blob: f12226b1dcfc18252e6c55bec0a06ecb8da12116 [file] [log] [blame]
(module
(type $FUNCSIG$vdji (func (param f64 i64 i32)))
(type $FUNCSIG$j (func (result i64)))
(type $FUNCSIG$ff (func (param f32) (result f32)))
(type $legaltype$illegalImport (func (param f64 i32 i32 i32)))
(type $legaltype$illegalImportResult (func (result i32)))
(type $legaltype$_fabsf (func (param f64) (result f64)))
(type $legaltype$do_i64 (func (result i32)))
(import "env" "illegalImport" (func $illegalImport (param f64 i64 i32)))
(import "env" "illegalImportResult" (func $illegalImportResult (result i64)))
(import "env" "_fabsf" (func $_fabsf (param f32) (result f32)))
(import "env" "do_i64" (func $do_i64 (result i64)))
(import "env" "illegalImport" (func $legalimport$illegalImport (param f64 i32 i32 i32)))
(import "env" "illegalImportResult" (func $legalimport$illegalImportResult (result i32)))
(import "env" "_fabsf" (func $legalimport$_fabsf (param f64) (result f64)))
(import "env" "do_i64" (func $legalimport$do_i64 (result i32)))
(import "env" "memory" (memory $0 256 256))
(import "env" "table" (table 3 3 anyfunc))
(import "env" "memoryBase" (global $memoryBase i32))
(import "env" "tableBase" (global $tableBase i32))
(global $tempRet0 (mut i32) (i32.const 0))
(elem (get_global $tableBase) $legalfunc$illegalImport $legalfunc$_fabsf $legalfunc$do_i64)
(data (get_global $memoryBase) "wasm-only.asm.js")
(export "test64" (func $test64))
(export "illegalParam" (func $legalstub$illegalParam))
(export "illegalResult" (func $legalstub$result))
(export "keepAlive" (func $keepAlive))
(func $loads
(nop)
)
(func $stores
(local $0 i32)
(local $1 f64)
(local $2 f32)
(i32.store8
(i32.const 100)
(get_local $0)
)
(i32.store8
(i32.const 101)
(get_local $0)
)
(i32.store16
(i32.const 102)
(get_local $0)
)
(i32.store16
(i32.const 103)
(get_local $0)
)
(i32.store16 align=1
(i32.const 104)
(get_local $0)
)
(i32.store16
(i32.const 105)
(get_local $0)
)
(i32.store
(i32.const 106)
(get_local $0)
)
(i32.store
(i32.const 107)
(get_local $0)
)
(i32.store align=1
(i32.const 108)
(get_local $0)
)
(i32.store align=2
(i32.const 109)
(get_local $0)
)
(i32.store
(i32.const 110)
(get_local $0)
)
(f32.store
(i32.const 111)
(get_local $2)
)
(f32.store
(i32.const 112)
(get_local $2)
)
(f32.store align=1
(i32.const 113)
(get_local $2)
)
(f32.store align=2
(i32.const 114)
(get_local $2)
)
(f32.store
(i32.const 115)
(get_local $2)
)
(f64.store
(i32.const 116)
(get_local $1)
)
(f64.store
(i32.const 117)
(get_local $1)
)
(f64.store align=1
(i32.const 118)
(get_local $1)
)
(f64.store align=2
(i32.const 119)
(get_local $1)
)
(f64.store align=4
(i32.const 120)
(get_local $1)
)
(f64.store
(i32.const 121)
(get_local $1)
)
)
(func $test
(local $0 f32)
(local $1 i32)
(set_local $1
(i32.reinterpret/f32
(get_local $0)
)
)
)
(func $i64u-div (param $0 i64) (param $1 i64) (result i64)
(if (result i64)
(i64.eqz
(get_local $1)
)
(i64.const 0)
(i64.div_u
(get_local $0)
(get_local $1)
)
)
)
(func $i64s-div (param $0 i64) (param $1 i64) (result i64)
(if (result i64)
(i64.eqz
(get_local $1)
)
(i64.const 0)
(if (result i64)
(i32.and
(i64.eq
(get_local $0)
(i64.const -9223372036854775808)
)
(i64.eq
(get_local $1)
(i64.const -1)
)
)
(i64.const 0)
(i64.div_s
(get_local $0)
(get_local $1)
)
)
)
)
(func $i64u-rem (param $0 i64) (param $1 i64) (result i64)
(if (result i64)
(i64.eqz
(get_local $1)
)
(i64.const 0)
(i64.rem_u
(get_local $0)
(get_local $1)
)
)
)
(func $i64s-rem (param $0 i64) (param $1 i64) (result i64)
(if (result i64)
(i64.eqz
(get_local $1)
)
(i64.const 0)
(i64.rem_s
(get_local $0)
(get_local $1)
)
)
)
(func $f64-to-int64 (param $0 f64) (result i64)
(if (result i64)
(f64.ne
(get_local $0)
(get_local $0)
)
(i64.const -9223372036854775808)
(if (result i64)
(f64.ge
(get_local $0)
(f64.const 9223372036854775808)
)
(i64.const -9223372036854775808)
(if (result i64)
(f64.le
(get_local $0)
(f64.const -9223372036854775808)
)
(i64.const -9223372036854775808)
(i64.trunc_s/f64
(get_local $0)
)
)
)
)
)
(func $test64
(local $0 i64)
(local $1 i64)
(local $2 i32)
(local $3 f32)
(local $4 f64)
(drop
(call $i64s-rem
(call $i64u-rem
(call $i64s-div
(call $i64u-div
(i64.mul
(i64.sub
(i64.add
(tee_local $1
(i64.const 128849018897)
)
(i64.const 100)
)
(get_local $1)
)
(get_local $1)
)
(get_local $1)
)
(get_local $1)
)
(get_local $1)
)
(get_local $1)
)
)
(i64.store
(i32.const 120)
(tee_local $0
(i64.load
(i32.const 120)
)
)
)
(i64.store
(i32.const 120)
(get_local $0)
)
(i64.store align=2
(i32.const 120)
(get_local $0)
)
(i64.store align=4
(i32.const 120)
(get_local $0)
)
(i64.store
(i32.const 120)
(get_local $0)
)
(set_local $2
(i32.wrap/i64
(get_local $0)
)
)
(set_local $0
(i64.extend_u/i32
(get_local $2)
)
)
(drop
(call $f64-to-int64
(f64.promote/f32
(tee_local $3
(f32.convert_u/i64
(get_local $0)
)
)
)
)
)
(drop
(call $f64-to-int64
(tee_local $4
(f64.convert_u/i64
(get_local $0)
)
)
)
)
(drop
(call $f64-to-int64
(f64.promote/f32
(get_local $3)
)
)
)
(drop
(call $f64-to-int64
(get_local $4)
)
)
)
(func $imports (result i64)
(call $legalfunc$illegalImport
(f64.const -3.13159)
(i64.const 94489280523)
(i32.const -33)
)
(call $legalfunc$illegalImportResult)
)
(func $arg (param $0 i64)
(i64.store
(i32.const 100)
(get_local $0)
)
(call $arg
(get_local $0)
)
)
(func $illegalParam (param $0 i32) (param $1 i64) (param $2 f64)
(i64.store
(i32.const 100)
(get_local $1)
)
(call $illegalParam
(i32.const 0)
(get_local $1)
(f64.const 12.34)
)
)
(func $result (result i64)
(i64.const 8589934593)
)
(func $call1 (param $0 i64) (result i64)
(call $call1
(get_local $0)
)
)
(func $call2 (param $0 i64) (result i64)
(drop
(call $call2
(call $call2
(get_local $0)
)
)
)
(i64.const 245127260211081)
)
(func $returnCastConst (result i64)
(i64.const 0)
)
(func $ifValue64 (param $0 i64) (param $1 i64) (result i64)
(call $call2
(get_local $0)
)
)
(func $ifValue32 (param $0 i32) (param $1 i32) (result i32)
(call $ifValue32
(get_local $0)
(get_local $1)
)
)
(func $switch64 (param $0 i64) (result i32)
(block $switch (result i32)
(block $switch-default
(block $switch-case0
(block $switch-case
(br_table $switch-case0 $switch-default $switch-case $switch-default
(i32.wrap/i64
(i64.sub
(get_local $0)
(i64.const 42949672965)
)
)
)
)
(br $switch
(i32.const 11000)
)
)
(br $switch
(i32.const 10)
)
)
(i32.const 1)
)
)
(func $unreachable_leftovers (param $0 i32) (param $1 i32) (param $2 i32)
(block $__rjto$0
(if
(i32.eqz
(get_local $1)
)
(block
(br_if $__rjto$0
(get_local $2)
)
(i32.store
(get_local $0)
(i32.const -2)
)
(return)
)
)
(i32.store
(get_local $0)
(i32.const -1)
)
)
)
(func $switch64TOOMUCH (param $0 i64) (result i32)
(local $1 i32)
(local $2 i64)
(block $switch-default
(if
(i64.ne
(tee_local $2
(get_local $0)
)
(i64.const -9223372036854775808)
)
(br_if $switch-default
(i64.ne
(get_local $2)
(i64.const 4611686018427387904)
)
)
)
(return
(i32.const 40)
)
)
(block $switch-default4
(if
(i32.ne
(tee_local $1
(i32.const 100)
)
(i32.const 214748364)
)
(br_if $switch-default4
(i32.ne
(get_local $1)
(i32.const 107374182)
)
)
)
(return
(i32.const 41)
)
)
(block $switch5
(if
(i64.ne
(get_local $0)
(i64.const -9223372036854775808)
)
(br_if $switch5
(i64.ne
(get_local $0)
(i64.const 4611686018427387904)
)
)
)
(return
(i32.const 42)
)
)
(block $switch8
(if
(i32.ne
(tee_local $1
(i32.const 100)
)
(i32.const 214748364)
)
(br_if $switch8
(i32.ne
(get_local $1)
(i32.const 107374182)
)
)
)
(return
(i32.const 43)
)
)
(i32.const 44)
)
(func $_memchr (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(set_local $5
(i32.and
(get_local $1)
(i32.const 255)
)
)
(block $label$break$L8
(block $__rjti$2
(if
(i32.and
(tee_local $4
(i32.ne
(get_local $2)
(i32.const 0)
)
)
(i32.ne
(i32.and
(get_local $0)
(i32.const 3)
)
(i32.const 0)
)
)
(block
(set_local $4
(i32.and
(get_local $1)
(i32.const 255)
)
)
(set_local $3
(get_local $2)
)
(set_local $2
(get_local $0)
)
(loop $while-in
(if
(i32.eq
(i32.load8_u
(get_local $2)
)
(i32.and
(get_local $4)
(i32.const 255)
)
)
(block
(set_local $0
(get_local $3)
)
(br $__rjti$2)
)
)
(br_if $while-in
(i32.and
(tee_local $0
(i32.ne
(tee_local $3
(i32.add
(get_local $3)
(i32.const -1)
)
)
(i32.const 0)
)
)
(i32.ne
(i32.and
(tee_local $2
(i32.add
(get_local $2)
(i32.const 1)
)
)
(i32.const 3)
)
(i32.const 0)
)
)
)
)
)
(block
(set_local $3
(get_local $2)
)
(set_local $2
(get_local $0)
)
(set_local $0
(get_local $4)
)
)
)
(if
(get_local $0)
(block
(set_local $0
(get_local $3)
)
(br $__rjti$2)
)
(set_local $0
(i32.const 0)
)
)
(br $label$break$L8)
)
(if
(i32.ne
(i32.load8_u
(get_local $2)
)
(tee_local $1
(i32.and
(get_local $1)
(i32.const 255)
)
)
)
(block
(set_local $3
(i32.mul
(get_local $5)
(i32.const 16843009)
)
)
(block $__rjto$0
(block $__rjti$0
(br_if $__rjti$0
(i32.le_u
(get_local $0)
(i32.const 3)
)
)
(loop $while-in3
(if
(i32.eqz
(i32.and
(i32.xor
(i32.and
(tee_local $4
(i32.xor
(i32.load
(get_local $2)
)
(get_local $3)
)
)
(i32.const -2139062144)
)
(i32.const -2139062144)
)
(i32.add
(get_local $4)
(i32.const -16843009)
)
)
)
(block
(set_local $2
(i32.add
(get_local $2)
(i32.const 4)
)
)
(br_if $while-in3
(i32.gt_u
(tee_local $0
(i32.add
(get_local $0)
(i32.const -4)
)
)
(i32.const 3)
)
)
(br $__rjti$0)
)
)
)
(br $__rjto$0)
)
(if
(i32.eqz
(get_local $0)
)
(block
(set_local $0
(i32.const 0)
)
(br $label$break$L8)
)
)
)
(loop $while-in5
(br_if $label$break$L8
(i32.eq
(i32.load8_u
(get_local $2)
)
(i32.and
(get_local $1)
(i32.const 255)
)
)
)
(set_local $2
(i32.add
(get_local $2)
(i32.const 1)
)
)
(br_if $while-in5
(tee_local $0
(i32.add
(get_local $0)
(i32.const -1)
)
)
)
(set_local $0
(i32.const 0)
)
)
)
)
)
(select
(get_local $2)
(i32.const 0)
(get_local $0)
)
)
(func $keepAlive
(call $loads)
(call $stores)
(call $test)
(drop
(call $imports)
)
(call $arg
(i64.const 0)
)
(drop
(call $call1
(i64.const 0)
)
)
(drop
(call $call2
(i64.const 0)
)
)
(drop
(call $returnCastConst)
)
(drop
(call $ifValue64
(i64.const 0)
(i64.const 0)
)
)
(drop
(call $ifValue32
(i32.const 0)
(i32.const 0)
)
)
(drop
(call $switch64
(i64.const 0)
)
)
(call $unreachable_leftovers
(i32.const 0)
(i32.const 0)
(i32.const 0)
)
(drop
(call $_memchr
(i32.const 0)
(i32.const 0)
(i32.const 0)
)
)
(drop
(call $switch64TOOMUCH
(i64.const 0)
)
)
)
(func $legalstub$illegalParam (param $0 i32) (param $1 i32) (param $2 i32) (param $3 f64)
(call $illegalParam
(get_local $0)
(i64.or
(i64.extend_u/i32
(get_local $1)
)
(i64.shl
(i64.extend_u/i32
(get_local $2)
)
(i64.const 32)
)
)
(get_local $3)
)
)
(func $legalstub$result (result i32)
(local $0 i64)
(set_local $0
(call $result)
)
(set_global $tempRet0
(i32.wrap/i64
(i64.shr_u
(get_local $0)
(i64.const 32)
)
)
)
(i32.wrap/i64
(get_local $0)
)
)
(func $legalfunc$illegalImport (param $0 f64) (param $1 i64) (param $2 i32)
(call $legalimport$illegalImport
(get_local $0)
(i32.wrap/i64
(get_local $1)
)
(i32.wrap/i64
(i64.shr_u
(get_local $1)
(i64.const 32)
)
)
(get_local $2)
)
)
(func $legalfunc$illegalImportResult (result i64)
(i64.or
(i64.extend_u/i32
(call $legalimport$illegalImportResult)
)
(i64.shl
(i64.extend_u/i32
(get_global $tempRet0)
)
(i64.const 32)
)
)
)
(func $legalfunc$_fabsf (param $0 f32) (result f32)
(f32.demote/f64
(call $legalimport$_fabsf
(f64.promote/f32
(get_local $0)
)
)
)
)
(func $legalfunc$do_i64 (result i64)
(i64.or
(i64.extend_u/i32
(call $legalimport$do_i64)
)
(i64.shl
(i64.extend_u/i32
(get_global $tempRet0)
)
(i64.const 32)
)
)
)
)