Optimise case arguments in sys_core_fold
Optimise case arguments in sys_core_fold

If the argument of a case expression is a let, a seq or a case with two clauses
where the second one is a failing clause; it can be moved outside the case and
further optimisations can be performed.

module 'foo' ['t'/4]
  attributes []
't'/4 =
  fun (_cor14,Sub0,_cor15,_cor16) ->
    let Ssa = call 'erlang':'get' ('foo') in
      case let Ssa = {'ssa',_cor14,Sub0,_cor15,_cor16} in
           let _rec11 = call 'erlang':'+' (_cor14, 1) in
           let _cor4 = call 'erlang':'setelement' (2, Ssa, _rec11) in
             {{'tmp',_cor14},_cor4} of
        {NewReg,Foo} when 'true' ->
          {NewReg,Foo,Ssa}
        _cor20 when 'true' ->
          primop 'match_failure' ({'case_clause',_cor20})
      end
end

  ==>

module 'foo' ['t'/4]
  attributes []
't'/4 =
  fun (_cor14,Sub0,_cor15,_cor16) ->
    let Ssa = call 'erlang':'get' ('foo') in
    let _fol0 = {'ssa',_cor14,Sub0,_cor15,_cor16} in
    let _rec11 = call 'erlang':'+' (_cor14, 1) in
    let _cor4 = call 'erlang':'setelement' (2, _fol0, _rec11) in
    let NewReg = {'tmp',_cor14} in
      {NewReg,_cor4,Ssa}
end

dgud/otp,vladdu/otp,jamesruan/otp,jamesruan/otp,RaimoNiskanen/otp,lemenkov/otp,johanclaesson/otp,sdebnath/otp,beni55/otp,legoscia/otp,krishnakumar4a4/otp,isvilen/otp,beni55/otp,uabboli/otp,bsmr-erlang/otp,ahmedshafeeq/otp,c-rack/otp,cnbin/otp,msantos/otp,yangchengjian/otp,vic/otp,stolen/otp,haguenau/otp,paulcager/otp,yangchengjian/otp,potatosalad/otp,haguenau/otp,lantti/otp,getong/otp,mujiatong/otp,emile/otp,ahmedshafeeq/otp,hairyhum/otp,electricimp/otp,entropiae/otp,sitexa/otp,theom/otp,g-andrade/otp,legoscia/otp,vic/otp,legoscia/otp,sitexa/otp,benoitc/otp-1,c-rack/otp,riverrun/otp,RoadRunnr/otp,RichMorin/otp,matwey/otp,palas/otp,RaimoNiskanen/otp,kvakvs/otp,ferd/otp,theom/otp,vladdu/otp,ader1990/otp,potatosalad/otp,lightcyphers/otp,aboroska/otp,msantos/otp,lianghaivv/otp,lantti/otp,theom/otp,bugs-erlang-org/otp,potatosalad/otp,vinoski/otp,RJ/otp,Teino1978-Corp/erlang-otp,lianghaivv/otp,falkevik/otp,neeraj9/otp,bernardd/otp,basho/otp,lrascao/otp,sammoth-wazoku/otp,massemanet/otp,release-project/otp,Teino1978-Corp/erlang-otp,marquisthunder/otp,derek121/otp,g-andrade/otp,lightcyphers/otp,vladdu/otp,sitexa/otp,yangchengjian/otp,RoadRunnr/otp,jemsbhai/otp,dgud/otp,NOMORECOFFEE/otp,emile/otp,RJ/otp,matwey/otp,aboroska/otp,lrascao/otp,ferd/otp,psyeugenic/otp,platinumthinker/otp,riverrun/otp,basho/otp,emacsmirror/erlang,palas/otp,mikpe/otp,theom/otp,haguenau/otp,schlagert/otp,schlagert/otp,g-andrade/otp,schlagert/otp,RoadRunnr/otp,rlipscombe/otp,bugs-erlang-org/otp,fenollp/otp,c-rack/otp,benoitc/otp-1,bernardd/otp,falkevik/otp,NOMORECOFFEE/otp,beni55/otp,ahmedshafeeq/otp,lrascao/otp,dgud/otp,kvakvs/otp,schlagert/otp,sdebnath/otp,cobusc/otp,Teino1978-Corp/otp,jamesruan/otp,massemanet/otp,platinumthinker/otp,jj1bdx/otp,lightcyphers/otp,bsmr-erlang/otp,saleyn/otp,matwey/otp,sammoth-wazoku/otp,erlang/otp,dumbbell/otp,lhslll/otp,sitexa/otp,paladim/otp,weisslj/otp,lucafavatella/otp,derek121/otp,ferd/otp,VincentHHL/otp,potatosalad/otp,emile/otp,release-project/otp,vic/otp,jinshana/otp,erlang/otp,massemanet/otp,lantti/otp,RichMorin/otp,electricimp/otp,mikpe/otp,lianghaivv/otp,tuncer/otp,weisslj/otp,kvakvs/otp,bernardd/otp,riverrun/otp,vinoski/otp,vladdu/otp,saleyn/otp,neeraj9/otp,derek121/otp,Teino1978-Corp/erlang-otp,bugs-erlang-org/otp,bjorng/otp,lhslll/otp,c-rack/otp,aboroska/otp,benoitc/otp-1,electricimp/otp,ahmedshafeeq/otp,lianghaivv/otp,stolen/otp,tuncer/otp,sammoth-wazoku/otp,isvilen/otp,bernardd/otp,weisslj/otp,beni55/otp,goertzenator/otp,jamesruan/otp,johanclaesson/otp,isvilen/otp,emacsmirror/erlang,theom/otp,lemenkov/otp,dgud/otp,emile/otp,lrascao/otp,VincentHHL/otp,dumbbell/otp,msantos/otp,vinoski/otp,legoscia/otp,jamesruan/otp,VincentHHL/otp,lianghaivv/otp,mujiatong/otp,vladdu/otp,rlipscombe/otp,lightcyphers/otp,haguenau/otp,sammoth-wazoku/otp,paulcager/otp,weisslj/otp,psyeugenic/otp,matwey/otp,lantti/otp,ferd/otp,marquisthunder/otp,rlipscombe/otp,basho/otp,potatosalad/otp,kvakvs/otp,ahmedshafeeq/otp,electricimp/otp,marquisthunder/otp,neeraj9/otp,basho/otp,RJ/otp,cobusc/otp,hairyhum/otp,ader1990/otp,massemanet/otp,derek121/otp,psyeugenic/otp,mikpe/otp,VincentHHL/otp,isvilen/otp,dgud/otp,psyeugenic/otp,Teino1978-Corp/erlang-otp,hairyhum/otp,jj1bdx/otp,vladdu/otp,cobusc/otp,getong/otp,NOMORECOFFEE/otp,emacsmirror/erlang,release-project/otp,emile/otp,matwey/otp,RoadRunnr/otp,awetzel/otp,johanclaesson/otp,bernardd/otp,emile/otp,johanclaesson/otp,stolen/otp,isvilen/otp,erlang/otp,paulcager/otp,isvilen/otp,bjorng/otp,entropiae/otp,klarna/otp,GinjaNinja32/otp,bsmr-erlang/otp,dgud/otp,kvakvs/otp,electricimp/otp,vic/otp,RGafiyatullin/otp,paladim/otp,basho/otp,lemenkov/otp,cobusc/otp,platinumthinker/otp,yangchengjian/otp,cnbin/otp,mujiatong/otp,GinjaNinja32/otp,VincentHHL/otp,goertzenator/otp,release-project/otp,yangchengjian/otp,platinumthinker/otp,marquisthunder/otp,jinshana/otp,RoadRunnr/otp,paladim/otp,lrascao/otp,enikki/otp,ahmedshafeeq/otp,RGafiyatullin/otp,krishnakumar4a4/otp,electricimp/otp,saleyn/otp,Teino1978-Corp/otp,bernardd/otp,beni55/otp,enikki/otp,RoadRunnr/otp,erlang/otp,legoscia/otp,bernardd/otp,lhslll/otp,cobusc/otp,falkevik/otp,beni55/otp,bjorng/otp,entropiae/otp,jj1bdx/otp,emacsmirror/erlang,release-project/otp,vladdu/otp,marquisthunder/otp,uabboli/otp,neeraj9/otp,NOMORECOFFEE/otp,lantti/otp,paulcager/otp,RichMorin/otp,platinumthinker/otp,emacsmirror/erlang,ferd/otp,ahmedshafeeq/otp,release-project/otp,lucafavatella/otp,jinshana/otp,jemsbhai/otp,basho/otp,bugs-erlang-org/otp,beni55/otp,falkevik/otp,gjaldon/otp,tuncer/otp,bugs-erlang-org/otp,kvakvs/otp,weisslj/otp,cnbin/otp,RaimoNiskanen/otp,RGafiyatullin/otp,sitexa/otp,marquisthunder/otp,benoitc/otp-1,dumbbell/otp,msantos/otp,jj1bdx/otp,bugs-erlang-org/otp,bsmr-erlang/otp,riverrun/otp,palas/otp,lightcyphers/otp,massemanet/otp,erlang/otp,hairyhum/otp,getong/otp,klarna/otp,falkevik/otp,getong/otp,weisslj/otp,paulcager/otp,potatosalad/otp,cnbin/otp,Teino1978-Corp/otp,RaimoNiskanen/otp,awetzel/otp,NOMORECOFFEE/otp,RichMorin/otp,falkevik/otp,entropiae/otp,vic/otp,goertzenator/otp,vinoski/otp,dumbbell/otp,weisslj/otp,jemsbhai/otp,lianghaivv/otp,erlang/otp,sitexa/otp,RichMorin/otp,g-andrade/otp,saleyn/otp,klarna/otp,g-andrade/otp,cnbin/otp,aboroska/otp,msantos/otp,jamesruan/otp,emile/otp,jj1bdx/otp,klarna/otp,rlipscombe/otp,uabboli/otp,bsmr-erlang/otp,jinshana/otp,dumbbell/otp,kvakvs/otp,weisslj/otp,GinjaNinja32/otp,rlipscombe/otp,jemsbhai/otp,aboroska/otp,ferd/otp,hairyhum/otp,stolen/otp,tuncer/otp,Teino1978-Corp/erlang-otp,g-andrade/otp,electricimp/otp,isvilen/otp,release-project/otp,RichMorin/otp,legoscia/otp,isvilen/otp,ader1990/otp,falkevik/otp,Teino1978-Corp/otp,bjorng/otp,paladim/otp,lightcyphers/otp,klarna/otp,fenollp/otp,saleyn/otp,mujiatong/otp,sdebnath/otp,paladim/otp,NOMORECOFFEE/otp,RGafiyatullin/otp,enikki/otp,neeraj9/otp,massemanet/otp,mujiatong/otp,uabboli/otp,paladim/otp,derek121/otp,platinumthinker/otp,lemenkov/otp,lianghaivv/otp,ader1990/otp,neeraj9/otp,lantti/otp,klarna/otp,lhslll/otp,mujiatong/otp,johanclaesson/otp,weisslj/otp,vic/otp,kvakvs/otp,goertzenator/otp,electricimp/otp,stolen/otp,haguenau/otp,saleyn/otp,RichMorin/otp,fenollp/otp,mikpe/otp,schlagert/otp,gjaldon/otp,saleyn/otp,benoitc/otp-1,basho/otp,rlipscombe/otp,matwey/otp,awetzel/otp,jj1bdx/otp,jamesruan/otp,bsmr-erlang/otp,lhslll/otp,massemanet/otp,GinjaNinja32/otp,derek121/otp,sitexa/otp,sdebnath/otp,krishnakumar4a4/otp,getong/otp,yangchengjian/otp,jj1bdx/otp,dgud/otp,enikki/otp,matwey/otp,psyeugenic/otp,awetzel/otp,cobusc/otp,johanclaesson/otp,emacsmirror/erlang,rlipscombe/otp,emacsmirror/erlang,msantos/otp,lucafavatella/otp,palas/otp,bjorng/otp,rlipscombe/otp,vic/otp,ader1990/otp,saleyn/otp,NOMORECOFFEE/otp,Teino1978-Corp/erlang-otp,beni55/otp,platinumthinker/otp,g-andrade/otp,theom/otp,awetzel/otp,ferd/otp,RaimoNiskanen/otp,riverrun/otp,awetzel/otp,tuncer/otp,RJ/otp,RaimoNiskanen/otp,bjorng/otp,vic/otp,vinoski/otp,lemenkov/otp,massemanet/otp,stolen/otp,gjaldon/otp,fenollp/otp,enikki/otp,krishnakumar4a4/otp,mikpe/otp,tuncer/otp,bjorng/otp,potatosalad/otp,schlagert/otp,klarna/otp,jinshana/otp,isvilen/otp,matwey/otp,mujiatong/otp,hairyhum/otp,johanclaesson/otp,RichMorin/otp,lantti/otp,jinshana/otp,getong/otp,GinjaNinja32/otp,RoadRunnr/otp,RJ/otp,sammoth-wazoku/otp,uabboli/otp,fenollp/otp,hairyhum/otp,mikpe/otp,basho/otp,legoscia/otp,psyeugenic/otp,platinumthinker/otp,Teino1978-Corp/erlang-otp,fenollp/otp,bsmr-erlang/otp,entropiae/otp,benoitc/otp-1,bsmr-erlang/otp,potatosalad/otp,yangchengjian/otp,c-rack/otp,bernardd/otp,dumbbell/otp,haguenau/otp,ader1990/otp,emile/otp,benoitc/otp-1,g-andrade/otp,rlipscombe/otp,enikki/otp,cnbin/otp,johanclaesson/otp,Teino1978-Corp/erlang-otp,uabboli/otp,hairyhum/otp,marquisthunder/otp,erlang/otp,erlang/otp,legoscia/otp,uabboli/otp,VincentHHL/otp,isvilen/otp,RaimoNiskanen/otp,dumbbell/otp,lemenkov/otp,ader1990/otp,Teino1978-Corp/otp,bjorng/otp,entropiae/otp,getong/otp,c-rack/otp,mikpe/otp,tuncer/otp,goertzenator/otp,bernardd/otp,electricimp/otp,vinoski/otp,dgud/otp,jemsbhai/otp,RJ/otp,entropiae/otp,jemsbhai/otp,release-project/otp,lemenkov/otp,sdebnath/otp,riverrun/otp,awetzel/otp,dumbbell/otp,gjaldon/otp,gjaldon/otp,sammoth-wazoku/otp,Teino1978-Corp/otp,potatosalad/otp,bjorng/otp,paulcager/otp,saleyn/otp,legoscia/otp,RoadRunnr/otp,sitexa/otp,krishnakumar4a4/otp,lucafavatella/otp,fenollp/otp,palas/otp,vladdu/otp,lhslll/otp,vladdu/otp,falkevik/otp,kvakvs/otp,uabboli/otp,g-andrade/otp,Teino1978-Corp/otp,fenollp/otp,goertzenator/otp,jj1bdx/otp,goertzenator/otp,haguenau/otp,schlagert/otp,emile/otp,lantti/otp,erlang/otp,dgud/otp,paladim/otp,vinoski/otp,VincentHHL/otp,RGafiyatullin/otp,jinshana/otp,aboroska/otp,psyeugenic/otp,bsmr-erlang/otp,RGafiyatullin/otp,theom/otp,mikpe/otp,c-rack/otp,gjaldon/otp,klarna/otp,Teino1978-Corp/otp,marquisthunder/otp,massemanet/otp,sammoth-wazoku/otp,derek121/otp,getong/otp,paladim/otp,basho/otp,neeraj9/otp,sammoth-wazoku/otp,jj1bdx/otp,VincentHHL/otp,stolen/otp,awetzel/otp,uabboli/otp,jemsbhai/otp,ahmedshafeeq/otp,RJ/otp,aboroska/otp,yangchengjian/otp,jamesruan/otp,erlang/otp,vinoski/otp,bugs-erlang-org/otp,psyeugenic/otp,paulcager/otp,entropiae/otp,RGafiyatullin/otp,lrascao/otp,falkevik/otp,emacsmirror/erlang,vinoski/otp,vinoski/otp,RJ/otp,jinshana/otp,GinjaNinja32/otp,cobusc/otp,lightcyphers/otp,release-project/otp,lianghaivv/otp,goertzenator/otp,theom/otp,goertzenator/otp,matwey/otp,bugs-erlang-org/otp,enikki/otp,msantos/otp,NOMORECOFFEE/otp,benoitc/otp-1,cobusc/otp,tuncer/otp,neeraj9/otp,jemsbhai/otp,potatosalad/otp,emacsmirror/erlang,ahmedshafeeq/otp,bjorng/otp,c-rack/otp,enikki/otp,lhslll/otp,RoadRunnr/otp,cnbin/otp,aboroska/otp,lemenkov/otp,riverrun/otp,palas/otp,dumbbell/otp,lucafavatella/otp,krishnakumar4a4/otp,palas/otp,mikpe/otp,sdebnath/otp,paulcager/otp,lucafavatella/otp,emacsmirror/erlang,lucafavatella/otp,schlagert/otp,RaimoNiskanen/otp,rlipscombe/otp,jj1bdx/otp,ferd/otp,lucafavatella/otp,riverrun/otp,lrascao/otp,ferd/otp,lrascao/otp,derek121/otp,aboroska/otp,GinjaNinja32/otp,krishnakumar4a4/otp,stolen/otp,msantos/otp,cnbin/otp,RaimoNiskanen/otp,tuncer/otp,mujiatong/otp,krishnakumar4a4/otp,haguenau/otp,gjaldon/otp,dgud/otp,g-andrade/otp,gjaldon/otp,sdebnath/otp,ader1990/otp,lrascao/otp,lightcyphers/otp,getong/otp,getong/otp,lhslll/otp,RGafiyatullin/otp,mikpe/otp,GinjaNinja32/otp,palas/otp,dumbbell/otp,fenollp/otp,sdebnath/otp