assemblyscript/tests/compiler/std/arraybuffer.untouched.wat
2019-02-06 23:42:43 +01:00

2666 lines
46 KiB
Plaintext

(module
(type $iiii (func (param i32 i32 i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $ii (func (param i32) (result i32)))
(type $iiiv (func (param i32 i32 i32)))
(type $iii (func (param i32 i32) (result i32)))
(type $iiiii (func (param i32 i32 i32 i32) (result i32)))
(type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\13\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
(data (i32.const 56) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
(data (i32.const 120) "\12\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
(data (i32.const 160) "\1b\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00t\00y\00p\00e\00d\00a\00r\00r\00a\00y\00.\00t\00s\00")
(data (i32.const 224) "\08\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00")
(data (i32.const 240) "\e0\00\00\00\02\00\00\00")
(data (i32.const 248) "\10\00\00\00~\00l\00i\00b\00/\00d\00a\00t\00a\00v\00i\00e\00w\00.\00t\00s\00")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $~lib/internal/allocator/AL_BITS i32 (i32.const 3))
(global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8))
(global $~lib/internal/allocator/AL_MASK i32 (i32.const 7))
(global $~lib/internal/allocator/MAX_SIZE_32 i32 (i32.const 1073741824))
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
(global $~lib/internal/arraybuffer/HEADER_SIZE i32 (i32.const 8))
(global $~lib/internal/arraybuffer/MAX_BLENGTH i32 (i32.const 1073741816))
(global $std/arraybuffer/buffer (mut i32) (i32.const 0))
(global $~argc (mut i32) (i32.const 0))
(global $std/arraybuffer/sliced (mut i32) (i32.const 0))
(global $std/arraybuffer/arr8 (mut i32) (i32.const 0))
(global $~lib/builtins/i32.MIN_VALUE i32 (i32.const -2147483648))
(global $HEAP_BASE i32 (i32.const 284))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $~lib/internal/arraybuffer/computeSize (; 1 ;) (type $ii) (param $0 i32) (result i32)
i32.const 1
i32.const 32
local.get $0
global.get $~lib/internal/arraybuffer/HEADER_SIZE
i32.add
i32.const 1
i32.sub
i32.clz
i32.sub
i32.shl
)
(func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
local.get $0
global.get $~lib/internal/allocator/MAX_SIZE_32
i32.gt_u
if
unreachable
end
global.get $~lib/allocator/arena/offset
local.set $1
local.get $1
local.get $0
local.tee $2
i32.const 1
local.tee $3
local.get $2
local.get $3
i32.gt_u
select
i32.add
global.get $~lib/internal/allocator/AL_MASK
i32.add
global.get $~lib/internal/allocator/AL_MASK
i32.const -1
i32.xor
i32.and
local.set $4
current_memory
local.set $5
local.get $4
local.get $5
i32.const 16
i32.shl
i32.gt_u
if
local.get $4
local.get $1
i32.sub
i32.const 65535
i32.add
i32.const 65535
i32.const -1
i32.xor
i32.and
i32.const 16
i32.shr_u
local.set $2
local.get $5
local.tee $3
local.get $2
local.tee $6
local.get $3
local.get $6
i32.gt_s
select
local.set $3
local.get $3
grow_memory
i32.const 0
i32.lt_s
if
local.get $2
grow_memory
i32.const 0
i32.lt_s
if
unreachable
end
end
end
local.get $4
global.set $~lib/allocator/arena/offset
local.get $1
)
(func $~lib/internal/arraybuffer/allocateUnsafe (; 3 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
local.get $0
global.get $~lib/internal/arraybuffer/MAX_BLENGTH
i32.le_u
i32.eqz
if
i32.const 0
i32.const 56
i32.const 26
i32.const 2
call $~lib/env/abort
unreachable
end
block $~lib/memory/memory.allocate|inlined.0 (result i32)
local.get $0
call $~lib/internal/arraybuffer/computeSize
local.set $2
local.get $2
call $~lib/allocator/arena/__memory_allocate
br $~lib/memory/memory.allocate|inlined.0
end
local.set $1
local.get $1
local.get $0
i32.store
local.get $1
)
(func $~lib/internal/memory/memset (; 4 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i64)
local.get $2
i32.eqz
if
return
end
local.get $0
local.get $1
i32.store8
local.get $0
local.get $2
i32.add
i32.const 1
i32.sub
local.get $1
i32.store8
local.get $2
i32.const 2
i32.le_u
if
return
end
local.get $0
i32.const 1
i32.add
local.get $1
i32.store8
local.get $0
i32.const 2
i32.add
local.get $1
i32.store8
local.get $0
local.get $2
i32.add
i32.const 2
i32.sub
local.get $1
i32.store8
local.get $0
local.get $2
i32.add
i32.const 3
i32.sub
local.get $1
i32.store8
local.get $2
i32.const 6
i32.le_u
if
return
end
local.get $0
i32.const 3
i32.add
local.get $1
i32.store8
local.get $0
local.get $2
i32.add
i32.const 4
i32.sub
local.get $1
i32.store8
local.get $2
i32.const 8
i32.le_u
if
return
end
i32.const 0
local.get $0
i32.sub
i32.const 3
i32.and
local.set $3
local.get $0
local.get $3
i32.add
local.set $0
local.get $2
local.get $3
i32.sub
local.set $2
local.get $2
i32.const -4
i32.and
local.set $2
i32.const -1
i32.const 255
i32.div_u
local.get $1
i32.const 255
i32.and
i32.mul
local.set $4
local.get $0
local.get $4
i32.store
local.get $0
local.get $2
i32.add
i32.const 4
i32.sub
local.get $4
i32.store
local.get $2
i32.const 8
i32.le_u
if
return
end
local.get $0
i32.const 4
i32.add
local.get $4
i32.store
local.get $0
i32.const 8
i32.add
local.get $4
i32.store
local.get $0
local.get $2
i32.add
i32.const 12
i32.sub
local.get $4
i32.store
local.get $0
local.get $2
i32.add
i32.const 8
i32.sub
local.get $4
i32.store
local.get $2
i32.const 24
i32.le_u
if
return
end
local.get $0
i32.const 12
i32.add
local.get $4
i32.store
local.get $0
i32.const 16
i32.add
local.get $4
i32.store
local.get $0
i32.const 20
i32.add
local.get $4
i32.store
local.get $0
i32.const 24
i32.add
local.get $4
i32.store
local.get $0
local.get $2
i32.add
i32.const 28
i32.sub
local.get $4
i32.store
local.get $0
local.get $2
i32.add
i32.const 24
i32.sub
local.get $4
i32.store
local.get $0
local.get $2
i32.add
i32.const 20
i32.sub
local.get $4
i32.store
local.get $0
local.get $2
i32.add
i32.const 16
i32.sub
local.get $4
i32.store
i32.const 24
local.get $0
i32.const 4
i32.and
i32.add
local.set $3
local.get $0
local.get $3
i32.add
local.set $0
local.get $2
local.get $3
i32.sub
local.set $2
local.get $4
i64.extend_i32_u
local.get $4
i64.extend_i32_u
i64.const 32
i64.shl
i64.or
local.set $5
block $break|0
loop $continue|0
local.get $2
i32.const 32
i32.ge_u
if
block
local.get $0
local.get $5
i64.store
local.get $0
i32.const 8
i32.add
local.get $5
i64.store
local.get $0
i32.const 16
i32.add
local.get $5
i64.store
local.get $0
i32.const 24
i32.add
local.get $5
i64.store
local.get $2
i32.const 32
i32.sub
local.set $2
local.get $0
i32.const 32
i32.add
local.set $0
end
br $continue|0
end
end
end
)
(func $~lib/arraybuffer/ArrayBuffer#constructor (; 5 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
local.get $1
global.get $~lib/internal/arraybuffer/MAX_BLENGTH
i32.gt_u
if
i32.const 0
i32.const 8
i32.const 47
i32.const 40
call $~lib/env/abort
unreachable
end
local.get $1
call $~lib/internal/arraybuffer/allocateUnsafe
local.set $3
local.get $2
i32.const 0
i32.ne
i32.eqz
if
local.get $3
global.get $~lib/internal/arraybuffer/HEADER_SIZE
i32.add
local.set $4
i32.const 0
local.set $5
local.get $1
local.set $6
local.get $4
local.get $5
local.get $6
call $~lib/internal/memory/memset
end
local.get $3
)
(func $~lib/internal/memory/memcpy (; 6 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
block $break|0
loop $continue|0
local.get $2
if (result i32)
local.get $1
i32.const 3
i32.and
else
local.get $2
end
if
block
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
local.get $2
i32.const 1
i32.sub
local.set $2
end
br $continue|0
end
end
end
local.get $0
i32.const 3
i32.and
i32.const 0
i32.eq
if
block $break|1
loop $continue|1
local.get $2
i32.const 16
i32.ge_u
if
block
local.get $0
local.get $1
i32.load
i32.store
local.get $0
i32.const 4
i32.add
local.get $1
i32.const 4
i32.add
i32.load
i32.store
local.get $0
i32.const 8
i32.add
local.get $1
i32.const 8
i32.add
i32.load
i32.store
local.get $0
i32.const 12
i32.add
local.get $1
i32.const 12
i32.add
i32.load
i32.store
local.get $1
i32.const 16
i32.add
local.set $1
local.get $0
i32.const 16
i32.add
local.set $0
local.get $2
i32.const 16
i32.sub
local.set $2
end
br $continue|1
end
end
end
local.get $2
i32.const 8
i32.and
if
local.get $0
local.get $1
i32.load
i32.store
local.get $0
i32.const 4
i32.add
local.get $1
i32.const 4
i32.add
i32.load
i32.store
local.get $0
i32.const 8
i32.add
local.set $0
local.get $1
i32.const 8
i32.add
local.set $1
end
local.get $2
i32.const 4
i32.and
if
local.get $0
local.get $1
i32.load
i32.store
local.get $0
i32.const 4
i32.add
local.set $0
local.get $1
i32.const 4
i32.add
local.set $1
end
local.get $2
i32.const 2
i32.and
if
local.get $0
local.get $1
i32.load16_u
i32.store16
local.get $0
i32.const 2
i32.add
local.set $0
local.get $1
i32.const 2
i32.add
local.set $1
end
local.get $2
i32.const 1
i32.and
if
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
end
return
end
local.get $2
i32.const 32
i32.ge_u
if
block $break|2
block $case2|2
block $case1|2
block $case0|2
local.get $0
i32.const 3
i32.and
local.set $5
local.get $5
i32.const 1
i32.eq
br_if $case0|2
local.get $5
i32.const 2
i32.eq
br_if $case1|2
local.get $5
i32.const 3
i32.eq
br_if $case2|2
br $break|2
end
block
local.get $1
i32.load
local.set $3
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
local.get $2
i32.const 3
i32.sub
local.set $2
block $break|3
loop $continue|3
local.get $2
i32.const 17
i32.ge_u
if
block
local.get $1
i32.const 1
i32.add
i32.load
local.set $4
local.get $0
local.get $3
i32.const 24
i32.shr_u
local.get $4
i32.const 8
i32.shl
i32.or
i32.store
local.get $1
i32.const 5
i32.add
i32.load
local.set $3
local.get $0
i32.const 4
i32.add
local.get $4
i32.const 24
i32.shr_u
local.get $3
i32.const 8
i32.shl
i32.or
i32.store
local.get $1
i32.const 9
i32.add
i32.load
local.set $4
local.get $0
i32.const 8
i32.add
local.get $3
i32.const 24
i32.shr_u
local.get $4
i32.const 8
i32.shl
i32.or
i32.store
local.get $1
i32.const 13
i32.add
i32.load
local.set $3
local.get $0
i32.const 12
i32.add
local.get $4
i32.const 24
i32.shr_u
local.get $3
i32.const 8
i32.shl
i32.or
i32.store
local.get $1
i32.const 16
i32.add
local.set $1
local.get $0
i32.const 16
i32.add
local.set $0
local.get $2
i32.const 16
i32.sub
local.set $2
end
br $continue|3
end
end
end
br $break|2
unreachable
end
unreachable
end
block
local.get $1
i32.load
local.set $3
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
local.get $2
i32.const 2
i32.sub
local.set $2
block $break|4
loop $continue|4
local.get $2
i32.const 18
i32.ge_u
if
block
local.get $1
i32.const 2
i32.add
i32.load
local.set $4
local.get $0
local.get $3
i32.const 16
i32.shr_u
local.get $4
i32.const 16
i32.shl
i32.or
i32.store
local.get $1
i32.const 6
i32.add
i32.load
local.set $3
local.get $0
i32.const 4
i32.add
local.get $4
i32.const 16
i32.shr_u
local.get $3
i32.const 16
i32.shl
i32.or
i32.store
local.get $1
i32.const 10
i32.add
i32.load
local.set $4
local.get $0
i32.const 8
i32.add
local.get $3
i32.const 16
i32.shr_u
local.get $4
i32.const 16
i32.shl
i32.or
i32.store
local.get $1
i32.const 14
i32.add
i32.load
local.set $3
local.get $0
i32.const 12
i32.add
local.get $4
i32.const 16
i32.shr_u
local.get $3
i32.const 16
i32.shl
i32.or
i32.store
local.get $1
i32.const 16
i32.add
local.set $1
local.get $0
i32.const 16
i32.add
local.set $0
local.get $2
i32.const 16
i32.sub
local.set $2
end
br $continue|4
end
end
end
br $break|2
unreachable
end
unreachable
end
block
local.get $1
i32.load
local.set $3
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
local.get $2
i32.const 1
i32.sub
local.set $2
block $break|5
loop $continue|5
local.get $2
i32.const 19
i32.ge_u
if
block
local.get $1
i32.const 3
i32.add
i32.load
local.set $4
local.get $0
local.get $3
i32.const 8
i32.shr_u
local.get $4
i32.const 24
i32.shl
i32.or
i32.store
local.get $1
i32.const 7
i32.add
i32.load
local.set $3
local.get $0
i32.const 4
i32.add
local.get $4
i32.const 8
i32.shr_u
local.get $3
i32.const 24
i32.shl
i32.or
i32.store
local.get $1
i32.const 11
i32.add
i32.load
local.set $4
local.get $0
i32.const 8
i32.add
local.get $3
i32.const 8
i32.shr_u
local.get $4
i32.const 24
i32.shl
i32.or
i32.store
local.get $1
i32.const 15
i32.add
i32.load
local.set $3
local.get $0
i32.const 12
i32.add
local.get $4
i32.const 8
i32.shr_u
local.get $3
i32.const 24
i32.shl
i32.or
i32.store
local.get $1
i32.const 16
i32.add
local.set $1
local.get $0
i32.const 16
i32.add
local.set $0
local.get $2
i32.const 16
i32.sub
local.set $2
end
br $continue|5
end
end
end
br $break|2
unreachable
end
unreachable
end
end
local.get $2
i32.const 16
i32.and
if
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
end
local.get $2
i32.const 8
i32.and
if
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
end
local.get $2
i32.const 4
i32.and
if
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
end
local.get $2
i32.const 2
i32.and
if
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
end
local.get $2
i32.const 1
i32.and
if
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
end
)
(func $~lib/internal/memory/memmove (; 7 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
local.get $0
local.get $1
i32.eq
if
return
end
local.get $1
local.get $2
i32.add
local.get $0
i32.le_u
local.tee $3
if (result i32)
local.get $3
else
local.get $0
local.get $2
i32.add
local.get $1
i32.le_u
end
if
local.get $0
local.get $1
local.get $2
call $~lib/internal/memory/memcpy
return
end
local.get $0
local.get $1
i32.lt_u
if
local.get $1
i32.const 7
i32.and
local.get $0
i32.const 7
i32.and
i32.eq
if
block $break|0
loop $continue|0
local.get $0
i32.const 7
i32.and
if
block
local.get $2
i32.eqz
if
return
end
local.get $2
i32.const 1
i32.sub
local.set $2
block (result i32)
local.get $0
local.tee $3
i32.const 1
i32.add
local.set $0
local.get $3
end
block (result i32)
local.get $1
local.tee $3
i32.const 1
i32.add
local.set $1
local.get $3
end
i32.load8_u
i32.store8
end
br $continue|0
end
end
end
block $break|1
loop $continue|1
local.get $2
i32.const 8
i32.ge_u
if
block
local.get $0
local.get $1
i64.load
i64.store
local.get $2
i32.const 8
i32.sub
local.set $2
local.get $0
i32.const 8
i32.add
local.set $0
local.get $1
i32.const 8
i32.add
local.set $1
end
br $continue|1
end
end
end
end
block $break|2
loop $continue|2
local.get $2
if
block
block (result i32)
local.get $0
local.tee $3
i32.const 1
i32.add
local.set $0
local.get $3
end
block (result i32)
local.get $1
local.tee $3
i32.const 1
i32.add
local.set $1
local.get $3
end
i32.load8_u
i32.store8
local.get $2
i32.const 1
i32.sub
local.set $2
end
br $continue|2
end
end
end
else
local.get $1
i32.const 7
i32.and
local.get $0
i32.const 7
i32.and
i32.eq
if
block $break|3
loop $continue|3
local.get $0
local.get $2
i32.add
i32.const 7
i32.and
if
block
local.get $2
i32.eqz
if
return
end
local.get $0
local.get $2
i32.const 1
i32.sub
local.tee $2
i32.add
local.get $1
local.get $2
i32.add
i32.load8_u
i32.store8
end
br $continue|3
end
end
end
block $break|4
loop $continue|4
local.get $2
i32.const 8
i32.ge_u
if
block
local.get $2
i32.const 8
i32.sub
local.set $2
local.get $0
local.get $2
i32.add
local.get $1
local.get $2
i32.add
i64.load
i64.store
end
br $continue|4
end
end
end
end
block $break|5
loop $continue|5
local.get $2
if
local.get $0
local.get $2
i32.const 1
i32.sub
local.tee $2
i32.add
local.get $1
local.get $2
i32.add
i32.load8_u
i32.store8
br $continue|5
end
end
end
end
)
(func $~lib/arraybuffer/ArrayBuffer#slice (; 8 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
(local $8 i32)
local.get $0
i32.load
local.set $3
local.get $1
i32.const 0
i32.lt_s
if
local.get $3
local.get $1
i32.add
local.tee $4
i32.const 0
local.tee $5
local.get $4
local.get $5
i32.gt_s
select
local.set $1
else
local.get $1
local.tee $4
local.get $3
local.tee $5
local.get $4
local.get $5
i32.lt_s
select
local.set $1
end
local.get $2
i32.const 0
i32.lt_s
if
local.get $3
local.get $2
i32.add
local.tee $4
i32.const 0
local.tee $5
local.get $4
local.get $5
i32.gt_s
select
local.set $2
else
local.get $2
local.tee $4
local.get $3
local.tee $5
local.get $4
local.get $5
i32.lt_s
select
local.set $2
end
local.get $2
local.get $1
i32.sub
local.tee $4
i32.const 0
local.tee $5
local.get $4
local.get $5
i32.gt_s
select
local.set $6
local.get $6
call $~lib/internal/arraybuffer/allocateUnsafe
local.set $7
block $~lib/memory/memory.copy|inlined.0
local.get $7
global.get $~lib/internal/arraybuffer/HEADER_SIZE
i32.add
local.set $4
local.get $0
global.get $~lib/internal/arraybuffer/HEADER_SIZE
i32.add
local.get $1
i32.add
local.set $5
local.get $6
local.set $8
local.get $4
local.get $5
local.get $8
call $~lib/internal/memory/memmove
end
local.get $7
)
(func $~lib/arraybuffer/ArrayBuffer#slice|trampoline (; 9 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
block $2of2
block $1of2
block $0of2
block $outOfRange
global.get $~argc
br_table $0of2 $1of2 $2of2 $outOfRange
end
unreachable
end
i32.const 0
local.set $1
end
global.get $~lib/internal/arraybuffer/MAX_BLENGTH
local.set $2
end
local.get $0
local.get $1
local.get $2
call $~lib/arraybuffer/ArrayBuffer#slice
)
(func $~lib/arraybuffer/ArrayBuffer.isView<Array<i32>> (; 10 ;) (type $ii) (param $0 i32) (result i32)
local.get $0
i32.const 0
i32.eq
if
i32.const 0
return
end
i32.const 0
)
(func $~lib/arraybuffer/ArrayBuffer.isView<usize> (; 11 ;) (type $ii) (param $0 i32) (result i32)
local.get $0
i32.const 0
i32.eq
if
i32.const 0
return
end
i32.const 0
)
(func $~lib/arraybuffer/ArrayBuffer.isView<Uint8Array> (; 12 ;) (type $ii) (param $0 i32) (result i32)
local.get $0
i32.const 0
i32.eq
if
i32.const 0
return
end
i32.const 1
return
)
(func $~lib/arraybuffer/ArrayBuffer.isView<Int32Array> (; 13 ;) (type $ii) (param $0 i32) (result i32)
local.get $0
i32.const 0
i32.eq
if
i32.const 0
return
end
i32.const 1
return
)
(func $~lib/arraybuffer/ArrayBuffer.isView<DataView> (; 14 ;) (type $ii) (param $0 i32) (result i32)
local.get $0
i32.const 0
i32.eq
if
i32.const 0
return
end
i32.const 1
return
)
(func $~lib/memory/memory.allocate (; 15 ;) (type $ii) (param $0 i32) (result i32)
local.get $0
call $~lib/allocator/arena/__memory_allocate
return
)
(func $~lib/internal/typedarray/TypedArray<u8>#constructor (; 16 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
local.get $1
i32.const 1073741816
i32.gt_u
if
i32.const 0
i32.const 160
i32.const 23
i32.const 34
call $~lib/env/abort
unreachable
end
local.get $1
i32.const 0
i32.shl
local.set $2
local.get $2
call $~lib/internal/arraybuffer/allocateUnsafe
local.set $3
block $~lib/memory/memory.fill|inlined.1
local.get $3
global.get $~lib/internal/arraybuffer/HEADER_SIZE
i32.add
local.set $4
i32.const 0
local.set $5
local.get $2
local.set $6
local.get $4
local.get $5
local.get $6
call $~lib/internal/memory/memset
end
block (result i32)
local.get $0
i32.eqz
if
i32.const 12
call $~lib/memory/memory.allocate
local.set $0
end
local.get $0
i32.const 0
i32.store
local.get $0
i32.const 0
i32.store offset=4
local.get $0
i32.const 0
i32.store offset=8
local.get $0
end
local.get $3
i32.store
local.get $0
i32.const 0
i32.store offset=4
local.get $0
local.get $2
i32.store offset=8
local.get $0
)
(func $~lib/typedarray/Uint8Array#constructor (; 17 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
i32.eqz
if
i32.const 12
call $~lib/memory/memory.allocate
local.set $0
end
local.get $0
local.get $1
call $~lib/internal/typedarray/TypedArray<u8>#constructor
local.set $0
local.get $0
)
(func $~lib/internal/typedarray/TypedArray<i32>#constructor (; 18 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
local.get $1
i32.const 268435454
i32.gt_u
if
i32.const 0
i32.const 160
i32.const 23
i32.const 34
call $~lib/env/abort
unreachable
end
local.get $1
i32.const 2
i32.shl
local.set $2
local.get $2
call $~lib/internal/arraybuffer/allocateUnsafe
local.set $3
block $~lib/memory/memory.fill|inlined.2
local.get $3
global.get $~lib/internal/arraybuffer/HEADER_SIZE
i32.add
local.set $4
i32.const 0
local.set $5
local.get $2
local.set $6
local.get $4
local.get $5
local.get $6
call $~lib/internal/memory/memset
end
block (result i32)
local.get $0
i32.eqz
if
i32.const 12
call $~lib/memory/memory.allocate
local.set $0
end
local.get $0
i32.const 0
i32.store
local.get $0
i32.const 0
i32.store offset=4
local.get $0
i32.const 0
i32.store offset=8
local.get $0
end
local.get $3
i32.store
local.get $0
i32.const 0
i32.store offset=4
local.get $0
local.get $2
i32.store offset=8
local.get $0
)
(func $~lib/typedarray/Int32Array#constructor (; 19 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
i32.eqz
if
i32.const 12
call $~lib/memory/memory.allocate
local.set $0
end
local.get $0
local.get $1
call $~lib/internal/typedarray/TypedArray<i32>#constructor
local.set $0
local.get $0
)
(func $~lib/dataview/DataView#constructor (; 20 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
local.get $3
global.get $~lib/builtins/i32.MIN_VALUE
i32.eq
if
local.get $1
i32.load
local.get $2
i32.sub
local.set $3
end
local.get $2
global.get $~lib/internal/arraybuffer/MAX_BLENGTH
i32.gt_u
if
i32.const 0
i32.const 248
i32.const 14
i32.const 44
call $~lib/env/abort
unreachable
end
local.get $3
global.get $~lib/internal/arraybuffer/MAX_BLENGTH
i32.gt_u
if
i32.const 0
i32.const 248
i32.const 15
i32.const 44
call $~lib/env/abort
unreachable
end
local.get $2
local.get $3
i32.add
local.get $1
i32.load
i32.gt_s
if
i32.const 0
i32.const 248
i32.const 16
i32.const 53
call $~lib/env/abort
unreachable
end
local.get $0
i32.eqz
if
i32.const 12
call $~lib/memory/memory.allocate
local.set $0
end
local.get $0
local.get $1
i32.store
local.get $0
local.get $2
i32.store offset=4
local.get $0
local.get $3
i32.store offset=8
local.get $0
)
(func $~lib/dataview/DataView#constructor|trampoline (; 21 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
block $2of2
block $1of2
block $0of2
block $outOfRange
global.get $~argc
i32.const 1
i32.sub
br_table $0of2 $1of2 $2of2 $outOfRange
end
unreachable
end
i32.const 0
local.set $2
end
global.get $~lib/builtins/i32.MIN_VALUE
local.set $3
end
local.get $0
local.get $1
local.get $2
local.get $3
call $~lib/dataview/DataView#constructor
)
(func $start (; 22 ;) (type $v)
(local $0 i32)
global.get $HEAP_BASE
global.get $~lib/internal/allocator/AL_MASK
i32.add
global.get $~lib/internal/allocator/AL_MASK
i32.const -1
i32.xor
i32.and
global.set $~lib/allocator/arena/startOffset
global.get $~lib/allocator/arena/startOffset
global.set $~lib/allocator/arena/offset
i32.const 0
i32.const 8
i32.const 0
call $~lib/arraybuffer/ArrayBuffer#constructor
global.set $std/arraybuffer/buffer
global.get $std/arraybuffer/buffer
i32.load
i32.const 8
i32.eq
i32.eqz
if
i32.const 0
i32.const 120
i32.const 5
i32.const 0
call $~lib/env/abort
unreachable
end
block (result i32)
i32.const 0
global.set $~argc
global.get $std/arraybuffer/buffer
i32.const 0
i32.const 0
call $~lib/arraybuffer/ArrayBuffer#slice|trampoline
end
global.set $std/arraybuffer/sliced
global.get $std/arraybuffer/sliced
i32.load
i32.const 8
i32.eq
i32.eqz
if
i32.const 0
i32.const 120
i32.const 9
i32.const 0
call $~lib/env/abort
unreachable
end
block $~lib/arraybuffer/ArrayBuffer#get:data|inlined.0 (result i32)
global.get $std/arraybuffer/sliced
local.set $0
local.get $0
global.get $~lib/internal/arraybuffer/HEADER_SIZE
i32.add
end
block $~lib/arraybuffer/ArrayBuffer#get:data|inlined.1 (result i32)
global.get $std/arraybuffer/buffer
local.set $0
local.get $0
global.get $~lib/internal/arraybuffer/HEADER_SIZE
i32.add
end
i32.ne
i32.eqz
if
i32.const 0
i32.const 120
i32.const 10
i32.const 0
call $~lib/env/abort
unreachable
end
global.get $std/arraybuffer/sliced
global.get $std/arraybuffer/buffer
i32.ne
i32.eqz
if
i32.const 0
i32.const 120
i32.const 11
i32.const 0
call $~lib/env/abort
unreachable
end
block (result i32)
i32.const 1
global.set $~argc
global.get $std/arraybuffer/buffer
i32.const 1
i32.const 0
call $~lib/arraybuffer/ArrayBuffer#slice|trampoline
end
global.set $std/arraybuffer/sliced
global.get $std/arraybuffer/sliced
i32.load
i32.const 7
i32.eq
i32.eqz
if
i32.const 0
i32.const 120
i32.const 15
i32.const 0
call $~lib/env/abort
unreachable
end
block (result i32)
i32.const 1
global.set $~argc
global.get $std/arraybuffer/buffer
i32.const -1
i32.const 0
call $~lib/arraybuffer/ArrayBuffer#slice|trampoline
end
global.set $std/arraybuffer/sliced
global.get $std/arraybuffer/sliced
i32.load
i32.const 1
i32.eq
i32.eqz
if
i32.const 0
i32.const 120
i32.const 19
i32.const 0
call $~lib/env/abort
unreachable
end
global.get $std/arraybuffer/buffer
i32.const 1
i32.const 3
call $~lib/arraybuffer/ArrayBuffer#slice
global.set $std/arraybuffer/sliced
global.get $std/arraybuffer/sliced
i32.load
i32.const 2
i32.eq
i32.eqz
if
i32.const 0
i32.const 120
i32.const 23
i32.const 0
call $~lib/env/abort
unreachable
end
global.get $std/arraybuffer/buffer
i32.const 1
i32.const -1
call $~lib/arraybuffer/ArrayBuffer#slice
global.set $std/arraybuffer/sliced
global.get $std/arraybuffer/sliced
i32.load
i32.const 6
i32.eq
i32.eqz
if
i32.const 0
i32.const 120
i32.const 27
i32.const 0
call $~lib/env/abort
unreachable
end
global.get $std/arraybuffer/buffer
i32.const -3
i32.const -1
call $~lib/arraybuffer/ArrayBuffer#slice
global.set $std/arraybuffer/sliced
global.get $std/arraybuffer/sliced
i32.load
i32.const 2
i32.eq
i32.eqz
if
i32.const 0
i32.const 120
i32.const 31
i32.const 0
call $~lib/env/abort
unreachable
end
global.get $std/arraybuffer/buffer
i32.const -4
i32.const 42
call $~lib/arraybuffer/ArrayBuffer#slice
global.set $std/arraybuffer/sliced
global.get $std/arraybuffer/sliced
i32.load
i32.const 4
i32.eq
i32.eqz
if
i32.const 0
i32.const 120
i32.const 35
i32.const 0
call $~lib/env/abort
unreachable
end
block (result i32)
i32.const 1
global.set $~argc
global.get $std/arraybuffer/buffer
i32.const 42
i32.const 0
call $~lib/arraybuffer/ArrayBuffer#slice|trampoline
end
global.set $std/arraybuffer/sliced
global.get $std/arraybuffer/sliced
i32.load
i32.const 0
i32.eq
i32.eqz
if
i32.const 0
i32.const 120
i32.const 39
i32.const 0
call $~lib/env/abort
unreachable
end
global.get $std/arraybuffer/sliced
i32.const 0
i32.ne
i32.eqz
if
i32.const 0
i32.const 120
i32.const 40
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 0
call $~lib/arraybuffer/ArrayBuffer.isView<Array<i32>>
i32.eqz
i32.eqz
if
i32.const 0
i32.const 120
i32.const 42
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 0
call $~lib/arraybuffer/ArrayBuffer.isView<usize>
i32.eqz
i32.eqz
if
i32.const 0
i32.const 120
i32.const 43
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 0
call $~lib/arraybuffer/ArrayBuffer.isView<Uint8Array>
i32.eqz
i32.eqz
if
i32.const 0
i32.const 120
i32.const 44
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 0
call $~lib/arraybuffer/ArrayBuffer.isView<Int32Array>
i32.eqz
i32.eqz
if
i32.const 0
i32.const 120
i32.const 45
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 0
call $~lib/arraybuffer/ArrayBuffer.isView<DataView>
i32.eqz
i32.eqz
if
i32.const 0
i32.const 120
i32.const 46
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 0
i32.const 1
call $~lib/typedarray/Uint8Array#constructor
global.set $std/arraybuffer/arr8
i32.const 240
call $~lib/arraybuffer/ArrayBuffer.isView<Array<i32>>
i32.eqz
i32.eqz
if
i32.const 0
i32.const 120
i32.const 49
i32.const 0
call $~lib/env/abort
unreachable
end
global.get $std/arraybuffer/arr8
call $~lib/arraybuffer/ArrayBuffer.isView<Uint8Array>
i32.eqz
if
i32.const 0
i32.const 120
i32.const 50
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 0
i32.const 1
call $~lib/typedarray/Int32Array#constructor
call $~lib/arraybuffer/ArrayBuffer.isView<Int32Array>
i32.eqz
if
i32.const 0
i32.const 120
i32.const 51
i32.const 0
call $~lib/env/abort
unreachable
end
block (result i32)
i32.const 1
global.set $~argc
i32.const 0
global.get $std/arraybuffer/arr8
i32.load
i32.const 0
i32.const 0
call $~lib/dataview/DataView#constructor|trampoline
end
call $~lib/arraybuffer/ArrayBuffer.isView<DataView>
i32.eqz
if
i32.const 0
i32.const 120
i32.const 52
i32.const 0
call $~lib/env/abort
unreachable
end
)
(func $null (; 23 ;) (type $v)
)
)