def METHOD_NAME(path_name, original_bundled_targets, original_opt_targets,
                     modified_bundled_targets, modified_opt_targets):
  """Compare current test sizes and generate a report."""
  size_report_file = open(path_name, "w+")
  size_report_file.write("Integration tests size report:\n")
  size_report_file.write("**************************************\n")
  print("  Building original and modified targets.")
  original_targets = original_bundled_targets + original_opt_targets
  modified_targets = modified_bundled_targets + modified_opt_targets
  repo_util.build_original_and_modified(original_targets, modified_targets)
  print("  Collecting original and modified sizes.")
  bundled_by_test_name = repo_util.get_files_by_test_name(
      modified_bundled_targets
  )
  optimized_by_test_name = repo_util.get_files_by_test_name(
      modified_opt_targets
  )
  print("  Comparing results.")
  uncompiled_reports = []
  for test_name in sorted(bundled_by_test_name.keys()):
    test = bundled_by_test_name.get(test_name)
    original, modified = get_files(test)
    uncompiled_reports.append(
        create_report(test_name, get_size(original), get_size(modified))
    )
  original_total_size = 0
  modified_total_size = 0
  all_reports = []
  incremental_reports = []
  for test_name in sorted(optimized_by_test_name.keys()):
    test = optimized_by_test_name.get(test_name)
    original, modified = get_files(test)
    original_size = repo_util.get_compressed_size(original)
    modified_size = repo_util.get_compressed_size(modified)
    existing_target = os.path.exists(original)
    if existing_target:
      modified_total_size += modified_size
      original_total_size += original_size
    all_reports.append(create_report(test_name, original_size, modified_size))
    incremental = optimized_by_test_name.get("%s_inc%s%s" %
                                             test_name.partition("/"))
    if incremental:
      inc_original, inc_modified = get_files(incremental)
      original_increment = (
          get_size(inc_original) - get_size(original) if existing_target else -1
      )
      modified_increment = get_size(inc_modified) - get_size(modified)
      incremental_reports.append(
          create_report(test_name, original_increment, modified_increment)
      )
  changed_reports = [report for report in all_reports if report[0] != 100]
  shrinkage_reports = [report for report in changed_reports if report[0] < 100]
  expansion_reports = [report for report in changed_reports if report[0] > 100]
  size_report_file.write(
      "There are %s optimized size changes.\n" % len(changed_reports))
  if modified_total_size != original_total_size:
    total_percent = (modified_total_size / float(original_total_size)) * 100
    size_report_file.write(
        "Total optimized size (of already existing tests) "
        "changed from\n  %s to %s bytes (100%%->%2.1f%%).\n" %
        (original_total_size, modified_total_size, total_percent))
  else:
    size_report_file.write(
        "Total size (of already existing tests) did not change.\n")
  size_report_file.write("\n")
  size_report_file.write("\n")
  size_report_file.write("Shrinkage report highlights:\n")
  size_report_file.write("**************************************\n")
  print_table(size_report_file,
              sorted(shrinkage_reports, key=lambda r: r[0], reverse=False)[0:4])
  size_report_file.write("\n")
  size_report_file.write("\n")
  size_report_file.write("Expansion report highlights:\n")
  size_report_file.write("**************************************\n")
  print_table(size_report_file,
              sorted(expansion_reports, key=lambda r: r[0], reverse=True)[0:4])
  size_report_file.write("\n")
  size_report_file.write("\n")
  size_report_file.write("Incremental size reports (non-compressed):\n")
  size_report_file.write("**************************************\n")
  print_table(size_report_file, incremental_reports)
  size_report_file.write("\n")
  size_report_file.write("\n")
  size_report_file.write("Uncompiled bundle reports:\n")
  size_report_file.write("**************************************\n")
  print_table(size_report_file, uncompiled_reports)
  size_report_file.write("\n")
  size_report_file.write("\n")
  size_report_file.write("All reports:\n")
  size_report_file.write("**************************************\n")
  print_table(size_report_file, all_reports)
  size_report_file.close()
  print("  Closing report (%s)" % size_report_file.name)