anchor.diff:    return sb.toString();
   }
   
  -Future<Uint8List> binarySearchDeleteData(
  -    Uint8List latestCrashData,
  -    MemoryFileSystem fs,
  -    Uri main,
  -    CompilerContext compilerContext,
  -    Component initialComponent) async {
  +void binarySearchDeleteData(Uri uri, Component initialComponent) async {
  +  Uint8List latestCrashData = fs.data[uri];
     int offset = 0;
     while (offset < latestCrashData.length) {
       print("Working at offset $offset of ${latestCrashData.length}");
  
positive.code: 
  import 'package:kernel/ast.dart' show Component;
  
  import 'parser_test_listener.dart' show ParserTestListener;
  
  import 'parser_suite.dart' as parser_suite;
  
  import 'incremental_load_from_dill_suite.dart' show getOptions;
  
  Uri sdkRoot = computePlatformBinariesLocation(forceBuildDir: true);
  Uri base = Uri.parse("org-dartlang-test:///");
  Uri sdkSummary = base.resolve("vm_platform.dill");
  Uri platformUri = sdkRoot.resolve("vm_platform_strong.dill");
  
  main(List<String> arguments) async {
    String filename;
    bool nnbd = false;
    for (String arg in arguments) {
      if (arg.startsWith("--")) {
        if (arg == "--nnbd") {
          nnbd = true;
        } else {
          throw "Unknown option $arg";
        }
  
negative.code:       filename = arg;
      }
    }
    if (platformUri == null) {
      throw "No platform given. Use --platform=/path/to/platform.dill";
    }
    if (!new File.fromUri(platformUri).existsSync()) {
      throw "The platform file '$platformUri' doesn't exist";
    }
    if (filename == null) {
      throw "Need file to operate on";
    }
    File file = new File(filename);
    if (!file.existsSync()) throw "File $filename doesn't exist.";
    mainUri = file.absolute.uri;
  
    await tryToMinimize();
  }
  
  Future tryToMinimize() async {
    // Set main to be basically empty up front.
    fs.data[mainUri] = utf8.encode("main() {}");
    Component initialComponent = await getInitialComponent();
    print("Compiled initially (without data)");
    // Remove fake cache.
    fs.data.remove(mainUri);
  
    // First assure it actually crash on the input.
    if (!await crashesOnCompile(initialComponent)) {
      throw "Input doesn't crash the compiler.";
    }
    print("Step #1: We did crash on the input!");
  
    // All file should now be cached.
    fs._redirectAndRecord = false;
  
    // For all dart files: Parse them as set their source as the parsed source
    // to "get around" any encoding issues when printing later.
    Map<Uri, Uint8List> copy = new Map.from(fs.data);
    for (Uri uri in fs.data.keys) {
      String uriString = uri.toString();
      if (uriString.endsWith(".json") ||
          uriString.endsWith(".json") ||
          uriString.endsWith(".packages") ||
          uriString.endsWith(".dill") ||
          fs.data[uri] == null ||
          fs.data[uri].isEmpty) {
        // skip
      } else {
        try {
          String parsedString = getFileAsStringContent(fs.data[uri], nnbd);
          fs.data[uri] = utf8.encode(parsedString);
        } catch (e) {
          // crash in scanner/parser --- keep original file. This crash might
          // be what we're looking for!
        }
      }
    }
    if (!await crashesOnCompile(initialComponent)) {
      // Now - for whatever reason - we didn't crash. Restore.
      fs.data.clear();
      fs.data.addAll(copy);
    }
  
    // Operate on one file at a time: Try to delete all content in file.
    List<Uri> uris = new List<Uri>.from(fs.data.keys);
  
    bool removedSome = true;
    while (removedSome) {
      while (removedSome) {
        removedSome = false;
        for (int i = 0; i < uris.length; i++) {
          Uri uri = uris[i];
          if (fs.data[uri] == null || fs.data[uri].isEmpty) continue;
          print("About to work on file $i of ${uris.length}");
          await deleteContent(uris, i, false, initialComponent);
          if (fs.data[uri] == null || fs.data[uri].isEmpty) removedSome = true;
        }
      }
      int left = 0;
      for (Uri uri in uris) {
        if (fs.data[uri] == null || fs.data[uri].isEmpty) continue;
        left++;
      }
      print("There's now $left files of ${fs.data.length} files left");
  
      // Operate on one file at a time.
      for (Uri uri in fs.data.keys) {
        if (fs.data[uri] == null || fs.data[uri].isEmpty) continue;
  
        print("Now working on $uri");
  
        // Try to delete lines.
        int prevLength = fs.data[uri].length;
        await deleteLines(uri, initialComponent);
        print("We're now at ${fs.data[uri].length} bytes for $uri.");
        if (prevLength != fs.data[uri].length) removedSome = true;
        if (fs.data[uri].isEmpty) continue;
  
        if (byteDelete) {
          // Now try to delete 'arbitrarily' (for any given start offset do an
          // exponential binary search).
          int prevLength = fs.data[uri].length;
          while (true) {
            await binarySearchDeleteData(uri, initialComponent);
  
            if (fs.data[uri].length == prevLength) {
              // No progress.
              break;
            } else {
              print("We're now at ${fs.data[uri].length} bytes");
              prevLength = fs.data[uri].length;
              removedSome = true;
            }
          }
        }
      }
    }
  
    print("\n\nDONE\n\n");
  
    for (Uri uri in uris) {
      if (fs.data[uri] == null || fs.data[uri].isEmpty) continue;
      print("Uri $uri has this content:");
  
      try {
        String utfDecoded = utf8.decode(fs.data[uri], allowMalformed: true);
        print(utfDecoded);
      } catch (e) {
        print(fs.data[uri]);
        print("(which crashes when trying to decode as utf8)");
      }
      print("\n\n====================\n\n");
    }
  }
  
  