Skip to content

Instantly share code, notes, and snippets.

@chikoski
Created August 25, 2018 23:50
Show Gist options
  • Save chikoski/3227689e6196583625ec283fc21b66de to your computer and use it in GitHub Desktop.
Save chikoski/3227689e6196583625ec283fc21b66de to your computer and use it in GitHub Desktop.
#[wasm_bindgen]
pub fn count(max: i32) -> i32 {
let mut res = 0;
for _i in 0..max {
res = res + 1;
}
res
}
(func $count (type 0) (param i32) (result i32)
i32.const 0
i32.const 0
i32.store offset=1048640
get_local 0
i32.const 0
get_local 0
i32.const 0
i32.gt_s
select)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment