2018-05-08 00:36:19 +02:00
|
|
|
(module
|
2019-03-01 00:01:23 +01:00
|
|
|
(type $FUNCSIG$ii (func (param i32) (result i32)))
|
|
|
|
(type $FUNCSIG$ij (func (param i64) (result i32)))
|
|
|
|
(type $FUNCSIG$v (func))
|
2018-05-08 00:36:19 +02:00
|
|
|
(memory $0 1)
|
2019-04-06 20:17:48 +02:00
|
|
|
(data (i32.const 8) "\10")
|
2019-04-08 23:22:13 +02:00
|
|
|
(data (i32.const 24) "\10\00\00\00\02")
|
|
|
|
(data (i32.const 40) "a")
|
|
|
|
(data (i32.const 48) "\10\00\00\00\04")
|
|
|
|
(data (i32.const 64) "a\00b")
|
|
|
|
(data (i32.const 72) "\10\00\00\00\06")
|
|
|
|
(data (i32.const 88) "a\00b\00c")
|
2018-05-08 00:36:19 +02:00
|
|
|
(export "memory" (memory $0))
|
|
|
|
(start $start)
|
2019-03-17 01:35:44 +01:00
|
|
|
(func $~lib/util/hash/hashStr (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
2018-05-08 00:36:19 +02:00
|
|
|
(local $1 i32)
|
|
|
|
(local $2 i32)
|
|
|
|
(local $3 i32)
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const -2128831035
|
2019-03-17 01:35:44 +01:00
|
|
|
local.set $1
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $0
|
2019-03-17 01:35:44 +01:00
|
|
|
if
|
2018-12-01 03:09:43 +01:00
|
|
|
block $break|0
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $0
|
2019-04-08 23:22:13 +02:00
|
|
|
i32.const 16
|
2019-03-17 01:35:44 +01:00
|
|
|
i32.sub
|
|
|
|
i32.load offset=4
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 1
|
2019-03-17 01:35:44 +01:00
|
|
|
i32.shr_u
|
|
|
|
i32.const 1
|
|
|
|
i32.shl
|
|
|
|
local.set $3
|
|
|
|
loop $repeat|0
|
|
|
|
local.get $2
|
|
|
|
local.get $3
|
|
|
|
i32.ge_u
|
|
|
|
br_if $break|0
|
|
|
|
local.get $0
|
|
|
|
local.get $2
|
|
|
|
i32.add
|
|
|
|
i32.load8_u
|
|
|
|
local.get $1
|
|
|
|
i32.xor
|
|
|
|
i32.const 16777619
|
|
|
|
i32.mul
|
|
|
|
local.set $1
|
|
|
|
local.get $2
|
|
|
|
i32.const 1
|
|
|
|
i32.add
|
|
|
|
local.set $2
|
|
|
|
br $repeat|0
|
|
|
|
unreachable
|
|
|
|
end
|
|
|
|
unreachable
|
2018-11-08 08:04:24 +01:00
|
|
|
end
|
|
|
|
end
|
2019-03-17 01:35:44 +01:00
|
|
|
local.get $1
|
2018-05-08 00:36:19 +02:00
|
|
|
)
|
2019-03-17 01:35:44 +01:00
|
|
|
(func $~lib/util/hash/hash32 (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 255
|
|
|
|
i32.and
|
|
|
|
i32.const -2128831035
|
|
|
|
i32.xor
|
|
|
|
i32.const 16777619
|
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 8
|
|
|
|
i32.shr_u
|
|
|
|
i32.const 255
|
|
|
|
i32.and
|
|
|
|
i32.xor
|
|
|
|
i32.const 16777619
|
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 16
|
|
|
|
i32.shr_u
|
|
|
|
i32.const 255
|
|
|
|
i32.and
|
|
|
|
i32.xor
|
|
|
|
i32.const 16777619
|
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 24
|
|
|
|
i32.shr_u
|
|
|
|
i32.xor
|
|
|
|
i32.const 16777619
|
|
|
|
i32.mul
|
2018-05-08 00:36:19 +02:00
|
|
|
)
|
2019-03-17 01:35:44 +01:00
|
|
|
(func $~lib/util/hash/hash64 (; 2 ;) (type $FUNCSIG$ij) (param $0 i64) (result i32)
|
2018-05-08 00:36:19 +02:00
|
|
|
(local $1 i32)
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $0
|
|
|
|
i32.wrap_i64
|
|
|
|
local.tee $1
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 255
|
|
|
|
i32.and
|
|
|
|
i32.const -2128831035
|
|
|
|
i32.xor
|
|
|
|
i32.const 16777619
|
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $1
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 8
|
|
|
|
i32.shr_u
|
|
|
|
i32.const 255
|
|
|
|
i32.and
|
|
|
|
i32.xor
|
|
|
|
i32.const 16777619
|
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $1
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 16
|
|
|
|
i32.shr_u
|
|
|
|
i32.const 255
|
|
|
|
i32.and
|
|
|
|
i32.xor
|
|
|
|
i32.const 16777619
|
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $1
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 24
|
|
|
|
i32.shr_u
|
|
|
|
i32.xor
|
|
|
|
i32.const 16777619
|
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
i64.const 32
|
|
|
|
i64.shr_u
|
2019-02-05 17:12:10 +01:00
|
|
|
i32.wrap_i64
|
|
|
|
local.tee $1
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 255
|
|
|
|
i32.and
|
|
|
|
i32.xor
|
|
|
|
i32.const 16777619
|
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $1
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 8
|
|
|
|
i32.shr_u
|
|
|
|
i32.const 255
|
|
|
|
i32.and
|
|
|
|
i32.xor
|
|
|
|
i32.const 16777619
|
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $1
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 16
|
|
|
|
i32.shr_u
|
|
|
|
i32.const 255
|
|
|
|
i32.and
|
|
|
|
i32.xor
|
|
|
|
i32.const 16777619
|
|
|
|
i32.mul
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $1
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 24
|
|
|
|
i32.shr_u
|
|
|
|
i32.xor
|
|
|
|
i32.const 16777619
|
|
|
|
i32.mul
|
2018-05-08 00:36:19 +02:00
|
|
|
)
|
2019-03-01 00:01:23 +01:00
|
|
|
(func $start:std/hash (; 3 ;) (type $FUNCSIG$v)
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 0
|
2019-03-17 01:35:44 +01:00
|
|
|
call $~lib/util/hash/hashStr
|
2018-11-08 08:04:24 +01:00
|
|
|
drop
|
|
|
|
i32.const 24
|
2019-03-17 01:35:44 +01:00
|
|
|
call $~lib/util/hash/hashStr
|
|
|
|
drop
|
|
|
|
i32.const 40
|
|
|
|
call $~lib/util/hash/hashStr
|
2018-11-08 08:04:24 +01:00
|
|
|
drop
|
2019-04-08 23:22:13 +02:00
|
|
|
i32.const 64
|
|
|
|
call $~lib/util/hash/hashStr
|
|
|
|
drop
|
|
|
|
i32.const 88
|
2019-03-17 01:35:44 +01:00
|
|
|
call $~lib/util/hash/hashStr
|
2018-11-08 08:04:24 +01:00
|
|
|
drop
|
|
|
|
i32.const 0
|
2019-03-17 01:35:44 +01:00
|
|
|
call $~lib/util/hash/hash32
|
2018-11-08 08:04:24 +01:00
|
|
|
drop
|
|
|
|
i32.const 1065353216
|
2019-03-17 01:35:44 +01:00
|
|
|
call $~lib/util/hash/hash32
|
2018-11-08 08:04:24 +01:00
|
|
|
drop
|
|
|
|
i32.const 1066192077
|
2019-03-17 01:35:44 +01:00
|
|
|
call $~lib/util/hash/hash32
|
2018-11-08 08:04:24 +01:00
|
|
|
drop
|
|
|
|
i32.const 0
|
2019-03-17 01:35:44 +01:00
|
|
|
call $~lib/util/hash/hash32
|
2018-11-08 08:04:24 +01:00
|
|
|
drop
|
|
|
|
i32.const 2139095040
|
2019-03-17 01:35:44 +01:00
|
|
|
call $~lib/util/hash/hash32
|
2018-11-08 08:04:24 +01:00
|
|
|
drop
|
|
|
|
i32.const 2143289344
|
2019-03-17 01:35:44 +01:00
|
|
|
call $~lib/util/hash/hash32
|
2018-11-08 08:04:24 +01:00
|
|
|
drop
|
|
|
|
i64.const 0
|
2019-03-17 01:35:44 +01:00
|
|
|
call $~lib/util/hash/hash64
|
2018-11-08 08:04:24 +01:00
|
|
|
drop
|
|
|
|
i64.const 4607182418800017408
|
2019-03-17 01:35:44 +01:00
|
|
|
call $~lib/util/hash/hash64
|
2018-11-08 08:04:24 +01:00
|
|
|
drop
|
|
|
|
i64.const 4607632778762754458
|
2019-03-17 01:35:44 +01:00
|
|
|
call $~lib/util/hash/hash64
|
2018-11-08 08:04:24 +01:00
|
|
|
drop
|
|
|
|
i64.const 0
|
2019-03-17 01:35:44 +01:00
|
|
|
call $~lib/util/hash/hash64
|
2018-11-08 08:04:24 +01:00
|
|
|
drop
|
|
|
|
i64.const 9218868437227405312
|
2019-03-17 01:35:44 +01:00
|
|
|
call $~lib/util/hash/hash64
|
2018-11-08 08:04:24 +01:00
|
|
|
drop
|
|
|
|
i64.const 9221120237041090560
|
2019-03-17 01:35:44 +01:00
|
|
|
call $~lib/util/hash/hash64
|
2018-11-08 08:04:24 +01:00
|
|
|
drop
|
2018-05-08 00:36:19 +02:00
|
|
|
)
|
2019-03-01 00:01:23 +01:00
|
|
|
(func $start (; 4 ;) (type $FUNCSIG$v)
|
2019-02-21 00:11:22 +01:00
|
|
|
call $start:std/hash
|
|
|
|
)
|
2019-03-01 00:01:23 +01:00
|
|
|
(func $null (; 5 ;) (type $FUNCSIG$v)
|
2018-11-08 08:04:24 +01:00
|
|
|
nop
|
2018-09-17 01:48:35 +02:00
|
|
|
)
|
2018-05-08 00:36:19 +02:00
|
|
|
)
|