#!/usr/bin/env python3
#
# Copyright (c) 2020, Trail of Bits, Inc.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
#

import sys

def main(argv):
  if len(argv) != 2:
    return 1
  
  new_lines = []
  with open(argv[1], "r") as lines:
    for line in lines:
      wrapped_line = line.rstrip(" \t\r\n").replace("\"", "\\\"")
      new_lines.append("\"{}\\n\"".format(wrapped_line))
  
  print("\n".join(new_lines))
  return 0

if __name__ == "__main__":
  exit(main(sys.argv))
