Program: 35222
Project: 35222
Buggy source:
public ArrayList<Block> convert(boolean simplify,boolean removeRedundant){
  ArrayList<Block> blocks=new ArrayList<>();
  HashMap<AbstractInsnNode,Block> correspBlock=new HashMap<>();
  Block block=null;
  for (  AbstractInsnNode ain : nodes) {
    if (block == null) {
      block=new Block();
    }
    if (ain instanceof LabelNode) {
      block.setLabel((LabelNode)ain);
    }
    block.getNodes().add(ain);
    correspBlock.put(ain,block);
    int op=ain.getOpcode();
    if (op >= IRETURN && op <= RETURN || ain instanceof JumpInsnNode || op == ATHROW || op == LOOKUPSWITCH || op == TABLESWITCH) {
      block.setEndNode(ain);
      blocks.add(block);
      block=null;
      continue;
    }
    if (ain.getNext() != null && (ain.getNext() instanceof LabelNode)) {
      block.setEndNode(ain.getNext());
      blocks.add(block);
      block=null;
      continue;
    }
  }
  for (  Block b : blocks) {
    AbstractInsnNode end=b.getEndNode();
    if (end instanceof JumpInsnNode) {
      JumpInsnNode jin=(JumpInsnNode)end;
      ArrayList<Block> outputs=new ArrayList<>();
      if (!correspBlock.containsKey(jin.label)) {
        throw new RuntimeException("String_Node_Str");
      }
      Block blockAtLabel=correspBlock.get(jin.label);
      if (end.getOpcode() == GOTO) {
        outputs.add(blockAtLabel);
        b.setOutput(outputs);
        blockAtLabel.getInput().add(b);
      }
 else {
        outputs.add(blockAtLabel);
        if (jin.getNext() == null) {
          throw new RuntimeException("String_Node_Str");
        }
        if (correspBlock.get(jin.getNext()) == b) {
          throw new RuntimeException("String_Node_Str");
        }
        Block blockAfter=correspBlock.get(jin.getNext());
        outputs.add(blockAfter);
        b.setOutput(outputs);
        blockAtLabel.getInput().add(b);
        blockAfter.getInput().add(b);
      }
    }
 else     if (end instanceof TableSwitchInsnNode) {
      ArrayList<Block> outputs=new ArrayList<>();
      TableSwitchInsnNode tsin=(TableSwitchInsnNode)end;
      if (tsin.dflt != null) {
        Block blockAtDefault=correspBlock.get(tsin.dflt);
        blockAtDefault.getInput().add(b);
        outputs.add(blockAtDefault);
      }
      for (      LabelNode l : tsin.labels) {
        Block blockAtCase=correspBlock.get(l);
        blockAtCase.getInput().add(b);
        outputs.add(blockAtCase);
      }
      b.setOutput(outputs);
    }
 else     if (end instanceof LookupSwitchInsnNode) {
      ArrayList<Block> outputs=new ArrayList<>();
      LookupSwitchInsnNode lsin=(LookupSwitchInsnNode)end;
      if (lsin.dflt != null) {
        Block blockAtDefault=correspBlock.get(lsin.dflt);
        blockAtDefault.getInput().add(b);
        outputs.add(blockAtDefault);
      }
      for (      LabelNode l : lsin.labels) {
        Block blockAtCase=correspBlock.get(l);
        blockAtCase.getInput().add(b);
        outputs.add(blockAtCase);
      }
      b.setOutput(outputs);
    }
 else     if (end instanceof LabelNode) {
      if (!correspBlock.containsKey(end)) {
        throw new RuntimeException("String_Node_Str");
      }
      ArrayList<Block> outputs=new ArrayList<>();
      Block blockAtNext=correspBlock.get(end);
      outputs.add(blockAtNext);
      b.setOutput(outputs);
      blockAtNext.getInput().add(b);
    }
  }
  if (simplify) {
    for (    Block b : new ArrayList<>(blocks)) {
      if (b.getInput().isEmpty()) {
        simplifyBlock(new ArrayList<>(),blocks,b);
      }
    }
  }
  if (removeRedundant) {
    for (    Block b : new ArrayList<>(blocks)) {
      if (b.getInput().isEmpty()) {
        removeNonsense(new ArrayList<>(),blocks,b);
      }
    }
  }
  return blocks;
}

Fixed version (ground truth):
public ArrayList<Block> convert(boolean simplify,boolean removeRedundant){
  ArrayList<Block> blocks=new ArrayList<>();
  HashMap<AbstractInsnNode,Block> correspBlock=new HashMap<>();
  Block block=null;
  if (nodes.isEmpty()) {
    return blocks;
  }
  for (  AbstractInsnNode ain : nodes) {
    if (block == null) {
      block=new Block();
    }
    if (ain instanceof LabelNode) {
      block.setLabel((LabelNode)ain);
    }
    block.getNodes().add(ain);
    correspBlock.put(ain,block);
    int op=ain.getOpcode();
    if (op >= IRETURN && op <= RETURN || ain instanceof JumpInsnNode || op == ATHROW || op == LOOKUPSWITCH || op == TABLESWITCH) {
      block.setEndNode(ain);
      blocks.add(block);
      block=null;
      continue;
    }
    if (ain.getNext() != null && (ain.getNext() instanceof LabelNode)) {
      block.setEndNode(ain.getNext());
      blocks.add(block);
      block=null;
      continue;
    }
  }
  for (  Block b : blocks) {
    AbstractInsnNode end=b.getEndNode();
    if (end instanceof JumpInsnNode) {
      JumpInsnNode jin=(JumpInsnNode)end;
      ArrayList<Block> outputs=new ArrayList<>();
      if (!correspBlock.containsKey(jin.label)) {
        throw new RuntimeException("String_Node_Str");
      }
      Block blockAtLabel=correspBlock.get(jin.label);
      if (end.getOpcode() == GOTO) {
        outputs.add(blockAtLabel);
        b.setOutput(outputs);
        blockAtLabel.getInput().add(b);
      }
 else {
        outputs.add(blockAtLabel);
        if (jin.getNext() == null) {
          throw new RuntimeException("String_Node_Str");
        }
        if (correspBlock.get(jin.getNext()) == b) {
          throw new RuntimeException("String_Node_Str");
        }
        Block blockAfter=correspBlock.get(jin.getNext());
        outputs.add(blockAfter);
        b.setOutput(outputs);
        blockAtLabel.getInput().add(b);
        blockAfter.getInput().add(b);
      }
    }
 else     if (end instanceof TableSwitchInsnNode) {
      ArrayList<Block> outputs=new ArrayList<>();
      TableSwitchInsnNode tsin=(TableSwitchInsnNode)end;
      if (tsin.dflt != null) {
        Block blockAtDefault=correspBlock.get(tsin.dflt);
        blockAtDefault.getInput().add(b);
        outputs.add(blockAtDefault);
      }
      for (      LabelNode l : tsin.labels) {
        Block blockAtCase=correspBlock.get(l);
        blockAtCase.getInput().add(b);
        outputs.add(blockAtCase);
      }
      b.setOutput(outputs);
    }
 else     if (end instanceof LookupSwitchInsnNode) {
      ArrayList<Block> outputs=new ArrayList<>();
      LookupSwitchInsnNode lsin=(LookupSwitchInsnNode)end;
      if (lsin.dflt != null) {
        Block blockAtDefault=correspBlock.get(lsin.dflt);
        blockAtDefault.getInput().add(b);
        outputs.add(blockAtDefault);
      }
      for (      LabelNode l : lsin.labels) {
        Block blockAtCase=correspBlock.get(l);
        blockAtCase.getInput().add(b);
        outputs.add(blockAtCase);
      }
      b.setOutput(outputs);
    }
 else     if (end instanceof LabelNode) {
      if (!correspBlock.containsKey(end)) {
        throw new RuntimeException("String_Node_Str");
      }
      ArrayList<Block> outputs=new ArrayList<>();
      Block blockAtNext=correspBlock.get(end);
      outputs.add(blockAtNext);
      b.setOutput(outputs);
      blockAtNext.getInput().add(b);
    }
  }
  Block first=correspBlock.get(nodes.get(0));
  assert(first != null);
  if (removeRedundant) {
    ArrayList<Block> visited=new ArrayList<>();
    removeNonsense(visited,blocks,first);
    for (    Block b : new ArrayList<>(blocks)) {
      if (b.getInput().isEmpty()) {
        removeNonsense(visited,blocks,b);
      }
    }
  }
  if (simplify) {
    ArrayList<Block> visited=new ArrayList<>();
    simplifyBlock(visited,blocks,first);
    for (    Block b : new ArrayList<>(blocks)) {
      if (b.getInput().isEmpty()) {
        simplifyBlock(visited,blocks,b);
      }
    }
  }
  if (DEBUG) {
    ArrayList<Block> visited=new ArrayList<>();
    calculateDepths(visited,blocks,first,0);
    for (    Block b : blocks) {
      if (b.getInput().isEmpty()) {
        calculateDepths(visited,blocks,b,0);
      }
    }
  }
  return blocks;
}