merge main

This commit is contained in:
Bryce Miller 2023-06-05 20:21:44 -04:00
commit 29561372de
No known key found for this signature in database
GPG key ID: F1E97BF8DF152350
126 changed files with 3728 additions and 2429 deletions

View file

@ -17,15 +17,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Fetch releases data and save to file. Authorization is used to prevent rate limiting.
env:
AUTH_HEADER: 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}'
run: |
./ci/get_releases_json.sh
- run: curl -OL $(./ci/get_latest_release_url.sh linux_x86_64)
- run: curl -OL $(./ci/get_latest_release_url.sh macos_x86_64)
- run: curl -OL $(./ci/get_latest_release_url.sh macos_apple_silicon)
- run: curl -fOL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-linux_x86_64-latest.tar.gz
- run: curl -fOL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-macos_x86_64-latest.tar.gz
- run: curl -fOL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-macos_apple_silicon-latest.tar.gz
- name: Save roc_nightly archives
uses: actions/upload-artifact@v3
@ -171,10 +165,10 @@ jobs:
cd basic-cli-platform
mkdir examples
cd examples
curl -OL https://raw.githubusercontent.com/roc-lang/basic-cli/main/examples/http-get.roc
curl -fOL https://raw.githubusercontent.com/roc-lang/basic-cli/main/examples/http-get.roc
sed -i 's/pf:\ \"[^"]*/pf:\ \"\.\.\/main.roc/g' http-get.roc
cd ..
curl -OL https://raw.githubusercontent.com/roc-lang/basic-cli/main/ci/expect_scripts/http-get.exp
curl -fOL https://raw.githubusercontent.com/roc-lang/basic-cli/main/ci/expect_scripts/http-get.exp
- run: sudo apt install -y expect

View file

@ -10,15 +10,9 @@ jobs:
timeout-minutes: 90
steps:
- uses: actions/checkout@v3
- name: fetch releases data and save to file
run: curl https://api.github.com/repos/roc-lang/roc/releases > roc_releases.json
- name: get the url of today`s release for macos apple silicon
run: echo "RELEASE_URL=$(./ci/get_today_release_url.sh silicon)" >> $GITHUB_ENV
- name: Get the archive from the url.
run: curl -OL ${{ env.RELEASE_URL }}
- name: get the latest release archive
run: curl -fOL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-macos_apple_silicon-latest.tar.gz
- name: remove everything in this dir except the tar # we want to test like a user who would have downloaded the release, so we clean up all files from the repo checkout
run: ls | grep -v "roc_nightly.*tar\.gz" | xargs rm -rf

View file

@ -18,24 +18,13 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: fetch releases data and save to file
run: |
curl --request GET \
--url https://api.github.com/repos/roc-lang/roc/releases \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--output roc_releases.json
- name: get the url of today`s release for linux (x86_64)
- name: get the latest release archive for linux (x86_64)
if: startsWith(matrix.os, 'ubuntu')
run: echo "RELEASE_URL=$(./ci/get_today_release_url.sh linux_x86_64)" >> $GITHUB_ENV
run: curl -fOL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-linux_x86_64-latest.tar.gz
- name: get the url of today`s release for macos (x86_64)
- name: get the latest release archive for macos (x86_64)
if: startsWith(matrix.os, 'macos')
run: echo "RELEASE_URL=$(./ci/get_today_release_url.sh macos_x86_64)" >> $GITHUB_ENV
- name: get the archive from the url
run: curl -OL ${{ env.RELEASE_URL }}
run: curl -fOL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-macos_x86_64-latest.tar.gz
- name: remove everything in this dir except the tar # we want to test like a user who would have downloaded the release, so we clean up all files from the repo checkout
run: ls | grep -v "roc_nightly.*tar\.gz" | xargs rm -rf
@ -65,7 +54,7 @@ jobs:
- name: Install zig
run: |
curl -L -o zig.tar.xz https://ziglang.org/download/${ZIG_VERSION}/zig-${{env.OS_TYPE}}-x86_64-${ZIG_VERSION}.tar.xz && tar -xf zig.tar.xz
curl -fL -o zig.tar.xz https://ziglang.org/download/${ZIG_VERSION}/zig-${{env.OS_TYPE}}-x86_64-${ZIG_VERSION}.tar.xz && tar -xf zig.tar.xz
echo "${GITHUB_WORKSPACE}/zig-${{env.OS_TYPE}}-x86_64-${ZIG_VERSION}" >> $GITHUB_PATH
- name: zig version
run: zig version

View file

@ -24,7 +24,7 @@ jobs:
- name: download and install zig
run: |
curl.exe --output "C:\zig-windows-x86_64-0.9.1.zip" --url https://ziglang.org/download/0.9.1/zig-windows-x86_64-0.9.1.zip
curl.exe -f --output "C:\zig-windows-x86_64-0.9.1.zip" --url https://ziglang.org/download/0.9.1/zig-windows-x86_64-0.9.1.zip
cd C:\
7z x zig-windows-x86_64-0.9.1.zip
Add-Content $env:GITHUB_PATH "C:\zig-windows-x86_64-0.9.1\"
@ -37,7 +37,7 @@ jobs:
- name: set up llvm 13
run: |
curl.exe -L -O -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://github.com/roc-lang/llvm-package-windows/releases/download/v13.0.1/LLVM-13.0.1-win64.7z
curl.exe -f -L -O -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://github.com/roc-lang/llvm-package-windows/releases/download/v13.0.1/LLVM-13.0.1-win64.7z
7z x LLVM-13.0.1-win64.7z -oC:\LLVM-13.0.1-win64
- name: cargo build release. Twice for zig lld-link error.

View file

@ -28,7 +28,7 @@ jobs:
- name: download and install zig
run: |
curl.exe --output "C:\zig-windows-x86_64-0.9.1.zip" --url https://ziglang.org/download/0.9.1/zig-windows-x86_64-0.9.1.zip
curl.exe -f --output "C:\zig-windows-x86_64-0.9.1.zip" --url https://ziglang.org/download/0.9.1/zig-windows-x86_64-0.9.1.zip
cd C:\
7z x zig-windows-x86_64-0.9.1.zip
Add-Content $env:GITHUB_PATH "C:\zig-windows-x86_64-0.9.1\"
@ -41,7 +41,7 @@ jobs:
- name: set up llvm 13
run: |
curl.exe -L -O -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://github.com/roc-lang/llvm-package-windows/releases/download/v13.0.1/LLVM-13.0.1-win64.7z
curl.exe -f -L -O -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://github.com/roc-lang/llvm-package-windows/releases/download/v13.0.1/LLVM-13.0.1-win64.7z
7z x LLVM-13.0.1-win64.7z -oC:\LLVM-13.0.1-win64
- name: Build tests --release without running. Twice for zig lld-link error.

11
Cargo.lock generated
View file

@ -358,6 +358,16 @@ version = "3.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c6ed94e98ecff0c12dd1b04c15ec0d7d9458ca8fe806cea6f12954efe74c63b"
[[package]]
name = "byte-unit"
version = "4.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da78b32057b8fdfc352504708feeba7216dcd65a2c9ab02978cbd288d1279b6c"
dependencies = [
"serde",
"utf8-width",
]
[[package]]
name = "bytemuck"
version = "1.13.1"
@ -3850,6 +3860,7 @@ name = "roc_reporting"
version = "0.0.1"
dependencies = [
"bumpalo",
"byte-unit",
"distance",
"indoc",
"insta",

View file

@ -1,16 +0,0 @@
#!/usr/bin/env bash
# assumes roc_releases.json is present
# https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
set -euxo pipefail
LATEST_RELEASE_URL=`cat roc_releases.json | jq --arg arch $1 '.[0] | .assets | map(.browser_download_url) | map(select(. | contains("\($arch)-"))) | last'`
if [[ "$LATEST_RELEASE_URL" == "null" ]]
then
echo "I expected to get a url but I got null instead. The provided argument for this bash script may not have had any matches when used as arch in the jq query above."
exit 1
else
echo $LATEST_RELEASE_URL | sed s/\"//g
fi

View file

@ -1,12 +0,0 @@
#!/usr/bin/env bash
# retrieves roc_releases.json, expects AUTH_HEADER to be set
# https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
set -euxo pipefail
curl --request GET \
--url https://api.github.com/repos/roc-lang/roc/releases \
--header '$AUTH_HEADER' \
--header 'content-type: application/json' \
--output roc_releases.json

View file

@ -1,16 +0,0 @@
#!/usr/bin/env bash
# assumes roc_releases.json is present
# https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
set -euxo pipefail
TODAY_RELEASE_URL=`cat roc_releases.json | jq --arg arch $1 --arg today $(date +'%Y-%m-%d') '.[0] | .assets | map(.browser_download_url) | map(select(. | contains("\($arch)-\($today)"))) | .[0]'`
if [[ "$TODAY_RELEASE_URL" == "null" ]]
then
echo "I expected to get a url but I got null instead. Today's release may not have been uploaded?"
exit 1
else
echo $TODAY_RELEASE_URL | sed s/\"//g
fi

View file

@ -48,10 +48,6 @@ export fn roc_dealloc(c_ptr: *anyopaque, alignment: u32) callconv(.C) void {
free(@alignCast(16, @ptrCast([*]u8, c_ptr)));
}
export fn roc_memcpy(dst: [*]u8, src: [*]u8, size: usize) callconv(.C) void {
return memcpy(dst, src, size);
}
export fn roc_memset(dst: [*]u8, value: i32, size: usize) callconv(.C) void {
return memset(dst, value, size);
}

View file

@ -47,10 +47,6 @@ export fn roc_dealloc(c_ptr: *anyopaque, alignment: u32) callconv(.C) void {
free(@alignCast(16, @ptrCast([*]u8, c_ptr)));
}
export fn roc_memcpy(dst: [*]u8, src: [*]u8, size: usize) callconv(.C) void {
return memcpy(dst, src, size);
}
export fn roc_memset(dst: [*]u8, value: i32, size: usize) callconv(.C) void {
return memset(dst, value, size);
}

View file

@ -48,10 +48,6 @@ export fn roc_dealloc(c_ptr: *anyopaque, alignment: u32) callconv(.C) void {
free(@alignCast(16, @ptrCast([*]u8, c_ptr)));
}
export fn roc_memcpy(dst: [*]u8, src: [*]u8, size: usize) callconv(.C) void {
return memcpy(dst, src, size);
}
export fn roc_memset(dst: [*]u8, value: i32, size: usize) callconv(.C) void {
return memset(dst, value, size);
}

View file

@ -73,10 +73,6 @@ export fn roc_panic(c_ptr: *anyopaque, tag_id: u32) callconv(.C) void {
std.process.exit(0);
}
export fn roc_memcpy(dst: [*]u8, src: [*]u8, size: usize) callconv(.C) void {
return memcpy(dst, src, size);
}
export fn roc_memset(dst: [*]u8, value: i32, size: usize) callconv(.C) void {
return memset(dst, value, size);
}

View file

@ -72,10 +72,6 @@ export fn roc_panic(c_ptr: *anyopaque, tag_id: u32) callconv(.C) void {
std.process.exit(0);
}
export fn roc_memcpy(dst: [*]u8, src: [*]u8, size: usize) callconv(.C) void {
return memcpy(dst, src, size);
}
export fn roc_memset(dst: [*]u8, value: i32, size: usize) callconv(.C) void {
return memset(dst, value, size);
}

View file

@ -77,10 +77,6 @@ export fn roc_panic(c_ptr: *anyopaque, tag_id: u32) callconv(.C) void {
std.process.exit(0);
}
export fn roc_memcpy(dst: [*]u8, src: [*]u8, size: usize) callconv(.C) void {
return memcpy(dst, src, size);
}
export fn roc_memset(dst: [*]u8, value: i32, size: usize) callconv(.C) void {
return memset(dst, value, size);
}

View file

@ -67,10 +67,6 @@ export fn roc_panic(c_ptr: *anyopaque, tag_id: u32) callconv(.C) void {
std.process.exit(0);
}
export fn roc_memcpy(dst: [*]u8, src: [*]u8, size: usize) callconv(.C) void {
return memcpy(dst, src, size);
}
export fn roc_memset(dst: [*]u8, value: i32, size: usize) callconv(.C) void {
return memset(dst, value, size);
}

View file

@ -0,0 +1,80 @@
const std = @import("std");
const builtin = @import("builtin");
const arch = builtin.cpu.arch;
const musl = @import("libc/musl.zig");
const folly = @import("libc/folly.zig");
const cpuid = @import("libc/cpuid.zig");
comptime {
// TODO: remove this workaround.
// Our wasm llvm pipeline always links in memcpy.
// As such, our impl will conflict.
if (arch != .wasm32) {
@export(memcpy, .{ .name = "memcpy", .linkage = .Strong });
}
}
const Memcpy = fn (noalias [*]u8, noalias [*]const u8, len: usize) callconv(.C) [*]u8;
pub var memcpy_target: Memcpy = switch (arch) {
.x86_64 => dispatch_memcpy,
else => unreachable,
};
pub fn memcpy(noalias dest: [*]u8, noalias src: [*]const u8, len: usize) callconv(.C) [*]u8 {
switch (arch) {
// x86_64 has a special optimized memcpy that can use avx2.
.x86_64 => {
return memcpy_target(dest, src, len);
},
else => {
return musl.memcpy(dest, src, len);
},
}
}
const MemcpyDecision = enum {
uninitialized,
folly_prefetchw,
folly_prefetcht0,
musl,
};
var memcpy_decision: MemcpyDecision = .uninitialized;
fn dispatch_memcpy(noalias dest: [*]u8, noalias src: [*]const u8, len: usize) callconv(.C) [*]u8 {
switch (arch) {
.x86_64 => {
// TODO: Switch this to overwrite the memcpy_target pointer once the surgical linker can support it.
// Then dispatch will just happen on the first call instead of every call.
// if (cpuid.supports_avx2()) {
// if (cpuid.supports_prefetchw()) {
// memcpy_target = folly.memcpy_prefetchw;
// } else {
// memcpy_target = folly.memcpy_prefetcht0;
// }
// } else {
// memcpy_target = musl.memcpy;
// }
// return memcpy_target(dest, src, len);
switch (memcpy_decision) {
.uninitialized => {
if (cpuid.supports_avx2()) {
if (cpuid.supports_prefetchw()) {
memcpy_decision = .folly_prefetchw;
} else {
memcpy_decision = .folly_prefetcht0;
}
} else {
memcpy_decision = .musl;
}
return dispatch_memcpy(dest, src, len);
},
.folly_prefetchw => return folly.memcpy_prefetchw(dest, src, len),
.folly_prefetcht0 => return folly.memcpy_prefetcht0(dest, src, len),
.musl => return musl.memcpy(dest, src, len),
}
},
else => unreachable,
}
}

View file

@ -0,0 +1,7 @@
const builtin = @import("builtin");
const os = builtin.os;
pub const function_prefix = switch (os.tag) {
.macos => "_",
else => "",
};

View file

@ -0,0 +1,53 @@
// Check if AVX2 is supported.
// Returns 1 if AVX2 is supported, 0 otherwise.
.global {[function_prefix]s}supports_avx2;
{[function_prefix]s}supports_avx2:
// Save the EBX register.
push %rbx
// Call the CPUID instruction with the EAX register set to 7 and ECX set to 0.
// This will get the CPUID information for the current CPU.
mov $7, %eax
mov $0, %ecx
cpuid
// The AVX2 feature flag is located in the EBX register at bit 5.
bt $5, %ebx
jc .avx2_supported
// AVX2 is not supported.
pop %rbx
mov $0, %eax
ret
.avx2_supported:
pop %rbx
mov $1, %eax
ret
// Check if prefetchw is supported.
// Returns 1 if the prefetchw instruction is supported, 0 otherwise.
.global {[function_prefix]s}supports_prefetchw;
{[function_prefix]s}supports_prefetchw:
// Save the EBX register.
push %rbx
// Call the CPUID instruction with the EAX register set to 0x80000001 and ECX set to 0.
// This will get the CPUID information for the current CPU.
mov $0x80000001, %eax
mov $0, %ecx
cpuid
// The prefetchw feature flag is located in the ECX register at bit 8.
bt $8, %ecx
jc .prefetchw_supported
// AVX2 is not supported.
pop %rbx
mov $0, %eax
ret
.prefetchw_supported:
pop %rbx
mov $1, %eax
ret

View file

@ -0,0 +1,18 @@
const std = @import("std");
const builtin = @import("builtin");
const arch = builtin.cpu.arch;
const function_prefix = @import("assembly_util.zig").function_prefix;
// I couldn't manage to define this in a PIE friendly way with inline assembly.
// Instead, I am defining it as global assembly functions.
comptime {
switch (arch) {
.x86_64 => {
asm (std.fmt.comptimePrint(@embedFile("cpuid.S"), .{ .function_prefix = function_prefix }));
},
else => unreachable,
}
}
pub extern fn supports_avx2() bool;
pub extern fn supports_prefetchw() bool;

View file

@ -0,0 +1,2 @@
pub const memcpy_prefetchw = @import("folly/memcpy.zig").__folly_memcpy_prefetchw;
pub const memcpy_prefetcht0 = @import("folly/memcpy.zig").__folly_memcpy_prefetcht0;

View file

@ -0,0 +1,437 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
*/
/*
* __folly_memcpy: An optimized memcpy implementation that uses prefetch and
* AVX2 instructions.
*
* This implementation of memcpy acts as a memmove: while overlapping copies
* are undefined in memcpy, in some implementations they're the same function and
* legacy programs rely on this behavior.
*
* This implementation uses prefetch to avoid dtlb misses. This can
* substantially reduce dtlb store misses in cases where the destination
* location is absent from L1 cache and where the copy size is small enough
* that the hardware prefetcher doesn't have a large impact.
*
* The number of branches is limited by the use of overlapping loads & stores.
* This helps with copies where the source and destination cache lines are already
* present in L1 because there are fewer instructions to execute and fewer
* branches to potentially mispredict.
* e.g. to copy the last 4 <= n <= 7 bytes: copy the first & last 4 bytes (overlapped):
* movl (%rsi), %r8d
* movl -4(%rsi,%rdx), %r9d
* movl %r8d, (%rdi)
* movl %r9d, -4(%rdi,%rdx)
*
*
* For sizes up to 256 all source data is first read into registers and then written:
* - n <= 16: overlapping movs
* - n <= 32: overlapping unaligned 16-byte SSE XMM load/stores
* - n <= 256: overlapping unaligned 32-byte AVX YMM load/stores
*
* Large copies (> 256 bytes) use unaligned loads + aligned stores.
* This is observed to always be faster than rep movsb, so the rep movsb
* instruction is not used.
* - The head & tail may be unaligned => they're always written using unaligned stores.
*
* If the copy size is humongous (> 32 KiB) and the source and destination are both
* aligned, this memcpy will use non-temporal operations (AVX2). This can have
* a substantial speedup for copies where data is absent from L1, but it
* is significantly slower if the source and destination data were already
* in L1. The use of non-temporal operations also has the effect that after
* the copy is complete, the data will be moved out of L1, even if the data was
* present before the copy started.
*
* For n > 256 and overlapping src & dst buffers (memmove):
* - use unaligned loads + aligned stores, but not non-temporal stores
* - for dst < src forward copy in 128 byte batches:
* - unaligned load the first 32 bytes & last 4 x 32 bytes
* - forward copy (unaligned load + aligned stores) 4 x 32 bytes at a time
* - unaligned store the first 32 bytes & last 4 x 32 bytes
* - for dst > src backward copy in 128 byte batches:
* - unaligned load the first 4 x 32 bytes & last 32 bytes
* - backward copy (unaligned load + aligned stores) 4 x 32 bytes at a time
* - unaligned store the first 4 x 32 bytes & last 32 bytes
*
* @author Logan Evans <lpe@fb.com>
*/
// .type {[function_prefix]s}__folly_memcpy_short_{[prefetch]s}, @function not supported by windows
{[function_prefix]s}__folly_memcpy_short_{[prefetch]s}:
.cfi_startproc
.L_GE1_LE7_{[prefetch]s}:
cmp $1, %rdx
je .L_EQ1_{[prefetch]s}
cmp $4, %rdx
jae .L_GE4_LE7_{[prefetch]s}
.L_GE2_LE3_{[prefetch]s}:
movw (%rsi), %r8w
movw -2(%rsi,%rdx), %r9w
movw %r8w, (%rdi)
movw %r9w, -2(%rdi,%rdx)
ret
.balign 2
.L_EQ1_{[prefetch]s}:
movb (%rsi), %r8b
movb %r8b, (%rdi)
ret
// Aligning the target of a jump to an even address has a measurable
// speedup in microbenchmarks.
.balign 2
.L_GE4_LE7_{[prefetch]s}:
movl (%rsi), %r8d
movl -4(%rsi,%rdx), %r9d
movl %r8d, (%rdi)
movl %r9d, -4(%rdi,%rdx)
ret
.cfi_endproc
// .size {[function_prefix]s}__folly_memcpy_short_{[prefetch]s}, .-{[function_prefix]s}__folly_memcpy_short_{[prefetch]s} not supported by windows
// memcpy is an alternative entrypoint into the function named __folly_memcpy.
// The compiler is able to call memcpy since the name is global while
// stacktraces will show __folly_memcpy since that is the name of the function.
// This is intended to aid in debugging by making it obvious which version of
// memcpy is being used.
.balign 64
.globl {[function_prefix]s}__folly_memcpy_{[prefetch]s}
// .type {[function_prefix]s}__folly_memcpy_{[prefetch]s}, @function not supported by windows
{[function_prefix]s}__folly_memcpy_{[prefetch]s}:
.cfi_startproc
mov %rdi, %rax // return: $rdi
test %rdx, %rdx
je .L_EQ0_{[prefetch]s}
{[prefetch]s} (%rdi)
{[prefetch]s} -1(%rdi,%rdx)
cmp $8, %rdx
jb .L_GE1_LE7_{[prefetch]s}
.L_GE8_{[prefetch]s}:
cmp $32, %rdx
ja .L_GE33_{[prefetch]s}
.L_GE8_LE32_{[prefetch]s}:
cmp $16, %rdx
ja .L_GE17_LE32_{[prefetch]s}
.L_GE8_LE16_{[prefetch]s}:
mov (%rsi), %r8
mov -8(%rsi,%rdx), %r9
mov %r8, (%rdi)
mov %r9, -8(%rdi,%rdx)
.L_EQ0_{[prefetch]s}:
ret
.balign 2
.L_GE17_LE32_{[prefetch]s}:
movdqu (%rsi), %xmm0
movdqu -16(%rsi,%rdx), %xmm1
movdqu %xmm0, (%rdi)
movdqu %xmm1, -16(%rdi,%rdx)
ret
.balign 2
.L_GE193_LE256_{[prefetch]s}:
vmovdqu %ymm3, 96(%rdi)
vmovdqu %ymm4, -128(%rdi,%rdx)
.L_GE129_LE192_{[prefetch]s}:
vmovdqu %ymm2, 64(%rdi)
vmovdqu %ymm5, -96(%rdi,%rdx)
.L_GE65_LE128_{[prefetch]s}:
vmovdqu %ymm1, 32(%rdi)
vmovdqu %ymm6, -64(%rdi,%rdx)
.L_GE33_LE64_{[prefetch]s}:
vmovdqu %ymm0, (%rdi)
vmovdqu %ymm7, -32(%rdi,%rdx)
vzeroupper
ret
.balign 2
.L_GE33_{[prefetch]s}:
vmovdqu (%rsi), %ymm0
vmovdqu -32(%rsi,%rdx), %ymm7
cmp $64, %rdx
jbe .L_GE33_LE64_{[prefetch]s}
{[prefetch]s} 64(%rdi)
vmovdqu 32(%rsi), %ymm1
vmovdqu -64(%rsi,%rdx), %ymm6
cmp $128, %rdx
jbe .L_GE65_LE128_{[prefetch]s}
{[prefetch]s} 128(%rdi)
vmovdqu 64(%rsi), %ymm2
vmovdqu -96(%rsi,%rdx), %ymm5
cmp $192, %rdx
jbe .L_GE129_LE192_{[prefetch]s}
{[prefetch]s} 192(%rdi)
vmovdqu 96(%rsi), %ymm3
vmovdqu -128(%rsi,%rdx), %ymm4
cmp $256, %rdx
jbe .L_GE193_LE256_{[prefetch]s}
.L_GE257_{[prefetch]s}:
{[prefetch]s} 256(%rdi)
// Check if there is an overlap. If there is an overlap then the caller
// has a bug since this is undefined behavior. However, for legacy
// reasons this behavior is expected by some callers.
//
// All copies through 256 bytes will operate as a memmove since for
// those sizes all reads are performed before any writes.
//
// This check uses the idea that there is an overlap if
// (%rdi < (%rsi + %rdx)) && (%rsi < (%rdi + %rdx)),
// or equivalently, there is no overlap if
// ((%rsi + %rdx) <= %rdi) || ((%rdi + %rdx) <= %rsi).
//
// %r9 will be used after .L_ALIGNED_DST_LOOP to calculate how many
// bytes remain to be copied.
// (%rsi + %rdx <= %rdi) => no overlap
lea (%rsi,%rdx), %r9
cmp %rdi, %r9
jbe .L_NO_OVERLAP_{[prefetch]s}
// (%rdi + %rdx <= %rsi) => no overlap
lea (%rdi,%rdx), %r8
cmp %rsi, %r8
// If no info is available in branch predictor's cache, Intel CPUs assume
// forward jumps are not taken. Use a forward jump as overlapping buffers
// are unlikely.
ja .L_OVERLAP_{[prefetch]s}
.balign 2
.L_NO_OVERLAP_{[prefetch]s}:
vmovdqu %ymm0, (%rdi)
vmovdqu %ymm1, 32(%rdi)
vmovdqu %ymm2, 64(%rdi)
vmovdqu %ymm3, 96(%rdi)
// Align %rdi to a 32 byte boundary.
// %rcx = 128 - 31 & %rdi
mov $128, %rcx
and $31, %rdi
sub %rdi, %rcx
lea (%rsi,%rcx), %rsi
lea (%rax,%rcx), %rdi
sub %rcx, %rdx
// %r8 is the end condition for the loop.
lea -128(%rsi,%rdx), %r8
// This threshold is half of L1 cache on a Skylake machine, which means that
// potentially all of L1 will be populated by this copy once it is executed
// (dst and src are cached for temporal copies).
// NON_TEMPORAL_STORE_THRESHOLD = $32768
// cmp NON_TEMPORAL_STORE_THRESHOLD, %rdx
cmp $32768, %rdx
jae .L_NON_TEMPORAL_LOOP_{[prefetch]s}
.balign 2
.L_ALIGNED_DST_LOOP_{[prefetch]s}:
{[prefetch]s} 128(%rdi)
{[prefetch]s} 192(%rdi)
vmovdqu (%rsi), %ymm0
vmovdqu 32(%rsi), %ymm1
vmovdqu 64(%rsi), %ymm2
vmovdqu 96(%rsi), %ymm3
add $128, %rsi
vmovdqa %ymm0, (%rdi)
vmovdqa %ymm1, 32(%rdi)
vmovdqa %ymm2, 64(%rdi)
vmovdqa %ymm3, 96(%rdi)
add $128, %rdi
cmp %r8, %rsi
jb .L_ALIGNED_DST_LOOP_{[prefetch]s}
.L_ALIGNED_DST_LOOP_END_{[prefetch]s}:
sub %rsi, %r9
mov %r9, %rdx
vmovdqu %ymm4, -128(%rdi,%rdx)
vmovdqu %ymm5, -96(%rdi,%rdx)
vmovdqu %ymm6, -64(%rdi,%rdx)
vmovdqu %ymm7, -32(%rdi,%rdx)
vzeroupper
ret
.balign 2
.L_NON_TEMPORAL_LOOP_{[prefetch]s}:
testb $31, %sil
jne .L_ALIGNED_DST_LOOP_{[prefetch]s}
// This is prefetching the source data unlike ALIGNED_DST_LOOP which
// prefetches the destination data. This choice is again informed by
// benchmarks. With a non-temporal store the entirety of the cache line
// is being written so the previous data can be discarded without being
// fetched.
prefetchnta 128(%rsi)
prefetchnta 196(%rsi)
vmovntdqa (%rsi), %ymm0
vmovntdqa 32(%rsi), %ymm1
vmovntdqa 64(%rsi), %ymm2
vmovntdqa 96(%rsi), %ymm3
add $128, %rsi
vmovntdq %ymm0, (%rdi)
vmovntdq %ymm1, 32(%rdi)
vmovntdq %ymm2, 64(%rdi)
vmovntdq %ymm3, 96(%rdi)
add $128, %rdi
cmp %r8, %rsi
jb .L_NON_TEMPORAL_LOOP_{[prefetch]s}
sfence
jmp .L_ALIGNED_DST_LOOP_END_{[prefetch]s}
.L_OVERLAP_{[prefetch]s}:
.balign 2
cmp %rdi, %rsi
jb .L_OVERLAP_BWD_{[prefetch]s} // %rsi < %rdi => backward-copy
je .L_RET_{[prefetch]s} // %rsi == %rdi => return, nothing to copy
// Source & destination buffers overlap. Forward copy.
vmovdqu (%rsi), %ymm8
// Align %rdi to a 32 byte boundary.
// %rcx = 32 - 31 & %rdi
mov $32, %rcx
and $31, %rdi
sub %rdi, %rcx
lea (%rsi,%rcx), %rsi
lea (%rax,%rcx), %rdi
sub %rcx, %rdx
// %r8 is the end condition for the loop.
lea -128(%rsi,%rdx), %r8
.L_OVERLAP_FWD_ALIGNED_DST_LOOP_{[prefetch]s}:
{[prefetch]s} 128(%rdi)
{[prefetch]s} 192(%rdi)
vmovdqu (%rsi), %ymm0
vmovdqu 32(%rsi), %ymm1
vmovdqu 64(%rsi), %ymm2
vmovdqu 96(%rsi), %ymm3
add $128, %rsi
vmovdqa %ymm0, (%rdi)
vmovdqa %ymm1, 32(%rdi)
vmovdqa %ymm2, 64(%rdi)
vmovdqa %ymm3, 96(%rdi)
add $128, %rdi
cmp %r8, %rsi
jb .L_OVERLAP_FWD_ALIGNED_DST_LOOP_{[prefetch]s}
sub %rsi, %r9
mov %r9, %rdx
vmovdqu %ymm4, -128(%rdi,%rdx)
vmovdqu %ymm5, -96(%rdi,%rdx)
vmovdqu %ymm6, -64(%rdi,%rdx)
vmovdqu %ymm7, -32(%rdi,%rdx)
vmovdqu %ymm8, (%rax) // %rax == the original (unaligned) %rdi
vzeroupper
.L_RET_{[prefetch]s}:
ret
.L_OVERLAP_BWD_{[prefetch]s}:
// Save last 32 bytes.
vmovdqu -32(%rsi, %rdx), %ymm8
lea -32(%rdi, %rdx), %r9
// %r8 is the end condition for the loop.
lea 128(%rsi), %r8
// Align %rdi+%rdx (destination end) to a 32 byte boundary.
// %rcx = (%rdi + %rdx - 32) & 31
mov %r9, %rcx
and $31, %rcx
// Set %rsi & %rdi to the end of the 32 byte aligned range.
sub %rcx, %rdx
add %rdx, %rsi
add %rdx, %rdi
.L_OVERLAP_BWD_ALIGNED_DST_LOOP_{[prefetch]s}:
{[prefetch]s} -128(%rdi)
{[prefetch]s} -192(%rdi)
vmovdqu -32(%rsi), %ymm4
vmovdqu -64(%rsi), %ymm5
vmovdqu -96(%rsi), %ymm6
vmovdqu -128(%rsi), %ymm7
sub $128, %rsi
vmovdqa %ymm4, -32(%rdi)
vmovdqa %ymm5, -64(%rdi)
vmovdqa %ymm6, -96(%rdi)
vmovdqa %ymm7, -128(%rdi)
sub $128, %rdi
cmp %r8, %rsi
ja .L_OVERLAP_BWD_ALIGNED_DST_LOOP_{[prefetch]s}
vmovdqu %ymm0, (%rax) // %rax == the original unaligned %rdi
vmovdqu %ymm1, 32(%rax)
vmovdqu %ymm2, 64(%rax)
vmovdqu %ymm3, 96(%rax)
vmovdqu %ymm8, (%r9)
vzeroupper
ret
.cfi_endproc
// .size {[function_prefix]s}__folly_memcpy_{[prefetch]s}, .-{[function_prefix]s}__folly_memcpy_{[prefetch]s} not supported by windows

View file

@ -0,0 +1,18 @@
const std = @import("std");
const builtin = @import("builtin");
const arch = builtin.cpu.arch;
const function_prefix = @import("../assembly_util.zig").function_prefix;
comptime {
switch (arch) {
.x86_64 => {
inline for ([_][]const u8{ "prefetchw", "prefetcht0" }) |prefetch| {
asm (std.fmt.comptimePrint(@embedFile("memcpy-x86_64.S"), .{ .prefetch = prefetch, .function_prefix = function_prefix }));
}
},
else => unreachable,
}
}
pub extern fn __folly_memcpy_prefetchw(noalias dest: [*]u8, noalias src: [*]const u8, len: usize) callconv(.C) [*]u8;
pub extern fn __folly_memcpy_prefetcht0(noalias dest: [*]u8, noalias src: [*]const u8, len: usize) callconv(.C) [*]u8;

View file

@ -0,0 +1 @@
pub const memcpy = @import("musl/memcpy.zig").memcpy;

View file

@ -0,0 +1,193 @@
musl as a whole is licensed under the following standard MIT license:
----------------------------------------------------------------------
Copyright © 2005-2020 Rich Felker, et al.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
----------------------------------------------------------------------
Authors/contributors include:
A. Wilcox
Ada Worcester
Alex Dowad
Alex Suykov
Alexander Monakov
Andre McCurdy
Andrew Kelley
Anthony G. Basile
Aric Belsito
Arvid Picciani
Bartosz Brachaczek
Benjamin Peterson
Bobby Bingham
Boris Brezillon
Brent Cook
Chris Spiegel
Clément Vasseur
Daniel Micay
Daniel Sabogal
Daurnimator
David Carlier
David Edelsohn
Denys Vlasenko
Dmitry Ivanov
Dmitry V. Levin
Drew DeVault
Emil Renner Berthing
Fangrui Song
Felix Fietkau
Felix Janda
Gianluca Anzolin
Hauke Mehrtens
He X
Hiltjo Posthuma
Isaac Dunham
Jaydeep Patil
Jens Gustedt
Jeremy Huntwork
Jo-Philipp Wich
Joakim Sindholt
John Spencer
Julien Ramseier
Justin Cormack
Kaarle Ritvanen
Khem Raj
Kylie McClain
Leah Neukirchen
Luca Barbato
Luka Perkov
M Farkas-Dyck (Strake)
Mahesh Bodapati
Markus Wichmann
Masanori Ogino
Michael Clark
Michael Forney
Mikhail Kremnyov
Natanael Copa
Nicholas J. Kain
orc
Pascal Cuoq
Patrick Oppenlander
Petr Hosek
Petr Skocik
Pierre Carrier
Reini Urban
Rich Felker
Richard Pennington
Ryan Fairfax
Samuel Holland
Segev Finer
Shiz
sin
Solar Designer
Stefan Kristiansson
Stefan O'Rear
Szabolcs Nagy
Timo Teräs
Trutz Behn
Valentin Ochs
Will Dietz
William Haddon
William Pitcock
Portions of this software are derived from third-party works licensed
under terms compatible with the above MIT license:
The TRE regular expression implementation (src/regex/reg* and
src/regex/tre*) is Copyright © 2001-2008 Ville Laurikari and licensed
under a 2-clause BSD license (license text in the source files). The
included version has been heavily modified by Rich Felker in 2012, in
the interests of size, simplicity, and namespace cleanliness.
Much of the math library code (src/math/* and src/complex/*) is
Copyright © 1993,2004 Sun Microsystems or
Copyright © 2003-2011 David Schultz or
Copyright © 2003-2009 Steven G. Kargl or
Copyright © 2003-2009 Bruce D. Evans or
Copyright © 2008 Stephen L. Moshier or
Copyright © 2017-2018 Arm Limited
and labelled as such in comments in the individual source files. All
have been licensed under extremely permissive terms.
The ARM memcpy code (src/string/arm/memcpy.S) is Copyright © 2008
The Android Open Source Project and is licensed under a two-clause BSD
license. It was taken from Bionic libc, used on Android.
The AArch64 memcpy and memset code (src/string/aarch64/*) are
Copyright © 1999-2019, Arm Limited.
The implementation of DES for crypt (src/crypt/crypt_des.c) is
Copyright © 1994 David Burren. It is licensed under a BSD license.
The implementation of blowfish crypt (src/crypt/crypt_blowfish.c) was
originally written by Solar Designer and placed into the public
domain. The code also comes with a fallback permissive license for use
in jurisdictions that may not recognize the public domain.
The smoothsort implementation (src/stdlib/qsort.c) is Copyright © 2011
Valentin Ochs and is licensed under an MIT-style license.
The x86_64 port was written by Nicholas J. Kain and is licensed under
the standard MIT terms.
The mips and microblaze ports were originally written by Richard
Pennington for use in the ellcc project. The original code was adapted
by Rich Felker for build system and code conventions during upstream
integration. It is licensed under the standard MIT terms.
The mips64 port was contributed by Imagination Technologies and is
licensed under the standard MIT terms.
The powerpc port was also originally written by Richard Pennington,
and later supplemented and integrated by John Spencer. It is licensed
under the standard MIT terms.
All other files which have no copyright comments are original works
produced specifically for use as part of this library, written either
by Rich Felker, the main author of the library, or by one or more
contibutors listed above. Details on authorship of individual files
can be found in the git version control history of the project. The
omission of copyright and license comments in each file is in the
interest of source tree size.
In addition, permission is hereby granted for all public header files
(include/* and arch/*/bits/*) and crt files intended to be linked into
applications (crt/*, ldso/dlstart.c, and arch/*/crt_arch.h) to omit
the copyright notice and permission notice otherwise required by the
license, and to use these files without any requirement of
attribution. These files include substantial contributions from:
Bobby Bingham
John Spencer
Nicholas J. Kain
Rich Felker
Richard Pennington
Stefan Kristiansson
Szabolcs Nagy
all of whom have explicitly granted such permission.
This file previously contained text expressing a belief that most of
the files covered by the above exception were sufficiently trivial not
to be subject to copyright, resulting in confusion over whether it
negated the permissions granted in the license. In the spirit of
permissive licensing, and of not having licensing issues being an
obstacle to adoption, that text has been removed.

View file

@ -0,0 +1,2 @@
This set of files all come from [musl libc](https://musl.libc.org/).
Roc just directly uses a few of them instead of depending on musl libc fully.

View file

@ -0,0 +1,30 @@
.global {[function_prefix]s}musl_memcpy
// Windows does not support the type directive.
// .type {[function_prefix]s}musl_memcpy,@function
{[function_prefix]s}musl_memcpy:
push %esi
push %edi
mov 12(%esp),%edi
mov 16(%esp),%esi
mov 20(%esp),%ecx
mov %edi,%eax
cmp $4,%ecx
jc 1f
test $3,%edi
jz 1f
2: movsb
dec %ecx
test $3,%edi
jnz 2b
1: mov %ecx,%edx
shr $2,%ecx
rep
movsl
and $3,%edx
jz 1f
2: movsb
dec %edx
jnz 2b
1: pop %edi
pop %esi
ret

View file

@ -0,0 +1,23 @@
.global {[function_prefix]s}musl_memcpy
// Windows does not support the type directive.
// .type {[function_prefix]s}musl_memcpy,@function
{[function_prefix]s}musl_memcpy:
mov %rdi,%rax
cmp $8,%rdx
jc 1f
test $7,%edi
jz 1f
2: movsb
dec %rdx
test $7,%edi
jnz 2b
1: mov %rdx,%rcx
shr $3,%rcx
rep
movsq
and $7,%edx
jz 1f
2: movsb
dec %edx
jnz 2b
1: ret

View file

@ -0,0 +1,201 @@
const std = @import("std");
const builtin = @import("builtin");
const arch = builtin.cpu.arch;
const function_prefix = @import("../assembly_util.zig").function_prefix;
comptime {
switch (arch) {
.x86_64 => {
asm (std.fmt.comptimePrint(@embedFile("memcpy-x86_64.S"), .{ .function_prefix = function_prefix }));
},
.i386 => {
asm (std.fmt.comptimePrint(@embedFile("memcpy-i386.S"), .{ .function_prefix = function_prefix }));
},
// TODO: add assembly implementations for other platforms.
else => {},
}
}
pub const memcpy =
switch (arch) {
.x86_64, .i386 => musl_memcpy,
else => fallback_memcpy,
};
pub extern fn musl_memcpy(noalias dest: [*]u8, noalias src: [*]const u8, len: usize) callconv(.C) [*]u8;
// Note: this is written to only support little endian targets.
// To support big endian, `<<` and `>>` wold need to be swapped.
pub fn fallback_memcpy(noalias dest: [*]u8, noalias src: [*]const u8, len: usize) callconv(.C) [*]u8 {
var d = dest;
var s = src;
var n = len;
while (@ptrToInt(s) % 4 != 0 and n != 0) : (n -= 1) {
d[0] = s[0];
d += 1;
s += 1;
}
if (@ptrToInt(d) % 4 == 0) {
var d4 = @alignCast(4, d);
var s4 = @alignCast(4, s);
while (n >= 16) : (n -= 16) {
var d_u32 = @ptrCast([*]u32, d4);
var s_u32 = @ptrCast([*]const u32, s4);
d_u32[0] = s_u32[0];
d_u32[1] = s_u32[1];
d_u32[2] = s_u32[2];
d_u32[3] = s_u32[3];
d4 += 16;
s4 += 16;
}
if (n & 8 != 0) {
var d_u32 = @ptrCast([*]u32, d4);
var s_u32 = @ptrCast([*]const u32, s4);
d_u32[0] = s_u32[0];
d_u32[1] = s_u32[1];
d4 += 8;
s4 += 8;
}
if (n & 4 != 0) {
var d_u32 = @ptrCast([*]u32, d4);
var s_u32 = @ptrCast([*]const u32, s4);
d_u32[0] = s_u32[0];
d4 += 4;
s4 += 4;
}
d = d4;
s = s4;
if (n & 2 != 0) {
d[0] = s[0];
d += 1;
s += 1;
d[0] = s[0];
d += 1;
s += 1;
}
if (n & 1 != 0) {
d[0] = s[0];
}
return dest;
}
if (n >= 32) {
switch (@ptrToInt(d) % 4) {
1 => {
var w = @ptrCast([*]const u32, @alignCast(4, s))[0];
d[0] = s[0];
d += 1;
s += 1;
d[0] = s[0];
d += 1;
s += 1;
d[0] = s[0];
d += 1;
s += 1;
n -= 3;
while (n >= 17) : (n -= 16) {
var d_u32 = @ptrCast([*]u32, @alignCast(4, d));
var s_u32 = @ptrCast([*]const u32, @alignCast(4, s + 1));
var x = s_u32[0];
d_u32[0] = (w >> 24) | (x << 8);
w = s_u32[1];
d_u32[1] = (x >> 24) | (w << 8);
x = s_u32[2];
d_u32[2] = (w >> 24) | (x << 8);
w = s_u32[3];
d_u32[3] = (x >> 24) | (w << 8);
d += 16;
s += 16;
}
},
2 => {
var w = @ptrCast([*]const u32, @alignCast(4, s))[0];
d[0] = s[0];
d += 1;
s += 1;
d[0] = s[0];
d += 1;
s += 1;
n -= 2;
while (n >= 18) : (n -= 16) {
var d_u32 = @ptrCast([*]u32, @alignCast(4, d));
var s_u32 = @ptrCast([*]const u32, @alignCast(4, s + 2));
var x = s_u32[0];
d_u32[0] = (w >> 16) | (x << 16);
w = s_u32[1];
d_u32[1] = (x >> 16) | (w << 16);
x = s_u32[2];
d_u32[2] = (w >> 16) | (x << 16);
w = s_u32[3];
d_u32[3] = (x >> 16) | (w << 16);
d += 16;
s += 16;
}
},
3 => {
var w = @ptrCast([*]const u32, @alignCast(4, s))[0];
d[0] = s[0];
d += 1;
s += 1;
n -= 1;
while (n >= 19) : (n -= 16) {
var d_u32 = @ptrCast([*]u32, @alignCast(4, d));
var s_u32 = @ptrCast([*]const u32, @alignCast(4, s + 3));
var x = s_u32[0];
d_u32[0] = (w >> 8) | (x << 24);
w = s_u32[1];
d_u32[1] = (x >> 8) | (w << 24);
x = s_u32[2];
d_u32[2] = (w >> 8) | (x << 24);
w = s_u32[3];
d_u32[3] = (x >> 8) | (w << 24);
d += 16;
s += 16;
}
},
else => unreachable,
}
}
if (n & 16 != 0) {
comptime var i = 0;
inline while (i < 16) : (i += 1) {
d[0] = s[0];
d += 1;
s += 1;
}
}
if (n & 8 != 0) {
comptime var i = 0;
inline while (i < 8) : (i += 1) {
d[0] = s[0];
d += 1;
s += 1;
}
}
if (n & 4 != 0) {
comptime var i = 0;
inline while (i < 4) : (i += 1) {
d[0] = s[0];
d += 1;
s += 1;
}
}
if (n & 2 != 0) {
d[0] = s[0];
d += 1;
s += 1;
d[0] = s[0];
d += 1;
s += 1;
}
if (n & 1 != 0) {
d[0] = s[0];
}
return dest;
}

View file

@ -7,6 +7,7 @@ const panic_utils = @import("panic.zig");
comptime {
_ = @import("compiler_rt.zig");
_ = @import("libc.zig");
}
const ROC_BUILTINS = "roc_builtins";

View file

@ -19,9 +19,6 @@ extern fn roc_realloc(c_ptr: *anyopaque, new_size: usize, old_size: usize, align
// This should never be passed a null pointer.
extern fn roc_dealloc(c_ptr: *anyopaque, alignment: u32) callconv(.C) void;
// should work just like libc memcpy (we can't assume libc is present)
extern fn roc_memcpy(dst: [*]u8, src: [*]u8, size: usize) callconv(.C) void;
extern fn kill(pid: c_int, sig: c_int) c_int;
extern fn shm_open(name: *const i8, oflag: c_int, mode: c_uint) c_int;
extern fn mmap(addr: ?*anyopaque, length: c_uint, prot: c_int, flags: c_int, fd: c_int, offset: c_uint) *anyopaque;
@ -49,7 +46,6 @@ comptime {
@export(testing_roc_realloc, .{ .name = "roc_realloc", .linkage = .Strong });
@export(testing_roc_dealloc, .{ .name = "roc_dealloc", .linkage = .Strong });
@export(testing_roc_panic, .{ .name = "roc_panic", .linkage = .Strong });
@export(testing_roc_memcpy, .{ .name = "roc_memcpy", .linkage = .Strong });
if (builtin.os.tag == .macos or builtin.os.tag == .linux) {
@export(testing_roc_getppid, .{ .name = "roc_getppid", .linkage = .Strong });
@ -83,14 +79,6 @@ fn testing_roc_panic(c_ptr: *anyopaque, tag_id: u32) callconv(.C) void {
@panic("Roc panicked");
}
fn testing_roc_memcpy(dest: *anyopaque, src: *anyopaque, bytes: usize) callconv(.C) ?*anyopaque {
const zig_dest = @ptrCast([*]u8, dest);
const zig_src = @ptrCast([*]u8, src);
@memcpy(zig_dest, zig_src, bytes);
return dest;
}
pub fn alloc(size: usize, alignment: u32) ?[*]u8 {
return @ptrCast(?[*]u8, roc_alloc(size, alignment));
}
@ -103,10 +91,6 @@ pub fn dealloc(c_ptr: [*]u8, alignment: u32) void {
return roc_dealloc(c_ptr, alignment);
}
pub fn memcpy(dst: [*]u8, src: [*]u8, size: usize) void {
roc_memcpy(dst, src, size);
}
// indirection because otherwise zig creates an alias to the panic function which our LLVM code
// does not know how to deal with
pub fn test_panic(c_ptr: *anyopaque, crash_tag: u32) callconv(.C) void {

View file

@ -4,6 +4,7 @@ interface List
get,
set,
replace,
update,
append,
map,
len,
@ -251,6 +252,50 @@ set : List a, Nat, a -> List a
set = \list, index, value ->
(List.replace list index value).list
## Updates the element at the given index with the given function.
## ```
## List.update [1, 2, 3] 1 (\x -> x + 1)
## ```
## If the given index is outside the bounds of the list, returns the original
## list unmodified.
##
## To replace the element at a given index, instead of updating based on the current value,
## see [List.set] and [List.replace]
update : List a, Nat, (a -> a) -> List a
update = \list, index, func ->
when List.get list index is
Err OutOfBounds -> list
Ok value ->
newValue = func value
(replaceUnsafe list index newValue).list
# Update one element in bounds
expect
list : List Nat
list = [1, 2, 3]
got = update list 1 (\x -> x + 42)
want = [1, 44, 3]
got == want
# Update out of bounds
expect
list : List Nat
list = [1, 2, 3]
got = update list 5 (\x -> x + 42)
got == list
# Update chain
expect
list : List Nat
list = [1, 2, 3]
got =
list
|> update 0 (\x -> x + 10)
|> update 1 (\x -> x + 20)
|> update 2 (\x -> x + 30)
want = [11, 22, 33]
got == want
## Add a single element to the end of a list.
## ```
## List.append [1, 2, 3] 4

View file

@ -2859,7 +2859,15 @@ pub fn build_exp_stmt<'a, 'ctx>(
_ if lay.is_refcounted() => {
if value.is_pointer_value() {
let value_ptr = value.into_pointer_value();
let value_ptr = match lay.repr {
LayoutRepr::Union(union_layout)
if union_layout
.stores_tag_id_in_pointer(env.target_info) =>
{
tag_pointer_clear_tag_id(env, value.into_pointer_value())
}
_ => value.into_pointer_value(),
};
let then_block = env.context.append_basic_block(parent, "then");
let done_block = env.context.append_basic_block(parent, "done");

View file

@ -289,11 +289,6 @@ mod dummy_platform_functions {
unimplemented!("It is not valid to call roc panic from within the compiler. Please use the \"platform\" feature if this is a platform.")
}
#[no_mangle]
pub fn roc_memcpy(_dst: *mut c_void, _src: *mut c_void, _n: usize) -> *mut c_void {
unimplemented!("It is not valid to call roc memcpy from within the compiler. Please use the \"platform\" feature if this is a platform.")
}
#[no_mangle]
pub fn roc_memset(_dst: *mut c_void, _c: i32, _n: usize) -> *mut c_void {
unimplemented!("It is not valid to call roc memset from within the compiler. Please use the \"platform\" feature if this is a platform.")

View file

@ -53,6 +53,8 @@ use roc_parse::module::module_defs;
use roc_parse::parser::{FileError, Parser, SourceError, SyntaxError};
use roc_problem::Severity;
use roc_region::all::{LineInfo, Loc, Region};
#[cfg(not(target_family = "wasm"))]
use roc_reporting::report::to_https_problem_report_string;
use roc_reporting::report::{to_file_problem_report_string, Palette, RenderTarget};
use roc_solve::module::{extract_module_owned_implementations, Solved, SolvedModule};
use roc_solve_problem::TypeError;
@ -72,7 +74,7 @@ use std::{env, fs};
#[cfg(not(target_family = "wasm"))]
use {
roc_packaging::cache::{self},
roc_packaging::https::PackageMetadata,
roc_packaging::https::{PackageMetadata, Problem},
};
pub use crate::work::Phase;
@ -2454,11 +2456,11 @@ fn update<'a>(
}
}
Err(url_err) => {
todo!(
"Gracefully report URL error for {:?} - {:?}",
let buf = to_https_problem_report_string(
url,
url_err
Problem::InvalidUrl(url_err),
);
return Err(LoadingProblem::FormattedReport(buf));
}
}
}
@ -4329,17 +4331,22 @@ fn load_packages<'a>(
// TODO we should do this async; however, with the current
// architecture of file.rs (which doesn't use async/await),
// this would be very difficult!
let (package_dir, opt_root_module) = cache::install_package(roc_cache_dir, src)
.unwrap_or_else(|err| {
todo!("TODO gracefully handle package install error {:?}", err);
});
match cache::install_package(roc_cache_dir, src) {
Ok((package_dir, opt_root_module)) => {
// You can optionally specify the root module using the URL fragment,
// e.g. #foo.roc
// (defaults to main.roc)
match opt_root_module {
Some(root_module) => package_dir.join(root_module),
None => package_dir.join("main.roc"),
}
}
Err(problem) => {
let buf = to_https_problem_report_string(src, problem);
// You can optionally specify the root module using the URL fragment,
// e.g. #foo.roc
// (defaults to main.roc)
match opt_root_module {
Some(root_module) => package_dir.join(root_module),
None => package_dir.join("main.roc"),
load_messages.push(Msg::FailedToLoad(LoadingProblem::FormattedReport(buf)));
return;
}
}
}

View file

@ -1422,6 +1422,7 @@ define_builtins! {
79 LIST_WALK_FROM_UNTIL: "walkFromUntil"
80 LIST_ITER_HELP: "iterHelp"
81 LIST_RELEASE_EXCESS_CAPACITY: "releaseExcessCapacity"
82 LIST_UPDATE: "update"
}
7 RESULT: "Result" => {
0 RESULT_RESULT: "Result" exposed_type=true // the Result.Result type alias

View file

@ -31,12 +31,6 @@ pub fn insert_inc_dec_operations<'a>(
layout_interner: &STLayoutInterner<'a>,
procedures: &mut HashMap<(Symbol, ProcLayout), Proc<'a>, BuildHasherDefault<WyHash>>,
) {
// Create a SymbolRcTypesEnv for the procedures as they get referenced but should be marked as non reference counted.
let mut symbol_rc_types_env = SymbolRcTypesEnv::from_layout_interner(layout_interner);
for proc_symbol in procedures.keys().map(|(symbol, _layout)| *symbol) {
symbol_rc_types_env.insert_proc_symbol(proc_symbol);
}
// All calls to lowlevels are wrapped in another function to help with type inference and return/parameter layouts.
// But this lowlevel might get inlined into the caller of the wrapper and thus removing any reference counting operations.
// Thus, these rc operations are performed on the caller of the wrapper instead, and we skip rc on the lowlevel.
@ -47,9 +41,7 @@ pub fn insert_inc_dec_operations<'a>(
LowLevelWrapperType::from_symbol(*symbol),
LowLevelWrapperType::NotALowLevelWrapper
) {
// Clone the symbol_rc_types_env and insert the symbols in the current procedure.
// As the symbols should be limited in scope for the current proc.
let symbol_rc_types_env = symbol_rc_types_env.clone();
let symbol_rc_types_env = SymbolRcTypesEnv::from_layout_interner(layout_interner);
insert_inc_dec_operations_proc(arena, symbol_rc_types_env, proc);
}
}
@ -127,15 +119,6 @@ impl<'a, 'i> SymbolRcTypesEnv<'a, 'i> {
}
}
/**
Insert the reference count type of top level functions.
As functions are not reference counted, they can be marked as such.
*/
fn insert_proc_symbol(&mut self, proc_symbol: Symbol) {
self.symbols_rc_type
.insert(proc_symbol, VarRcType::NotReferenceCounted);
}
/**
Insert the reference count types of all symbols in a procedure.
*/

View file

@ -7,13 +7,6 @@ pub unsafe fn roc_alloc(size: usize, _alignment: u32) -> *mut c_void {
libc::malloc(size)
}
/// # Safety
/// The Roc application needs this.
#[no_mangle]
pub unsafe fn roc_memcpy(dest: *mut c_void, src: *const c_void, bytes: usize) -> *mut c_void {
libc::memcpy(dest, src, bytes)
}
/// # Safety
/// The Roc application needs this.
#[no_mangle]

View file

@ -134,13 +134,6 @@ void roc_panic(void* msg, unsigned int tag_id)
//--------------------------
void roc_memcpy(void *dest, const void *src, size_t n)
{
memcpy(dest, src, n);
}
//--------------------------
void *roc_memset(void *str, int c, size_t n)
{
return memset(str, c, n);

View file

@ -2,88 +2,88 @@ procedure Bool.11 (#Attr.2, #Attr.3):
let Bool.24 : Int1 = lowlevel Eq #Attr.2 #Attr.3;
ret Bool.24;
procedure List.26 (List.153, List.154, List.155):
let List.509 : [C U64, C U64] = CallByName List.92 List.153 List.154 List.155;
let List.512 : U8 = 1i64;
let List.513 : U8 = GetTagId List.509;
let List.514 : Int1 = lowlevel Eq List.512 List.513;
if List.514 then
let List.156 : U64 = UnionAtIndex (Id 1) (Index 0) List.509;
ret List.156;
procedure List.26 (List.159, List.160, List.161):
let List.536 : [C U64, C U64] = CallByName List.93 List.159 List.160 List.161;
let List.539 : U8 = 1i64;
let List.540 : U8 = GetTagId List.536;
let List.541 : Int1 = lowlevel Eq List.539 List.540;
if List.541 then
let List.162 : U64 = UnionAtIndex (Id 1) (Index 0) List.536;
ret List.162;
else
let List.157 : U64 = UnionAtIndex (Id 0) (Index 0) List.509;
ret List.157;
let List.163 : U64 = UnionAtIndex (Id 0) (Index 0) List.536;
ret List.163;
procedure List.29 (List.298, List.299):
let List.508 : U64 = CallByName List.6 List.298;
let List.300 : U64 = CallByName Num.77 List.508 List.299;
let List.494 : List U8 = CallByName List.43 List.298 List.300;
ret List.494;
procedure List.29 (List.304, List.305):
let List.535 : U64 = CallByName List.6 List.304;
let List.306 : U64 = CallByName Num.77 List.535 List.305;
let List.521 : List U8 = CallByName List.43 List.304 List.306;
ret List.521;
procedure List.43 (List.296, List.297):
let List.506 : U64 = CallByName List.6 List.296;
let List.505 : U64 = CallByName Num.77 List.506 List.297;
let List.496 : {U64, U64} = Struct {List.297, List.505};
let List.495 : List U8 = CallByName List.49 List.296 List.496;
ret List.495;
procedure List.43 (List.302, List.303):
let List.533 : U64 = CallByName List.6 List.302;
let List.532 : U64 = CallByName Num.77 List.533 List.303;
let List.523 : {U64, U64} = Struct {List.303, List.532};
let List.522 : List U8 = CallByName List.49 List.302 List.523;
ret List.522;
procedure List.49 (List.370, List.371):
let List.503 : U64 = StructAtIndex 0 List.371;
let List.504 : U64 = 0i64;
let List.501 : Int1 = CallByName Bool.11 List.503 List.504;
if List.501 then
dec List.370;
let List.502 : List U8 = Array [];
ret List.502;
procedure List.49 (List.376, List.377):
let List.530 : U64 = StructAtIndex 0 List.377;
let List.531 : U64 = 0i64;
let List.528 : Int1 = CallByName Bool.11 List.530 List.531;
if List.528 then
dec List.376;
let List.529 : List U8 = Array [];
ret List.529;
else
let List.498 : U64 = StructAtIndex 1 List.371;
let List.499 : U64 = StructAtIndex 0 List.371;
let List.497 : List U8 = CallByName List.72 List.370 List.498 List.499;
ret List.497;
let List.525 : U64 = StructAtIndex 1 List.377;
let List.526 : U64 = StructAtIndex 0 List.377;
let List.524 : List U8 = CallByName List.72 List.376 List.525 List.526;
ret List.524;
procedure List.6 (#Attr.2):
let List.507 : U64 = lowlevel ListLen #Attr.2;
ret List.507;
let List.534 : U64 = lowlevel ListLen #Attr.2;
ret List.534;
procedure List.66 (#Attr.2, #Attr.3):
let List.530 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.530;
let List.557 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.557;
procedure List.72 (#Attr.2, #Attr.3, #Attr.4):
let List.500 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.500;
let List.527 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.527;
procedure List.80 (List.544, List.545, List.546, List.547, List.548):
joinpoint List.518 List.433 List.434 List.435 List.436 List.437:
let List.520 : Int1 = CallByName Num.22 List.436 List.437;
if List.520 then
let List.529 : U8 = CallByName List.66 List.433 List.436;
let List.521 : [C U64, C U64] = CallByName Test.4 List.434 List.529;
let List.526 : U8 = 1i64;
let List.527 : U8 = GetTagId List.521;
let List.528 : Int1 = lowlevel Eq List.526 List.527;
if List.528 then
let List.438 : U64 = UnionAtIndex (Id 1) (Index 0) List.521;
let List.524 : U64 = 1i64;
let List.523 : U64 = CallByName Num.19 List.436 List.524;
jump List.518 List.433 List.438 List.435 List.523 List.437;
procedure List.80 (List.571, List.572, List.573, List.574, List.575):
joinpoint List.545 List.439 List.440 List.441 List.442 List.443:
let List.547 : Int1 = CallByName Num.22 List.442 List.443;
if List.547 then
let List.556 : U8 = CallByName List.66 List.439 List.442;
let List.548 : [C U64, C U64] = CallByName Test.4 List.440 List.556;
let List.553 : U8 = 1i64;
let List.554 : U8 = GetTagId List.548;
let List.555 : Int1 = lowlevel Eq List.553 List.554;
if List.555 then
let List.444 : U64 = UnionAtIndex (Id 1) (Index 0) List.548;
let List.551 : U64 = 1i64;
let List.550 : U64 = CallByName Num.19 List.442 List.551;
jump List.545 List.439 List.444 List.441 List.550 List.443;
else
dec List.433;
let List.439 : U64 = UnionAtIndex (Id 0) (Index 0) List.521;
let List.525 : [C U64, C U64] = TagId(0) List.439;
ret List.525;
dec List.439;
let List.445 : U64 = UnionAtIndex (Id 0) (Index 0) List.548;
let List.552 : [C U64, C U64] = TagId(0) List.445;
ret List.552;
else
dec List.433;
let List.519 : [C U64, C U64] = TagId(1) List.434;
ret List.519;
dec List.439;
let List.546 : [C U64, C U64] = TagId(1) List.440;
ret List.546;
in
jump List.518 List.544 List.545 List.546 List.547 List.548;
jump List.545 List.571 List.572 List.573 List.574 List.575;
procedure List.92 (List.430, List.431, List.432):
let List.516 : U64 = 0i64;
let List.517 : U64 = CallByName List.6 List.430;
let List.515 : [C U64, C U64] = CallByName List.80 List.430 List.431 List.432 List.516 List.517;
ret List.515;
procedure List.93 (List.436, List.437, List.438):
let List.543 : U64 = 0i64;
let List.544 : U64 = CallByName List.6 List.436;
let List.542 : [C U64, C U64] = CallByName List.80 List.436 List.437 List.438 List.543 List.544;
ret List.542;
procedure Num.19 (#Attr.2, #Attr.3):
let Num.283 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;

View file

@ -1,7 +1,7 @@
procedure List.5 (#Attr.2, #Attr.3):
let List.494 : List {} = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.2 #Attr.3;
let List.521 : List {} = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.2 #Attr.3;
decref #Attr.2;
ret List.494;
ret List.521;
procedure Test.2 (Test.3):
let Test.7 : {} = Struct {};

View file

@ -1,7 +1,7 @@
procedure List.5 (#Attr.2, #Attr.3):
let List.494 : List [] = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.2 #Attr.3;
let List.521 : List [] = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.2 #Attr.3;
decref #Attr.2;
ret List.494;
ret List.521;
procedure Test.2 (Test.3):
let Test.7 : {} = Struct {};

View file

@ -2,49 +2,49 @@ procedure Bool.1 ():
let Bool.24 : Int1 = false;
ret Bool.24;
procedure List.2 (List.96, List.97):
let List.508 : U64 = CallByName List.6 List.96;
let List.504 : Int1 = CallByName Num.22 List.97 List.508;
if List.504 then
let List.506 : Str = CallByName List.66 List.96 List.97;
inc List.506;
dec List.96;
let List.505 : [C {}, C Str] = TagId(1) List.506;
ret List.505;
procedure List.2 (List.97, List.98):
let List.535 : U64 = CallByName List.6 List.97;
let List.531 : Int1 = CallByName Num.22 List.98 List.535;
if List.531 then
let List.533 : Str = CallByName List.66 List.97 List.98;
inc List.533;
dec List.97;
let List.532 : [C {}, C Str] = TagId(1) List.533;
ret List.532;
else
dec List.96;
let List.503 : {} = Struct {};
let List.502 : [C {}, C Str] = TagId(0) List.503;
ret List.502;
dec List.97;
let List.530 : {} = Struct {};
let List.529 : [C {}, C Str] = TagId(0) List.530;
ret List.529;
procedure List.5 (#Attr.2, #Attr.3):
let List.510 : List Str = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.10 #Attr.3;
let List.537 : List Str = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.10 #Attr.3;
decref #Attr.2;
ret List.510;
ret List.537;
procedure List.6 (#Attr.2):
let List.509 : U64 = lowlevel ListLen #Attr.2;
ret List.509;
let List.536 : U64 = lowlevel ListLen #Attr.2;
ret List.536;
procedure List.66 (#Attr.2, #Attr.3):
let List.507 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.507;
let List.534 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.534;
procedure List.9 (List.287):
let List.501 : U64 = 0i64;
let List.494 : [C {}, C Str] = CallByName List.2 List.287 List.501;
let List.498 : U8 = 1i64;
let List.499 : U8 = GetTagId List.494;
let List.500 : Int1 = lowlevel Eq List.498 List.499;
if List.500 then
let List.288 : Str = UnionAtIndex (Id 1) (Index 0) List.494;
let List.495 : [C {}, C Str] = TagId(1) List.288;
ret List.495;
procedure List.9 (List.293):
let List.528 : U64 = 0i64;
let List.521 : [C {}, C Str] = CallByName List.2 List.293 List.528;
let List.525 : U8 = 1i64;
let List.526 : U8 = GetTagId List.521;
let List.527 : Int1 = lowlevel Eq List.525 List.526;
if List.527 then
let List.294 : Str = UnionAtIndex (Id 1) (Index 0) List.521;
let List.522 : [C {}, C Str] = TagId(1) List.294;
ret List.522;
else
dec List.494;
let List.497 : {} = Struct {};
let List.496 : [C {}, C Str] = TagId(0) List.497;
ret List.496;
dec List.521;
let List.524 : {} = Struct {};
let List.523 : [C {}, C Str] = TagId(0) List.524;
ret List.523;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.281 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -1,6 +1,6 @@
procedure List.6 (#Attr.2):
let List.494 : U64 = lowlevel ListLen #Attr.2;
ret List.494;
let List.521 : U64 = lowlevel ListLen #Attr.2;
ret List.521;
procedure Test.1 (Test.5):
let Test.2 : I64 = 41i64;

View file

@ -2,42 +2,42 @@ procedure Bool.2 ():
let Bool.23 : Int1 = true;
ret Bool.23;
procedure List.139 (List.140, List.141, List.138):
let List.513 : [<rnw><null>, C *self Int1, C *self Int1] = CallByName Test.6 List.140 List.141 List.138;
ret List.513;
procedure List.145 (List.146, List.147, List.144):
let List.540 : [<rnw><null>, C *self Int1, C *self Int1] = CallByName Test.6 List.146 List.147 List.144;
ret List.540;
procedure List.18 (List.136, List.137, List.138):
let List.494 : [<rnw><null>, C *self Int1, C *self Int1] = CallByName List.92 List.136 List.137 List.138;
ret List.494;
procedure List.18 (List.142, List.143, List.144):
let List.521 : [<rnw><null>, C *self Int1, C *self Int1] = CallByName List.93 List.142 List.143 List.144;
ret List.521;
procedure List.6 (#Attr.2):
let List.511 : U64 = lowlevel ListLen #Attr.2;
ret List.511;
let List.538 : U64 = lowlevel ListLen #Attr.2;
ret List.538;
procedure List.66 (#Attr.2, #Attr.3):
let List.510 : Int1 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.510;
let List.537 : Int1 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.537;
procedure List.80 (List.517, List.518, List.519, List.520, List.521):
joinpoint List.500 List.433 List.434 List.435 List.436 List.437:
let List.502 : Int1 = CallByName Num.22 List.436 List.437;
if List.502 then
let List.509 : Int1 = CallByName List.66 List.433 List.436;
let List.503 : [<rnw><null>, C *self Int1, C *self Int1] = CallByName List.139 List.434 List.509 List.435;
let List.506 : U64 = 1i64;
let List.505 : U64 = CallByName Num.19 List.436 List.506;
jump List.500 List.433 List.503 List.435 List.505 List.437;
procedure List.80 (List.544, List.545, List.546, List.547, List.548):
joinpoint List.527 List.439 List.440 List.441 List.442 List.443:
let List.529 : Int1 = CallByName Num.22 List.442 List.443;
if List.529 then
let List.536 : Int1 = CallByName List.66 List.439 List.442;
let List.530 : [<rnw><null>, C *self Int1, C *self Int1] = CallByName List.145 List.440 List.536 List.441;
let List.533 : U64 = 1i64;
let List.532 : U64 = CallByName Num.19 List.442 List.533;
jump List.527 List.439 List.530 List.441 List.532 List.443;
else
dec List.433;
ret List.434;
dec List.439;
ret List.440;
in
jump List.500 List.517 List.518 List.519 List.520 List.521;
jump List.527 List.544 List.545 List.546 List.547 List.548;
procedure List.92 (List.430, List.431, List.432):
let List.498 : U64 = 0i64;
let List.499 : U64 = CallByName List.6 List.430;
let List.497 : [<rnw><null>, C *self Int1, C *self Int1] = CallByName List.80 List.430 List.431 List.432 List.498 List.499;
ret List.497;
procedure List.93 (List.436, List.437, List.438):
let List.525 : U64 = 0i64;
let List.526 : U64 = CallByName List.6 List.436;
let List.524 : [<rnw><null>, C *self Int1, C *self Int1] = CallByName List.80 List.436 List.437 List.438 List.525 List.526;
ret List.524;
procedure Num.19 (#Attr.2, #Attr.3):
let Num.281 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;

View file

@ -24,59 +24,59 @@ procedure Dict.4 (Dict.543):
dec #Derived_gen.0;
ret Dict.97;
procedure List.11 (List.115, List.116):
let List.495 : List I8 = CallByName List.68 List.116;
let List.494 : List I8 = CallByName List.82 List.115 List.116 List.495;
ret List.494;
procedure List.11 (List.121, List.122):
let List.522 : List I8 = CallByName List.68 List.122;
let List.521 : List I8 = CallByName List.83 List.121 List.122 List.522;
ret List.521;
procedure List.11 (List.115, List.116):
let List.507 : List U64 = CallByName List.68 List.116;
let List.506 : List U64 = CallByName List.82 List.115 List.116 List.507;
ret List.506;
procedure List.11 (List.121, List.122):
let List.534 : List U64 = CallByName List.68 List.122;
let List.533 : List U64 = CallByName List.83 List.121 List.122 List.534;
ret List.533;
procedure List.68 (#Attr.2):
let List.505 : List I8 = lowlevel ListWithCapacity #Attr.2;
ret List.505;
let List.532 : List I8 = lowlevel ListWithCapacity #Attr.2;
ret List.532;
procedure List.68 (#Attr.2):
let List.517 : List U64 = lowlevel ListWithCapacity #Attr.2;
ret List.517;
let List.544 : List U64 = lowlevel ListWithCapacity #Attr.2;
ret List.544;
procedure List.71 (#Attr.2, #Attr.3):
let List.502 : List I8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.502;
let List.529 : List I8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.529;
procedure List.71 (#Attr.2, #Attr.3):
let List.514 : List U64 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.514;
let List.541 : List U64 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.541;
procedure List.82 (List.518, List.519, List.520):
joinpoint List.496 List.117 List.118 List.119:
let List.504 : U64 = 0i64;
let List.498 : Int1 = CallByName Num.24 List.118 List.504;
if List.498 then
let List.503 : U64 = 1i64;
let List.500 : U64 = CallByName Num.20 List.118 List.503;
let List.501 : List I8 = CallByName List.71 List.119 List.117;
jump List.496 List.117 List.500 List.501;
procedure List.83 (List.545, List.546, List.547):
joinpoint List.523 List.123 List.124 List.125:
let List.531 : U64 = 0i64;
let List.525 : Int1 = CallByName Num.24 List.124 List.531;
if List.525 then
let List.530 : U64 = 1i64;
let List.527 : U64 = CallByName Num.20 List.124 List.530;
let List.528 : List I8 = CallByName List.71 List.125 List.123;
jump List.523 List.123 List.527 List.528;
else
ret List.119;
ret List.125;
in
jump List.496 List.518 List.519 List.520;
jump List.523 List.545 List.546 List.547;
procedure List.82 (List.526, List.527, List.528):
joinpoint List.508 List.117 List.118 List.119:
let List.516 : U64 = 0i64;
let List.510 : Int1 = CallByName Num.24 List.118 List.516;
if List.510 then
let List.515 : U64 = 1i64;
let List.512 : U64 = CallByName Num.20 List.118 List.515;
let List.513 : List U64 = CallByName List.71 List.119 List.117;
jump List.508 List.117 List.512 List.513;
procedure List.83 (List.553, List.554, List.555):
joinpoint List.535 List.123 List.124 List.125:
let List.543 : U64 = 0i64;
let List.537 : Int1 = CallByName Num.24 List.124 List.543;
if List.537 then
let List.542 : U64 = 1i64;
let List.539 : U64 = CallByName Num.20 List.124 List.542;
let List.540 : List U64 = CallByName List.71 List.125 List.123;
jump List.535 List.123 List.539 List.540;
else
ret List.119;
ret List.125;
in
jump List.508 List.526 List.527 List.528;
jump List.535 List.553 List.554 List.555;
procedure Num.20 (#Attr.2, #Attr.3):
let Num.282 : U64 = lowlevel NumSub #Attr.2 #Attr.3;

View file

@ -2,27 +2,27 @@ procedure Bool.1 ():
let Bool.23 : Int1 = false;
ret Bool.23;
procedure List.2 (List.96, List.97):
let List.500 : U64 = CallByName List.6 List.96;
let List.496 : Int1 = CallByName Num.22 List.97 List.500;
if List.496 then
let List.498 : {} = CallByName List.66 List.96 List.97;
dec List.96;
let List.497 : [C {}, C {}] = TagId(1) List.498;
ret List.497;
procedure List.2 (List.97, List.98):
let List.527 : U64 = CallByName List.6 List.97;
let List.523 : Int1 = CallByName Num.22 List.98 List.527;
if List.523 then
let List.525 : {} = CallByName List.66 List.97 List.98;
dec List.97;
let List.524 : [C {}, C {}] = TagId(1) List.525;
ret List.524;
else
dec List.96;
let List.495 : {} = Struct {};
let List.494 : [C {}, C {}] = TagId(0) List.495;
ret List.494;
dec List.97;
let List.522 : {} = Struct {};
let List.521 : [C {}, C {}] = TagId(0) List.522;
ret List.521;
procedure List.6 (#Attr.2):
let List.501 : U64 = lowlevel ListLen #Attr.2;
ret List.501;
let List.528 : U64 = lowlevel ListLen #Attr.2;
ret List.528;
procedure List.66 (#Attr.2, #Attr.3):
let List.499 : {} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.499;
let List.526 : {} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.526;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.281 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -1,16 +1,16 @@
procedure List.4 (List.107, List.108):
let List.497 : U64 = 1i64;
let List.495 : List U8 = CallByName List.70 List.107 List.497;
let List.494 : List U8 = CallByName List.71 List.495 List.108;
ret List.494;
procedure List.4 (List.113, List.114):
let List.524 : U64 = 1i64;
let List.522 : List U8 = CallByName List.70 List.113 List.524;
let List.521 : List U8 = CallByName List.71 List.522 List.114;
ret List.521;
procedure List.70 (#Attr.2, #Attr.3):
let List.498 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.498;
let List.525 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.525;
procedure List.71 (#Attr.2, #Attr.3):
let List.496 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.496;
let List.523 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.523;
procedure Test.23 (Test.24, Test.35, Test.22):
let Test.37 : List U8 = CallByName List.4 Test.24 Test.22;

View file

@ -1168,259 +1168,259 @@ procedure Json.99 (Json.849):
ret Json.849;
procedure List.13 (#Attr.2, #Attr.3):
let List.703 : List Str = lowlevel ListPrepend #Attr.2 #Attr.3;
ret List.703;
let List.730 : List Str = lowlevel ListPrepend #Attr.2 #Attr.3;
ret List.730;
procedure List.139 (List.140, List.141, List.138):
let List.543 : {List U8, U64} = CallByName Json.236 List.140 List.141 List.138;
ret List.543;
procedure List.145 (List.146, List.147, List.144):
let List.570 : {List U8, U64} = CallByName Json.236 List.146 List.147 List.144;
ret List.570;
procedure List.139 (List.140, List.141, List.138):
let List.651 : {List U8, U64} = CallByName Json.236 List.140 List.141 List.138;
ret List.651;
procedure List.145 (List.146, List.147, List.144):
let List.678 : {List U8, U64} = CallByName Json.236 List.146 List.147 List.144;
ret List.678;
procedure List.139 (List.140, List.141, List.138):
let List.671 : List U8 = CallByName Json.214 List.140 List.141;
ret List.671;
procedure List.145 (List.146, List.147, List.144):
let List.698 : List U8 = CallByName Json.214 List.146 List.147;
ret List.698;
procedure List.18 (List.136, List.137, List.138):
let List.524 : {List U8, U64} = CallByName List.92 List.136 List.137 List.138;
ret List.524;
procedure List.18 (List.142, List.143, List.144):
let List.551 : {List U8, U64} = CallByName List.93 List.142 List.143 List.144;
ret List.551;
procedure List.18 (List.136, List.137, List.138):
let List.632 : {List U8, U64} = CallByName List.92 List.136 List.137 List.138;
ret List.632;
procedure List.18 (List.142, List.143, List.144):
let List.659 : {List U8, U64} = CallByName List.93 List.142 List.143 List.144;
ret List.659;
procedure List.18 (List.136, List.137, List.138):
let List.652 : List U8 = CallByName List.92 List.136 List.137 List.138;
ret List.652;
procedure List.18 (List.142, List.143, List.144):
let List.679 : List U8 = CallByName List.93 List.142 List.143 List.144;
ret List.679;
procedure List.26 (List.153, List.154, List.155):
let List.720 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.92 List.153 List.154 List.155;
let List.723 : U8 = 1i64;
let List.724 : U8 = GetTagId List.720;
let List.725 : Int1 = lowlevel Eq List.723 List.724;
if List.725 then
let List.156 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.720;
ret List.156;
procedure List.26 (List.159, List.160, List.161):
let List.747 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.93 List.159 List.160 List.161;
let List.750 : U8 = 1i64;
let List.751 : U8 = GetTagId List.747;
let List.752 : Int1 = lowlevel Eq List.750 List.751;
if List.752 then
let List.162 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.747;
ret List.162;
else
let List.157 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.720;
ret List.157;
let List.163 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.747;
ret List.163;
procedure List.31 (#Attr.2, #Attr.3):
let List.685 : List Str = lowlevel ListDropAt #Attr.2 #Attr.3;
ret List.685;
let List.712 : List Str = lowlevel ListDropAt #Attr.2 #Attr.3;
ret List.712;
procedure List.38 (List.292):
let List.693 : U64 = 0i64;
let List.692 : List Str = CallByName List.31 List.292 List.693;
ret List.692;
procedure List.38 (List.298):
let List.720 : U64 = 0i64;
let List.719 : List Str = CallByName List.31 List.298 List.720;
ret List.719;
procedure List.4 (List.107, List.108):
let List.628 : U64 = 1i64;
let List.627 : List Str = CallByName List.70 List.107 List.628;
let List.626 : List Str = CallByName List.71 List.627 List.108;
ret List.626;
procedure List.4 (List.113, List.114):
let List.655 : U64 = 1i64;
let List.654 : List Str = CallByName List.70 List.113 List.655;
let List.653 : List Str = CallByName List.71 List.654 List.114;
ret List.653;
procedure List.4 (List.107, List.108):
let List.631 : U64 = 1i64;
let List.630 : List U8 = CallByName List.70 List.107 List.631;
let List.629 : List U8 = CallByName List.71 List.630 List.108;
ret List.629;
procedure List.4 (List.113, List.114):
let List.658 : U64 = 1i64;
let List.657 : List U8 = CallByName List.70 List.113 List.658;
let List.656 : List U8 = CallByName List.71 List.657 List.114;
ret List.656;
procedure List.49 (List.370, List.371):
let List.712 : U64 = StructAtIndex 0 List.371;
let List.713 : U64 = 0i64;
let List.710 : Int1 = CallByName Bool.11 List.712 List.713;
if List.710 then
dec List.370;
let List.711 : List U8 = Array [];
ret List.711;
procedure List.49 (List.376, List.377):
let List.739 : U64 = StructAtIndex 0 List.377;
let List.740 : U64 = 0i64;
let List.737 : Int1 = CallByName Bool.11 List.739 List.740;
if List.737 then
dec List.376;
let List.738 : List U8 = Array [];
ret List.738;
else
let List.707 : U64 = StructAtIndex 1 List.371;
let List.708 : U64 = StructAtIndex 0 List.371;
let List.706 : List U8 = CallByName List.72 List.370 List.707 List.708;
ret List.706;
let List.734 : U64 = StructAtIndex 1 List.377;
let List.735 : U64 = StructAtIndex 0 List.377;
let List.733 : List U8 = CallByName List.72 List.376 List.734 List.735;
ret List.733;
procedure List.52 (List.385, List.386):
let List.387 : U64 = CallByName List.6 List.385;
joinpoint List.718 List.388:
let List.716 : U64 = 0i64;
let List.715 : {U64, U64} = Struct {List.388, List.716};
inc List.385;
let List.389 : List U8 = CallByName List.49 List.385 List.715;
let List.714 : U64 = CallByName Num.20 List.387 List.388;
let List.705 : {U64, U64} = Struct {List.714, List.388};
let List.390 : List U8 = CallByName List.49 List.385 List.705;
let List.704 : {List U8, List U8} = Struct {List.389, List.390};
ret List.704;
procedure List.52 (List.391, List.392):
let List.393 : U64 = CallByName List.6 List.391;
joinpoint List.745 List.394:
let List.743 : U64 = 0i64;
let List.742 : {U64, U64} = Struct {List.394, List.743};
inc List.391;
let List.395 : List U8 = CallByName List.49 List.391 List.742;
let List.741 : U64 = CallByName Num.20 List.393 List.394;
let List.732 : {U64, U64} = Struct {List.741, List.394};
let List.396 : List U8 = CallByName List.49 List.391 List.732;
let List.731 : {List U8, List U8} = Struct {List.395, List.396};
ret List.731;
in
let List.719 : Int1 = CallByName Num.24 List.387 List.386;
if List.719 then
jump List.718 List.386;
let List.746 : Int1 = CallByName Num.24 List.393 List.392;
if List.746 then
jump List.745 List.392;
else
jump List.718 List.387;
jump List.745 List.393;
procedure List.6 (#Attr.2):
let List.562 : U64 = lowlevel ListLen #Attr.2;
ret List.562;
let List.589 : U64 = lowlevel ListLen #Attr.2;
ret List.589;
procedure List.6 (#Attr.2):
let List.699 : U64 = lowlevel ListLen #Attr.2;
ret List.699;
let List.726 : U64 = lowlevel ListLen #Attr.2;
ret List.726;
procedure List.6 (#Attr.2):
let List.700 : U64 = lowlevel ListLen #Attr.2;
ret List.700;
let List.727 : U64 = lowlevel ListLen #Attr.2;
ret List.727;
procedure List.6 (#Attr.2):
let List.702 : U64 = lowlevel ListLen #Attr.2;
ret List.702;
let List.729 : U64 = lowlevel ListLen #Attr.2;
ret List.729;
procedure List.66 (#Attr.2, #Attr.3):
let List.540 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.540;
let List.567 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.567;
procedure List.66 (#Attr.2, #Attr.3):
let List.648 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.648;
let List.675 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.675;
procedure List.66 (#Attr.2, #Attr.3):
let List.668 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.668;
procedure List.68 (#Attr.2):
let List.695 : List Str = lowlevel ListWithCapacity #Attr.2;
let List.695 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.695;
procedure List.68 (#Attr.2):
let List.697 : List U8 = lowlevel ListWithCapacity #Attr.2;
ret List.697;
let List.722 : List Str = lowlevel ListWithCapacity #Attr.2;
ret List.722;
procedure List.68 (#Attr.2):
let List.724 : List U8 = lowlevel ListWithCapacity #Attr.2;
ret List.724;
procedure List.70 (#Attr.2, #Attr.3):
let List.608 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.608;
procedure List.70 (#Attr.2, #Attr.3):
let List.625 : List Str = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.625;
procedure List.71 (#Attr.2, #Attr.3):
let List.606 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.606;
procedure List.71 (#Attr.2, #Attr.3):
let List.623 : List Str = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.623;
procedure List.72 (#Attr.2, #Attr.3, #Attr.4):
let List.709 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.709;
procedure List.8 (#Attr.2, #Attr.3):
let List.674 : List Str = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.674;
procedure List.8 (#Attr.2, #Attr.3):
let List.682 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.682;
procedure List.80 (List.579, List.580, List.581, List.582, List.583):
joinpoint List.530 List.433 List.434 List.435 List.436 List.437:
let List.532 : Int1 = CallByName Num.22 List.436 List.437;
if List.532 then
let List.539 : {Str, Str} = CallByName List.66 List.433 List.436;
inc List.539;
let List.533 : {List U8, U64} = CallByName List.139 List.434 List.539 List.435;
let List.536 : U64 = 1i64;
let List.535 : U64 = CallByName Num.19 List.436 List.536;
jump List.530 List.433 List.533 List.435 List.535 List.437;
else
dec List.433;
ret List.434;
in
jump List.530 List.579 List.580 List.581 List.582 List.583;
procedure List.80 (List.756, List.757, List.758, List.759, List.760):
joinpoint List.638 List.433 List.434 List.435 List.436 List.437:
let List.640 : Int1 = CallByName Num.22 List.436 List.437;
if List.640 then
let List.647 : {Str, Str} = CallByName List.66 List.433 List.436;
inc List.647;
let List.641 : {List U8, U64} = CallByName List.139 List.434 List.647 List.435;
let List.644 : U64 = 1i64;
let List.643 : U64 = CallByName Num.19 List.436 List.644;
jump List.638 List.433 List.641 List.435 List.643 List.437;
else
dec List.433;
ret List.434;
in
jump List.638 List.756 List.757 List.758 List.759 List.760;
procedure List.80 (List.773, List.774, List.775, List.776, List.777):
joinpoint List.658 List.433 List.434 List.435 List.436 List.437:
let List.660 : Int1 = CallByName Num.22 List.436 List.437;
if List.660 then
let List.667 : U8 = CallByName List.66 List.433 List.436;
let List.661 : List U8 = CallByName List.139 List.434 List.667 List.435;
let List.664 : U64 = 1i64;
let List.663 : U64 = CallByName Num.19 List.436 List.664;
jump List.658 List.433 List.661 List.435 List.663 List.437;
else
dec List.433;
ret List.434;
in
jump List.658 List.773 List.774 List.775 List.776 List.777;
procedure List.80 (List.809, List.810, List.811, List.812, List.813):
joinpoint List.729 List.433 List.434 List.435 List.436 List.437:
let List.731 : Int1 = CallByName Num.22 List.436 List.437;
if List.731 then
let List.740 : U8 = CallByName List.66 List.433 List.436;
let List.732 : [C {U64, Int1}, C {U64, Int1}] = CallByName Json.188 List.434 List.740;
let List.737 : U8 = 1i64;
let List.738 : U8 = GetTagId List.732;
let List.739 : Int1 = lowlevel Eq List.737 List.738;
if List.739 then
let List.438 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.732;
let List.735 : U64 = 1i64;
let List.734 : U64 = CallByName Num.19 List.436 List.735;
jump List.729 List.433 List.438 List.435 List.734 List.437;
else
dec List.433;
let List.439 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.732;
let List.736 : [C {U64, Int1}, C {U64, Int1}] = TagId(0) List.439;
ret List.736;
else
dec List.433;
let List.730 : [C {U64, Int1}, C {U64, Int1}] = TagId(1) List.434;
ret List.730;
in
jump List.729 List.809 List.810 List.811 List.812 List.813;
procedure List.92 (List.430, List.431, List.432):
let List.528 : U64 = 0i64;
let List.529 : U64 = CallByName List.6 List.430;
let List.527 : {List U8, U64} = CallByName List.80 List.430 List.431 List.432 List.528 List.529;
ret List.527;
procedure List.92 (List.430, List.431, List.432):
let List.636 : U64 = 0i64;
let List.637 : U64 = CallByName List.6 List.430;
let List.635 : {List U8, U64} = CallByName List.80 List.430 List.431 List.432 List.636 List.637;
let List.635 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.635;
procedure List.92 (List.430, List.431, List.432):
let List.656 : U64 = 0i64;
let List.657 : U64 = CallByName List.6 List.430;
let List.655 : List U8 = CallByName List.80 List.430 List.431 List.432 List.656 List.657;
ret List.655;
procedure List.70 (#Attr.2, #Attr.3):
let List.652 : List Str = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.652;
procedure List.92 (List.430, List.431, List.432):
let List.727 : U64 = 0i64;
let List.728 : U64 = CallByName List.6 List.430;
let List.726 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.80 List.430 List.431 List.432 List.727 List.728;
ret List.726;
procedure List.71 (#Attr.2, #Attr.3):
let List.633 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.633;
procedure List.71 (#Attr.2, #Attr.3):
let List.650 : List Str = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.650;
procedure List.72 (#Attr.2, #Attr.3, #Attr.4):
let List.736 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.736;
procedure List.8 (#Attr.2, #Attr.3):
let List.701 : List Str = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.701;
procedure List.8 (#Attr.2, #Attr.3):
let List.709 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.709;
procedure List.80 (List.606, List.607, List.608, List.609, List.610):
joinpoint List.557 List.439 List.440 List.441 List.442 List.443:
let List.559 : Int1 = CallByName Num.22 List.442 List.443;
if List.559 then
let List.566 : {Str, Str} = CallByName List.66 List.439 List.442;
inc List.566;
let List.560 : {List U8, U64} = CallByName List.145 List.440 List.566 List.441;
let List.563 : U64 = 1i64;
let List.562 : U64 = CallByName Num.19 List.442 List.563;
jump List.557 List.439 List.560 List.441 List.562 List.443;
else
dec List.439;
ret List.440;
in
jump List.557 List.606 List.607 List.608 List.609 List.610;
procedure List.80 (List.783, List.784, List.785, List.786, List.787):
joinpoint List.665 List.439 List.440 List.441 List.442 List.443:
let List.667 : Int1 = CallByName Num.22 List.442 List.443;
if List.667 then
let List.674 : {Str, Str} = CallByName List.66 List.439 List.442;
inc List.674;
let List.668 : {List U8, U64} = CallByName List.145 List.440 List.674 List.441;
let List.671 : U64 = 1i64;
let List.670 : U64 = CallByName Num.19 List.442 List.671;
jump List.665 List.439 List.668 List.441 List.670 List.443;
else
dec List.439;
ret List.440;
in
jump List.665 List.783 List.784 List.785 List.786 List.787;
procedure List.80 (List.800, List.801, List.802, List.803, List.804):
joinpoint List.685 List.439 List.440 List.441 List.442 List.443:
let List.687 : Int1 = CallByName Num.22 List.442 List.443;
if List.687 then
let List.694 : U8 = CallByName List.66 List.439 List.442;
let List.688 : List U8 = CallByName List.145 List.440 List.694 List.441;
let List.691 : U64 = 1i64;
let List.690 : U64 = CallByName Num.19 List.442 List.691;
jump List.685 List.439 List.688 List.441 List.690 List.443;
else
dec List.439;
ret List.440;
in
jump List.685 List.800 List.801 List.802 List.803 List.804;
procedure List.80 (List.836, List.837, List.838, List.839, List.840):
joinpoint List.756 List.439 List.440 List.441 List.442 List.443:
let List.758 : Int1 = CallByName Num.22 List.442 List.443;
if List.758 then
let List.767 : U8 = CallByName List.66 List.439 List.442;
let List.759 : [C {U64, Int1}, C {U64, Int1}] = CallByName Json.188 List.440 List.767;
let List.764 : U8 = 1i64;
let List.765 : U8 = GetTagId List.759;
let List.766 : Int1 = lowlevel Eq List.764 List.765;
if List.766 then
let List.444 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.759;
let List.762 : U64 = 1i64;
let List.761 : U64 = CallByName Num.19 List.442 List.762;
jump List.756 List.439 List.444 List.441 List.761 List.443;
else
dec List.439;
let List.445 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.759;
let List.763 : [C {U64, Int1}, C {U64, Int1}] = TagId(0) List.445;
ret List.763;
else
dec List.439;
let List.757 : [C {U64, Int1}, C {U64, Int1}] = TagId(1) List.440;
ret List.757;
in
jump List.756 List.836 List.837 List.838 List.839 List.840;
procedure List.93 (List.436, List.437, List.438):
let List.555 : U64 = 0i64;
let List.556 : U64 = CallByName List.6 List.436;
let List.554 : {List U8, U64} = CallByName List.80 List.436 List.437 List.438 List.555 List.556;
ret List.554;
procedure List.93 (List.436, List.437, List.438):
let List.663 : U64 = 0i64;
let List.664 : U64 = CallByName List.6 List.436;
let List.662 : {List U8, U64} = CallByName List.80 List.436 List.437 List.438 List.663 List.664;
ret List.662;
procedure List.93 (List.436, List.437, List.438):
let List.683 : U64 = 0i64;
let List.684 : U64 = CallByName List.6 List.436;
let List.682 : List U8 = CallByName List.80 List.436 List.437 List.438 List.683 List.684;
ret List.682;
procedure List.93 (List.436, List.437, List.438):
let List.754 : U64 = 0i64;
let List.755 : U64 = CallByName List.6 List.436;
let List.753 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.80 List.436 List.437 List.438 List.754 List.755;
ret List.753;
procedure Num.127 (#Attr.2):
let Num.305 : U8 = lowlevel NumIntCast #Attr.2;

View file

@ -1090,221 +1090,221 @@ procedure Json.99 (Json.849):
ret Json.849;
procedure List.13 (#Attr.2, #Attr.3):
let List.595 : List Str = lowlevel ListPrepend #Attr.2 #Attr.3;
ret List.595;
let List.622 : List Str = lowlevel ListPrepend #Attr.2 #Attr.3;
ret List.622;
procedure List.139 (List.140, List.141, List.138):
let List.543 : {List U8, U64} = CallByName Json.236 List.140 List.141 List.138;
ret List.543;
procedure List.145 (List.146, List.147, List.144):
let List.570 : {List U8, U64} = CallByName Json.236 List.146 List.147 List.144;
ret List.570;
procedure List.139 (List.140, List.141, List.138):
let List.563 : List U8 = CallByName Json.214 List.140 List.141;
ret List.563;
procedure List.145 (List.146, List.147, List.144):
let List.590 : List U8 = CallByName Json.214 List.146 List.147;
ret List.590;
procedure List.18 (List.136, List.137, List.138):
let List.524 : {List U8, U64} = CallByName List.92 List.136 List.137 List.138;
ret List.524;
procedure List.18 (List.142, List.143, List.144):
let List.551 : {List U8, U64} = CallByName List.93 List.142 List.143 List.144;
ret List.551;
procedure List.18 (List.136, List.137, List.138):
let List.544 : List U8 = CallByName List.92 List.136 List.137 List.138;
ret List.544;
procedure List.18 (List.142, List.143, List.144):
let List.571 : List U8 = CallByName List.93 List.142 List.143 List.144;
ret List.571;
procedure List.26 (List.153, List.154, List.155):
let List.612 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.92 List.153 List.154 List.155;
let List.615 : U8 = 1i64;
let List.616 : U8 = GetTagId List.612;
let List.617 : Int1 = lowlevel Eq List.615 List.616;
if List.617 then
let List.156 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.612;
ret List.156;
procedure List.26 (List.159, List.160, List.161):
let List.639 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.93 List.159 List.160 List.161;
let List.642 : U8 = 1i64;
let List.643 : U8 = GetTagId List.639;
let List.644 : Int1 = lowlevel Eq List.642 List.643;
if List.644 then
let List.162 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.639;
ret List.162;
else
let List.157 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.612;
ret List.157;
let List.163 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.639;
ret List.163;
procedure List.31 (#Attr.2, #Attr.3):
let List.577 : List Str = lowlevel ListDropAt #Attr.2 #Attr.3;
ret List.577;
let List.604 : List Str = lowlevel ListDropAt #Attr.2 #Attr.3;
ret List.604;
procedure List.38 (List.292):
let List.585 : U64 = 0i64;
let List.584 : List Str = CallByName List.31 List.292 List.585;
ret List.584;
procedure List.38 (List.298):
let List.612 : U64 = 0i64;
let List.611 : List Str = CallByName List.31 List.298 List.612;
ret List.611;
procedure List.4 (List.107, List.108):
let List.520 : U64 = 1i64;
let List.519 : List Str = CallByName List.70 List.107 List.520;
let List.518 : List Str = CallByName List.71 List.519 List.108;
ret List.518;
procedure List.4 (List.113, List.114):
let List.547 : U64 = 1i64;
let List.546 : List Str = CallByName List.70 List.113 List.547;
let List.545 : List Str = CallByName List.71 List.546 List.114;
ret List.545;
procedure List.4 (List.107, List.108):
let List.523 : U64 = 1i64;
let List.522 : List U8 = CallByName List.70 List.107 List.523;
let List.521 : List U8 = CallByName List.71 List.522 List.108;
ret List.521;
procedure List.4 (List.113, List.114):
let List.550 : U64 = 1i64;
let List.549 : List U8 = CallByName List.70 List.113 List.550;
let List.548 : List U8 = CallByName List.71 List.549 List.114;
ret List.548;
procedure List.49 (List.370, List.371):
let List.604 : U64 = StructAtIndex 0 List.371;
let List.605 : U64 = 0i64;
let List.602 : Int1 = CallByName Bool.11 List.604 List.605;
if List.602 then
dec List.370;
let List.603 : List U8 = Array [];
ret List.603;
procedure List.49 (List.376, List.377):
let List.631 : U64 = StructAtIndex 0 List.377;
let List.632 : U64 = 0i64;
let List.629 : Int1 = CallByName Bool.11 List.631 List.632;
if List.629 then
dec List.376;
let List.630 : List U8 = Array [];
ret List.630;
else
let List.599 : U64 = StructAtIndex 1 List.371;
let List.600 : U64 = StructAtIndex 0 List.371;
let List.598 : List U8 = CallByName List.72 List.370 List.599 List.600;
ret List.598;
let List.626 : U64 = StructAtIndex 1 List.377;
let List.627 : U64 = StructAtIndex 0 List.377;
let List.625 : List U8 = CallByName List.72 List.376 List.626 List.627;
ret List.625;
procedure List.52 (List.385, List.386):
let List.387 : U64 = CallByName List.6 List.385;
joinpoint List.610 List.388:
let List.608 : U64 = 0i64;
let List.607 : {U64, U64} = Struct {List.388, List.608};
inc List.385;
let List.389 : List U8 = CallByName List.49 List.385 List.607;
let List.606 : U64 = CallByName Num.20 List.387 List.388;
let List.597 : {U64, U64} = Struct {List.606, List.388};
let List.390 : List U8 = CallByName List.49 List.385 List.597;
let List.596 : {List U8, List U8} = Struct {List.389, List.390};
ret List.596;
procedure List.52 (List.391, List.392):
let List.393 : U64 = CallByName List.6 List.391;
joinpoint List.637 List.394:
let List.635 : U64 = 0i64;
let List.634 : {U64, U64} = Struct {List.394, List.635};
inc List.391;
let List.395 : List U8 = CallByName List.49 List.391 List.634;
let List.633 : U64 = CallByName Num.20 List.393 List.394;
let List.624 : {U64, U64} = Struct {List.633, List.394};
let List.396 : List U8 = CallByName List.49 List.391 List.624;
let List.623 : {List U8, List U8} = Struct {List.395, List.396};
ret List.623;
in
let List.611 : Int1 = CallByName Num.24 List.387 List.386;
if List.611 then
jump List.610 List.386;
let List.638 : Int1 = CallByName Num.24 List.393 List.392;
if List.638 then
jump List.637 List.392;
else
jump List.610 List.387;
jump List.637 List.393;
procedure List.6 (#Attr.2):
let List.591 : U64 = lowlevel ListLen #Attr.2;
ret List.591;
let List.618 : U64 = lowlevel ListLen #Attr.2;
ret List.618;
procedure List.6 (#Attr.2):
let List.592 : U64 = lowlevel ListLen #Attr.2;
ret List.592;
let List.619 : U64 = lowlevel ListLen #Attr.2;
ret List.619;
procedure List.6 (#Attr.2):
let List.594 : U64 = lowlevel ListLen #Attr.2;
ret List.594;
let List.621 : U64 = lowlevel ListLen #Attr.2;
ret List.621;
procedure List.66 (#Attr.2, #Attr.3):
let List.540 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.540;
let List.567 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.567;
procedure List.66 (#Attr.2, #Attr.3):
let List.560 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.560;
procedure List.68 (#Attr.2):
let List.587 : List Str = lowlevel ListWithCapacity #Attr.2;
let List.587 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.587;
procedure List.68 (#Attr.2):
let List.589 : List U8 = lowlevel ListWithCapacity #Attr.2;
ret List.589;
let List.614 : List Str = lowlevel ListWithCapacity #Attr.2;
ret List.614;
procedure List.68 (#Attr.2):
let List.616 : List U8 = lowlevel ListWithCapacity #Attr.2;
ret List.616;
procedure List.70 (#Attr.2, #Attr.3):
let List.500 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.500;
procedure List.70 (#Attr.2, #Attr.3):
let List.517 : List Str = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.517;
procedure List.71 (#Attr.2, #Attr.3):
let List.498 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.498;
procedure List.71 (#Attr.2, #Attr.3):
let List.515 : List Str = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.515;
procedure List.72 (#Attr.2, #Attr.3, #Attr.4):
let List.601 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.601;
procedure List.8 (#Attr.2, #Attr.3):
let List.566 : List Str = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.566;
procedure List.8 (#Attr.2, #Attr.3):
let List.574 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.574;
procedure List.80 (List.648, List.649, List.650, List.651, List.652):
joinpoint List.530 List.433 List.434 List.435 List.436 List.437:
let List.532 : Int1 = CallByName Num.22 List.436 List.437;
if List.532 then
let List.539 : {Str, Str} = CallByName List.66 List.433 List.436;
inc List.539;
let List.533 : {List U8, U64} = CallByName List.139 List.434 List.539 List.435;
let List.536 : U64 = 1i64;
let List.535 : U64 = CallByName Num.19 List.436 List.536;
jump List.530 List.433 List.533 List.435 List.535 List.437;
else
dec List.433;
ret List.434;
in
jump List.530 List.648 List.649 List.650 List.651 List.652;
procedure List.80 (List.665, List.666, List.667, List.668, List.669):
joinpoint List.550 List.433 List.434 List.435 List.436 List.437:
let List.552 : Int1 = CallByName Num.22 List.436 List.437;
if List.552 then
let List.559 : U8 = CallByName List.66 List.433 List.436;
let List.553 : List U8 = CallByName List.139 List.434 List.559 List.435;
let List.556 : U64 = 1i64;
let List.555 : U64 = CallByName Num.19 List.436 List.556;
jump List.550 List.433 List.553 List.435 List.555 List.437;
else
dec List.433;
ret List.434;
in
jump List.550 List.665 List.666 List.667 List.668 List.669;
procedure List.80 (List.701, List.702, List.703, List.704, List.705):
joinpoint List.621 List.433 List.434 List.435 List.436 List.437:
let List.623 : Int1 = CallByName Num.22 List.436 List.437;
if List.623 then
let List.632 : U8 = CallByName List.66 List.433 List.436;
let List.624 : [C {U64, Int1}, C {U64, Int1}] = CallByName Json.188 List.434 List.632;
let List.629 : U8 = 1i64;
let List.630 : U8 = GetTagId List.624;
let List.631 : Int1 = lowlevel Eq List.629 List.630;
if List.631 then
let List.438 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.624;
let List.627 : U64 = 1i64;
let List.626 : U64 = CallByName Num.19 List.436 List.627;
jump List.621 List.433 List.438 List.435 List.626 List.437;
else
dec List.433;
let List.439 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.624;
let List.628 : [C {U64, Int1}, C {U64, Int1}] = TagId(0) List.439;
ret List.628;
else
dec List.433;
let List.622 : [C {U64, Int1}, C {U64, Int1}] = TagId(1) List.434;
ret List.622;
in
jump List.621 List.701 List.702 List.703 List.704 List.705;
procedure List.92 (List.430, List.431, List.432):
let List.528 : U64 = 0i64;
let List.529 : U64 = CallByName List.6 List.430;
let List.527 : {List U8, U64} = CallByName List.80 List.430 List.431 List.432 List.528 List.529;
let List.527 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.527;
procedure List.92 (List.430, List.431, List.432):
let List.548 : U64 = 0i64;
let List.549 : U64 = CallByName List.6 List.430;
let List.547 : List U8 = CallByName List.80 List.430 List.431 List.432 List.548 List.549;
ret List.547;
procedure List.70 (#Attr.2, #Attr.3):
let List.544 : List Str = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.544;
procedure List.92 (List.430, List.431, List.432):
let List.619 : U64 = 0i64;
let List.620 : U64 = CallByName List.6 List.430;
let List.618 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.80 List.430 List.431 List.432 List.619 List.620;
ret List.618;
procedure List.71 (#Attr.2, #Attr.3):
let List.525 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.525;
procedure List.71 (#Attr.2, #Attr.3):
let List.542 : List Str = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.542;
procedure List.72 (#Attr.2, #Attr.3, #Attr.4):
let List.628 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.628;
procedure List.8 (#Attr.2, #Attr.3):
let List.593 : List Str = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.593;
procedure List.8 (#Attr.2, #Attr.3):
let List.601 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.601;
procedure List.80 (List.675, List.676, List.677, List.678, List.679):
joinpoint List.557 List.439 List.440 List.441 List.442 List.443:
let List.559 : Int1 = CallByName Num.22 List.442 List.443;
if List.559 then
let List.566 : {Str, Str} = CallByName List.66 List.439 List.442;
inc List.566;
let List.560 : {List U8, U64} = CallByName List.145 List.440 List.566 List.441;
let List.563 : U64 = 1i64;
let List.562 : U64 = CallByName Num.19 List.442 List.563;
jump List.557 List.439 List.560 List.441 List.562 List.443;
else
dec List.439;
ret List.440;
in
jump List.557 List.675 List.676 List.677 List.678 List.679;
procedure List.80 (List.692, List.693, List.694, List.695, List.696):
joinpoint List.577 List.439 List.440 List.441 List.442 List.443:
let List.579 : Int1 = CallByName Num.22 List.442 List.443;
if List.579 then
let List.586 : U8 = CallByName List.66 List.439 List.442;
let List.580 : List U8 = CallByName List.145 List.440 List.586 List.441;
let List.583 : U64 = 1i64;
let List.582 : U64 = CallByName Num.19 List.442 List.583;
jump List.577 List.439 List.580 List.441 List.582 List.443;
else
dec List.439;
ret List.440;
in
jump List.577 List.692 List.693 List.694 List.695 List.696;
procedure List.80 (List.728, List.729, List.730, List.731, List.732):
joinpoint List.648 List.439 List.440 List.441 List.442 List.443:
let List.650 : Int1 = CallByName Num.22 List.442 List.443;
if List.650 then
let List.659 : U8 = CallByName List.66 List.439 List.442;
let List.651 : [C {U64, Int1}, C {U64, Int1}] = CallByName Json.188 List.440 List.659;
let List.656 : U8 = 1i64;
let List.657 : U8 = GetTagId List.651;
let List.658 : Int1 = lowlevel Eq List.656 List.657;
if List.658 then
let List.444 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.651;
let List.654 : U64 = 1i64;
let List.653 : U64 = CallByName Num.19 List.442 List.654;
jump List.648 List.439 List.444 List.441 List.653 List.443;
else
dec List.439;
let List.445 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.651;
let List.655 : [C {U64, Int1}, C {U64, Int1}] = TagId(0) List.445;
ret List.655;
else
dec List.439;
let List.649 : [C {U64, Int1}, C {U64, Int1}] = TagId(1) List.440;
ret List.649;
in
jump List.648 List.728 List.729 List.730 List.731 List.732;
procedure List.93 (List.436, List.437, List.438):
let List.555 : U64 = 0i64;
let List.556 : U64 = CallByName List.6 List.436;
let List.554 : {List U8, U64} = CallByName List.80 List.436 List.437 List.438 List.555 List.556;
ret List.554;
procedure List.93 (List.436, List.437, List.438):
let List.575 : U64 = 0i64;
let List.576 : U64 = CallByName List.6 List.436;
let List.574 : List U8 = CallByName List.80 List.436 List.437 List.438 List.575 List.576;
ret List.574;
procedure List.93 (List.436, List.437, List.438):
let List.646 : U64 = 0i64;
let List.647 : U64 = CallByName List.6 List.436;
let List.645 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.80 List.436 List.437 List.438 List.646 List.647;
ret List.645;
procedure Num.127 (#Attr.2):
let Num.286 : U8 = lowlevel NumIntCast #Attr.2;

View file

@ -1097,221 +1097,221 @@ procedure Json.99 (Json.849):
ret Json.849;
procedure List.13 (#Attr.2, #Attr.3):
let List.595 : List Str = lowlevel ListPrepend #Attr.2 #Attr.3;
ret List.595;
let List.622 : List Str = lowlevel ListPrepend #Attr.2 #Attr.3;
ret List.622;
procedure List.139 (List.140, List.141, List.138):
let List.543 : {List U8, U64} = CallByName Json.236 List.140 List.141 List.138;
ret List.543;
procedure List.145 (List.146, List.147, List.144):
let List.570 : {List U8, U64} = CallByName Json.236 List.146 List.147 List.144;
ret List.570;
procedure List.139 (List.140, List.141, List.138):
let List.563 : List U8 = CallByName Json.214 List.140 List.141;
ret List.563;
procedure List.145 (List.146, List.147, List.144):
let List.590 : List U8 = CallByName Json.214 List.146 List.147;
ret List.590;
procedure List.18 (List.136, List.137, List.138):
let List.524 : {List U8, U64} = CallByName List.92 List.136 List.137 List.138;
ret List.524;
procedure List.18 (List.142, List.143, List.144):
let List.551 : {List U8, U64} = CallByName List.93 List.142 List.143 List.144;
ret List.551;
procedure List.18 (List.136, List.137, List.138):
let List.544 : List U8 = CallByName List.92 List.136 List.137 List.138;
ret List.544;
procedure List.18 (List.142, List.143, List.144):
let List.571 : List U8 = CallByName List.93 List.142 List.143 List.144;
ret List.571;
procedure List.26 (List.153, List.154, List.155):
let List.612 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.92 List.153 List.154 List.155;
let List.615 : U8 = 1i64;
let List.616 : U8 = GetTagId List.612;
let List.617 : Int1 = lowlevel Eq List.615 List.616;
if List.617 then
let List.156 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.612;
ret List.156;
procedure List.26 (List.159, List.160, List.161):
let List.639 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.93 List.159 List.160 List.161;
let List.642 : U8 = 1i64;
let List.643 : U8 = GetTagId List.639;
let List.644 : Int1 = lowlevel Eq List.642 List.643;
if List.644 then
let List.162 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.639;
ret List.162;
else
let List.157 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.612;
ret List.157;
let List.163 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.639;
ret List.163;
procedure List.31 (#Attr.2, #Attr.3):
let List.577 : List Str = lowlevel ListDropAt #Attr.2 #Attr.3;
ret List.577;
let List.604 : List Str = lowlevel ListDropAt #Attr.2 #Attr.3;
ret List.604;
procedure List.38 (List.292):
let List.585 : U64 = 0i64;
let List.584 : List Str = CallByName List.31 List.292 List.585;
ret List.584;
procedure List.38 (List.298):
let List.612 : U64 = 0i64;
let List.611 : List Str = CallByName List.31 List.298 List.612;
ret List.611;
procedure List.4 (List.107, List.108):
let List.520 : U64 = 1i64;
let List.519 : List Str = CallByName List.70 List.107 List.520;
let List.518 : List Str = CallByName List.71 List.519 List.108;
ret List.518;
procedure List.4 (List.113, List.114):
let List.547 : U64 = 1i64;
let List.546 : List Str = CallByName List.70 List.113 List.547;
let List.545 : List Str = CallByName List.71 List.546 List.114;
ret List.545;
procedure List.4 (List.107, List.108):
let List.523 : U64 = 1i64;
let List.522 : List U8 = CallByName List.70 List.107 List.523;
let List.521 : List U8 = CallByName List.71 List.522 List.108;
ret List.521;
procedure List.4 (List.113, List.114):
let List.550 : U64 = 1i64;
let List.549 : List U8 = CallByName List.70 List.113 List.550;
let List.548 : List U8 = CallByName List.71 List.549 List.114;
ret List.548;
procedure List.49 (List.370, List.371):
let List.604 : U64 = StructAtIndex 0 List.371;
let List.605 : U64 = 0i64;
let List.602 : Int1 = CallByName Bool.11 List.604 List.605;
if List.602 then
dec List.370;
let List.603 : List U8 = Array [];
ret List.603;
procedure List.49 (List.376, List.377):
let List.631 : U64 = StructAtIndex 0 List.377;
let List.632 : U64 = 0i64;
let List.629 : Int1 = CallByName Bool.11 List.631 List.632;
if List.629 then
dec List.376;
let List.630 : List U8 = Array [];
ret List.630;
else
let List.599 : U64 = StructAtIndex 1 List.371;
let List.600 : U64 = StructAtIndex 0 List.371;
let List.598 : List U8 = CallByName List.72 List.370 List.599 List.600;
ret List.598;
let List.626 : U64 = StructAtIndex 1 List.377;
let List.627 : U64 = StructAtIndex 0 List.377;
let List.625 : List U8 = CallByName List.72 List.376 List.626 List.627;
ret List.625;
procedure List.52 (List.385, List.386):
let List.387 : U64 = CallByName List.6 List.385;
joinpoint List.610 List.388:
let List.608 : U64 = 0i64;
let List.607 : {U64, U64} = Struct {List.388, List.608};
inc List.385;
let List.389 : List U8 = CallByName List.49 List.385 List.607;
let List.606 : U64 = CallByName Num.20 List.387 List.388;
let List.597 : {U64, U64} = Struct {List.606, List.388};
let List.390 : List U8 = CallByName List.49 List.385 List.597;
let List.596 : {List U8, List U8} = Struct {List.389, List.390};
ret List.596;
procedure List.52 (List.391, List.392):
let List.393 : U64 = CallByName List.6 List.391;
joinpoint List.637 List.394:
let List.635 : U64 = 0i64;
let List.634 : {U64, U64} = Struct {List.394, List.635};
inc List.391;
let List.395 : List U8 = CallByName List.49 List.391 List.634;
let List.633 : U64 = CallByName Num.20 List.393 List.394;
let List.624 : {U64, U64} = Struct {List.633, List.394};
let List.396 : List U8 = CallByName List.49 List.391 List.624;
let List.623 : {List U8, List U8} = Struct {List.395, List.396};
ret List.623;
in
let List.611 : Int1 = CallByName Num.24 List.387 List.386;
if List.611 then
jump List.610 List.386;
let List.638 : Int1 = CallByName Num.24 List.393 List.392;
if List.638 then
jump List.637 List.392;
else
jump List.610 List.387;
jump List.637 List.393;
procedure List.6 (#Attr.2):
let List.591 : U64 = lowlevel ListLen #Attr.2;
ret List.591;
let List.618 : U64 = lowlevel ListLen #Attr.2;
ret List.618;
procedure List.6 (#Attr.2):
let List.592 : U64 = lowlevel ListLen #Attr.2;
ret List.592;
let List.619 : U64 = lowlevel ListLen #Attr.2;
ret List.619;
procedure List.6 (#Attr.2):
let List.594 : U64 = lowlevel ListLen #Attr.2;
ret List.594;
let List.621 : U64 = lowlevel ListLen #Attr.2;
ret List.621;
procedure List.66 (#Attr.2, #Attr.3):
let List.540 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.540;
let List.567 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.567;
procedure List.66 (#Attr.2, #Attr.3):
let List.560 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.560;
procedure List.68 (#Attr.2):
let List.587 : List Str = lowlevel ListWithCapacity #Attr.2;
let List.587 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.587;
procedure List.68 (#Attr.2):
let List.589 : List U8 = lowlevel ListWithCapacity #Attr.2;
ret List.589;
let List.614 : List Str = lowlevel ListWithCapacity #Attr.2;
ret List.614;
procedure List.68 (#Attr.2):
let List.616 : List U8 = lowlevel ListWithCapacity #Attr.2;
ret List.616;
procedure List.70 (#Attr.2, #Attr.3):
let List.500 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.500;
procedure List.70 (#Attr.2, #Attr.3):
let List.517 : List Str = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.517;
procedure List.71 (#Attr.2, #Attr.3):
let List.498 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.498;
procedure List.71 (#Attr.2, #Attr.3):
let List.515 : List Str = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.515;
procedure List.72 (#Attr.2, #Attr.3, #Attr.4):
let List.601 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.601;
procedure List.8 (#Attr.2, #Attr.3):
let List.566 : List Str = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.566;
procedure List.8 (#Attr.2, #Attr.3):
let List.574 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.574;
procedure List.80 (List.648, List.649, List.650, List.651, List.652):
joinpoint List.530 List.433 List.434 List.435 List.436 List.437:
let List.532 : Int1 = CallByName Num.22 List.436 List.437;
if List.532 then
let List.539 : {Str, Str} = CallByName List.66 List.433 List.436;
inc List.539;
let List.533 : {List U8, U64} = CallByName List.139 List.434 List.539 List.435;
let List.536 : U64 = 1i64;
let List.535 : U64 = CallByName Num.19 List.436 List.536;
jump List.530 List.433 List.533 List.435 List.535 List.437;
else
dec List.433;
ret List.434;
in
jump List.530 List.648 List.649 List.650 List.651 List.652;
procedure List.80 (List.665, List.666, List.667, List.668, List.669):
joinpoint List.550 List.433 List.434 List.435 List.436 List.437:
let List.552 : Int1 = CallByName Num.22 List.436 List.437;
if List.552 then
let List.559 : U8 = CallByName List.66 List.433 List.436;
let List.553 : List U8 = CallByName List.139 List.434 List.559 List.435;
let List.556 : U64 = 1i64;
let List.555 : U64 = CallByName Num.19 List.436 List.556;
jump List.550 List.433 List.553 List.435 List.555 List.437;
else
dec List.433;
ret List.434;
in
jump List.550 List.665 List.666 List.667 List.668 List.669;
procedure List.80 (List.701, List.702, List.703, List.704, List.705):
joinpoint List.621 List.433 List.434 List.435 List.436 List.437:
let List.623 : Int1 = CallByName Num.22 List.436 List.437;
if List.623 then
let List.632 : U8 = CallByName List.66 List.433 List.436;
let List.624 : [C {U64, Int1}, C {U64, Int1}] = CallByName Json.188 List.434 List.632;
let List.629 : U8 = 1i64;
let List.630 : U8 = GetTagId List.624;
let List.631 : Int1 = lowlevel Eq List.629 List.630;
if List.631 then
let List.438 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.624;
let List.627 : U64 = 1i64;
let List.626 : U64 = CallByName Num.19 List.436 List.627;
jump List.621 List.433 List.438 List.435 List.626 List.437;
else
dec List.433;
let List.439 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.624;
let List.628 : [C {U64, Int1}, C {U64, Int1}] = TagId(0) List.439;
ret List.628;
else
dec List.433;
let List.622 : [C {U64, Int1}, C {U64, Int1}] = TagId(1) List.434;
ret List.622;
in
jump List.621 List.701 List.702 List.703 List.704 List.705;
procedure List.92 (List.430, List.431, List.432):
let List.528 : U64 = 0i64;
let List.529 : U64 = CallByName List.6 List.430;
let List.527 : {List U8, U64} = CallByName List.80 List.430 List.431 List.432 List.528 List.529;
let List.527 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.527;
procedure List.92 (List.430, List.431, List.432):
let List.548 : U64 = 0i64;
let List.549 : U64 = CallByName List.6 List.430;
let List.547 : List U8 = CallByName List.80 List.430 List.431 List.432 List.548 List.549;
ret List.547;
procedure List.70 (#Attr.2, #Attr.3):
let List.544 : List Str = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.544;
procedure List.92 (List.430, List.431, List.432):
let List.619 : U64 = 0i64;
let List.620 : U64 = CallByName List.6 List.430;
let List.618 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.80 List.430 List.431 List.432 List.619 List.620;
ret List.618;
procedure List.71 (#Attr.2, #Attr.3):
let List.525 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.525;
procedure List.71 (#Attr.2, #Attr.3):
let List.542 : List Str = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.542;
procedure List.72 (#Attr.2, #Attr.3, #Attr.4):
let List.628 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.628;
procedure List.8 (#Attr.2, #Attr.3):
let List.593 : List Str = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.593;
procedure List.8 (#Attr.2, #Attr.3):
let List.601 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.601;
procedure List.80 (List.675, List.676, List.677, List.678, List.679):
joinpoint List.557 List.439 List.440 List.441 List.442 List.443:
let List.559 : Int1 = CallByName Num.22 List.442 List.443;
if List.559 then
let List.566 : {Str, Str} = CallByName List.66 List.439 List.442;
inc List.566;
let List.560 : {List U8, U64} = CallByName List.145 List.440 List.566 List.441;
let List.563 : U64 = 1i64;
let List.562 : U64 = CallByName Num.19 List.442 List.563;
jump List.557 List.439 List.560 List.441 List.562 List.443;
else
dec List.439;
ret List.440;
in
jump List.557 List.675 List.676 List.677 List.678 List.679;
procedure List.80 (List.692, List.693, List.694, List.695, List.696):
joinpoint List.577 List.439 List.440 List.441 List.442 List.443:
let List.579 : Int1 = CallByName Num.22 List.442 List.443;
if List.579 then
let List.586 : U8 = CallByName List.66 List.439 List.442;
let List.580 : List U8 = CallByName List.145 List.440 List.586 List.441;
let List.583 : U64 = 1i64;
let List.582 : U64 = CallByName Num.19 List.442 List.583;
jump List.577 List.439 List.580 List.441 List.582 List.443;
else
dec List.439;
ret List.440;
in
jump List.577 List.692 List.693 List.694 List.695 List.696;
procedure List.80 (List.728, List.729, List.730, List.731, List.732):
joinpoint List.648 List.439 List.440 List.441 List.442 List.443:
let List.650 : Int1 = CallByName Num.22 List.442 List.443;
if List.650 then
let List.659 : U8 = CallByName List.66 List.439 List.442;
let List.651 : [C {U64, Int1}, C {U64, Int1}] = CallByName Json.188 List.440 List.659;
let List.656 : U8 = 1i64;
let List.657 : U8 = GetTagId List.651;
let List.658 : Int1 = lowlevel Eq List.656 List.657;
if List.658 then
let List.444 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.651;
let List.654 : U64 = 1i64;
let List.653 : U64 = CallByName Num.19 List.442 List.654;
jump List.648 List.439 List.444 List.441 List.653 List.443;
else
dec List.439;
let List.445 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.651;
let List.655 : [C {U64, Int1}, C {U64, Int1}] = TagId(0) List.445;
ret List.655;
else
dec List.439;
let List.649 : [C {U64, Int1}, C {U64, Int1}] = TagId(1) List.440;
ret List.649;
in
jump List.648 List.728 List.729 List.730 List.731 List.732;
procedure List.93 (List.436, List.437, List.438):
let List.555 : U64 = 0i64;
let List.556 : U64 = CallByName List.6 List.436;
let List.554 : {List U8, U64} = CallByName List.80 List.436 List.437 List.438 List.555 List.556;
ret List.554;
procedure List.93 (List.436, List.437, List.438):
let List.575 : U64 = 0i64;
let List.576 : U64 = CallByName List.6 List.436;
let List.574 : List U8 = CallByName List.80 List.436 List.437 List.438 List.575 List.576;
ret List.574;
procedure List.93 (List.436, List.437, List.438):
let List.646 : U64 = 0i64;
let List.647 : U64 = CallByName List.6 List.436;
let List.645 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.80 List.436 List.437 List.438 List.646 List.647;
ret List.645;
procedure Num.127 (#Attr.2):
let Num.286 : U8 = lowlevel NumIntCast #Attr.2;

View file

@ -185,131 +185,131 @@ procedure Json.26 (Json.217):
ret Json.1210;
procedure List.139 (List.140, List.141, List.138):
let List.526 : List U8 = CallByName Json.214 List.140 List.141;
ret List.526;
procedure List.145 (List.146, List.147, List.144):
let List.553 : List U8 = CallByName Json.214 List.146 List.147;
ret List.553;
procedure List.18 (List.136, List.137, List.138):
let List.508 : List U8 = CallByName List.92 List.136 List.137 List.138;
ret List.508;
procedure List.18 (List.142, List.143, List.144):
let List.535 : List U8 = CallByName List.93 List.142 List.143 List.144;
ret List.535;
procedure List.26 (List.153, List.154, List.155):
let List.543 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.92 List.153 List.154 List.155;
let List.546 : U8 = 1i64;
let List.547 : U8 = GetTagId List.543;
let List.548 : Int1 = lowlevel Eq List.546 List.547;
if List.548 then
let List.156 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.543;
ret List.156;
procedure List.26 (List.159, List.160, List.161):
let List.570 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.93 List.159 List.160 List.161;
let List.573 : U8 = 1i64;
let List.574 : U8 = GetTagId List.570;
let List.575 : Int1 = lowlevel Eq List.573 List.574;
if List.575 then
let List.162 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.570;
ret List.162;
else
let List.157 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.543;
ret List.157;
let List.163 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.570;
ret List.163;
procedure List.49 (List.370, List.371):
let List.535 : U64 = StructAtIndex 0 List.371;
let List.536 : U64 = 0i64;
let List.533 : Int1 = CallByName Bool.11 List.535 List.536;
if List.533 then
dec List.370;
let List.534 : List U8 = Array [];
ret List.534;
procedure List.49 (List.376, List.377):
let List.562 : U64 = StructAtIndex 0 List.377;
let List.563 : U64 = 0i64;
let List.560 : Int1 = CallByName Bool.11 List.562 List.563;
if List.560 then
dec List.376;
let List.561 : List U8 = Array [];
ret List.561;
else
let List.530 : U64 = StructAtIndex 1 List.371;
let List.531 : U64 = StructAtIndex 0 List.371;
let List.529 : List U8 = CallByName List.72 List.370 List.530 List.531;
ret List.529;
let List.557 : U64 = StructAtIndex 1 List.377;
let List.558 : U64 = StructAtIndex 0 List.377;
let List.556 : List U8 = CallByName List.72 List.376 List.557 List.558;
ret List.556;
procedure List.52 (List.385, List.386):
let List.387 : U64 = CallByName List.6 List.385;
joinpoint List.541 List.388:
let List.539 : U64 = 0i64;
let List.538 : {U64, U64} = Struct {List.388, List.539};
inc List.385;
let List.389 : List U8 = CallByName List.49 List.385 List.538;
let List.537 : U64 = CallByName Num.20 List.387 List.388;
let List.528 : {U64, U64} = Struct {List.537, List.388};
let List.390 : List U8 = CallByName List.49 List.385 List.528;
let List.527 : {List U8, List U8} = Struct {List.389, List.390};
ret List.527;
procedure List.52 (List.391, List.392):
let List.393 : U64 = CallByName List.6 List.391;
joinpoint List.568 List.394:
let List.566 : U64 = 0i64;
let List.565 : {U64, U64} = Struct {List.394, List.566};
inc List.391;
let List.395 : List U8 = CallByName List.49 List.391 List.565;
let List.564 : U64 = CallByName Num.20 List.393 List.394;
let List.555 : {U64, U64} = Struct {List.564, List.394};
let List.396 : List U8 = CallByName List.49 List.391 List.555;
let List.554 : {List U8, List U8} = Struct {List.395, List.396};
ret List.554;
in
let List.542 : Int1 = CallByName Num.24 List.387 List.386;
if List.542 then
jump List.541 List.386;
let List.569 : Int1 = CallByName Num.24 List.393 List.392;
if List.569 then
jump List.568 List.392;
else
jump List.541 List.387;
jump List.568 List.393;
procedure List.6 (#Attr.2):
let List.507 : U64 = lowlevel ListLen #Attr.2;
ret List.507;
let List.534 : U64 = lowlevel ListLen #Attr.2;
ret List.534;
procedure List.66 (#Attr.2, #Attr.3):
let List.524 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.524;
let List.551 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.551;
procedure List.68 (#Attr.2):
let List.505 : List U8 = lowlevel ListWithCapacity #Attr.2;
ret List.505;
procedure List.72 (#Attr.2, #Attr.3, #Attr.4):
let List.532 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
let List.532 : List U8 = lowlevel ListWithCapacity #Attr.2;
ret List.532;
procedure List.72 (#Attr.2, #Attr.3, #Attr.4):
let List.559 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.559;
procedure List.8 (#Attr.2, #Attr.3):
let List.503 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.503;
let List.530 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.530;
procedure List.80 (List.571, List.572, List.573, List.574, List.575):
joinpoint List.514 List.433 List.434 List.435 List.436 List.437:
let List.516 : Int1 = CallByName Num.22 List.436 List.437;
if List.516 then
let List.523 : U8 = CallByName List.66 List.433 List.436;
let List.517 : List U8 = CallByName List.139 List.434 List.523 List.435;
let List.520 : U64 = 1i64;
let List.519 : U64 = CallByName Num.19 List.436 List.520;
jump List.514 List.433 List.517 List.435 List.519 List.437;
procedure List.80 (List.598, List.599, List.600, List.601, List.602):
joinpoint List.541 List.439 List.440 List.441 List.442 List.443:
let List.543 : Int1 = CallByName Num.22 List.442 List.443;
if List.543 then
let List.550 : U8 = CallByName List.66 List.439 List.442;
let List.544 : List U8 = CallByName List.145 List.440 List.550 List.441;
let List.547 : U64 = 1i64;
let List.546 : U64 = CallByName Num.19 List.442 List.547;
jump List.541 List.439 List.544 List.441 List.546 List.443;
else
dec List.433;
ret List.434;
dec List.439;
ret List.440;
in
jump List.514 List.571 List.572 List.573 List.574 List.575;
jump List.541 List.598 List.599 List.600 List.601 List.602;
procedure List.80 (List.594, List.595, List.596, List.597, List.598):
joinpoint List.552 List.433 List.434 List.435 List.436 List.437:
let List.554 : Int1 = CallByName Num.22 List.436 List.437;
if List.554 then
let List.563 : U8 = CallByName List.66 List.433 List.436;
let List.555 : [C {U64, Int1}, C {U64, Int1}] = CallByName Json.188 List.434 List.563;
let List.560 : U8 = 1i64;
let List.561 : U8 = GetTagId List.555;
let List.562 : Int1 = lowlevel Eq List.560 List.561;
if List.562 then
let List.438 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.555;
let List.558 : U64 = 1i64;
let List.557 : U64 = CallByName Num.19 List.436 List.558;
jump List.552 List.433 List.438 List.435 List.557 List.437;
procedure List.80 (List.621, List.622, List.623, List.624, List.625):
joinpoint List.579 List.439 List.440 List.441 List.442 List.443:
let List.581 : Int1 = CallByName Num.22 List.442 List.443;
if List.581 then
let List.590 : U8 = CallByName List.66 List.439 List.442;
let List.582 : [C {U64, Int1}, C {U64, Int1}] = CallByName Json.188 List.440 List.590;
let List.587 : U8 = 1i64;
let List.588 : U8 = GetTagId List.582;
let List.589 : Int1 = lowlevel Eq List.587 List.588;
if List.589 then
let List.444 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.582;
let List.585 : U64 = 1i64;
let List.584 : U64 = CallByName Num.19 List.442 List.585;
jump List.579 List.439 List.444 List.441 List.584 List.443;
else
dec List.433;
let List.439 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.555;
let List.559 : [C {U64, Int1}, C {U64, Int1}] = TagId(0) List.439;
ret List.559;
dec List.439;
let List.445 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.582;
let List.586 : [C {U64, Int1}, C {U64, Int1}] = TagId(0) List.445;
ret List.586;
else
dec List.433;
let List.553 : [C {U64, Int1}, C {U64, Int1}] = TagId(1) List.434;
ret List.553;
dec List.439;
let List.580 : [C {U64, Int1}, C {U64, Int1}] = TagId(1) List.440;
ret List.580;
in
jump List.552 List.594 List.595 List.596 List.597 List.598;
jump List.579 List.621 List.622 List.623 List.624 List.625;
procedure List.92 (List.430, List.431, List.432):
let List.512 : U64 = 0i64;
let List.513 : U64 = CallByName List.6 List.430;
let List.511 : List U8 = CallByName List.80 List.430 List.431 List.432 List.512 List.513;
ret List.511;
procedure List.93 (List.436, List.437, List.438):
let List.539 : U64 = 0i64;
let List.540 : U64 = CallByName List.6 List.436;
let List.538 : List U8 = CallByName List.80 List.436 List.437 List.438 List.539 List.540;
ret List.538;
procedure List.92 (List.430, List.431, List.432):
let List.550 : U64 = 0i64;
let List.551 : U64 = CallByName List.6 List.430;
let List.549 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.80 List.430 List.431 List.432 List.550 List.551;
ret List.549;
procedure List.93 (List.436, List.437, List.438):
let List.577 : U64 = 0i64;
let List.578 : U64 = CallByName List.6 List.436;
let List.576 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.80 List.436 List.437 List.438 List.577 List.578;
ret List.576;
procedure Num.19 (#Attr.2, #Attr.3):
let Num.286 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;

View file

@ -271,183 +271,183 @@ procedure Json.31 (Json.261, Json.262):
let Json.1172 : {Str, List Str} = CallByName Encode.23 Json.1173;
ret Json.1172;
procedure List.139 (List.140, List.141, List.138):
let List.541 : {List U8, U64} = CallByName Json.266 List.140 List.141 List.138;
ret List.541;
procedure List.145 (List.146, List.147, List.144):
let List.568 : {List U8, U64} = CallByName Json.266 List.146 List.147 List.144;
ret List.568;
procedure List.139 (List.140, List.141, List.138):
let List.561 : List U8 = CallByName Json.214 List.140 List.141;
ret List.561;
procedure List.145 (List.146, List.147, List.144):
let List.588 : List U8 = CallByName Json.214 List.146 List.147;
ret List.588;
procedure List.18 (List.136, List.137, List.138):
let List.522 : {List U8, U64} = CallByName List.92 List.136 List.137 List.138;
ret List.522;
procedure List.18 (List.142, List.143, List.144):
let List.549 : {List U8, U64} = CallByName List.93 List.142 List.143 List.144;
ret List.549;
procedure List.18 (List.136, List.137, List.138):
let List.542 : List U8 = CallByName List.92 List.136 List.137 List.138;
ret List.542;
procedure List.18 (List.142, List.143, List.144):
let List.569 : List U8 = CallByName List.93 List.142 List.143 List.144;
ret List.569;
procedure List.26 (List.153, List.154, List.155):
let List.592 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.92 List.153 List.154 List.155;
let List.595 : U8 = 1i64;
let List.596 : U8 = GetTagId List.592;
let List.597 : Int1 = lowlevel Eq List.595 List.596;
if List.597 then
let List.156 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.592;
ret List.156;
procedure List.26 (List.159, List.160, List.161):
let List.619 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.93 List.159 List.160 List.161;
let List.622 : U8 = 1i64;
let List.623 : U8 = GetTagId List.619;
let List.624 : Int1 = lowlevel Eq List.622 List.623;
if List.624 then
let List.162 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.619;
ret List.162;
else
let List.157 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.592;
ret List.157;
let List.163 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.619;
ret List.163;
procedure List.4 (List.107, List.108):
let List.521 : U64 = 1i64;
let List.520 : List U8 = CallByName List.70 List.107 List.521;
let List.519 : List U8 = CallByName List.71 List.520 List.108;
ret List.519;
procedure List.4 (List.113, List.114):
let List.548 : U64 = 1i64;
let List.547 : List U8 = CallByName List.70 List.113 List.548;
let List.546 : List U8 = CallByName List.71 List.547 List.114;
ret List.546;
procedure List.49 (List.370, List.371):
let List.584 : U64 = StructAtIndex 0 List.371;
let List.585 : U64 = 0i64;
let List.582 : Int1 = CallByName Bool.11 List.584 List.585;
if List.582 then
dec List.370;
let List.583 : List U8 = Array [];
ret List.583;
procedure List.49 (List.376, List.377):
let List.611 : U64 = StructAtIndex 0 List.377;
let List.612 : U64 = 0i64;
let List.609 : Int1 = CallByName Bool.11 List.611 List.612;
if List.609 then
dec List.376;
let List.610 : List U8 = Array [];
ret List.610;
else
let List.579 : U64 = StructAtIndex 1 List.371;
let List.580 : U64 = StructAtIndex 0 List.371;
let List.578 : List U8 = CallByName List.72 List.370 List.579 List.580;
ret List.578;
let List.606 : U64 = StructAtIndex 1 List.377;
let List.607 : U64 = StructAtIndex 0 List.377;
let List.605 : List U8 = CallByName List.72 List.376 List.606 List.607;
ret List.605;
procedure List.52 (List.385, List.386):
let List.387 : U64 = CallByName List.6 List.385;
joinpoint List.590 List.388:
let List.588 : U64 = 0i64;
let List.587 : {U64, U64} = Struct {List.388, List.588};
inc List.385;
let List.389 : List U8 = CallByName List.49 List.385 List.587;
let List.586 : U64 = CallByName Num.20 List.387 List.388;
let List.577 : {U64, U64} = Struct {List.586, List.388};
let List.390 : List U8 = CallByName List.49 List.385 List.577;
let List.576 : {List U8, List U8} = Struct {List.389, List.390};
ret List.576;
procedure List.52 (List.391, List.392):
let List.393 : U64 = CallByName List.6 List.391;
joinpoint List.617 List.394:
let List.615 : U64 = 0i64;
let List.614 : {U64, U64} = Struct {List.394, List.615};
inc List.391;
let List.395 : List U8 = CallByName List.49 List.391 List.614;
let List.613 : U64 = CallByName Num.20 List.393 List.394;
let List.604 : {U64, U64} = Struct {List.613, List.394};
let List.396 : List U8 = CallByName List.49 List.391 List.604;
let List.603 : {List U8, List U8} = Struct {List.395, List.396};
ret List.603;
in
let List.591 : Int1 = CallByName Num.24 List.387 List.386;
if List.591 then
jump List.590 List.386;
let List.618 : Int1 = CallByName Num.24 List.393 List.392;
if List.618 then
jump List.617 List.392;
else
jump List.590 List.387;
jump List.617 List.393;
procedure List.6 (#Attr.2):
let List.562 : U64 = lowlevel ListLen #Attr.2;
ret List.562;
let List.589 : U64 = lowlevel ListLen #Attr.2;
ret List.589;
procedure List.6 (#Attr.2):
let List.564 : U64 = lowlevel ListLen #Attr.2;
ret List.564;
let List.591 : U64 = lowlevel ListLen #Attr.2;
ret List.591;
procedure List.66 (#Attr.2, #Attr.3):
let List.538 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.538;
let List.565 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.565;
procedure List.66 (#Attr.2, #Attr.3):
let List.558 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.558;
let List.585 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.585;
procedure List.68 (#Attr.2):
let List.575 : List U8 = lowlevel ListWithCapacity #Attr.2;
ret List.575;
let List.602 : List U8 = lowlevel ListWithCapacity #Attr.2;
ret List.602;
procedure List.70 (#Attr.2, #Attr.3):
let List.500 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.500;
let List.527 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.527;
procedure List.71 (#Attr.2, #Attr.3):
let List.498 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.498;
procedure List.72 (#Attr.2, #Attr.3, #Attr.4):
let List.581 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.581;
procedure List.8 (#Attr.2, #Attr.3):
let List.573 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.573;
procedure List.80 (List.622, List.623, List.624, List.625, List.626):
joinpoint List.528 List.433 List.434 List.435 List.436 List.437:
let List.530 : Int1 = CallByName Num.22 List.436 List.437;
if List.530 then
let List.537 : Str = CallByName List.66 List.433 List.436;
inc List.537;
let List.531 : {List U8, U64} = CallByName List.139 List.434 List.537 List.435;
let List.534 : U64 = 1i64;
let List.533 : U64 = CallByName Num.19 List.436 List.534;
jump List.528 List.433 List.531 List.435 List.533 List.437;
else
dec List.433;
ret List.434;
in
jump List.528 List.622 List.623 List.624 List.625 List.626;
procedure List.80 (List.639, List.640, List.641, List.642, List.643):
joinpoint List.548 List.433 List.434 List.435 List.436 List.437:
let List.550 : Int1 = CallByName Num.22 List.436 List.437;
if List.550 then
let List.557 : U8 = CallByName List.66 List.433 List.436;
let List.551 : List U8 = CallByName List.139 List.434 List.557 List.435;
let List.554 : U64 = 1i64;
let List.553 : U64 = CallByName Num.19 List.436 List.554;
jump List.548 List.433 List.551 List.435 List.553 List.437;
else
dec List.433;
ret List.434;
in
jump List.548 List.639 List.640 List.641 List.642 List.643;
procedure List.80 (List.666, List.667, List.668, List.669, List.670):
joinpoint List.601 List.433 List.434 List.435 List.436 List.437:
let List.603 : Int1 = CallByName Num.22 List.436 List.437;
if List.603 then
let List.612 : U8 = CallByName List.66 List.433 List.436;
let List.604 : [C {U64, Int1}, C {U64, Int1}] = CallByName Json.188 List.434 List.612;
let List.609 : U8 = 1i64;
let List.610 : U8 = GetTagId List.604;
let List.611 : Int1 = lowlevel Eq List.609 List.610;
if List.611 then
let List.438 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.604;
let List.607 : U64 = 1i64;
let List.606 : U64 = CallByName Num.19 List.436 List.607;
jump List.601 List.433 List.438 List.435 List.606 List.437;
else
dec List.433;
let List.439 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.604;
let List.608 : [C {U64, Int1}, C {U64, Int1}] = TagId(0) List.439;
ret List.608;
else
dec List.433;
let List.602 : [C {U64, Int1}, C {U64, Int1}] = TagId(1) List.434;
ret List.602;
in
jump List.601 List.666 List.667 List.668 List.669 List.670;
procedure List.92 (List.430, List.431, List.432):
let List.526 : U64 = 0i64;
let List.527 : U64 = CallByName List.6 List.430;
let List.525 : {List U8, U64} = CallByName List.80 List.430 List.431 List.432 List.526 List.527;
let List.525 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.525;
procedure List.92 (List.430, List.431, List.432):
let List.546 : U64 = 0i64;
let List.547 : U64 = CallByName List.6 List.430;
let List.545 : List U8 = CallByName List.80 List.430 List.431 List.432 List.546 List.547;
ret List.545;
procedure List.72 (#Attr.2, #Attr.3, #Attr.4):
let List.608 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.608;
procedure List.92 (List.430, List.431, List.432):
let List.599 : U64 = 0i64;
let List.600 : U64 = CallByName List.6 List.430;
let List.598 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.80 List.430 List.431 List.432 List.599 List.600;
ret List.598;
procedure List.8 (#Attr.2, #Attr.3):
let List.600 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.600;
procedure List.80 (List.649, List.650, List.651, List.652, List.653):
joinpoint List.555 List.439 List.440 List.441 List.442 List.443:
let List.557 : Int1 = CallByName Num.22 List.442 List.443;
if List.557 then
let List.564 : Str = CallByName List.66 List.439 List.442;
inc List.564;
let List.558 : {List U8, U64} = CallByName List.145 List.440 List.564 List.441;
let List.561 : U64 = 1i64;
let List.560 : U64 = CallByName Num.19 List.442 List.561;
jump List.555 List.439 List.558 List.441 List.560 List.443;
else
dec List.439;
ret List.440;
in
jump List.555 List.649 List.650 List.651 List.652 List.653;
procedure List.80 (List.666, List.667, List.668, List.669, List.670):
joinpoint List.575 List.439 List.440 List.441 List.442 List.443:
let List.577 : Int1 = CallByName Num.22 List.442 List.443;
if List.577 then
let List.584 : U8 = CallByName List.66 List.439 List.442;
let List.578 : List U8 = CallByName List.145 List.440 List.584 List.441;
let List.581 : U64 = 1i64;
let List.580 : U64 = CallByName Num.19 List.442 List.581;
jump List.575 List.439 List.578 List.441 List.580 List.443;
else
dec List.439;
ret List.440;
in
jump List.575 List.666 List.667 List.668 List.669 List.670;
procedure List.80 (List.693, List.694, List.695, List.696, List.697):
joinpoint List.628 List.439 List.440 List.441 List.442 List.443:
let List.630 : Int1 = CallByName Num.22 List.442 List.443;
if List.630 then
let List.639 : U8 = CallByName List.66 List.439 List.442;
let List.631 : [C {U64, Int1}, C {U64, Int1}] = CallByName Json.188 List.440 List.639;
let List.636 : U8 = 1i64;
let List.637 : U8 = GetTagId List.631;
let List.638 : Int1 = lowlevel Eq List.636 List.637;
if List.638 then
let List.444 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.631;
let List.634 : U64 = 1i64;
let List.633 : U64 = CallByName Num.19 List.442 List.634;
jump List.628 List.439 List.444 List.441 List.633 List.443;
else
dec List.439;
let List.445 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.631;
let List.635 : [C {U64, Int1}, C {U64, Int1}] = TagId(0) List.445;
ret List.635;
else
dec List.439;
let List.629 : [C {U64, Int1}, C {U64, Int1}] = TagId(1) List.440;
ret List.629;
in
jump List.628 List.693 List.694 List.695 List.696 List.697;
procedure List.93 (List.436, List.437, List.438):
let List.553 : U64 = 0i64;
let List.554 : U64 = CallByName List.6 List.436;
let List.552 : {List U8, U64} = CallByName List.80 List.436 List.437 List.438 List.553 List.554;
ret List.552;
procedure List.93 (List.436, List.437, List.438):
let List.573 : U64 = 0i64;
let List.574 : U64 = CallByName List.6 List.436;
let List.572 : List U8 = CallByName List.80 List.436 List.437 List.438 List.573 List.574;
ret List.572;
procedure List.93 (List.436, List.437, List.438):
let List.626 : U64 = 0i64;
let List.627 : U64 = CallByName List.6 List.436;
let List.625 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.80 List.436 List.437 List.438 List.626 List.627;
ret List.625;
procedure Num.127 (#Attr.2):
let Num.288 : U8 = lowlevel NumIntCast #Attr.2;

View file

@ -274,183 +274,183 @@ procedure Json.31 (Json.261, Json.262):
let Json.1172 : {Str, List Str} = CallByName Encode.23 Json.1173;
ret Json.1172;
procedure List.139 (List.140, List.141, List.138):
let List.541 : {List U8, U64} = CallByName Json.266 List.140 List.141 List.138;
ret List.541;
procedure List.145 (List.146, List.147, List.144):
let List.568 : {List U8, U64} = CallByName Json.266 List.146 List.147 List.144;
ret List.568;
procedure List.139 (List.140, List.141, List.138):
let List.561 : List U8 = CallByName Json.214 List.140 List.141;
ret List.561;
procedure List.145 (List.146, List.147, List.144):
let List.588 : List U8 = CallByName Json.214 List.146 List.147;
ret List.588;
procedure List.18 (List.136, List.137, List.138):
let List.522 : {List U8, U64} = CallByName List.92 List.136 List.137 List.138;
ret List.522;
procedure List.18 (List.142, List.143, List.144):
let List.549 : {List U8, U64} = CallByName List.93 List.142 List.143 List.144;
ret List.549;
procedure List.18 (List.136, List.137, List.138):
let List.542 : List U8 = CallByName List.92 List.136 List.137 List.138;
ret List.542;
procedure List.18 (List.142, List.143, List.144):
let List.569 : List U8 = CallByName List.93 List.142 List.143 List.144;
ret List.569;
procedure List.26 (List.153, List.154, List.155):
let List.592 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.92 List.153 List.154 List.155;
let List.595 : U8 = 1i64;
let List.596 : U8 = GetTagId List.592;
let List.597 : Int1 = lowlevel Eq List.595 List.596;
if List.597 then
let List.156 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.592;
ret List.156;
procedure List.26 (List.159, List.160, List.161):
let List.619 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.93 List.159 List.160 List.161;
let List.622 : U8 = 1i64;
let List.623 : U8 = GetTagId List.619;
let List.624 : Int1 = lowlevel Eq List.622 List.623;
if List.624 then
let List.162 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.619;
ret List.162;
else
let List.157 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.592;
ret List.157;
let List.163 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.619;
ret List.163;
procedure List.4 (List.107, List.108):
let List.521 : U64 = 1i64;
let List.520 : List U8 = CallByName List.70 List.107 List.521;
let List.519 : List U8 = CallByName List.71 List.520 List.108;
ret List.519;
procedure List.4 (List.113, List.114):
let List.548 : U64 = 1i64;
let List.547 : List U8 = CallByName List.70 List.113 List.548;
let List.546 : List U8 = CallByName List.71 List.547 List.114;
ret List.546;
procedure List.49 (List.370, List.371):
let List.584 : U64 = StructAtIndex 0 List.371;
let List.585 : U64 = 0i64;
let List.582 : Int1 = CallByName Bool.11 List.584 List.585;
if List.582 then
dec List.370;
let List.583 : List U8 = Array [];
ret List.583;
procedure List.49 (List.376, List.377):
let List.611 : U64 = StructAtIndex 0 List.377;
let List.612 : U64 = 0i64;
let List.609 : Int1 = CallByName Bool.11 List.611 List.612;
if List.609 then
dec List.376;
let List.610 : List U8 = Array [];
ret List.610;
else
let List.579 : U64 = StructAtIndex 1 List.371;
let List.580 : U64 = StructAtIndex 0 List.371;
let List.578 : List U8 = CallByName List.72 List.370 List.579 List.580;
ret List.578;
let List.606 : U64 = StructAtIndex 1 List.377;
let List.607 : U64 = StructAtIndex 0 List.377;
let List.605 : List U8 = CallByName List.72 List.376 List.606 List.607;
ret List.605;
procedure List.52 (List.385, List.386):
let List.387 : U64 = CallByName List.6 List.385;
joinpoint List.590 List.388:
let List.588 : U64 = 0i64;
let List.587 : {U64, U64} = Struct {List.388, List.588};
inc List.385;
let List.389 : List U8 = CallByName List.49 List.385 List.587;
let List.586 : U64 = CallByName Num.20 List.387 List.388;
let List.577 : {U64, U64} = Struct {List.586, List.388};
let List.390 : List U8 = CallByName List.49 List.385 List.577;
let List.576 : {List U8, List U8} = Struct {List.389, List.390};
ret List.576;
procedure List.52 (List.391, List.392):
let List.393 : U64 = CallByName List.6 List.391;
joinpoint List.617 List.394:
let List.615 : U64 = 0i64;
let List.614 : {U64, U64} = Struct {List.394, List.615};
inc List.391;
let List.395 : List U8 = CallByName List.49 List.391 List.614;
let List.613 : U64 = CallByName Num.20 List.393 List.394;
let List.604 : {U64, U64} = Struct {List.613, List.394};
let List.396 : List U8 = CallByName List.49 List.391 List.604;
let List.603 : {List U8, List U8} = Struct {List.395, List.396};
ret List.603;
in
let List.591 : Int1 = CallByName Num.24 List.387 List.386;
if List.591 then
jump List.590 List.386;
let List.618 : Int1 = CallByName Num.24 List.393 List.392;
if List.618 then
jump List.617 List.392;
else
jump List.590 List.387;
jump List.617 List.393;
procedure List.6 (#Attr.2):
let List.562 : U64 = lowlevel ListLen #Attr.2;
ret List.562;
let List.589 : U64 = lowlevel ListLen #Attr.2;
ret List.589;
procedure List.6 (#Attr.2):
let List.564 : U64 = lowlevel ListLen #Attr.2;
ret List.564;
let List.591 : U64 = lowlevel ListLen #Attr.2;
ret List.591;
procedure List.66 (#Attr.2, #Attr.3):
let List.538 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.538;
let List.565 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.565;
procedure List.66 (#Attr.2, #Attr.3):
let List.558 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.558;
let List.585 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.585;
procedure List.68 (#Attr.2):
let List.575 : List U8 = lowlevel ListWithCapacity #Attr.2;
ret List.575;
let List.602 : List U8 = lowlevel ListWithCapacity #Attr.2;
ret List.602;
procedure List.70 (#Attr.2, #Attr.3):
let List.500 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.500;
let List.527 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.527;
procedure List.71 (#Attr.2, #Attr.3):
let List.498 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.498;
procedure List.72 (#Attr.2, #Attr.3, #Attr.4):
let List.581 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.581;
procedure List.8 (#Attr.2, #Attr.3):
let List.573 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.573;
procedure List.80 (List.622, List.623, List.624, List.625, List.626):
joinpoint List.528 List.433 List.434 List.435 List.436 List.437:
let List.530 : Int1 = CallByName Num.22 List.436 List.437;
if List.530 then
let List.537 : Str = CallByName List.66 List.433 List.436;
inc List.537;
let List.531 : {List U8, U64} = CallByName List.139 List.434 List.537 List.435;
let List.534 : U64 = 1i64;
let List.533 : U64 = CallByName Num.19 List.436 List.534;
jump List.528 List.433 List.531 List.435 List.533 List.437;
else
dec List.433;
ret List.434;
in
jump List.528 List.622 List.623 List.624 List.625 List.626;
procedure List.80 (List.639, List.640, List.641, List.642, List.643):
joinpoint List.548 List.433 List.434 List.435 List.436 List.437:
let List.550 : Int1 = CallByName Num.22 List.436 List.437;
if List.550 then
let List.557 : U8 = CallByName List.66 List.433 List.436;
let List.551 : List U8 = CallByName List.139 List.434 List.557 List.435;
let List.554 : U64 = 1i64;
let List.553 : U64 = CallByName Num.19 List.436 List.554;
jump List.548 List.433 List.551 List.435 List.553 List.437;
else
dec List.433;
ret List.434;
in
jump List.548 List.639 List.640 List.641 List.642 List.643;
procedure List.80 (List.666, List.667, List.668, List.669, List.670):
joinpoint List.601 List.433 List.434 List.435 List.436 List.437:
let List.603 : Int1 = CallByName Num.22 List.436 List.437;
if List.603 then
let List.612 : U8 = CallByName List.66 List.433 List.436;
let List.604 : [C {U64, Int1}, C {U64, Int1}] = CallByName Json.188 List.434 List.612;
let List.609 : U8 = 1i64;
let List.610 : U8 = GetTagId List.604;
let List.611 : Int1 = lowlevel Eq List.609 List.610;
if List.611 then
let List.438 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.604;
let List.607 : U64 = 1i64;
let List.606 : U64 = CallByName Num.19 List.436 List.607;
jump List.601 List.433 List.438 List.435 List.606 List.437;
else
dec List.433;
let List.439 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.604;
let List.608 : [C {U64, Int1}, C {U64, Int1}] = TagId(0) List.439;
ret List.608;
else
dec List.433;
let List.602 : [C {U64, Int1}, C {U64, Int1}] = TagId(1) List.434;
ret List.602;
in
jump List.601 List.666 List.667 List.668 List.669 List.670;
procedure List.92 (List.430, List.431, List.432):
let List.526 : U64 = 0i64;
let List.527 : U64 = CallByName List.6 List.430;
let List.525 : {List U8, U64} = CallByName List.80 List.430 List.431 List.432 List.526 List.527;
let List.525 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.525;
procedure List.92 (List.430, List.431, List.432):
let List.546 : U64 = 0i64;
let List.547 : U64 = CallByName List.6 List.430;
let List.545 : List U8 = CallByName List.80 List.430 List.431 List.432 List.546 List.547;
ret List.545;
procedure List.72 (#Attr.2, #Attr.3, #Attr.4):
let List.608 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.608;
procedure List.92 (List.430, List.431, List.432):
let List.599 : U64 = 0i64;
let List.600 : U64 = CallByName List.6 List.430;
let List.598 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.80 List.430 List.431 List.432 List.599 List.600;
ret List.598;
procedure List.8 (#Attr.2, #Attr.3):
let List.600 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.600;
procedure List.80 (List.649, List.650, List.651, List.652, List.653):
joinpoint List.555 List.439 List.440 List.441 List.442 List.443:
let List.557 : Int1 = CallByName Num.22 List.442 List.443;
if List.557 then
let List.564 : Str = CallByName List.66 List.439 List.442;
inc List.564;
let List.558 : {List U8, U64} = CallByName List.145 List.440 List.564 List.441;
let List.561 : U64 = 1i64;
let List.560 : U64 = CallByName Num.19 List.442 List.561;
jump List.555 List.439 List.558 List.441 List.560 List.443;
else
dec List.439;
ret List.440;
in
jump List.555 List.649 List.650 List.651 List.652 List.653;
procedure List.80 (List.666, List.667, List.668, List.669, List.670):
joinpoint List.575 List.439 List.440 List.441 List.442 List.443:
let List.577 : Int1 = CallByName Num.22 List.442 List.443;
if List.577 then
let List.584 : U8 = CallByName List.66 List.439 List.442;
let List.578 : List U8 = CallByName List.145 List.440 List.584 List.441;
let List.581 : U64 = 1i64;
let List.580 : U64 = CallByName Num.19 List.442 List.581;
jump List.575 List.439 List.578 List.441 List.580 List.443;
else
dec List.439;
ret List.440;
in
jump List.575 List.666 List.667 List.668 List.669 List.670;
procedure List.80 (List.693, List.694, List.695, List.696, List.697):
joinpoint List.628 List.439 List.440 List.441 List.442 List.443:
let List.630 : Int1 = CallByName Num.22 List.442 List.443;
if List.630 then
let List.639 : U8 = CallByName List.66 List.439 List.442;
let List.631 : [C {U64, Int1}, C {U64, Int1}] = CallByName Json.188 List.440 List.639;
let List.636 : U8 = 1i64;
let List.637 : U8 = GetTagId List.631;
let List.638 : Int1 = lowlevel Eq List.636 List.637;
if List.638 then
let List.444 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.631;
let List.634 : U64 = 1i64;
let List.633 : U64 = CallByName Num.19 List.442 List.634;
jump List.628 List.439 List.444 List.441 List.633 List.443;
else
dec List.439;
let List.445 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.631;
let List.635 : [C {U64, Int1}, C {U64, Int1}] = TagId(0) List.445;
ret List.635;
else
dec List.439;
let List.629 : [C {U64, Int1}, C {U64, Int1}] = TagId(1) List.440;
ret List.629;
in
jump List.628 List.693 List.694 List.695 List.696 List.697;
procedure List.93 (List.436, List.437, List.438):
let List.553 : U64 = 0i64;
let List.554 : U64 = CallByName List.6 List.436;
let List.552 : {List U8, U64} = CallByName List.80 List.436 List.437 List.438 List.553 List.554;
ret List.552;
procedure List.93 (List.436, List.437, List.438):
let List.573 : U64 = 0i64;
let List.574 : U64 = CallByName List.6 List.436;
let List.572 : List U8 = CallByName List.80 List.436 List.437 List.438 List.573 List.574;
ret List.572;
procedure List.93 (List.436, List.437, List.438):
let List.626 : U64 = 0i64;
let List.627 : U64 = CallByName List.6 List.436;
let List.625 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.80 List.436 List.437 List.438 List.626 List.627;
ret List.625;
procedure Num.127 (#Attr.2):
let Num.288 : U8 = lowlevel NumIntCast #Attr.2;

View file

@ -1,6 +1,6 @@
procedure List.6 (#Attr.2):
let List.494 : U64 = lowlevel ListLen #Attr.2;
ret List.494;
let List.521 : U64 = lowlevel ListLen #Attr.2;
ret List.521;
procedure Num.19 (#Attr.2, #Attr.3):
let Num.283 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;

View file

@ -6,42 +6,42 @@ procedure Bool.2 ():
let Bool.23 : Int1 = true;
ret Bool.23;
procedure List.2 (List.96, List.97):
let List.508 : U64 = CallByName List.6 List.96;
let List.504 : Int1 = CallByName Num.22 List.97 List.508;
if List.504 then
let List.506 : I64 = CallByName List.66 List.96 List.97;
dec List.96;
let List.505 : [C {}, C I64] = TagId(1) List.506;
ret List.505;
procedure List.2 (List.97, List.98):
let List.535 : U64 = CallByName List.6 List.97;
let List.531 : Int1 = CallByName Num.22 List.98 List.535;
if List.531 then
let List.533 : I64 = CallByName List.66 List.97 List.98;
dec List.97;
let List.532 : [C {}, C I64] = TagId(1) List.533;
ret List.532;
else
dec List.96;
let List.503 : {} = Struct {};
let List.502 : [C {}, C I64] = TagId(0) List.503;
ret List.502;
dec List.97;
let List.530 : {} = Struct {};
let List.529 : [C {}, C I64] = TagId(0) List.530;
ret List.529;
procedure List.6 (#Attr.2):
let List.509 : U64 = lowlevel ListLen #Attr.2;
ret List.509;
let List.536 : U64 = lowlevel ListLen #Attr.2;
ret List.536;
procedure List.66 (#Attr.2, #Attr.3):
let List.507 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.507;
let List.534 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.534;
procedure List.9 (List.287):
let List.501 : U64 = 0i64;
let List.494 : [C {}, C I64] = CallByName List.2 List.287 List.501;
let List.498 : U8 = 1i64;
let List.499 : U8 = GetTagId List.494;
let List.500 : Int1 = lowlevel Eq List.498 List.499;
if List.500 then
let List.288 : I64 = UnionAtIndex (Id 1) (Index 0) List.494;
let List.495 : [C Int1, C I64] = TagId(1) List.288;
ret List.495;
procedure List.9 (List.293):
let List.528 : U64 = 0i64;
let List.521 : [C {}, C I64] = CallByName List.2 List.293 List.528;
let List.525 : U8 = 1i64;
let List.526 : U8 = GetTagId List.521;
let List.527 : Int1 = lowlevel Eq List.525 List.526;
if List.527 then
let List.294 : I64 = UnionAtIndex (Id 1) (Index 0) List.521;
let List.522 : [C Int1, C I64] = TagId(1) List.294;
ret List.522;
else
let List.497 : Int1 = true;
let List.496 : [C Int1, C I64] = TagId(0) List.497;
ret List.496;
let List.524 : Int1 = true;
let List.523 : [C Int1, C I64] = TagId(0) List.524;
ret List.523;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.281 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -632,136 +632,136 @@ procedure Json.69 (Json.1467):
in
jump Json.1197 Json.1467;
procedure List.1 (List.95):
let List.563 : U64 = CallByName List.6 List.95;
dec List.95;
let List.564 : U64 = 0i64;
let List.562 : Int1 = CallByName Bool.11 List.563 List.564;
ret List.562;
procedure List.1 (List.96):
let List.590 : U64 = CallByName List.6 List.96;
dec List.96;
let List.591 : U64 = 0i64;
let List.589 : Int1 = CallByName Bool.11 List.590 List.591;
ret List.589;
procedure List.2 (List.96, List.97):
let List.546 : U64 = CallByName List.6 List.96;
let List.543 : Int1 = CallByName Num.22 List.97 List.546;
if List.543 then
let List.545 : U8 = CallByName List.66 List.96 List.97;
dec List.96;
let List.544 : [C {}, C U8] = TagId(1) List.545;
ret List.544;
else
dec List.96;
let List.542 : {} = Struct {};
let List.541 : [C {}, C U8] = TagId(0) List.542;
ret List.541;
procedure List.26 (List.153, List.154, List.155):
let List.565 : [C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64], C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64]] = CallByName List.92 List.153 List.154 List.155;
let List.568 : U8 = 1i64;
let List.569 : U8 = GetTagId List.565;
let List.570 : Int1 = lowlevel Eq List.568 List.569;
procedure List.2 (List.97, List.98):
let List.573 : U64 = CallByName List.6 List.97;
let List.570 : Int1 = CallByName Num.22 List.98 List.573;
if List.570 then
let List.156 : [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64] = UnionAtIndex (Id 1) (Index 0) List.565;
ret List.156;
let List.572 : U8 = CallByName List.66 List.97 List.98;
dec List.97;
let List.571 : [C {}, C U8] = TagId(1) List.572;
ret List.571;
else
let List.157 : [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64] = UnionAtIndex (Id 0) (Index 0) List.565;
ret List.157;
dec List.97;
let List.569 : {} = Struct {};
let List.568 : [C {}, C U8] = TagId(0) List.569;
ret List.568;
procedure List.29 (List.298, List.299):
let List.520 : U64 = CallByName List.6 List.298;
let List.300 : U64 = CallByName Num.77 List.520 List.299;
let List.519 : List U8 = CallByName List.43 List.298 List.300;
ret List.519;
procedure List.26 (List.159, List.160, List.161):
let List.592 : [C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64], C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64]] = CallByName List.93 List.159 List.160 List.161;
let List.595 : U8 = 1i64;
let List.596 : U8 = GetTagId List.592;
let List.597 : Int1 = lowlevel Eq List.595 List.596;
if List.597 then
let List.162 : [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64] = UnionAtIndex (Id 1) (Index 0) List.592;
ret List.162;
else
let List.163 : [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64] = UnionAtIndex (Id 0) (Index 0) List.592;
ret List.163;
procedure List.29 (List.304, List.305):
let List.547 : U64 = CallByName List.6 List.304;
let List.306 : U64 = CallByName Num.77 List.547 List.305;
let List.546 : List U8 = CallByName List.43 List.304 List.306;
ret List.546;
procedure List.31 (#Attr.2, #Attr.3):
let List.533 : List U8 = lowlevel ListDropAt #Attr.2 #Attr.3;
ret List.533;
let List.560 : List U8 = lowlevel ListDropAt #Attr.2 #Attr.3;
ret List.560;
procedure List.38 (List.292):
let List.532 : U64 = 0i64;
let List.531 : List U8 = CallByName List.31 List.292 List.532;
ret List.531;
procedure List.38 (List.298):
let List.559 : U64 = 0i64;
let List.558 : List U8 = CallByName List.31 List.298 List.559;
ret List.558;
procedure List.4 (List.107, List.108):
let List.530 : U64 = 1i64;
let List.529 : List U8 = CallByName List.70 List.107 List.530;
let List.528 : List U8 = CallByName List.71 List.529 List.108;
procedure List.4 (List.113, List.114):
let List.557 : U64 = 1i64;
let List.556 : List U8 = CallByName List.70 List.113 List.557;
let List.555 : List U8 = CallByName List.71 List.556 List.114;
ret List.555;
procedure List.43 (List.302, List.303):
let List.539 : U64 = CallByName List.6 List.302;
let List.538 : U64 = CallByName Num.77 List.539 List.303;
let List.529 : {U64, U64} = Struct {List.303, List.538};
let List.528 : List U8 = CallByName List.49 List.302 List.529;
ret List.528;
procedure List.43 (List.296, List.297):
let List.512 : U64 = CallByName List.6 List.296;
let List.511 : U64 = CallByName Num.77 List.512 List.297;
let List.502 : {U64, U64} = Struct {List.297, List.511};
let List.501 : List U8 = CallByName List.49 List.296 List.502;
ret List.501;
procedure List.49 (List.370, List.371):
let List.559 : U64 = StructAtIndex 0 List.371;
let List.560 : U64 = 0i64;
let List.557 : Int1 = CallByName Bool.11 List.559 List.560;
if List.557 then
dec List.370;
let List.558 : List U8 = Array [];
ret List.558;
procedure List.49 (List.376, List.377):
let List.586 : U64 = StructAtIndex 0 List.377;
let List.587 : U64 = 0i64;
let List.584 : Int1 = CallByName Bool.11 List.586 List.587;
if List.584 then
dec List.376;
let List.585 : List U8 = Array [];
ret List.585;
else
let List.555 : U64 = StructAtIndex 1 List.371;
let List.556 : U64 = StructAtIndex 0 List.371;
let List.554 : List U8 = CallByName List.72 List.370 List.555 List.556;
ret List.554;
let List.582 : U64 = StructAtIndex 1 List.377;
let List.583 : U64 = StructAtIndex 0 List.377;
let List.581 : List U8 = CallByName List.72 List.376 List.582 List.583;
ret List.581;
procedure List.6 (#Attr.2):
let List.623 : U64 = lowlevel ListLen #Attr.2;
ret List.623;
let List.650 : U64 = lowlevel ListLen #Attr.2;
ret List.650;
procedure List.66 (#Attr.2, #Attr.3):
let List.539 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.539;
let List.566 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.566;
procedure List.70 (#Attr.2, #Attr.3):
let List.527 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.527;
let List.554 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.554;
procedure List.71 (#Attr.2, #Attr.3):
let List.525 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.525;
let List.552 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.552;
procedure List.72 (#Attr.2, #Attr.3, #Attr.4):
let List.506 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.506;
let List.533 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.533;
procedure List.8 (#Attr.2, #Attr.3):
let List.522 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.522;
let List.549 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.549;
procedure List.80 (List.615, List.616, List.617, List.618, List.619):
joinpoint List.574 List.433 List.434 List.435 List.436 List.437:
let List.576 : Int1 = CallByName Num.22 List.436 List.437;
if List.576 then
let List.585 : U8 = CallByName List.66 List.433 List.436;
let List.577 : [C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64], C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64]] = CallByName Json.61 List.434 List.585;
let List.582 : U8 = 1i64;
let List.583 : U8 = GetTagId List.577;
let List.584 : Int1 = lowlevel Eq List.582 List.583;
if List.584 then
let List.438 : [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64] = UnionAtIndex (Id 1) (Index 0) List.577;
let List.580 : U64 = 1i64;
let List.579 : U64 = CallByName Num.19 List.436 List.580;
jump List.574 List.433 List.438 List.435 List.579 List.437;
procedure List.80 (List.642, List.643, List.644, List.645, List.646):
joinpoint List.601 List.439 List.440 List.441 List.442 List.443:
let List.603 : Int1 = CallByName Num.22 List.442 List.443;
if List.603 then
let List.612 : U8 = CallByName List.66 List.439 List.442;
let List.604 : [C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64], C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64]] = CallByName Json.61 List.440 List.612;
let List.609 : U8 = 1i64;
let List.610 : U8 = GetTagId List.604;
let List.611 : Int1 = lowlevel Eq List.609 List.610;
if List.611 then
let List.444 : [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64] = UnionAtIndex (Id 1) (Index 0) List.604;
let List.607 : U64 = 1i64;
let List.606 : U64 = CallByName Num.19 List.442 List.607;
jump List.601 List.439 List.444 List.441 List.606 List.443;
else
dec List.433;
let List.439 : [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64] = UnionAtIndex (Id 0) (Index 0) List.577;
let List.581 : [C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64], C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64]] = TagId(0) List.439;
ret List.581;
dec List.439;
let List.445 : [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64] = UnionAtIndex (Id 0) (Index 0) List.604;
let List.608 : [C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64], C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64]] = TagId(0) List.445;
ret List.608;
else
dec List.433;
let List.575 : [C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64], C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64]] = TagId(1) List.434;
ret List.575;
dec List.439;
let List.602 : [C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64], C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64]] = TagId(1) List.440;
ret List.602;
in
jump List.574 List.615 List.616 List.617 List.618 List.619;
jump List.601 List.642 List.643 List.644 List.645 List.646;
procedure List.92 (List.430, List.431, List.432):
let List.572 : U64 = 0i64;
let List.573 : U64 = CallByName List.6 List.430;
let List.571 : [C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64], C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64]] = CallByName List.80 List.430 List.431 List.432 List.572 List.573;
ret List.571;
procedure List.93 (List.436, List.437, List.438):
let List.599 : U64 = 0i64;
let List.600 : U64 = CallByName List.6 List.436;
let List.598 : [C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64], C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64]] = CallByName List.80 List.436 List.437 List.438 List.599 List.600;
ret List.598;
procedure Num.19 (#Attr.2, #Attr.3):
let Num.284 : U8 = lowlevel NumAdd #Attr.2 #Attr.3;

View file

@ -6,80 +6,80 @@ procedure Bool.2 ():
let Bool.24 : Int1 = true;
ret Bool.24;
procedure List.188 (List.496, List.189, List.187):
let List.526 : Int1 = CallByName Test.1 List.189;
if List.526 then
let List.528 : {} = Struct {};
let List.527 : [C {}, C {}] = TagId(1) List.528;
ret List.527;
procedure List.194 (List.523, List.195, List.193):
let List.553 : Int1 = CallByName Test.1 List.195;
if List.553 then
let List.555 : {} = Struct {};
let List.554 : [C {}, C {}] = TagId(1) List.555;
ret List.554;
else
let List.525 : {} = Struct {};
let List.524 : [C {}, C {}] = TagId(0) List.525;
ret List.524;
let List.552 : {} = Struct {};
let List.551 : [C {}, C {}] = TagId(0) List.552;
ret List.551;
procedure List.23 (#Attr.2, #Attr.3, #Attr.4):
let List.529 : List {[<r>C I64, C List *self], [<r>C I64, C List *self]} = lowlevel ListMap2 { xs: `#Attr.#arg1`, ys: `#Attr.#arg2` } #Attr.2 #Attr.3 Test.15 #Attr.4;
let List.556 : List {[<r>C I64, C List *self], [<r>C I64, C List *self]} = lowlevel ListMap2 { xs: `#Attr.#arg1`, ys: `#Attr.#arg2` } #Attr.2 #Attr.3 Test.15 #Attr.4;
decref #Attr.3;
decref #Attr.2;
ret List.529;
ret List.556;
procedure List.56 (List.186, List.187):
let List.505 : {} = Struct {};
let List.497 : [C {}, C {}] = CallByName List.92 List.186 List.505 List.187;
let List.502 : U8 = 1i64;
let List.503 : U8 = GetTagId List.497;
let List.504 : Int1 = lowlevel Eq List.502 List.503;
if List.504 then
let List.498 : Int1 = CallByName Bool.2;
ret List.498;
procedure List.56 (List.192, List.193):
let List.532 : {} = Struct {};
let List.524 : [C {}, C {}] = CallByName List.93 List.192 List.532 List.193;
let List.529 : U8 = 1i64;
let List.530 : U8 = GetTagId List.524;
let List.531 : Int1 = lowlevel Eq List.529 List.530;
if List.531 then
let List.525 : Int1 = CallByName Bool.2;
ret List.525;
else
let List.499 : Int1 = CallByName Bool.1;
ret List.499;
let List.526 : Int1 = CallByName Bool.1;
ret List.526;
procedure List.6 (#Attr.2):
let List.495 : U64 = lowlevel ListLen #Attr.2;
ret List.495;
procedure List.6 (#Attr.2):
let List.523 : U64 = lowlevel ListLen #Attr.2;
ret List.523;
procedure List.66 (#Attr.2, #Attr.3):
let List.522 : {[<r>C I64, C List *self], [<r>C I64, C List *self]} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
let List.522 : U64 = lowlevel ListLen #Attr.2;
ret List.522;
procedure List.80 (List.534, List.535, List.536, List.537, List.538):
joinpoint List.510 List.433 List.434 List.435 List.436 List.437:
let List.512 : Int1 = CallByName Num.22 List.436 List.437;
if List.512 then
let List.521 : {[<r>C I64, C List *self], [<r>C I64, C List *self]} = CallByName List.66 List.433 List.436;
inc List.521;
let List.513 : [C {}, C {}] = CallByName List.188 List.434 List.521 List.435;
let List.518 : U8 = 1i64;
let List.519 : U8 = GetTagId List.513;
let List.520 : Int1 = lowlevel Eq List.518 List.519;
if List.520 then
let List.438 : {} = UnionAtIndex (Id 1) (Index 0) List.513;
let List.516 : U64 = 1i64;
let List.515 : U64 = CallByName Num.19 List.436 List.516;
jump List.510 List.433 List.438 List.435 List.515 List.437;
else
dec List.433;
let List.439 : {} = UnionAtIndex (Id 0) (Index 0) List.513;
let List.517 : [C {}, C {}] = TagId(0) List.439;
ret List.517;
else
dec List.433;
let List.511 : [C {}, C {}] = TagId(1) List.434;
ret List.511;
in
jump List.510 List.534 List.535 List.536 List.537 List.538;
procedure List.6 (#Attr.2):
let List.550 : U64 = lowlevel ListLen #Attr.2;
ret List.550;
procedure List.92 (List.430, List.431, List.432):
let List.508 : U64 = 0i64;
let List.509 : U64 = CallByName List.6 List.430;
let List.507 : [C {}, C {}] = CallByName List.80 List.430 List.431 List.432 List.508 List.509;
ret List.507;
procedure List.66 (#Attr.2, #Attr.3):
let List.549 : {[<r>C I64, C List *self], [<r>C I64, C List *self]} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.549;
procedure List.80 (List.561, List.562, List.563, List.564, List.565):
joinpoint List.537 List.439 List.440 List.441 List.442 List.443:
let List.539 : Int1 = CallByName Num.22 List.442 List.443;
if List.539 then
let List.548 : {[<r>C I64, C List *self], [<r>C I64, C List *self]} = CallByName List.66 List.439 List.442;
inc List.548;
let List.540 : [C {}, C {}] = CallByName List.194 List.440 List.548 List.441;
let List.545 : U8 = 1i64;
let List.546 : U8 = GetTagId List.540;
let List.547 : Int1 = lowlevel Eq List.545 List.546;
if List.547 then
let List.444 : {} = UnionAtIndex (Id 1) (Index 0) List.540;
let List.543 : U64 = 1i64;
let List.542 : U64 = CallByName Num.19 List.442 List.543;
jump List.537 List.439 List.444 List.441 List.542 List.443;
else
dec List.439;
let List.445 : {} = UnionAtIndex (Id 0) (Index 0) List.540;
let List.544 : [C {}, C {}] = TagId(0) List.445;
ret List.544;
else
dec List.439;
let List.538 : [C {}, C {}] = TagId(1) List.440;
ret List.538;
in
jump List.537 List.561 List.562 List.563 List.564 List.565;
procedure List.93 (List.436, List.437, List.438):
let List.535 : U64 = 0i64;
let List.536 : U64 = CallByName List.6 List.436;
let List.534 : [C {}, C {}] = CallByName List.80 List.436 List.437 List.438 List.535 List.536;
ret List.534;
procedure Num.19 (#Attr.2, #Attr.3):
let Num.283 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;

View file

@ -606,136 +606,136 @@ procedure Json.69 (Json.1467):
in
jump Json.1197 Json.1467;
procedure List.1 (List.95):
let List.557 : U64 = CallByName List.6 List.95;
dec List.95;
let List.558 : U64 = 0i64;
let List.556 : Int1 = CallByName Bool.11 List.557 List.558;
ret List.556;
procedure List.1 (List.96):
let List.584 : U64 = CallByName List.6 List.96;
dec List.96;
let List.585 : U64 = 0i64;
let List.583 : Int1 = CallByName Bool.11 List.584 List.585;
ret List.583;
procedure List.2 (List.96, List.97):
let List.540 : U64 = CallByName List.6 List.96;
let List.537 : Int1 = CallByName Num.22 List.97 List.540;
if List.537 then
let List.539 : U8 = CallByName List.66 List.96 List.97;
dec List.96;
let List.538 : [C {}, C U8] = TagId(1) List.539;
ret List.538;
else
dec List.96;
let List.536 : {} = Struct {};
let List.535 : [C {}, C U8] = TagId(0) List.536;
ret List.535;
procedure List.26 (List.153, List.154, List.155):
let List.559 : [C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64], C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64]] = CallByName List.92 List.153 List.154 List.155;
let List.562 : U8 = 1i64;
let List.563 : U8 = GetTagId List.559;
let List.564 : Int1 = lowlevel Eq List.562 List.563;
procedure List.2 (List.97, List.98):
let List.567 : U64 = CallByName List.6 List.97;
let List.564 : Int1 = CallByName Num.22 List.98 List.567;
if List.564 then
let List.156 : [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64] = UnionAtIndex (Id 1) (Index 0) List.559;
ret List.156;
let List.566 : U8 = CallByName List.66 List.97 List.98;
dec List.97;
let List.565 : [C {}, C U8] = TagId(1) List.566;
ret List.565;
else
let List.157 : [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64] = UnionAtIndex (Id 0) (Index 0) List.559;
ret List.157;
dec List.97;
let List.563 : {} = Struct {};
let List.562 : [C {}, C U8] = TagId(0) List.563;
ret List.562;
procedure List.29 (List.298, List.299):
let List.514 : U64 = CallByName List.6 List.298;
let List.300 : U64 = CallByName Num.77 List.514 List.299;
let List.513 : List U8 = CallByName List.43 List.298 List.300;
ret List.513;
procedure List.26 (List.159, List.160, List.161):
let List.586 : [C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64], C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64]] = CallByName List.93 List.159 List.160 List.161;
let List.589 : U8 = 1i64;
let List.590 : U8 = GetTagId List.586;
let List.591 : Int1 = lowlevel Eq List.589 List.590;
if List.591 then
let List.162 : [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64] = UnionAtIndex (Id 1) (Index 0) List.586;
ret List.162;
else
let List.163 : [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64] = UnionAtIndex (Id 0) (Index 0) List.586;
ret List.163;
procedure List.29 (List.304, List.305):
let List.541 : U64 = CallByName List.6 List.304;
let List.306 : U64 = CallByName Num.77 List.541 List.305;
let List.540 : List U8 = CallByName List.43 List.304 List.306;
ret List.540;
procedure List.31 (#Attr.2, #Attr.3):
let List.527 : List U8 = lowlevel ListDropAt #Attr.2 #Attr.3;
ret List.527;
let List.554 : List U8 = lowlevel ListDropAt #Attr.2 #Attr.3;
ret List.554;
procedure List.38 (List.292):
let List.526 : U64 = 0i64;
let List.525 : List U8 = CallByName List.31 List.292 List.526;
ret List.525;
procedure List.38 (List.298):
let List.553 : U64 = 0i64;
let List.552 : List U8 = CallByName List.31 List.298 List.553;
ret List.552;
procedure List.4 (List.107, List.108):
let List.524 : U64 = 1i64;
let List.523 : List U8 = CallByName List.70 List.107 List.524;
let List.522 : List U8 = CallByName List.71 List.523 List.108;
procedure List.4 (List.113, List.114):
let List.551 : U64 = 1i64;
let List.550 : List U8 = CallByName List.70 List.113 List.551;
let List.549 : List U8 = CallByName List.71 List.550 List.114;
ret List.549;
procedure List.43 (List.302, List.303):
let List.533 : U64 = CallByName List.6 List.302;
let List.532 : U64 = CallByName Num.77 List.533 List.303;
let List.523 : {U64, U64} = Struct {List.303, List.532};
let List.522 : List U8 = CallByName List.49 List.302 List.523;
ret List.522;
procedure List.43 (List.296, List.297):
let List.506 : U64 = CallByName List.6 List.296;
let List.505 : U64 = CallByName Num.77 List.506 List.297;
let List.496 : {U64, U64} = Struct {List.297, List.505};
let List.495 : List U8 = CallByName List.49 List.296 List.496;
ret List.495;
procedure List.49 (List.370, List.371):
let List.553 : U64 = StructAtIndex 0 List.371;
let List.554 : U64 = 0i64;
let List.551 : Int1 = CallByName Bool.11 List.553 List.554;
if List.551 then
dec List.370;
let List.552 : List U8 = Array [];
ret List.552;
procedure List.49 (List.376, List.377):
let List.580 : U64 = StructAtIndex 0 List.377;
let List.581 : U64 = 0i64;
let List.578 : Int1 = CallByName Bool.11 List.580 List.581;
if List.578 then
dec List.376;
let List.579 : List U8 = Array [];
ret List.579;
else
let List.549 : U64 = StructAtIndex 1 List.371;
let List.550 : U64 = StructAtIndex 0 List.371;
let List.548 : List U8 = CallByName List.72 List.370 List.549 List.550;
ret List.548;
let List.576 : U64 = StructAtIndex 1 List.377;
let List.577 : U64 = StructAtIndex 0 List.377;
let List.575 : List U8 = CallByName List.72 List.376 List.576 List.577;
ret List.575;
procedure List.6 (#Attr.2):
let List.617 : U64 = lowlevel ListLen #Attr.2;
ret List.617;
let List.644 : U64 = lowlevel ListLen #Attr.2;
ret List.644;
procedure List.66 (#Attr.2, #Attr.3):
let List.533 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.533;
let List.560 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.560;
procedure List.70 (#Attr.2, #Attr.3):
let List.521 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.521;
let List.548 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.548;
procedure List.71 (#Attr.2, #Attr.3):
let List.519 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.519;
let List.546 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.546;
procedure List.72 (#Attr.2, #Attr.3, #Attr.4):
let List.500 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.500;
let List.527 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.527;
procedure List.8 (#Attr.2, #Attr.3):
let List.516 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.516;
let List.543 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.543;
procedure List.80 (List.609, List.610, List.611, List.612, List.613):
joinpoint List.568 List.433 List.434 List.435 List.436 List.437:
let List.570 : Int1 = CallByName Num.22 List.436 List.437;
if List.570 then
let List.579 : U8 = CallByName List.66 List.433 List.436;
let List.571 : [C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64], C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64]] = CallByName Json.61 List.434 List.579;
let List.576 : U8 = 1i64;
let List.577 : U8 = GetTagId List.571;
let List.578 : Int1 = lowlevel Eq List.576 List.577;
if List.578 then
let List.438 : [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64] = UnionAtIndex (Id 1) (Index 0) List.571;
let List.574 : U64 = 1i64;
let List.573 : U64 = CallByName Num.19 List.436 List.574;
jump List.568 List.433 List.438 List.435 List.573 List.437;
procedure List.80 (List.636, List.637, List.638, List.639, List.640):
joinpoint List.595 List.439 List.440 List.441 List.442 List.443:
let List.597 : Int1 = CallByName Num.22 List.442 List.443;
if List.597 then
let List.606 : U8 = CallByName List.66 List.439 List.442;
let List.598 : [C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64], C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64]] = CallByName Json.61 List.440 List.606;
let List.603 : U8 = 1i64;
let List.604 : U8 = GetTagId List.598;
let List.605 : Int1 = lowlevel Eq List.603 List.604;
if List.605 then
let List.444 : [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64] = UnionAtIndex (Id 1) (Index 0) List.598;
let List.601 : U64 = 1i64;
let List.600 : U64 = CallByName Num.19 List.442 List.601;
jump List.595 List.439 List.444 List.441 List.600 List.443;
else
dec List.433;
let List.439 : [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64] = UnionAtIndex (Id 0) (Index 0) List.571;
let List.575 : [C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64], C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64]] = TagId(0) List.439;
ret List.575;
dec List.439;
let List.445 : [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64] = UnionAtIndex (Id 0) (Index 0) List.598;
let List.602 : [C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64], C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64]] = TagId(0) List.445;
ret List.602;
else
dec List.433;
let List.569 : [C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64], C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64]] = TagId(1) List.434;
ret List.569;
dec List.439;
let List.596 : [C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64], C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64]] = TagId(1) List.440;
ret List.596;
in
jump List.568 List.609 List.610 List.611 List.612 List.613;
jump List.595 List.636 List.637 List.638 List.639 List.640;
procedure List.92 (List.430, List.431, List.432):
let List.566 : U64 = 0i64;
let List.567 : U64 = CallByName List.6 List.430;
let List.565 : [C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64], C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64]] = CallByName List.80 List.430 List.431 List.432 List.566 List.567;
ret List.565;
procedure List.93 (List.436, List.437, List.438):
let List.593 : U64 = 0i64;
let List.594 : U64 = CallByName List.6 List.436;
let List.592 : [C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64], C [C U64, C U64, C U64, C , C , C U64, C U64, C U64, C U64]] = CallByName List.80 List.436 List.437 List.438 List.593 List.594;
ret List.592;
procedure Num.19 (#Attr.2, #Attr.3):
let Num.284 : U8 = lowlevel NumAdd #Attr.2 #Attr.3;

View file

@ -1,40 +1,40 @@
procedure List.139 (List.140, List.141, List.138):
let List.513 : [<rnu><null>, C {[<rnu>C *self, <null>], *self}] = CallByName Test.7 List.140 List.141;
ret List.513;
procedure List.145 (List.146, List.147, List.144):
let List.540 : [<rnu><null>, C {[<rnu>C *self, <null>], *self}] = CallByName Test.7 List.146 List.147;
ret List.540;
procedure List.18 (List.136, List.137, List.138):
let List.494 : [<rnu><null>, C {[<rnu>C *self, <null>], *self}] = CallByName List.92 List.136 List.137 List.138;
ret List.494;
procedure List.18 (List.142, List.143, List.144):
let List.521 : [<rnu><null>, C {[<rnu>C *self, <null>], *self}] = CallByName List.93 List.142 List.143 List.144;
ret List.521;
procedure List.6 (#Attr.2):
let List.511 : U64 = lowlevel ListLen #Attr.2;
ret List.511;
let List.538 : U64 = lowlevel ListLen #Attr.2;
ret List.538;
procedure List.66 (#Attr.2, #Attr.3):
let List.510 : [<rnu>C *self, <null>] = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.510;
let List.537 : [<rnu>C *self, <null>] = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.537;
procedure List.80 (List.517, List.518, List.519, List.520, List.521):
joinpoint List.500 List.433 List.434 List.435 List.436 List.437:
let List.502 : Int1 = CallByName Num.22 List.436 List.437;
if List.502 then
let List.509 : [<rnu>C *self, <null>] = CallByName List.66 List.433 List.436;
inc List.509;
let List.503 : [<rnu><null>, C {[<rnu>C *self, <null>], *self}] = CallByName List.139 List.434 List.509 List.435;
let List.506 : U64 = 1i64;
let List.505 : U64 = CallByName Num.19 List.436 List.506;
jump List.500 List.433 List.503 List.435 List.505 List.437;
procedure List.80 (List.544, List.545, List.546, List.547, List.548):
joinpoint List.527 List.439 List.440 List.441 List.442 List.443:
let List.529 : Int1 = CallByName Num.22 List.442 List.443;
if List.529 then
let List.536 : [<rnu>C *self, <null>] = CallByName List.66 List.439 List.442;
inc List.536;
let List.530 : [<rnu><null>, C {[<rnu>C *self, <null>], *self}] = CallByName List.145 List.440 List.536 List.441;
let List.533 : U64 = 1i64;
let List.532 : U64 = CallByName Num.19 List.442 List.533;
jump List.527 List.439 List.530 List.441 List.532 List.443;
else
dec List.433;
ret List.434;
dec List.439;
ret List.440;
in
jump List.500 List.517 List.518 List.519 List.520 List.521;
jump List.527 List.544 List.545 List.546 List.547 List.548;
procedure List.92 (List.430, List.431, List.432):
let List.498 : U64 = 0i64;
let List.499 : U64 = CallByName List.6 List.430;
let List.497 : [<rnu><null>, C {[<rnu>C *self, <null>], *self}] = CallByName List.80 List.430 List.431 List.432 List.498 List.499;
ret List.497;
procedure List.93 (List.436, List.437, List.438):
let List.525 : U64 = 0i64;
let List.526 : U64 = CallByName List.6 List.436;
let List.524 : [<rnu><null>, C {[<rnu>C *self, <null>], *self}] = CallByName List.80 List.436 List.437 List.438 List.525 List.526;
ret List.524;
procedure Num.19 (#Attr.2, #Attr.3):
let Num.281 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;

View file

@ -1,16 +1,16 @@
procedure List.4 (List.107, List.108):
let List.497 : U64 = 1i64;
let List.495 : List I64 = CallByName List.70 List.107 List.497;
let List.494 : List I64 = CallByName List.71 List.495 List.108;
ret List.494;
procedure List.4 (List.113, List.114):
let List.524 : U64 = 1i64;
let List.522 : List I64 = CallByName List.70 List.113 List.524;
let List.521 : List I64 = CallByName List.71 List.522 List.114;
ret List.521;
procedure List.70 (#Attr.2, #Attr.3):
let List.498 : List I64 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.498;
let List.525 : List I64 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.525;
procedure List.71 (#Attr.2, #Attr.3):
let List.496 : List I64 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.496;
let List.523 : List I64 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.523;
procedure Test.0 ():
let Test.2 : List I64 = Array [1i64];

View file

@ -1,16 +1,16 @@
procedure List.4 (List.107, List.108):
let List.497 : U64 = 1i64;
let List.495 : List I64 = CallByName List.70 List.107 List.497;
let List.494 : List I64 = CallByName List.71 List.495 List.108;
ret List.494;
procedure List.4 (List.113, List.114):
let List.524 : U64 = 1i64;
let List.522 : List I64 = CallByName List.70 List.113 List.524;
let List.521 : List I64 = CallByName List.71 List.522 List.114;
ret List.521;
procedure List.70 (#Attr.2, #Attr.3):
let List.498 : List I64 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.498;
let List.525 : List I64 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.525;
procedure List.71 (#Attr.2, #Attr.3):
let List.496 : List I64 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.496;
let List.523 : List I64 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.523;
procedure Test.1 (Test.2):
let Test.6 : I64 = 42i64;

View file

@ -1,25 +1,25 @@
procedure List.3 (List.104, List.105, List.106):
let List.497 : {List I64, I64} = CallByName List.64 List.104 List.105 List.106;
let List.496 : List I64 = StructAtIndex 0 List.497;
ret List.496;
procedure List.3 (List.105, List.106, List.107):
let List.524 : {List I64, I64} = CallByName List.64 List.105 List.106 List.107;
let List.523 : List I64 = StructAtIndex 0 List.524;
ret List.523;
procedure List.6 (#Attr.2):
let List.495 : U64 = lowlevel ListLen #Attr.2;
ret List.495;
let List.522 : U64 = lowlevel ListLen #Attr.2;
ret List.522;
procedure List.64 (List.101, List.102, List.103):
let List.502 : U64 = CallByName List.6 List.101;
let List.499 : Int1 = CallByName Num.22 List.102 List.502;
if List.499 then
let List.500 : {List I64, I64} = CallByName List.67 List.101 List.102 List.103;
ret List.500;
procedure List.64 (List.102, List.103, List.104):
let List.529 : U64 = CallByName List.6 List.102;
let List.526 : Int1 = CallByName Num.22 List.103 List.529;
if List.526 then
let List.527 : {List I64, I64} = CallByName List.67 List.102 List.103 List.104;
ret List.527;
else
let List.498 : {List I64, I64} = Struct {List.101, List.103};
ret List.498;
let List.525 : {List I64, I64} = Struct {List.102, List.104};
ret List.525;
procedure List.67 (#Attr.2, #Attr.3, #Attr.4):
let List.501 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
ret List.501;
let List.528 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
ret List.528;
procedure Num.19 (#Attr.2, #Attr.3):
let Num.281 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;

View file

@ -1,24 +1,24 @@
procedure List.2 (List.96, List.97):
let List.500 : U64 = CallByName List.6 List.96;
let List.496 : Int1 = CallByName Num.22 List.97 List.500;
if List.496 then
let List.498 : I64 = CallByName List.66 List.96 List.97;
dec List.96;
let List.497 : [C {}, C I64] = TagId(1) List.498;
ret List.497;
procedure List.2 (List.97, List.98):
let List.527 : U64 = CallByName List.6 List.97;
let List.523 : Int1 = CallByName Num.22 List.98 List.527;
if List.523 then
let List.525 : I64 = CallByName List.66 List.97 List.98;
dec List.97;
let List.524 : [C {}, C I64] = TagId(1) List.525;
ret List.524;
else
dec List.96;
let List.495 : {} = Struct {};
let List.494 : [C {}, C I64] = TagId(0) List.495;
ret List.494;
dec List.97;
let List.522 : {} = Struct {};
let List.521 : [C {}, C I64] = TagId(0) List.522;
ret List.521;
procedure List.6 (#Attr.2):
let List.501 : U64 = lowlevel ListLen #Attr.2;
ret List.501;
let List.528 : U64 = lowlevel ListLen #Attr.2;
ret List.528;
procedure List.66 (#Attr.2, #Attr.3):
let List.499 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.499;
let List.526 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.526;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.281 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -1,10 +1,10 @@
procedure List.6 (#Attr.2):
let List.494 : U64 = lowlevel ListLen #Attr.2;
ret List.494;
let List.521 : U64 = lowlevel ListLen #Attr.2;
ret List.521;
procedure List.6 (#Attr.2):
let List.495 : U64 = lowlevel ListLen #Attr.2;
ret List.495;
let List.522 : U64 = lowlevel ListLen #Attr.2;
ret List.522;
procedure Num.19 (#Attr.2, #Attr.3):
let Num.281 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;

View file

@ -1,30 +1,30 @@
procedure List.2 (List.96, List.97):
let List.500 : U64 = CallByName List.6 List.96;
let List.496 : Int1 = CallByName Num.22 List.97 List.500;
if List.496 then
let List.498 : Str = CallByName List.66 List.96 List.97;
inc List.498;
dec List.96;
let List.497 : [C {}, C Str] = TagId(1) List.498;
ret List.497;
procedure List.2 (List.97, List.98):
let List.527 : U64 = CallByName List.6 List.97;
let List.523 : Int1 = CallByName Num.22 List.98 List.527;
if List.523 then
let List.525 : Str = CallByName List.66 List.97 List.98;
inc List.525;
dec List.97;
let List.524 : [C {}, C Str] = TagId(1) List.525;
ret List.524;
else
dec List.96;
let List.495 : {} = Struct {};
let List.494 : [C {}, C Str] = TagId(0) List.495;
ret List.494;
dec List.97;
let List.522 : {} = Struct {};
let List.521 : [C {}, C Str] = TagId(0) List.522;
ret List.521;
procedure List.5 (#Attr.2, #Attr.3):
let List.502 : List Str = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.3 #Attr.3;
let List.529 : List Str = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.3 #Attr.3;
decref #Attr.2;
ret List.502;
ret List.529;
procedure List.6 (#Attr.2):
let List.501 : U64 = lowlevel ListLen #Attr.2;
ret List.501;
let List.528 : U64 = lowlevel ListLen #Attr.2;
ret List.528;
procedure List.66 (#Attr.2, #Attr.3):
let List.499 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.499;
let List.526 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.526;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.281 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -1,30 +1,30 @@
procedure List.2 (List.96, List.97):
let List.500 : U64 = CallByName List.6 List.96;
let List.496 : Int1 = CallByName Num.22 List.97 List.500;
if List.496 then
let List.498 : Str = CallByName List.66 List.96 List.97;
inc List.498;
dec List.96;
let List.497 : [C {}, C Str] = TagId(1) List.498;
ret List.497;
procedure List.2 (List.97, List.98):
let List.527 : U64 = CallByName List.6 List.97;
let List.523 : Int1 = CallByName Num.22 List.98 List.527;
if List.523 then
let List.525 : Str = CallByName List.66 List.97 List.98;
inc List.525;
dec List.97;
let List.524 : [C {}, C Str] = TagId(1) List.525;
ret List.524;
else
dec List.96;
let List.495 : {} = Struct {};
let List.494 : [C {}, C Str] = TagId(0) List.495;
ret List.494;
dec List.97;
let List.522 : {} = Struct {};
let List.521 : [C {}, C Str] = TagId(0) List.522;
ret List.521;
procedure List.5 (#Attr.2, #Attr.3):
let List.502 : List Str = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.3 #Attr.3;
let List.529 : List Str = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.3 #Attr.3;
decref #Attr.2;
ret List.502;
ret List.529;
procedure List.6 (#Attr.2):
let List.501 : U64 = lowlevel ListLen #Attr.2;
ret List.501;
let List.528 : U64 = lowlevel ListLen #Attr.2;
ret List.528;
procedure List.66 (#Attr.2, #Attr.3):
let List.499 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.499;
let List.526 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.526;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.281 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -1,23 +1,23 @@
procedure List.5 (#Attr.2, #Attr.3):
let List.495 : U8 = GetTagId #Attr.3;
joinpoint List.496 List.494:
ret List.494;
let List.522 : U8 = GetTagId #Attr.3;
joinpoint List.523 List.521:
ret List.521;
in
switch List.495:
switch List.522:
case 0:
let List.497 : List U8 = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.4 #Attr.3;
let List.524 : List U8 = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.4 #Attr.3;
decref #Attr.2;
jump List.496 List.497;
jump List.523 List.524;
case 1:
let List.498 : List U8 = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.6 #Attr.3;
let List.525 : List U8 = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.6 #Attr.3;
decref #Attr.2;
jump List.496 List.498;
jump List.523 List.525;
default:
let List.499 : List U8 = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.8 #Attr.3;
let List.526 : List U8 = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.8 #Attr.3;
decref #Attr.2;
jump List.496 List.499;
jump List.523 List.526;
procedure Num.19 (#Attr.2, #Attr.3):

View file

@ -1,25 +1,25 @@
procedure List.3 (List.104, List.105, List.106):
let List.495 : {List I64, I64} = CallByName List.64 List.104 List.105 List.106;
let List.494 : List I64 = StructAtIndex 0 List.495;
ret List.494;
procedure List.3 (List.105, List.106, List.107):
let List.522 : {List I64, I64} = CallByName List.64 List.105 List.106 List.107;
let List.521 : List I64 = StructAtIndex 0 List.522;
ret List.521;
procedure List.6 (#Attr.2):
let List.501 : U64 = lowlevel ListLen #Attr.2;
ret List.501;
let List.528 : U64 = lowlevel ListLen #Attr.2;
ret List.528;
procedure List.64 (List.101, List.102, List.103):
let List.500 : U64 = CallByName List.6 List.101;
let List.497 : Int1 = CallByName Num.22 List.102 List.500;
if List.497 then
let List.498 : {List I64, I64} = CallByName List.67 List.101 List.102 List.103;
ret List.498;
procedure List.64 (List.102, List.103, List.104):
let List.527 : U64 = CallByName List.6 List.102;
let List.524 : Int1 = CallByName Num.22 List.103 List.527;
if List.524 then
let List.525 : {List I64, I64} = CallByName List.67 List.102 List.103 List.104;
ret List.525;
else
let List.496 : {List I64, I64} = Struct {List.101, List.103};
ret List.496;
let List.523 : {List I64, I64} = Struct {List.102, List.104};
ret List.523;
procedure List.67 (#Attr.2, #Attr.3, #Attr.4):
let List.499 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
ret List.499;
let List.526 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
ret List.526;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.281 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -1,11 +1,11 @@
procedure List.28 (#Attr.2, #Attr.3):
let List.496 : List I64 = lowlevel ListSortWith { xs: `#Attr.#arg1` } #Attr.2 Num.46 #Attr.3;
ret List.496;
let List.523 : List I64 = lowlevel ListSortWith { xs: `#Attr.#arg1` } #Attr.2 Num.46 #Attr.3;
ret List.523;
procedure List.59 (List.282):
let List.495 : {} = Struct {};
let List.494 : List I64 = CallByName List.28 List.282 List.495;
ret List.494;
procedure List.59 (List.288):
let List.522 : {} = Struct {};
let List.521 : List I64 = CallByName List.28 List.288 List.522;
ret List.521;
procedure Num.46 (#Attr.2, #Attr.3):
let Num.281 : U8 = lowlevel NumCompare #Attr.2 #Attr.3;

View file

@ -1,43 +1,43 @@
procedure List.2 (List.96, List.97):
let List.516 : U64 = CallByName List.6 List.96;
let List.513 : Int1 = CallByName Num.22 List.97 List.516;
if List.513 then
let List.515 : I64 = CallByName List.66 List.96 List.97;
dec List.96;
let List.514 : [C {}, C I64] = TagId(1) List.515;
ret List.514;
procedure List.2 (List.97, List.98):
let List.543 : U64 = CallByName List.6 List.97;
let List.540 : Int1 = CallByName Num.22 List.98 List.543;
if List.540 then
let List.542 : I64 = CallByName List.66 List.97 List.98;
dec List.97;
let List.541 : [C {}, C I64] = TagId(1) List.542;
ret List.541;
else
dec List.96;
let List.512 : {} = Struct {};
let List.511 : [C {}, C I64] = TagId(0) List.512;
ret List.511;
dec List.97;
let List.539 : {} = Struct {};
let List.538 : [C {}, C I64] = TagId(0) List.539;
ret List.538;
procedure List.3 (List.104, List.105, List.106):
let List.503 : {List I64, I64} = CallByName List.64 List.104 List.105 List.106;
let List.502 : List I64 = StructAtIndex 0 List.503;
ret List.502;
procedure List.3 (List.105, List.106, List.107):
let List.530 : {List I64, I64} = CallByName List.64 List.105 List.106 List.107;
let List.529 : List I64 = StructAtIndex 0 List.530;
ret List.529;
procedure List.6 (#Attr.2):
let List.501 : U64 = lowlevel ListLen #Attr.2;
ret List.501;
let List.528 : U64 = lowlevel ListLen #Attr.2;
ret List.528;
procedure List.64 (List.101, List.102, List.103):
let List.500 : U64 = CallByName List.6 List.101;
let List.497 : Int1 = CallByName Num.22 List.102 List.500;
if List.497 then
let List.498 : {List I64, I64} = CallByName List.67 List.101 List.102 List.103;
ret List.498;
procedure List.64 (List.102, List.103, List.104):
let List.527 : U64 = CallByName List.6 List.102;
let List.524 : Int1 = CallByName Num.22 List.103 List.527;
if List.524 then
let List.525 : {List I64, I64} = CallByName List.67 List.102 List.103 List.104;
ret List.525;
else
let List.496 : {List I64, I64} = Struct {List.101, List.103};
ret List.496;
let List.523 : {List I64, I64} = Struct {List.102, List.104};
ret List.523;
procedure List.66 (#Attr.2, #Attr.3):
let List.509 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.509;
let List.536 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.536;
procedure List.67 (#Attr.2, #Attr.3, #Attr.4):
let List.499 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
ret List.499;
let List.526 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
ret List.526;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.283 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -1,25 +1,25 @@
procedure List.3 (List.104, List.105, List.106):
let List.503 : {List U64, U64} = CallByName List.64 List.104 List.105 List.106;
let List.502 : List U64 = StructAtIndex 0 List.503;
ret List.502;
procedure List.3 (List.105, List.106, List.107):
let List.530 : {List U64, U64} = CallByName List.64 List.105 List.106 List.107;
let List.529 : List U64 = StructAtIndex 0 List.530;
ret List.529;
procedure List.6 (#Attr.2):
let List.501 : U64 = lowlevel ListLen #Attr.2;
ret List.501;
let List.528 : U64 = lowlevel ListLen #Attr.2;
ret List.528;
procedure List.64 (List.101, List.102, List.103):
let List.500 : U64 = CallByName List.6 List.101;
let List.497 : Int1 = CallByName Num.22 List.102 List.500;
if List.497 then
let List.498 : {List U64, U64} = CallByName List.67 List.101 List.102 List.103;
ret List.498;
procedure List.64 (List.102, List.103, List.104):
let List.527 : U64 = CallByName List.6 List.102;
let List.524 : Int1 = CallByName Num.22 List.103 List.527;
if List.524 then
let List.525 : {List U64, U64} = CallByName List.67 List.102 List.103 List.104;
ret List.525;
else
let List.496 : {List U64, U64} = Struct {List.101, List.103};
ret List.496;
let List.523 : {List U64, U64} = Struct {List.102, List.104};
ret List.523;
procedure List.67 (#Attr.2, #Attr.3, #Attr.4):
let List.499 : {List U64, U64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
ret List.499;
let List.526 : {List U64, U64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
ret List.526;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.281 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -1,7 +1,7 @@
procedure List.5 (#Attr.2, #Attr.3):
let List.494 : List [<rnnu>C List *self] = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.2 #Attr.3;
let List.521 : List [<rnnu>C List *self] = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.2 #Attr.3;
decref #Attr.2;
ret List.494;
ret List.521;
procedure Test.2 (Test.5):
let Test.6 : List [<rnnu>C List *self] = UnionAtIndex (Id 0) (Index 0) Test.5;

View file

@ -1,43 +1,43 @@
procedure List.2 (List.96, List.97):
let List.516 : U64 = CallByName List.6 List.96;
let List.513 : Int1 = CallByName Num.22 List.97 List.516;
if List.513 then
let List.515 : I64 = CallByName List.66 List.96 List.97;
dec List.96;
let List.514 : [C {}, C I64] = TagId(1) List.515;
ret List.514;
procedure List.2 (List.97, List.98):
let List.543 : U64 = CallByName List.6 List.97;
let List.540 : Int1 = CallByName Num.22 List.98 List.543;
if List.540 then
let List.542 : I64 = CallByName List.66 List.97 List.98;
dec List.97;
let List.541 : [C {}, C I64] = TagId(1) List.542;
ret List.541;
else
dec List.96;
let List.512 : {} = Struct {};
let List.511 : [C {}, C I64] = TagId(0) List.512;
ret List.511;
dec List.97;
let List.539 : {} = Struct {};
let List.538 : [C {}, C I64] = TagId(0) List.539;
ret List.538;
procedure List.3 (List.104, List.105, List.106):
let List.503 : {List I64, I64} = CallByName List.64 List.104 List.105 List.106;
let List.502 : List I64 = StructAtIndex 0 List.503;
ret List.502;
procedure List.3 (List.105, List.106, List.107):
let List.530 : {List I64, I64} = CallByName List.64 List.105 List.106 List.107;
let List.529 : List I64 = StructAtIndex 0 List.530;
ret List.529;
procedure List.6 (#Attr.2):
let List.501 : U64 = lowlevel ListLen #Attr.2;
ret List.501;
let List.528 : U64 = lowlevel ListLen #Attr.2;
ret List.528;
procedure List.64 (List.101, List.102, List.103):
let List.500 : U64 = CallByName List.6 List.101;
let List.497 : Int1 = CallByName Num.22 List.102 List.500;
if List.497 then
let List.498 : {List I64, I64} = CallByName List.67 List.101 List.102 List.103;
ret List.498;
procedure List.64 (List.102, List.103, List.104):
let List.527 : U64 = CallByName List.6 List.102;
let List.524 : Int1 = CallByName Num.22 List.103 List.527;
if List.524 then
let List.525 : {List I64, I64} = CallByName List.67 List.102 List.103 List.104;
ret List.525;
else
let List.496 : {List I64, I64} = Struct {List.101, List.103};
ret List.496;
let List.523 : {List I64, I64} = Struct {List.102, List.104};
ret List.523;
procedure List.66 (#Attr.2, #Attr.3):
let List.509 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.509;
let List.536 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.536;
procedure List.67 (#Attr.2, #Attr.3, #Attr.4):
let List.499 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
ret List.499;
let List.526 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
ret List.526;
procedure Num.22 (#Attr.2, #Attr.3):
let Num.283 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;

View file

@ -260,183 +260,183 @@ procedure Json.31 (Json.261, Json.262):
let Json.1213 : {Str, List Str} = CallByName Encode.23 Json.1214;
ret Json.1213;
procedure List.139 (List.140, List.141, List.138):
let List.539 : {List U8, U64} = CallByName Json.266 List.140 List.141 List.138;
ret List.539;
procedure List.145 (List.146, List.147, List.144):
let List.566 : {List U8, U64} = CallByName Json.266 List.146 List.147 List.144;
ret List.566;
procedure List.139 (List.140, List.141, List.138):
let List.559 : List U8 = CallByName Json.214 List.140 List.141;
ret List.559;
procedure List.145 (List.146, List.147, List.144):
let List.586 : List U8 = CallByName Json.214 List.146 List.147;
ret List.586;
procedure List.18 (List.136, List.137, List.138):
let List.520 : {List U8, U64} = CallByName List.92 List.136 List.137 List.138;
ret List.520;
procedure List.18 (List.142, List.143, List.144):
let List.547 : {List U8, U64} = CallByName List.93 List.142 List.143 List.144;
ret List.547;
procedure List.18 (List.136, List.137, List.138):
let List.540 : List U8 = CallByName List.92 List.136 List.137 List.138;
ret List.540;
procedure List.18 (List.142, List.143, List.144):
let List.567 : List U8 = CallByName List.93 List.142 List.143 List.144;
ret List.567;
procedure List.26 (List.153, List.154, List.155):
let List.590 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.92 List.153 List.154 List.155;
let List.593 : U8 = 1i64;
let List.594 : U8 = GetTagId List.590;
let List.595 : Int1 = lowlevel Eq List.593 List.594;
if List.595 then
let List.156 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.590;
ret List.156;
procedure List.26 (List.159, List.160, List.161):
let List.617 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.93 List.159 List.160 List.161;
let List.620 : U8 = 1i64;
let List.621 : U8 = GetTagId List.617;
let List.622 : Int1 = lowlevel Eq List.620 List.621;
if List.622 then
let List.162 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.617;
ret List.162;
else
let List.157 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.590;
ret List.157;
let List.163 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.617;
ret List.163;
procedure List.4 (List.107, List.108):
let List.519 : U64 = 1i64;
let List.518 : List U8 = CallByName List.70 List.107 List.519;
let List.517 : List U8 = CallByName List.71 List.518 List.108;
ret List.517;
procedure List.4 (List.113, List.114):
let List.546 : U64 = 1i64;
let List.545 : List U8 = CallByName List.70 List.113 List.546;
let List.544 : List U8 = CallByName List.71 List.545 List.114;
ret List.544;
procedure List.49 (List.370, List.371):
let List.582 : U64 = StructAtIndex 0 List.371;
let List.583 : U64 = 0i64;
let List.580 : Int1 = CallByName Bool.11 List.582 List.583;
if List.580 then
dec List.370;
let List.581 : List U8 = Array [];
ret List.581;
procedure List.49 (List.376, List.377):
let List.609 : U64 = StructAtIndex 0 List.377;
let List.610 : U64 = 0i64;
let List.607 : Int1 = CallByName Bool.11 List.609 List.610;
if List.607 then
dec List.376;
let List.608 : List U8 = Array [];
ret List.608;
else
let List.577 : U64 = StructAtIndex 1 List.371;
let List.578 : U64 = StructAtIndex 0 List.371;
let List.576 : List U8 = CallByName List.72 List.370 List.577 List.578;
ret List.576;
let List.604 : U64 = StructAtIndex 1 List.377;
let List.605 : U64 = StructAtIndex 0 List.377;
let List.603 : List U8 = CallByName List.72 List.376 List.604 List.605;
ret List.603;
procedure List.52 (List.385, List.386):
let List.387 : U64 = CallByName List.6 List.385;
joinpoint List.588 List.388:
let List.586 : U64 = 0i64;
let List.585 : {U64, U64} = Struct {List.388, List.586};
inc List.385;
let List.389 : List U8 = CallByName List.49 List.385 List.585;
let List.584 : U64 = CallByName Num.20 List.387 List.388;
let List.575 : {U64, U64} = Struct {List.584, List.388};
let List.390 : List U8 = CallByName List.49 List.385 List.575;
let List.574 : {List U8, List U8} = Struct {List.389, List.390};
ret List.574;
procedure List.52 (List.391, List.392):
let List.393 : U64 = CallByName List.6 List.391;
joinpoint List.615 List.394:
let List.613 : U64 = 0i64;
let List.612 : {U64, U64} = Struct {List.394, List.613};
inc List.391;
let List.395 : List U8 = CallByName List.49 List.391 List.612;
let List.611 : U64 = CallByName Num.20 List.393 List.394;
let List.602 : {U64, U64} = Struct {List.611, List.394};
let List.396 : List U8 = CallByName List.49 List.391 List.602;
let List.601 : {List U8, List U8} = Struct {List.395, List.396};
ret List.601;
in
let List.589 : Int1 = CallByName Num.24 List.387 List.386;
if List.589 then
jump List.588 List.386;
let List.616 : Int1 = CallByName Num.24 List.393 List.392;
if List.616 then
jump List.615 List.392;
else
jump List.588 List.387;
jump List.615 List.393;
procedure List.6 (#Attr.2):
let List.560 : U64 = lowlevel ListLen #Attr.2;
ret List.560;
let List.587 : U64 = lowlevel ListLen #Attr.2;
ret List.587;
procedure List.6 (#Attr.2):
let List.562 : U64 = lowlevel ListLen #Attr.2;
ret List.562;
let List.589 : U64 = lowlevel ListLen #Attr.2;
ret List.589;
procedure List.66 (#Attr.2, #Attr.3):
let List.536 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.536;
let List.563 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.563;
procedure List.66 (#Attr.2, #Attr.3):
let List.556 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.556;
let List.583 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.583;
procedure List.68 (#Attr.2):
let List.573 : List U8 = lowlevel ListWithCapacity #Attr.2;
ret List.573;
let List.600 : List U8 = lowlevel ListWithCapacity #Attr.2;
ret List.600;
procedure List.70 (#Attr.2, #Attr.3):
let List.498 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.498;
let List.525 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.525;
procedure List.71 (#Attr.2, #Attr.3):
let List.496 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.496;
procedure List.72 (#Attr.2, #Attr.3, #Attr.4):
let List.579 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.579;
procedure List.8 (#Attr.2, #Attr.3):
let List.571 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.571;
procedure List.80 (List.620, List.621, List.622, List.623, List.624):
joinpoint List.526 List.433 List.434 List.435 List.436 List.437:
let List.528 : Int1 = CallByName Num.22 List.436 List.437;
if List.528 then
let List.535 : Str = CallByName List.66 List.433 List.436;
inc List.535;
let List.529 : {List U8, U64} = CallByName List.139 List.434 List.535 List.435;
let List.532 : U64 = 1i64;
let List.531 : U64 = CallByName Num.19 List.436 List.532;
jump List.526 List.433 List.529 List.435 List.531 List.437;
else
dec List.433;
ret List.434;
in
jump List.526 List.620 List.621 List.622 List.623 List.624;
procedure List.80 (List.637, List.638, List.639, List.640, List.641):
joinpoint List.546 List.433 List.434 List.435 List.436 List.437:
let List.548 : Int1 = CallByName Num.22 List.436 List.437;
if List.548 then
let List.555 : U8 = CallByName List.66 List.433 List.436;
let List.549 : List U8 = CallByName List.139 List.434 List.555 List.435;
let List.552 : U64 = 1i64;
let List.551 : U64 = CallByName Num.19 List.436 List.552;
jump List.546 List.433 List.549 List.435 List.551 List.437;
else
dec List.433;
ret List.434;
in
jump List.546 List.637 List.638 List.639 List.640 List.641;
procedure List.80 (List.664, List.665, List.666, List.667, List.668):
joinpoint List.599 List.433 List.434 List.435 List.436 List.437:
let List.601 : Int1 = CallByName Num.22 List.436 List.437;
if List.601 then
let List.610 : U8 = CallByName List.66 List.433 List.436;
let List.602 : [C {U64, Int1}, C {U64, Int1}] = CallByName Json.188 List.434 List.610;
let List.607 : U8 = 1i64;
let List.608 : U8 = GetTagId List.602;
let List.609 : Int1 = lowlevel Eq List.607 List.608;
if List.609 then
let List.438 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.602;
let List.605 : U64 = 1i64;
let List.604 : U64 = CallByName Num.19 List.436 List.605;
jump List.599 List.433 List.438 List.435 List.604 List.437;
else
dec List.433;
let List.439 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.602;
let List.606 : [C {U64, Int1}, C {U64, Int1}] = TagId(0) List.439;
ret List.606;
else
dec List.433;
let List.600 : [C {U64, Int1}, C {U64, Int1}] = TagId(1) List.434;
ret List.600;
in
jump List.599 List.664 List.665 List.666 List.667 List.668;
procedure List.92 (List.430, List.431, List.432):
let List.524 : U64 = 0i64;
let List.525 : U64 = CallByName List.6 List.430;
let List.523 : {List U8, U64} = CallByName List.80 List.430 List.431 List.432 List.524 List.525;
let List.523 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.523;
procedure List.92 (List.430, List.431, List.432):
let List.544 : U64 = 0i64;
let List.545 : U64 = CallByName List.6 List.430;
let List.543 : List U8 = CallByName List.80 List.430 List.431 List.432 List.544 List.545;
ret List.543;
procedure List.72 (#Attr.2, #Attr.3, #Attr.4):
let List.606 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.606;
procedure List.92 (List.430, List.431, List.432):
let List.597 : U64 = 0i64;
let List.598 : U64 = CallByName List.6 List.430;
let List.596 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.80 List.430 List.431 List.432 List.597 List.598;
ret List.596;
procedure List.8 (#Attr.2, #Attr.3):
let List.598 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.598;
procedure List.80 (List.647, List.648, List.649, List.650, List.651):
joinpoint List.553 List.439 List.440 List.441 List.442 List.443:
let List.555 : Int1 = CallByName Num.22 List.442 List.443;
if List.555 then
let List.562 : Str = CallByName List.66 List.439 List.442;
inc List.562;
let List.556 : {List U8, U64} = CallByName List.145 List.440 List.562 List.441;
let List.559 : U64 = 1i64;
let List.558 : U64 = CallByName Num.19 List.442 List.559;
jump List.553 List.439 List.556 List.441 List.558 List.443;
else
dec List.439;
ret List.440;
in
jump List.553 List.647 List.648 List.649 List.650 List.651;
procedure List.80 (List.664, List.665, List.666, List.667, List.668):
joinpoint List.573 List.439 List.440 List.441 List.442 List.443:
let List.575 : Int1 = CallByName Num.22 List.442 List.443;
if List.575 then
let List.582 : U8 = CallByName List.66 List.439 List.442;
let List.576 : List U8 = CallByName List.145 List.440 List.582 List.441;
let List.579 : U64 = 1i64;
let List.578 : U64 = CallByName Num.19 List.442 List.579;
jump List.573 List.439 List.576 List.441 List.578 List.443;
else
dec List.439;
ret List.440;
in
jump List.573 List.664 List.665 List.666 List.667 List.668;
procedure List.80 (List.691, List.692, List.693, List.694, List.695):
joinpoint List.626 List.439 List.440 List.441 List.442 List.443:
let List.628 : Int1 = CallByName Num.22 List.442 List.443;
if List.628 then
let List.637 : U8 = CallByName List.66 List.439 List.442;
let List.629 : [C {U64, Int1}, C {U64, Int1}] = CallByName Json.188 List.440 List.637;
let List.634 : U8 = 1i64;
let List.635 : U8 = GetTagId List.629;
let List.636 : Int1 = lowlevel Eq List.634 List.635;
if List.636 then
let List.444 : {U64, Int1} = UnionAtIndex (Id 1) (Index 0) List.629;
let List.632 : U64 = 1i64;
let List.631 : U64 = CallByName Num.19 List.442 List.632;
jump List.626 List.439 List.444 List.441 List.631 List.443;
else
dec List.439;
let List.445 : {U64, Int1} = UnionAtIndex (Id 0) (Index 0) List.629;
let List.633 : [C {U64, Int1}, C {U64, Int1}] = TagId(0) List.445;
ret List.633;
else
dec List.439;
let List.627 : [C {U64, Int1}, C {U64, Int1}] = TagId(1) List.440;
ret List.627;
in
jump List.626 List.691 List.692 List.693 List.694 List.695;
procedure List.93 (List.436, List.437, List.438):
let List.551 : U64 = 0i64;
let List.552 : U64 = CallByName List.6 List.436;
let List.550 : {List U8, U64} = CallByName List.80 List.436 List.437 List.438 List.551 List.552;
ret List.550;
procedure List.93 (List.436, List.437, List.438):
let List.571 : U64 = 0i64;
let List.572 : U64 = CallByName List.6 List.436;
let List.570 : List U8 = CallByName List.80 List.436 List.437 List.438 List.571 List.572;
ret List.570;
procedure List.93 (List.436, List.437, List.438):
let List.624 : U64 = 0i64;
let List.625 : U64 = CallByName List.6 List.436;
let List.623 : [C {U64, Int1}, C {U64, Int1}] = CallByName List.80 List.436 List.437 List.438 List.624 List.625;
ret List.623;
procedure Num.127 (#Attr.2):
let Num.288 : U8 = lowlevel NumIntCast #Attr.2;

View file

@ -199,97 +199,97 @@ procedure Json.31 (Json.261, Json.262):
let Json.1264 : {Str, List []} = CallByName Encode.23 Json.1265;
ret Json.1264;
procedure List.139 (List.140, List.141, List.138):
let List.539 : {List U8, U64} = CallByName Json.266 List.140 List.141 List.138;
ret List.539;
procedure List.145 (List.146, List.147, List.144):
let List.566 : {List U8, U64} = CallByName Json.266 List.146 List.147 List.144;
ret List.566;
procedure List.139 (List.140, List.141, List.138):
let List.612 : {List U8, U64} = CallByName Json.266 List.140 List.141 List.138;
ret List.612;
procedure List.145 (List.146, List.147, List.144):
let List.639 : {List U8, U64} = CallByName Json.266 List.146 List.147 List.144;
ret List.639;
procedure List.18 (List.136, List.137, List.138):
let List.520 : {List U8, U64} = CallByName List.92 List.136 List.137 List.138;
ret List.520;
procedure List.18 (List.142, List.143, List.144):
let List.547 : {List U8, U64} = CallByName List.93 List.142 List.143 List.144;
ret List.547;
procedure List.18 (List.136, List.137, List.138):
let List.593 : {List U8, U64} = CallByName List.92 List.136 List.137 List.138;
ret List.593;
procedure List.18 (List.142, List.143, List.144):
let List.620 : {List U8, U64} = CallByName List.93 List.142 List.143 List.144;
ret List.620;
procedure List.4 (List.107, List.108):
let List.592 : U64 = 1i64;
let List.591 : List U8 = CallByName List.70 List.107 List.592;
let List.590 : List U8 = CallByName List.71 List.591 List.108;
ret List.590;
procedure List.4 (List.113, List.114):
let List.619 : U64 = 1i64;
let List.618 : List U8 = CallByName List.70 List.113 List.619;
let List.617 : List U8 = CallByName List.71 List.618 List.114;
ret List.617;
procedure List.6 (#Attr.2):
let List.540 : U64 = lowlevel ListLen #Attr.2;
ret List.540;
let List.567 : U64 = lowlevel ListLen #Attr.2;
ret List.567;
procedure List.6 (#Attr.2):
let List.613 : U64 = lowlevel ListLen #Attr.2;
ret List.613;
let List.640 : U64 = lowlevel ListLen #Attr.2;
ret List.640;
procedure List.66 (#Attr.2, #Attr.3):
let List.536 : [C {}, C {}] = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.536;
let List.563 : [C {}, C {}] = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.563;
procedure List.66 (#Attr.2, #Attr.3):
let List.609 : [] = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.609;
let List.636 : [] = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.636;
procedure List.70 (#Attr.2, #Attr.3):
let List.571 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.571;
let List.598 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.598;
procedure List.71 (#Attr.2, #Attr.3):
let List.569 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.569;
let List.596 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.596;
procedure List.8 (#Attr.2, #Attr.3):
let List.614 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.614;
let List.641 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3;
ret List.641;
procedure List.80 (List.551, List.552, List.553, List.554, List.555):
joinpoint List.526 List.433 List.434 List.435 List.436 List.437:
let List.528 : Int1 = CallByName Num.22 List.436 List.437;
if List.528 then
let List.535 : [C {}, C {}] = CallByName List.66 List.433 List.436;
let List.529 : {List U8, U64} = CallByName List.139 List.434 List.535 List.435;
let List.532 : U64 = 1i64;
let List.531 : U64 = CallByName Num.19 List.436 List.532;
jump List.526 List.433 List.529 List.435 List.531 List.437;
procedure List.80 (List.578, List.579, List.580, List.581, List.582):
joinpoint List.553 List.439 List.440 List.441 List.442 List.443:
let List.555 : Int1 = CallByName Num.22 List.442 List.443;
if List.555 then
let List.562 : [C {}, C {}] = CallByName List.66 List.439 List.442;
let List.556 : {List U8, U64} = CallByName List.145 List.440 List.562 List.441;
let List.559 : U64 = 1i64;
let List.558 : U64 = CallByName Num.19 List.442 List.559;
jump List.553 List.439 List.556 List.441 List.558 List.443;
else
dec List.433;
ret List.434;
dec List.439;
ret List.440;
in
jump List.526 List.551 List.552 List.553 List.554 List.555;
jump List.553 List.578 List.579 List.580 List.581 List.582;
procedure List.80 (List.624, List.625, List.626, List.627, List.628):
joinpoint List.599 List.433 List.434 List.435 List.436 List.437:
let List.601 : Int1 = CallByName Num.22 List.436 List.437;
if List.601 then
let List.608 : [] = CallByName List.66 List.433 List.436;
let List.602 : {List U8, U64} = CallByName List.139 List.434 List.608 List.435;
let List.605 : U64 = 1i64;
let List.604 : U64 = CallByName Num.19 List.436 List.605;
jump List.599 List.433 List.602 List.435 List.604 List.437;
procedure List.80 (List.651, List.652, List.653, List.654, List.655):
joinpoint List.626 List.439 List.440 List.441 List.442 List.443:
let List.628 : Int1 = CallByName Num.22 List.442 List.443;
if List.628 then
let List.635 : [] = CallByName List.66 List.439 List.442;
let List.629 : {List U8, U64} = CallByName List.145 List.440 List.635 List.441;
let List.632 : U64 = 1i64;
let List.631 : U64 = CallByName Num.19 List.442 List.632;
jump List.626 List.439 List.629 List.441 List.631 List.443;
else
dec List.433;
ret List.434;
dec List.439;
ret List.440;
in
jump List.599 List.624 List.625 List.626 List.627 List.628;
jump List.626 List.651 List.652 List.653 List.654 List.655;
procedure List.92 (List.430, List.431, List.432):
let List.524 : U64 = 0i64;
let List.525 : U64 = CallByName List.6 List.430;
let List.523 : {List U8, U64} = CallByName List.80 List.430 List.431 List.432 List.524 List.525;
ret List.523;
procedure List.93 (List.436, List.437, List.438):
let List.551 : U64 = 0i64;
let List.552 : U64 = CallByName List.6 List.436;
let List.550 : {List U8, U64} = CallByName List.80 List.436 List.437 List.438 List.551 List.552;
ret List.550;
procedure List.92 (List.430, List.431, List.432):
let List.597 : U64 = 0i64;
let List.598 : U64 = CallByName List.6 List.430;
let List.596 : {List U8, U64} = CallByName List.80 List.430 List.431 List.432 List.597 List.598;
ret List.596;
procedure List.93 (List.436, List.437, List.438):
let List.624 : U64 = 0i64;
let List.625 : U64 = CallByName List.6 List.436;
let List.623 : {List U8, U64} = CallByName List.80 List.436 List.437 List.438 List.624 List.625;
ret List.623;
procedure Num.127 (#Attr.2):
let Num.309 : U8 = lowlevel NumIntCast #Attr.2;

View file

@ -2,88 +2,88 @@ procedure Bool.11 (#Attr.2, #Attr.3):
let Bool.24 : Int1 = lowlevel Eq #Attr.2 #Attr.3;
ret Bool.24;
procedure List.26 (List.153, List.154, List.155):
let List.509 : [C U64, C U64] = CallByName List.92 List.153 List.154 List.155;
let List.512 : U8 = 1i64;
let List.513 : U8 = GetTagId List.509;
let List.514 : Int1 = lowlevel Eq List.512 List.513;
if List.514 then
let List.156 : U64 = UnionAtIndex (Id 1) (Index 0) List.509;
ret List.156;
procedure List.26 (List.159, List.160, List.161):
let List.536 : [C U64, C U64] = CallByName List.93 List.159 List.160 List.161;
let List.539 : U8 = 1i64;
let List.540 : U8 = GetTagId List.536;
let List.541 : Int1 = lowlevel Eq List.539 List.540;
if List.541 then
let List.162 : U64 = UnionAtIndex (Id 1) (Index 0) List.536;
ret List.162;
else
let List.157 : U64 = UnionAtIndex (Id 0) (Index 0) List.509;
ret List.157;
let List.163 : U64 = UnionAtIndex (Id 0) (Index 0) List.536;
ret List.163;
procedure List.29 (List.298, List.299):
let List.508 : U64 = CallByName List.6 List.298;
let List.300 : U64 = CallByName Num.77 List.508 List.299;
let List.494 : List U8 = CallByName List.43 List.298 List.300;
ret List.494;
procedure List.29 (List.304, List.305):
let List.535 : U64 = CallByName List.6 List.304;
let List.306 : U64 = CallByName Num.77 List.535 List.305;
let List.521 : List U8 = CallByName List.43 List.304 List.306;
ret List.521;
procedure List.43 (List.296, List.297):
let List.506 : U64 = CallByName List.6 List.296;
let List.505 : U64 = CallByName Num.77 List.506 List.297;
let List.496 : {U64, U64} = Struct {List.297, List.505};
let List.495 : List U8 = CallByName List.49 List.296 List.496;
ret List.495;
procedure List.43 (List.302, List.303):
let List.533 : U64 = CallByName List.6 List.302;
let List.532 : U64 = CallByName Num.77 List.533 List.303;
let List.523 : {U64, U64} = Struct {List.303, List.532};
let List.522 : List U8 = CallByName List.49 List.302 List.523;
ret List.522;
procedure List.49 (List.370, List.371):
let List.503 : U64 = StructAtIndex 0 List.371;
let List.504 : U64 = 0i64;
let List.501 : Int1 = CallByName Bool.11 List.503 List.504;
if List.501 then
dec List.370;
let List.502 : List U8 = Array [];
ret List.502;
procedure List.49 (List.376, List.377):
let List.530 : U64 = StructAtIndex 0 List.377;
let List.531 : U64 = 0i64;
let List.528 : Int1 = CallByName Bool.11 List.530 List.531;
if List.528 then
dec List.376;
let List.529 : List U8 = Array [];
ret List.529;
else
let List.498 : U64 = StructAtIndex 1 List.371;
let List.499 : U64 = StructAtIndex 0 List.371;
let List.497 : List U8 = CallByName List.72 List.370 List.498 List.499;
ret List.497;
let List.525 : U64 = StructAtIndex 1 List.377;
let List.526 : U64 = StructAtIndex 0 List.377;
let List.524 : List U8 = CallByName List.72 List.376 List.525 List.526;
ret List.524;
procedure List.6 (#Attr.2):
let List.507 : U64 = lowlevel ListLen #Attr.2;
ret List.507;
let List.534 : U64 = lowlevel ListLen #Attr.2;
ret List.534;
procedure List.66 (#Attr.2, #Attr.3):
let List.530 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.530;
let List.557 : U8 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
ret List.557;
procedure List.72 (#Attr.2, #Attr.3, #Attr.4):
let List.500 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.500;
let List.527 : List U8 = lowlevel ListSublist #Attr.2 #Attr.3 #Attr.4;
ret List.527;
procedure List.80 (List.544, List.545, List.546, List.547, List.548):
joinpoint List.518 List.433 List.434 List.435 List.436 List.437:
let List.520 : Int1 = CallByName Num.22 List.436 List.437;
if List.520 then
let List.529 : U8 = CallByName List.66 List.433 List.436;
let List.521 : [C U64, C U64] = CallByName Test.3 List.434 List.529;
let List.526 : U8 = 1i64;
let List.527 : U8 = GetTagId List.521;
let List.528 : Int1 = lowlevel Eq List.526 List.527;
if List.528 then
let List.438 : U64 = UnionAtIndex (Id 1) (Index 0) List.521;
let List.524 : U64 = 1i64;
let List.523 : U64 = CallByName Num.19 List.436 List.524;
jump List.518 List.433 List.438 List.435 List.523 List.437;
procedure List.80 (List.571, List.572, List.573, List.574, List.575):
joinpoint List.545 List.439 List.440 List.441 List.442 List.443:
let List.547 : Int1 = CallByName Num.22 List.442 List.443;
if List.547 then
let List.556 : U8 = CallByName List.66 List.439 List.442;
let List.548 : [C U64, C U64] = CallByName Test.3 List.440 List.556;
let List.553 : U8 = 1i64;
let List.554 : U8 = GetTagId List.548;
let List.555 : Int1 = lowlevel Eq List.553 List.554;
if List.555 then
let List.444 : U64 = UnionAtIndex (Id 1) (Index 0) List.548;
let List.551 : U64 = 1i64;
let List.550 : U64 = CallByName Num.19 List.442 List.551;
jump List.545 List.439 List.444 List.441 List.550 List.443;
else
dec List.433;
let List.439 : U64 = UnionAtIndex (Id 0) (Index 0) List.521;
let List.525 : [C U64, C U64] = TagId(0) List.439;
ret List.525;
dec List.439;
let List.445 : U64 = UnionAtIndex (Id 0) (Index 0) List.548;
let List.552 : [C U64, C U64] = TagId(0) List.445;
ret List.552;
else
dec List.433;
let List.519 : [C U64, C U64] = TagId(1) List.434;
ret List.519;
dec List.439;
let List.546 : [C U64, C U64] = TagId(1) List.440;
ret List.546;
in
jump List.518 List.544 List.545 List.546 List.547 List.548;
jump List.545 List.571 List.572 List.573 List.574 List.575;
procedure List.92 (List.430, List.431, List.432):
let List.516 : U64 = 0i64;
let List.517 : U64 = CallByName List.6 List.430;
let List.515 : [C U64, C U64] = CallByName List.80 List.430 List.431 List.432 List.516 List.517;
ret List.515;
procedure List.93 (List.436, List.437, List.438):
let List.543 : U64 = 0i64;
let List.544 : U64 = CallByName List.6 List.436;
let List.542 : [C U64, C U64] = CallByName List.80 List.436 List.437 List.438 List.543 List.544;
ret List.542;
procedure Num.19 (#Attr.2, #Attr.3):
let Num.283 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;

View file

@ -78,11 +78,6 @@ pub unsafe extern "C" fn roc_panic(c_ptr: *mut c_void, tag_id: u32) {
}
}
#[no_mangle]
pub unsafe extern "C" fn roc_memcpy(dst: *mut c_void, src: *mut c_void, n: usize) -> *mut c_void {
libc::memcpy(dst, src, n)
}
#[no_mangle]
pub unsafe extern "C" fn roc_memset(dst: *mut c_void, c: i32, n: usize) -> *mut c_void {
libc::memset(dst, c, n)

View file

@ -49,11 +49,6 @@ pub unsafe extern "C" fn roc_panic(c_ptr: *mut c_void, tag_id: u32) {
}
}
#[no_mangle]
pub unsafe extern "C" fn roc_memcpy(dst: *mut c_void, src: *mut c_void, n: usize) -> *mut c_void {
libc::memcpy(dst, src, n)
}
#[no_mangle]
pub unsafe extern "C" fn roc_memset(dst: *mut c_void, c: i32, n: usize) -> *mut c_void {
libc::memset(dst, c, n)

View file

@ -71,11 +71,6 @@ pub unsafe extern "C" fn roc_panic(c_ptr: *mut c_void, tag_id: u32) {
}
}
#[no_mangle]
pub unsafe extern "C" fn roc_memcpy(dst: *mut c_void, src: *mut c_void, n: usize) -> *mut c_void {
libc::memcpy(dst, src, n)
}
#[no_mangle]
pub unsafe extern "C" fn roc_memset(dst: *mut c_void, c: i32, n: usize) -> *mut c_void {
libc::memset(dst, c, n)

View file

@ -13,7 +13,7 @@ pub extern "C" fn rust_main() -> i32 {
use std::cmp::Ordering;
use std::collections::hash_set::HashSet;
let tag_union = test_glue::mainForHost(());
let tag_union = test_glue::mainForHost(());
// Verify that it has all the expected traits.
@ -89,11 +89,6 @@ pub unsafe extern "C" fn roc_panic(c_ptr: *mut c_void, tag_id: u32) {
}
}
#[no_mangle]
pub unsafe extern "C" fn roc_memcpy(dst: *mut c_void, src: *mut c_void, n: usize) -> *mut c_void {
libc::memcpy(dst, src, n)
}
#[no_mangle]
pub unsafe extern "C" fn roc_memset(dst: *mut c_void, c: i32, n: usize) -> *mut c_void {
libc::memset(dst, c, n)

View file

@ -75,11 +75,6 @@ pub unsafe extern "C" fn roc_panic(c_ptr: *mut c_void, tag_id: u32) {
}
}
#[no_mangle]
pub unsafe extern "C" fn roc_memcpy(dst: *mut c_void, src: *mut c_void, n: usize) -> *mut c_void {
libc::memcpy(dst, src, n)
}
#[no_mangle]
pub unsafe extern "C" fn roc_memset(dst: *mut c_void, c: i32, n: usize) -> *mut c_void {
libc::memset(dst, c, n)

View file

@ -88,11 +88,6 @@ pub unsafe extern "C" fn roc_panic(c_ptr: *mut c_void, tag_id: u32) {
}
}
#[no_mangle]
pub unsafe extern "C" fn roc_memcpy(dst: *mut c_void, src: *mut c_void, n: usize) -> *mut c_void {
libc::memcpy(dst, src, n)
}
#[no_mangle]
pub unsafe extern "C" fn roc_memset(dst: *mut c_void, c: i32, n: usize) -> *mut c_void {
libc::memset(dst, c, n)

View file

@ -76,11 +76,6 @@ pub unsafe extern "C" fn roc_panic(c_ptr: *mut c_void, tag_id: u32) {
}
}
#[no_mangle]
pub unsafe extern "C" fn roc_memcpy(dst: *mut c_void, src: *mut c_void, n: usize) -> *mut c_void {
libc::memcpy(dst, src, n)
}
#[no_mangle]
pub unsafe extern "C" fn roc_memset(dst: *mut c_void, c: i32, n: usize) -> *mut c_void {
libc::memset(dst, c, n)

View file

@ -73,11 +73,6 @@ pub unsafe extern "C" fn roc_panic(c_ptr: *mut c_void, tag_id: u32) {
}
}
#[no_mangle]
pub unsafe extern "C" fn roc_memcpy(dst: *mut c_void, src: *mut c_void, n: usize) -> *mut c_void {
libc::memcpy(dst, src, n)
}
#[no_mangle]
pub unsafe extern "C" fn roc_memset(dst: *mut c_void, c: i32, n: usize) -> *mut c_void {
libc::memset(dst, c, n)

View file

@ -91,11 +91,6 @@ pub unsafe extern "C" fn roc_panic(c_ptr: *mut c_void, tag_id: u32) {
}
}
#[no_mangle]
pub unsafe extern "C" fn roc_memcpy(dst: *mut c_void, src: *mut c_void, n: usize) -> *mut c_void {
libc::memcpy(dst, src, n)
}
#[no_mangle]
pub unsafe extern "C" fn roc_memset(dst: *mut c_void, c: i32, n: usize) -> *mut c_void {
libc::memset(dst, c, n)

View file

@ -87,11 +87,6 @@ pub unsafe extern "C" fn roc_panic(c_ptr: *mut c_void, tag_id: u32) {
}
}
#[no_mangle]
pub unsafe extern "C" fn roc_memcpy(dst: *mut c_void, src: *mut c_void, n: usize) -> *mut c_void {
libc::memcpy(dst, src, n)
}
#[no_mangle]
pub unsafe extern "C" fn roc_memset(dst: *mut c_void, c: i32, n: usize) -> *mut c_void {
libc::memset(dst, c, n)

View file

@ -102,11 +102,6 @@ pub unsafe extern "C" fn roc_panic(c_ptr: *mut c_void, tag_id: u32) {
}
}
#[no_mangle]
pub unsafe extern "C" fn roc_memcpy(dst: *mut c_void, src: *mut c_void, n: usize) -> *mut c_void {
libc::memcpy(dst, src, n)
}
#[no_mangle]
pub unsafe extern "C" fn roc_memset(dst: *mut c_void, c: i32, n: usize) -> *mut c_void {
libc::memset(dst, c, n)

View file

@ -51,11 +51,6 @@ pub unsafe extern "C" fn roc_panic(c_ptr: *mut c_void, tag_id: u32) {
}
}
#[no_mangle]
pub unsafe extern "C" fn roc_memcpy(dst: *mut c_void, src: *mut c_void, n: usize) -> *mut c_void {
libc::memcpy(dst, src, n)
}
#[no_mangle]
pub unsafe extern "C" fn roc_memset(dst: *mut c_void, c: i32, n: usize) -> *mut c_void {
libc::memset(dst, c, n)

View file

@ -51,11 +51,6 @@ pub unsafe extern "C" fn roc_panic(c_ptr: *mut c_void, tag_id: u32) {
}
}
#[no_mangle]
pub unsafe extern "C" fn roc_memcpy(dst: *mut c_void, src: *mut c_void, n: usize) -> *mut c_void {
libc::memcpy(dst, src, n)
}
#[no_mangle]
pub unsafe extern "C" fn roc_memset(dst: *mut c_void, c: i32, n: usize) -> *mut c_void {
libc::memset(dst, c, n)

View file

@ -51,11 +51,6 @@ pub unsafe extern "C" fn roc_panic(c_ptr: *mut c_void, tag_id: u32) {
}
}
#[no_mangle]
pub unsafe extern "C" fn roc_memcpy(dst: *mut c_void, src: *mut c_void, n: usize) -> *mut c_void {
libc::memcpy(dst, src, n)
}
#[no_mangle]
pub unsafe extern "C" fn roc_memset(dst: *mut c_void, c: i32, n: usize) -> *mut c_void {
libc::memset(dst, c, n)

View file

@ -77,11 +77,6 @@ pub unsafe extern "C" fn roc_panic(c_ptr: *mut c_void, tag_id: u32) {
}
}
#[no_mangle]
pub unsafe extern "C" fn roc_memcpy(dst: *mut c_void, src: *mut c_void, n: usize) -> *mut c_void {
libc::memcpy(dst, src, n)
}
#[no_mangle]
pub unsafe extern "C" fn roc_memset(dst: *mut c_void, c: i32, n: usize) -> *mut c_void {
libc::memset(dst, c, n)

View file

@ -82,11 +82,6 @@ pub unsafe extern "C" fn roc_panic(c_ptr: *mut c_void, tag_id: u32) {
}
}
#[no_mangle]
pub unsafe extern "C" fn roc_memcpy(dst: *mut c_void, src: *mut c_void, n: usize) -> *mut c_void {
libc::memcpy(dst, src, n)
}
#[no_mangle]
pub unsafe extern "C" fn roc_memset(dst: *mut c_void, c: i32, n: usize) -> *mut c_void {
libc::memset(dst, c, n)

View file

@ -79,11 +79,6 @@ pub unsafe extern "C" fn roc_panic(c_ptr: *mut c_void, tag_id: u32) {
}
}
#[no_mangle]
pub unsafe extern "C" fn roc_memcpy(dst: *mut c_void, src: *mut c_void, n: usize) -> *mut c_void {
libc::memcpy(dst, src, n)
}
#[no_mangle]
pub unsafe extern "C" fn roc_memset(dst: *mut c_void, c: i32, n: usize) -> *mut c_void {
libc::memset(dst, c, n)

View file

@ -140,7 +140,6 @@ fn collect_roc_definitions<'a>(object: &object::File<'a, &'a [u8]>) -> MutMap<St
// special exceptions for roc_ functions that map to libc symbols
let direct_mapping = match name {
"roc_memcpy" => Some("memcpy"),
"roc_memset" => Some("memset"),
"roc_memmove" => Some("memmove"),
@ -603,7 +602,7 @@ fn gen_elf_le(
}
// Copy header and shift everything to enable more program sections.
let added_header_count = 2;
let added_header_count = 3;
md.added_byte_count = ph_ent_size as u64 * added_header_count;
md.added_byte_count = md.added_byte_count
+ (MIN_SECTION_ALIGNMENT as u64 - md.added_byte_count % MIN_SECTION_ALIGNMENT as u64);
@ -1278,22 +1277,12 @@ fn surgery_elf_help(
let mut offset = sh_offset as usize;
offset = align_by_constraint(offset, MIN_SECTION_ALIGNMENT);
let new_rodata_section_offset = offset;
// Align physical and virtual address of new segment.
let mut virt_offset = align_to_offset_by_constraint(
md.last_vaddr as usize,
offset,
md.load_align_constraint as usize,
);
let new_rodata_section_vaddr = virt_offset;
if verbose {
println!();
println!(
"New Virtual Rodata Section Address: {:+x?}",
new_rodata_section_vaddr
);
}
// First decide on sections locations and then recode every exact symbol locations.
@ -1375,13 +1364,40 @@ fn surgery_elf_help(
println!("Found App Function Symbols: {:+x?}", app_func_vaddr_map);
}
let (new_rodata_section_offset, new_rodata_section_vaddr) = rodata_sections
.iter()
.map(|sec| section_offset_map.get(&sec.index()).unwrap())
.min()
.unwrap();
let (new_rodata_section_offset, new_rodata_section_vaddr) = (
*new_rodata_section_offset as u64,
*new_rodata_section_vaddr as u64,
);
let (new_text_section_offset, new_text_section_vaddr) = text_sections
.iter()
.map(|sec| section_offset_map.get(&sec.index()).unwrap())
.min()
.unwrap();
let (new_text_section_offset, new_text_section_vaddr) =
(*new_text_section_offset, *new_text_section_vaddr);
let (new_text_section_offset, new_text_section_vaddr) = (
*new_text_section_offset as u64,
*new_text_section_vaddr as u64,
);
// BSS section is not guaranteed to exist.
// If it doesn't exist, just use the text section offset.
// This will make a bss section of size 0.
let bss_default = (
new_text_section_offset as usize,
new_text_section_vaddr as usize,
);
let (new_bss_section_offset, new_bss_section_vaddr) = bss_sections
.iter()
.map(|sec| section_offset_map.get(&sec.index()).unwrap())
.min()
.unwrap_or(&bss_default);
let (new_bss_section_offset, new_bss_section_vaddr) = (
*new_bss_section_offset as u64,
*new_bss_section_vaddr as u64,
);
// Move data and deal with relocations.
for sec in rodata_sections
@ -1494,15 +1510,15 @@ fn surgery_elf_help(
// Flush app only data to speed up write to disk.
exec_mmap
.flush_async_range(
new_rodata_section_offset,
offset - new_rodata_section_offset,
new_rodata_section_offset as usize,
offset - new_rodata_section_offset as usize,
)
.unwrap_or_else(|e| internal_error!("{}", e));
// TODO: look into merging symbol tables, debug info, and eh frames to enable better debugger experience.
// Add 2 new sections and segments.
let new_section_count = 2;
// Add 3 new sections and segments.
let new_section_count = 3;
offset += new_section_count * sh_ent_size as usize;
let section_headers = load_structs_inplace_mut::<elf::SectionHeader64<LE>>(
exec_mmap,
@ -1510,19 +1526,17 @@ fn surgery_elf_help(
sh_num as usize + new_section_count,
);
let new_rodata_section_size = new_text_section_offset as u64 - new_rodata_section_offset as u64;
let new_rodata_section_virtual_size =
new_text_section_vaddr as u64 - new_rodata_section_vaddr as u64;
let new_text_section_vaddr = new_rodata_section_vaddr as u64 + new_rodata_section_size;
let new_text_section_size = new_sh_offset as u64 - new_text_section_offset as u64;
let new_rodata_section_size = new_text_section_offset - new_rodata_section_offset;
let new_bss_section_virtual_size = new_text_section_vaddr - new_bss_section_vaddr;
let new_text_section_size = new_sh_offset as u64 - new_text_section_offset;
// set the new rodata section header
section_headers[section_headers.len() - 2] = elf::SectionHeader64 {
section_headers[section_headers.len() - 3] = elf::SectionHeader64 {
sh_name: endian::U32::new(LE, 0),
sh_type: endian::U32::new(LE, elf::SHT_PROGBITS),
sh_flags: endian::U64::new(LE, elf::SHF_ALLOC as u64),
sh_addr: endian::U64::new(LE, new_rodata_section_vaddr as u64),
sh_offset: endian::U64::new(LE, new_rodata_section_offset as u64),
sh_addr: endian::U64::new(LE, new_rodata_section_vaddr),
sh_offset: endian::U64::new(LE, new_rodata_section_offset),
sh_size: endian::U64::new(LE, new_rodata_section_size),
sh_link: endian::U32::new(LE, 0),
sh_info: endian::U32::new(LE, 0),
@ -1530,13 +1544,27 @@ fn surgery_elf_help(
sh_entsize: endian::U64::new(LE, 0),
};
// set the new bss section header
section_headers[section_headers.len() - 2] = elf::SectionHeader64 {
sh_name: endian::U32::new(LE, 0),
sh_type: endian::U32::new(LE, elf::SHT_NOBITS),
sh_flags: endian::U64::new(LE, (elf::SHF_ALLOC) as u64),
sh_addr: endian::U64::new(LE, new_bss_section_vaddr),
sh_offset: endian::U64::new(LE, new_bss_section_offset),
sh_size: endian::U64::new(LE, new_bss_section_virtual_size),
sh_link: endian::U32::new(LE, 0),
sh_info: endian::U32::new(LE, 0),
sh_addralign: endian::U64::new(LE, 16),
sh_entsize: endian::U64::new(LE, 0),
};
// set the new text section header
section_headers[section_headers.len() - 1] = elf::SectionHeader64 {
sh_name: endian::U32::new(LE, 0),
sh_type: endian::U32::new(LE, elf::SHT_PROGBITS),
sh_flags: endian::U64::new(LE, (elf::SHF_ALLOC | elf::SHF_EXECINSTR) as u64),
sh_addr: endian::U64::new(LE, new_text_section_vaddr),
sh_offset: endian::U64::new(LE, new_text_section_offset as u64),
sh_offset: endian::U64::new(LE, new_text_section_offset),
sh_size: endian::U64::new(LE, new_text_section_size),
sh_link: endian::U32::new(LE, 0),
sh_info: endian::U32::new(LE, 0),
@ -1559,14 +1587,26 @@ fn surgery_elf_help(
);
// set the new rodata section program header
program_headers[program_headers.len() - 2] = elf::ProgramHeader64 {
program_headers[program_headers.len() - 3] = elf::ProgramHeader64 {
p_type: endian::U32::new(LE, elf::PT_LOAD),
p_flags: endian::U32::new(LE, elf::PF_R),
p_offset: endian::U64::new(LE, new_rodata_section_offset as u64),
p_vaddr: endian::U64::new(LE, new_rodata_section_vaddr as u64),
p_paddr: endian::U64::new(LE, new_rodata_section_vaddr as u64),
p_offset: endian::U64::new(LE, new_rodata_section_offset),
p_vaddr: endian::U64::new(LE, new_rodata_section_vaddr),
p_paddr: endian::U64::new(LE, new_rodata_section_vaddr),
p_filesz: endian::U64::new(LE, new_rodata_section_size),
p_memsz: endian::U64::new(LE, new_rodata_section_virtual_size),
p_memsz: endian::U64::new(LE, new_rodata_section_size),
p_align: endian::U64::new(LE, md.load_align_constraint),
};
// set the new bss section program header
program_headers[program_headers.len() - 2] = elf::ProgramHeader64 {
p_type: endian::U32::new(LE, elf::PT_LOAD),
p_flags: endian::U32::new(LE, elf::PF_R | elf::PF_W),
p_offset: endian::U64::new(LE, new_bss_section_offset),
p_vaddr: endian::U64::new(LE, new_bss_section_vaddr),
p_paddr: endian::U64::new(LE, new_bss_section_vaddr),
p_filesz: endian::U64::new(LE, 0),
p_memsz: endian::U64::new(LE, new_bss_section_virtual_size),
p_align: endian::U64::new(LE, md.load_align_constraint),
};
@ -1575,7 +1615,7 @@ fn surgery_elf_help(
program_headers[new_text_section_index] = elf::ProgramHeader64 {
p_type: endian::U32::new(LE, elf::PT_LOAD),
p_flags: endian::U32::new(LE, elf::PF_R | elf::PF_X),
p_offset: endian::U64::new(LE, new_text_section_offset as u64),
p_offset: endian::U64::new(LE, new_text_section_offset),
p_vaddr: endian::U64::new(LE, new_text_section_vaddr),
p_paddr: endian::U64::new(LE, new_text_section_vaddr),
p_filesz: endian::U64::new(LE, new_text_section_size),
@ -1722,7 +1762,6 @@ mod tests {
assert_eq!(
[
"memcpy",
"memset",
"roc_alloc",
"roc_dealloc",

View file

@ -141,9 +141,7 @@ fn collect_roc_definitions<'a>(object: &object::File<'a, &'a [u8]>) -> MutMap<St
let address = sym.address();
// special exceptions for memcpy and memset.
if name == "roc_memcpy" {
vaddresses.insert("memcpy".to_string(), address);
} else if name == "roc_memset" {
if name == "roc_memset" {
vaddresses.insert("memset".to_string(), address);
}

View file

@ -444,6 +444,7 @@ pub(crate) fn surgery_pe(executable_path: &Path, metadata_path: &Path, roc_app_b
"__fixsfti",
"__fixunsdfti",
"__fixunssfti",
"memcpy_decision",
]
.contains(&name.as_str());
if *address == 0 && !name.starts_with("roc") && !is_ingested_compiler_rt {
@ -1318,7 +1319,6 @@ fn relocate_dummy_dll_entries(executable: &mut [u8], md: &PeMetadata) {
/// Redirect `memcpy` and similar libc functions to their roc equivalents
pub(crate) fn redirect_libc_functions(name: &str) -> Option<&str> {
match name {
"memcpy" => Some("roc_memcpy"),
"memset" => Some("roc_memset"),
"memmove" => Some("roc_memmove"),
_ => None,

View file

@ -64,13 +64,6 @@ void roc_panic(void *ptr, unsigned int alignment)
//--------------------------
void *roc_memcpy(void *dest, const void *src, size_t n)
{
return memcpy(dest, src, n);
}
//--------------------------
void *roc_memset(void *str, int c, size_t n)
{
return memset(str, c, n);

View file

@ -15,12 +15,14 @@ roc_exhaustive = { path = "../compiler/exhaustive" }
roc_fmt = { path = "../compiler/fmt" }
roc_module = { path = "../compiler/module" }
roc_parse = { path = "../compiler/parse" }
roc_packaging = { path = "../packaging" }
roc_problem = { path = "../compiler/problem" }
roc_region = { path = "../compiler/region" }
roc_solve_problem = { path = "../compiler/solve_problem" }
roc_std = { path = "../roc_std" }
roc_types = { path = "../compiler/types" }
ven_pretty = { path = "../vendor/pretty" }
byte-unit = "4.0.19"
itertools = "0.10.5"
bumpalo.workspace = true

View file

@ -7,6 +7,11 @@ use std::path::{Path, PathBuf};
use std::{fmt, io};
use ven_pretty::{text, BoxAllocator, DocAllocator, DocBuilder, Render, RenderAnnotated};
#[cfg(not(target_family = "wasm"))]
use byte_unit::Byte;
#[cfg(not(target_family = "wasm"))]
use roc_packaging::https::Problem;
pub use crate::error::canonicalize::can_problem;
pub use crate::error::parse::parse_problem;
pub use crate::error::r#type::type_problem;
@ -1075,6 +1080,471 @@ where
}
}
#[cfg(not(target_family = "wasm"))]
pub fn to_https_problem_report_string(url: &str, https_problem: Problem) -> String {
let src_lines: Vec<&str> = Vec::new();
let mut module_ids = ModuleIds::default();
let module_id = module_ids.get_or_insert(&"find module name somehow?".into());
let interns = Interns::default();
// Report parsing and canonicalization problems
let alloc = RocDocAllocator::new(&src_lines, module_id, &interns);
let mut buf = String::new();
let palette = DEFAULT_PALETTE;
let report = to_https_problem_report(&alloc, url, https_problem);
report.render_color_terminal(&mut buf, &alloc, &palette);
buf
}
#[cfg(not(target_family = "wasm"))]
pub fn to_https_problem_report<'b>(
alloc: &'b RocDocAllocator<'b>,
url: &'b str,
https_problem: Problem,
) -> Report<'b> {
match https_problem {
Problem::UnsupportedEncoding(not_supported_encoding) => {
let doc = alloc.stack([
alloc.reflow(r"I was trying to download this URL:"),
alloc.string((&url).to_string()).annotate(Annotation::Url).indent(4),
alloc.concat([
alloc.reflow(r"But the server replied with a "),
alloc.reflow(r"content encoding").annotate(Annotation::Emphasized),
alloc.reflow(r" that I do not understand ("),
alloc.string(not_supported_encoding).annotate(Annotation::Emphasized),
alloc.reflow(r")."),
]),
alloc.concat([
alloc.reflow(r"The supported content encodings are "),
alloc.keyword(r"br"),
alloc.reflow(r", "),
alloc.keyword(r"gzip"),
alloc.reflow(r" and "),
alloc.keyword(r"deflate"),
]),
alloc.concat([
alloc.tip(),
alloc.reflow(r"Perhaps you can check if the URL is correctly formed, or if the server is correctly configured."),
]),
]);
Report {
filename: "UNKNOWN.roc".into(),
doc,
title: "UNSUPPORTED ENCODING".to_string(),
severity: Severity::Fatal,
}
}
Problem::MultipleEncodings(multiple_encodings) => {
let doc = alloc.stack([
alloc.reflow(r"I was trying to download this URL:"),
alloc.string((&url).to_string()).annotate(Annotation::Url).indent(4),
alloc.concat([
alloc.reflow(r"But the server replied with multiple "),
alloc.reflow(r"content encodings").annotate(Annotation::Emphasized),
alloc.reflow(r": "),
alloc.string(multiple_encodings).annotate(Annotation::Emphasized),
alloc.reflow(r"."),
]),
alloc.concat([
alloc.reflow(r"The supported content encodings are "),
alloc.keyword(r"br"),
alloc.reflow(r", "),
alloc.keyword(r"gzip"),
alloc.reflow(r" and "),
alloc.keyword(r"deflate"),
alloc.reflow(r". However, the server reply can only contain "),
alloc.reflow(r"one").annotate(Annotation::Emphasized),
alloc.reflow(r"."),
]),
alloc.concat([
alloc.tip(),
alloc.reflow(r"Perhaps you can check if the URL is correctly formed, or if the server is correctly configured."),
]),
]);
Report {
filename: "UNKNOWN.roc".into(),
doc,
title: "MULTIPLE ENCODINGS".to_string(),
severity: Severity::Fatal,
}
}
Problem::InvalidContentHash { expected, actual } => {
let doc = alloc.stack([
alloc.reflow(r"I was able to download this URL:"),
alloc.string((&url).to_string()).annotate(Annotation::Url).indent(4),
alloc.concat([
alloc.reflow(r"I use a mechanism to detect if the file might "),
alloc.reflow(r"have been tampered with. This could happen if "),
alloc.reflow(r"the server or domain have been compromised."),
]),
alloc.concat([
alloc.reflow(r"This is the content signature I was "),
alloc.reflow(r"expecting").annotate(Annotation::Emphasized),
alloc.reflow(r":"),
]),
alloc.string(expected).annotate(Annotation::PlainText).indent(4),
alloc.concat([
alloc.reflow(r"However, this is the content signature I "),
alloc.reflow(r"obtained").annotate(Annotation::Emphasized),
alloc.reflow(r":"),
]),
alloc.string(actual).annotate(Annotation::PlainText).indent(4),
alloc.reflow(r"To keep you secure, I will not execute this untrusted code."),
alloc.concat([
alloc.tip(),
alloc.reflow(r"Check if the URL is correctly formed and if this is the server you are expecting to connect to."),
]),
]);
Report {
filename: "UNKNOWN.roc".into(),
doc,
title: "INVALID CONTENT HASH".to_string(),
severity: Severity::Fatal,
}
}
// TODO: The reporting text for IoErr and FsExtraErr could probably be unified
Problem::IoErr(io_error) => {
let doc = alloc.stack([
alloc.reflow(r"I was trying to download this URL:"),
alloc
.string((&url).to_string())
.annotate(Annotation::Url)
.indent(4),
alloc.reflow(r"But I encountered an IO (input/output) error:"),
alloc
.string(io_error.to_string())
.annotate(Annotation::PlainText)
.indent(4),
// TODO: What should the tip for IO errors be?
// alloc.concat([
// alloc.tip(),
// alloc.reflow(r"Check the error message."),
// ]),
]);
Report {
filename: "UNKNOWN.roc".into(),
doc,
title: "IO ERROR".to_string(),
severity: Severity::Fatal,
}
}
// TODO: The reporting text for IoErr and FsExtraErr could probably be unified
Problem::FsExtraErr(fs_extra_error) => {
let doc = alloc.stack([
alloc.reflow(r"I was trying to download this URL:"),
alloc
.string((&url).to_string())
.annotate(Annotation::Url)
.indent(4),
alloc.reflow(r"But I encountered an IO (input/output) error:"),
alloc
.string(fs_extra_error.to_string())
.annotate(Annotation::PlainText)
.indent(4),
// TODO: What should the tip for IO errors be?
// alloc.concat([
// alloc.tip(),
// alloc.reflow(r"Check the error message."),
// ]),
]);
Report {
filename: "UNKNOWN.roc".into(),
doc,
title: "IO ERROR".to_string(),
severity: Severity::Fatal,
}
}
Problem::HttpErr(reqwest_error) => {
let doc = alloc.stack([
alloc.reflow(r"I was trying to download this URL:"),
alloc
.string((&url).to_string())
.annotate(Annotation::Url)
.indent(4),
alloc.reflow(r"But I encountered a network error:"),
alloc
.string(reqwest_error.to_string())
.annotate(Annotation::PlainText)
.indent(4),
// TODO: What should the tip for HTTP IO errors be?
// Should we import reqwest and check stuff like
// reqwest_error.{ is_redirect(), is_status(), is_timeout(), ... } ?
//
// alloc.concat([
// alloc.tip(),
// alloc.reflow(r"Check the error message."),
// ]),
]);
Report {
filename: "UNKNOWN.roc".into(),
doc,
title: "HTTP ERROR".to_string(),
severity: Severity::Fatal,
}
}
Problem::InvalidUrl(roc_packaging::https::UrlProblem::InvalidExtensionSuffix(
invalid_suffix,
)) => {
let (suffix_text, annotation_style) = if invalid_suffix.is_empty() {
(r"empty".to_string(), Annotation::PlainText)
} else {
(invalid_suffix, Annotation::Emphasized)
};
let doc = alloc.stack([
alloc.reflow(r"I was trying to download this URL:"),
alloc
.string((&url).to_string())
.annotate(Annotation::Url)
.indent(4),
alloc.concat([
alloc.reflow(r"However, this file's extension ("),
alloc.string(suffix_text).annotate(annotation_style),
alloc.reflow(r") is not a supported extension."),
]),
alloc.concat([
alloc.reflow(r"The supported extensions are "),
alloc.keyword(r".tar"),
alloc.reflow(r", "),
alloc.keyword(r".tar.gz"),
alloc.reflow(r" and "),
alloc.keyword(r".tar.br"),
]),
alloc.concat([
alloc.tip(),
alloc.reflow(r"Check that you have the correct URL for this package/platform."),
]),
]);
Report {
filename: "UNKNOWN.roc".into(),
doc,
title: "INVALID EXTENSION SUFFIX".to_string(),
severity: Severity::Fatal,
}
}
Problem::InvalidUrl(roc_packaging::https::UrlProblem::MissingTarExt) => {
let doc = alloc.stack([
alloc.reflow(r"I was trying to download this URL:"),
alloc
.string((&url).to_string())
.annotate(Annotation::Url)
.indent(4),
alloc.concat([
alloc.reflow(r"However, this file's extension is not "),
alloc.keyword(r".tar"),
alloc.reflow(r"."),
]),
alloc.concat([
alloc.reflow(r"The supported extensions are "),
alloc.keyword(r".tar"),
alloc.reflow(r", "),
alloc.keyword(r".tar.gz"),
alloc.reflow(r" and "),
alloc.keyword(r".tar.br"),
]),
alloc.concat([
alloc.tip(),
alloc.reflow(r"Check that you have the correct URL for this package/platform."),
]),
]);
Report {
filename: "UNKNOWN.roc".into(),
doc,
title: "INVALID EXTENSION".to_string(),
severity: Severity::Fatal,
}
}
Problem::InvalidUrl(roc_packaging::https::UrlProblem::InvalidFragment(
invalid_fragment,
)) => {
let doc = alloc.stack([
alloc.reflow(r"I was trying to download this URL:"),
alloc
.string((&url).to_string())
.annotate(Annotation::Url)
.indent(4),
alloc.concat([
alloc.reflow(r"However, this URL's fragment (the part after #) "),
alloc.reflow(r"is not valid. When present, the fragment must point to "),
alloc.reflow(r"an existing "),
alloc.keyword(r".roc"),
alloc.reflow(r" file inside the package. Also, the filename can't be empty, "),
alloc.reflow(r"so a fragment of #.roc would also not be valid. This is the "),
alloc.reflow(r"invalid fragment I encountered: "),
]),
alloc
.string(invalid_fragment)
.annotate(Annotation::Emphasized)
.indent(4),
alloc.concat([
alloc.tip(),
alloc.reflow(r"Check that the fragment points to an existing "),
alloc.keyword(r".roc"),
alloc.reflow(r" file inside the package. You can download this package "),
alloc.reflow(r"and inspect it locally."),
]),
]);
Report {
filename: "UNKNOWN.roc".into(),
doc,
title: "INVALID FRAGMENT".to_string(),
severity: Severity::Fatal,
}
}
Problem::InvalidUrl(roc_packaging::https::UrlProblem::MissingHash) => {
let doc = alloc.stack([
alloc.reflow(r"I was trying to download this URL:"),
alloc
.string((&url).to_string())
.annotate(Annotation::Url)
.indent(4),
alloc.concat([
alloc.reflow(r"I use a content hash to detect if the file might "),
alloc.reflow(r"have been tampered with. This could happen if "),
alloc.reflow(r"the server or domain have been compromised."),
]),
alloc.concat([
alloc.reflow(r"The way this works is that the name of the file "),
alloc.reflow(r"is the BLAKE3 hash of the contents of the "),
alloc.reflow(r"file itself. If someone would tamper with the file, "),
alloc.reflow(r"I could notify and protect you. However, I could "),
alloc.reflow(r"not find the expected hash on the URL above, "),
alloc.reflow(r"so I cannot apply this tamper-check."),
]),
alloc.concat([
alloc.tip(),
alloc
.reflow(r"Check that you have the correct URL for this package/platform. "),
alloc.reflow(r"Here is an example of how such a hash looks like: "),
alloc
.string(r"tE4xS_zLdmmxmHwHih9kHWQ7fsXtJr7W7h3425-eZFk".to_string())
.annotate(Annotation::Emphasized),
]),
]);
Report {
filename: "UNKNOWN.roc".into(),
doc,
title: "MISSING PACKAGE HASH".to_string(),
severity: Severity::Fatal,
}
}
Problem::InvalidUrl(roc_packaging::https::UrlProblem::MissingHttps) => {
let doc = alloc.stack([
alloc.reflow(r"I was trying to download this URL:"),
alloc
.string((&url).to_string())
.annotate(Annotation::Url)
.indent(4),
alloc.concat([
alloc.reflow(r"For your security, I will only attempt to download "),
alloc.reflow(r"files from servers which use the "),
alloc.keyword(r"https"),
alloc.reflow(r" protocol."),
]),
alloc.concat([
alloc.tip(),
alloc.reflow(r"Check that you have the correct URL for this package/platform."),
]),
]);
Report {
filename: "UNKNOWN.roc".into(),
doc,
title: "HTTPS MANDATORY".to_string(),
severity: Severity::Fatal,
}
}
Problem::InvalidUrl(roc_packaging::https::UrlProblem::MisleadingCharacter) => {
let doc = alloc.stack([
alloc.reflow(r"I was trying to download this URL:"),
alloc
.string((&url).to_string())
.annotate(Annotation::Url)
.indent(4),
alloc.concat([
alloc.reflow(r"I have found one or more potentially misleading "),
alloc.reflow(r"characters in this URL. Misleading characters are "),
alloc.reflow(r"characters that look like others but aren't the same. "),
alloc.reflow(r"The following characters are classified as misleading: "),
alloc.keyword(r"@"),
alloc.reflow(r", "),
alloc.keyword("\u{2044}"),
alloc.reflow(r" (unicode 2044), "),
alloc.keyword("\u{2215}"),
alloc.reflow(r" (unicode 2215), "),
alloc.keyword("\u{FF0F}"),
alloc.reflow(r" (unicode FF0F) and "),
alloc.keyword("\u{29F8}"),
alloc.reflow(r" (unicode 29F8). "),
]),
alloc.concat([
alloc.reflow(r"If you have a use-case for any of these characters we "),
alloc.reflow(r"would like to hear about it. Reach out on "),
alloc
.string(r"https://github.com/roc-lang/roc/issues/5487".to_string())
.annotate(Annotation::Url),
]),
alloc.concat([
alloc.tip(),
alloc.reflow(r"Check that you have the correct URL for this package/platform."),
]),
]);
Report {
filename: "UNKNOWN.roc".into(),
doc,
title: "MISLEADING CHARACTERS".to_string(),
severity: Severity::Fatal,
}
}
Problem::DownloadTooBig(content_len) => {
let nice_bytes = Byte::from_bytes(content_len.into())
.get_appropriate_unit(false)
.format(3);
let doc = alloc.stack([
alloc.reflow(r"I was trying to download this URL:"),
alloc
.string((&url).to_string())
.annotate(Annotation::Url)
.indent(4),
alloc.concat([
alloc.reflow(r"But the server stated this file is "),
alloc.string(nice_bytes).annotate(Annotation::Keyword),
alloc.reflow(r" in size. This is larger that the maximum size I can handle (around 32 GB)."),
]),
alloc.concat([
alloc.tip(),
alloc.reflow(r"Check that you have the correct URL for this package/platform. "),
alloc.reflow(r"If you do, you should contact the package/platform's author and "),
alloc.reflow(r"notify them about this issue."),
]),
]);
Report {
filename: "UNKNOWN.roc".into(),
doc,
title: "FILE TOO LARGE".to_string(),
severity: Severity::Fatal,
}
}
}
}
pub fn to_file_problem_report_string(filename: &Path, error: io::ErrorKind) -> String {
let src_lines: Vec<&str> = Vec::new();

Some files were not shown because too many files have changed in this diff Show more