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


file_name('/home/diaz/GP/src/src/BipsPl/src_rdr.pl').


predicate('$use_src_rdr'/0,42,static,private,monofile,built_in,[
    proceed]).


predicate(sr_open/3,72,static,private,monofile,built_in,[
    allocate(4),
    get_variable(y(0),0),
    get_variable(y(1),1),
    get_variable(y(2),2),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_open,3]),
    call('$set_sr_defaults'/0),
    put_value(y(2),0),
    put_variable(y(3),1),
    call('$get_sr_options'/2),
    put_value(y(1),0),
    call('$sr_open/3_$aux1'/1),
    put_value(y(1),0),
    put_unsafe_value(y(3),1),
    call_c('Pl_SR_Init_Open_2',[],[x(0),x(1)]),
    put_value(y(0),0),
    deallocate,
    execute('$sr_open/3_$aux2'/1)]).


predicate('$sr_open/3_$aux2'/1,72,static,private,monofile,local,[
    pragma_arity(2),
    get_current_choice(x(1)),
    try_me_else(1),
    call_c('Pl_Blt_Non_Var',[fast_call,boolean],[x(0)]),
    get_structure('$stream'/1,0),
    unify_void(1),
    cut(x(1)),
    put_atom(true,1),
    call_c('Pl_SR_Open_File_2',[],[x(0),x(1)]),
    proceed,

label(1),
    trust_me_else_fail,
    execute('$sr_open_new_prolog_file'/1)]).


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

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


predicate('$set_sr_defaults'/0,105,static,private,monofile,built_in,[
    allocate(0),
    put_integer(0,0),
    put_integer(1022,1),
    call('$sys_var_write'/2),
    put_integer(0,0),
    put_integer(19,1),
    call('$sys_var_set_bit'/2),
    put_integer(1,0),
    put_integer(0,1),
    deallocate,
    execute('$sys_var_write'/2)]).


predicate('$get_sr_options'/2,111,static,private,monofile,built_in,[
    allocate(2),
    get_variable(y(0),0),
    get_variable(y(1),1),
    put_value(y(0),0),
    call('$check_list'/1),
    put_atom('$sr_output_stream',0),
    put_integer(0,1),
    call_c('Pl_Blt_G_Assign',[fast_call],[x(0),x(1)]),
    put_value(y(0),0),
    call('$get_sr_options1'/1),
    put_atom('$sr_output_stream',0),
    put_value(y(1),1),
    call_c('Pl_Blt_G_Read',[fast_call,boolean],[x(0),x(1)]),
    deallocate,
    proceed]).


predicate('$get_sr_options1'/1,118,static,private,monofile,built_in,[
    pragma_arity(2),
    get_current_choice(x(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(y(0)),
    get_variable(y(1),1),
    call('$get_sr_options2'/1),
    cut(y(1)),
    put_value(y(0),0),
    deallocate,
    execute('$get_sr_options1'/1)]).


predicate('$get_sr_options2'/1,125,static,private,monofile,built_in,[
    try_me_else(1),
    call_c('Pl_Blt_Var',[fast_call,boolean],[x(0)]),
    execute('$pl_err_instantiation'/0),

label(1),
    retry_me_else(2),
    allocate(2),
    get_variable(x(2),0),
    put_variable(x(0),1),
    put_integer(1,3),
    call_c('Pl_Blt_Functor',[fast_call,boolean],[x(2),x(1),x(3)]),
    put_integer(1,1),
    put_variable(y(0),3),
    call_c('Pl_Blt_Arg',[fast_call,boolean],[x(1),x(2),x(3)]),
    put_value(y(0),1),
    call_c('Pl_Blt_Non_Var',[fast_call,boolean],[x(1)]),
    put_void(1),
    put_variable(y(1),2),
    call('$sr_treat_pass_no'/3),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[is,2]),
    math_load_value(y(1),0),
    put_integer(2,1),
    call_c('Pl_Fct_Mul',[fast_call,x(1)],[x(0),x(1)]),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[is,2]),
    math_load_value(x(1),0),
    call_c('Pl_Fct_Inc',[fast_call,x(2)],[x(0)]),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_open,3]),
    put_unsafe_value(y(0),0),
    deallocate,
    execute('$sr_set_treat_pass_bits'/3),

label(2),
    retry_me_else(14),
    switch_on_term(4,fail,fail,fail,3),

label(3),
    switch_on_structure([(restart/1,5),(reflect_eof/1,7),(undo_directives/1,9),(write_error/1,11),(output_stream/1,13)]),

label(4),
    try_me_else(6),

label(5),
    get_structure(restart/1,0),
    unify_variable(x(0)),
    call_c('Pl_Blt_Non_Var',[fast_call,boolean],[x(0)]),
    execute('$$get_sr_options2/1_$aux1'/1),

label(6),
    retry_me_else(8),

label(7),
    get_structure(reflect_eof/1,0),
    unify_variable(x(0)),
    call_c('Pl_Blt_Non_Var',[fast_call,boolean],[x(0)]),
    execute('$$get_sr_options2/1_$aux2'/1),

label(8),
    retry_me_else(10),

label(9),
    get_structure(undo_directives/1,0),
    unify_variable(x(0)),
    call_c('Pl_Blt_Non_Var',[fast_call,boolean],[x(0)]),
    execute('$$get_sr_options2/1_$aux3'/1),

label(10),
    retry_me_else(12),

label(11),
    get_structure(write_error/1,0),
    unify_variable(x(0)),
    call_c('Pl_Blt_Non_Var',[fast_call,boolean],[x(0)]),
    execute('$$get_sr_options2/1_$aux4'/1),

label(12),
    trust_me_else_fail,

label(13),
    get_structure(output_stream/1,0),
    unify_variable(x(1)),
    put_atom('$sr_output_stream',0),
    call_c('Pl_Blt_G_Link',[fast_call],[x(0),x(1)]),
    put_integer(1,0),
    put_integer(1,1),
    execute('$sys_var_write'/2),

label(14),
    trust_me_else_fail,
    put_value(x(0),1),
    put_atom(sr_option,0),
    execute('$pl_err_domain'/2)]).


predicate('$$get_sr_options2/1_$aux4'/1,163,static,private,monofile,local,[
    switch_on_term(2,1,fail,fail,fail),

label(1),
    switch_on_atom([(false,3),(true,5)]),

label(2),
    try_me_else(4),

label(3),
    get_atom(false,0),
    put_integer(0,0),
    put_integer(19,1),
    execute('$sys_var_reset_bit'/2),

label(4),
    trust_me_else_fail,

label(5),
    get_atom(true,0),
    put_integer(0,0),
    put_integer(19,1),
    execute('$sys_var_set_bit'/2)]).


predicate('$$get_sr_options2/1_$aux3'/1,155,static,private,monofile,local,[
    switch_on_term(2,1,fail,fail,fail),

label(1),
    switch_on_atom([(false,3),(true,5)]),

label(2),
    try_me_else(4),

label(3),
    get_atom(false,0),
    put_integer(0,0),
    put_integer(18,1),
    execute('$sys_var_reset_bit'/2),

label(4),
    trust_me_else_fail,

label(5),
    get_atom(true,0),
    put_integer(0,0),
    put_integer(18,1),
    execute('$sys_var_set_bit'/2)]).


predicate('$$get_sr_options2/1_$aux2'/1,147,static,private,monofile,local,[
    switch_on_term(2,1,fail,fail,fail),

label(1),
    switch_on_atom([(false,3),(true,5)]),

label(2),
    try_me_else(4),

label(3),
    get_atom(false,0),
    put_integer(0,0),
    put_integer(17,1),
    execute('$sys_var_reset_bit'/2),

label(4),
    trust_me_else_fail,

label(5),
    get_atom(true,0),
    put_integer(0,0),
    put_integer(17,1),
    execute('$sys_var_set_bit'/2)]).


predicate('$$get_sr_options2/1_$aux1'/1,139,static,private,monofile,local,[
    switch_on_term(2,1,fail,fail,fail),

label(1),
    switch_on_atom([(false,3),(true,5)]),

label(2),
    try_me_else(4),

label(3),
    get_atom(false,0),
    put_integer(0,0),
    put_integer(16,1),
    execute('$sys_var_reset_bit'/2),

label(4),
    trust_me_else_fail,

label(5),
    get_atom(true,0),
    put_integer(0,0),
    put_integer(16,1),
    execute('$sys_var_set_bit'/2)]).


predicate('$sr_treat_pass_no'/3,183,static,private,monofile,built_in,[
    switch_on_term(2,1,fail,fail,fail),

label(1),
    switch_on_atom([(include,3),(op,5),(set_prolog_flag,7),(char_conversion,9),(module,11),(end_module,13),(body,15),(end_body,17)]),

label(2),
    try_me_else(4),

label(3),
    get_atom(include,0),
    get_integer(1,1),
    get_integer(0,2),
    proceed,

label(4),
    retry_me_else(6),

label(5),
    get_atom(op,0),
    get_integer(3,1),
    get_integer(1,2),
    proceed,

label(6),
    retry_me_else(8),

label(7),
    get_atom(set_prolog_flag,0),
    get_integer(2,1),
    get_integer(2,2),
    proceed,

label(8),
    retry_me_else(10),

label(9),
    get_atom(char_conversion,0),
    get_integer(2,1),
    get_integer(3,2),
    proceed,

label(10),
    retry_me_else(12),

label(11),
    get_atom(module,0),
    get_integer(1,1),
    get_integer(4,2),
    proceed,

label(12),
    retry_me_else(14),

label(13),
    get_atom(end_module,0),
    get_integer(1,1),
    get_integer(4,2),
    proceed,

label(14),
    retry_me_else(16),

label(15),
    get_atom(body,0),
    get_integer(1,1),
    get_integer(4,2),
    proceed,

label(16),
    trust_me_else_fail,

label(17),
    get_atom(end_body,0),
    get_integer(1,1),
    get_integer(4,2),
    proceed]).


predicate('$sr_set_treat_pass_bits'/3,195,static,private,monofile,built_in,[
    switch_on_term(2,1,fail,fail,fail),

label(1),
    switch_on_atom([(kill,3),(ignore,5),(hide,7),(reflect,9)]),

label(2),
    try_me_else(4),

label(3),
    allocate(1),
    get_atom(kill,0),
    get_variable(y(0),2),
    put_integer(0,0),
    call('$sys_var_reset_bit'/2),
    put_integer(0,0),
    put_value(y(0),1),
    deallocate,
    execute('$sys_var_reset_bit'/2),

label(4),
    retry_me_else(6),

label(5),
    allocate(1),
    get_atom(ignore,0),
    get_variable(y(0),2),
    put_integer(0,0),
    call('$sys_var_set_bit'/2),
    put_integer(0,0),
    put_value(y(0),1),
    deallocate,
    execute('$sys_var_reset_bit'/2),

label(6),
    retry_me_else(8),

label(7),
    allocate(1),
    get_atom(hide,0),
    get_variable(y(0),2),
    put_integer(0,0),
    call('$sys_var_reset_bit'/2),
    put_integer(0,0),
    put_value(y(0),1),
    deallocate,
    execute('$sys_var_set_bit'/2),

label(8),
    trust_me_else_fail,

label(9),
    allocate(1),
    get_atom(reflect,0),
    get_variable(y(0),2),
    put_integer(0,0),
    call('$sys_var_set_bit'/2),
    put_integer(0,0),
    put_value(y(0),1),
    deallocate,
    execute('$sys_var_set_bit'/2)]).


predicate('$sr_open_new_prolog_file'/1,214,static,private,monofile,built_in,[
    put_variable(x(1),2),
    call_c('Pl_Prolog_File_Name_2',[],[x(0),x(2)]),
    put_atom(false,0),
    call_c('Pl_SR_Open_File_2',[],[x(1),x(0)]),
    proceed]).


predicate(sr_change_options/2,226,static,private,monofile,built_in,[
    allocate(0),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_change_options,2]),
    call_c('Pl_SR_Check_Descriptor_1',[],[x(0)]),
    put_value(x(1),0),
    call('$get_sr_options1'/1),
    deallocate,
    call_c('Pl_SR_Change_Options_0',[],[]),
    proceed]).


predicate(sr_close/1,235,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_close,1]),
    call_c('Pl_SR_Close_1',[],[x(0)]),
    proceed]).


predicate(sr_new_pass/1,241,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_new_pass,1]),
    execute('$sr_new_pass/1_$aux1'/1)]).


predicate('$sr_new_pass/1_$aux1'/1,241,static,private,monofile,local,[
    pragma_arity(2),
    get_current_choice(x(1)),
    try_me_else(1),
    call_c('Pl_SR_New_Pass_1',[boolean],[x(0)]),
    cut(x(1)),
    proceed,

label(1),
    trust_me_else_fail,
    put_value(x(0),2),
    put_atom(new_pass,0),
    put_atom(one_pass_reader,1),
    execute('$pl_err_permission'/3)]).


predicate(sr_read_term/4,251,static,private,monofile,built_in,[
    pragma_arity(5),
    get_current_choice(x(4)),
    allocate(6),
    get_variable(y(0),0),
    get_variable(y(1),1),
    get_variable(y(2),2),
    get_variable(y(3),3),
    get_variable(y(4),4),
    put_value(y(0),0),
    call_c('Pl_SR_Check_Descriptor_1',[],[x(0)]),
    call(repeat/0),
    put_variable(x(0),1),
    call_c('Pl_SR_Get_Stm_For_Read_Term_1',[],[x(1)]),
    put_structure('$stream'/1,1),
    unify_value(x(0)),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_read_term,3]),
    put_structure('$read_term'/3,0),
    unify_value(x(1)),
    unify_local_value(y(1)),
    unify_local_value(y(2)),
    put_variable(y(5),1),
    put_atom(true,2),
    put_atom(sr_read_term,3),
    put_integer(3,4),
    put_atom(false,5),
    call('$catch'/6),
    call_c('Pl_SR_Update_Position_0',[],[]),
    put_value(y(5),0),
    put_value(y(1),1),
    put_value(y(3),2),
    call('$sr_read_term/4_$aux1'/3),
    put_value(y(3),0),
    put_value(y(0),1),
    call('$sr_read_term/4_$aux2'/2),
    cut(y(4)),
    deallocate,
    proceed]).


predicate('$sr_read_term/4_$aux2'/2,251,static,private,monofile,local,[
    pragma_arity(3),
    get_current_choice(x(2)),
    try_me_else(1),
    get_variable(x(3),1),
    get_variable(x(1),0),
    get_structure(sr_error/2,1),
    unify_void(2),
    put_integer(19,0),
    call_c('Pl_SR_Is_Bit_Set_1',[boolean],[x(0)]),
    cut(x(2)),
    put_value(x(3),0),
    execute(sr_write_error/2),

label(1),
    trust_me_else_fail,
    proceed]).


predicate('$sr_read_term/4_$aux1'/3,251,static,private,monofile,local,[
    pragma_arity(4),
    get_current_choice(x(3)),
    try_me_else(1),
    call_c('Pl_Blt_Var',[fast_call,boolean],[x(0)]),
    cut(x(3)),
    put_value(x(1),0),
    put_value(x(2),1),
    execute('$sr_treat_term'/2),

label(1),
    trust_me_else_fail,
    get_atom('$sr_read_term_error',1),
    put_value(x(2),1),
    execute('$sr_error_from_exception'/2)]).


predicate('$sr_treat_term'/2,278,static,private,monofile,built_in,[
    pragma_arity(3),
    get_current_choice(x(2)),
    try_me_else(1),
    put_atom(end_of_file,3),
    call_c('Pl_Blt_Term_Eq',[fast_call,boolean],[x(0),x(3)]),
    cut(x(2)),
    put_variable(x(0),2),
    call_c('Pl_SR_EOF_Reached_1',[boolean],[x(2)]),
    execute('$$sr_treat_term/2_$aux1'/2),

label(1),
    retry_me_else(2),
    allocate(6),
    get_variable(y(0),1),
    get_variable(y(1),2),
    call_c('Pl_Blt_Non_Var',[fast_call,boolean],[x(0)]),
    get_structure((:-)/1,0),
    unify_variable(y(2)),
    put_value(y(2),0),
    call_c('Pl_Blt_Non_Var',[fast_call,boolean],[x(0)]),
    put_value(y(2),2),
    put_variable(x(0),3),
    put_variable(x(1),4),
    call_c('Pl_Blt_Functor',[fast_call,boolean],[x(2),x(3),x(4)]),
    put_variable(y(3),2),
    call('$sr_treat_pass_no'/3),
    cut(y(1)),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[is,2]),
    math_load_value(y(3),0),
    put_integer(2,1),
    call_c('Pl_Fct_Mul',[fast_call,x(0)],[x(0),x(1)]),
    get_variable(y(4),0),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[is,2]),
    math_load_value(y(4),0),
    call_c('Pl_Fct_Inc',[fast_call,x(0)],[x(0)]),
    put_value(y(2),1),
    put_value(y(0),2),
    put_variable(y(5),3),
    call('$$sr_treat_term/2_$aux2'/4),
    put_unsafe_value(y(5),0),
    put_unsafe_value(y(4),1),
    deallocate,
    execute('$$sr_treat_term/2_$aux3'/2),

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


predicate('$$sr_treat_term/2_$aux3'/2,286,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)),
    call_c('Pl_SR_Is_Bit_Set_1',[boolean],[x(1)]),
    proceed,

label(1),
    trust_me_else_fail,
    proceed]).


predicate('$$sr_treat_term/2_$aux2'/4,286,static,private,monofile,local,[
    pragma_arity(5),
    get_current_choice(x(4)),
    try_me_else(1),
    get_variable(x(5),2),
    call_c('Pl_SR_Is_Bit_Set_1',[boolean],[x(0)]),
    cut(x(4)),
    put_structure('$sr_exec_directive'/2,0),
    unify_local_value(x(1)),
    unify_local_value(x(5)),
    put_structure('$sr_error_from_exception'/2,2),
    unify_local_value(x(3)),
    unify_local_value(x(5)),
    put_value(x(3),1),
    put_atom(any,3),
    put_integer(0,4),
    put_atom(false,5),
    execute('$catch'/6),

label(1),
    trust_me_else_fail,
    proceed]).


predicate('$$sr_treat_term/2_$aux1'/2,278,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(sr_ok,1),
    proceed,

label(1),
    trust_me_else_fail,
    get_structure(sr_error/2,1),
    unify_atom(warning),
    unify_local_value(x(0)),
    proceed]).


predicate('$sr_exec_directive'/2,311,static,private,monofile,built_in,[
    pragma_arity(3),
    get_current_choice(x(2)),
    try_me_else(1),
    allocate(1),
    get_variable(y(0),2),
    call('$sr_directive1'/2),
    cut(y(0)),
    deallocate,
    proceed,

label(1),
    trust_me_else_fail,
    get_structure(sr_error/2,1),
    unify_atom(warning),
    unify_atom('directive failed'),
    proceed]).


predicate('$sr_directive1'/2,321,static,private,monofile,built_in,[
    switch_on_term(2,fail,fail,fail,1),

label(1),
    switch_on_structure([(include/1,3),(op/3,5),(set_prolog_flag/2,7),(char_conversion/2,9),(module/1,11),(body/1,13),(end_module/1,15),(end_body/1,17)]),

label(2),
    try_me_else(4),

label(3),
    get_atom(sr_ok,1),
    get_structure(include/1,0),
    unify_variable(x(0)),
    execute('$sr_open_new_prolog_file'/1),

label(4),
    retry_me_else(6),

label(5),
    allocate(5),
    get_structure(op/3,0),
    unify_variable(y(0)),
    unify_variable(y(1)),
    unify_variable(y(2)),
    get_atom(sr_ok,1),
    put_value(y(1),0),
    put_value(y(2),1),
    put_variable(y(3),2),
    put_variable(y(4),3),
    call('$$sr_directive1/2_$aux1'/4),
    put_integer(0,0),
    put_value(y(0),1),
    put_value(y(1),2),
    put_value(y(2),3),
    put_unsafe_value(y(3),4),
    put_unsafe_value(y(4),5),
    put_value(y(2),6),
    deallocate,
    call_c('Pl_SR_Add_Directive_7',[],[x(0),x(1),x(2),x(3),x(4),x(5),x(6)]),
    proceed,

label(6),
    retry_me_else(8),

label(7),
    allocate(3),
    get_structure(set_prolog_flag/2,0),
    unify_variable(y(0)),
    unify_variable(y(1)),
    get_atom(sr_ok,1),
    put_value(y(0),0),
    put_variable(y(2),1),
    call('$$sr_directive1/2_$aux2'/2),
    put_integer(1,0),
    put_value(y(0),1),
    put_value(y(1),2),
    put_integer(0,3),
    put_value(y(0),4),
    put_unsafe_value(y(2),5),
    put_integer(0,6),
    deallocate,
    call_c('Pl_SR_Add_Directive_7',[],[x(0),x(1),x(2),x(3),x(4),x(5),x(6)]),
    proceed,

label(8),
    retry_me_else(10),

label(9),
    allocate(3),
    get_structure(char_conversion/2,0),
    unify_variable(y(0)),
    unify_variable(y(1)),
    get_atom(sr_ok,1),
    put_value(y(0),0),
    put_variable(y(2),1),
    call('$$sr_directive1/2_$aux3'/2),
    put_integer(2,0),
    put_value(y(0),1),
    put_value(y(1),2),
    put_integer(0,3),
    put_value(y(0),4),
    put_unsafe_value(y(2),5),
    put_integer(0,6),
    deallocate,
    call_c('Pl_SR_Add_Directive_7',[],[x(0),x(1),x(2),x(3),x(4),x(5),x(6)]),
    proceed,

label(10),
    retry_me_else(12),

label(11),
    get_structure(module/1,0),
    unify_variable(x(0)),
    put_value(x(1),2),
    put_atom(true,1),
    execute('$sr_start_module'/3),

label(12),
    retry_me_else(14),

label(13),
    get_structure(body/1,0),
    unify_variable(x(0)),
    put_value(x(1),2),
    put_atom(false,1),
    execute('$sr_start_module'/3),

label(14),
    retry_me_else(16),

label(15),
    get_structure(end_module/1,0),
    unify_variable(x(0)),
    put_value(x(1),2),
    put_atom(true,1),
    execute('$sr_stop_module'/3),

label(16),
    trust_me_else_fail,

label(17),
    get_structure(end_body/1,0),
    unify_variable(x(0)),
    put_value(x(1),2),
    put_atom(false,1),
    execute('$sr_stop_module'/3)]).


predicate('$$sr_directive1/2_$aux3'/2,347,static,private,monofile,local,[
    pragma_arity(3),
    get_current_choice(x(2)),
    try_me_else(1),
    allocate(1),
    get_variable(y(0),2),
    call_c('Pl_Blt_Non_Var',[fast_call,boolean],[x(0)]),
    call(current_char_conversion/2),
    cut(y(0)),
    deallocate,
    proceed,

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


predicate('$$sr_directive1/2_$aux2'/2,338,static,private,monofile,local,[
    pragma_arity(3),
    get_current_choice(x(2)),
    try_me_else(1),
    allocate(1),
    get_variable(y(0),2),
    call_c('Pl_Blt_Non_Var',[fast_call,boolean],[x(0)]),
    call(current_prolog_flag/2),
    cut(y(0)),
    deallocate,
    proceed,

label(1),
    trust_me_else_fail,
    proceed]).


predicate('$$sr_directive1/2_$aux1'/4,324,static,private,monofile,local,[
    pragma_arity(5),
    get_current_choice(x(4)),
    try_me_else(1),
    allocate(5),
    get_variable(y(0),1),
    get_variable(y(1),2),
    get_variable(y(2),3),
    get_variable(y(3),4),
    call_c('Pl_Blt_Non_Var',[fast_call,boolean],[x(0)]),
    put_value(y(0),1),
    call_c('Pl_Blt_Non_Var',[fast_call,boolean],[x(1)]),
    put_variable(y(4),1),
    call('$sr_op_type'/2),
    put_value(y(1),0),
    put_value(y(2),1),
    put_value(y(0),2),
    call(current_op/3),
    put_value(y(2),0),
    put_value(y(4),1),
    call('$sr_op_type'/2),
    cut(y(3)),
    deallocate,
    proceed,

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


predicate('$sr_op_type'/2,371,static,private,monofile,built_in,[
    switch_on_term(2,1,fail,fail,fail),

label(1),
    switch_on_atom([(fx,3),(fy,5),(xfx,7),(yfx,9),(xfy,11),(xf,13),(yf,15)]),

label(2),
    try_me_else(4),

label(3),
    get_atom(fx,0),
    get_atom(prefix,1),
    proceed,

label(4),
    retry_me_else(6),

label(5),
    get_atom(fy,0),
    get_atom(prefix,1),
    proceed,

label(6),
    retry_me_else(8),

label(7),
    get_atom(xfx,0),
    get_atom(infix,1),
    proceed,

label(8),
    retry_me_else(10),

label(9),
    get_atom(yfx,0),
    get_atom(infix,1),
    proceed,

label(10),
    retry_me_else(12),

label(11),
    get_atom(xfy,0),
    get_atom(infix,1),
    proceed,

label(12),
    retry_me_else(14),

label(13),
    get_atom(xf,0),
    get_atom(postfix,1),
    proceed,

label(14),
    trust_me_else_fail,

label(15),
    get_atom(yf,0),
    get_atom(postfix,1),
    proceed]).


predicate('$sr_start_module'/3,382,static,private,monofile,built_in,[
    get_variable(x(3),0),
    put_variable(x(0),4),
    call_c('Pl_SR_Start_Module_3',[],[x(3),x(1),x(4)]),
    put_value(x(2),1),
    execute('$$sr_start_module/3_$aux1'/2)]).


predicate('$$sr_start_module/3_$aux1'/2,382,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(sr_ok,1),
    proceed,

label(1),
    trust_me_else_fail,
    get_structure(sr_error/2,1),
    unify_atom(warning),
    unify_local_value(x(0)),
    proceed]).


predicate('$sr_stop_module'/3,391,static,private,monofile,built_in,[
    get_variable(x(3),0),
    put_variable(x(0),4),
    call_c('Pl_SR_Stop_Module_3',[],[x(3),x(1),x(4)]),
    put_value(x(2),1),
    execute('$$sr_stop_module/3_$aux1'/2)]).


predicate('$$sr_stop_module/3_$aux1'/2,391,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(sr_ok,1),
    proceed,

label(1),
    trust_me_else_fail,
    get_structure(sr_error/2,1),
    unify_atom(warning),
    unify_local_value(x(0)),
    proceed]).


predicate(sr_current_descriptor/1,400,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_current_descriptor,1]),
    call_c('Pl_SR_Current_Descriptor_1',[boolean],[x(0)]),
    proceed]).


predicate('$sr_current_descriptor_alt'/0,407,static,private,monofile,built_in,[
    call_c('Pl_SR_Current_Descriptor_Alt_0',[boolean],[]),
    proceed]).


predicate(sr_get_stream/2,413,static,private,monofile,built_in,[
    allocate(2),
    get_variable(y(0),0),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_get_stream,2]),
    put_value(x(1),0),
    put_variable(y(1),1),
    call('$check_stream_or_var'/2),
    put_value(y(0),0),
    put_unsafe_value(y(1),1),
    deallocate,
    call_c('Pl_SR_Get_Stm_2',[boolean],[x(0),x(1)]),
    proceed]).


predicate(sr_get_module/3,421,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_get_module,3]),
    call_c('Pl_SR_Get_Module_3',[boolean],[x(0),x(1),x(2)]),
    proceed]).


predicate(sr_get_file_name/2,428,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_get_file_name,2]),
    call_c('Pl_SR_Get_File_Name_2',[boolean],[x(0),x(1)]),
    proceed]).


predicate(sr_get_position/3,435,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_get_position,3]),
    call_c('Pl_SR_Get_Position_3',[boolean],[x(0),x(1),x(2)]),
    proceed]).


predicate(sr_get_include_list/2,442,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_get_include_list,2]),
    call_c('Pl_SR_Get_Include_List_2',[boolean],[x(0),x(1)]),
    proceed]).


predicate(sr_get_include_stream_list/2,449,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_get_include_stream_list,2]),
    call_c('Pl_SR_Get_Include_Stream_List_2',[boolean],[x(0),x(1)]),
    proceed]).


predicate(sr_get_size_counters/3,456,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_get_size_counters,3]),
    call_c('Pl_SR_Get_Size_Counters_3',[boolean],[x(0),x(1),x(2)]),
    proceed]).


predicate(sr_get_error_counters/3,463,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_get_error_counters,3]),
    call_c('Pl_SR_Get_Error_Counters_3',[boolean],[x(0),x(1),x(2)]),
    proceed]).


predicate(sr_set_error_counters/3,470,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_set_error_counters,3]),
    call_c('Pl_SR_Set_Error_Counters_3',[],[x(0),x(1),x(2)]),
    proceed]).


predicate(sr_write_message/4,477,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_write_message,4]),
    call_c('Pl_SR_Write_Message_4',[],[x(0),x(1),x(2),x(3)]),
    proceed]).


predicate(sr_write_message/6,484,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_write_message,6]),
    call_c('Pl_SR_Write_Message_6',[],[x(0),x(1),x(2),x(3),x(4),x(5)]),
    proceed]).


predicate(sr_write_message/8,491,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_write_message,8]),
    call_c('Pl_SR_Write_Message_8',[],[x(0),x(1),x(2),x(3),x(4),x(5),x(6),x(7)]),
    proceed]).


predicate(sr_write_error/2,498,static,private,monofile,built_in,[
    pragma_arity(3),
    get_current_choice(x(2)),
    try_me_else(1),
    allocate(7),
    get_variable(y(0),0),
    get_variable(y(1),2),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_write_error,2]),
    put_value(x(1),0),
    put_variable(y(2),1),
    put_variable(y(3),2),
    put_variable(y(4),3),
    put_variable(y(5),4),
    put_variable(y(6),5),
    call('$sr_get_format_args_error'/6),
    put_value(y(2),0),
    put_value(y(0),1),
    put_value(y(4),2),
    put_value(y(5),3),
    put_value(y(6),4),
    put_value(y(3),5),
    call('$sr_write_error/2_$aux1'/6),
    cut(y(1)),
    deallocate,
    proceed,

label(1),
    trust_me_else_fail,
    proceed]).


predicate('$sr_write_error/2_$aux1'/6,498,static,private,monofile,local,[
    try_me_else(1),
    call_c('Pl_Blt_Var',[fast_call,boolean],[x(0)]),
    call_c('Pl_SR_Write_Message_4',[],[x(1),x(2),x(3),x(4)]),
    proceed,

label(1),
    trust_me_else_fail,
    call_c('Pl_SR_Write_Message_6',[],[x(1),x(0),x(5),x(2),x(3),x(4)]),
    proceed]).


predicate(sr_write_error/4,512,static,private,monofile,built_in,[
    pragma_arity(5),
    get_current_choice(x(4)),
    try_me_else(1),
    allocate(9),
    get_variable(y(0),0),
    get_variable(y(1),1),
    get_variable(y(2),2),
    get_variable(y(3),4),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_write_error,4]),
    put_value(x(3),0),
    put_variable(y(4),1),
    put_variable(y(5),2),
    put_variable(y(6),3),
    put_variable(y(7),4),
    put_variable(y(8),5),
    call('$sr_get_format_args_error'/6),
    put_value(y(1),0),
    put_value(y(4),1),
    put_value(y(2),2),
    put_value(y(5),3),
    call('$sr_write_error/4_$aux1'/4),
    put_value(y(0),0),
    put_unsafe_value(y(4),1),
    put_unsafe_value(y(5),2),
    put_unsafe_value(y(6),3),
    put_unsafe_value(y(7),4),
    put_unsafe_value(y(8),5),
    call_c('Pl_SR_Write_Message_6',[],[x(0),x(1),x(2),x(3),x(4),x(5)]),
    cut(y(3)),
    deallocate,
    proceed,

label(1),
    trust_me_else_fail,
    proceed]).


predicate('$sr_write_error/4_$aux1'/4,512,static,private,monofile,local,[
    try_me_else(1),
    get_value(x(1),0),
    get_value(x(3),2),
    proceed,

label(1),
    trust_me_else_fail,
    proceed]).


predicate(sr_write_error/6,523,static,private,monofile,built_in,[
    pragma_arity(7),
    get_current_choice(x(6)),
    try_me_else(1),
    allocate(11),
    get_variable(y(0),0),
    get_variable(y(1),1),
    get_variable(y(2),2),
    get_variable(y(3),3),
    get_variable(y(4),4),
    get_variable(y(5),6),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_write_error,6]),
    put_value(x(5),0),
    put_variable(y(6),1),
    put_variable(y(7),2),
    put_variable(y(8),3),
    put_variable(y(9),4),
    put_variable(y(10),5),
    call('$sr_get_format_args_error'/6),
    put_value(y(3),0),
    put_value(y(6),1),
    put_value(y(4),2),
    put_value(y(7),3),
    call('$sr_write_error/6_$aux1'/4),
    put_value(y(0),0),
    put_value(y(1),1),
    put_value(y(2),2),
    put_unsafe_value(y(6),3),
    put_unsafe_value(y(7),4),
    put_unsafe_value(y(8),5),
    put_unsafe_value(y(9),6),
    put_unsafe_value(y(10),7),
    call_c('Pl_SR_Write_Message_8',[],[x(0),x(1),x(2),x(3),x(4),x(5),x(6),x(7)]),
    cut(y(5)),
    deallocate,
    proceed,

label(1),
    trust_me_else_fail,
    proceed]).


predicate('$sr_write_error/6_$aux1'/4,523,static,private,monofile,local,[
    try_me_else(1),
    get_value(x(1),0),
    get_value(x(3),2),
    proceed,

label(1),
    trust_me_else_fail,
    proceed]).


predicate('$sr_get_format_args_error'/6,535,static,private,monofile,built_in,[
    try_me_else(1),
    call_c('Pl_Blt_Var',[fast_call,boolean],[x(0)]),
    execute('$pl_err_instantiation'/0),

label(1),
    trust_me_else_fail,
    get_structure(sr_error/2,0),
    unify_local_value(x(3)),
    unify_variable(x(0)),
    put_value(x(4),3),
    put_value(x(5),4),
    execute('$sr_simpl_error'/5)]).


predicate('$sr_simpl_error'/5,546,static,private,monofile,built_in,[
    pragma_arity(6),
    get_current_choice(x(5)),
    try_me_else(8),
    switch_on_term(2,fail,fail,fail,1),

label(1),
    switch_on_structure([(syntax/3,3),(existence_error/2,5),(permission_error/3,7)]),

label(2),
    try_me_else(4),

label(3),
    get_structure(syntax/3,0),
    unify_local_value(x(1)),
    unify_variable(x(1)),
    unify_variable(x(0)),
    cut(x(5)),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[is,2]),
    math_load_value(x(1),1),
    call_c('Pl_Fct_Neg',[fast_call,x(1)],[x(1)]),
    get_value(x(2),1),
    get_atom('~a~n',3),
    get_list(4),
    unify_value(x(0)),
    unify_nil,
    proceed,

label(4),
    retry_me_else(6),

label(5),
    get_structure(existence_error/2,0),
    unify_atom(source_sink),
    unify_variable(x(0)),
    cut(x(5)),
    get_atom('cannot open file ~a - does not exist~n',3),
    get_list(4),
    unify_value(x(0)),
    unify_nil,
    proceed,

label(6),
    trust_me_else_fail,

label(7),
    get_structure(permission_error/3,0),
    unify_atom(open),
    unify_atom(source_sink),
    unify_variable(x(0)),
    cut(x(5)),
    get_atom('cannot open file ~a - permission error~n',3),
    get_list(4),
    unify_value(x(0)),
    unify_nil,
    proceed,

label(8),
    trust_me_else_fail,
    get_atom('~w~n',3),
    get_list(4),
    unify_local_value(x(0)),
    unify_nil,
    proceed]).


predicate(sr_error_from_exception/2,569,static,private,monofile,built_in,[
    allocate(2),
    get_variable(y(0),0),
    get_variable(y(1),1),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sr_error_from_exception,2]),
    put_value(y(0),0),
    call('$sr_error_from_exception/2_$aux1'/1),
    put_value(y(0),0),
    put_value(y(1),1),
    deallocate,
    execute('$sr_error_from_exception'/2)]).


predicate('$sr_error_from_exception/2_$aux1'/1,569,static,private,monofile,local,[
    pragma_arity(2),
    get_current_choice(x(1)),
    try_me_else(1),
    call_c('Pl_Blt_Var',[fast_call,boolean],[x(0)]),
    cut(x(1)),
    execute('$pl_err_instantiation'/0),

label(1),
    trust_me_else_fail,
    proceed]).


predicate('$sr_error_from_exception'/2,578,static,private,monofile,built_in,[
    pragma_arity(3),
    get_current_choice(x(2)),
    try_me_else(7),
    switch_on_term(3,fail,fail,fail,1),

label(1),
    switch_on_structure([(error/2,2)]),

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

label(3),
    try_me_else(5),

label(4),
    allocate(4),
    get_structure(error/2,0),
    unify_variable(x(0)),
    unify_void(1),
    get_structure(syntax_error/1,0),
    unify_void(1),
    get_variable(y(0),1),
    cut(x(2)),
    put_void(0),
    put_variable(y(1),1),
    put_variable(y(2),2),
    put_variable(y(3),3),
    call(syntax_error_info/4),
    put_value(y(0),0),
    get_structure(sr_error/2,0),
    unify_atom(error),
    unify_structure(syntax/3),
    unify_local_value(y(1)),
    unify_local_value(y(2)),
    unify_local_value(y(3)),
    deallocate,
    proceed,

label(5),
    trust_me_else_fail,

label(6),
    get_structure(error/2,0),
    unify_variable(x(0)),
    unify_void(1),
    get_structure(sr_error/2,1),
    unify_atom(error),
    unify_value(x(0)),
    cut(x(2)),
    proceed,

label(7),
    trust_me_else_fail,
    get_structure(sr_error/2,1),
    unify_atom(exception),
    unify_local_value(x(0)),
    proceed]).
