<commit_before>(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            <NAME>, <NAME>, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

open Clflags

let usage =
   "Usage: ocamlnat <options> <object-files> [script-file]\noptions are:"

let preload_objects = ref []

let prepare ppf =
  Opttoploop.set_paths ();
  try
    let res =
      List.for_all (Opttopdirs.load_file ppf) (List.rev !preload_objects)
    in
    !Opttoploop.toplevel_startup_hook ();
    res
  with x ->
    try Location.report_exception ppf x; false
    with x ->
      Format.fprintf ppf "Uncaught exception: %s\n" (Printexc.to_string x);
      false

let file_argument name =
  let ppf = Format.err_formatter in
  if Filename.check_suffix name ".cmxs"
    || Filename.check_suffix name ".cmx"
    || Filename.check_suffix name ".cmxa"
  then preload_objects := name :: !preload_objects
  else
    begin
      let newargs = Array.sub Sys.argv !Arg.current
                              (Array.length Sys.argv - !Arg.current)
      in
      if prepare ppf && Opttoploop.run_script ppf name newargs
      then exit 0
      else exit 2
    end

let print_version () =
  Printf.printf "The OCaml toplevel, version %s\n" Sys.ocaml_version;
  exit 0;
;;

let print_version_num () =
  Printf.printf "%s\n" Sys.ocaml_version;
  exit 0;
;;

module Options = Main_args.Make_opttop_options (struct
  let set r () = r := true
  let clear r () = r := false

  let _absname = set Location.absname
  let _compact = clear optimize_for_speed
  let _I dir =
    let dir = Misc.expand_directory Config.standard_library dir in
    include_dirs := dir :: !include_dirs
  let _init s = init_file := Some s
  let _noinit = set noinit
  let _clambda_checks () = clambda_checks := true
  let _inline spec =
    Float_arg_helper.parse spec ~update:inline_threshold
      ~help_text:"Syntax: -inline <n> | <round>=<n>[,...]"
  let _inline_indirect_cost spec =
    Int_arg_helper.parse spec ~update:inline_indirect_cost
      ~help_text:"Syntax: -inline-indirect-cost <n> | <round>=<n>[,...]"
  let _inline_toplevel spec =
    Int_arg_helper.parse spec ~update:inline_toplevel_threshold
      ~help_text:"Syntax: -inline-toplevel <n> | <round>=<n>[,...]"
  let _inlining_stats () = inlining_stats := true
  let _dump_pass pass = set_dumped_pass pass true
  let _rounds n = simplify_rounds := n
  let _unroll spec =
    Int_arg_helper.parse spec ~update:unroll
      ~help_text:"Syntax: -unroll <n> | <round>=<n>[,...]"
  let _classic_inlining () = classic_inlining := true
  let _inline_call_cost spec =
    Int_arg_helper.parse spec ~update:inline_call_cost
      ~help_text:"Syntax: -inline-call-cost <n> | <round>=<n>[,...]"
  let _inline_alloc_cost spec =
    Int_arg_helper.parse spec ~update:inline_alloc_cost
      ~help_text:"Syntax: -inline-alloc-cost <n> | <round>=<n>[,...]"
  let _inline_prim_cost spec =
    Int_arg_helper.parse spec ~update:inline_prim_cost
      ~help_text:"Syntax: -inline-prim-cost <n> | <round>=<n>[,...]"
  let _inline_branch_cost spec =
    Int_arg_helper.parse spec ~update:inline_branch_cost
      ~help_text:"Syntax: -inline-branch-cost <n> | <round>=<n>[,...]"
  let _inline_lifting_benefit spec =
    Int_arg_helper.parse spec ~update:inline_lifting_benefit
      ~help_text:"Syntax: -inline-lifting-benefit <n> | <round>=<n>[,...]"
  let _branch_inline_factor spec =
    Float_arg_helper.parse spec ~update:branch_inline_factor
      ~help_text:"Syntax: -branch-inline-factor <n> | <round>=<n>[,...]"
  let _max_inlining_depth spec =
    Int_arg_helper.parse spec ~update:max_inlining_depth
      ~help_text:"Syntax: -max-inlining-depth <n> | <round>=<n>[,...]"
  let _o s = output_name := Some s
  let _o2 () =
    simplify_rounds := 2;
    use_inlining_arguments_set ~round:1 o1_arguments;
    use_inlining_arguments_set ~round:2 o2_arguments
  let _o3 () =
    simplify_rounds := 3;
    use_inlining_arguments_set ~round:1 o1_arguments;
    use_inlining_arguments_set ~round:2 o2_arguments;
    use_inlining_arguments_set ~round:3 o3_arguments
  let _remove_unused_arguments = set remove_unused_arguments
  let _unbox_closures = set unbox_closures
  let _drawclambda = set dump_rawclambda
  let _dclambda = set dump_clambda
  let _dflambda = set dump_flambda
  let _dflambda_let stamp = dump_flambda_let := Some stamp
  let _dflambda_verbose () =
    set dump_flambda ();
    set dump_flambda_verbose ()
  let _dflambda_invariants = set flambda_invariant_checks
  let _labels = clear classic
  let _no_alias_deps = set transparent_modules
  let _no_app_funct = clear applicative_functors
  let _noassert = set noassert
  let _nolabels = set classic
  let _noprompt = set noprompt
  let _nopromptcont = set nopromptcont
  let _nostdlib = set no_std_include
  let _ppx s = Compenv.first_ppx := s :: !Compenv.first_ppx
  let _principal = set principal
  let _real_paths = set real_paths
  let _rectypes = set recursive_types
  let _strict_sequence = set strict_sequence
  let _strict_formats = set strict_formats
  let _S = set keep_asm_file
  let _short_paths = clear real_paths
  let _stdin () = file_argument ""
  let _unsafe = set fast
  let _version () = print_version ()
  let _vnum () = print_version_num ()
  let _w s = Warnings.parse_options false s
  let _warn_error s = Warnings.parse_options true s
  let _warn_help = Warnings.help_warnings

  let _dsource = set dump_source
  let _dparsetree = set dump_parsetree
  let _dtypedtree = set dump_typedtree
  let _drawlambda = set dump_rawlambda
  let _dlambda = set dump_lambda
  let _drawclambda = set dump_rawclambda
  let _dclambda = set dump_clambda
  let _dcmm = set dump_cmm
  let _dsel = set dump_selection
  let _dcombine = set dump_combine
  let _dcse = set dump_cse
  let _dlive () = dump_live := true; Printmach.print_live := true
  let _dspill = set dump_spill
  let _dsplit = set dump_split
  let _dinterf = set dump_interf
  let _dprefer = set dump_prefer
  let _dalloc = set dump_regalloc
  let _dreload = set dump_reload
  let _dscheduling = set dump_scheduling
  let _dlinear = set dump_linear
  let _dstartup = set keep_startup_file
  let _safe_string = clear unsafe_string
  let _unsafe_string = set unsafe_string
  let _open s = open_modules := s :: !open_modules

  let anonymous = file_argument
end);;

let main () =
  native_code := true;
  Arg.parse Options.list file_argument usage;
  if not (prepare Format.err_formatter) then exit 2;
  Opttoploop.loop Format.std_formatter
<commit_msg>Fix ocamlnat build<commit_after>(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            <NAME>, <NAME>, INRI<NAME>         *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

open Clflags

let usage =
   "Usage: ocamlnat <options> <object-files> [script-file]\noptions are:"

let preload_objects = ref []

let prepare ppf =
  Opttoploop.set_paths ();
  try
    let res =
      List.for_all (Opttopdirs.load_file ppf) (List.rev !preload_objects)
    in
    !Opttoploop.toplevel_startup_hook ();
    res
  with x ->
    try Location.report_exception ppf x; false
    with x ->
      Format.fprintf ppf "Uncaught exception: %s\n" (Printexc.to_string x);
      false

let file_argument name =
  let ppf = Format.err_formatter in
  if Filename.check_suffix name ".cmxs"
    || Filename.check_suffix name ".cmx"
    || Filename.check_suffix name ".cmxa"
  then preload_objects := name :: !preload_objects
  else
    begin
      let newargs = Array.sub Sys.argv !Arg.current
                              (Array.length Sys.argv - !Arg.current)
      in
      if prepare ppf && Opttoploop.run_script ppf name newargs
      then exit 0
      else exit 2
    end

let print_version () =
  Printf.printf "The OCaml toplevel, version %s\n" Sys.ocaml_version;
  exit 0;
;;

let print_version_num () =
  Printf.printf "%s\n" Sys.ocaml_version;
  exit 0;
;;

module Options = Main_args.Make_opttop_options (struct
  let set r () = r := true
  let clear r () = r := false

  let _absname = set Location.absname
  let _compact = clear optimize_for_speed
  let _I dir =
    let dir = Misc.expand_directory Config.standard_library dir in
    include_dirs := dir :: !include_dirs
  let _init s = init_file := Some s
  let _noinit = set noinit
  let _clambda_checks () = clambda_checks := true
  let _inline spec =
    Float_arg_helper.parse spec ~update:inline_threshold
      ~help_text:"Syntax: -inline <n> | <round>=<n>[,...]"
  let _inline_indirect_cost spec =
    Int_arg_helper.parse spec ~update:inline_indirect_cost
      ~help_text:"Syntax: -inline-indirect-cost <n> | <round>=<n>[,...]"
  let _inline_toplevel spec =
    Int_arg_helper.parse spec ~update:inline_toplevel_threshold
      ~help_text:"Syntax: -inline-toplevel <n> | <round>=<n>[,...]"
  let _inlining_stats () = inlining_stats := true
  let _dump_pass pass = set_dumped_pass pass true
  let _rounds n = simplify_rounds := n
  let _unroll spec =
    Int_arg_helper.parse spec ~update:unroll
      ~help_text:"Syntax: -unroll <n> | <round>=<n>[,...]"
  let _classic_inlining () = classic_inlining := true
  let _inline_call_cost spec =
    Int_arg_helper.parse spec ~update:inline_call_cost
      ~help_text:"Syntax: -inline-call-cost <n> | <round>=<n>[,...]"
  let _inline_alloc_cost spec =
    Int_arg_helper.parse spec ~update:inline_alloc_cost
      ~help_text:"Syntax: -inline-alloc-cost <n> | <round>=<n>[,...]"
  let _inline_prim_cost spec =
    Int_arg_helper.parse spec ~update:inline_prim_cost
      ~help_text:"Syntax: -inline-prim-cost <n> | <round>=<n>[,...]"
  let _inline_branch_cost spec =
    Int_arg_helper.parse spec ~update:inline_branch_cost
      ~help_text:"Syntax: -inline-branch-cost <n> | <round>=<n>[,...]"
  let _inline_lifting_benefit spec =
    Int_arg_helper.parse spec ~update:inline_lifting_benefit
      ~help_text:"Syntax: -inline-lifting-benefit <n> | <round>=<n>[,...]"
  let _branch_inline_factor spec =
    Float_arg_helper.parse spec ~update:branch_inline_factor
      ~help_text:"Syntax: -branch-inline-factor <n> | <round>=<n>[,...]"
  let _max_inlining_depth spec =
    Int_arg_helper.parse spec ~update:max_inlining_depth
      ~help_text:"Syntax: -max-inlining-depth <n> | <round>=<n>[,...]"
  let _no_unbox_free_vars_of_closures = clear unbox_free_vars_of_closures
  let _no_unbox_specialised_args = clear unbox_specialised_args
  let _o s = output_name := Some s
  let _o2 () =
    simplify_rounds := 2;
    use_inlining_arguments_set ~round:1 o1_arguments;
    use_inlining_arguments_set ~round:2 o2_arguments
  let _o3 () =
    simplify_rounds := 3;
    use_inlining_arguments_set ~round:1 o1_arguments;
    use_inlining_arguments_set ~round:2 o2_arguments;
    use_inlining_arguments_set ~round:3 o3_arguments
  let _remove_unused_arguments = set remove_unused_arguments
  let _unbox_closures = set unbox_closures
  let _drawclambda = set dump_rawclambda
  let _dclambda = set dump_clambda
  let _dflambda = set dump_flambda
  let _dflambda_let stamp = dump_flambda_let := Some stamp
  let _dflambda_verbose () =
    set dump_flambda ();
    set dump_flambda_verbose ()
  let _dflambda_invariants = set flambda_invariant_checks
  let _labels = clear classic
  let _no_alias_deps = set transparent_modules
  let _no_app_funct = clear applicative_functors
  let _noassert = set noassert
  let _nolabels = set classic
  let _noprompt = set noprompt
  let _nopromptcont = set nopromptcont
  let _nostdlib = set no_std_include
  let _ppx s = Compenv.first_ppx := s :: !Compenv.first_ppx
  let _principal = set principal
  let _real_paths = set real_paths
  let _rectypes = set recursive_types
  let _strict_sequence = set strict_sequence
  let _strict_formats = set strict_formats
  let _S = set keep_asm_file
  let _short_paths = clear real_paths
  let _stdin () = file_argument ""
  let _unsafe = set fast
  let _version () = print_version ()
  let _vnum () = print_version_num ()
  let _w s = Warnings.parse_options false s
  let _warn_error s = Warnings.parse_options true s
  let _warn_help = Warnings.help_warnings

  let _dsource = set dump_source
  let _dparsetree = set dump_parsetree
  let _dtypedtree = set dump_typedtree
  let _drawlambda = set dump_rawlambda
  let _dlambda = set dump_lambda
  let _drawclambda = set dump_rawclambda
  let _dclambda = set dump_clambda
  let _dcmm = set dump_cmm
  let _dsel = set dump_selection
  let _dcombine = set dump_combine
  let _dcse = set dump_cse
  let _dlive () = dump_live := true; Printmach.print_live := true
  let _dspill = set dump_spill
  let _dsplit = set dump_split
  let _dinterf = set dump_interf
  let _dprefer = set dump_prefer
  let _dalloc = set dump_regalloc
  let _dreload = set dump_reload
  let _dscheduling = set dump_scheduling
  let _dlinear = set dump_linear
  let _dstartup = set keep_startup_file
  let _safe_string = clear unsafe_string
  let _unsafe_string = set unsafe_string
  let _open s = open_modules := s :: !open_modules

  let anonymous = file_argument
end);;

let main () =
  native_code := true;
  Arg.parse Options.list file_argument usage;
  if not (prepare Format.err_formatter) then exit 2;
  Opttoploop.loop Format.std_formatter

{'fraction_non_alphanumeric': 0.10962325678207174, 'fraction_numerical': 0.0034690904044959413, 'mean_word_length': 3.0740531373657434, 'pattern_counts': {'":': 0, '<': 78, '<?xml version=': 0, '>': 82, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3478216', 'n_tokens_mistral': 4852, 'n_tokens_neox': 4675, 'n_words': 1209}