2018-04-19 17:32:23 +02:00
|
|
|
(module
|
2019-03-01 00:09:06 +01:00
|
|
|
(type $FUNCSIG$vii (func (param i32 i32)))
|
|
|
|
(type $FUNCSIG$d (func (result f64)))
|
|
|
|
(type $FUNCSIG$v (func))
|
|
|
|
(type $FUNCSIG$viid (func (param i32 i32 f64)))
|
2018-10-11 08:49:08 +02:00
|
|
|
(import "env" "memory" (memory $0 0))
|
2018-06-28 01:44:32 +02:00
|
|
|
(import "config" "BGR_DEAD" (global $assembly/config/BGR_DEAD i32))
|
2019-02-21 00:11:22 +01:00
|
|
|
(import "config" "BGR_ALIVE" (global $assembly/config/BGR_ALIVE i32))
|
2018-06-28 01:44:32 +02:00
|
|
|
(import "config" "BIT_ROT" (global $assembly/config/BIT_ROT i32))
|
2018-10-11 08:49:08 +02:00
|
|
|
(import "Math" "random" (func $~lib/bindings/Math/random (result f64)))
|
2019-02-21 00:11:22 +01:00
|
|
|
(table $0 1 funcref)
|
2018-11-08 08:04:24 +01:00
|
|
|
(elem (i32.const 0) $null)
|
2018-04-19 17:32:23 +02:00
|
|
|
(global $assembly/index/w (mut i32) (i32.const 0))
|
|
|
|
(global $assembly/index/h (mut i32) (i32.const 0))
|
|
|
|
(global $assembly/index/s (mut i32) (i32.const 0))
|
2019-02-21 00:11:22 +01:00
|
|
|
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
2018-07-19 02:10:04 +02:00
|
|
|
(export "memory" (memory $0))
|
2018-10-11 08:49:08 +02:00
|
|
|
(export "table" (table $0))
|
2018-04-19 17:32:23 +02:00
|
|
|
(export "init" (func $assembly/index/init))
|
|
|
|
(export "step" (func $assembly/index/step))
|
2018-04-22 23:13:02 +02:00
|
|
|
(export "fill" (func $assembly/index/fill))
|
2019-03-01 00:09:06 +01:00
|
|
|
(func $assembly/index/init (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
|
2018-04-20 18:56:51 +02:00
|
|
|
(local $2 i32)
|
2018-04-19 23:16:03 +02:00
|
|
|
(local $3 i32)
|
|
|
|
(local $4 i32)
|
2019-02-21 00:11:22 +01:00
|
|
|
(local $5 i32)
|
|
|
|
(local $6 i32)
|
|
|
|
local.get $0
|
|
|
|
global.set $assembly/index/w
|
|
|
|
local.get $1
|
|
|
|
global.set $assembly/index/h
|
|
|
|
local.get $0
|
|
|
|
local.get $1
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-21 00:11:22 +01:00
|
|
|
global.set $assembly/index/s
|
2018-11-08 08:04:24 +01:00
|
|
|
block $break|0
|
|
|
|
i32.const 0
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $2
|
2018-11-08 08:04:24 +01:00
|
|
|
loop $repeat|0
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $2
|
|
|
|
global.get $assembly/index/h
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.lt_s
|
|
|
|
i32.eqz
|
|
|
|
br_if $break|0
|
|
|
|
block $break|1
|
|
|
|
i32.const 0
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $3
|
2018-11-08 08:04:24 +01:00
|
|
|
loop $repeat|1
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $3
|
|
|
|
global.get $assembly/index/w
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.lt_s
|
|
|
|
i32.eqz
|
|
|
|
br_if $break|1
|
2019-02-21 00:11:22 +01:00
|
|
|
block $assembly/index/set|inlined.0
|
|
|
|
local.get $3
|
|
|
|
local.set $4
|
|
|
|
local.get $2
|
|
|
|
local.set $5
|
2018-11-08 08:04:24 +01:00
|
|
|
call $~lib/bindings/Math/random
|
|
|
|
f64.const 0.1
|
|
|
|
f64.gt
|
|
|
|
if (result i32)
|
2019-02-21 00:11:22 +01:00
|
|
|
global.get $assembly/config/BGR_DEAD
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 16777215
|
|
|
|
i32.and
|
|
|
|
else
|
2019-02-21 00:11:22 +01:00
|
|
|
global.get $assembly/config/BGR_ALIVE
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const -16777216
|
|
|
|
i32.or
|
|
|
|
end
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $6
|
|
|
|
global.get $assembly/index/s
|
|
|
|
local.get $5
|
|
|
|
global.get $assembly/index/w
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
|
|
|
i32.add
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $4
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.add
|
|
|
|
i32.const 2
|
|
|
|
i32.shl
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $6
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.store
|
|
|
|
end
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $3
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 1
|
|
|
|
i32.add
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $3
|
2018-11-08 08:04:24 +01:00
|
|
|
br $repeat|1
|
|
|
|
unreachable
|
|
|
|
end
|
|
|
|
unreachable
|
|
|
|
end
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $2
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 1
|
|
|
|
i32.add
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $2
|
2018-11-08 08:04:24 +01:00
|
|
|
br $repeat|0
|
|
|
|
unreachable
|
|
|
|
end
|
|
|
|
unreachable
|
|
|
|
end
|
2018-04-19 17:32:23 +02:00
|
|
|
)
|
2019-03-01 00:09:06 +01:00
|
|
|
(func $assembly/index/step (; 2 ;) (type $FUNCSIG$v)
|
2018-04-19 17:32:23 +02:00
|
|
|
(local $0 i32)
|
|
|
|
(local $1 i32)
|
|
|
|
(local $2 i32)
|
|
|
|
(local $3 i32)
|
|
|
|
(local $4 i32)
|
|
|
|
(local $5 i32)
|
|
|
|
(local $6 i32)
|
|
|
|
(local $7 i32)
|
|
|
|
(local $8 i32)
|
|
|
|
(local $9 i32)
|
|
|
|
(local $10 i32)
|
2018-04-19 23:16:03 +02:00
|
|
|
(local $11 i32)
|
2019-02-21 00:11:22 +01:00
|
|
|
(local $12 i32)
|
|
|
|
(local $13 i32)
|
|
|
|
(local $14 i32)
|
|
|
|
(local $15 i32)
|
|
|
|
(local $16 i32)
|
|
|
|
global.get $assembly/index/h
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 1
|
|
|
|
i32.sub
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $0
|
|
|
|
global.get $assembly/index/w
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 1
|
|
|
|
i32.sub
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $1
|
2018-11-08 08:04:24 +01:00
|
|
|
block $break|0
|
|
|
|
i32.const 0
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $2
|
2018-11-08 08:04:24 +01:00
|
|
|
loop $repeat|0
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $2
|
|
|
|
global.get $assembly/index/h
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.lt_s
|
|
|
|
i32.eqz
|
|
|
|
br_if $break|0
|
|
|
|
block
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $2
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 0
|
|
|
|
i32.eq
|
|
|
|
if (result i32)
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
else
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $2
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 1
|
|
|
|
i32.sub
|
|
|
|
end
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $3
|
|
|
|
local.get $2
|
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.eq
|
|
|
|
if (result i32)
|
|
|
|
i32.const 0
|
|
|
|
else
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $2
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 1
|
|
|
|
i32.add
|
|
|
|
end
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $4
|
2018-11-08 08:04:24 +01:00
|
|
|
block $break|1
|
|
|
|
i32.const 0
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $5
|
2018-11-08 08:04:24 +01:00
|
|
|
loop $repeat|1
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $5
|
|
|
|
global.get $assembly/index/w
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.lt_s
|
|
|
|
i32.eqz
|
|
|
|
br_if $break|1
|
|
|
|
block
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $5
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 0
|
|
|
|
i32.eq
|
|
|
|
if (result i32)
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $1
|
2018-11-08 08:04:24 +01:00
|
|
|
else
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $5
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 1
|
|
|
|
i32.sub
|
|
|
|
end
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $6
|
|
|
|
local.get $5
|
|
|
|
local.get $1
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.eq
|
|
|
|
if (result i32)
|
|
|
|
i32.const 0
|
|
|
|
else
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $5
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 1
|
|
|
|
i32.add
|
|
|
|
end
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $7
|
2018-11-08 08:04:24 +01:00
|
|
|
block $assembly/index/get|inlined.0 (result i32)
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $6
|
|
|
|
local.set $8
|
|
|
|
local.get $3
|
|
|
|
local.set $9
|
|
|
|
local.get $9
|
|
|
|
global.get $assembly/index/w
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $8
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.add
|
|
|
|
i32.const 2
|
|
|
|
i32.shl
|
|
|
|
i32.load
|
|
|
|
end
|
|
|
|
i32.const 1
|
|
|
|
i32.and
|
|
|
|
block $assembly/index/get|inlined.1 (result i32)
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $5
|
|
|
|
local.set $9
|
|
|
|
local.get $3
|
|
|
|
local.set $8
|
|
|
|
local.get $8
|
|
|
|
global.get $assembly/index/w
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $9
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.add
|
|
|
|
i32.const 2
|
|
|
|
i32.shl
|
|
|
|
i32.load
|
|
|
|
end
|
|
|
|
i32.const 1
|
|
|
|
i32.and
|
|
|
|
i32.add
|
|
|
|
block $assembly/index/get|inlined.2 (result i32)
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $7
|
|
|
|
local.set $8
|
|
|
|
local.get $3
|
|
|
|
local.set $9
|
|
|
|
local.get $9
|
|
|
|
global.get $assembly/index/w
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $8
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.add
|
|
|
|
i32.const 2
|
|
|
|
i32.shl
|
|
|
|
i32.load
|
|
|
|
end
|
|
|
|
i32.const 1
|
|
|
|
i32.and
|
|
|
|
i32.add
|
|
|
|
block $assembly/index/get|inlined.3 (result i32)
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $6
|
|
|
|
local.set $9
|
|
|
|
local.get $2
|
|
|
|
local.set $8
|
|
|
|
local.get $8
|
|
|
|
global.get $assembly/index/w
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $9
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.add
|
|
|
|
i32.const 2
|
|
|
|
i32.shl
|
|
|
|
i32.load
|
|
|
|
end
|
|
|
|
i32.const 1
|
|
|
|
i32.and
|
|
|
|
i32.add
|
|
|
|
block $assembly/index/get|inlined.4 (result i32)
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $7
|
|
|
|
local.set $8
|
|
|
|
local.get $2
|
|
|
|
local.set $9
|
|
|
|
local.get $9
|
|
|
|
global.get $assembly/index/w
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $8
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.add
|
|
|
|
i32.const 2
|
|
|
|
i32.shl
|
|
|
|
i32.load
|
|
|
|
end
|
|
|
|
i32.const 1
|
|
|
|
i32.and
|
|
|
|
i32.add
|
|
|
|
block $assembly/index/get|inlined.5 (result i32)
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $6
|
|
|
|
local.set $9
|
|
|
|
local.get $4
|
|
|
|
local.set $8
|
|
|
|
local.get $8
|
|
|
|
global.get $assembly/index/w
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $9
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.add
|
|
|
|
i32.const 2
|
|
|
|
i32.shl
|
|
|
|
i32.load
|
|
|
|
end
|
|
|
|
i32.const 1
|
|
|
|
i32.and
|
|
|
|
i32.add
|
|
|
|
block $assembly/index/get|inlined.6 (result i32)
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $5
|
|
|
|
local.set $8
|
|
|
|
local.get $4
|
|
|
|
local.set $9
|
|
|
|
local.get $9
|
|
|
|
global.get $assembly/index/w
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $8
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.add
|
|
|
|
i32.const 2
|
|
|
|
i32.shl
|
|
|
|
i32.load
|
|
|
|
end
|
|
|
|
i32.const 1
|
|
|
|
i32.and
|
|
|
|
i32.add
|
|
|
|
block $assembly/index/get|inlined.7 (result i32)
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $7
|
|
|
|
local.set $9
|
|
|
|
local.get $4
|
|
|
|
local.set $8
|
|
|
|
local.get $8
|
|
|
|
global.get $assembly/index/w
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $9
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.add
|
|
|
|
i32.const 2
|
|
|
|
i32.shl
|
|
|
|
i32.load
|
|
|
|
end
|
|
|
|
i32.const 1
|
|
|
|
i32.and
|
|
|
|
i32.add
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $8
|
2018-11-08 08:04:24 +01:00
|
|
|
block $assembly/index/get|inlined.8 (result i32)
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $5
|
|
|
|
local.set $9
|
|
|
|
local.get $2
|
|
|
|
local.set $10
|
|
|
|
local.get $10
|
|
|
|
global.get $assembly/index/w
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $9
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.add
|
|
|
|
i32.const 2
|
|
|
|
i32.shl
|
|
|
|
i32.load
|
|
|
|
end
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $10
|
|
|
|
local.get $10
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 1
|
|
|
|
i32.and
|
|
|
|
if
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $8
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 14
|
|
|
|
i32.and
|
|
|
|
i32.const 2
|
|
|
|
i32.eq
|
|
|
|
if
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $5
|
|
|
|
local.set $9
|
|
|
|
local.get $2
|
|
|
|
local.set $11
|
|
|
|
local.get $10
|
|
|
|
local.set $12
|
|
|
|
local.get $12
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 24
|
|
|
|
i32.shr_u
|
2019-02-21 00:11:22 +01:00
|
|
|
global.get $assembly/config/BIT_ROT
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.sub
|
2019-02-21 00:11:22 +01:00
|
|
|
local.tee $13
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 0
|
2019-02-21 00:11:22 +01:00
|
|
|
local.tee $14
|
|
|
|
local.get $13
|
|
|
|
local.get $14
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.gt_s
|
|
|
|
select
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $13
|
|
|
|
block $assembly/index/set|inlined.1
|
|
|
|
local.get $9
|
|
|
|
local.set $14
|
|
|
|
local.get $11
|
|
|
|
local.set $15
|
|
|
|
local.get $13
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 24
|
|
|
|
i32.shl
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $12
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 16777215
|
|
|
|
i32.and
|
|
|
|
i32.or
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $16
|
|
|
|
global.get $assembly/index/s
|
|
|
|
local.get $15
|
|
|
|
global.get $assembly/index/w
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
|
|
|
i32.add
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $14
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.add
|
|
|
|
i32.const 2
|
|
|
|
i32.shl
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $16
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.store
|
|
|
|
end
|
|
|
|
else
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $5
|
|
|
|
local.set $13
|
|
|
|
local.get $2
|
|
|
|
local.set $12
|
|
|
|
global.get $assembly/config/BGR_DEAD
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const -16777216
|
|
|
|
i32.or
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $11
|
|
|
|
global.get $assembly/index/s
|
|
|
|
local.get $12
|
|
|
|
global.get $assembly/index/w
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
|
|
|
i32.add
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $13
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.add
|
|
|
|
i32.const 2
|
|
|
|
i32.shl
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $11
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.store
|
|
|
|
end
|
|
|
|
else
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $8
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 3
|
|
|
|
i32.eq
|
|
|
|
if
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $5
|
|
|
|
local.set $11
|
|
|
|
local.get $2
|
|
|
|
local.set $12
|
|
|
|
global.get $assembly/config/BGR_ALIVE
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const -16777216
|
|
|
|
i32.or
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $13
|
|
|
|
global.get $assembly/index/s
|
|
|
|
local.get $12
|
|
|
|
global.get $assembly/index/w
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
|
|
|
i32.add
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $11
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.add
|
|
|
|
i32.const 2
|
|
|
|
i32.shl
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $13
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.store
|
|
|
|
else
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $5
|
|
|
|
local.set $13
|
|
|
|
local.get $2
|
|
|
|
local.set $12
|
|
|
|
local.get $10
|
|
|
|
local.set $11
|
|
|
|
local.get $11
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 24
|
|
|
|
i32.shr_u
|
2019-02-21 00:11:22 +01:00
|
|
|
global.get $assembly/config/BIT_ROT
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.sub
|
2019-02-21 00:11:22 +01:00
|
|
|
local.tee $9
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 0
|
2019-02-21 00:11:22 +01:00
|
|
|
local.tee $16
|
|
|
|
local.get $9
|
|
|
|
local.get $16
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.gt_s
|
|
|
|
select
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $9
|
|
|
|
block $assembly/index/set|inlined.4
|
|
|
|
local.get $13
|
|
|
|
local.set $16
|
|
|
|
local.get $12
|
|
|
|
local.set $15
|
|
|
|
local.get $9
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 24
|
|
|
|
i32.shl
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $11
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 16777215
|
|
|
|
i32.and
|
|
|
|
i32.or
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $14
|
|
|
|
global.get $assembly/index/s
|
|
|
|
local.get $15
|
|
|
|
global.get $assembly/index/w
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
|
|
|
i32.add
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $16
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.add
|
|
|
|
i32.const 2
|
|
|
|
i32.shl
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $14
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.store
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $5
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 1
|
|
|
|
i32.add
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $5
|
2018-11-08 08:04:24 +01:00
|
|
|
br $repeat|1
|
|
|
|
unreachable
|
|
|
|
end
|
|
|
|
unreachable
|
|
|
|
end
|
|
|
|
end
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $2
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 1
|
|
|
|
i32.add
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $2
|
2018-11-08 08:04:24 +01:00
|
|
|
br $repeat|0
|
|
|
|
unreachable
|
|
|
|
end
|
|
|
|
unreachable
|
|
|
|
end
|
2018-04-19 17:32:23 +02:00
|
|
|
)
|
2019-03-01 00:09:06 +01:00
|
|
|
(func $assembly/index/fill (; 3 ;) (type $FUNCSIG$viid) (param $0 i32) (param $1 i32) (param $2 f64)
|
2018-04-22 23:13:02 +02:00
|
|
|
(local $3 i32)
|
|
|
|
(local $4 i32)
|
2019-02-21 00:11:22 +01:00
|
|
|
(local $5 i32)
|
|
|
|
(local $6 i32)
|
2018-11-08 08:04:24 +01:00
|
|
|
block $break|0
|
|
|
|
i32.const 0
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $3
|
2018-11-08 08:04:24 +01:00
|
|
|
loop $repeat|0
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $3
|
|
|
|
global.get $assembly/index/w
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.lt_s
|
|
|
|
i32.eqz
|
|
|
|
br_if $break|0
|
|
|
|
call $~lib/bindings/Math/random
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $2
|
2018-11-08 08:04:24 +01:00
|
|
|
f64.lt
|
|
|
|
if
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $3
|
|
|
|
local.set $4
|
|
|
|
local.get $1
|
|
|
|
local.set $5
|
|
|
|
global.get $assembly/config/BGR_ALIVE
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const -16777216
|
|
|
|
i32.or
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $6
|
|
|
|
global.get $assembly/index/s
|
|
|
|
local.get $5
|
|
|
|
global.get $assembly/index/w
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
|
|
|
i32.add
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $4
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.add
|
|
|
|
i32.const 2
|
|
|
|
i32.shl
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $6
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.store
|
|
|
|
end
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $3
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 1
|
|
|
|
i32.add
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $3
|
2018-11-08 08:04:24 +01:00
|
|
|
br $repeat|0
|
|
|
|
unreachable
|
|
|
|
end
|
|
|
|
unreachable
|
|
|
|
end
|
|
|
|
block $break|1
|
|
|
|
i32.const 0
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $3
|
2018-11-08 08:04:24 +01:00
|
|
|
loop $repeat|1
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $3
|
|
|
|
global.get $assembly/index/h
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.lt_s
|
|
|
|
i32.eqz
|
|
|
|
br_if $break|1
|
|
|
|
call $~lib/bindings/Math/random
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $2
|
2018-11-08 08:04:24 +01:00
|
|
|
f64.lt
|
|
|
|
if
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $0
|
|
|
|
local.set $6
|
|
|
|
local.get $3
|
|
|
|
local.set $5
|
|
|
|
global.get $assembly/config/BGR_ALIVE
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const -16777216
|
|
|
|
i32.or
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $4
|
|
|
|
global.get $assembly/index/s
|
|
|
|
local.get $5
|
|
|
|
global.get $assembly/index/w
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.mul
|
|
|
|
i32.add
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $6
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.add
|
|
|
|
i32.const 2
|
|
|
|
i32.shl
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $4
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.store
|
|
|
|
end
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $3
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 1
|
|
|
|
i32.add
|
2019-02-21 00:11:22 +01:00
|
|
|
local.set $3
|
2018-11-08 08:04:24 +01:00
|
|
|
br $repeat|1
|
|
|
|
unreachable
|
|
|
|
end
|
|
|
|
unreachable
|
|
|
|
end
|
2018-04-22 23:13:02 +02:00
|
|
|
)
|
2019-03-01 00:09:06 +01:00
|
|
|
(func $null (; 4 ;) (type $FUNCSIG$v)
|
2018-10-11 08:49:08 +02:00
|
|
|
)
|
2018-04-19 17:32:23 +02:00
|
|
|
)
|