anchor.diff:      {<<1,2,3,7>>,19,42} = mos_bin(<<4,1,2,3,7,19,4,42>>),
       <<1,2,3,7>> = mos_bin(<<4,1,2,3,7,"abcdefghij">>),
   
  -    ok.
  -
  -mos_int(<<L,I:L,X:32>>) ->
  +    false = mos_verify_sig(not_a_binary),
  +    false = mos_verify_sig(<<>>),
  +    false = mos_verify_sig(<<42:32>>),
  +    <<"123456789">> = mos_verify_sig(<<77:32,0:77/unit:8,9:32,"123456789">>),
  +
  +    ok.
  +
  +mos_int(B) ->
  +    Res = mos_int_plain(B),
  +    Res = mos_int_list([B]),
  +    Res = mos_int_tuple({a,[B],z}),
  +
  +    Res = mos_int_mixed([B]),
  +    Res = mos_int_mixed({a,[B],z}),
  +    42 = mos_int_mixed({30,12}),
  +    no_match = mos_int_mixed([B,B,B]),
  +
  +    Res = mos_int_pats1({tag,[B]}, {0,1,2,3,4,5,6,7,8,9}),
  +    Res = mos_int_pats2({tag,[B]}, {a,a,a,a,a,a,a,a,a,a}, [z]),
  +    {I,X} = Res,
  +    Res = mos_int_pats3({tag,[B]}, [I,{X,B,X},I]),
  +    Res = mos_int_map(#{key => [B]}),
  +    Key = {my,key},
  +    Res = mos_int_map(Key, #{Key => [B]}),
  +    {I,X,B} = mos_int_alias([[B]]),
  +    Res = {I,X},
  +    Res = mos_int_try([B]),
  +    Res = mos_int_receive(B),
  +    Res = mos_int_fun([B]),
  +    Res = mos_int_exported(B),
  +    Res = mos_int_utf(B),
  +    Res.
  +
  +mos_int_plain(<<L,I:L,X:32>>) ->
       {I,X};
  -mos_int(<<L,I:L,X:64>>) ->
  +mos_int_plain(<<L,I:L,X:64>>) ->
       {I,X}.
   
  -mos_bin(<<L,Bin:L/binary,X:8,L>>) ->
  +mos_int_list([<<L,I:L,X:32>>]) ->
  +    {I,X};
  +mos_int_list([<<L,I:L,X:64>>]) ->
  +    {I,X}.
  +
  +mos_int_tuple({a,[<<L,I:L,X:32>>],z}) ->
  +    {I,X};
  +mos_int_tuple({a,[<<L,I:L,X:64>>],z}) ->
  +    {I,X}.
  +
  +mos_int_mixed({a,[<<L,I:L,X:32>>],z}) ->
  +    {I,X};
  +mos_int_mixed({a,[<<L,I:L,X:64>>],z}) ->
  +    {I,X};
  +mos_int_mixed([<<L,I:L,X:32>>]) ->
  +    {I,X};
  +mos_int_mixed([<<L,I:L,X:64>>]) ->
  +    {I,X};
  +mos_int_mixed({A,B}) when is_integer(A), is_integer(B) ->
  +    A + B;
  +mos_int_mixed(_) ->
  +    no_match.
  +
  +mos_int_pats1({tag,[<<L,I:L,X:32>>]}, {_,_,_,_,_,_,_,_,_,_}) ->
  +    {I,X};
  +mos_int_pats1({tag,[<<L,I:L,X:64>>]}, {_,_,_,_,_,_,_,_,_,_}) ->
  +    {I,X}.
  +
  +mos_int_pats2({tag,[<<L,I:L,X:32>>]}, {S,S,S,S,S,S,S,S,S,S}, [_|_]) ->
  +    {I,X};
  +mos_int_pats2({tag,[<<L,I:L,X:64>>]}, {S,S,S,S,S,S,S,S,S,S}, [_|_]) ->
  +    {I,X}.
  +
  +mos_int_pats3({tag,[<<L,I:L,X:32>>]}, [I,{X,<<L,I:L,X:32>>,X},I]) ->
  +    {I,X};
  +mos_int_pats3({tag,[<<L,I:L,X:64>>]}, [I,{X,<<L,I:L,X:64>>,X},I]) ->
  +    {I,X}.
  +
  +mos_int_map(#{key := [<<L,I:L,X:32>>]}) ->
  +    {I,X};
  +mos_int_map(#{key := [<<L,I:L,X:64>>]}) ->
  +    {I,X}.
  +
  +mos_int_map(Key, Map) ->
  +    case Map of
  +        #{Key := [<<L,I:L,X:32>>]} -> {I,X};
  +        #{Key := [<<L,I:L,X:64>>]} -> {I,X}
  +    end.
  +
  +mos_int_alias([[<<L,I:L,X:32>> = B]]) ->
  +    {I,X,B};
  +mos_int_alias([[<<L,I:L,X:64>> = B]]) ->
  +    {I,X,B}.
  +
  +mos_int_try(B) ->
  +    try id(B) of
  +        [<<L,I:L,X:32>>] -> {I,X};
  +        [<<L,I:L,X:64>>] -> {I,X}
  +    after
  +        ok
  +    end.
  +
  +mos_int_receive(Msg) ->
  +    Res = (fun() ->
  +                  self() ! Msg,
  +                  receive
  +                      <<L,I:L,X:32>> -> {I,X};
  +                      <<L,I:L,X:64>> -> {I,X}
  +                  end
  +           end)(),
  +    self() ! Msg,
  +    Res = receive
  +              <<L,I:L,X:32>> -> {I,X};
  +              <<L,I:L,X:64>> -> {I,X}
  +          end,
  +    self() ! {tag,[Msg]},
  +    Res = receive
  +              {tag,[<<L,I:L,X:32>>]} -> {I,X};
  +              {tag,[<<L,I:L,X:64>>]} -> {I,X}
  +          end,
  +    Res.
  +
  +mos_int_fun(B) ->
  +    L = ignore_me,
  +    F = fun ([<<L,I:L,X:32>>]) -> {I,X};
  +            ([<<L,I:L,X:64>>]) -> {I,X}
  +        end,
  +    F(B).
  +
  +mos_int_exported(B) ->
  +    case B of
  +        <<L,I:L,X:32>> -> ok;
  +        <<L,I:L,X:64>> -> ok
  +    end,
  +    {I,X}.
  +
  +mos_int_utf(B0) ->
  +    B = id(<<B0/bits,777/utf8,7777/utf16,9999/utf32>>),
  +    case B of
  +        <<L,I:L,X:32,777/utf8,7777/utf16,9999/utf32>> -> {I,X};
  +        <<L,I:L,X:64,777/utf8,7777/utf16,9999/utf32>> -> {I,X}
  +    end.
  +
  +mos_bin(B) ->
  +    Res = mos_bin_plain(B),
  +    Res = mos_bin_tuple({outer,{inner,B}}),
  +    Res.
  +
  +mos_bin_plain(<<L,Bin:L/binary,X:8,L>>) ->
       L = byte_size(Bin),
       {Bin,X};
  -mos_bin(<<L,Bin:L/binary,X:8,L,Y:8>>) ->
  +mos_bin_plain(<<L,Bin:L/binary,X:8,L,Y:8>>) ->
       L = byte_size(Bin),
       {Bin,X,Y};
  -mos_bin(<<L,Bin:L/binary,"abcdefghij">>) ->
  +mos_bin_plain(<<L,Bin:L/binary,"abcdefghij">>) ->
       L = byte_size(Bin),
       Bin.
  +
  +mos_bin_tuple({outer,{inner,<<L,Bin:L/binary,X:8,L>>}}) ->
  +    L = byte_size(Bin),
  +    {Bin,X};
  +mos_bin_tuple({outer,{inner,<<L,Bin:L/binary,X:8,L,Y:8>>}}) ->
  +    L = byte_size(Bin),
  +    {Bin,X,Y};
  +mos_bin_tuple({outer,{inner,<<L,Bin:L/binary,"abcdefghij">>}}) ->
  +    L = byte_size(Bin),
  +    Bin.
  +
  +mos_verify_sig(AlgSig) ->
  +    try
  +        <<AlgLen:32, _Alg:AlgLen/binary,
  +          SigLen:32, Sig:SigLen/binary>> = AlgSig,
  +        Sig
  +    catch
  +        _:_ ->
  +            false
  +    end.
   
   follow_fail_branch(_) ->
       42 = ffb_1(<<0,1>>, <<0>>),
  
positive.code:        expression_before_match,erl_689,restore_on_call,
         matches_on_parameter,big_positions,
         matching_meets_apply,bs_start_match2_defs,
         exceptions_after_match_failure,bad_phi_paths]}].
  
  
  init_per_suite(Config) ->
      test_lib:recompile(?MODULE),
  
negative.code: 
  size_shadow_1() ->
      L = 8,
      Fs = [fun(<<L:L,B:L>>) -> B end,
            fun(A) ->
                    (fun([<<L:L,B:L>>]) -> B end)([A])
            end,
            fun(A) ->
                    (fun([<<L:L,B:L>>,<<L:L,B:L>>]) -> B end)([A,A])
            end,
            fun(A) ->
                    <<Size:L,_/bits>> = A,
                    Inner = fun([L], {#{key1 := <<L:L,B:L>>,
                                      key2 := <<L:L,B:L>>}, L}) -> B end,
                    Inner([Size], {#{key1 => A,key2 => A},Size})
            end],
      size_shadow_apply(Fs, <<16:8, 7:16>>).
  
  size_shadow_2(L) ->
      Fs = [fun(<<L:L,B:L>>) -> B end,
            fun(A) ->
                    (fun([<<L:L,B:L>>]) -> B end)([A])
            end,
            fun(A) ->
                    (fun({<<L:L,B:L>>,<<L:L,B:L>>}) -> B end)({A,A})
            end],
      size_shadow_apply(Fs, <<16:8, 7:16>>).
  
  size_shadow_3() ->
      L = 8,
      Fs = [fun(<<L:L,B:L,L:L>>) -> B end,
            fun(A) ->
                    (fun({tag,[<<L:L,B:L,L:L>>]}) -> B end)({tag,[A]})
            end,
            fun(A) ->
                    (fun({tag,<<L:L,B:L,L:L>>,<<L:L,B:L,L:L>>}) -> B end)({tag,A,A})
            end],
      size_shadow_apply(Fs, <<16:8, 7:16,16:16>>).
  
  size_shadow_4(L) ->
      Fs = [fun(<<L:L,B:L,L:L>>) -> B;
               (_) -> no
            end,
            fun(A) ->
                    Inner = fun([<<L:L,B:L,L:L>>]) -> B;
                               (_) -> no
                            end,
                    Inner([A])
            end,
            fun(A) ->
                    Inner = fun({<<L:L,B:L,L:L>>,<<L:L,B:L,L:L>>}) -> B;
                               (_) -> no
                            end,
                    Inner({A,A})
            end],
      size_shadow_apply(Fs, <<16:8, 7:16,15:16>>).
  
  size_shadow_5(X, Y) ->
      fun (<< A:Y >>, Y, B) -> fum(A, X, Y, B) end.
  