summaryrefslogtreecommitdiff
path: root/test/dot_s/basics.wast
blob: 3562140fbb8eac22a10131052f31b14d4a21ee97 (plain)
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
(module
  (memory 1)
  (data (i32.const 16) "hello, world!\n\00")
  (data (i32.const 32) "vcq")
  (data (i32.const 48) "\16\00\00\00")
  (export "memory" memory)
  (type $FUNCSIG$vi (func (param i32)))
  (type $FUNCSIG$v (func))
  (type $FUNCSIG$iii (func (param i32 i32) (result i32)))
  (import $puts "env" "puts" (param i32))
  (export "main" $main)
  (export "dynCall_iii" $dynCall_iii)
  (table 2 2 anyfunc)
  (elem (i32.const 0) $__wasm_nullptr $main)
  (func $main (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
    (call_import $puts
      (i32.const 16)
    )
    (block $label$0
      (block $label$1
        (br_if $label$1
          (i32.ne
            (i32.sub
              (get_local $0)
              (i32.and
                (i32.add
                  (get_local $0)
                  (i32.shr_u
                    (i32.shr_s
                      (get_local $0)
                      (i32.const 31)
                    )
                    (i32.const 30)
                  )
                )
                (i32.const -4)
              )
            )
            (i32.const 1)
          )
        )
        (loop $label$3 $label$2
          (set_local $0
            (i32.add
              (i32.gt_s
                (get_local $0)
                (i32.const 10)
              )
              (get_local $0)
            )
          )
          (block $label$4
            (br_if $label$4
              (i32.ne
                (i32.rem_s
                  (get_local $0)
                  (i32.const 5)
                )
                (i32.const 3)
              )
            )
            (set_local $0
              (i32.add
                (i32.rem_s
                  (get_local $0)
                  (i32.const 111)
                )
                (get_local $0)
              )
            )
          )
          (br_if $label$1
            (i32.eq
              (i32.rem_s
                (get_local $0)
                (i32.const 7)
              )
              (i32.const 0)
            )
          )
          (br $label$2)
        )
      )
      (set_local $0
        (i32.add
          (get_local $0)
          (i32.const -12)
        )
      )
      (i32.const 1)
    )
    (get_local $0)
  )
  (func $__wasm_nullptr (type $FUNCSIG$v)
    (unreachable)
  )
  (func $dynCall_iii (param $fptr i32) (param $0 i32) (param $1 i32) (result i32)
    (call_indirect $FUNCSIG$iii
      (get_local $fptr)
      (get_local $0)
      (get_local $1)
    )
  )
)
;; METADATA: { "asmConsts": {},"staticBump": 52, "initializers": [] }