Program: 62207
Project: 62207
Buggy source:
public ConvertOutput toSourceOutput(boolean processJumps,boolean isStatic,int classIndex,java.util.HashMap<Integer,GraphTargetItem> localRegs,Stack<GraphTargetItem> stack,Stack<GraphTargetItem> scopeStack,ABC abc,ConstantPool constants,MethodInfo method_info[],MethodBody body,int start,int end,HashMap<Integer,String> localRegNames,List<String> fullyQualifiedNames,boolean visited[]) throws ConvertException {
  boolean debugMode=DEBUG_MODE;
  if (debugMode) {
    System.out.println("String_Node_Str" + start + "String_Node_Str"+ end+ "String_Node_Str"+ code.get(start).toString()+ "String_Node_Str"+ code.get(end).toString());
  }
  if (visited == null) {
    visited=new boolean[code.size()];
  }
  toSourceCount++;
  if (toSourceLimit > 0) {
    if (toSourceCount > toSourceLimit) {
      throw new ConvertException("String_Node_Str" + toSourceLimit + "String_Node_Str",start);
    }
  }
  List<GraphTargetItem> output=new ArrayList<GraphTargetItem>();
  String ret="String_Node_Str";
  int ip=start;
  try {
    int addr;
    iploop:     while (ip <= end) {
      if (ignoredIns.contains(ip)) {
        ip++;
        continue;
      }
      boolean processTry=processJumps;
      addr=pos2adr(ip);
      int ipfix=fixIPAfterDebugLine(ip);
      int addrfix=pos2adr(ipfix);
      int maxend=-1;
      if (processTry) {
        List<ABCException> catchedExceptions=new ArrayList<ABCException>();
        for (int e=0; e < body.exceptions.length; e++) {
          if (addrfix == fixAddrAfterDebugLine(body.exceptions[e].start)) {
            if (!body.exceptions[e].isFinally()) {
              if ((fixAddrAfterDebugLine(body.exceptions[e].end) > maxend) && (!parsedExceptions.contains(body.exceptions[e]))) {
                catchedExceptions.clear();
                maxend=fixAddrAfterDebugLine(body.exceptions[e].end);
                catchedExceptions.add(body.exceptions[e]);
              }
 else               if (fixAddrAfterDebugLine(body.exceptions[e].end) == maxend) {
                catchedExceptions.add(body.exceptions[e]);
              }
            }
          }
        }
        if (catchedExceptions.size() > 0) {
          ip=ipfix;
          addr=addrfix;
          parsedExceptions.addAll(catchedExceptions);
          int endpos=adr2pos(fixAddrAfterDebugLine(catchedExceptions.get(0).end));
          List<List<GraphTargetItem>> catchedCommands=new ArrayList<List<GraphTargetItem>>();
          if (code.get(endpos).definition instanceof JumpIns) {
            int afterCatchAddr=pos2adr(endpos + 1) + code.get(endpos).operands[0];
            int afterCatchPos=adr2pos(afterCatchAddr);
            Collections.sort(catchedExceptions,new Comparator<ABCException>(){
              @Override public int compare(              ABCException o1,              ABCException o2){
                try {
                  return fixAddrAfterDebugLine(o1.target) - fixAddrAfterDebugLine(o2.target);
                }
 catch (                ConvertException ex) {
                  return 0;
                }
              }
            }
);
            List<GraphTargetItem> finallyCommands=new ArrayList<GraphTargetItem>();
            int returnPos=afterCatchPos;
            for (int e=0; e < body.exceptions.length; e++) {
              if (body.exceptions[e].isFinally()) {
                if (addr == fixAddrAfterDebugLine(body.exceptions[e].start)) {
                  if (afterCatchPos + 1 == adr2pos(fixAddrAfterDebugLine(body.exceptions[e].end))) {
                    AVM2Instruction jmpIns=code.get(adr2pos(fixAddrAfterDebugLine(body.exceptions[e].end)));
                    if (jmpIns.definition instanceof JumpIns) {
                      int finStart=adr2pos(fixAddrAfterDebugLine(body.exceptions[e].end) + jmpIns.getBytes().length + jmpIns.operands[0]);
                      finallyJumps.add(finStart);
                      if (unknownJumps.contains(finStart)) {
                        unknownJumps.remove((Integer)finStart);
                      }
                      for (int f=finStart; f <= end; f++) {
                        if (code.get(f).definition instanceof LookupSwitchIns) {
                          AVM2Instruction swins=code.get(f);
                          if (swins.operands.length >= 3) {
                            if (swins.operands[0] == swins.getBytes().length) {
                              if (adr2pos(pos2adr(f) + swins.operands[2]) < finStart) {
                                finallyCommands=toSourceOutput(processJumps,isStatic,classIndex,localRegs,stack,scopeStack,abc,constants,method_info,body,finStart,f - 1,localRegNames,fullyQualifiedNames,visited).output;
                                returnPos=f + 1;
                                break;
                              }
                            }
                          }
                        }
                      }
                      break;
                    }
                  }
                }
              }
            }
            for (int e=0; e < catchedExceptions.size(); e++) {
              int eendpos;
              if (e < catchedExceptions.size() - 1) {
                eendpos=adr2pos(fixAddrAfterDebugLine(catchedExceptions.get(e + 1).target)) - 2;
              }
 else {
                eendpos=afterCatchPos - 1;
              }
              Stack<GraphTargetItem> substack=new Stack<GraphTargetItem>();
              substack.add(new ExceptionTreeItem(catchedExceptions.get(e)));
              catchedCommands.add(toSourceOutput(processJumps,isStatic,classIndex,localRegs,substack,new Stack<GraphTargetItem>(),abc,constants,method_info,body,adr2pos(fixAddrAfterDebugLine(catchedExceptions.get(e).target)),eendpos,localRegNames,fullyQualifiedNames,visited).output);
            }
            List<GraphTargetItem> tryCommands=toSourceOutput(processJumps,isStatic,classIndex,localRegs,stack,scopeStack,abc,constants,method_info,body,ip,endpos - 1,localRegNames,fullyQualifiedNames,visited).output;
            output.add(new TryTreeItem(tryCommands,catchedExceptions,catchedCommands,finallyCommands));
            ip=returnPos;
            addr=pos2adr(ip);
          }
        }
      }
      if (ip > end) {
        break;
      }
      if (unknownJumps.contains(ip)) {
        unknownJumps.remove(new Integer(ip));
        throw new UnknownJumpException(stack,ip,output);
      }
      if (visited[ip]) {
        Logger.getLogger(AVM2Code.class.getName()).warning("String_Node_Str" + Helper.formatAddress(pos2adr(ip)) + "String_Node_Str"+ ip);
        break;
      }
      visited[ip]=true;
      AVM2Instruction ins=code.get(ip);
      if (debugMode) {
        System.err.println("String_Node_Str" + ip + "String_Node_Str"+ ins.toString()+ "String_Node_Str"+ Highlighting.stripHilights(stack.toString())+ "String_Node_Str"+ Highlighting.stripHilights(scopeStack.toString()));
      }
      if (ins.definition instanceof NewFunctionIns) {
        if (ip + 1 <= end) {
          if (code.get(ip + 1).definition instanceof PopIns) {
            ip+=2;
            continue;
          }
        }
      }
      if ((ip + 8 < code.size())) {
        if (ins.definition instanceof SetLocalTypeIns) {
          if (code.get(ip + 1).definition instanceof PushByteIns) {
            AVM2Instruction jmp=code.get(ip + 2);
            if (jmp.definition instanceof JumpIns) {
              if (jmp.operands[0] == 0) {
                if (code.get(ip + 3).definition instanceof LabelIns) {
                  if (code.get(ip + 4).definition instanceof PopIns) {
                    if (code.get(ip + 5).definition instanceof LabelIns) {
                      AVM2Instruction gl=code.get(ip + 6);
                      if (gl.definition instanceof GetLocalTypeIns) {
                        if (((GetLocalTypeIns)gl.definition).getRegisterId(gl) == ((SetLocalTypeIns)ins.definition).getRegisterId(ins)) {
                          AVM2Instruction ki=code.get(ip + 7);
                          if (ki.definition instanceof KillIns) {
                            if (ki.operands[0] == ((SetLocalTypeIns)ins.definition).getRegisterId(ins)) {
                              if (code.get(ip + 8).definition instanceof ReturnValueIns) {
                                ip=ip + 8;
                                continue;
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      if ((ins.definition instanceof GetLocalTypeIns) && (!output.isEmpty()) && (output.get(output.size() - 1) instanceof SetLocalTreeItem)&& (((SetLocalTreeItem)output.get(output.size() - 1)).regIndex == ((GetLocalTypeIns)ins.definition).getRegisterId(ins))&& isKilled(((SetLocalTreeItem)output.get(output.size() - 1)).regIndex,start,end)) {
        SetLocalTreeItem slt=(SetLocalTreeItem)output.remove(output.size() - 1);
        stack.push(slt.getValue());
        ip++;
      }
 else       if ((ins.definition instanceof SetLocalTypeIns) && (ip + 1 <= end) && (isKilled(((SetLocalTypeIns)ins.definition).getRegisterId(ins),ip,end))) {
        AVM2Instruction insAfter=code.get(ip + 1);
        if ((insAfter.definition instanceof GetLocalTypeIns) && (((GetLocalTypeIns)insAfter.definition).getRegisterId(insAfter) == ((SetLocalTypeIns)ins.definition).getRegisterId(ins))) {
          GraphTargetItem before=stack.peek();
          ins.definition.translate(isStatic,classIndex,localRegs,stack,scopeStack,constants,ins,method_info,output,body,abc,localRegNames,fullyQualifiedNames);
          stack.push(before);
          ip+=2;
          continue iploop;
        }
 else {
          ins.definition.translate(isStatic,classIndex,localRegs,stack,scopeStack,constants,ins,method_info,output,body,abc,localRegNames,fullyQualifiedNames);
          ip++;
          continue iploop;
        }
      }
 else       if (ins.definition instanceof DupIns) {
        int nextPos;
        do {
          AVM2Instruction insAfter=code.get(ip + 1);
          AVM2Instruction insBefore=ins;
          if (ip - 1 >= start) {
            insBefore=code.get(ip - 1);
          }
          if (insAfter.definition instanceof ConvertBIns) {
            ip++;
            addr=pos2adr(ip);
            insAfter=code.get(ip + 1);
          }
          boolean isAnd;
          if (processJumps && (insAfter.definition instanceof IfFalseIns)) {
            isAnd=true;
          }
 else           if (processJumps && (insAfter.definition instanceof IfTrueIns)) {
            isAnd=false;
          }
 else           if (insAfter.definition instanceof SetLocalTypeIns) {
            int reg=(((SetLocalTypeIns)insAfter.definition).getRegisterId(insAfter));
            for (int t=ip + 1; t <= end - 1; t++) {
              if (code.get(t).definition instanceof KillIns) {
                if (code.get(t).operands[0] == reg) {
                  break;
                }
              }
              if (code.get(t).definition instanceof GetLocalTypeIns) {
                if (((GetLocalTypeIns)code.get(t).definition).getRegisterId(code.get(t)) == reg) {
                  if (code.get(t + 1).definition instanceof KillIns) {
                    if (code.get(t + 1).operands[0] == reg) {
                      ConvertOutput assignment=toSourceOutput(processJumps,isStatic,classIndex,localRegs,stack,scopeStack,abc,constants,method_info,body,ip + 2,t - 1,localRegNames,fullyQualifiedNames,visited);
                      stack.push(assignment.output.remove(assignment.output.size() - 1));
                      ip=t + 2;
                      continue iploop;
                    }
                  }
                }
              }
            }
            if (!isKilled(reg,0,end)) {
              for (int i=ip; i >= start; i--) {
                if (code.get(i).definition instanceof DupIns) {
                  GraphTargetItem v=stack.pop();
                  stack.push(new LocalRegTreeItem(ins,reg,v));
                  stack.push(v);
                }
 else {
                  break;
                }
              }
            }
 else {
              ins.definition.translate(isStatic,classIndex,localRegs,stack,scopeStack,constants,ins,method_info,output,body,abc,localRegNames,fullyQualifiedNames);
            }
            ip++;
            break;
          }
 else {
            ins.definition.translate(isStatic,classIndex,localRegs,stack,scopeStack,constants,ins,method_info,output,body,abc,localRegNames,fullyQualifiedNames);
            ip++;
            break;
          }
        }
 while (ins.definition instanceof DupIns);
      }
 else       if ((ins.definition instanceof ReturnValueIns) || (ins.definition instanceof ReturnVoidIns) || (ins.definition instanceof ThrowIns)) {
        ins.definition.translate(isStatic,classIndex,localRegs,stack,scopeStack,constants,ins,method_info,output,body,abc,localRegNames,fullyQualifiedNames);
        ip=end + 1;
        break;
      }
 else       if (ins.definition instanceof NewFunctionIns) {
        String functionName="String_Node_Str";
        if ((ip >= start + 2) && (ip <= end - 4)) {
          AVM2Instruction prev2=code.get(ip - 2);
          if (prev2.definition instanceof NewObjectIns) {
            if (prev2.operands[0] == 0) {
              if (code.get(ip - 1).definition instanceof PushWithIns) {
                boolean hasDup=false;
                int plus=0;
                if (code.get(ip + 1).definition instanceof DupIns) {
                  hasDup=true;
                  plus=1;
                }
                AVM2Instruction psco=code.get(ip + 1 + plus);
                if (psco.definition instanceof GetScopeObjectIns) {
                  if (psco.operands[0] == scopeStack.size() - 1) {
                    if (code.get(ip + plus + 2).definition instanceof SwapIns) {
                      if (code.get(ip + plus + 4).definition instanceof PopScopeIns) {
                        if (code.get(ip + plus + 3).definition instanceof SetPropertyIns) {
                          functionName=abc.constants.constant_multiname[code.get(ip + plus + 3).operands[0]].getName(constants,fullyQualifiedNames);
                          scopeStack.pop();
                          output.remove(output.size() - 1);
                          ip=ip + plus + 4;
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
        ins.definition.translate(isStatic,classIndex,localRegs,stack,scopeStack,constants,ins,method_info,output,body,abc,localRegNames,fullyQualifiedNames);
        NewFunctionTreeItem nft=(NewFunctionTreeItem)stack.peek();
        nft.functionName=functionName;
        ip++;
      }
 else {
        ins.definition.translate(isStatic,classIndex,localRegs,stack,scopeStack,constants,ins,method_info,output,body,abc,localRegNames,fullyQualifiedNames);
        ip++;
        addr=pos2adr(ip);
      }
    }
    if (debugMode) {
      System.out.println("String_Node_Str" + start + "String_Node_Str"+ end+ "String_Node_Str"+ code.get(start).toString()+ "String_Node_Str"+ code.get(end).toString());
    }
    return new ConvertOutput(stack,output);
  }
 catch (  ConvertException cex) {
    throw cex;
  }
}

Fixed version (ground truth):
public ConvertOutput toSourceOutput(boolean processJumps,boolean isStatic,int scriptIndex,int classIndex,java.util.HashMap<Integer,GraphTargetItem> localRegs,Stack<GraphTargetItem> stack,Stack<GraphTargetItem> scopeStack,ABC abc,ConstantPool constants,MethodInfo method_info[],MethodBody body,int start,int end,HashMap<Integer,String> localRegNames,List<String> fullyQualifiedNames,boolean visited[]) throws ConvertException {
  boolean debugMode=DEBUG_MODE;
  if (debugMode) {
    System.out.println("String_Node_Str" + start + "String_Node_Str"+ end+ "String_Node_Str"+ code.get(start).toString()+ "String_Node_Str"+ code.get(end).toString());
  }
  if (visited == null) {
    visited=new boolean[code.size()];
  }
  toSourceCount++;
  if (toSourceLimit > 0) {
    if (toSourceCount > toSourceLimit) {
      throw new ConvertException("String_Node_Str" + toSourceLimit + "String_Node_Str",start);
    }
  }
  List<GraphTargetItem> output=new ArrayList<GraphTargetItem>();
  String ret="String_Node_Str";
  int ip=start;
  try {
    int addr;
    iploop:     while (ip <= end) {
      if (ignoredIns.contains(ip)) {
        ip++;
        continue;
      }
      boolean processTry=processJumps;
      addr=pos2adr(ip);
      int ipfix=fixIPAfterDebugLine(ip);
      int addrfix=pos2adr(ipfix);
      int maxend=-1;
      if (processTry) {
        List<ABCException> catchedExceptions=new ArrayList<ABCException>();
        for (int e=0; e < body.exceptions.length; e++) {
          if (addrfix == fixAddrAfterDebugLine(body.exceptions[e].start)) {
            if (!body.exceptions[e].isFinally()) {
              if ((fixAddrAfterDebugLine(body.exceptions[e].end) > maxend) && (!parsedExceptions.contains(body.exceptions[e]))) {
                catchedExceptions.clear();
                maxend=fixAddrAfterDebugLine(body.exceptions[e].end);
                catchedExceptions.add(body.exceptions[e]);
              }
 else               if (fixAddrAfterDebugLine(body.exceptions[e].end) == maxend) {
                catchedExceptions.add(body.exceptions[e]);
              }
            }
          }
        }
        if (catchedExceptions.size() > 0) {
          ip=ipfix;
          addr=addrfix;
          parsedExceptions.addAll(catchedExceptions);
          int endpos=adr2pos(fixAddrAfterDebugLine(catchedExceptions.get(0).end));
          List<List<GraphTargetItem>> catchedCommands=new ArrayList<List<GraphTargetItem>>();
          if (code.get(endpos).definition instanceof JumpIns) {
            int afterCatchAddr=pos2adr(endpos + 1) + code.get(endpos).operands[0];
            int afterCatchPos=adr2pos(afterCatchAddr);
            Collections.sort(catchedExceptions,new Comparator<ABCException>(){
              @Override public int compare(              ABCException o1,              ABCException o2){
                try {
                  return fixAddrAfterDebugLine(o1.target) - fixAddrAfterDebugLine(o2.target);
                }
 catch (                ConvertException ex) {
                  return 0;
                }
              }
            }
);
            List<GraphTargetItem> finallyCommands=new ArrayList<GraphTargetItem>();
            int returnPos=afterCatchPos;
            for (int e=0; e < body.exceptions.length; e++) {
              if (body.exceptions[e].isFinally()) {
                if (addr == fixAddrAfterDebugLine(body.exceptions[e].start)) {
                  if (afterCatchPos + 1 == adr2pos(fixAddrAfterDebugLine(body.exceptions[e].end))) {
                    AVM2Instruction jmpIns=code.get(adr2pos(fixAddrAfterDebugLine(body.exceptions[e].end)));
                    if (jmpIns.definition instanceof JumpIns) {
                      int finStart=adr2pos(fixAddrAfterDebugLine(body.exceptions[e].end) + jmpIns.getBytes().length + jmpIns.operands[0]);
                      finallyJumps.add(finStart);
                      if (unknownJumps.contains(finStart)) {
                        unknownJumps.remove((Integer)finStart);
                      }
                      for (int f=finStart; f <= end; f++) {
                        if (code.get(f).definition instanceof LookupSwitchIns) {
                          AVM2Instruction swins=code.get(f);
                          if (swins.operands.length >= 3) {
                            if (swins.operands[0] == swins.getBytes().length) {
                              if (adr2pos(pos2adr(f) + swins.operands[2]) < finStart) {
                                finallyCommands=toSourceOutput(processJumps,isStatic,scriptIndex,classIndex,localRegs,stack,scopeStack,abc,constants,method_info,body,finStart,f - 1,localRegNames,fullyQualifiedNames,visited).output;
                                returnPos=f + 1;
                                break;
                              }
                            }
                          }
                        }
                      }
                      break;
                    }
                  }
                }
              }
            }
            for (int e=0; e < catchedExceptions.size(); e++) {
              int eendpos;
              if (e < catchedExceptions.size() - 1) {
                eendpos=adr2pos(fixAddrAfterDebugLine(catchedExceptions.get(e + 1).target)) - 2;
              }
 else {
                eendpos=afterCatchPos - 1;
              }
              Stack<GraphTargetItem> substack=new Stack<GraphTargetItem>();
              substack.add(new ExceptionTreeItem(catchedExceptions.get(e)));
              catchedCommands.add(toSourceOutput(processJumps,isStatic,scriptIndex,classIndex,localRegs,substack,new Stack<GraphTargetItem>(),abc,constants,method_info,body,adr2pos(fixAddrAfterDebugLine(catchedExceptions.get(e).target)),eendpos,localRegNames,fullyQualifiedNames,visited).output);
            }
            List<GraphTargetItem> tryCommands=toSourceOutput(processJumps,isStatic,scriptIndex,classIndex,localRegs,stack,scopeStack,abc,constants,method_info,body,ip,endpos - 1,localRegNames,fullyQualifiedNames,visited).output;
            output.add(new TryTreeItem(tryCommands,catchedExceptions,catchedCommands,finallyCommands));
            ip=returnPos;
            addr=pos2adr(ip);
          }
        }
      }
      if (ip > end) {
        break;
      }
      if (unknownJumps.contains(ip)) {
        unknownJumps.remove(new Integer(ip));
        throw new UnknownJumpException(stack,ip,output);
      }
      if (visited[ip]) {
        Logger.getLogger(AVM2Code.class.getName()).warning("String_Node_Str" + Helper.formatAddress(pos2adr(ip)) + "String_Node_Str"+ ip);
        break;
      }
      visited[ip]=true;
      AVM2Instruction ins=code.get(ip);
      if (debugMode) {
        System.err.println("String_Node_Str" + ip + "String_Node_Str"+ ins.toString()+ "String_Node_Str"+ Highlighting.stripHilights(stack.toString())+ "String_Node_Str"+ Highlighting.stripHilights(scopeStack.toString()));
      }
      if (ins.definition instanceof NewFunctionIns) {
        if (ip + 1 <= end) {
          if (code.get(ip + 1).definition instanceof PopIns) {
            ip+=2;
            continue;
          }
        }
      }
      if ((ip + 8 < code.size())) {
        if (ins.definition instanceof SetLocalTypeIns) {
          if (code.get(ip + 1).definition instanceof PushByteIns) {
            AVM2Instruction jmp=code.get(ip + 2);
            if (jmp.definition instanceof JumpIns) {
              if (jmp.operands[0] == 0) {
                if (code.get(ip + 3).definition instanceof LabelIns) {
                  if (code.get(ip + 4).definition instanceof PopIns) {
                    if (code.get(ip + 5).definition instanceof LabelIns) {
                      AVM2Instruction gl=code.get(ip + 6);
                      if (gl.definition instanceof GetLocalTypeIns) {
                        if (((GetLocalTypeIns)gl.definition).getRegisterId(gl) == ((SetLocalTypeIns)ins.definition).getRegisterId(ins)) {
                          AVM2Instruction ki=code.get(ip + 7);
                          if (ki.definition instanceof KillIns) {
                            if (ki.operands[0] == ((SetLocalTypeIns)ins.definition).getRegisterId(ins)) {
                              if (code.get(ip + 8).definition instanceof ReturnValueIns) {
                                ip=ip + 8;
                                continue;
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      if ((ins.definition instanceof GetLocalTypeIns) && (!output.isEmpty()) && (output.get(output.size() - 1) instanceof SetLocalTreeItem)&& (((SetLocalTreeItem)output.get(output.size() - 1)).regIndex == ((GetLocalTypeIns)ins.definition).getRegisterId(ins))&& isKilled(((SetLocalTreeItem)output.get(output.size() - 1)).regIndex,start,end)) {
        SetLocalTreeItem slt=(SetLocalTreeItem)output.remove(output.size() - 1);
        stack.push(slt.getValue());
        ip++;
      }
 else       if ((ins.definition instanceof SetLocalTypeIns) && (ip + 1 <= end) && (isKilled(((SetLocalTypeIns)ins.definition).getRegisterId(ins),ip,end))) {
        AVM2Instruction insAfter=code.get(ip + 1);
        if ((insAfter.definition instanceof GetLocalTypeIns) && (((GetLocalTypeIns)insAfter.definition).getRegisterId(insAfter) == ((SetLocalTypeIns)ins.definition).getRegisterId(ins))) {
          GraphTargetItem before=stack.peek();
          ins.definition.translate(isStatic,scriptIndex,classIndex,localRegs,stack,scopeStack,constants,ins,method_info,output,body,abc,localRegNames,fullyQualifiedNames);
          stack.push(before);
          ip+=2;
          continue iploop;
        }
 else {
          ins.definition.translate(isStatic,scriptIndex,classIndex,localRegs,stack,scopeStack,constants,ins,method_info,output,body,abc,localRegNames,fullyQualifiedNames);
          ip++;
          continue iploop;
        }
      }
 else       if (ins.definition instanceof DupIns) {
        int nextPos;
        do {
          AVM2Instruction insAfter=code.get(ip + 1);
          AVM2Instruction insBefore=ins;
          if (ip - 1 >= start) {
            insBefore=code.get(ip - 1);
          }
          if (insAfter.definition instanceof ConvertBIns) {
            ip++;
            addr=pos2adr(ip);
            insAfter=code.get(ip + 1);
          }
          boolean isAnd;
          if (processJumps && (insAfter.definition instanceof IfFalseIns)) {
            isAnd=true;
          }
 else           if (processJumps && (insAfter.definition instanceof IfTrueIns)) {
            isAnd=false;
          }
 else           if (insAfter.definition instanceof SetLocalTypeIns) {
            int reg=(((SetLocalTypeIns)insAfter.definition).getRegisterId(insAfter));
            for (int t=ip + 1; t <= end - 1; t++) {
              if (code.get(t).definition instanceof KillIns) {
                if (code.get(t).operands[0] == reg) {
                  break;
                }
              }
              if (code.get(t).definition instanceof GetLocalTypeIns) {
                if (((GetLocalTypeIns)code.get(t).definition).getRegisterId(code.get(t)) == reg) {
                  if (code.get(t + 1).definition instanceof KillIns) {
                    if (code.get(t + 1).operands[0] == reg) {
                      ConvertOutput assignment=toSourceOutput(processJumps,isStatic,scriptIndex,classIndex,localRegs,stack,scopeStack,abc,constants,method_info,body,ip + 2,t - 1,localRegNames,fullyQualifiedNames,visited);
                      stack.push(assignment.output.remove(assignment.output.size() - 1));
                      ip=t + 2;
                      continue iploop;
                    }
                  }
                }
              }
            }
            if (!isKilled(reg,0,end)) {
              for (int i=ip; i >= start; i--) {
                if (code.get(i).definition instanceof DupIns) {
                  GraphTargetItem v=stack.pop();
                  stack.push(new LocalRegTreeItem(ins,reg,v));
                  stack.push(v);
                }
 else {
                  break;
                }
              }
            }
 else {
              ins.definition.translate(isStatic,scriptIndex,classIndex,localRegs,stack,scopeStack,constants,ins,method_info,output,body,abc,localRegNames,fullyQualifiedNames);
            }
            ip++;
            break;
          }
 else {
            ins.definition.translate(isStatic,scriptIndex,classIndex,localRegs,stack,scopeStack,constants,ins,method_info,output,body,abc,localRegNames,fullyQualifiedNames);
            ip++;
            break;
          }
        }
 while (ins.definition instanceof DupIns);
      }
 else       if ((ins.definition instanceof ReturnValueIns) || (ins.definition instanceof ReturnVoidIns) || (ins.definition instanceof ThrowIns)) {
        ins.definition.translate(isStatic,scriptIndex,classIndex,localRegs,stack,scopeStack,constants,ins,method_info,output,body,abc,localRegNames,fullyQualifiedNames);
        ip=end + 1;
        break;
      }
 else       if (ins.definition instanceof NewFunctionIns) {
        String functionName="String_Node_Str";
        if ((ip >= start + 2) && (ip <= end - 4)) {
          AVM2Instruction prev2=code.get(ip - 2);
          if (prev2.definition instanceof NewObjectIns) {
            if (prev2.operands[0] == 0) {
              if (code.get(ip - 1).definition instanceof PushWithIns) {
                boolean hasDup=false;
                int plus=0;
                if (code.get(ip + 1).definition instanceof DupIns) {
                  hasDup=true;
                  plus=1;
                }
                AVM2Instruction psco=code.get(ip + 1 + plus);
                if (psco.definition instanceof GetScopeObjectIns) {
                  if (psco.operands[0] == scopeStack.size() - 1) {
                    if (code.get(ip + plus + 2).definition instanceof SwapIns) {
                      if (code.get(ip + plus + 4).definition instanceof PopScopeIns) {
                        if (code.get(ip + plus + 3).definition instanceof SetPropertyIns) {
                          functionName=abc.constants.constant_multiname[code.get(ip + plus + 3).operands[0]].getName(constants,fullyQualifiedNames);
                          scopeStack.pop();
                          output.remove(output.size() - 1);
                          ip=ip + plus + 4;
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
        ins.definition.translate(isStatic,scriptIndex,classIndex,localRegs,stack,scopeStack,constants,ins,method_info,output,body,abc,localRegNames,fullyQualifiedNames);
        NewFunctionTreeItem nft=(NewFunctionTreeItem)stack.peek();
        nft.functionName=functionName;
        ip++;
      }
 else {
        ins.definition.translate(isStatic,scriptIndex,classIndex,localRegs,stack,scopeStack,constants,ins,method_info,output,body,abc,localRegNames,fullyQualifiedNames);
        ip++;
        addr=pos2adr(ip);
      }
    }
    if (debugMode) {
      System.out.println("String_Node_Str" + start + "String_Node_Str"+ end+ "String_Node_Str"+ code.get(start).toString()+ "String_Node_Str"+ code.get(end).toString());
    }
    return new ConvertOutput(stack,output);
  }
 catch (  ConvertException cex) {
    throw cex;
  }
}