∀ (discr : Lean.Term) (alts : Lean.TSyntax `Lean.Parser.Term.matchExprAlts) (dec : Lean.Elab.Do.DoElemCont)
  (_x : (_ : ℕ) ×' Array (Lean.TSyntax `Lean.Parser.Term.matchExprAlt)),
  Lean.Elab.Do.elabDoMatchExpr.elabDoMatchExprNoMeta.elabMatch._unary✝ discr alts dec _x =
    PSigma.casesOn _x fun i altsArr =>
      if h : i < altsArr.size then
        have __discr := altsArr[i];
        if __discr.raw.isOfKind `Lean.Parser.Term.matchExprAlt = true then
          have __discr_1 := __discr.raw.getArg 0;
          have __discr_2 := __discr.raw.getArg 1;
          have __discr_3 := __discr.raw.getArg 2;
          have __discr := __discr.raw.getArg 3;
          have seq := { raw := __discr };
          have pattern := { raw := __discr_2 };
          do
          let vars ← liftM (Lean.Elab.Do.getExprPatternVarsEx pattern)
          Lean.Elab.Do.checkMutVarsForShadowing vars
          Lean.Elab.Do.doElabToSyntax (Lean.toMessageData "match_expr alternative " ++ Lean.toMessageData pattern)
              (Lean.Elab.Do.elabDoSeq { raw := seq.raw } dec)
              (fun rhs => do
                let __do_lift ←
                  do
                    let info ← Lean.MonadRef.mkInfoFromRefPos
                    let _ ← Lean.getCurrMacroScope
                    let _ ← Lean.MonadQuotation.getContext
                    pure
                        {
                          raw :=
                            Lean.Syntax.node4 info `Lean.Parser.Term.matchExprAlt (Lean.Syntax.atom info "|")
                              pattern.raw (Lean.Syntax.atom info "=>") rhs.raw }
                Lean.Elab.Do.elabDoMatchExpr.elabDoMatchExprNoMeta.elabMatch._unary✝ discr alts dec
                    ⟨i + 1, altsArr.set i { raw := __do_lift.raw } h⟩)
              seq.raw
        else
          have __discr := altsArr[i];
          Lean.Elab.throwUnsupportedSyntax
      else
        have elseSeq := alts.raw[1][3];
        Lean.Elab.Do.doElabToSyntax (Lean.toMessageData "match_expr else alternative")
          (Lean.Elab.Do.elabDoSeq { raw := elseSeq } dec)
          (fun rhs =>
            have alts := { raw := alts.raw.modifyArg 0 fun node => node.setArgs (Lean.TSyntaxArray.raw altsArr) };
            have alts := { raw := alts.raw.modifyArg 1 fun x => x.setArg 3 rhs.raw };
            do
            let __do_lift ← read
            let mγ ← Lean.Elab.Do.mkMonadicType __do_lift.doBlockResultType
            let __do_lift ←
              do
                let info ← Lean.MonadRef.mkInfoFromRefPos
                let _ ← Lean.getCurrMacroScope
                let _ ← Lean.MonadQuotation.getContext
                pure
                    {
                      raw :=
                        Lean.Syntax.node4 info `Lean.Parser.Term.matchExpr (Lean.Syntax.atom info "match_expr")
                          discr.raw (Lean.Syntax.atom info "with") alts.raw }
            liftM (Lean.Elab.Term.elabTerm __do_lift.raw (some mγ)))
          elseSeq