Program: 62211
Project: 62211
Buggy source:
public static List<GraphTargetItem> checkClass(List<GraphTargetItem> output){
  List<GraphTargetItem> ret=new ArrayList<GraphTargetItem>();
  List<GraphTargetItem> functions=new ArrayList<GraphTargetItem>();
  List<GraphTargetItem> staticFunctions=new ArrayList<GraphTargetItem>();
  HashMap<GraphTargetItem,GraphTargetItem> vars=new HashMap<GraphTargetItem,GraphTargetItem>();
  HashMap<GraphTargetItem,GraphTargetItem> staticVars=new HashMap<GraphTargetItem,GraphTargetItem>();
  GraphTargetItem className;
  GraphTargetItem extendsOp=null;
  List<GraphTargetItem> implementsOp=new ArrayList<GraphTargetItem>();
  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) {
          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((GetMemberTreeItem)nti.value);
              if (parts.size() >= 1) {
                if (parts.get(0) instanceof StoreRegisterTreeItem) {
                  int classReg=((StoreRegisterTreeItem)parts.get(0)).register.number;
                  if ((parts.size() >= 2) && (parts.get(1) instanceof SetMemberTreeItem)) {
                    GraphTargetItem ti1=((SetMemberTreeItem)parts.get(1)).value;
                    GraphTargetItem ti2=((StoreRegisterTreeItem)parts.get(0)).value;
                    if (ti1 == ti2) {
                      if (((SetMemberTreeItem)parts.get(1)).value instanceof FunctionTreeItem) {
                        ((FunctionTreeItem)((SetMemberTreeItem)parts.get(1)).value).calculatedFunctionName=(className instanceof GetMemberTreeItem) ? ((GetMemberTreeItem)className).memberName : className;
                        functions.add((FunctionTreeItem)((SetMemberTreeItem)parts.get(1)).value);
                        int pos=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<GraphTargetItem>();
                          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 StoreRegisterTreeItem) {
                          int instanceReg=-1;
                          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) {
                            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 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<GraphTargetItem>();
                            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<GraphTargetItem>();
                      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) {
    return output;
  }
  List<GraphTargetItem> ret=new ArrayList<GraphTargetItem>();
  List<GraphTargetItem> functions=new ArrayList<GraphTargetItem>();
  List<GraphTargetItem> staticFunctions=new ArrayList<GraphTargetItem>();
  HashMap<GraphTargetItem,GraphTargetItem> vars=new HashMap<GraphTargetItem,GraphTargetItem>();
  HashMap<GraphTargetItem,GraphTargetItem> staticVars=new HashMap<GraphTargetItem,GraphTargetItem>();
  GraphTargetItem className;
  GraphTargetItem extendsOp=null;
  List<GraphTargetItem> implementsOp=new ArrayList<GraphTargetItem>();
  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) {
          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((GetMemberTreeItem)nti.value);
              if (parts.size() >= 1) {
                if (parts.get(0) instanceof StoreRegisterTreeItem) {
                  int classReg=((StoreRegisterTreeItem)parts.get(0)).register.number;
                  if ((parts.size() >= 2) && (parts.get(1) instanceof SetMemberTreeItem)) {
                    GraphTargetItem ti1=((SetMemberTreeItem)parts.get(1)).value;
                    GraphTargetItem ti2=((StoreRegisterTreeItem)parts.get(0)).value;
                    if (ti1 == ti2) {
                      if (((SetMemberTreeItem)parts.get(1)).value instanceof FunctionTreeItem) {
                        ((FunctionTreeItem)((SetMemberTreeItem)parts.get(1)).value).calculatedFunctionName=(className instanceof GetMemberTreeItem) ? ((GetMemberTreeItem)className).memberName : className;
                        functions.add((FunctionTreeItem)((SetMemberTreeItem)parts.get(1)).value);
                        int pos=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<GraphTargetItem>();
                          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 StoreRegisterTreeItem) {
                          int instanceReg=-1;
                          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) {
                            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 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<GraphTargetItem>();
                            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<GraphTargetItem>();
                      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;
}