(module
 (type $i32_i32_=>_none (func (param i32 i32)))
 (type $i32_=>_none (func (param i32)))
 (type $i32_i32_i32_=>_none (func (param i32 i32 i32)))
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (type $none_=>_i32 (func (result i32)))
 (type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
 (import "rt" "retain" (func $~lib/rt/pure/__retain (param i32) (result i32)))
 (import "rt" "release" (func $~lib/rt/pure/__release (param i32)))
 (import "rc" "getRetainedRef" (func $getRetainedRef (result i32)))
 (func $eliminates.linearArgument (; 3 ;) (param $0 i32)
  (local.set $0
   (local.get $0)
  )
  (nop)
 )
 (func $eliminates.linearLocal (; 4 ;) (param $0 i32)
  (local $1 i32)
  (local.set $1
   (local.get $0)
  )
  (nop)
 )
 (func $eliminates.linearChain (; 5 ;) (param $0 i32)
  (local $1 i32)
  (local $2 i32)
  (local $3 i32)
  (local.set $1
   (local.get $0)
  )
  (local.set $2
   (local.get $1)
  )
  (local.set $3
   (local.get $2)
  )
  (nop)
  (nop)
  (nop)
 )
 (func $eliminates.balancedReleases (; 6 ;) (param $0 i32) (param $cond i32)
  (local $2 i32)
  (local.set $2
   (local.get $0)
  )
  (if
   (local.get $cond)
   (nop)
   (nop)
  )
 )
 (func $eliminates.partialReleases (; 7 ;) (param $0 i32) (param $cond i32)
  (local $2 i32)
  (local.set $2
   (local.get $0)
  )
  (if
   (local.get $cond)
   (nop)
  )
 )
 (func $eliminates.balancedRetains (; 8 ;) (param $0 i32) (param $cond1 i32) (param $cond2 i32)
  (local $3 i32)
  (if
   (local.get $cond1)
   (if
    (local.get $cond2)
    (local.set $3
     (local.get $0)
    )
    (local.set $3
     (local.get $0)
    )
   )
   (local.set $3
    (local.get $0)
   )
  )
  (nop)
 )
 (func $eliminates.balancedInsideLoop (; 9 ;) (param $0 i32) (param $cond i32)
  (local $flat i32)
  (block $break|0
   (loop $continue|0
    (local.set $flat
     (i32.eqz
      (local.get $cond)
     )
    )
    (br_if $break|0
     (local.get $flat)
    )
    (local.set $0
     (local.get $0)
    )
    (nop)
    (br $continue|0)
   )
   (unreachable)
  )
 )
 (func $eliminates.balancedOutsideLoop (; 10 ;) (param $0 i32) (param $cond i32)
  (local $flat i32)
  (local.set $0
   (local.get $0)
  )
  (block $break|0
   (loop $continue|0
    (local.set $flat
     (i32.eqz
      (local.get $cond)
     )
    )
    (br_if $break|0
     (local.get $flat)
    )
    (br $continue|0)
   )
   (unreachable)
  )
  (nop)
 )
 (func $eliminates.balancedInsideOutsideLoop (; 11 ;) (param $0 i32) (param $cond i32)
  (local $flat i32)
  (local.set $0
   (local.get $0)
  )
  (block $break|0
   (loop $continue|0
    (local.set $flat
     (i32.eqz
      (local.get $cond)
     )
    )
    (br_if $break|0
     (local.get $flat)
    )
    (nop)
    (local.set $0
     (local.get $0)
    )
    (br $continue|0)
   )
   (unreachable)
  )
  (nop)
 )
 (func $eliminates.balancedInsideOutsideLoopWithBranch (; 12 ;) (param $0 i32) (param $cond1 i32) (param $cond2 i32)
  (local $flat i32)
  (local.set $0
   (local.get $0)
  )
  (block $break|0
   (loop $continue|0
    (local.set $flat
     (i32.eqz
      (local.get $cond1)
     )
    )
    (br_if $break|0
     (local.get $flat)
    )
    (if
     (local.get $cond2)
     (block $block
      (nop)
      (return)
     )
    )
    (nop)
    (local.set $0
     (local.get $0)
    )
    (br $continue|0)
   )
   (unreachable)
  )
  (nop)
 )
 (func $eliminates.replace (; 13 ;) (param $0 i32) (param $1 i32)
  (local $2 i32)
  (local $3 i32)
  (local.set $0
   (local.get $0)
  )
  (local.set $1
   (local.get $1)
  )
  (local.set $2
   (local.get $1)
  )
  (local.set $3
   (local.get $0)
  )
  (if
   (i32.ne
    (local.get $2)
    (local.get $3)
   )
   (local.set $2
    (local.get $2)
   )
   (nop)
  )
  (local.set $0
   (local.get $2)
  )
  (nop)
  (nop)
 )
 (func $eliminates.replaceAlreadyRetained (; 14 ;) (param $0 i32) (result i32)
  (local $1 i32)
  (block $block
   (local.set $0
    (local.get $0)
   )
   (local.set $1
    (call $getRetainedRef)
   )
   (nop)
   (local.set $0
    (local.get $1)
   )
   (return
    (local.get $0)
   )
  )
 )
 (func $keeps.partialRetains (; 15 ;) (param $0 i32) (param $cond i32)
  (if
   (local.get $cond)
   (local.set $0
    (call $~lib/rt/pure/__retain
     (local.get $0)
    )
   )
  )
  (call $~lib/rt/pure/__release
   (local.get $0)
  )
 )
 (func $keeps.reachesReturn (; 16 ;) (param $0 i32) (param $cond i32) (result i32)
  (block $block
   (local.set $0
    (call $~lib/rt/pure/__retain
     (local.get $0)
    )
   )
   (if
    (local.get $cond)
    (return
     (local.get $0)
    )
   )
   (call $~lib/rt/pure/__release
    (local.get $0)
   )
   (return
    (i32.const 0)
   )
  )
 )
)
