anchor.diff:          let eenvAtTarget = AllocStorageForBinds cenv cgbuf scopeMarks eenv binds
           let targetInfo = (targetMarkBeforeBinds, targetMarkAfterBinds, eenvAtTarget, successExpr, spTarget, repeatSP, vs, binds, startScope, endScope)
   
  -        // In debug mode push all decision tree targets to after the switching
  -        let isTargetPostponed, genTargetInfoOpt =
  -            if cenv.opts.localOptimizationsAreOn then
  -                false, Some(GenDecisionTreeTarget cenv cgbuf stackAtTargets targetInfo sequel)
  +        // In debug mode, postpone all decision tree targets to after the switching.
  +        // In release mode, if a target is the target of multiple incoming success nodes, postpone it to avoid 
  +        // making any backward branches
  +        let isTargetPostponed =
  +            not cenv.opts.localOptimizationsAreOn || 
  +            not (targetCounts.ContainsKey targetIdx) || 
  +            targetCounts.[targetIdx] <> 1
  +        let genTargetInfoOpt =
  +            if isTargetPostponed then
  +                // Here we are postponing the generation of the target.
  +                // If not binding anything we can go directly to the targetMarkAfterBinds point.
  +                if isNil vs then
  +                    match inplabOpt with
  +                    | None -> CG.EmitInstr cgbuf (pop 0) Push0 (I_br targetMarkAfterBinds.CodeLabel)
  +                    | Some inplab -> CG.SetMark cgbuf inplab targetMarkAfterBinds
  +                else
  +                    match inplabOpt with None -> () | Some inplab -> CG.SetMarkToHere cgbuf inplab
  +                    CG.EmitInstr cgbuf (pop 0) Push0 (I_br targetMarkBeforeBinds.CodeLabel)
  +                None
               else
  -                CG.EmitInstr cgbuf (pop 0) Push0 (I_br targetMarkBeforeBinds.CodeLabel)
  -                true, None
  +                // Here we are generating the target immediately
  +                match inplabOpt with None -> () | Some inplab -> CG.SetMarkToHere cgbuf inplab
  +                Some(GenDecisionTreeTarget cenv cgbuf stackAtTargets targetInfo sequel)
   
           let targetInfos = IntMap.add targetIdx (targetInfo, isTargetPostponed) targetInfos
           targetInfos, genTargetInfoOpt
  
positive.code: // Used for the peephole optimization below
  and (|BoolExpr|_|) = function Expr.Const (Const.Bool b1, _, _) -> Some b1 | _ -> None
  
  and GenDecisionTreeTest cenv cloc cgbuf stackAtTargets e tester eenv successTree failureTree targets repeatSP targetInfos sequel contf =
      let g = cenv.g
      match successTree, failureTree with
  
  
negative.code: 
  // Accumulate the decision graph as we go
  and GenDecisionTreeAndTargets cenv cgbuf stackAtTargets eenv tree targets repeatSP sequel contf =
      let targetCounts = accTargetsOfDecisionTree tree [] |> List.countBy id |> Map.ofList
      GenDecisionTreeAndTargetsInner cenv cgbuf None stackAtTargets eenv tree targets targetCounts repeatSP (IntMap.empty()) sequel (fun targetInfos ->
          let sortedTargetInfos =
              targetInfos
              |> Seq.sortBy (fun (KeyValue(targetIdx, _)) -> targetIdx)
  