int iterationCounter = 0;
// Outer loop: Repeat until any change produces a crash
while (hasChanged)
{
SWFFile parsedFile;
try {
parsedFile = SWFParser.parse(inputFile);
} catch (final IOException e) {
throw new MinimizerException("SWF input file could not be read");
} catch (final SWFParserException e) {
throw new MinimizerException("SWF input file could not be parsed");
}
final byte[] fileData = parsedFile.getDecompressedData();
// For each run of the minimizer loop, this list stores
// the tags that can be removed without the input file
// crashing.
final List<Tag> removableTags = new ArrayList<Tag>();
final TagList tags = parsedFile.getTags();
int tagCounter = 1;
// Inner loop: Remove one tag at a time and then check
// whether the modified file still crashes.