Skip to content

Instantly share code, notes, and snippets.

@lqd
Created October 4, 2016 18:35
Show Gist options
  • Save lqd/742bef11c8187c2e8a3e84f21baa5bff to your computer and use it in GitHub Desktop.
Save lqd/742bef11c8187c2e8a3e84f21baa5bff to your computer and use it in GitHub Desktop.
(module
(memory 1 1)
(start $__wasm_start)
(type $rustfn-0-13 (func (param i32 i32) (result i32)))
(type $rustfn-0-25 (func))
(type $rustfn-0-27 (func (result i32)))
(type $rustfn-0-30 (func (result i32)))
(type $rustfn-0-33 (func (param i32 i32) (result i32)))
(type $__wasm_start (func))
(export "memory" (memory $0))
(export "_isize_as_Add_::add" (func $_isize_as_Add_::add))
(export "eh_personality" (func $eh_personality))
(export "eh_unwind_resume" (func $eh_unwind_resume))
(export "panic_fmt" (func $panic_fmt))
(export "rust_eh_register_frames" (func $rust_eh_register_frames))
(export "rust_eh_unregister_frames" (func $rust_eh_unregister_frames))
(export "real_main" (func $real_main))
(export "main" (func $main))
(func $_isize_as_Add_::add (type $rustfn-0-13) (param $0 i32) (param $1 i32) (result 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 i64)
(block $block$1$break
(set_local $8
(i32.load
(i32.const 0)
)
)
(block
(br $block$1$break)
)
)
(block
(block $block$2$break
(block $bb0
(drop
(tee_local $2
(get_local $0)
)
)
(drop
(tee_local $3
(get_local $1)
)
)
(drop
(tee_local $4
(get_local $2)
)
)
(drop
(tee_local $5
(get_local $3)
)
)
(set_local $10
(i64.add
(i64.extend_s/i32
(get_local $4)
)
(i64.extend_s/i32
(get_local $5)
)
)
)
(i32.store
(i32.const 0)
(tee_local $6
(i32.sub
(i32.load
(i32.const 0)
)
(i32.const 128)
)
)
)
(i32.store
(get_local $6)
(i32.wrap/i64
(get_local $10)
)
)
(i32.store offset=4
(get_local $6)
(i32.wrap/i64
(i64.shr_u
(get_local $10)
(i64.const 32)
)
)
)
)
(block
(br $block$2$break)
)
)
(block
(block $bb1
(drop
(tee_local $7
(i32.load
(get_local $6)
)
)
)
(i32.store
(i32.const 0)
(get_local $8)
)
(return
(get_local $7)
)
)
)
)
)
(func $eh_personality (type $rustfn-0-25)
(local $0 i32)
(local $1 i32)
(local $2 i64)
(block $block$1$break
(set_local $0
(i32.load
(i32.const 0)
)
)
(block
(br $block$1$break)
)
)
(block
(block $block$2$break
(block $bb0
)
(block
(br $block$2$break)
)
)
(block
(block $bb1
(i32.store
(i32.const 0)
(get_local $0)
)
(return
(get_local $0)
)
)
)
)
)
(func $eh_unwind_resume (type $rustfn-0-25)
(local $0 i32)
(local $1 i32)
(local $2 i64)
(block $block$1$break
(set_local $0
(i32.load
(i32.const 0)
)
)
(block
(br $block$1$break)
)
)
(block
(block $block$2$break
(block $bb0
)
(block
(br $block$2$break)
)
)
(block
(block $bb1
(i32.store
(i32.const 0)
(get_local $0)
)
(return
(get_local $0)
)
)
)
)
)
(func $panic_fmt (type $rustfn-0-27) (result i32)
(local $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i64)
(block $block$1$break
(set_local $3
(i32.load
(i32.const 0)
)
)
(block
(br $block$1$break)
)
)
(block
(block $block$2$break
(block $bb0
)
(block
(br $block$2$break)
)
)
(loop $shape$2$continue
(block $bb1
)
(block
(br $shape$2$continue)
)
)
)
)
(func $rust_eh_register_frames (type $rustfn-0-25)
(local $0 i32)
(local $1 i32)
(local $2 i64)
(block $block$1$break
(set_local $0
(i32.load
(i32.const 0)
)
)
(block
(br $block$1$break)
)
)
(block
(block $block$2$break
(block $bb0
)
(block
(br $block$2$break)
)
)
(block
(block $bb1
(i32.store
(i32.const 0)
(get_local $0)
)
(return
(get_local $0)
)
)
)
)
)
(func $rust_eh_unregister_frames (type $rustfn-0-25)
(local $0 i32)
(local $1 i32)
(local $2 i64)
(block $block$1$break
(set_local $0
(i32.load
(i32.const 0)
)
)
(block
(br $block$1$break)
)
)
(block
(block $block$2$break
(block $bb0
)
(block
(br $block$2$break)
)
)
(block
(block $bb1
(i32.store
(i32.const 0)
(get_local $0)
)
(return
(get_local $0)
)
)
)
)
)
(func $real_main (type $rustfn-0-30) (result i32)
(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 i64)
(block $block$1$break
(set_local $6
(i32.load
(i32.const 0)
)
)
(block
(br $block$1$break)
)
)
(block
(block $block$2$break
(block $bb0
(drop
(tee_local $0
(i32.const 1)
)
)
(drop
(tee_local $2
(get_local $0)
)
)
(set_local $8
(i64.add
(i64.extend_s/i32
(get_local $2)
)
(i64.extend_s/i32
(i32.const 2)
)
)
)
(i32.store
(i32.const 0)
(tee_local $3
(i32.sub
(i32.load
(i32.const 0)
)
(i32.const 128)
)
)
)
(i32.store
(get_local $3)
(i32.wrap/i64
(get_local $8)
)
)
(i32.store offset=4
(get_local $3)
(i32.wrap/i64
(i64.shr_u
(get_local $8)
(i64.const 32)
)
)
)
)
(block
(br $block$2$break)
)
)
(block
(block $bb1
(drop
(tee_local $1
(i32.load
(get_local $3)
)
)
)
(drop
(tee_local $4
(get_local $1)
)
)
(drop
(tee_local $5
(get_local $4)
)
)
(i32.store
(i32.const 0)
(get_local $6)
)
(return
(get_local $5)
)
)
)
)
)
(func $main (type $rustfn-0-33) (param $0 i32) (param $1 i32) (result 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 i64)
(block $block$1$break
(set_local $8
(i32.load
(i32.const 0)
)
)
(block
(br $block$1$break)
)
)
(block
(block $block$2$break
(block $bb0
(drop
(tee_local $2
(get_local $0)
)
)
(set_local $4
(call $real_main)
)
)
(block
(br $block$2$break)
)
)
(block
(block $block$3$break
(block $bb1
(set_local $10
(i64.add
(i64.extend_s/i32
(get_local $4)
)
(i64.extend_s/i32
(i32.const 3)
)
)
)
(i32.store
(i32.const 0)
(tee_local $5
(i32.sub
(i32.load
(i32.const 0)
)
(i32.const 128)
)
)
)
(i32.store
(get_local $5)
(i32.wrap/i64
(get_local $10)
)
)
(i32.store offset=4
(get_local $5)
(i32.wrap/i64
(i64.shr_u
(get_local $10)
(i64.const 32)
)
)
)
)
(block
(br $block$3$break)
)
)
(block
(block $bb2
(drop
(tee_local $3
(i32.load
(get_local $5)
)
)
)
(drop
(tee_local $6
(get_local $3)
)
)
(drop
(tee_local $7
(get_local $6)
)
)
(i32.store
(i32.const 0)
(get_local $8)
)
(return
(get_local $7)
)
)
)
)
)
)
(func $__wasm_start (type $__wasm_start)
(i32.store
(i32.const 0)
(i32.const 65535)
)
(drop
(call $main
(i32.const 0)
(i32.const 0)
)
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment