(module rc_match_arm_partial_drop_leak
  (data Wrap
    (ctor MkWrap (con Int)))
  (data Cell
    (ctor MkCell (con Wrap) (con Wrap)))
  (data Pair
    (ctor MkPair (con Cell) (con Cell)))
  (fn build_pair
    (type (fn-type (params (con Int)) (ret (own (con Pair)))))
    (params n)
    (body (term-ctor Pair MkPair (term-ctor Cell MkCell (term-ctor Wrap MkWrap n) (term-ctor Wrap MkWrap 2)) (term-ctor Cell MkCell (term-ctor Wrap MkWrap 3) (term-ctor Wrap MkWrap 4)))))
  (fn use_first
    (suppress (code "over-strict-mode") (because "RC codegen test: exercises Iter A outer-arm-close partial-drop"))
    (type (fn-type (params (own (con Pair))) (ret (con Int))))
    (params p)
    (body (match p
      (case (pat-ctor MkPair a b) (match a
        (case (pat-ctor MkCell w1 _) 1))))))
  (fn main
    (type (fn-type (params) (ret (con Unit)) (effects IO)))
    (params)
    (body (do io/print_int (app use_first (app build_pair 1))))))
