% compiler: GNU Prolog 1.1.1 (Oct 18 1999)
% file    : pl2wam.pl
% date    : 10 22 1999
% time    : 14:54:23


file_name('/home/lima/diaz/GNU-Prolog/src/Pl2Wam/pl2wam.pl').


predicate(pl2wam/1,25,static,private,user,[
    get_variable(x(1),0),
    put_structure(pl2wam1/1,0),
    unify_local_value(x(1)),
    put_structure(exception/1,2),
    unify_variable(x(1)),
    put_atom(pl2wam,3),
    put_integer(1,4),
    put_atom(true,5),
    execute('$catch'/6)]).


predicate(pl2wam1/1,31,static,private,user,[
    load_cut_level(1),
    allocate(13),
    get_variable(y(0),1),
    put_variable(y(1),1),
    put_variable(y(2),2),
    call(cmd_line_args/3),
    put_value(y(1),0),
    put_variable(y(3),1),
    call(prolog_file_name/2),
    put_value(y(1),0),
    call(read_file_init/1),
    put_value(y(2),0),
    put_value(y(1),1),
    call(emit_code_init/2),
    put_atom(native_code,0),
    put_variable(y(4),1),
    call_c_test('Blt_G_Read',[0,1]),
    put_value(y(3),0),
    put_value(y(4),1),
    call(compile_msg_start/2),
    call(init_counters/0),
    call(repeat/0),
    put_variable(y(5),0),
    put_variable(y(6),1),
    put_variable(y(7),2),
    call(read_predicate/3),
    put_atom(user_read_file,0),
    put_atom(real_read_file,1),
    call(add_counter/2),
    put_value(y(7),0),
    put_value(y(0),1),
    put_value(y(4),2),
    put_value(y(5),3),
    put_value(y(6),4),
    call('$pl2wam1/1_$aux1'/5),
    call(emit_ensure_linked/0),
    put_variable(y(8),0),
    put_variable(y(9),1),
    call(read_file_term/2),
    put_variable(y(10),0),
    put_variable(y(11),1),
    call(emit_code_term/2),
    put_variable(y(12),0),
    call(read_file_error_nb/1),
    put_unsafe_value(y(12),0),
    put_unsafe_value(y(3),1),
    put_unsafe_value(y(8),2),
    put_unsafe_value(y(9),3),
    put_unsafe_value(y(10),4),
    put_unsafe_value(y(11),5),
    deallocate,
    execute('$pl2wam1/1_$aux2'/6)]).


predicate('$pl2wam1/1_$aux2'/6,31,static,private,user,[
    load_cut_level(6),
    try_me_else(2),
    switch_on_term(1,fail,1,fail,fail),

label(1),
    allocate(5),
    get_variable(y(0),1),
    get_variable(y(1),2),
    get_variable(y(2),3),
    get_variable(y(3),4),
    get_variable(y(4),5),
    get_integer(0,0),
    cut(x(6)),
    call(display_counters/0),
    put_value(y(0),0),
    put_value(y(1),1),
    put_value(y(2),2),
    put_value(y(3),3),
    put_value(y(4),4),
    deallocate,
    execute(compile_msg_end/5),

label(2),
    trust_me_else_fail,
    allocate(0),
    put_list(1),
    unify_local_value(x(0)),
    unify_nil,
    put_atom('~N\t~d error(s)~n',0),
    call(format/2),
    deallocate,
    execute(abort/0)]).


predicate('$pl2wam1/1_$aux1'/5,31,static,private,user,[
    load_cut_level(5),
    try_me_else(2),
    switch_on_term(1,1,fail,fail,fail),

label(1),
    get_nil(0),
    cut(x(5)),
    cut(x(1)),
    proceed,

label(2),
    trust_me_else_fail,
    allocate(4),
    get_variable(y(0),0),
    get_variable(y(1),2),
    get_variable(y(2),3),
    get_variable(y(3),4),
    put_integer(0,0),
    call(read_file_error_nb/1),
    put_value(y(1),0),
    put_value(y(2),1),
    put_value(y(3),2),
    put_value(y(0),3),
    call(compile_and_emit_pred/4),
    fail]).


predicate(compile_and_emit_pred/4,61,static,private,user,[
    switch_on_term(2,1,fail,fail,fail),

label(1),
    switch_on_atom([(t,3),(f,5)]),

label(2),
    try_me_else(4),

label(3),
    allocate(7),
    get_atom(t,0),
    get_variable(y(0),1),
    get_variable(y(1),2),
    get_variable(y(2),3),
    put_value(y(0),0),
    put_value(y(1),1),
    put_value(y(2),2),
    put_variable(y(3),3),
    put_variable(y(4),4),
    call(compile_emit_inits/5),
    put_value(y(2),0),
    put_variable(y(5),1),
    call(compile_lst_clause/2),
    put_value(y(5),0),
    put_variable(y(6),1),
    call(indexing/2),
    put_atom(user_indexing,0),
    put_atom(real_indexing,1),
    call(add_counter/2),
    put_value(y(0),0),
    put_value(y(1),1),
    put_value(y(3),2),
    put_value(y(4),3),
    put_value(y(6),4),
    call(emit_code/5),
    put_atom(user_wam_emit,0),
    put_atom(real_wam_emit,1),
    deallocate,
    execute(add_counter/2),

label(4),
    trust_me_else_fail,

label(5),
    allocate(6),
    get_atom(f,0),
    get_variable(y(0),1),
    get_variable(y(1),2),
    get_variable(y(2),3),
    put_value(y(0),0),
    put_value(y(1),1),
    put_value(y(2),2),
    put_variable(y(3),3),
    put_variable(y(4),4),
    call(compile_emit_inits/5),
    put_value(y(2),0),
    put_variable(y(5),1),
    call(bc_compile_lst_clause/2),
    put_value(y(0),0),
    put_value(y(1),1),
    put_value(y(3),2),
    put_value(y(4),3),
    put_value(y(5),4),
    call(bc_emit_code/5),
    put_atom(user_wam_emit,0),
    put_atom(real_wam_emit,1),
    deallocate,
    execute(add_counter/2)]).


predicate(compile_emit_inits/5,78,static,private,user,[
    allocate(3),
    get_variable(y(0),2),
    get_variable(y(1),3),
    get_variable(y(2),4),
    put_atom(cur_func,2),
    call_c_test('Blt_G_Assign',[2,0]),
    put_atom(cur_arity,2),
    call_c_test('Blt_G_Assign',[2,1]),
    call(syntactic_sugar_init_pred/2),
    put_value(y(0),0),
    get_list(0),
    unify_variable(x(0)),
    unify_void(1),
    get_structure((+)/2,0),
    unify_variable(x(0)),
    unify_void(1),
    get_structure((+)/2,0),
    unify_variable(x(0)),
    unify_structure((-)/2),
    unify_local_value(y(2)),
    unify_void(1),
    get_list(0),
    unify_variable(x(0)),
    unify_void(1),
    get_structure((*)/2,0),
    unify_variable(x(0)),
    unify_void(1),
    put_value(y(1),1),
    deallocate,
    execute(absolute_file_name/2)]).


predicate(compile_lst_clause/2,88,static,private,user,[
    switch_on_term(1,2,fail,4,fail),

label(1),
    try_me_else(3),

label(2),
    get_nil(0),
    get_nil(1),
    proceed,

label(3),
    trust_me_else_fail,

label(4),
    allocate(2),
    get_list(0),
    unify_variable(x(0)),
    unify_variable(y(0)),
    get_list(1),
    unify_variable(x(1)),
    unify_variable(y(1)),
    get_structure(cl/3,1),
    unify_void(1),
    unify_variable(x(1)),
    unify_variable(x(2)),
    call(compile_clause/3),
    put_value(y(0),0),
    put_value(y(1),1),
    deallocate,
    execute(compile_lst_clause/2)]).


predicate(compile_clause/3,97,static,private,user,[
    switch_on_term(1,fail,fail,fail,1),

label(1),
    allocate(8),
    get_variable(y(0),1),
    get_variable(y(1),2),
    get_structure((+)/2,0),
    unify_variable(x(2)),
    unify_variable(x(0)),
    put_atom(where,1),
    call_c_test('Blt_G_Assign',[1,2]),
    put_variable(y(2),1),
    put_variable(y(3),2),
    call(syntactic_sugar/3),
    put_atom(user_syn_sugar,0),
    put_atom(real_syn_sugar,1),
    call(add_counter/2),
    put_value(y(2),0),
    put_value(y(3),1),
    put_variable(y(4),2),
    put_variable(y(5),3),
    put_variable(y(6),4),
    put_variable(y(7),5),
    call(internal_format/6),
    put_atom(user_internal,0),
    put_atom(real_internal,1),
    call(add_counter/2),
    put_value(y(4),0),
    put_value(y(5),1),
    put_value(y(6),2),
    put_value(y(7),3),
    put_value(y(1),4),
    call(code_generation/5),
    put_atom(user_code_gen,0),
    put_atom(real_code_gen,1),
    call(add_counter/2),
    put_value(y(1),0),
    call(allocate_registers/1),
    put_atom(user_reg_alloc,0),
    put_atom(real_reg_alloc,1),
    call(add_counter/2),
    put_value(y(1),0),
    put_value(y(0),1),
    call(find_first_arg/2),
    put_atom(user_first_arg,0),
    put_atom(real_first_arg,1),
    deallocate,
    execute(add_counter/2)]).


predicate(bc_compile_lst_clause/2,113,static,private,user,[
    switch_on_term(1,2,fail,4,fail),

label(1),
    try_me_else(3),

label(2),
    get_nil(0),
    get_nil(1),
    proceed,

label(3),
    trust_me_else_fail,

label(4),
    allocate(2),
    get_list(0),
    unify_variable(x(0)),
    unify_variable(y(0)),
    get_list(1),
    unify_variable(x(1)),
    unify_variable(y(1)),
    get_structure(bc/2,1),
    unify_variable(x(1)),
    unify_variable(x(2)),
    get_structure((+)/2,0),
    unify_void(1),
    unify_value(x(1)),
    put_void(1),
    call(compile_clause/3),
    put_value(y(0),0),
    put_value(y(1),1),
    deallocate,
    execute(bc_compile_lst_clause/2)]).


predicate(compile_msg_start/2,122,static,private,user,[
    load_cut_level(2),
    try_me_else(1),
    put_atom(compile_msg,0),
    put_atom(f,1),
    call_c_test('Blt_G_Read',[0,1]),
    cut(x(2)),
    proceed,

label(1),
    trust_me_else_fail,
    allocate(2),
    get_variable(y(0),0),
    put_value(x(1),0),
    put_variable(y(1),1),
    call('$compile_msg_start/2_$aux1'/2),
    put_atom('compiling ~a for ~a...~n',0),
    put_list(1),
    unify_local_value(y(0)),
    unify_list,
    unify_local_value(y(1)),
    unify_nil,
    deallocate,
    execute(format/2)]).


predicate('$compile_msg_start/2_$aux1'/2,126,static,private,user,[
    load_cut_level(2),
    try_me_else(2),
    switch_on_term(1,1,fail,fail,fail),

label(1),
    get_atom(t,0),
    cut(x(2)),
    get_atom('native code',1),
    proceed,

label(2),
    trust_me_else_fail,
    get_atom('byte code',1),
    proceed]).


predicate(compile_msg_end/5,134,static,private,user,[
    load_cut_level(5),
    try_me_else(1),
    put_atom(compile_msg,0),
    put_atom(f,1),
    call_c_test('Blt_G_Read',[0,1]),
    cut(x(5)),
    proceed,

label(1),
    trust_me_else_fail,
    allocate(4),
    get_variable(y(0),0),
    get_variable(y(1),2),
    get_variable(y(2),3),
    put_variable(y(3),0),
    call(real_time/1),
    put_atom('~a compiled, ~d lines read - ~d bytes written, ~d ms~n',0),
    put_list(1),
    unify_local_value(y(0)),
    unify_list,
    unify_local_value(y(1)),
    unify_list,
    unify_local_value(y(2)),
    unify_list,
    unify_local_value(y(3)),
    unify_nil,
    deallocate,
    execute(format/2)]).


predicate(cur_pred/2,146,static,private,user,[
    put_atom(cur_func,2),
    call_c_test('Blt_G_Read',[2,0]),
    put_atom(cur_arity,0),
    call_c_test('Blt_G_Read',[0,1]),
    proceed]).


predicate(cur_pred_without_aux/2,151,static,private,user,[
    allocate(4),
    get_variable(y(0),0),
    get_variable(y(1),1),
    put_variable(y(2),0),
    put_variable(y(3),1),
    call(cur_pred/2),
    put_unsafe_value(y(2),0),
    put_unsafe_value(y(3),1),
    put_value(y(0),2),
    put_value(y(1),3),
    deallocate,
    execute('$pred_without_aux'/4)]).


predicate(init_counters/0,158,static,private,user,[
    load_cut_level(0),
    try_me_else(1),
    put_atom(statistics,1),
    put_atom(f,2),
    call_c_test('Blt_G_Read',[1,2]),
    cut(x(0)),
    proceed,

label(1),
    trust_me_else_fail,
    put_atom(user_read_file,0),
    put_integer(0,1),
    call_c_test('Blt_G_Assign',[0,1]),
    put_atom(real_read_file,0),
    put_integer(0,1),
    call_c_test('Blt_G_Assign',[0,1]),
    put_atom(user_syn_sugar,0),
    put_integer(0,1),
    call_c_test('Blt_G_Assign',[0,1]),
    put_atom(real_syn_sugar,0),
    put_integer(0,1),
    call_c_test('Blt_G_Assign',[0,1]),
    put_atom(user_internal,0),
    put_integer(0,1),
    call_c_test('Blt_G_Assign',[0,1]),
    put_atom(real_internal,0),
    put_integer(0,1),
    call_c_test('Blt_G_Assign',[0,1]),
    put_atom(user_code_gen,0),
    put_integer(0,1),
    call_c_test('Blt_G_Assign',[0,1]),
    put_atom(real_code_gen,0),
    put_integer(0,1),
    call_c_test('Blt_G_Assign',[0,1]),
    put_atom(user_reg_alloc,0),
    put_integer(0,1),
    call_c_test('Blt_G_Assign',[0,1]),
    put_atom(real_reg_alloc,0),
    put_integer(0,1),
    call_c_test('Blt_G_Assign',[0,1]),
    put_atom(user_indexing,0),
    put_integer(0,1),
    call_c_test('Blt_G_Assign',[0,1]),
    put_atom(real_indexing,0),
    put_integer(0,1),
    call_c_test('Blt_G_Assign',[0,1]),
    put_atom(user_first_arg,0),
    put_integer(0,1),
    call_c_test('Blt_G_Assign',[0,1]),
    put_atom(real_first_arg,0),
    put_integer(0,1),
    call_c_test('Blt_G_Assign',[0,1]),
    put_atom(user_wam_emit,0),
    put_integer(0,1),
    call_c_test('Blt_G_Assign',[0,1]),
    put_atom(real_wam_emit,0),
    put_integer(0,1),
    call_c_test('Blt_G_Assign',[0,1]),
    put_void(0),
    put_void(1),
    execute(last_times/2)]).


predicate(add_counter/2,176,static,private,user,[
    load_cut_level(2),
    try_me_else(1),
    put_atom(statistics,0),
    put_atom(f,1),
    call_c_test('Blt_G_Read',[0,1]),
    cut(x(2)),
    proceed,

label(1),
    trust_me_else_fail,
    allocate(4),
    get_variable(y(0),0),
    get_variable(y(1),1),
    put_variable(y(2),0),
    put_variable(y(3),1),
    call(last_times/2),
    put_value(y(0),0),
    put_variable(x(1),2),
    call_c_test('Blt_G_Read',[0,2]),
    put_value(y(1),2),
    put_variable(x(0),3),
    call_c_test('Blt_G_Read',[2,3]),
    math_fast_load_value(y(2),2),
    math_fast_load_value(x(1),1),
    function('Fct_Fast_Add',2,[2,1]),
    math_fast_load_value(y(3),1),
    math_fast_load_value(x(0),0),
    function('Fct_Fast_Add',1,[1,0]),
    put_value(y(0),0),
    call_c_test('Blt_G_Assign',[0,2]),
    put_value(y(1),0),
    call_c_test('Blt_G_Assign',[0,1]),
    deallocate,
    proceed]).


predicate(last_times/2,192,static,private,user,[
    allocate(1),
    get_variable(y(0),0),
    get_variable(x(0),1),
    put_list(1),
    unify_void(1),
    unify_list,
    unify_local_value(x(0)),
    unify_nil,
    put_atom(real_time,0),
    call(statistics/2),
    put_atom(runtime,0),
    put_list(1),
    unify_void(1),
    unify_list,
    unify_local_value(y(0)),
    unify_nil,
    deallocate,
    execute(statistics/2)]).


predicate(display_counters/0,199,static,private,user,[
    load_cut_level(0),
    try_me_else(1),
    put_atom(statistics,1),
    put_atom(f,2),
    call_c_test('Blt_G_Read',[1,2]),
    cut(x(0)),
    proceed,

label(1),
    trust_me_else_fail,
    allocate(22),
    put_atom(user_read_file,0),
    put_variable(y(0),1),
    call_c_test('Blt_G_Read',[0,1]),
    put_atom(real_read_file,0),
    put_variable(y(1),1),
    call_c_test('Blt_G_Read',[0,1]),
    put_atom(user_syn_sugar,0),
    put_variable(y(2),1),
    call_c_test('Blt_G_Read',[0,1]),
    put_atom(real_syn_sugar,0),
    put_variable(y(3),1),
    call_c_test('Blt_G_Read',[0,1]),
    put_atom(user_internal,0),
    put_variable(y(4),1),
    call_c_test('Blt_G_Read',[0,1]),
    put_atom(real_internal,0),
    put_variable(y(5),1),
    call_c_test('Blt_G_Read',[0,1]),
    put_atom(user_code_gen,0),
    put_variable(y(6),1),
    call_c_test('Blt_G_Read',[0,1]),
    put_atom(real_code_gen,0),
    put_variable(y(7),1),
    call_c_test('Blt_G_Read',[0,1]),
    put_atom(user_reg_alloc,0),
    put_variable(y(8),1),
    call_c_test('Blt_G_Read',[0,1]),
    put_atom(real_reg_alloc,0),
    put_variable(y(9),1),
    call_c_test('Blt_G_Read',[0,1]),
    put_atom(user_indexing,0),
    put_variable(y(10),1),
    call_c_test('Blt_G_Read',[0,1]),
    put_atom(real_indexing,0),
    put_variable(y(11),1),
    call_c_test('Blt_G_Read',[0,1]),
    put_atom(user_first_arg,0),
    put_variable(y(12),1),
    call_c_test('Blt_G_Read',[0,1]),
    put_atom(real_first_arg,0),
    put_variable(y(13),1),
    call_c_test('Blt_G_Read',[0,1]),
    put_atom(user_wam_emit,0),
    put_variable(y(14),1),
    call_c_test('Blt_G_Read',[0,1]),
    put_atom(real_wam_emit,0),
    put_variable(y(15),1),
    call_c_test('Blt_G_Read',[0,1]),
    math_fast_load_value(y(0),1),
    math_fast_load_value(y(2),0),
    function('Fct_Fast_Add',1,[1,0]),
    math_fast_load_value(y(4),0),
    function('Fct_Fast_Add',1,[1,0]),
    math_fast_load_value(y(6),0),
    function('Fct_Fast_Add',1,[1,0]),
    math_fast_load_value(y(8),0),
    function('Fct_Fast_Add',1,[1,0]),
    math_fast_load_value(y(10),0),
    function('Fct_Fast_Add',1,[1,0]),
    math_fast_load_value(y(10),0),
    function('Fct_Fast_Add',1,[1,0]),
    math_fast_load_value(y(14),0),
    function('Fct_Fast_Add',0,[1,0]),
    get_variable(y(16),0),
    math_fast_load_value(y(1),1),
    math_fast_load_value(y(3),0),
    function('Fct_Fast_Add',1,[1,0]),
    math_fast_load_value(y(5),0),
    function('Fct_Fast_Add',1,[1,0]),
    math_fast_load_value(y(7),0),
    function('Fct_Fast_Add',1,[1,0]),
    math_fast_load_value(y(9),0),
    function('Fct_Fast_Add',1,[1,0]),
    math_fast_load_value(y(11),0),
    function('Fct_Fast_Add',1,[1,0]),
    math_fast_load_value(y(11),0),
    function('Fct_Fast_Add',1,[1,0]),
    math_fast_load_value(y(15),0),
    function('Fct_Fast_Add',0,[1,0]),
    get_variable(y(17),0),
    put_variable(y(18),0),
    call(user_time/1),
    put_variable(y(19),0),
    call(real_time/1),
    math_fast_load_value(y(18),1),
    math_fast_load_value(y(16),0),
    function('Fct_Fast_Sub',0,[1,0]),
    get_variable(y(20),0),
    math_fast_load_value(y(19),1),
    math_fast_load_value(y(17),0),
    function('Fct_Fast_Sub',0,[1,0]),
    get_variable(y(21),0),
    put_atom('   Statistics (in ms)     user     real~n',0),
    put_nil(1),
    call(format/2),
    put_atom('   source reading     : %6d   %6d~n',0),
    put_list(1),
    unify_local_value(y(0)),
    unify_list,
    unify_local_value(y(1)),
    unify_nil,
    call(format/2),
    put_atom('   syntactic sugar    : %6d   %6d~n',0),
    put_list(1),
    unify_local_value(y(2)),
    unify_list,
    unify_local_value(y(3)),
    unify_nil,
    call(format/2),
    put_atom('   internal format    : %6d   %6d~n',0),
    put_list(1),
    unify_local_value(y(4)),
    unify_list,
    unify_local_value(y(5)),
    unify_nil,
    call(format/2),
    put_atom('   code generation    : %6d   %6d~n',0),
    put_list(1),
    unify_local_value(y(6)),
    unify_list,
    unify_local_value(y(7)),
    unify_nil,
    call(format/2),
    put_atom('   register allocation: %6d   %6d~n',0),
    put_list(1),
    unify_local_value(y(8)),
    unify_list,
    unify_local_value(y(9)),
    unify_nil,
    call(format/2),
    put_atom('   indexing           : %6d   %6d~n',0),
    put_list(1),
    unify_local_value(y(10)),
    unify_list,
    unify_local_value(y(11)),
    unify_nil,
    call(format/2),
    put_atom('   first arg computing: %6d   %6d~n',0),
    put_list(1),
    unify_local_value(y(12)),
    unify_list,
    unify_local_value(y(13)),
    unify_nil,
    call(format/2),
    put_atom('   code emission      : %6d   %6d~n',0),
    put_list(1),
    unify_local_value(y(14)),
    unify_list,
    unify_local_value(y(15)),
    unify_nil,
    call(format/2),
    put_atom('   other              : %6d   %6d~n',0),
    put_list(1),
    unify_local_value(y(20)),
    unify_list,
    unify_local_value(y(21)),
    unify_nil,
    call(format/2),
    put_atom('                Total : %6d   %6d~n',0),
    put_list(1),
    unify_local_value(y(18)),
    unify_list,
    unify_local_value(y(19)),
    unify_nil,
    deallocate,
    execute(format/2)]).


predicate(cmd_line_args/3,237,static,private,user,[
    allocate(2),
    get_variable(y(0),1),
    get_variable(y(1),2),
    put_atom(plfile,1),
    put_atom('',2),
    call_c_test('Blt_G_Assign',[1,2]),
    put_atom(wamfile,1),
    put_atom('',2),
    call_c_test('Blt_G_Assign',[1,2]),
    put_atom(inline,1),
    put_atom(t,2),
    call_c_test('Blt_G_Assign',[1,2]),
    put_atom(reorder,1),
    put_atom(t,2),
    call_c_test('Blt_G_Assign',[1,2]),
    put_atom(reg_opt,1),
    put_integer(2,2),
    call_c_test('Blt_G_Assign',[1,2]),
    put_atom(opt_last_subterm,1),
    put_atom(t,2),
    call_c_test('Blt_G_Assign',[1,2]),
    put_atom(keep_void_inst,1),
    put_atom(f,2),
    call_c_test('Blt_G_Assign',[1,2]),
    put_atom(susp_warn,1),
    put_atom(t,2),
    call_c_test('Blt_G_Assign',[1,2]),
    put_atom(singl_warn,1),
    put_atom(t,2),
    call_c_test('Blt_G_Assign',[1,2]),
    put_atom(redef_error,1),
    put_atom(t,2),
    call_c_test('Blt_G_Assign',[1,2]),
    put_atom(fast_math,1),
    put_atom(f,2),
    call_c_test('Blt_G_Assign',[1,2]),
    put_atom(native_code,1),
    put_atom(t,2),
    call_c_test('Blt_G_Assign',[1,2]),
    put_atom(call_c,1),
    put_atom(t,2),
    call_c_test('Blt_G_Assign',[1,2]),
    put_atom(statistics,1),
    put_atom(f,2),
    call_c_test('Blt_G_Assign',[1,2]),
    put_atom(compile_msg,1),
    put_atom(f,2),
    call_c_test('Blt_G_Assign',[1,2]),
    call(cmd_line_args/1),
    put_atom(plfile,0),
    put_value(y(0),1),
    call_c_test('Blt_G_Read',[0,1]),
    put_value(y(0),0),
    call('$cmd_line_args/3_$aux1'/1),
    put_atom(wamfile,0),
    put_value(y(1),1),
    call_c_test('Blt_G_Read',[0,1]),
    deallocate,
    proceed]).


predicate('$cmd_line_args/3_$aux1'/1,237,static,private,user,[
    load_cut_level(1),
    try_me_else(2),
    switch_on_term(1,1,fail,fail,fail),

label(1),
    allocate(0),
    get_atom('',0),
    cut(x(1)),
    put_atom('no input file~n',0),
    put_nil(1),
    call(format/2),
    deallocate,
    execute(abort/0),

label(2),
    trust_me_else_fail,
    proceed]).


predicate(cmd_line_args/1,262,static,private,user,[
    load_cut_level(1),
    switch_on_term(1,2,fail,4,fail),

label(1),
    try_me_else(3),

label(2),
    get_nil(0),
    proceed,

label(3),
    trust_me_else_fail,

label(4),
    allocate(2),
    get_list(0),
    unify_variable(x(0)),
    unify_variable(x(2)),
    get_variable(y(0),1),
    put_value(x(2),1),
    put_variable(y(1),2),
    call(cmd_line_arg1/3),
    cut(y(0)),
    put_unsafe_value(y(1),0),
    deallocate,
    execute(cmd_line_args/1)]).


predicate(cmd_line_arg1/3,270,static,private,user,[
    try_me_else(48),
    switch_on_term(2,1,fail,fail,fail),

label(1),
    switch_on_atom([('-o',3),('--output',5),('--pl-state',7),('--no-inline',9),('--no-reorder',11),('--no-reg-opt',13),('--min-reg-opt',15),('--no-opt-last-subterm',17),('--fast-math',19),('--keep-void-inst',21),('--no-susp-warn',23),('--no-singl-warn',25),('--no-redef-error',27),('-W',29),('--wam-for-native',31),('-w',33),('--wam-for-byte-code',35),('--no-call-c',37),('--statistics',39),('--compile-msg',41),('--version',43),('-h',45),('--help',47)]),

label(2),
    try_me_else(4),

label(3),
    get_atom('-o',0),
    put_atom('--output',0),
    execute(cmd_line_arg1/3),

label(4),
    retry_me_else(6),

label(5),
    allocate(1),
    get_atom('--output',0),
    put_value(x(1),0),
    put_variable(y(0),1),
    call('$cmd_line_arg1/3_$aux1'/3),
    put_atom(wamfile,1),
    put_variable(x(0),2),
    call_c_test('Blt_G_Read',[1,2]),
    call('$cmd_line_arg1/3_$aux2'/1),
    put_atom(wamfile,0),
    put_unsafe_value(y(0),1),
    call_c_test('Blt_G_Assign',[0,1]),
    deallocate,
    proceed,

label(6),
    retry_me_else(8),

label(7),
    allocate(0),
    get_atom('--pl-state',0),
    get_list(1),
    unify_variable(x(0)),
    unify_local_value(x(2)),
    call(read_pl_state_file/1),
    deallocate,
    execute('$cmd_line_arg1/3_$aux3'/0),

label(8),
    retry_me_else(10),

label(9),
    get_atom('--no-inline',0),
    get_value(x(2),1),
    put_atom(inline,0),
    put_atom(f,1),
    call_c_test('Blt_G_Assign',[0,1]),
    proceed,

label(10),
    retry_me_else(12),

label(11),
    get_atom('--no-reorder',0),
    get_value(x(2),1),
    put_atom(reorder,0),
    put_atom(f,1),
    call_c_test('Blt_G_Assign',[0,1]),
    proceed,

label(12),
    retry_me_else(14),

label(13),
    get_atom('--no-reg-opt',0),
    get_value(x(2),1),
    put_atom(reg_opt,0),
    put_integer(0,1),
    call_c_test('Blt_G_Assign',[0,1]),
    proceed,

label(14),
    retry_me_else(16),

label(15),
    get_atom('--min-reg-opt',0),
    get_value(x(2),1),
    put_atom(reg_opt,0),
    put_integer(1,1),
    call_c_test('Blt_G_Assign',[0,1]),
    proceed,

label(16),
    retry_me_else(18),

label(17),
    get_atom('--no-opt-last-subterm',0),
    get_value(x(2),1),
    put_atom(opt_last_subterm,0),
    put_atom(f,1),
    call_c_test('Blt_G_Assign',[0,1]),
    proceed,

label(18),
    retry_me_else(20),

label(19),
    get_atom('--fast-math',0),
    get_value(x(2),1),
    put_atom(fast_math,0),
    put_atom(t,1),
    call_c_test('Blt_G_Assign',[0,1]),
    proceed,

label(20),
    retry_me_else(22),

label(21),
    get_atom('--keep-void-inst',0),
    get_value(x(2),1),
    put_atom(keep_void_inst,0),
    put_atom(t,1),
    call_c_test('Blt_G_Assign',[0,1]),
    proceed,

label(22),
    retry_me_else(24),

label(23),
    get_atom('--no-susp-warn',0),
    get_value(x(2),1),
    put_atom(susp_warn,0),
    put_atom(f,1),
    call_c_test('Blt_G_Assign',[0,1]),
    proceed,

label(24),
    retry_me_else(26),

label(25),
    get_atom('--no-singl-warn',0),
    get_value(x(2),1),
    put_atom(singl_warn,0),
    put_atom(f,1),
    call_c_test('Blt_G_Assign',[0,1]),
    proceed,

label(26),
    retry_me_else(28),

label(27),
    get_atom('--no-redef-error',0),
    get_value(x(2),1),
    put_atom(redef_error,0),
    put_atom(f,1),
    call_c_test('Blt_G_Assign',[0,1]),
    proceed,

label(28),
    retry_me_else(30),

label(29),
    get_atom('-W',0),
    put_atom('--wam-for-native',0),
    execute(cmd_line_arg1/3),

label(30),
    retry_me_else(32),

label(31),
    get_atom('--wam-for-native',0),
    get_value(x(2),1),
    put_atom(native_code,0),
    put_atom(t,1),
    call_c_test('Blt_G_Assign',[0,1]),
    proceed,

label(32),
    retry_me_else(34),

label(33),
    get_atom('-w',0),
    put_atom('--wam-for-byte-code',0),
    execute(cmd_line_arg1/3),

label(34),
    retry_me_else(36),

label(35),
    get_atom('--wam-for-byte-code',0),
    get_value(x(2),1),
    put_atom(native_code,0),
    put_atom(f,1),
    call_c_test('Blt_G_Assign',[0,1]),
    put_atom(inline,0),
    put_atom(f,1),
    call_c_test('Blt_G_Assign',[0,1]),
    put_atom(call_c,0),
    put_atom(f,1),
    call_c_test('Blt_G_Assign',[0,1]),
    proceed,

label(36),
    retry_me_else(38),

label(37),
    get_atom('--no-call-c',0),
    get_value(x(2),1),
    put_atom(call_c,0),
    put_atom(f,1),
    call_c_test('Blt_G_Assign',[0,1]),
    proceed,

label(38),
    retry_me_else(40),

label(39),
    get_atom('--statistics',0),
    get_value(x(2),1),
    put_atom(statistics,0),
    put_atom(t,1),
    call_c_test('Blt_G_Assign',[0,1]),
    proceed,

label(40),
    retry_me_else(42),

label(41),
    get_atom('--compile-msg',0),
    get_value(x(2),1),
    put_atom(compile_msg,0),
    put_atom(t,1),
    call_c_test('Blt_G_Assign',[0,1]),
    proceed,

label(42),
    retry_me_else(44),

label(43),
    allocate(0),
    get_atom('--version',0),
    get_value(x(2),1),
    call(display_copying/0),
    deallocate,
    execute(stop/0),

label(44),
    retry_me_else(46),

label(45),
    get_atom('-h',0),
    put_atom('--help',0),
    execute(cmd_line_arg1/3),

label(46),
    trust_me_else_fail,

label(47),
    get_atom('--help',0),
    get_value(x(2),1),
    execute('$cmd_line_arg1/3_$aux4'/0),

label(48),
    retry_me_else(49),
    allocate(1),
    get_variable(y(0),0),
    put_value(y(0),0),
    put_integer(0,1),
    put_integer(1,2),
    put_void(3),
    put_atom(-,4),
    call(sub_atom/5),
    put_atom('unknown option ~a - try pl2wam --help~n',0),
    put_list(1),
    unify_local_value(y(0)),
    unify_nil,
    call(format/2),
    deallocate,
    execute(abort/0),

label(49),
    trust_me_else_fail,
    allocate(1),
    get_variable(y(0),0),
    get_value(x(2),1),
    put_atom(plfile,1),
    put_variable(x(0),2),
    call_c_test('Blt_G_Read',[1,2]),
    call('$cmd_line_arg1/3_$aux5'/1),
    put_atom(plfile,0),
    put_value(y(0),1),
    call_c_test('Blt_G_Assign',[0,1]),
    deallocate,
    proceed]).


predicate('$cmd_line_arg1/3_$aux5'/1,360,static,private,user,[
    load_cut_level(1),
    try_me_else(2),
    switch_on_term(1,1,fail,fail,fail),

label(1),
    get_atom('',0),
    cut(x(1)),
    proceed,

label(2),
    trust_me_else_fail,
    allocate(0),
    put_list(1),
    unify_local_value(x(0)),
    unify_nil,
    put_atom('input file already specified (~a)~n',0),
    call(format/2),
    deallocate,
    execute(abort/0)]).


predicate('$cmd_line_arg1/3_$aux4'/0,350,static,private,user,[
    try_me_else(1),
    allocate(1),
    put_variable(y(0),0),
    call(h/1),
    put_value(y(0),0),
    call(write/1),
    call(nl/0),
    fail,

label(1),
    trust_me_else_fail,
    allocate(0),
    call(nl/0),
    put_atom('Report bugs to bug-prolog@gnu.org.',0),
    call(write/1),
    call(nl/0),
    deallocate,
    execute(stop/0)]).


predicate('$cmd_line_arg1/3_$aux3'/0,284,static,private,user,[
    load_cut_level(0),
    try_me_else(1),
    allocate(1),
    get_variable(y(0),0),
    put_atom(singleton_warning,0),
    put_atom(off,1),
    call(current_prolog_flag/2),
    cut(y(0)),
    put_atom(singl_warn,0),
    put_atom(f,1),
    call_c_test('Blt_G_Assign',[0,1]),
    deallocate,
    proceed,

label(1),
    trust_me_else_fail,
    proceed]).


predicate('$cmd_line_arg1/3_$aux2'/1,273,static,private,user,[
    load_cut_level(1),
    try_me_else(2),
    switch_on_term(1,1,fail,fail,fail),

label(1),
    get_atom('',0),
    cut(x(1)),
    proceed,

label(2),
    trust_me_else_fail,
    allocate(0),
    put_list(1),
    unify_local_value(x(0)),
    unify_nil,
    put_atom('output file already specified (~a)~n',0),
    call(format/2),
    deallocate,
    execute(abort/0)]).


predicate('$cmd_line_arg1/3_$aux1'/3,273,static,private,user,[
    try_me_else(2),
    switch_on_term(1,fail,fail,1,fail),

label(1),
    allocate(1),
    get_list(0),
    unify_local_value(x(1)),
    unify_local_value(x(2)),
    put_value(x(1),0),
    put_integer(0,1),
    put_integer(1,2),
    put_void(3),
    put_variable(y(0),4),
    call(sub_atom/5),
    put_unsafe_value(y(0),0),
    put_atom(-,1),
    call_c_test('Blt_Term_Neq',[0,1]),
    deallocate,
    proceed,

label(2),
    trust_me_else_fail,
    allocate(0),
    put_atom('FILE missing after --output option~n',0),
    put_nil(1),
    call(format/2),
    deallocate,
    execute(abort/0)]).


predicate(display_copying/0,373,static,private,user,[
    allocate(3),
    put_atom(prolog_name,0),
    put_variable(y(0),1),
    call(current_prolog_flag/2),
    put_atom(prolog_version,0),
    put_variable(y(1),1),
    call(current_prolog_flag/2),
    put_atom(prolog_copyright,0),
    put_variable(y(2),1),
    call(current_prolog_flag/2),
    put_atom('Prolog to Wam Compiler (~a) ~a~n',0),
    put_list(1),
    unify_local_value(y(0)),
    unify_list,
    unify_local_value(y(1)),
    unify_nil,
    call(format/2),
    put_atom('By Daniel Diaz~n',0),
    put_nil(1),
    call(format/2),
    put_value(y(2),0),
    call(write/1),
    call(nl/0),
    put_atom('~a comes with ABSOLUTELY NO WARRANTY.~n',0),
    put_list(1),
    unify_local_value(y(0)),
    unify_nil,
    call(format/2),
    put_atom('You may redistribute copies of ~a~n',0),
    put_list(1),
    unify_local_value(y(0)),
    unify_nil,
    call(format/2),
    put_atom('under the terms of the GNU General Public License.~n',0),
    put_nil(1),
    call(format/2),
    put_atom('For more information about these matters, see the files named COPYING.~n',0),
    put_nil(1),
    deallocate,
    execute(format/2)]).


predicate(h/1,390,static,private,user,[
    switch_on_term(3,1,fail,fail,fail),

label(1),
    switch_on_atom([('Usage: pl2wam [OPTION...] FILE',4),('',2),('Options:',8),('  -o FILE, --output FILE      set output file name',10),('  -W, --wam-for-native        produce a WAM file for native code',12),('  -w, --wam-for-byte-code     produce a WAM file for byte-code (force --no-call-c)',14),('  --pl-state FILE             read FILE to set the initial Prolog state',16),('  --no-inline                 do not inline predicates',18),('  --no-reorder                do not reorder predicate arguments',20),('  --no-reg-opt                do not optimize registers',22),('  --min-reg-opt               minimally optimize registers',24),('  --no-opt-last-subterm       do not optimize last subterm compilation',26),('  --fast-math                 fast mathematical mode (assume integer arithmetic)',28),('  --keep-void-inst            keep void instructions in the output file',30),('  --no-susp-warn              do not show warnings for suspicious predicates',32),('  --no-singl-warn             do not show warnings for named singleton variables',34),('  --no-redef-error            do not show errors for built-in redefinitions',36),('  --no-call-c                 do not allow the use of fd_tell, ''$call_c'',...',38),('  --compile-msg               print a compile message',40),('  --statistics                print statistics information',42),('  --help                      print this help and exit',44),('  --version                   print version number and exit',46),('''user'' can be given as FILE for the standard input/output',50)]),

label(2),
    try(6),
    trust(48),

label(3),
    try_me_else(5),

label(4),
    get_atom('Usage: pl2wam [OPTION...] FILE',0),
    proceed,

label(5),
    retry_me_else(7),

label(6),
    get_atom('',0),
    proceed,

label(7),
    retry_me_else(9),

label(8),
    get_atom('Options:',0),
    proceed,

label(9),
    retry_me_else(11),

label(10),
    get_atom('  -o FILE, --output FILE      set output file name',0),
    proceed,

label(11),
    retry_me_else(13),

label(12),
    get_atom('  -W, --wam-for-native        produce a WAM file for native code',0),
    proceed,

label(13),
    retry_me_else(15),

label(14),
    get_atom('  -w, --wam-for-byte-code     produce a WAM file for byte-code (force --no-call-c)',0),
    proceed,

label(15),
    retry_me_else(17),

label(16),
    get_atom('  --pl-state FILE             read FILE to set the initial Prolog state',0),
    proceed,

label(17),
    retry_me_else(19),

label(18),
    get_atom('  --no-inline                 do not inline predicates',0),
    proceed,

label(19),
    retry_me_else(21),

label(20),
    get_atom('  --no-reorder                do not reorder predicate arguments',0),
    proceed,

label(21),
    retry_me_else(23),

label(22),
    get_atom('  --no-reg-opt                do not optimize registers',0),
    proceed,

label(23),
    retry_me_else(25),

label(24),
    get_atom('  --min-reg-opt               minimally optimize registers',0),
    proceed,

label(25),
    retry_me_else(27),

label(26),
    get_atom('  --no-opt-last-subterm       do not optimize last subterm compilation',0),
    proceed,

label(27),
    retry_me_else(29),

label(28),
    get_atom('  --fast-math                 fast mathematical mode (assume integer arithmetic)',0),
    proceed,

label(29),
    retry_me_else(31),

label(30),
    get_atom('  --keep-void-inst            keep void instructions in the output file',0),
    proceed,

label(31),
    retry_me_else(33),

label(32),
    get_atom('  --no-susp-warn              do not show warnings for suspicious predicates',0),
    proceed,

label(33),
    retry_me_else(35),

label(34),
    get_atom('  --no-singl-warn             do not show warnings for named singleton variables',0),
    proceed,

label(35),
    retry_me_else(37),

label(36),
    get_atom('  --no-redef-error            do not show errors for built-in redefinitions',0),
    proceed,

label(37),
    retry_me_else(39),

label(38),
    get_atom('  --no-call-c                 do not allow the use of fd_tell, ''$call_c'',...',0),
    proceed,

label(39),
    retry_me_else(41),

label(40),
    get_atom('  --compile-msg               print a compile message',0),
    proceed,

label(41),
    retry_me_else(43),

label(42),
    get_atom('  --statistics                print statistics information',0),
    proceed,

label(43),
    retry_me_else(45),

label(44),
    get_atom('  --help                      print this help and exit',0),
    proceed,

label(45),
    retry_me_else(47),

label(46),
    get_atom('  --version                   print version number and exit',0),
    proceed,

label(47),
    retry_me_else(49),

label(48),
    get_atom('',0),
    proceed,

label(49),
    trust_me_else_fail,

label(50),
    get_atom('''user'' can be given as FILE for the standard input/output',0),
    proceed]).


predicate(go/0,420,static,private,user,[
    allocate(1),
    put_variable(y(0),0),
    call(argument_list/1),
    put_unsafe_value(y(0),0),
    deallocate,
    execute(pl2wam/1)]).


directive(422,user,[
    execute(go/0)]).
