Program: 174714
Project: 174714
Buggy source:
public static void addBlock(Block block){
  if (block.getBlockNumber() == 37) {
    short inventoryArg=(short)(100);
    int worldFlag=241;
    GameObjectId gameObjectId=new GameObjectId(inventoryArg,worldFlag);
    List<Block> blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    if (blocks == null) {
      mapOfChestIdentifyingInfoToBlock.put(gameObjectId,new ArrayList<>());
      blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    }
    blocks.add(block);
  }
 else   if (block.getBlockNumber() == 245) {
    short inventoryArg=(short)(30);
    int worldFlag=2702;
    GameObjectId gameObjectId=new GameObjectId(inventoryArg,worldFlag);
    List<Block> blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    if (blocks == null) {
      mapOfChestIdentifyingInfoToBlock.put(gameObjectId,new ArrayList<>());
      blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    }
    blocks.add(block);
  }
 else   if (block.getBlockNumber() == 247) {
    short inventoryArg=(short)(50);
    int worldFlag=2706;
    GameObjectId gameObjectId=new GameObjectId(inventoryArg,worldFlag);
    List<Block> blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    if (blocks == null) {
      mapOfChestIdentifyingInfoToBlock.put(gameObjectId,new ArrayList<>());
      blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    }
    blocks.add(block);
  }
 else   if (block.getBlockNumber() == 249) {
    short inventoryArg=(short)(22);
    int worldFlag=152;
    GameObjectId gameObjectId=new GameObjectId(inventoryArg,worldFlag);
    List<Block> blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    if (blocks == null) {
      mapOfChestIdentifyingInfoToBlock.put(gameObjectId,new ArrayList<>());
      blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    }
    blocks.add(block);
  }
 else   if (block.getBlockNumber() == 364) {
    short inventoryArg=(short)(86);
    int worldFlag=227;
    GameObjectId gameObjectId=new GameObjectId(inventoryArg,worldFlag);
    for (int i=0; i < block.getBlockContents().size(); i++) {
      BlockContents blockContents=block.getBlockContents().get(i);
      if (blockContents instanceof BlockFlagData) {
        BlockFlagData blockFlagData=(BlockFlagData)blockContents;
        if (blockFlagData.getWorldFlag() == 227) {
          blockFlagData.setFlagValue((short)2);
        }
      }
    }
    List<Block> blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    if (blocks == null) {
      mapOfChestIdentifyingInfoToBlock.put(gameObjectId,new ArrayList<>());
      blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    }
    blocks.add(block);
  }
 else   if (block.getBlockNumber() == 369) {
    Integer blockContentIndex=null;
    for (int i=0; i < block.getBlockContents().size(); i++) {
      BlockContents blockContents=block.getBlockContents().get(i);
      if (blockContents instanceof BlockFlagData) {
        BlockFlagData blockFlagData=(BlockFlagData)blockContents;
        if (blockFlagData.getWorldFlag() == 740) {
          blockContentIndex=i;
        }
      }
    }
    block.getBlockContents().add(blockContentIndex + 1,new BlockFlagData((short)0x0040,(short)2796,(short)2));
    block.getBlockContents().add(blockContentIndex + 1,new BlockFlagData((short)0x0040,(short)807,(short)1));
  }
 else   if (block.getBlockNumber() == 371) {
    short inventoryArg=(short)(73);
    int worldFlag=261;
    GameObjectId gameObjectId=new GameObjectId(inventoryArg,worldFlag);
    List<Block> blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    if (blocks == null) {
      mapOfChestIdentifyingInfoToBlock.put(gameObjectId,new ArrayList<>());
      blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    }
    blocks.add(block);
    Integer flagIndex=null;
    for (int i=0; i < block.getBlockContents().size(); i++) {
      BlockContents blockContents=block.getBlockContents().get(i);
      if (blockContents instanceof BlockFlagData) {
        BlockFlagData blockFlagData=(BlockFlagData)blockContents;
        if (blockFlagData.getWorldFlag() == 261) {
          blockFlagData.setWorldFlag((short)2797);
          blockFlagData.setFlagValue((short)2);
          flagIndex=i;
        }
      }
    }
    BlockFlagData blockFlagData=new BlockFlagData((short)0x0040,(short)261,(short)2);
    block.getBlockContents().add(flagIndex,blockFlagData);
  }
 else   if (block.getBlockNumber() == 397) {
    short inventoryArg=(short)(54);
    int worldFlag=2703;
    GameObjectId gameObjectId=new GameObjectId(inventoryArg,worldFlag);
    List<Block> blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    if (blocks == null) {
      mapOfChestIdentifyingInfoToBlock.put(gameObjectId,new ArrayList<>());
      blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    }
    blocks.add(block);
  }
 else   if (block.getBlockNumber() == 480) {
    CheckBlock checkBlock=(CheckBlock)block;
    Integer cmdToRemoveIndex1=null;
    Integer cmdToRemoveIndex2=null;
    for (int i=0; i < checkBlock.getFlagCheckReferences().size(); i++) {
      BlockListData blockListData=checkBlock.getFlagCheckReferences().get(i);
      if (blockListData.getData().get(2) == 1049) {
        cmdToRemoveIndex1=i;
      }
 else       if (blockListData.getData().get(2) == 371) {
        cmdToRemoveIndex2=i;
      }
    }
    checkBlock.getFlagCheckReferences().remove((int)cmdToRemoveIndex1);
    checkBlock.getFlagCheckReferences().remove((int)cmdToRemoveIndex2);
    BlockListData blockListData=new BlockListData((short)78,(short)4);
    blockListData.getData().add((short)2797);
    blockListData.getData().add((short)1);
    blockListData.getData().add((short)371);
    blockListData.getData().add((short)0);
    checkBlock.getFlagCheckReferences().add(0,blockListData);
    blockListData=new BlockListData((short)78,(short)4);
    blockListData.getData().add((short)2796);
    blockListData.getData().add((short)1);
    blockListData.getData().add((short)369);
    blockListData.getData().add((short)0);
    checkBlock.getFlagCheckReferences().add(0,blockListData);
  }
 else   if (block.getBlockNumber() == 482) {
    CheckBlock checkBlock=(CheckBlock)block;
    Integer cmdToRemoveIndex=null;
    for (int i=0; i < checkBlock.getFlagCheckReferences().size(); i++) {
      BlockListData blockListData=checkBlock.getFlagCheckReferences().get(i);
      if (blockListData.getData().get(2) == 373) {
        cmdToRemoveIndex=i;
      }
    }
    if (cmdToRemoveIndex != null) {
      checkBlock.getFlagCheckReferences().remove((int)cmdToRemoveIndex);
    }
  }
 else   if (block.getBlockNumber() == 486) {
    CheckBlock checkBlock=(CheckBlock)block;
    for (    BlockListData blockListData : checkBlock.getFlagCheckReferences()) {
      blockListData.getData().remove((int)blockListData.getData().size() - 1);
      blockListData.getData().add((short)0);
    }
  }
 else   if (block.getBlockNumber() == 716) {
    short inventoryArg=(short)(70);
    int worldFlag=209;
    GameObjectId gameObjectId=new GameObjectId(inventoryArg,worldFlag);
    List<Block> blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    if (blocks == null) {
      mapOfChestIdentifyingInfoToBlock.put(gameObjectId,new ArrayList<>());
      blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    }
    blocks.add(block);
  }
 else   if (block.getBlockNumber() == 1012) {
    short inventoryArg=(short)(74);
    int worldFlag=262;
    GameObjectId gameObjectId=new GameObjectId(inventoryArg,worldFlag);
    List<Block> blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    if (blocks == null) {
      mapOfChestIdentifyingInfoToBlock.put(gameObjectId,new ArrayList<>());
      blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    }
    blocks.add(block);
  }
}

Fixed version (ground truth):
public static void addBlock(Block block){
  if (block.getBlockNumber() == 37) {
    short inventoryArg=(short)(100);
    int worldFlag=241;
    GameObjectId gameObjectId=new GameObjectId(inventoryArg,worldFlag);
    List<Block> blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    if (blocks == null) {
      mapOfChestIdentifyingInfoToBlock.put(gameObjectId,new ArrayList<>());
      blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    }
    blocks.add(block);
  }
 else   if (block.getBlockNumber() == 245) {
    short inventoryArg=(short)(30);
    int worldFlag=2702;
    GameObjectId gameObjectId=new GameObjectId(inventoryArg,worldFlag);
    List<Block> blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    if (blocks == null) {
      mapOfChestIdentifyingInfoToBlock.put(gameObjectId,new ArrayList<>());
      blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    }
    blocks.add(block);
  }
 else   if (block.getBlockNumber() == 247) {
    short inventoryArg=(short)(50);
    int worldFlag=2706;
    GameObjectId gameObjectId=new GameObjectId(inventoryArg,worldFlag);
    List<Block> blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    if (blocks == null) {
      mapOfChestIdentifyingInfoToBlock.put(gameObjectId,new ArrayList<>());
      blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    }
    blocks.add(block);
  }
 else   if (block.getBlockNumber() == 249) {
    short inventoryArg=(short)(22);
    int worldFlag=152;
    GameObjectId gameObjectId=new GameObjectId(inventoryArg,worldFlag);
    List<Block> blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    if (blocks == null) {
      mapOfChestIdentifyingInfoToBlock.put(gameObjectId,new ArrayList<>());
      blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    }
    blocks.add(block);
  }
 else   if (block.getBlockNumber() == 364) {
    short inventoryArg=(short)(86);
    int worldFlag=227;
    GameObjectId gameObjectId=new GameObjectId(inventoryArg,worldFlag);
    for (int i=0; i < block.getBlockContents().size(); i++) {
      BlockContents blockContents=block.getBlockContents().get(i);
      if (blockContents instanceof BlockFlagData) {
        BlockFlagData blockFlagData=(BlockFlagData)blockContents;
        if (blockFlagData.getWorldFlag() == 227) {
          blockFlagData.setFlagValue((short)2);
        }
      }
    }
    List<Block> blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    if (blocks == null) {
      mapOfChestIdentifyingInfoToBlock.put(gameObjectId,new ArrayList<>());
      blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    }
    blocks.add(block);
  }
 else   if (block.getBlockNumber() == 369) {
    Integer blockContentIndex=null;
    for (int i=0; i < block.getBlockContents().size(); i++) {
      BlockContents blockContents=block.getBlockContents().get(i);
      if (blockContents instanceof BlockFlagData) {
        BlockFlagData blockFlagData=(BlockFlagData)blockContents;
        if (blockFlagData.getWorldFlag() == 740) {
          blockContentIndex=i;
        }
      }
    }
    block.getBlockContents().add(blockContentIndex + 1,new BlockFlagData((short)0x0040,(short)2796,(short)2));
    block.getBlockContents().add(blockContentIndex + 1,new BlockFlagData((short)0x0040,(short)807,(short)1));
  }
 else   if (block.getBlockNumber() == 371) {
    short inventoryArg=(short)(73);
    int worldFlag=261;
    GameObjectId gameObjectId=new GameObjectId(inventoryArg,worldFlag);
    List<Block> blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    if (blocks == null) {
      mapOfChestIdentifyingInfoToBlock.put(gameObjectId,new ArrayList<>());
      blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    }
    blocks.add(block);
    BlockFlagData blockFlagData;
    Integer flagIndexOfMulanaTalisman=null;
    for (int i=0; i < block.getBlockContents().size(); i++) {
      BlockContents blockContents=block.getBlockContents().get(i);
      if (blockContents instanceof BlockFlagData) {
        blockFlagData=(BlockFlagData)blockContents;
        if (blockFlagData.getWorldFlag() == 261) {
          blockFlagData.setWorldFlag((short)2797);
          blockFlagData.setFlagValue((short)2);
          flagIndexOfMulanaTalisman=i;
        }
      }
    }
    blockFlagData=new BlockFlagData((short)0x0040,(short)261,(short)2);
    block.getBlockContents().add(flagIndexOfMulanaTalisman,blockFlagData);
    Integer flagIndexToRemove=null;
    for (int i=0; i < block.getBlockContents().size(); i++) {
      BlockContents blockContents=block.getBlockContents().get(i);
      if (blockContents instanceof BlockFlagData) {
        blockFlagData=(BlockFlagData)blockContents;
        if (blockFlagData.getWorldFlag() == 530) {
          flagIndexToRemove=i;
        }
      }
    }
    if (flagIndexToRemove != null) {
      block.getBlockContents().remove((int)flagIndexToRemove);
    }
  }
 else   if (block.getBlockNumber() == 397) {
    short inventoryArg=(short)(54);
    int worldFlag=2703;
    GameObjectId gameObjectId=new GameObjectId(inventoryArg,worldFlag);
    List<Block> blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    if (blocks == null) {
      mapOfChestIdentifyingInfoToBlock.put(gameObjectId,new ArrayList<>());
      blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    }
    blocks.add(block);
  }
 else   if (block.getBlockNumber() == 480) {
    CheckBlock checkBlock=(CheckBlock)block;
    Integer cmdToRemoveIndex1=null;
    for (int i=0; i < checkBlock.getFlagCheckReferences().size(); i++) {
      BlockListData blockListData=checkBlock.getFlagCheckReferences().get(i);
      if (blockListData.getData().get(2) == 1049) {
        cmdToRemoveIndex1=i;
      }
    }
    checkBlock.getFlagCheckReferences().remove((int)cmdToRemoveIndex1);
    Integer cmdToRemoveIndex2=null;
    for (int i=0; i < checkBlock.getFlagCheckReferences().size(); i++) {
      BlockListData blockListData=checkBlock.getFlagCheckReferences().get(i);
      if (blockListData.getData().get(2) == 371) {
        cmdToRemoveIndex2=i;
      }
    }
    checkBlock.getFlagCheckReferences().remove((int)cmdToRemoveIndex2);
    BlockListData blockListData=new BlockListData((short)78,(short)4);
    blockListData.getData().add((short)2797);
    blockListData.getData().add((short)1);
    blockListData.getData().add((short)371);
    blockListData.getData().add((short)0);
    checkBlock.getFlagCheckReferences().add(0,blockListData);
    blockListData=new BlockListData((short)78,(short)4);
    blockListData.getData().add((short)2796);
    blockListData.getData().add((short)1);
    blockListData.getData().add((short)369);
    blockListData.getData().add((short)0);
    checkBlock.getFlagCheckReferences().add(0,blockListData);
  }
 else   if (block.getBlockNumber() == 482) {
    CheckBlock checkBlock=(CheckBlock)block;
    Integer cmdToRemoveIndex=null;
    for (int i=0; i < checkBlock.getFlagCheckReferences().size(); i++) {
      BlockListData blockListData=checkBlock.getFlagCheckReferences().get(i);
      if (blockListData.getData().get(2) == 373) {
        cmdToRemoveIndex=i;
      }
    }
    if (cmdToRemoveIndex != null) {
      checkBlock.getFlagCheckReferences().remove((int)cmdToRemoveIndex);
    }
  }
 else   if (block.getBlockNumber() == 486) {
    CheckBlock checkBlock=(CheckBlock)block;
    for (    BlockListData blockListData : checkBlock.getFlagCheckReferences()) {
      blockListData.getData().remove((int)blockListData.getData().size() - 1);
      blockListData.getData().add((short)0);
    }
  }
 else   if (block.getBlockNumber() == 716) {
    short inventoryArg=(short)(70);
    int worldFlag=209;
    GameObjectId gameObjectId=new GameObjectId(inventoryArg,worldFlag);
    List<Block> blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    if (blocks == null) {
      mapOfChestIdentifyingInfoToBlock.put(gameObjectId,new ArrayList<>());
      blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    }
    blocks.add(block);
  }
 else   if (block.getBlockNumber() == 1012) {
    short inventoryArg=(short)(74);
    int worldFlag=262;
    GameObjectId gameObjectId=new GameObjectId(inventoryArg,worldFlag);
    List<Block> blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    if (blocks == null) {
      mapOfChestIdentifyingInfoToBlock.put(gameObjectId,new ArrayList<>());
      blocks=mapOfChestIdentifyingInfoToBlock.get(gameObjectId);
    }
    blocks.add(block);
  }
}