Program: 19629
Project: 19629
Buggy source:
public static void moveItems(Inventory iFrom,Inventory iTo,IntMap through){
  ItemStack[] from=iFrom.getContents();
  ItemStack[] to=iTo.getContents();
  int i1, i2;
  for (i1=0; i1 < from.length; i1++) {
    if (from[i1] == null)     continue;
    int mapAmount=through.getInt(from[i1].getType(),(byte)from[i1].getDurability());
    int startAmount=from[i1].getAmount();
    if (mapAmount == 0 || mapAmount == Integer.MIN_VALUE)     continue;
    if (mapAmount == Integer.MAX_VALUE || from[i1].getAmount() < mapAmount) {
      for (i2=0; i2 < to.length; i2++) {
        if (to[i2] == null) {
          to[i2]=from[i1];
          from[i1]=null;
          break;
        }
 else         if (to[i2].getTypeId() == from[i1].getTypeId() && to[i2].getDurability() == from[i1].getDurability() && to[i2].getAmount() < 64) {
          if ((from[i1].getAmount() + to[i2].getAmount()) > 64) {
            from[i1].setAmount((to[i2].getAmount() + from[i1].getAmount()) - 64);
            to[i2].setAmount(64);
          }
 else {
            to[i2].setAmount(to[i2].getAmount() + from[i1].getAmount());
            from[i1]=null;
          }
          break;
        }
      }
      if (mapAmount != Integer.MAX_VALUE) {
        if (from[i1] == null) {
          through.setInt(from[i1].getType(),(byte)from[i1].getDurability(),mapAmount - startAmount);
        }
 else {
          through.setInt(from[i1].getType(),(byte)from[i1].getDurability(),mapAmount - startAmount + to[i2].getAmount());
        }
      }
    }
 else {
      int amountToMove=from[i1].getAmount() - mapAmount;
      Bukkit.getServer().broadcastMessage("String_Node_Str" + amountToMove + "String_Node_Str");
      for (i2=0; i2 < to.length; i2++) {
        if (to[i2] == null) {
          to[i2]=from[i1];
          to[i2].setAmount(amountToMove);
          amountToMove=0;
          break;
        }
 else         if (to[i2].getTypeId() == from[i1].getTypeId() && to[i2].getDurability() == from[i1].getDurability() && to[i2].getAmount() < 64) {
          if (amountToMove + to[i2].getAmount() > 64) {
            to[i2].setAmount(64);
            amountToMove+=to[i2].getAmount() - 64;
          }
 else {
            to[i2].setAmount(amountToMove + to[i2].getAmount());
            amountToMove=0;
          }
          break;
        }
      }
      if (amountToMove != 0) {
        from[i1].setAmount(amountToMove);
      }
 else {
        from[i1]=null;
      }
      through.setInt(from[i1].getType(),(byte)from[i1].getDurability(),amountToMove);
    }
  }
  iTo.setContents(to);
  iFrom.setContents(from);
}

Fixed version (ground truth):
public static void moveItems(Inventory iFrom,Inventory iTo,IntMap through){
  ItemStack[] from=iFrom.getContents();
  ItemStack[] to=iTo.getContents();
  int i1, i2;
  for (i1=0; i1 < from.length; i1++) {
    if (from[i1] == null)     continue;
    int mapAmount=through.getInt(from[i1].getType(),(byte)from[i1].getDurability());
    int startAmount=from[i1].getAmount();
    if (mapAmount == 0 || mapAmount == Integer.MIN_VALUE)     continue;
    if (mapAmount == Integer.MAX_VALUE || from[i1].getAmount() < mapAmount) {
      for (i2=0; i2 < to.length; i2++) {
        if (to[i2] == null) {
          to[i2]=from[i1];
          from[i1]=null;
          break;
        }
 else         if (to[i2].getTypeId() == from[i1].getTypeId() && to[i2].getDurability() == from[i1].getDurability() && to[i2].getAmount() < 64) {
          if ((from[i1].getAmount() + to[i2].getAmount()) > 64) {
            from[i1].setAmount((to[i2].getAmount() + from[i1].getAmount()) - 64);
            to[i2].setAmount(64);
          }
 else {
            to[i2].setAmount(to[i2].getAmount() + from[i1].getAmount());
            from[i1]=null;
          }
          break;
        }
      }
      if (mapAmount != Integer.MAX_VALUE) {
        if (from[i1] == null) {
          through.setInt(from[i1].getType(),(byte)from[i1].getDurability(),mapAmount - startAmount);
        }
 else {
          through.setInt(from[i1].getType(),(byte)from[i1].getDurability(),mapAmount - startAmount + to[i2].getAmount());
        }
      }
    }
 else {
      int amountToMove=mapAmount;
      from[i1].setAmount(from[i1].getAmount() - amountToMove);
      Bukkit.getServer().broadcastMessage("String_Node_Str" + amountToMove + "String_Node_Str");
      for (i2=0; i2 < to.length; i2++) {
        if (to[i2] == null) {
          to[i2]=from[i1];
          to[i2].setAmount(amountToMove);
          amountToMove=0;
          break;
        }
 else         if (to[i2].getTypeId() == from[i1].getTypeId() && to[i2].getDurability() == from[i1].getDurability() && to[i2].getAmount() < 64) {
          if (amountToMove + to[i2].getAmount() > 64) {
            amountToMove+=to[i2].getAmount() - 64;
            to[i2].setAmount(64);
          }
 else {
            to[i2].setAmount(amountToMove + to[i2].getAmount());
            amountToMove=0;
          }
          break;
        }
      }
      if (amountToMove != mapAmount) {
        from[i1].setAmount(from[i1].getAmount() + amountToMove);
        through.setInt(from[i1].getType(),(byte)from[i1].getDurability(),amountToMove);
      }
    }
  }
  iTo.setContents(to);
  iFrom.setContents(from);
}