Program: 8642
Project: 8642
Buggy source:
private void drawChildren(Entity rootEntity,Batch batch,CompositeTransformComponent curCompositeTransformComponent,float parentAlpha){
  NodeComponent nodeComponent=nodeMapper.get(rootEntity);
  Entity[] children=nodeComponent.children.begin();
  if (curCompositeTransformComponent.transform) {
    for (int i=0, n=nodeComponent.children.size; i < n; i++) {
      Entity child=children[i];
      LayerMapComponent rootLayers=ComponentRetriever.get(rootEntity,LayerMapComponent.class);
      ZIndexComponent childZIndexComponent=ComponentRetriever.get(child,ZIndexComponent.class);
      if (!rootLayers.isVisible(childZIndexComponent.layerName)) {
        continue;
      }
      MainItemComponent childMainItemComponent=mainItemComponentMapper.get(child);
      if (!childMainItemComponent.visible) {
        continue;
      }
      int entityType=childMainItemComponent.entityType;
      NodeComponent childNodeComponent=nodeMapper.get(child);
      if (childNodeComponent == null) {
        drawableLogicMapper.getDrawable(entityType).draw(batch,child,parentAlpha);
      }
 else {
        drawRecursively(child,parentAlpha);
      }
    }
  }
 else {
    TransformComponent compositeTransform=transformMapper.get(rootEntity);
    float offsetX=compositeTransform.x, offsetY=compositeTransform.y;
    if (viewPortMapper.has(rootEntity)) {
      offsetX=0;
      offsetY=0;
    }
    for (int i=0, n=nodeComponent.children.size; i < n; i++) {
      Entity child=children[i];
      LayerMapComponent rootLayers=ComponentRetriever.get(rootEntity,LayerMapComponent.class);
      ZIndexComponent childZIndexComponent=ComponentRetriever.get(child,ZIndexComponent.class);
      if (!rootLayers.isVisible(childZIndexComponent.layerName)) {
        continue;
      }
      MainItemComponent childMainItemComponent=mainItemComponentMapper.get(child);
      if (!childMainItemComponent.visible) {
        continue;
      }
      TransformComponent childTransformComponent=transformMapper.get(child);
      float cx=childTransformComponent.x, cy=childTransformComponent.y;
      childTransformComponent.x=cx + offsetX;
      childTransformComponent.y=cy + offsetY;
      NodeComponent childNodeComponent=nodeMapper.get(child);
      int entityType=mainItemComponentMapper.get(child).entityType;
      if (childNodeComponent == null) {
        drawableLogicMapper.getDrawable(entityType).draw(batch,child,parentAlpha);
      }
 else {
        drawRecursively(child,parentAlpha);
      }
      childTransformComponent.x=cx;
      childTransformComponent.y=cy;
    }
  }
  nodeComponent.children.end();
}

Fixed version (ground truth):
private void drawChildren(Entity rootEntity,Batch batch,CompositeTransformComponent curCompositeTransformComponent,float parentAlpha){
  NodeComponent nodeComponent=nodeMapper.get(rootEntity);
  Entity[] children=nodeComponent.children.begin();
  TransformComponent transform=transformMapper.get(rootEntity);
  if (curCompositeTransformComponent.transform || transform.rotation != 0 || transform.scaleX != 0 || transform.scaleY != 0) {
    for (int i=0, n=nodeComponent.children.size; i < n; i++) {
      Entity child=children[i];
      LayerMapComponent rootLayers=ComponentRetriever.get(rootEntity,LayerMapComponent.class);
      ZIndexComponent childZIndexComponent=ComponentRetriever.get(child,ZIndexComponent.class);
      if (!rootLayers.isVisible(childZIndexComponent.layerName)) {
        continue;
      }
      MainItemComponent childMainItemComponent=mainItemComponentMapper.get(child);
      if (!childMainItemComponent.visible) {
        continue;
      }
      int entityType=childMainItemComponent.entityType;
      NodeComponent childNodeComponent=nodeMapper.get(child);
      if (childNodeComponent == null) {
        drawableLogicMapper.getDrawable(entityType).draw(batch,child,parentAlpha);
      }
 else {
        drawRecursively(child,parentAlpha);
      }
    }
  }
 else {
    TransformComponent compositeTransform=transformMapper.get(rootEntity);
    float offsetX=compositeTransform.x, offsetY=compositeTransform.y;
    if (viewPortMapper.has(rootEntity)) {
      offsetX=0;
      offsetY=0;
    }
    for (int i=0, n=nodeComponent.children.size; i < n; i++) {
      Entity child=children[i];
      LayerMapComponent rootLayers=ComponentRetriever.get(rootEntity,LayerMapComponent.class);
      ZIndexComponent childZIndexComponent=ComponentRetriever.get(child,ZIndexComponent.class);
      if (!rootLayers.isVisible(childZIndexComponent.layerName)) {
        continue;
      }
      MainItemComponent childMainItemComponent=mainItemComponentMapper.get(child);
      if (!childMainItemComponent.visible) {
        continue;
      }
      TransformComponent childTransformComponent=transformMapper.get(child);
      float cx=childTransformComponent.x, cy=childTransformComponent.y;
      childTransformComponent.x=cx + offsetX;
      childTransformComponent.y=cy + offsetY;
      NodeComponent childNodeComponent=nodeMapper.get(child);
      int entityType=mainItemComponentMapper.get(child).entityType;
      if (childNodeComponent == null) {
        drawableLogicMapper.getDrawable(entityType).draw(batch,child,parentAlpha);
      }
 else {
        drawRecursively(child,parentAlpha);
      }
      childTransformComponent.x=cx;
      childTransformComponent.y=cy;
    }
  }
  nodeComponent.children.end();
}