code: def output(memory, ofile=None):
      
      for m in memory:
          m = m.rstrip('\r\n\t ')  # Ensures no trailing newlines (might with upon includes)
          if m and m[0] == '#':  # Preprocessor directive?
              if ofile is None:
                  print(m)
              else:
                  ofile.write('%s\n' % m)
              continue
  
          # Prints a 4 spaces "tab" for non labels
          if m and ':' not in m:
              if ofile is None:
                  print('    '),
              else:
                  ofile.write('\t')
  
          if ofile is None:
              print(m)
          else:
              ofile.write('%s\n' % m)
docs: Filters the output removing useless preprocessor #directives
      and writes it to the given file or to the screen if no file is passed