Program: 162049
Project: 162049
Buggy source:
public void render(Screen screen){
  int xTile=8;
  int yTile=28;
  int walkingSpeed=4;
  int flipTop=(numSteps >> walkingSpeed) & 1;
  int flipBottom=(numSteps >> walkingSpeed) & 1;
  if (movingDir == 1) {
    xTile+=2;
  }
 else   if (movingDir > 1) {
    xTile+=4 + ((numSteps >> walkingSpeed) & 1) * 2;
    flipTop=(movingDir - 1) % 2;
  }
  int modifier=8 * scale;
  int xOffset=getX() - modifier / 2;
  int yOffset=getY() - modifier / 2 - 4;
  if (isSwimming) {
    int waterColour=0;
    yOffset+=4;
    colour=Colours.get(-1,111,-1,faceCol);
    if (tickCount % 60 < 15) {
      waterColour=Colours.get(-1,-1,255,-1);
    }
 else     if (15 <= tickCount % 60 && tickCount % 60 < 30) {
      yOffset--;
      waterColour=Colours.get(-1,225,115,-1);
    }
 else     if (30 <= tickCount % 60 && tickCount % 60 < 45) {
      waterColour=Colours.get(-1,115,-1,225);
    }
 else {
      yOffset--;
      waterColour=Colours.get(-1,-1,225,115);
    }
    screen.render(xOffset,yOffset + 3,31 + 31 * 32,waterColour,0x00,1);
    screen.render(xOffset + 8,yOffset + 3,31 + 31 * 32,waterColour,0x01,1);
  }
  if (isMagma) {
    int waterColour=0;
    yOffset+=4;
    colour=Colours.get(-1,111,-1,faceCol);
    if (tickCount % 60 < 15) {
      waterColour=Colours.get(-1,-1,541,-1);
    }
 else     if (15 <= tickCount % 60 && tickCount % 60 < 30) {
      yOffset--;
      waterColour=Colours.get(-1,521,510,-1);
    }
 else     if (30 <= tickCount % 60 && tickCount % 60 < 45) {
      waterColour=Colours.get(-1,510,-1,521);
    }
 else {
      yOffset--;
      waterColour=Colours.get(-1,-1,521,510);
    }
    screen.render(xOffset,yOffset + 3,31 + 31 * 32,waterColour,0x00,1);
    screen.render(xOffset + 8,yOffset + 3,31 + 31 * 32,waterColour,0x01,1);
  }
  if (isMuddy) {
    int waterColour=0;
    yOffset+=4;
    colour=Colours.get(-1,111,-1,310);
    if (tickCount % 60 < 15) {
      waterColour=Colours.get(-1,-1,422,-1);
    }
 else     if (15 <= tickCount % 60 && tickCount % 60 < 30) {
      yOffset--;
      waterColour=Colours.get(-1,410,321,-1);
    }
 else     if (30 <= tickCount % 60 && tickCount % 60 < 45) {
      waterColour=Colours.get(-1,321,-1,410);
    }
 else {
      yOffset--;
      waterColour=Colours.get(-1,-1,410,321);
    }
    screen.render(xOffset,yOffset + 3,31 + 31 * 32,waterColour,0x00,1);
    screen.render(xOffset + 8,yOffset + 3,31 + 31 * 32,waterColour,0x01,1);
  }
  screen.render((xOffset + (modifier * flipTop)),yOffset,(xTile + yTile * 32),colour,flipTop,scale);
  screen.render((xOffset + modifier - (modifier * flipTop)),yOffset,((xTile + 1) + yTile * 32),colour,flipTop,scale);
  if (!isSwimming && !isMagma && !isMuddy) {
    screen.render((xOffset + (modifier * flipBottom)),(yOffset + modifier),(xTile + (yTile + 1) * 32),colour,flipBottom,scale);
    screen.render((xOffset + modifier - (modifier * flipBottom)),(yOffset + modifier),((xTile + 1) + (yTile + 1) * 32),colour,flipBottom,scale);
    colour=Colours.get(-1,111,shirtCol,faceCol);
  }
}

Fixed version (ground truth):
public void render(Screen screen){
  int xTile=8;
  int yTile=28;
  int walkingSpeed=4;
  int flipTop=(numSteps >> walkingSpeed) & 1;
  int flipBottom=(numSteps >> walkingSpeed) & 1;
  if (movingDir == 1) {
    xTile+=2;
  }
 else   if (movingDir > 1) {
    xTile+=4 + ((numSteps >> walkingSpeed) & 1) * 2;
    flipTop=(movingDir - 1) % 2;
  }
  int modifier=8 * scale;
  int xOffset=getX() - modifier / 2;
  int yOffset=getY() - modifier / 2 - 4;
  if (isSwimming) {
    int waterColour=0;
    yOffset+=4;
    colour=Colours.get(-1,111,-1,faceCol);
    if (tickCount % 60 < 15) {
      waterColour=Colours.get(-1,-1,255,-1);
    }
 else     if (15 <= tickCount % 60 && tickCount % 60 < 30) {
      yOffset--;
      waterColour=Colours.get(-1,225,115,-1);
    }
 else     if (30 <= tickCount % 60 && tickCount % 60 < 45) {
      waterColour=Colours.get(-1,115,-1,225);
    }
 else {
      yOffset--;
      waterColour=Colours.get(-1,-1,225,115);
    }
    screen.render(xOffset,yOffset + 3,31 + 31 * 32,waterColour,0x00,1);
    screen.render(xOffset + 8,yOffset + 3,31 + 31 * 32,waterColour,0x01,1);
  }
  if (isMagma) {
    int waterColour=0;
    yOffset+=4;
    colour=Colours.get(-1,111,-1,faceCol);
    if (tickCount % 60 < 15) {
      waterColour=Colours.get(-1,-1,541,-1);
    }
 else     if (15 <= tickCount % 60 && tickCount % 60 < 30) {
      yOffset--;
      waterColour=Colours.get(-1,521,510,-1);
    }
 else     if (30 <= tickCount % 60 && tickCount % 60 < 45) {
      waterColour=Colours.get(-1,510,-1,521);
    }
 else {
      yOffset--;
      waterColour=Colours.get(-1,-1,521,510);
    }
    screen.render(xOffset,yOffset + 3,31 + 31 * 32,waterColour,0x00,1);
    screen.render(xOffset + 8,yOffset + 3,31 + 31 * 32,waterColour,0x01,1);
  }
  if (isMuddy) {
    int waterColour=0;
    yOffset+=4;
    colour=Colours.get(-1,111,-1,faceCol);
    if (tickCount % 60 < 15) {
      waterColour=Colours.get(-1,-1,422,-1);
    }
 else     if (15 <= tickCount % 60 && tickCount % 60 < 30) {
      yOffset--;
      waterColour=Colours.get(-1,410,321,-1);
    }
 else     if (30 <= tickCount % 60 && tickCount % 60 < 45) {
      waterColour=Colours.get(-1,321,-1,410);
    }
 else {
      yOffset--;
      waterColour=Colours.get(-1,-1,410,321);
    }
    screen.render(xOffset,yOffset + 3,31 + 31 * 32,waterColour,0x00,1);
    screen.render(xOffset + 8,yOffset + 3,31 + 31 * 32,waterColour,0x01,1);
  }
  screen.render((xOffset + (modifier * flipTop)),yOffset,(xTile + yTile * 32),colour,flipTop,scale);
  screen.render((xOffset + modifier - (modifier * flipTop)),yOffset,((xTile + 1) + yTile * 32),colour,flipTop,scale);
  if (!isSwimming && !isMagma && !isMuddy) {
    screen.render((xOffset + (modifier * flipBottom)),(yOffset + modifier),(xTile + (yTile + 1) * 32),colour,flipBottom,scale);
    screen.render((xOffset + modifier - (modifier * flipBottom)),(yOffset + modifier),((xTile + 1) + (yTile + 1) * 32),colour,flipBottom,scale);
    colour=Colours.get(-1,111,shirtCol,faceCol);
  }
}