Program: 62097
Project: 62097
Buggy source:
public static List<GraphTargetItem> checkClass(List<GraphTargetItem> output){
  if (true) {
  }
  List<GraphTargetItem> ret=new ArrayList<>();
  List<GraphTargetItem> functions=new ArrayList<>();
  List<GraphTargetItem> staticFunctions=new ArrayList<>();
  HashMap<GraphTargetItem,GraphTargetItem> vars=new HashMap<>();
  HashMap<GraphTargetItem,GraphTargetItem> staticVars=new HashMap<>();
  GraphTargetItem className;
  GraphTargetItem extendsOp=null;
  List<GraphTargetItem> implementsOp=new ArrayList<>();
  boolean ok=true;
  int prevCount=0;
  for (  GraphTargetItem t : output) {
    if (t instanceof IfItem) {
      IfItem it=(IfItem)t;
      if (it.expression instanceof NotItem) {
        NotItem nti=(NotItem)it.expression;
        if ((nti.value instanceof GetMemberTreeItem) || (nti.value instanceof GetVariableTreeItem)) {
          if (true) {
            if ((it.onTrue.size() == 1) && (it.onTrue.get(0) instanceof SetMemberTreeItem) && (((SetMemberTreeItem)it.onTrue.get(0)).value instanceof NewObjectTreeItem)) {
            }
 else {
              List<GraphTargetItem> parts=it.onTrue;
              className=getWithoutGlobal(nti.value);
              if (parts.size() >= 1) {
                int ipos=0;
                while ((parts.get(ipos) instanceof IfItem) && ((((IfItem)parts.get(ipos)).onTrue.size() == 1) && (((IfItem)parts.get(ipos)).onTrue.get(0) instanceof SetMemberTreeItem) && (((SetMemberTreeItem)((IfItem)parts.get(ipos)).onTrue.get(0)).value instanceof NewObjectTreeItem))) {
                  ipos++;
                }
                if (parts.get(ipos) instanceof SetMemberTreeItem) {
                  SetMemberTreeItem smt=(SetMemberTreeItem)parts.get(ipos);
                  if (smt.value instanceof StoreRegisterTreeItem) {
                    parts.add(ipos,smt.value);
                    smt.value=((StoreRegisterTreeItem)smt.value).value;
                  }
                }
                if (parts.get(ipos) instanceof StoreRegisterTreeItem) {
                  StoreRegisterTreeItem str1=(StoreRegisterTreeItem)parts.get(ipos);
                  int classReg=str1.register.number;
                  int instanceReg=-1;
                  if ((parts.size() >= ipos + 2) && (parts.get(ipos + 1) instanceof SetMemberTreeItem)) {
                    GraphTargetItem ti1=((SetMemberTreeItem)parts.get(ipos + 1)).value;
                    GraphTargetItem ti2=((StoreRegisterTreeItem)parts.get(ipos + 0)).value;
                    if (ti1 == ti2) {
                      if (((SetMemberTreeItem)parts.get(ipos + 1)).value instanceof FunctionTreeItem) {
                        ((FunctionTreeItem)((SetMemberTreeItem)parts.get(ipos + 1)).value).calculatedFunctionName=(className instanceof GetMemberTreeItem) ? ((GetMemberTreeItem)className).memberName : className;
                        functions.add((FunctionTreeItem)((SetMemberTreeItem)parts.get(ipos + 1)).value);
                        int pos=ipos + 2;
                        if (parts.size() <= pos) {
                          ok=false;
                          break;
                        }
                        if (parts.get(pos) instanceof ExtendsTreeItem) {
                          ExtendsTreeItem et=(ExtendsTreeItem)parts.get(pos);
                          extendsOp=getWithoutGlobal(et.superclass);
                          pos++;
                        }
                        if (parts.size() <= pos) {
                          List<GraphTargetItem> output2=new ArrayList<>();
                          for (int i=0; i < prevCount; i++) {
                            output2.add(output.get(i));
                          }
                          output2.add(new ClassTreeItem(className,extendsOp,implementsOp,functions,vars,staticFunctions,staticVars));
                          return output2;
                        }
                        if (parts.get(pos) instanceof SetMemberTreeItem) {
                          SetMemberTreeItem smt=(SetMemberTreeItem)parts.get(pos);
                          if (smt.value instanceof StoreRegisterTreeItem) {
                            parts.add(pos,smt.value);
                            smt.value=((StoreRegisterTreeItem)smt.value).value;
                          }
                        }
                        if (parts.get(pos) instanceof StoreRegisterTreeItem) {
                          if (((StoreRegisterTreeItem)parts.get(pos)).value instanceof GetMemberTreeItem) {
                            GraphTargetItem obj=((GetMemberTreeItem)((StoreRegisterTreeItem)parts.get(pos)).value).object;
                            if (obj instanceof DirectValueTreeItem) {
                              if (((DirectValueTreeItem)obj).value instanceof RegisterNumber) {
                                if (((RegisterNumber)((DirectValueTreeItem)obj).value).number == classReg) {
                                  instanceReg=((StoreRegisterTreeItem)parts.get(pos)).register.number;
                                }
                              }
                            }
                          }
 else                           if (((StoreRegisterTreeItem)parts.get(pos)).value instanceof NewMethodTreeItem) {
                            if (parts.get(pos + 1) instanceof SetMemberTreeItem) {
                              if (((SetMemberTreeItem)parts.get(pos + 1)).value == ((StoreRegisterTreeItem)parts.get(pos)).value) {
                                instanceReg=((StoreRegisterTreeItem)parts.get(pos)).register.number;
                                NewMethodTreeItem nm=(NewMethodTreeItem)((StoreRegisterTreeItem)parts.get(pos)).value;
                                GetMemberTreeItem gm=new GetMemberTreeItem(null,nm.scriptObject,nm.methodName);
                                extendsOp=gm;
                              }
 else {
                                ok=false;
                                break;
                              }
                            }
 else {
                              ok=false;
                              break;
                            }
                            pos++;
                          }
 else                           if (((StoreRegisterTreeItem)parts.get(pos)).value instanceof NewObjectTreeItem) {
                            if (parts.get(pos + 1) instanceof SetMemberTreeItem) {
                              if (((SetMemberTreeItem)parts.get(pos + 1)).value == ((StoreRegisterTreeItem)parts.get(pos)).value) {
                                instanceReg=((StoreRegisterTreeItem)parts.get(pos)).register.number;
                                NewObjectTreeItem nm=(NewObjectTreeItem)((StoreRegisterTreeItem)parts.get(pos)).value;
                                extendsOp=new GetVariableTreeItem(null,nm.objectName);
                              }
 else {
                                ok=false;
                                break;
                              }
                            }
 else {
                              ok=false;
                              break;
                            }
                            pos++;
                          }
 else {
                            ok=false;
                            break;
                          }
                          if (instanceReg == -1) {
                            ok=false;
                            break;
                          }
                          pos++;
                          if (parts.size() <= pos) {
                            List<GraphTargetItem> output2=new ArrayList<>();
                            for (int i=0; i < prevCount; i++) {
                              output2.add(output.get(i));
                            }
                            output2.add(new ClassTreeItem(className,extendsOp,implementsOp,functions,vars,staticFunctions,staticVars));
                            return output2;
                          }
                          if (parts.size() <= pos) {
                            ok=false;
                            break;
                          }
                          if (parts.get(pos) instanceof ImplementsOpTreeItem) {
                            ImplementsOpTreeItem io=(ImplementsOpTreeItem)parts.get(pos);
                            implementsOp=io.superclasses;
                            pos++;
                          }
                          while ((parts.size() > pos) && ok) {
                            if (parts.get(pos) instanceof ScriptEndItem) {
                              break;
                            }
                            if (parts.get(pos) instanceof SetMemberTreeItem) {
                              SetMemberTreeItem smt=(SetMemberTreeItem)parts.get(pos);
                              if (smt.object instanceof DirectValueTreeItem) {
                                if (((DirectValueTreeItem)smt.object).value instanceof RegisterNumber) {
                                  if (((RegisterNumber)((DirectValueTreeItem)smt.object).value).number == instanceReg) {
                                    if (smt.value instanceof FunctionTreeItem) {
                                      ((FunctionTreeItem)smt.value).calculatedFunctionName=smt.objectName;
                                      functions.add((FunctionTreeItem)smt.value);
                                    }
 else {
                                      vars.put(smt.objectName,smt.value);
                                    }
                                  }
 else                                   if (((RegisterNumber)((DirectValueTreeItem)smt.object).value).number == classReg) {
                                    if (smt.value instanceof FunctionTreeItem) {
                                      ((FunctionTreeItem)smt.value).calculatedFunctionName=smt.objectName;
                                      staticFunctions.add((FunctionTreeItem)smt.value);
                                    }
 else {
                                      staticVars.put(smt.objectName,smt.value);
                                    }
                                  }
 else {
                                    ok=false;
                                  }
                                }
                              }
 else {
                                ok=false;
                              }
                            }
 else                             if (parts.get(pos) instanceof CallFunctionTreeItem) {
                              if (((CallFunctionTreeItem)parts.get(pos)).functionName instanceof DirectValueTreeItem) {
                                if (((DirectValueTreeItem)((CallFunctionTreeItem)parts.get(pos)).functionName).value.equals("String_Node_Str")) {
                                }
 else {
                                  ok=false;
                                }
                              }
 else {
                                ok=false;
                              }
                            }
 else {
                              ok=false;
                              break;
                            }
                            pos++;
                          }
                          if (ok) {
                            List<GraphTargetItem> output2=new ArrayList<>();
                            for (int i=0; i < prevCount; i++) {
                              output2.add(output.get(i));
                            }
                            output2.add(new ClassTreeItem(className,extendsOp,implementsOp,functions,vars,staticFunctions,staticVars));
                            return output2;
                          }
                        }
 else {
                          ok=false;
                        }
                      }
 else {
                        ok=false;
                      }
                    }
 else {
                      ok=false;
                    }
                  }
 else {
                    ok=false;
                  }
                }
 else                 if (parts.get(0) instanceof SetMemberTreeItem) {
                  SetMemberTreeItem sm=(SetMemberTreeItem)parts.get(0);
                  if (sm.value instanceof FunctionTreeItem) {
                    FunctionTreeItem f=(FunctionTreeItem)sm.value;
                    if (f.actions.isEmpty()) {
                      if (parts.size() == 2) {
                        if (parts.get(1) instanceof ImplementsOpTreeItem) {
                          ImplementsOpTreeItem iot=(ImplementsOpTreeItem)parts.get(1);
                          implementsOp=iot.superclasses;
                        }
 else {
                          ok=false;
                          break;
                        }
                      }
                      List<GraphTargetItem> output2=new ArrayList<>();
                      for (int i=0; i < prevCount; i++) {
                        output2.add(output.get(i));
                      }
                      output2.add(new InterfaceTreeItem(sm.objectName,implementsOp));
                      return output2;
                    }
 else {
                      ok=false;
                    }
                  }
 else {
                    ok=false;
                  }
                }
 else {
                  ok=false;
                }
              }
 else {
                ok=false;
              }
            }
          }
 else {
            ok=false;
          }
        }
 else {
          ok=false;
        }
      }
 else {
        ok=false;
      }
    }
 else {
      prevCount++;
    }
    if (!ok) {
      break;
    }
  }
  return output;
}

Fixed version (ground truth):
public static List<GraphTargetItem> checkClass(List<GraphTargetItem> output){
  if (true) {
  }
  List<GraphTargetItem> ret=new ArrayList<>();
  List<GraphTargetItem> functions=new ArrayList<>();
  List<GraphTargetItem> staticFunctions=new ArrayList<>();
  List<KeyValue<GraphTargetItem,GraphTargetItem>> vars=new ArrayList<>();
  List<KeyValue<GraphTargetItem,GraphTargetItem>> staticVars=new ArrayList<>();
  GraphTargetItem className;
  GraphTargetItem extendsOp=null;
  List<GraphTargetItem> implementsOp=new ArrayList<>();
  boolean ok=true;
  int prevCount=0;
  for (  GraphTargetItem t : output) {
    if (t instanceof IfItem) {
      IfItem it=(IfItem)t;
      if (it.expression instanceof NotItem) {
        NotItem nti=(NotItem)it.expression;
        if ((nti.value instanceof GetMemberTreeItem) || (nti.value instanceof GetVariableTreeItem)) {
          if (true) {
            if ((it.onTrue.size() == 1) && (it.onTrue.get(0) instanceof SetMemberTreeItem) && (((SetMemberTreeItem)it.onTrue.get(0)).value instanceof NewObjectTreeItem)) {
            }
 else {
              List<GraphTargetItem> parts=it.onTrue;
              className=getWithoutGlobal(nti.value);
              if (parts.size() >= 1) {
                int ipos=0;
                while ((parts.get(ipos) instanceof IfItem) && ((((IfItem)parts.get(ipos)).onTrue.size() == 1) && (((IfItem)parts.get(ipos)).onTrue.get(0) instanceof SetMemberTreeItem) && (((SetMemberTreeItem)((IfItem)parts.get(ipos)).onTrue.get(0)).value instanceof NewObjectTreeItem))) {
                  ipos++;
                }
                if (parts.get(ipos) instanceof SetMemberTreeItem) {
                  SetMemberTreeItem smt=(SetMemberTreeItem)parts.get(ipos);
                  if (smt.value instanceof StoreRegisterTreeItem) {
                    parts.add(ipos,smt.value);
                    smt.value=((StoreRegisterTreeItem)smt.value).value;
                  }
                }
                if (parts.get(ipos) instanceof StoreRegisterTreeItem) {
                  StoreRegisterTreeItem str1=(StoreRegisterTreeItem)parts.get(ipos);
                  int classReg=str1.register.number;
                  int instanceReg=-1;
                  if ((parts.size() >= ipos + 2) && (parts.get(ipos + 1) instanceof SetMemberTreeItem)) {
                    GraphTargetItem ti1=((SetMemberTreeItem)parts.get(ipos + 1)).value;
                    GraphTargetItem ti2=((StoreRegisterTreeItem)parts.get(ipos + 0)).value;
                    if (ti1 == ti2) {
                      if (((SetMemberTreeItem)parts.get(ipos + 1)).value instanceof FunctionTreeItem) {
                        ((FunctionTreeItem)((SetMemberTreeItem)parts.get(ipos + 1)).value).calculatedFunctionName=(className instanceof GetMemberTreeItem) ? ((GetMemberTreeItem)className).memberName : className;
                        functions.add((FunctionTreeItem)((SetMemberTreeItem)parts.get(ipos + 1)).value);
                        int pos=ipos + 2;
                        if (parts.size() <= pos) {
                          ok=false;
                          break;
                        }
                        if (parts.get(pos) instanceof ExtendsTreeItem) {
                          ExtendsTreeItem et=(ExtendsTreeItem)parts.get(pos);
                          extendsOp=getWithoutGlobal(et.superclass);
                          pos++;
                        }
                        if (parts.size() <= pos) {
                          List<GraphTargetItem> output2=new ArrayList<>();
                          for (int i=0; i < prevCount; i++) {
                            output2.add(output.get(i));
                          }
                          output2.add(new ClassTreeItem(className,extendsOp,implementsOp,functions,vars,staticFunctions,staticVars));
                          return output2;
                        }
                        if (parts.get(pos) instanceof SetMemberTreeItem) {
                          SetMemberTreeItem smt=(SetMemberTreeItem)parts.get(pos);
                          if (smt.value instanceof StoreRegisterTreeItem) {
                            parts.add(pos,smt.value);
                            smt.value=((StoreRegisterTreeItem)smt.value).value;
                          }
                        }
                        if (parts.get(pos) instanceof StoreRegisterTreeItem) {
                          if (((StoreRegisterTreeItem)parts.get(pos)).value instanceof GetMemberTreeItem) {
                            GraphTargetItem obj=((GetMemberTreeItem)((StoreRegisterTreeItem)parts.get(pos)).value).object;
                            if (obj instanceof DirectValueTreeItem) {
                              if (((DirectValueTreeItem)obj).value instanceof RegisterNumber) {
                                if (((RegisterNumber)((DirectValueTreeItem)obj).value).number == classReg) {
                                  instanceReg=((StoreRegisterTreeItem)parts.get(pos)).register.number;
                                }
                              }
                            }
                          }
 else                           if (((StoreRegisterTreeItem)parts.get(pos)).value instanceof NewMethodTreeItem) {
                            if (parts.get(pos + 1) instanceof SetMemberTreeItem) {
                              if (((SetMemberTreeItem)parts.get(pos + 1)).value == ((StoreRegisterTreeItem)parts.get(pos)).value) {
                                instanceReg=((StoreRegisterTreeItem)parts.get(pos)).register.number;
                                NewMethodTreeItem nm=(NewMethodTreeItem)((StoreRegisterTreeItem)parts.get(pos)).value;
                                GetMemberTreeItem gm=new GetMemberTreeItem(null,nm.scriptObject,nm.methodName);
                                extendsOp=gm;
                              }
 else {
                                ok=false;
                                break;
                              }
                            }
 else {
                              ok=false;
                              break;
                            }
                            pos++;
                          }
 else                           if (((StoreRegisterTreeItem)parts.get(pos)).value instanceof NewObjectTreeItem) {
                            if (parts.get(pos + 1) instanceof SetMemberTreeItem) {
                              if (((SetMemberTreeItem)parts.get(pos + 1)).value == ((StoreRegisterTreeItem)parts.get(pos)).value) {
                                instanceReg=((StoreRegisterTreeItem)parts.get(pos)).register.number;
                                NewObjectTreeItem nm=(NewObjectTreeItem)((StoreRegisterTreeItem)parts.get(pos)).value;
                                extendsOp=new GetVariableTreeItem(null,nm.objectName);
                              }
 else {
                                ok=false;
                                break;
                              }
                            }
 else {
                              ok=false;
                              break;
                            }
                            pos++;
                          }
 else {
                            ok=false;
                            break;
                          }
                          if (instanceReg == -1) {
                            ok=false;
                            break;
                          }
                          pos++;
                          if (parts.size() <= pos) {
                            List<GraphTargetItem> output2=new ArrayList<>();
                            for (int i=0; i < prevCount; i++) {
                              output2.add(output.get(i));
                            }
                            output2.add(new ClassTreeItem(className,extendsOp,implementsOp,functions,vars,staticFunctions,staticVars));
                            return output2;
                          }
                          if (parts.size() <= pos) {
                            ok=false;
                            break;
                          }
                          if (parts.get(pos) instanceof ImplementsOpTreeItem) {
                            ImplementsOpTreeItem io=(ImplementsOpTreeItem)parts.get(pos);
                            implementsOp=io.superclasses;
                            pos++;
                          }
                          while ((parts.size() > pos) && ok) {
                            if (parts.get(pos) instanceof ScriptEndItem) {
                              break;
                            }
                            if (parts.get(pos) instanceof SetMemberTreeItem) {
                              SetMemberTreeItem smt=(SetMemberTreeItem)parts.get(pos);
                              if (smt.object instanceof DirectValueTreeItem) {
                                if (((DirectValueTreeItem)smt.object).value instanceof RegisterNumber) {
                                  if (((RegisterNumber)((DirectValueTreeItem)smt.object).value).number == instanceReg) {
                                    if (smt.value instanceof FunctionTreeItem) {
                                      ((FunctionTreeItem)smt.value).calculatedFunctionName=smt.objectName;
                                      functions.add((FunctionTreeItem)smt.value);
                                    }
 else {
                                      vars.add(new KeyValue<>(smt.objectName,smt.value));
                                    }
                                  }
 else                                   if (((RegisterNumber)((DirectValueTreeItem)smt.object).value).number == classReg) {
                                    if (smt.value instanceof FunctionTreeItem) {
                                      ((FunctionTreeItem)smt.value).calculatedFunctionName=smt.objectName;
                                      staticFunctions.add((FunctionTreeItem)smt.value);
                                    }
 else {
                                      staticVars.add(new KeyValue<>(smt.objectName,smt.value));
                                    }
                                  }
 else {
                                    ok=false;
                                  }
                                }
                              }
 else {
                                ok=false;
                              }
                            }
 else                             if (parts.get(pos) instanceof CallFunctionTreeItem) {
                              if (((CallFunctionTreeItem)parts.get(pos)).functionName instanceof DirectValueTreeItem) {
                                if (((DirectValueTreeItem)((CallFunctionTreeItem)parts.get(pos)).functionName).value.equals("String_Node_Str")) {
                                }
 else {
                                  ok=false;
                                }
                              }
 else {
                                ok=false;
                              }
                            }
 else {
                              ok=false;
                              break;
                            }
                            pos++;
                          }
                          if (ok) {
                            List<GraphTargetItem> output2=new ArrayList<>();
                            for (int i=0; i < prevCount; i++) {
                              output2.add(output.get(i));
                            }
                            output2.add(new ClassTreeItem(className,extendsOp,implementsOp,functions,vars,staticFunctions,staticVars));
                            return output2;
                          }
                        }
 else {
                          ok=false;
                        }
                      }
 else {
                        ok=false;
                      }
                    }
 else {
                      ok=false;
                    }
                  }
 else {
                    ok=false;
                  }
                }
 else                 if (parts.get(0) instanceof SetMemberTreeItem) {
                  SetMemberTreeItem sm=(SetMemberTreeItem)parts.get(0);
                  if (sm.value instanceof FunctionTreeItem) {
                    FunctionTreeItem f=(FunctionTreeItem)sm.value;
                    if (f.actions.isEmpty()) {
                      if (parts.size() == 2) {
                        if (parts.get(1) instanceof ImplementsOpTreeItem) {
                          ImplementsOpTreeItem iot=(ImplementsOpTreeItem)parts.get(1);
                          implementsOp=iot.superclasses;
                        }
 else {
                          ok=false;
                          break;
                        }
                      }
                      List<GraphTargetItem> output2=new ArrayList<>();
                      for (int i=0; i < prevCount; i++) {
                        output2.add(output.get(i));
                      }
                      output2.add(new InterfaceTreeItem(sm.objectName,implementsOp));
                      return output2;
                    }
 else {
                      ok=false;
                    }
                  }
 else {
                    ok=false;
                  }
                }
 else {
                  ok=false;
                }
              }
 else {
                ok=false;
              }
            }
          }
 else {
            ok=false;
          }
        }
 else {
          ok=false;
        }
      }
 else {
        ok=false;
      }
    }
 else {
      prevCount++;
    }
    if (!ok) {
      break;
    }
  }
  return output;
}