1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
function asmFunc(env) {
var Math_imul = Math.imul;
var Math_fround = Math.fround;
var Math_abs = Math.abs;
var Math_clz32 = Math.clz32;
var Math_min = Math.min;
var Math_max = Math.max;
var Math_floor = Math.floor;
var Math_ceil = Math.ceil;
var Math_trunc = Math.trunc;
var Math_sqrt = Math.sqrt;
var abort = env.abort;
var nan = NaN;
var infinity = Infinity;
var i64toi32_i32$HIGH_BITS = 0;
function legalstub$1($0, $1, $2, $3, $4, $5) {
return (__wasm_rotl_i64($0, $1, $2) | 0) == ($4 | 0) & ($5 | 0) == (i64toi32_i32$HIGH_BITS | 0);
}
function legalstub$2($0, $1, $2, $3, $4, $5) {
return (__wasm_rotr_i64($0, $1, $2) | 0) == ($4 | 0) & ($5 | 0) == (i64toi32_i32$HIGH_BITS | 0);
}
function __wasm_rotl_i64($0, $1, $2) {
var $3 = 0, $4 = 0, $5 = 0, $6 = 0;
$6 = $2 & 63;
$5 = $6;
$3 = $5 & 31;
if ($5 >>> 0 >= 32) {
$3 = -1 >>> $3 | 0
} else {
$4 = -1 >>> $3 | 0;
$3 = (1 << $3) - 1 << 32 - $3 | -1 >>> $3;
}
$5 = $3 & $0;
$3 = $1 & $4;
$4 = $6 & 31;
if ($6 >>> 0 >= 32) {
$3 = $5 << $4;
$6 = 0;
} else {
$3 = (1 << $4) - 1 & $5 >>> 32 - $4 | $3 << $4;
$6 = $5 << $4;
}
$5 = $3;
$4 = 0 - $2 & 63;
$3 = $4;
$2 = $3 & 31;
if ($3 >>> 0 >= 32) {
$3 = -1 << $2;
$2 = 0;
} else {
$3 = (1 << $2) - 1 & -1 >>> 32 - $2 | -1 << $2;
$2 = -1 << $2;
}
$0 = $2 & $0;
$3 = $1 & $3;
$1 = $4 & 31;
if ($4 >>> 0 >= 32) {
$2 = 0;
$0 = $3 >>> $1 | 0;
} else {
$2 = $3 >>> $1 | 0;
$0 = ((1 << $1) - 1 & $3) << 32 - $1 | $0 >>> $1;
}
$0 = $0 | $6;
i64toi32_i32$HIGH_BITS = $2 | $5;
return $0;
}
function __wasm_rotr_i64($0, $1, $2) {
var $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0;
$6 = $2 & 63;
$3 = $6 & 31;
if ($6 >>> 0 >= 32) {
$4 = -1 << $3;
$7 = 0;
} else {
$4 = (1 << $3) - 1 & -1 >>> 32 - $3 | -1 << $3;
$7 = -1 << $3;
}
$7 = $7 & $0;
$3 = $1 & $4;
$5 = $6 & 31;
if ($6 >>> 0 >= 32) {
$4 = 0;
$6 = $3 >>> $5 | 0;
} else {
$4 = $3 >>> $5 | 0;
$6 = ((1 << $5) - 1 & $3) << 32 - $5 | $7 >>> $5;
}
$7 = $4;
$3 = 0 - $2 & 63;
$5 = $3 & 31;
if ($3 >>> 0 >= 32) {
$4 = 0;
$2 = -1 >>> $5 | 0;
} else {
$4 = -1 >>> $5 | 0;
$2 = (1 << $5) - 1 << 32 - $5 | -1 >>> $5;
}
$0 = $2 & $0;
$1 = $1 & $4;
$4 = $3 & 31;
if ($3 >>> 0 >= 32) {
$2 = $0 << $4;
$0 = 0;
} else {
$2 = (1 << $4) - 1 & $0 >>> 32 - $4 | $1 << $4;
$0 = $0 << $4;
}
$0 = $0 | $6;
i64toi32_i32$HIGH_BITS = $2 | $7;
return $0;
}
return {
"rotl": legalstub$1,
"rotr": legalstub$2
};
}
var retasmFunc = asmFunc( { abort: function() { throw new Error('abort'); }
});
export var rotl = retasmFunc.rotl;
export var rotr = retasmFunc.rotr;
|