Program: 61728
Project: 61728
Buggy source:
@Override public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData,SourceGenerator generator) throws CompilationException {
  Set<String> usedNames=new HashSet<>();
  for (  VariableActionItem v : variables) {
    usedNames.add(v.getVariableName());
  }
  List<GraphSourceItem> ret=new ArrayList<>();
  ActionSourceGenerator asGenerator=(ActionSourceGenerator)generator;
  List<Integer> paramRegs=new ArrayList<>();
  SourceGeneratorLocalData localDataCopy=Helper.deepCopy(localData);
  localDataCopy.inFunction++;
  boolean preloadParentFlag=false;
  boolean preloadRootFlag=false;
  boolean preloadSuperFlag=false;
  boolean preloadArgumentsFlag=false;
  boolean preloadThisFlag=false;
  boolean preloadGlobalFlag=false;
  boolean suppressParentFlag=false;
  boolean suppressArgumentsFlag=false;
  boolean suppressThisFlag=false;
  boolean needsFun2=false;
  List<String> registerNames=new ArrayList<>();
  registerNames.add("String_Node_Str");
  if (usedNames.contains("String_Node_Str")) {
    needsFun2=true;
    preloadThisFlag=true;
    registerNames.add("String_Node_Str");
  }
 else {
    suppressThisFlag=true;
  }
  if (usedNames.contains("String_Node_Str")) {
    preloadArgumentsFlag=true;
    needsFun2=true;
    registerNames.add("String_Node_Str");
  }
 else {
    suppressArgumentsFlag=true;
  }
  if (usedNames.contains("String_Node_Str")) {
    preloadSuperFlag=true;
    needsFun2=true;
    registerNames.add("String_Node_Str");
  }
  if (usedNames.contains("String_Node_Str")) {
    preloadRootFlag=true;
    needsFun2=true;
    registerNames.add("String_Node_Str");
  }
  if (usedNames.contains("String_Node_Str")) {
    preloadParentFlag=true;
    needsFun2=true;
    registerNames.add("String_Node_Str");
  }
 else {
    suppressParentFlag=true;
  }
  if (usedNames.contains("String_Node_Str")) {
    needsFun2=true;
    preloadGlobalFlag=true;
    registerNames.add("String_Node_Str");
  }
  int preloadedNumber=registerNames.size();
  if (!paramNames.isEmpty()) {
    needsFun2=true;
  }
  if (localData.inMethod) {
    needsFun2=true;
  }
  if (localData.inFunction > 1) {
    needsFun2=true;
  }
  if (needsFun2) {
    for (int i=0; i < paramNames.size(); i++) {
      paramRegs.add(registerNames.size());
      registerNames.add(paramNames.get(i));
    }
  }
  if (actions != null && !actions.isEmpty()) {
    localDataCopy.inFunction++;
    for (    VariableActionItem v : variables) {
      String varName=v.getVariableName();
      GraphTargetItem stored=v.getStoreValue();
      if (needsFun2) {
        if (v.isDefinition() && !registerNames.contains(varName)) {
          registerNames.add(varName);
        }
      }
      if (registerNames.contains(varName)) {
        if (stored != null) {
          v.setBoxedValue(new StoreRegisterActionItem(null,new RegisterNumber(registerNames.indexOf(varName),varName),stored,false));
        }
 else {
          v.setBoxedValue(new DirectValueActionItem(new RegisterNumber(registerNames.indexOf(varName),varName)));
        }
      }
 else {
        if (v.isDefinition()) {
          v.setBoxedValue(new DefineLocalActionItem(null,((ActionSourceGenerator)generator).pushConstTargetItem(varName),stored));
        }
 else {
          if (stored != null) {
            v.setBoxedValue(new SetVariableActionItem(null,((ActionSourceGenerator)generator).pushConstTargetItem(varName),stored));
          }
 else {
            v.setBoxedValue(new GetVariableActionItem(null,((ActionSourceGenerator)generator).pushConstTargetItem(varName)));
          }
        }
      }
    }
    ret.addAll(asGenerator.toActionList(asGenerator.generate(localDataCopy,actions)));
  }
  int len=Action.actionsToBytes(asGenerator.toActionList(ret),false,SWF.DEFAULT_VERSION).length;
  if (!needsFun2 && paramNames.isEmpty()) {
    ret.add(0,new ActionDefineFunction(functionName,paramNames,len,SWF.DEFAULT_VERSION));
  }
 else {
    ret.add(0,new ActionDefineFunction2(functionName,preloadParentFlag,preloadRootFlag,suppressParentFlag,preloadSuperFlag,suppressArgumentsFlag,preloadArgumentsFlag,suppressThisFlag,preloadThisFlag,preloadGlobalFlag,registerNames.size() - 1,len,SWF.DEFAULT_VERSION,paramNames,paramRegs));
  }
  return ret;
}

Fixed version (ground truth):
@Override public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData,SourceGenerator generator) throws CompilationException {
  Set<String> usedNames=new HashSet<>();
  for (  VariableActionItem v : variables) {
    usedNames.add(v.getVariableName());
  }
  List<GraphSourceItem> ret=new ArrayList<>();
  ActionSourceGenerator asGenerator=(ActionSourceGenerator)generator;
  List<Integer> paramRegs=new ArrayList<>();
  SourceGeneratorLocalData localDataCopy=Helper.deepCopy(localData);
  localDataCopy.inFunction++;
  boolean preloadParentFlag=false;
  boolean preloadRootFlag=false;
  boolean preloadSuperFlag=false;
  boolean preloadArgumentsFlag=false;
  boolean preloadThisFlag=false;
  boolean preloadGlobalFlag=false;
  boolean suppressParentFlag=false;
  boolean suppressArgumentsFlag=false;
  boolean suppressThisFlag=false;
  boolean needsFun2=false;
  List<String> registerNames=new ArrayList<>();
  registerNames.add("String_Node_Str");
  if (usedNames.contains("String_Node_Str")) {
    needsFun2=true;
    preloadThisFlag=true;
    registerNames.add("String_Node_Str");
  }
 else {
    suppressThisFlag=true;
  }
  if (usedNames.contains("String_Node_Str")) {
    preloadArgumentsFlag=true;
    needsFun2=true;
    registerNames.add("String_Node_Str");
  }
 else {
    suppressArgumentsFlag=true;
  }
  if (usedNames.contains("String_Node_Str")) {
    preloadSuperFlag=true;
    needsFun2=true;
    registerNames.add("String_Node_Str");
  }
  if (usedNames.contains("String_Node_Str")) {
    preloadRootFlag=true;
    needsFun2=true;
    registerNames.add("String_Node_Str");
  }
  if (usedNames.contains("String_Node_Str")) {
    preloadParentFlag=true;
    needsFun2=true;
    registerNames.add("String_Node_Str");
  }
 else {
    suppressParentFlag=true;
  }
  if (usedNames.contains("String_Node_Str")) {
    needsFun2=true;
    preloadGlobalFlag=true;
    registerNames.add("String_Node_Str");
  }
  int preloadedNumber=registerNames.size();
  if (!paramNames.isEmpty()) {
    needsFun2=true;
  }
  if (localData.inMethod) {
    needsFun2=true;
  }
  if (localData.inFunction > 1) {
    needsFun2=true;
  }
  if (needsFun2) {
    for (int i=0; i < paramNames.size(); i++) {
      paramRegs.add(registerNames.size());
      registerNames.add(paramNames.get(i));
    }
  }
  if (actions != null && !actions.isEmpty()) {
    localDataCopy.inFunction++;
    for (    VariableActionItem v : variables) {
      String varName=v.getVariableName();
      GraphTargetItem stored=v.getStoreValue();
      if (needsFun2) {
        if (v.isDefinition() && !registerNames.contains(varName)) {
          registerNames.add(varName);
        }
      }
      if (registerNames.contains(varName)) {
        if (stored != null) {
          v.setBoxedValue(new StoreRegisterActionItem(null,new RegisterNumber(registerNames.indexOf(varName),varName),stored,false));
        }
 else {
          v.setBoxedValue(new DirectValueActionItem(new RegisterNumber(registerNames.indexOf(varName),varName)));
        }
      }
 else {
        if (v.isDefinition()) {
          v.setBoxedValue(new DefineLocalActionItem(null,((ActionSourceGenerator)generator).pushConstTargetItem(varName),stored));
        }
 else {
          if (stored != null) {
            v.setBoxedValue(new SetVariableActionItem(null,((ActionSourceGenerator)generator).pushConstTargetItem(varName),stored));
          }
 else {
            v.setBoxedValue(new GetVariableActionItem(null,((ActionSourceGenerator)generator).pushConstTargetItem(varName)));
          }
        }
      }
    }
    ret.addAll(asGenerator.toActionList(asGenerator.generate(localDataCopy,actions)));
  }
  int len=Action.actionsToBytes(asGenerator.toActionList(ret),false,SWF.DEFAULT_VERSION).length;
  if (!needsFun2 && paramNames.isEmpty()) {
    ret.add(0,new ActionDefineFunction(functionName,paramNames,len,SWF.DEFAULT_VERSION));
  }
 else {
    ret.add(0,new ActionDefineFunction2(functionName,preloadParentFlag,preloadRootFlag,suppressParentFlag,preloadSuperFlag,suppressArgumentsFlag,preloadArgumentsFlag,suppressThisFlag,preloadThisFlag,preloadGlobalFlag,registerNames.size(),len,SWF.DEFAULT_VERSION,paramNames,paramRegs));
  }
  return ret;
}