% compiler: GNU Prolog 1.4.2
% file    : wam_emit.pl


file_name('/home/diaz/GP/src/src/Pl2Wam/wam_emit.pl').


predicate(emit_code_init/2,104,static,private,monofile,global,[
    allocate(6),
    get_variable(y(0),0),
    put_value(x(1),0),
    put_variable(y(1),1),
    call(prolog_file_name/2),
    put_value(y(0),0),
    put_value(y(1),1),
    put_variable(y(2),2),
    call(emit_code_files/3),
    put_value(y(2),0),
    put_variable(y(3),1),
    call('$emit_code_init/2_$aux1'/2),
    put_atom(streamwamfile,0),
    put_value(y(3),1),
    call_c('Pl_Blt_G_Assign',[fast_call],[x(0),x(1)]),
    put_atom(cur_pl_file,0),
    put_atom('',1),
    call_c('Pl_Blt_G_Assign',[fast_call],[x(0),x(1)]),
    put_variable(y(4),0),
    call(prolog_name/1),
    put_variable(y(5),0),
    call(prolog_version/1),
    put_value(y(3),0),
    put_atom('%% compiler: ~a ~a~n',1),
    put_list(2),
    unify_local_value(y(4)),
    unify_list,
    unify_local_value(y(5)),
    unify_nil,
    call(format/3),
    put_value(y(3),0),
    put_atom('%% file    : ~a~n',1),
    put_list(2),
    unify_local_value(y(1)),
    unify_nil,
    call(format/3),
    put_atom(wam_comment,1),
    put_variable(x(0),2),
    call_c('Pl_Blt_G_Read',[fast_call,boolean],[x(1),x(2)]),
    put_unsafe_value(y(3),1),
    deallocate,
    execute('$emit_code_init/2_$aux2'/2)]).


predicate('$emit_code_init/2_$aux2'/2,104,static,private,monofile,local,[
    pragma_arity(3),
    get_current_choice(x(2)),
    try_me_else(1),
    get_atom('',0),
    cut(x(2)),
    proceed,

label(1),
    trust_me_else_fail,
    put_list(2),
    unify_local_value(x(0)),
    unify_nil,
    put_value(x(1),0),
    put_atom('%%           ~a~n',1),
    execute(format/3)]).


predicate('$emit_code_init/2_$aux1'/2,104,static,private,monofile,local,[
    pragma_arity(3),
    get_current_choice(x(2)),
    try_me_else(1),
    get_atom(user,0),
    cut(x(2)),
    put_value(x(1),0),
    execute(current_output/1),

label(1),
    trust_me_else_fail,
    put_value(x(1),2),
    put_atom(write,1),
    execute(open/3)]).


predicate(emit_code_files/3,127,static,private,monofile,global,[
    pragma_arity(4),
    get_current_choice(x(3)),
    try_me_else(7),
    switch_on_term(3,1,fail,fail,fail),

label(1),
    switch_on_atom([('',2)]),

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

label(3),
    try_me_else(5),

label(4),
    get_atom('',0),
    get_atom(user,1),
    get_atom(user,2),
    cut(x(3)),
    proceed,

label(5),
    trust_me_else_fail,

label(6),
    allocate(4),
    get_atom('',0),
    get_variable(y(0),2),
    cut(x(3)),
    put_value(x(1),0),
    put_void(1),
    put_variable(y(1),2),
    put_variable(y(2),3),
    call(decompose_file_name/4),
    put_variable(y(3),0),
    call('$emit_code_files/3_$aux1'/1),
    put_unsafe_value(y(2),0),
    put_unsafe_value(y(1),1),
    put_unsafe_value(y(3),2),
    put_value(y(0),3),
    deallocate,
    execute('$emit_code_files/3_$aux2'/4),

label(7),
    trust_me_else_fail,
    get_value(x(2),0),
    proceed]).


predicate('$emit_code_files/3_$aux2'/4,130,static,private,monofile,local,[
    pragma_arity(5),
    get_current_choice(x(4)),
    try_me_else(1),
    get_atom('.pl',0),
    cut(x(4)),
    put_value(x(1),0),
    put_value(x(2),1),
    put_value(x(3),2),
    execute(atom_concat/3),

label(1),
    trust_me_else_fail,
    allocate(3),
    get_variable(y(0),2),
    get_variable(y(1),3),
    get_variable(x(2),1),
    get_variable(x(1),0),
    put_value(x(2),0),
    put_variable(y(2),2),
    call(atom_concat/3),
    put_unsafe_value(y(2),0),
    put_value(y(0),1),
    put_value(y(1),2),
    deallocate,
    execute(atom_concat/3)]).


predicate('$emit_code_files/3_$aux1'/1,130,static,private,monofile,local,[
    pragma_arity(2),
    get_current_choice(x(1)),
    try_me_else(1),
    put_atom(native_code,2),
    put_atom(t,3),
    call_c('Pl_Blt_G_Read',[fast_call,boolean],[x(2),x(3)]),
    cut(x(1)),
    get_atom('.wam',0),
    proceed,

label(1),
    trust_me_else_fail,
    get_atom('.wbc',0),
    proceed]).


predicate(emit_code_term/2,148,static,private,monofile,global,[
    allocate(2),
    get_variable(y(0),1),
    put_atom(streamwamfile,1),
    put_variable(y(1),2),
    call_c('Pl_Blt_G_Read',[fast_call,boolean],[x(1),x(2)]),
    put_value(x(0),1),
    put_value(y(1),0),
    call(character_count/2),
    put_value(y(1),0),
    put_value(y(0),1),
    call(line_count/2),
    put_unsafe_value(y(1),0),
    deallocate,
    execute(close/1)]).


predicate(emit_code/5,157,static,private,monofile,global,[
    allocate(2),
    get_variable(y(0),4),
    put_atom(streamwamfile,4),
    put_variable(y(1),5),
    call_c('Pl_Blt_G_Read',[fast_call,boolean],[x(4),x(5)]),
    put_value(y(1),4),
    put_void(5),
    call(emit_pred_start/6),
    put_value(y(0),0),
    put_void(1),
    put_value(y(1),2),
    call(emit_wam_code/3),
    put_value(y(1),0),
    put_atom(']).',1),
    call(write/2),
    put_unsafe_value(y(1),0),
    deallocate,
    execute(nl/1)]).


predicate(emit_pred_start/6,167,static,private,monofile,global,[
    pragma_arity(7),
    get_current_choice(x(6)),
    try_me_else(1),
    allocate(5),
    get_integer(0,1),
    get_variable(y(0),2),
    get_variable(y(1),3),
    get_variable(y(2),4),
    get_variable(y(3),5),
    get_variable(y(4),6),
    put_value(y(3),1),
    call('$emit_pred_start/6_$aux1'/2),
    cut(y(4)),
    put_value(y(0),0),
    put_value(y(2),1),
    call(emit_file_name_if_needed/2),
    put_value(y(2),0),
    put_atom('~n~ndirective(~d,~a,',1),
    put_list(2),
    unify_local_value(y(1)),
    unify_list,
    unify_local_value(y(3)),
    unify_nil,
    deallocate,
    execute(format/3),

label(1),
    trust_me_else_fail,
    allocate(8),
    get_variable(y(0),0),
    get_variable(y(1),1),
    get_variable(y(2),3),
    get_variable(y(3),4),
    put_value(x(2),0),
    put_value(y(3),1),
    call(emit_file_name_if_needed/2),
    put_value(y(0),0),
    put_value(y(1),1),
    put_variable(y(4),2),
    call('$emit_pred_start/6_$aux2'/3),
    put_value(y(0),0),
    put_value(y(1),1),
    put_variable(y(5),2),
    call('$emit_pred_start/6_$aux3'/3),
    put_value(y(0),0),
    put_value(y(1),1),
    put_variable(y(6),2),
    call('$emit_pred_start/6_$aux4'/3),
    put_atom(module,0),
    put_variable(x(2),1),
    call_c('Pl_Blt_G_Read',[fast_call,boolean],[x(0),x(1)]),
    put_value(y(0),0),
    put_value(y(1),1),
    put_void(3),
    put_variable(y(7),4),
    call(export_type/5),
    put_value(y(3),0),
    put_atom('~n~npredicate(~q,~d,~a,~a,~a,~a,',1),
    put_structure((/)/2,3),
    unify_local_value(y(0)),
    unify_local_value(y(1)),
    put_list(2),
    unify_value(x(3)),
    unify_list,
    unify_local_value(y(2)),
    unify_list,
    unify_local_value(y(4)),
    unify_list,
    unify_local_value(y(5)),
    unify_list,
    unify_local_value(y(6)),
    unify_list,
    unify_local_value(y(7)),
    unify_nil,
    deallocate,
    execute(format/3)]).


predicate('$emit_pred_start/6_$aux4'/3,176,static,private,monofile,local,[
    pragma_arity(4),
    get_current_choice(x(3)),
    try_me_else(1),
    allocate(2),
    get_variable(y(0),2),
    get_variable(x(2),1),
    get_variable(y(1),3),
    put_value(x(0),1),
    put_atom(multi,0),
    call(test_pred_info/3),
    cut(y(1)),
    put_value(y(0),0),
    get_atom(multifile,0),
    deallocate,
    proceed,

label(1),
    trust_me_else_fail,
    get_atom(monofile,2),
    proceed]).


predicate('$emit_pred_start/6_$aux3'/3,176,static,private,monofile,local,[
    pragma_arity(4),
    get_current_choice(x(3)),
    try_me_else(1),
    allocate(2),
    get_variable(y(0),2),
    get_variable(x(2),1),
    get_variable(y(1),3),
    put_value(x(0),1),
    put_atom(pub,0),
    call(test_pred_info/3),
    cut(y(1)),
    put_value(y(0),0),
    get_atom(public,0),
    deallocate,
    proceed,

label(1),
    trust_me_else_fail,
    get_atom(private,2),
    proceed]).


predicate('$emit_pred_start/6_$aux2'/3,176,static,private,monofile,local,[
    pragma_arity(4),
    get_current_choice(x(3)),
    try_me_else(1),
    allocate(2),
    get_variable(y(0),2),
    get_variable(x(2),1),
    get_variable(y(1),3),
    put_value(x(0),1),
    put_atom(dyn,0),
    call(test_pred_info/3),
    cut(y(1)),
    put_value(y(0),0),
    get_atom(dynamic,0),
    deallocate,
    proceed,

label(1),
    trust_me_else_fail,
    get_atom(static,2),
    proceed]).


predicate('$emit_pred_start/6_$aux1'/2,167,static,private,monofile,local,[
    switch_on_term(2,1,fail,fail,fail),

label(1),
    switch_on_atom([('$exe_user',3),('$exe_system',5)]),

label(2),
    try_me_else(4),

label(3),
    get_atom('$exe_user',0),
    get_atom(user,1),
    proceed,

label(4),
    trust_me_else_fail,

label(5),
    get_atom('$exe_system',0),
    get_atom(system,1),
    proceed]).


predicate(export_type/5,198,static,private,monofile,global,[
    pragma_arity(6),
    get_current_choice(x(5)),
    try_me_else(1),
    allocate(1),
    get_atom(local,4),
    get_value(x(3),2),
    get_variable(y(0),5),
    call('$aux_name'/1),
    cut(y(0)),
    deallocate,
    proceed,

label(1),
    retry_me_else(2),
    allocate(1),
    get_atom(local,4),
    get_value(x(3),2),
    get_variable(x(2),1),
    get_variable(y(0),5),
    put_value(x(0),1),
    put_atom(multi,0),
    call(test_pred_info/3),
    cut(y(0)),
    deallocate,
    proceed,

label(2),
    retry_me_else(3),
    allocate(1),
    get_atom(system,3),
    get_atom(built_in,4),
    get_variable(x(2),1),
    get_variable(y(0),5),
    put_value(x(0),1),
    put_atom(bpl,0),
    call(test_pred_info/3),
    cut(y(0)),
    deallocate,
    proceed,

label(3),
    retry_me_else(4),
    allocate(1),
    get_atom(system,3),
    get_atom(built_in_fd,4),
    get_variable(x(2),1),
    get_variable(y(0),5),
    put_value(x(0),1),
    put_atom(bfd,0),
    call(test_pred_info/3),
    cut(y(0)),
    deallocate,
    proceed,

label(4),
    retry_me_else(5),
    allocate(1),
    get_atom(system,2),
    get_atom(system,3),
    get_atom(built_in,4),
    get_variable(y(0),5),
    call(is_exported/2),
    cut(y(0)),
    deallocate,
    proceed,

label(5),
    retry_me_else(6),
    get_atom(global,4),
    get_value(x(3),2),
    put_atom(module_already_seen,0),
    put_atom(f,1),
    call_c('Pl_Blt_G_Read',[fast_call,boolean],[x(0),x(1)]),
    cut(x(5)),
    proceed,

label(6),
    retry_me_else(7),
    allocate(1),
    get_atom(global,4),
    get_value(x(3),2),
    get_variable(y(0),5),
    call(is_exported/2),
    cut(y(0)),
    deallocate,
    proceed,

label(7),
    trust_me_else_fail,
    get_atom(local,4),
    get_value(x(3),2),
    proceed]).


predicate(emit_file_name_if_needed/2,224,static,private,monofile,global,[
    pragma_arity(3),
    get_current_choice(x(2)),
    try_me_else(1),
    put_atom(cur_pl_file,1),
    call_c('Pl_Blt_G_Read',[fast_call,boolean],[x(1),x(0)]),
    cut(x(2)),
    proceed,

label(1),
    trust_me_else_fail,
    allocate(1),
    get_variable(y(0),0),
    put_value(x(1),0),
    put_atom('~n~nfile_name(~q).~n',1),
    put_list(2),
    unify_local_value(y(0)),
    unify_nil,
    call(format/3),
    put_atom(cur_pl_file,0),
    put_value(y(0),1),
    call_c('Pl_Blt_G_Assign',[fast_call],[x(0),x(1)]),
    deallocate,
    proceed]).


predicate(emit_wam_code/3,234,static,private,monofile,global,[
    pragma_arity(4),
    get_current_choice(x(3)),
    try_me_else(5),
    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(4),
    get_variable(y(1),1),
    get_variable(y(2),2),
    get_list(0),
    unify_variable(x(0)),
    unify_variable(y(0)),
    get_variable(y(3),3),
    put_value(y(1),1),
    put_value(y(2),2),
    call(emit_wam_code/3),
    put_value(y(0),0),
    put_value(y(1),1),
    put_value(y(2),2),
    call(emit_wam_code/3),
    cut(y(3)),
    deallocate,
    proceed,

label(5),
    retry_me_else(6),
    allocate(3),
    get_variable(y(0),1),
    get_variable(y(1),2),
    put_variable(y(2),1),
    call(special_form/2),
    put_unsafe_value(y(2),0),
    put_value(y(0),1),
    put_value(y(1),2),
    deallocate,
    execute(emit_wam_code/3),

label(6),
    retry_me_else(7),
    allocate(1),
    get_variable(y(0),3),
    put_atom(keep_void_inst,2),
    put_variable(x(1),3),
    call_c('Pl_Blt_G_Read',[fast_call,boolean],[x(2),x(3)]),
    call(dummy_instruction/2),
    cut(y(0)),
    deallocate,
    proceed,

label(7),
    retry_me_else(8),
    allocate(3),
    get_variable(y(0),0),
    get_variable(y(1),2),
    put_value(y(0),0),
    get_structure(label/1,0),
    unify_void(1),
    cut(x(3)),
    put_value(x(1),0),
    put_variable(y(2),1),
    call('$emit_wam_code/3_$aux1'/2),
    put_value(y(1),0),
    put_atom('~a~n~n',1),
    put_list(2),
    unify_local_value(y(2)),
    unify_nil,
    call(format/3),
    put_value(y(0),0),
    put_value(y(1),1),
    deallocate,
    execute(emit_one_inst/2),

label(8),
    trust_me_else_fail,
    allocate(3),
    get_variable(y(0),0),
    get_variable(y(1),2),
    put_value(x(1),0),
    put_variable(y(2),1),
    call('$emit_wam_code/3_$aux2'/2),
    put_value(y(1),0),
    put_atom('~a~n    ',1),
    put_list(2),
    unify_local_value(y(2)),
    unify_nil,
    call(format/3),
    put_value(y(0),0),
    put_value(y(1),1),
    deallocate,
    execute(emit_one_inst/2)]).


predicate('$emit_wam_code/3_$aux2'/2,258,static,private,monofile,local,[
    pragma_arity(3),
    get_current_choice(x(2)),
    try_me_else(1),
    call_c('Pl_Blt_Var',[fast_call,boolean],[x(0)]),
    cut(x(2)),
    get_atom('[',1),
    get_atom(f,0),
    proceed,

label(1),
    trust_me_else_fail,
    get_atom(',',1),
    proceed]).


predicate('$emit_wam_code/3_$aux1'/2,248,static,private,monofile,local,[
    pragma_arity(3),
    get_current_choice(x(2)),
    try_me_else(1),
    call_c('Pl_Blt_Var',[fast_call,boolean],[x(0)]),
    cut(x(2)),
    get_atom('[',1),
    get_atom(f,0),
    proceed,

label(1),
    trust_me_else_fail,
    get_atom(',',1),
    proceed]).


predicate(emit_one_inst/2,270,static,private,monofile,global,[
    pragma_arity(3),
    get_current_choice(x(2)),
    try_me_else(1),
    get_variable(x(3),1),
    get_variable(x(1),0),
    call_c('Pl_Blt_Atom',[fast_call,boolean],[x(1)]),
    cut(x(2)),
    put_value(x(3),0),
    execute(writeq/2),

label(1),
    trust_me_else_fail,
    allocate(3),
    get_variable(y(0),0),
    get_variable(y(1),1),
    put_value(y(0),0),
    put_variable(x(1),2),
    put_variable(y(2),3),
    call_c('Pl_Blt_Functor',[fast_call,boolean],[x(0),x(2),x(3)]),
    put_value(y(1),0),
    call(writeq/2),
    put_integer(0,0),
    put_value(y(2),1),
    put_value(y(0),2),
    put_value(y(1),3),
    call(emit_args/4),
    put_value(y(1),0),
    put_atom(')',1),
    deallocate,
    execute(write/2)]).


predicate(emit_args/4,280,static,private,monofile,global,[
    pragma_arity(5),
    get_current_choice(x(4)),
    try_me_else(1),
    get_value(x(1),0),
    cut(x(4)),
    proceed,

label(1),
    trust_me_else_fail,
    allocate(4),
    get_variable(y(0),1),
    get_variable(y(1),2),
    get_variable(y(2),3),
    math_fast_load_value(x(0),0),
    call_c('Pl_Fct_Fast_Inc',[fast_call,x(0)],[x(0)]),
    get_variable(y(3),0),
    put_value(y(3),0),
    put_value(y(2),1),
    call('$emit_args/4_$aux1'/2),
    put_value(y(3),1),
    put_value(y(1),2),
    put_variable(x(0),3),
    call_c('Pl_Blt_Arg',[fast_call,boolean],[x(1),x(2),x(3)]),
    put_value(y(2),1),
    call(emit_one_arg/2),
    put_unsafe_value(y(3),0),
    put_value(y(0),1),
    put_value(y(1),2),
    put_value(y(2),3),
    deallocate,
    execute(emit_args/4)]).


predicate('$emit_args/4_$aux1'/2,283,static,private,monofile,local,[
    pragma_arity(3),
    get_current_choice(x(2)),
    try_me_else(1),
    get_integer(1,0),
    cut(x(2)),
    put_value(x(1),0),
    put_atom('(',1),
    execute(put_char/2),

label(1),
    trust_me_else_fail,
    put_value(x(1),0),
    put_atom(',',1),
    execute(put_char/2)]).


predicate(emit_one_arg/2,293,static,private,monofile,global,[
    pragma_arity(3),
    get_current_choice(x(2)),
    try_me_else(1),
    allocate(6),
    get_list(0),
    unify_variable(y(0)),
    unify_variable(y(1)),
    get_variable(y(2),1),
    get_variable(y(3),2),
    put_value(y(1),0),
    put_variable(y(4),1),
    call(length/2),
    math_fast_load_value(y(4),0),
    put_integer(30,1),
    call_c('Pl_Blt_Fast_Gt',[fast_call,boolean],[x(0),x(1)]),
    cut(y(3)),
    put_value(y(2),0),
    put_atom('[',1),
    call(put_char/2),
    put_value(y(2),0),
    put_variable(y(5),1),
    call(line_position/2),
    put_value(y(2),0),
    put_value(y(0),1),
    put_structure(quoted/1,4),
    unify_atom(true),
    put_structure(priority/1,3),
    unify_integer(999),
    put_list(2),
    unify_value(x(4)),
    unify_list,
    unify_value(x(3)),
    unify_nil,
    call(write_term/3),
    put_value(y(1),0),
    put_unsafe_value(y(5),1),
    put_value(y(2),2),
    deallocate,
    execute(emit_list/3),

label(1),
    retry_me_else(2),
    allocate(1),
    get_variable(y(0),2),
    put_atom(native_code,2),
    put_atom(f,3),
    call_c('Pl_Blt_G_Read',[fast_call,boolean],[x(2),x(3)]),
    call(emit_one_f_n/2),
    cut(y(0)),
    deallocate,
    proceed,

label(2),
    trust_me_else_fail,
    get_variable(x(2),1),
    get_variable(x(1),0),
    put_value(x(2),0),
    execute(writeq/2)]).


predicate(emit_one_f_n/2,317,static,private,monofile,global,[
    switch_on_term(2,fail,fail,fail,1),

label(1),
    switch_on_structure([((:)/2,3),((/)/2,5)]),

label(2),
    try_me_else(4),

label(3),
    get_structure((:)/2,0),
    unify_variable(x(4)),
    unify_structure((/)/2),
    unify_variable(x(3)),
    unify_variable(x(0)),
    put_list(2),
    unify_value(x(4)),
    unify_list,
    unify_value(x(3)),
    unify_list,
    unify_value(x(0)),
    unify_nil,
    put_value(x(1),0),
    put_atom('(~q):(~q)/~q',1),
    execute(format/3),

label(4),
    trust_me_else_fail,

label(5),
    get_structure((/)/2,0),
    unify_variable(x(3)),
    unify_variable(x(0)),
    put_list(2),
    unify_value(x(3)),
    unify_list,
    unify_value(x(0)),
    unify_nil,
    put_value(x(1),0),
    put_atom('(~q)/~q',1),
    execute(format/3)]).


predicate(emit_list/3,326,static,private,monofile,global,[
    switch_on_term(1,2,fail,4,fail),

label(1),
    try_me_else(3),

label(2),
    get_nil(0),
    put_value(x(2),0),
    put_atom(']',1),
    execute(put_char/2),

label(3),
    trust_me_else_fail,

label(4),
    allocate(4),
    get_list(0),
    unify_variable(y(0)),
    unify_variable(y(1)),
    get_variable(y(2),1),
    get_variable(y(3),2),
    put_value(y(3),0),
    put_atom(',~n~*c',1),
    put_list(2),
    unify_local_value(y(2)),
    unify_list,
    unify_integer(32),
    unify_nil,
    call(format/3),
    put_value(y(3),0),
    put_value(y(0),1),
    put_structure(quoted/1,4),
    unify_atom(true),
    put_structure(priority/1,3),
    unify_integer(999),
    put_list(2),
    unify_value(x(4)),
    unify_list,
    unify_value(x(3)),
    unify_nil,
    call(write_term/3),
    put_value(y(1),0),
    put_value(y(2),1),
    put_value(y(3),2),
    deallocate,
    execute(emit_list/3)]).


predicate(emit_ensure_linked/0,337,static,private,monofile,global,[
    pragma_arity(1),
    get_current_choice(x(0)),
    try_me_else(1),
    allocate(4),
    get_variable(y(0),0),
    put_atom(streamwamfile,0),
    put_variable(y(1),1),
    call_c('Pl_Blt_G_Read',[fast_call,boolean],[x(0),x(1)]),
    put_structure(ensure_linked/2,0),
    unify_variable(y(2)),
    unify_variable(y(3)),
    call(retract/1),
    cut(y(0)),
    put_value(y(1),0),
    put_atom('~n~nensure_linked([~q',1),
    put_structure((/)/2,3),
    unify_value(y(2)),
    unify_value(y(3)),
    put_list(2),
    unify_value(x(3)),
    unify_nil,
    call(format/3),
    put_value(y(1),0),
    call('$emit_ensure_linked/0_$aux1'/1),
    put_value(y(1),0),
    put_atom(']).',1),
    call(write/2),
    put_unsafe_value(y(1),0),
    deallocate,
    execute(nl/1),

label(1),
    trust_me_else_fail,
    proceed]).


predicate('$emit_ensure_linked/0_$aux1'/1,337,static,private,monofile,local,[
    try_me_else(1),
    allocate(3),
    get_variable(y(0),0),
    put_structure(ensure_linked/2,0),
    unify_variable(y(1)),
    unify_variable(y(2)),
    put_void(1),
    call(clause/2),
    put_value(y(0),0),
    put_atom(',~q',1),
    put_structure((/)/2,3),
    unify_value(y(1)),
    unify_value(y(2)),
    put_list(2),
    unify_value(x(3)),
    unify_nil,
    call(format/3),
    fail,

label(1),
    trust_me_else_fail,
    proceed]).


predicate(bc_emit_code/5,354,static,private,monofile,global,[
    allocate(3),
    get_variable(y(0),4),
    put_atom(streamwamfile,4),
    put_variable(y(1),5),
    call_c('Pl_Blt_G_Read',[fast_call,boolean],[x(4),x(5)]),
    put_value(y(1),4),
    put_variable(y(2),5),
    call(emit_pred_start/6),
    put_unsafe_value(y(2),0),
    put_value(y(0),1),
    put_unsafe_value(y(1),2),
    deallocate,
    execute('$bc_emit_code/5_$aux1'/3)]).


predicate('$bc_emit_code/5_$aux1'/3,354,static,private,monofile,local,[
    pragma_arity(4),
    get_current_choice(x(3)),
    try_me_else(1),
    allocate(1),
    get_variable(y(0),2),
    call_c('Pl_Blt_Non_Var',[fast_call,boolean],[x(0)]),
    cut(x(3)),
    get_list(1),
    unify_variable(x(0)),
    unify_nil,
    get_structure(bc/2,0),
    unify_variable(x(0)),
    unify_void(1),
    get_structure((:-)/2,0),
    unify_void(1),
    unify_variable(x(1)),
    put_value(y(0),0),
    call(bc_emit_prolog_term/2),
    put_value(y(0),0),
    put_atom(').~n',1),
    put_nil(2),
    deallocate,
    execute(format/3),

label(1),
    trust_me_else_fail,
    allocate(5),
    get_variable(y(0),1),
    get_variable(y(1),2),
    put_value(y(0),0),
    put_variable(y(2),1),
    call(length/2),
    put_value(y(0),0),
    put_variable(y(3),1),
    put_variable(y(4),2),
    put_value(y(2),3),
    call('$bc_emit_code/5_$aux2'/4),
    put_value(y(1),0),
    put_atom('~d).~n',1),
    put_list(2),
    unify_local_value(y(3)),
    unify_nil,
    call(format/3),
    put_unsafe_value(y(4),0),
    put_value(y(1),1),
    deallocate,
    execute(bc_emit_lst_clause/2)]).


predicate('$bc_emit_code/5_$aux2'/4,354,static,private,monofile,local,[
    pragma_arity(5),
    get_current_choice(x(4)),
    try_me_else(1),
    get_list(0),
    unify_variable(x(0)),
    unify_nil,
    get_structure(bc/2,0),
    unify_atom('$$empty$$predicate$$clause$$'),
    unify_list,
    unify_atom(proceed),
    unify_nil,
    cut(x(4)),
    get_integer(0,1),
    get_nil(2),
    proceed,

label(1),
    trust_me_else_fail,
    get_value(x(3),1),
    get_value(x(0),2),
    proceed]).


predicate(bc_emit_lst_clause/2,375,static,private,monofile,global,[
    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(4),
    get_list(0),
    unify_variable(x(0)),
    unify_variable(y(2)),
    get_structure(bc/2,0),
    unify_variable(y(0)),
    unify_variable(y(1)),
    get_variable(y(3),1),
    put_value(y(3),0),
    put_atom('~n~nclause(',1),
    put_nil(2),
    call(format/3),
    put_value(y(3),0),
    put_value(y(0),1),
    call(bc_emit_prolog_term/2),
    put_value(y(3),0),
    put_atom(',',1),
    call(write/2),
    put_value(y(1),0),
    put_void(1),
    put_value(y(3),2),
    call(emit_wam_code/3),
    put_value(y(3),0),
    put_atom(']).~n',1),
    put_nil(2),
    call(format/3),
    put_value(y(2),0),
    put_value(y(3),1),
    deallocate,
    execute(bc_emit_lst_clause/2)]).


predicate(bc_emit_prolog_term/2,388,static,private,monofile,global,[
    try_me_else(1),
    allocate(3),
    get_variable(y(0),0),
    get_variable(y(1),1),
    put_variable(y(2),0),
    call('$get_current_B'/1),
    put_value(y(1),0),
    call(name_singleton_vars/1),
    put_value(y(1),0),
    put_structure(exclude/1,2),
    unify_list,
    unify_local_value(y(1)),
    unify_nil,
    put_list(1),
    unify_value(x(2)),
    unify_nil,
    call(bind_variables/2),
    put_value(y(0),0),
    put_value(y(1),1),
    put_structure(numbervars/1,7),
    unify_atom(true),
    put_structure(namevars/1,6),
    unify_atom(true),
    put_structure('$above'/1,5),
    unify_local_value(y(2)),
    put_structure(ignore_ops/1,4),
    unify_atom(true),
    put_structure(quoted/1,3),
    unify_atom(true),
    put_list(2),
    unify_value(x(7)),
    unify_list,
    unify_value(x(6)),
    unify_list,
    unify_value(x(5)),
    unify_list,
    unify_value(x(4)),
    unify_list,
    unify_value(x(3)),
    unify_nil,
    call(write_term/3),
    fail,

label(1),
    trust_me_else_fail,
    proceed]).
