/*
** Automatically generated from `loop_inv.m'
** by the Mercury compiler,
** version 11.07, configured for x86_64-unknown-linux-gnu.
** Do not edit.
**
** The autoconfigured grade settings governing
** the generation of this C file were
**
** TAG_BITS=2
** UNBOXED_FLOAT=no
** HIGHLEVEL_CODE=no
**
** END_OF_C_GRADE_INFO
*/

/*
INIT mercury__transform_hlds__loop_inv__init
ENDINIT
*/

#define MR_ALLOW_RESET
#include "mercury_imp.h"
#line 140 "../library/io.int2"
#include "io.mh"

#line 28 "transform_hlds.loop_inv.c"
#line 150 "../library/io.int2"
#include "time.mh"

#line 32 "transform_hlds.loop_inv.c"
#line 151 "../library/io.int2"
#include "string.mh"

#line 36 "transform_hlds.loop_inv.c"
#line 33 "../library/array.int2"
#include "array.mh"

#line 40 "transform_hlds.loop_inv.c"
#line 39 "../mdbcomp/mdbcomp.rtti_access.int2"
#include "mdbcomp.rtti_access.mh"

#line 44 "transform_hlds.loop_inv.c"
#line 31 "../library/bitmap.int2"
#include "bitmap.mh"

#line 48 "transform_hlds.loop_inv.c"
#line 49 "transform_hlds.loop_inv.c"
#include "transform_hlds.loop_inv.mh"

#line 52 "transform_hlds.loop_inv.c"
#line 53 "transform_hlds.loop_inv.c"
#ifndef TRANSFORM_HLDS__LOOP_INV_DECL_GUARD
#define TRANSFORM_HLDS__LOOP_INV_DECL_GUARD

#line 57 "transform_hlds.loop_inv.c"
#line 58 "transform_hlds.loop_inv.c"

#endif
#line 61 "transform_hlds.loop_inv.c"

#ifdef _MSC_VER
#define MR_STATIC_LINKAGE extern
#else
#define MR_STATIC_LINKAGE static
#endif

struct mercury_type_0 {
	MR_Word * f1[2];
};
MR_STATIC_LINKAGE const struct mercury_type_0 mercury_common_0[];

struct mercury_type_1 {
	MR_Word * f1[2];
	MR_Integer f2;
	MR_Word * f3[4];
};
MR_STATIC_LINKAGE const struct mercury_type_1 mercury_common_1[];

struct mercury_type_2 {
	MR_Word * f1[2];
	MR_Integer f2;
	MR_Word * f3[3];
};
MR_STATIC_LINKAGE const struct mercury_type_2 mercury_common_2[];

struct mercury_type_3 {
	MR_Word * f1;
	MR_Code * f2;
	MR_Integer f3;
};
MR_STATIC_LINKAGE const struct mercury_type_3 mercury_common_3[];

struct mercury_type_4 {
	MR_Word * f1;
	MR_Word * f2;
	MR_Integer f3;
	MR_Word * f4;
	MR_Word * f5;
};
MR_STATIC_LINKAGE const struct mercury_type_4 mercury_common_4[];

struct mercury_type_5 {
	MR_Word * f1[2];
	MR_Integer f2;
	MR_Word * f3[7];
};
MR_STATIC_LINKAGE const struct mercury_type_5 mercury_common_5[];

struct mercury_type_6 {
	MR_Word * f1[2];
	MR_Integer f2;
	MR_Word * f3[6];
};
MR_STATIC_LINKAGE const struct mercury_type_6 mercury_common_6[];

struct mercury_type_7 {
	MR_Word * f1[3];
};
MR_STATIC_LINKAGE const struct mercury_type_7 mercury_common_7[];

struct mercury_type_8 {
	MR_Word * f1;
	MR_Integer f2;
	MR_Word * f3;
	MR_Word * f4;
};
MR_STATIC_LINKAGE const struct mercury_type_8 mercury_common_8[];

extern const MR_TypeCtorInfo_Struct
	mercury_data_transform_hlds__loop_inv__type_ctor_info_gen_aux_proc_info_0,
	mercury_data_transform_hlds__loop_inv__type_ctor_info_igc_info_0,
	mercury_data_transform_hlds__loop_inv__type_ctor_info_inst_info_0,
	mercury_data_transform_hlds__loop_inv__type_ctor_info_rec_call_0;
MR_decl_label3(transform_hlds__loop_inv__add_output_4_0, 6,10,2)
MR_decl_label1(transform_hlds__loop_inv__add_outputs_5_0, 3)
MR_decl_label1(transform_hlds__loop_inv__add_recursive_call_3_0, 2)
MR_decl_label4(transform_hlds__loop_inv__all_instmap_deltas_are_ground_2_0, 17,4,2,1)
MR_decl_label7(transform_hlds__loop_inv__common_goal_2_0, 7,12,16,21,13,11,5)
MR_decl_label10(transform_hlds__loop_inv__create_aux_pred_10_0, 3,4,5,6,7,8,9,10,11,12)
MR_decl_label10(transform_hlds__loop_inv__create_aux_pred_10_0, 13,14,15,16,17,18,19,22,20,24)
MR_decl_label6(transform_hlds__loop_inv__create_aux_pred_10_0, 25,26,27,28,31,32)
MR_decl_label10(transform_hlds__loop_inv__do_not_hoist_2_6_0, 10,6,13,17,16,20,21,19,24,26)
MR_decl_label10(transform_hlds__loop_inv__do_not_hoist_2_6_0, 27,23,30,31,35,33,37,32,28,4)
MR_decl_label4(transform_hlds__loop_inv__do_not_hoist_2_6_0, 40,41,2,3)
MR_decl_label4(transform_hlds__loop_inv__gen_aux_proc_9_0, 3,4,5,6)
MR_decl_label9(transform_hlds__loop_inv__gen_out_proc_8_0, 2,3,4,5,6,7,8,9,10)
MR_decl_label10(transform_hlds__loop_inv__hoist_loop_invariants_6_0, 3,4,5,6,8,9,10,12,14,16)
MR_decl_label10(transform_hlds__loop_inv__hoist_loop_invariants_6_0, 18,15,19,20,21,24,25,26,28,29)
MR_decl_label4(transform_hlds__loop_inv__hoist_loop_invariants_6_0, 30,31,32,2)
MR_decl_label10(transform_hlds__loop_inv__inv_goals_vars_2_7_0, 8,12,17,9,6,24,26,27,22,30)
MR_decl_label6(transform_hlds__loop_inv__inv_goals_vars_2_7_0, 36,39,34,44,47,2)
MR_decl_label10(transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0, 3,4,6,5,8,10,11,12,14,2)
MR_decl_label3(transform_hlds__loop_inv__invariant_goal_candidates_in_disj_4_0, 11,3,4)
MR_decl_label10(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0, 5,6,8,7,10,12,13,14,16,4)
MR_decl_label10(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0, 3,21,19,24,27,28,26,31,34,33)
MR_decl_label2(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0, 38,40)
MR_decl_label3(transform_hlds__loop_inv__invariant_goal_candidates_in_parallel_conj_4_0, 11,3,4)
MR_decl_label3(transform_hlds__loop_inv__invariant_goal_candidates_in_plain_conj_4_0, 10,3,4)
MR_decl_label3(transform_hlds__loop_inv__invariant_goal_candidates_in_switch_4_0, 11,3,4)
MR_decl_label1(transform_hlds__loop_inv__invariant_goal_candidates_keeping_path_candidates_4_0, 2)
MR_decl_label1(fn__transform_hlds__loop_inv__IntroducedFrom__func__compute_initial_aux_instmap__736__1_2_0, 2)
MR_decl_label1(fn__transform_hlds__loop_inv__IntroducedFrom__func__inv_args__490__1_1_0, 1)
MR_decl_label3(fn__f_116_114_97_110_115_102_111_114_109_95_104_108_100_115_95_95_108_111_111_112_95_105_110_118_95_95_85_110_117_115_101_100_65_114_103_115_95_95_102_117_110_99_95_95_114_101_112_108_97_99_101_95_105_110_105_116_105_97_108_95_97_114_103_115_95_95_91_49_93_95_48_2_0, 3,6,5)
MR_decl_label3(fn__transform_hlds__loop_inv__arg_to_maybe_inv_arg_3_0, 3,6,2)
MR_decl_label1(fn__transform_hlds__loop_inv__argmodes_3_0, 2)
MR_decl_label2(fn__transform_hlds__loop_inv__gen_aux_call_2_0, 5,2)
MR_decl_label1(fn__transform_hlds__loop_inv__gen_aux_proc_case_2_0, 2)
MR_decl_label10(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0, 80,3,7,5,12,10,16,17,18,15)
MR_decl_label9(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0, 22,21,28,26,25,34,33,39,37)
MR_decl_label5(fn__transform_hlds__loop_inv__gen_aux_proc_handle_non_recursive_call_2_0, 6,10,15,7,4)
MR_decl_label1(fn__transform_hlds__loop_inv__gen_out_proc_case_3_0, 2)
MR_decl_label10(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0, 76,38,3,6,4,11,9,15,16,17)
MR_decl_label8(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0, 14,21,20,24,29,28,34,32)
MR_decl_label10(fn__transform_hlds__loop_inv__goal_inputs_2_0, 7,8,3,11,14,10,19,16,23,28)
MR_decl_label8(fn__transform_hlds__loop_inv__goal_inputs_2_0, 25,33,34,30,38,40,36,21)
MR_decl_label10(fn__transform_hlds__loop_inv__goal_outputs_2_0, 7,8,3,10,17,14,21,23,28,25)
MR_decl_label1(fn__transform_hlds__loop_inv__goal_outputs_2_0, 19)
MR_decl_label3(fn__transform_hlds__loop_inv__input_arg_3_0, 2,5,1)
MR_decl_label2(fn__transform_hlds__loop_inv__inv_args_4_0, 5,8)
MR_decl_label2(fn__transform_hlds__loop_inv__output_arg_3_0, 2,1)
MR_decl_label1(fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_0, 2)
MR_decl_label3(fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_2_0, 8,3,5)
MR_decl_label3(fn__transform_hlds__loop_inv__uniquely_used_args_3_0, 2,5,1)
MR_decl_label10(fn__transform_hlds__loop_inv__used_vars_2_0, 115,7,8,9,11,3,13,23,19,25)
MR_decl_label10(fn__transform_hlds__loop_inv__used_vars_2_0, 31,32,33,34,29,36,41,38,43,49)
MR_decl_label3(fn__transform_hlds__loop_inv__used_vars_2_0, 50,45,52)
MR_decl_label5(__Unify___transform_hlds__loop_inv__gen_aux_proc_info_0_0, 4,6,8,12,1)
MR_decl_label4(__Unify___transform_hlds__loop_inv__igc_info_0_0, 4,6,12,1)
MR_decl_label6(__Compare___transform_hlds__loop_inv__gen_aux_proc_info_0_0, 3,2,5,9,13,37)
MR_decl_label5(__Compare___transform_hlds__loop_inv__igc_info_0_0, 3,2,5,9,40)
MR_decl_static(transform_hlds__loop_inv__add_recursive_call_3_0)
MR_decl_static(transform_hlds__loop_inv__all_instmap_deltas_are_ground_2_0)
MR_decl_static(transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0)
MR_decl_static(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0)
MR_decl_static(transform_hlds__loop_inv__invariant_goal_candidates_keeping_path_candidates_4_0)
MR_decl_static(transform_hlds__loop_inv__invariant_goal_candidates_in_plain_conj_4_0)
MR_decl_static(transform_hlds__loop_inv__invariant_goal_candidates_in_parallel_conj_4_0)
MR_decl_static(transform_hlds__loop_inv__invariant_goal_candidates_in_disj_4_0)
MR_decl_static(transform_hlds__loop_inv__invariant_goal_candidates_in_switch_4_0)
MR_decl_static(fn__transform_hlds__loop_inv__inv_args_4_0)
MR_decl_static(transform_hlds__loop_inv__inv_goals_vars_6_0)
MR_decl_static(fn__transform_hlds__loop_inv__compute_initial_aux_instmap_2_0)
MR_decl_static(transform_hlds__loop_inv__create_aux_pred_10_0)
MR_decl_static(fn__transform_hlds__loop_inv__gen_aux_proc_handle_non_recursive_call_2_0)
MR_decl_static(fn__transform_hlds__loop_inv__gen_aux_call_2_0)
MR_decl_static(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0)
MR_decl_static(transform_hlds__loop_inv__gen_aux_proc_9_0)
MR_decl_static(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0)
MR_decl_static(transform_hlds__loop_inv__gen_out_proc_8_0)
MR_decl_static(fn__transform_hlds__loop_inv__case_goals_1_0)
MR_decl_static(fn__transform_hlds__loop_inv__argmodes_3_0)
MR_decl_static(fn__transform_hlds__loop_inv__used_vars_2_0)
MR_def_extern_entry(transform_hlds__loop_inv__hoist_loop_invariants_6_0)
MR_decl_static(transform_hlds__loop_inv__common_goal_2_0)
MR_decl_static(fn__transform_hlds__loop_inv__input_arg_3_0)
MR_decl_static(fn__transform_hlds__loop_inv__arg_to_maybe_inv_arg_3_0)
MR_decl_static(fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_0)
MR_decl_static(fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_2_0)
MR_decl_static(fn__transform_hlds__loop_inv__rhs_modes_1_0)
MR_decl_static(fn__transform_hlds__loop_inv__goal_inputs_2_0)
MR_decl_static(fn__transform_hlds__loop_inv__goal_outputs_2_0)
MR_decl_static(transform_hlds__loop_inv__add_outputs_5_0)
MR_decl_static(transform_hlds__loop_inv__inv_goals_vars_2_7_0)
MR_decl_static(transform_hlds__loop_inv__do_not_hoist_2_6_0)
MR_decl_static(transform_hlds__loop_inv__add_output_4_0)
MR_decl_static(fn__transform_hlds__loop_inv__gen_aux_proc_case_2_0)
MR_decl_static(fn__transform_hlds__loop_inv__gen_out_proc_case_3_0)
MR_decl_static(fn__transform_hlds__loop_inv__uniquely_used_args_3_0)
MR_decl_static(fn__transform_hlds__loop_inv__output_arg_3_0)
MR_decl_static(__Unify___transform_hlds__loop_inv__gen_aux_proc_info_0_0)
MR_decl_static(__Compare___transform_hlds__loop_inv__gen_aux_proc_info_0_0)
MR_decl_static(__Unify___transform_hlds__loop_inv__igc_info_0_0)
MR_decl_static(__Compare___transform_hlds__loop_inv__igc_info_0_0)
MR_decl_static(__Unify___transform_hlds__loop_inv__inst_info_0_0)
MR_decl_static(__Compare___transform_hlds__loop_inv__inst_info_0_0)
MR_decl_static(__Unify___transform_hlds__loop_inv__rec_call_0_0)
MR_decl_static(__Compare___transform_hlds__loop_inv__rec_call_0_0)
MR_decl_static(fn__transform_hlds__loop_inv__IntroducedFrom__func__inv_args__490__1_1_0)
MR_decl_static(fn__transform_hlds__loop_inv__IntroducedFrom__func__compute_initial_aux_instmap__736__1_2_0)
MR_decl_static(fn__transform_hlds__loop_inv__IntroducedFrom__func__case_goals__1148__1_1_0)
MR_decl_static(fn__transform_hlds__loop_inv__IntroducedFrom__func__rhs_modes__1321__1_1_0)
MR_decl_static(fn__f_116_114_97_110_115_102_111_114_109_95_104_108_100_115_95_95_108_111_111_112_95_105_110_118_95_95_85_110_117_115_101_100_65_114_103_115_95_95_102_117_110_99_95_95_114_101_112_108_97_99_101_95_105_110_105_116_105_97_108_95_97_114_103_115_95_95_91_49_93_95_48_2_0)

extern const MR_TypeCtorInfo_Struct mercury_data_term__type_ctor_info_var_1;
extern const MR_TypeCtorInfo_Struct mercury_data_parse_tree__prog_data__type_ctor_info_prog_var_type_0;
extern const MR_TypeCtorInfo_Struct mercury_data_maybe__type_ctor_info_maybe_1;
extern const MR_TypeCtorInfo_Struct mercury_data_parse_tree__prog_data__type_ctor_info_prog_var_type_0;
extern const MR_TypeCtorInfo_Struct mercury_data_term__type_ctor_info_var_1;
extern const MR_TypeCtorInfo_Struct mercury_data_list__type_ctor_info_list_1;
extern const MR_TypeCtorInfo_Struct mercury_data_maybe__type_ctor_info_maybe_1;
extern const MR_TypeCtorInfo_Struct mercury_data_hlds__hlds_goal__type_ctor_info_hlds_goal_0;
extern const MR_TypeCtorInfo_Struct mercury_data_hlds__hlds_goal__type_ctor_info_hlds_goal_0;
extern const MR_TypeCtorInfo_Struct mercury_data_list__type_ctor_info_list_1;
static const struct mercury_type_0 mercury_common_0[14] =
{
{
{
MR_CTOR1_ADDR(term, var),
MR_CTOR0_ADDR(parse_tree__prog_data, prog_var_type)
}
},
{
{
MR_CTOR1_ADDR(maybe, maybe),
MR_TAG_COMMON(0,0,0)
}
},
{
{
MR_CTOR1_ADDR(term, var),
MR_CTOR0_ADDR(parse_tree__prog_data, prog_var_type)
}
},
{
{
MR_CTOR1_ADDR(term, var),
MR_CTOR0_ADDR(parse_tree__prog_data, prog_var_type)
}
},
{
{
MR_CTOR1_ADDR(maybe, maybe),
MR_COMMON(0,3)
}
},
{
{
MR_LIST_CTOR_ADDR,
MR_TAG_COMMON(0,0,1)
}
},
{
{
MR_CTOR1_ADDR(maybe, maybe),
MR_COMMON(0,3)
}
},
{
{
MR_LIST_CTOR_ADDR,
MR_COMMON(0,6)
}
},
{
{
MR_LIST_CTOR_ADDR,
MR_COMMON(0,3)
}
},
{
{
MR_LIST_CTOR_ADDR,
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal)
}
},
{
{
MR_LIST_CTOR_ADDR,
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal)
}
},
{
{
MR_LIST_CTOR_ADDR,
MR_TAG_COMMON(0,0,0)
}
},
{
{
MR_LIST_CTOR_ADDR,
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal)
}
},
{
{
MR_LIST_CTOR_ADDR,
MR_COMMON(0,12)
}
},
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__inv_args_4_0_1;
extern const MR_TypeCtorInfo_Struct mercury_data_hlds__hlds_module__type_ctor_info_module_info_0;
extern const MR_TypeCtorInfo_Struct mercury_data_parse_tree__prog_data__type_ctor_info_mer_mode_0;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_1;
extern const MR_TypeCtorInfo_Struct mercury_data_hlds__hlds_pred__type_ctor_info_pred_proc_id_0;
extern const MR_TypeCtorInfo_Struct mercury_data_hlds__hlds_goal__type_ctor_info_hlds_goal_0;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_2;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_3;
extern const MR_TypeCtorInfo_Struct mercury_data_hlds__hlds_goal__type_ctor_info_case_0;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_1;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_6;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_7;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_inputs_2_0_1;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_inputs_2_0_3;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_inputs_2_0_4;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_inputs_2_0_5;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_inputs_2_0_6;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_outputs_2_0_1;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_outputs_2_0_3;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_outputs_2_0_4;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_outputs_2_0_5;
static const MR_UserClosureId
mercury_data__closure_layout__transform_hlds__loop_inv__add_outputs_5_0_1;
static const MR_UserClosureId
mercury_data__closure_layout__transform_hlds__loop_inv__inv_goals_vars_2_7_0_1;
static const struct mercury_type_1 mercury_common_1[18] =
{
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__inv_args_4_0_1,
(MR_Word *) (MR_Integer) 0
},
4,
{
MR_CTOR0_ADDR(hlds__hlds_module, module_info),
MR_COMMON(0,2),
MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode),
MR_COMMON(0,4)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_1,
(MR_Word *) (MR_Integer) 0
},
4,
{
MR_CTOR0_ADDR(hlds__hlds_pred, pred_proc_id),
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal),
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal),
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_2,
(MR_Word *) (MR_Integer) 0
},
4,
{
MR_CTOR0_ADDR(hlds__hlds_pred, pred_proc_id),
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal),
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal),
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_3,
(MR_Word *) (MR_Integer) 0
},
4,
{
MR_CTOR0_ADDR(hlds__hlds_pred, pred_proc_id),
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal),
MR_CTOR0_ADDR(hlds__hlds_goal, case),
MR_CTOR0_ADDR(hlds__hlds_goal, case)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_1,
(MR_Word *) (MR_Integer) 0
},
4,
{
MR_CTOR0_ADDR(hlds__hlds_module, module_info),
MR_COMMON(0,2),
MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode),
MR_COMMON(0,2)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_6,
(MR_Word *) (MR_Integer) 0
},
4,
{
MR_CTOR0_ADDR(hlds__hlds_module, module_info),
MR_COMMON(0,2),
MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode),
MR_COMMON(0,2)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_7,
(MR_Word *) (MR_Integer) 0
},
4,
{
MR_CTOR0_ADDR(hlds__hlds_module, module_info),
MR_COMMON(0,2),
MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode),
MR_COMMON(0,2)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_inputs_2_0_1,
(MR_Word *) (MR_Integer) 0
},
4,
{
MR_CTOR0_ADDR(hlds__hlds_module, module_info),
MR_COMMON(0,2),
MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode),
MR_COMMON(0,2)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_inputs_2_0_3,
(MR_Word *) (MR_Integer) 0
},
4,
{
MR_CTOR0_ADDR(hlds__hlds_module, module_info),
MR_COMMON(0,2),
MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode),
MR_COMMON(0,2)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_inputs_2_0_4,
(MR_Word *) (MR_Integer) 0
},
4,
{
MR_CTOR0_ADDR(hlds__hlds_module, module_info),
MR_COMMON(0,2),
MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode),
MR_COMMON(0,2)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_inputs_2_0_5,
(MR_Word *) (MR_Integer) 0
},
4,
{
MR_CTOR0_ADDR(hlds__hlds_module, module_info),
MR_COMMON(0,2),
MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode),
MR_COMMON(0,2)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_inputs_2_0_6,
(MR_Word *) (MR_Integer) 0
},
4,
{
MR_CTOR0_ADDR(hlds__hlds_module, module_info),
MR_COMMON(0,2),
MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode),
MR_COMMON(0,2)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_outputs_2_0_1,
(MR_Word *) (MR_Integer) 0
},
4,
{
MR_CTOR0_ADDR(hlds__hlds_module, module_info),
MR_COMMON(0,2),
MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode),
MR_COMMON(0,2)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_outputs_2_0_3,
(MR_Word *) (MR_Integer) 0
},
4,
{
MR_CTOR0_ADDR(hlds__hlds_module, module_info),
MR_COMMON(0,2),
MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode),
MR_COMMON(0,2)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_outputs_2_0_4,
(MR_Word *) (MR_Integer) 0
},
4,
{
MR_CTOR0_ADDR(hlds__hlds_module, module_info),
MR_COMMON(0,2),
MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode),
MR_COMMON(0,2)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_outputs_2_0_5,
(MR_Word *) (MR_Integer) 0
},
4,
{
MR_CTOR0_ADDR(hlds__hlds_module, module_info),
MR_COMMON(0,2),
MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode),
MR_COMMON(0,2)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__transform_hlds__loop_inv__add_outputs_5_0_1,
(MR_Word *) (MR_Integer) 0
},
4,
{
MR_COMMON(0,8),
MR_COMMON(0,2),
MR_COMMON(0,8),
MR_COMMON(0,8)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__transform_hlds__loop_inv__inv_goals_vars_2_7_0_1,
(MR_Word *) (MR_Integer) 0
},
4,
{
MR_COMMON(0,8),
MR_COMMON(0,2),
MR_COMMON(0,8),
MR_COMMON(0,8)
}
},
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__inv_args_4_0_2;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__compute_initial_aux_instmap_2_0_1;
extern const MR_TypeCtorInfo_Struct mercury_data_hlds__instmap__type_ctor_info_instmap_0;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_1;
extern const MR_TypeCtorInfo_Struct mercury_data_transform_hlds__loop_inv__type_ctor_info_gen_aux_proc_info_0;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_2;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_3;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_4;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_5;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_8;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_0_1;
static const struct mercury_type_2 mercury_common_2[9] =
{
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__inv_args_4_0_2,
(MR_Word *) (MR_Integer) 0
},
3,
{
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal),
MR_COMMON(0,7),
MR_COMMON(0,7)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__compute_initial_aux_instmap_2_0_1,
(MR_Word *) (MR_Integer) 0
},
3,
{
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal),
MR_CTOR0_ADDR(hlds__instmap, instmap),
MR_CTOR0_ADDR(hlds__instmap, instmap)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_1,
(MR_Word *) (MR_Integer) 0
},
3,
{
MR_CTOR0_ADDR(transform_hlds__loop_inv, gen_aux_proc_info),
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal),
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_2,
(MR_Word *) (MR_Integer) 0
},
3,
{
MR_CTOR0_ADDR(transform_hlds__loop_inv, gen_aux_proc_info),
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal),
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_3,
(MR_Word *) (MR_Integer) 0
},
3,
{
MR_CTOR0_ADDR(transform_hlds__loop_inv, gen_aux_proc_info),
MR_CTOR0_ADDR(hlds__hlds_goal, case),
MR_CTOR0_ADDR(hlds__hlds_goal, case)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_4,
(MR_Word *) (MR_Integer) 0
},
3,
{
MR_CTOR0_ADDR(hlds__hlds_module, module_info),
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal),
MR_COMMON(0,8)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_5,
(MR_Word *) (MR_Integer) 0
},
3,
{
MR_CTOR0_ADDR(hlds__hlds_module, module_info),
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal),
MR_COMMON(0,8)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_8,
(MR_Word *) (MR_Integer) 0
},
3,
{
MR_CTOR0_ADDR(hlds__hlds_module, module_info),
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal),
MR_COMMON(0,8)
}
},
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_0_1,
(MR_Word *) (MR_Integer) 0
},
3,
{
MR_COMMON(0,4),
MR_COMMON(0,2),
MR_COMMON(0,4)
}
},
};

MR_decl_entry(fn__hlds__hlds_goal__foreign_arg_var_1_0);
static const struct mercury_type_3 mercury_common_3[10] =
{
{
MR_COMMON(2,0),
MR_ENTRY_AP(fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_0),
0
},
{
MR_COMMON(4,0),
MR_ENTRY_AP(fn__transform_hlds__loop_inv__IntroducedFrom__func__inv_args__490__1_1_0),
0
},
{
MR_COMMON(2,1),
MR_ENTRY_AP(fn__transform_hlds__loop_inv__IntroducedFrom__func__compute_initial_aux_instmap__736__1_2_0),
0
},
{
MR_COMMON(4,1),
MR_ENTRY_AP(fn__transform_hlds__loop_inv__IntroducedFrom__func__case_goals__1148__1_1_0),
0
},
{
MR_COMMON(4,2),
MR_ENTRY_AP(fn__hlds__hlds_goal__foreign_arg_var_1_0),
0
},
{
MR_COMMON(4,3),
MR_ENTRY_AP(fn__hlds__hlds_goal__foreign_arg_var_1_0),
0
},
{
MR_COMMON(2,8),
MR_ENTRY_AP(fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_2_0),
0
},
{
MR_COMMON(4,5),
MR_ENTRY_AP(fn__transform_hlds__loop_inv__IntroducedFrom__func__rhs_modes__1321__1_1_0),
0
},
{
MR_COMMON(4,6),
MR_ENTRY_AP(fn__hlds__hlds_goal__foreign_arg_var_1_0),
0
},
{
MR_COMMON(4,7),
MR_ENTRY_AP(fn__hlds__hlds_goal__foreign_arg_var_1_0),
0
},
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__inv_args_4_0_3;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__case_goals_1_0_1;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_2;
extern const MR_TypeCtorInfo_Struct mercury_data_hlds__hlds_goal__type_ctor_info_foreign_arg_0;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_3;
static const MR_UserClosureId
mercury_data__closure_layout__transform_hlds__loop_inv__hoist_loop_invariants_6_0_1;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__rhs_modes_1_0_1;
extern const MR_TypeCtorInfo_Struct mercury_data_hlds__hlds_goal__type_ctor_info_uni_mode_0;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_inputs_2_0_2;
static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_outputs_2_0_2;
static const struct mercury_type_4 mercury_common_4[8] =
{
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__inv_args_4_0_3,
(MR_Word *) (MR_Integer) 0,
2,
MR_COMMON(0,4),
MR_COMMON(0,2)
},
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__case_goals_1_0_1,
(MR_Word *) (MR_Integer) 0,
2,
MR_CTOR0_ADDR(hlds__hlds_goal, case),
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal)
},
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_2,
(MR_Word *) (MR_Integer) 0,
2,
MR_CTOR0_ADDR(hlds__hlds_goal, foreign_arg),
MR_COMMON(0,2)
},
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_3,
(MR_Word *) (MR_Integer) 0,
2,
MR_CTOR0_ADDR(hlds__hlds_goal, foreign_arg),
MR_COMMON(0,2)
},
{
(MR_Word *) &mercury_data__closure_layout__transform_hlds__loop_inv__hoist_loop_invariants_6_0_1,
(MR_Word *) (MR_Integer) 0,
2,
MR_COMMON(0,13),
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal)
},
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__rhs_modes_1_0_1,
(MR_Word *) (MR_Integer) 0,
2,
MR_CTOR0_ADDR(hlds__hlds_goal, uni_mode),
MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode)
},
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_inputs_2_0_2,
(MR_Word *) (MR_Integer) 0,
2,
MR_CTOR0_ADDR(hlds__hlds_goal, foreign_arg),
MR_COMMON(0,2)
},
{
(MR_Word *) &mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_outputs_2_0_2,
(MR_Word *) (MR_Integer) 0,
2,
MR_CTOR0_ADDR(hlds__hlds_goal, foreign_arg),
MR_COMMON(0,2)
},
};

static const MR_UserClosureId
mercury_data__closure_layout__transform_hlds__loop_inv__inv_goals_vars_6_0_1;
static const struct mercury_type_5 mercury_common_5[1] =
{
{
{
(MR_Word *) &mercury_data__closure_layout__transform_hlds__loop_inv__inv_goals_vars_6_0_1,
(MR_Word *) (MR_Integer) 0
},
7,
{
MR_CTOR0_ADDR(hlds__hlds_module, module_info),
MR_COMMON(0,8),
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal),
MR_COMMON(0,9),
MR_COMMON(0,9),
MR_COMMON(0,8),
MR_COMMON(0,8)
}
},
};

static const MR_UserClosureId
mercury_data__closure_layout__transform_hlds__loop_inv__hoist_loop_invariants_6_0_2;
static const struct mercury_type_6 mercury_common_6[1] =
{
{
{
(MR_Word *) &mercury_data__closure_layout__transform_hlds__loop_inv__hoist_loop_invariants_6_0_2,
(MR_Word *) (MR_Integer) 0
},
6,
{
MR_CTOR0_ADDR(hlds__hlds_module, module_info),
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal),
MR_COMMON(0,9),
MR_COMMON(0,9),
MR_COMMON(0,8),
MR_COMMON(0,8)
}
},
};

extern const MR_TypeCtorInfo_Struct mercury_data_pair__type_ctor_info_pair_2;
static const struct mercury_type_7 mercury_common_7[1] =
{
{
{
MR_CTOR_ADDR(pair, pair, 2),
MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal),
MR_TAG_COMMON(0,0,10)
}
},
};

extern const MR_TypeCtorInfo_Struct mercury_data_builtin__type_ctor_info_tuple_0;
extern const MR_TypeCtorInfo_Struct mercury_data_hlds__hlds_module__type_ctor_info_module_info_0;
extern const MR_TypeCtorInfo_Struct mercury_data_hlds__instmap__type_ctor_info_instmap_0;
static const struct mercury_type_8 mercury_common_8[1] =
{
{
MR_CTOR0_ADDR(builtin, tuple),
2,
MR_CTOR0_ADDR(hlds__hlds_module, module_info),
MR_CTOR0_ADDR(hlds__instmap, instmap)
},
};

static const MR_FA_TypeInfo_Struct1 mercury_data_list__ti_list_1hlds__hlds_goal__type_ctor_info_hlds_goal_0 = {
	&mercury_data_list__type_ctor_info_list_1,
{	(MR_TypeInfo) &mercury_data_hlds__hlds_goal__type_ctor_info_hlds_goal_0
}};
extern const MR_TypeCtorInfo_Struct mercury_data_hlds__hlds_pred__type_ctor_info_pred_proc_id_0;
extern const MR_TypeCtorInfo_Struct mercury_data_hlds__hlds_module__type_ctor_info_module_info_0;
extern const MR_TypeCtorInfo_Struct mercury_data_hlds__hlds_pred__type_ctor_info_pred_proc_id_0;

const MR_PseudoTypeInfo mercury_data_transform_hlds__loop_inv__field_types_gen_aux_proc_info_0_0[] = {
	(MR_PseudoTypeInfo) &mercury_data_hlds__hlds_module__type_ctor_info_module_info_0,
	(MR_PseudoTypeInfo) &mercury_data_list__ti_list_1hlds__hlds_goal__type_ctor_info_hlds_goal_0,
	(MR_PseudoTypeInfo) &mercury_data_hlds__hlds_pred__type_ctor_info_pred_proc_id_0,
	(MR_PseudoTypeInfo) &mercury_data_hlds__hlds_goal__type_ctor_info_hlds_goal_0
};

const MR_ConstString mercury_data_transform_hlds__loop_inv__field_names_gen_aux_proc_info_0_0[] = {
	"gapi_module_info",
	"gapi_inv_goals",
	"gapi_pred_proc_id",
	"gapi_call_aux_goal"
};

static const MR_DuFunctorDesc mercury_data_transform_hlds__loop_inv__du_functor_desc_gen_aux_proc_info_0_0 = {
	"gen_aux_proc_info",
	4,
	0,
	MR_SECTAG_NONE,
	0,
	-1,
	0,
	(MR_PseudoTypeInfo *) mercury_data_transform_hlds__loop_inv__field_types_gen_aux_proc_info_0_0,
	mercury_data_transform_hlds__loop_inv__field_names_gen_aux_proc_info_0_0,
	NULL
};

const MR_DuFunctorDescPtr mercury_data_transform_hlds__loop_inv__du_stag_ordered_gen_aux_proc_info_0_0[] = {
	&mercury_data_transform_hlds__loop_inv__du_functor_desc_gen_aux_proc_info_0_0

};

const MR_DuPtagLayout mercury_data_transform_hlds__loop_inv__du_ptag_ordered_gen_aux_proc_info_0[] = {
	{ 1, MR_SECTAG_NONE,
	mercury_data_transform_hlds__loop_inv__du_stag_ordered_gen_aux_proc_info_0_0 }

};

const MR_DuFunctorDescPtr mercury_data_transform_hlds__loop_inv__du_name_ordered_gen_aux_proc_info_0[] = {
	&mercury_data_transform_hlds__loop_inv__du_functor_desc_gen_aux_proc_info_0_0
};

const MR_Integer mercury_data_transform_hlds__loop_inv__functor_number_map_gen_aux_proc_info_0[] = {
	0 };
	
const MR_TypeCtorInfo_Struct mercury_data_transform_hlds__loop_inv__type_ctor_info_gen_aux_proc_info_0 = {
	0,
	14,
	1,
	MR_TYPECTOR_REP_DU,
	MR_MAYBE_STATIC_CODE(MR_ENTRY_AP(__Unify___transform_hlds__loop_inv__gen_aux_proc_info_0_0)),
	MR_MAYBE_STATIC_CODE(MR_ENTRY_AP(__Compare___transform_hlds__loop_inv__gen_aux_proc_info_0_0)),
	"transform_hlds.loop_inv",
	"gen_aux_proc_info",
	{ (void *)mercury_data_transform_hlds__loop_inv__du_name_ordered_gen_aux_proc_info_0 },
	{ (void *)mercury_data_transform_hlds__loop_inv__du_ptag_ordered_gen_aux_proc_info_0 },
	1,
	4,
	mercury_data_transform_hlds__loop_inv__functor_number_map_gen_aux_proc_info_0
};
extern const MR_TypeCtorInfo_Struct mercury_data_cord__type_ctor_info_cord_1;

static const MR_FA_TypeInfo_Struct1 mercury_data_cord__ti_cord_1hlds__hlds_goal__type_ctor_info_hlds_goal_0 = {
	&mercury_data_cord__type_ctor_info_cord_1,
{	(MR_TypeInfo) &mercury_data_hlds__hlds_goal__type_ctor_info_hlds_goal_0
}};

static const MR_FA_TypeInfo_Struct2 mercury_data_pair__ti_pair_2hlds__hlds_goal__type_ctor_info_hlds_goal_0list__ti_list_1hlds__hlds_goal__type_ctor_info_hlds_goal_0 = {
	&mercury_data_pair__type_ctor_info_pair_2,
{	(MR_TypeInfo) &mercury_data_hlds__hlds_goal__type_ctor_info_hlds_goal_0,
	(MR_TypeInfo) &mercury_data_list__ti_list_1hlds__hlds_goal__type_ctor_info_hlds_goal_0
}};

static const MR_FA_TypeInfo_Struct1 mercury_data_list__ti_list_1pair__ti_pair_2hlds__hlds_goal__type_ctor_info_hlds_goal_0list__ti_list_1hlds__hlds_goal__type_ctor_info_hlds_goal_0 = {
	&mercury_data_list__type_ctor_info_list_1,
{	(MR_TypeInfo) &mercury_data_pair__ti_pair_2hlds__hlds_goal__type_ctor_info_hlds_goal_0list__ti_list_1hlds__hlds_goal__type_ctor_info_hlds_goal_0
}};

const MR_PseudoTypeInfo mercury_data_transform_hlds__loop_inv__field_types_igc_info_0_0[] = {
	(MR_PseudoTypeInfo) &mercury_data_hlds__hlds_module__type_ctor_info_module_info_0,
	(MR_PseudoTypeInfo) &mercury_data_cord__ti_cord_1hlds__hlds_goal__type_ctor_info_hlds_goal_0,
	(MR_PseudoTypeInfo) &mercury_data_list__ti_list_1pair__ti_pair_2hlds__hlds_goal__type_ctor_info_hlds_goal_0list__ti_list_1hlds__hlds_goal__type_ctor_info_hlds_goal_0
};

const MR_ConstString mercury_data_transform_hlds__loop_inv__field_names_igc_info_0_0[] = {
	"igc_module_info",
	"igc_path_candidates",
	"igc_rec_calls"
};

static const MR_DuFunctorDesc mercury_data_transform_hlds__loop_inv__du_functor_desc_igc_info_0_0 = {
	"igc_info",
	3,
	0,
	MR_SECTAG_NONE,
	0,
	-1,
	0,
	(MR_PseudoTypeInfo *) mercury_data_transform_hlds__loop_inv__field_types_igc_info_0_0,
	mercury_data_transform_hlds__loop_inv__field_names_igc_info_0_0,
	NULL
};

const MR_DuFunctorDescPtr mercury_data_transform_hlds__loop_inv__du_stag_ordered_igc_info_0_0[] = {
	&mercury_data_transform_hlds__loop_inv__du_functor_desc_igc_info_0_0

};

const MR_DuPtagLayout mercury_data_transform_hlds__loop_inv__du_ptag_ordered_igc_info_0[] = {
	{ 1, MR_SECTAG_NONE,
	mercury_data_transform_hlds__loop_inv__du_stag_ordered_igc_info_0_0 }

};

const MR_DuFunctorDescPtr mercury_data_transform_hlds__loop_inv__du_name_ordered_igc_info_0[] = {
	&mercury_data_transform_hlds__loop_inv__du_functor_desc_igc_info_0_0
};

const MR_Integer mercury_data_transform_hlds__loop_inv__functor_number_map_igc_info_0[] = {
	0 };
	
const MR_TypeCtorInfo_Struct mercury_data_transform_hlds__loop_inv__type_ctor_info_igc_info_0 = {
	0,
	14,
	1,
	MR_TYPECTOR_REP_DU,
	MR_MAYBE_STATIC_CODE(MR_ENTRY_AP(__Unify___transform_hlds__loop_inv__igc_info_0_0)),
	MR_MAYBE_STATIC_CODE(MR_ENTRY_AP(__Compare___transform_hlds__loop_inv__igc_info_0_0)),
	"transform_hlds.loop_inv",
	"igc_info",
	{ (void *)mercury_data_transform_hlds__loop_inv__du_name_ordered_igc_info_0 },
	{ (void *)mercury_data_transform_hlds__loop_inv__du_ptag_ordered_igc_info_0 },
	1,
	4,
	mercury_data_transform_hlds__loop_inv__functor_number_map_igc_info_0
};
extern const MR_TypeCtorInfo_Struct mercury_data_builtin__type_ctor_info_tuple_0;
extern const MR_TypeCtorInfo_Struct mercury_data_hlds__instmap__type_ctor_info_instmap_0;

static const MR_VA_TypeInfo_Struct2 mercury_data___vti_tuple_2hlds__hlds_module__type_ctor_info_module_info_0hlds__instmap__type_ctor_info_instmap_0 = {
	&mercury_data_builtin__type_ctor_info_tuple_0,
	2,
{	(MR_TypeInfo) &mercury_data_hlds__hlds_module__type_ctor_info_module_info_0,
	(MR_TypeInfo) &mercury_data_hlds__instmap__type_ctor_info_instmap_0
}};

const MR_TypeCtorInfo_Struct mercury_data_transform_hlds__loop_inv__type_ctor_info_inst_info_0 = {
	0,
	14,
	-1,
	MR_TYPECTOR_REP_EQUIV_GROUND,
	MR_MAYBE_STATIC_CODE(MR_ENTRY_AP(__Unify___transform_hlds__loop_inv__inst_info_0_0)),
	MR_MAYBE_STATIC_CODE(MR_ENTRY_AP(__Compare___transform_hlds__loop_inv__inst_info_0_0)),
	"transform_hlds.loop_inv",
	"inst_info",
	{ 0 },
	{ (void *)&mercury_data___vti_tuple_2hlds__hlds_module__type_ctor_info_module_info_0hlds__instmap__type_ctor_info_instmap_0 },
	-1,
	0,
	NULL
};

const MR_TypeCtorInfo_Struct mercury_data_transform_hlds__loop_inv__type_ctor_info_rec_call_0 = {
	0,
	14,
	-1,
	MR_TYPECTOR_REP_EQUIV_GROUND,
	MR_MAYBE_STATIC_CODE(MR_ENTRY_AP(__Unify___transform_hlds__loop_inv__rec_call_0_0)),
	MR_MAYBE_STATIC_CODE(MR_ENTRY_AP(__Compare___transform_hlds__loop_inv__rec_call_0_0)),
	"transform_hlds.loop_inv",
	"rec_call",
	{ 0 },
	{ (void *)&mercury_data_pair__ti_pair_2hlds__hlds_goal__type_ctor_info_hlds_goal_0list__ti_list_1hlds__hlds_goal__type_ctor_info_hlds_goal_0 },
	-1,
	0,
	NULL
};


static const MR_UserClosureId
mercury_data__closure_layout__transform_hlds__loop_inv__inv_goals_vars_2_7_0_1 = {
{
MR_PREDICATE,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"add_output",
4,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
716,
"7"
};

static const MR_UserClosureId
mercury_data__closure_layout__transform_hlds__loop_inv__add_outputs_5_0_1 = {
{
MR_PREDICATE,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"add_output",
4,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
716,
"7"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_outputs_2_0_5 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"output_arg",
4,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
1280,
"33"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_outputs_2_0_4 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"output_arg",
4,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
1260,
"10"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_outputs_2_0_3 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"output_arg",
4,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
1264,
"15"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_outputs_2_0_2 = {
{
MR_FUNCTION,
"hlds.hlds_goal",
"hlds.hlds_goal",
"foreign_arg_var",
2,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
1269,
"21"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_outputs_2_0_1 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"output_arg",
4,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
1268,
"19"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_inputs_2_0_6 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"input_arg",
4,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
1201,
"36"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_inputs_2_0_5 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"input_arg",
4,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
1196,
"31"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_inputs_2_0_4 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"input_arg",
4,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
1178,
"10"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_inputs_2_0_3 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"input_arg",
4,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
1183,
"16"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_inputs_2_0_2 = {
{
MR_FUNCTION,
"hlds.hlds_goal",
"hlds.hlds_goal",
"foreign_arg_var",
2,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
1189,
"23"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__goal_inputs_2_0_1 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"input_arg",
4,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
1188,
"21"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__rhs_modes_1_0_1 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"lambda_loop_inv_m_1321",
2,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
1321,
"4"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_0_1 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"refine_candidate_inv_args_2",
3,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
510,
"8"
};

static const MR_UserClosureId
mercury_data__closure_layout__transform_hlds__loop_inv__hoist_loop_invariants_6_0_2 = {
{
MR_PREDICATE,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"do_not_hoist_2",
6,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
605,
"6"
};

static const MR_UserClosureId
mercury_data__closure_layout__transform_hlds__loop_inv__hoist_loop_invariants_6_0_1 = {
{
MR_PREDICATE,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"common_goal",
2,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
448,
"7"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_8 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"used_vars",
3,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
1126,
"43"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_7 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"uniquely_used_args",
4,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
1090,
"10"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_6 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"uniquely_used_args",
4,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
1095,
"15"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_5 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"used_vars",
3,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
1123,
"38"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_4 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"used_vars",
3,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
1120,
"33"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_3 = {
{
MR_FUNCTION,
"hlds.hlds_goal",
"hlds.hlds_goal",
"foreign_arg_var",
2,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
1112,
"24"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_2 = {
{
MR_FUNCTION,
"hlds.hlds_goal",
"hlds.hlds_goal",
"foreign_arg_var",
2,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
1110,
"21"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__used_vars_2_0_1 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"uniquely_used_args",
4,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
1108,
"19"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__case_goals_1_0_1 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"lambda_loop_inv_m_1148",
2,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
1148,
"4"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_3 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"gen_out_proc_case",
4,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
1002,
"35"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_2 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"gen_out_proc_goal",
4,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
997,
"29"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_1 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"gen_out_proc_goal",
4,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
992,
"23"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_3 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"gen_aux_proc_case",
3,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
888,
"38"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_2 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"gen_aux_proc_goal",
3,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
883,
"32"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_1 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"gen_aux_proc_goal",
3,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
878,
"26"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__compute_initial_aux_instmap_2_0_1 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"lambda_loop_inv_m_736",
3,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
736,
"5"
};

static const MR_UserClosureId
mercury_data__closure_layout__transform_hlds__loop_inv__inv_goals_vars_6_0_1 = {
{
MR_PREDICATE,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"inv_goals_vars_2",
7,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
544,
"8"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__inv_args_4_0_3 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"lambda_loop_inv_m_490",
2,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
490,
"12"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__inv_args_4_0_2 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"refine_candidate_inv_args",
3,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
488,
"10"
};

static const MR_UserClosureId
mercury_data__closure_layout__fn__transform_hlds__loop_inv__inv_args_4_0_1 = {
{
MR_FUNCTION,
"transform_hlds.loop_inv",
"transform_hlds.loop_inv",
"arg_to_maybe_inv_arg",
4,
0
},
"transform_hlds.loop_inv",
"loop_inv.m",
485,
"8"
};


MR_decl_entry(fn__cord__list_1_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module0)
	MR_init_entry1(transform_hlds__loop_inv__add_recursive_call_3_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__transform_hlds__loop_inv__add_recursive_call_3_0);
	MR_init_label1(transform_hlds__loop_inv__add_recursive_call_3_0,2)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'add_recursive_call'/3 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(transform_hlds__loop_inv__add_recursive_call_3_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(3);
	MR_sv(3) = (MR_Word) MR_succip;
	MR_sv(1) = MR_r1;
	MR_sv(2) = MR_r2;
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r2 = MR_tfield(0, MR_r2, 1);
	MR_np_call_localret_ent(fn__cord__list_1_0,
		transform_hlds__loop_inv__add_recursive_call_3_0_i2);
MR_def_label(transform_hlds__loop_inv__add_recursive_call_3_0,2)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_tag_alloc_heap(MR_r2, 0, (MR_Integer) 2);
	MR_tfield(0, MR_r2, 0) = MR_sv(1);
	MR_tfield(0, MR_r2, 1) = MR_r1;
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tag_alloc_heap(MR_tempr1, 1, (MR_Integer) 2);
	MR_tfield(1, MR_tempr1, 0) = MR_r2;
	MR_tempr2 = MR_sv(2);
	MR_tfield(1, MR_tempr1, 1) = MR_tfield(0, MR_tempr2, 2);
	MR_tag_alloc_heap(MR_r1, 0, (MR_Integer) 3);
	MR_tfield(0, MR_r1, 0) = MR_tfield(0, MR_tempr2, 0);
	MR_tfield(0, MR_r1, 1) = MR_tfield(0, MR_tempr2, 1);
	MR_tfield(0, MR_r1, 2) = MR_tempr1;
	MR_decr_sp_and_return(3);
	}
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(check_hlds__inst_match__inst_is_ground_2_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module1)
	MR_init_entry1(transform_hlds__loop_inv__all_instmap_deltas_are_ground_2_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__transform_hlds__loop_inv__all_instmap_deltas_are_ground_2_0);
	MR_init_label4(transform_hlds__loop_inv__all_instmap_deltas_are_ground_2_0,17,4,2,1)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'all_instmap_deltas_are_ground'/2 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(transform_hlds__loop_inv__all_instmap_deltas_are_ground_2_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(3);
	MR_sv(3) = (MR_Word) MR_succip;
MR_def_label(transform_hlds__loop_inv__all_instmap_deltas_are_ground_2_0,17)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_LTAGS_TEST(MR_r2,0,0)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__all_instmap_deltas_are_ground_2_0_i2);
	}
	MR_sv(1) = MR_r1;
	MR_sv(2) = MR_tfield(1, MR_r2, 1);
	MR_r2 = MR_tfield(0, MR_tfield(1, MR_r2, 0), 1);
	MR_np_call_localret_ent(check_hlds__inst_match__inst_is_ground_2_0,
		transform_hlds__loop_inv__all_instmap_deltas_are_ground_2_0_i4);
MR_def_label(transform_hlds__loop_inv__all_instmap_deltas_are_ground_2_0,4)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (!(MR_r1)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__all_instmap_deltas_are_ground_2_0_i1);
	}
	MR_r1 = MR_sv(1);
	MR_r2 = MR_sv(2);
	MR_succip_word = MR_sv(3);
	MR_GOTO_LAB(transform_hlds__loop_inv__all_instmap_deltas_are_ground_2_0_i17);
MR_def_label(transform_hlds__loop_inv__all_instmap_deltas_are_ground_2_0,2)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = MR_TRUE;
	MR_decr_sp_and_return(3);
MR_def_label(transform_hlds__loop_inv__all_instmap_deltas_are_ground_2_0,1)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = MR_FALSE;
	MR_decr_sp_and_return(3);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(fn__hlds__hlds_goal__goal_info_get_determinism_1_0);
MR_decl_entry(hlds__code_model__determinism_to_code_model_2_0);
MR_decl_entry(fn__hlds__hlds_goal__goal_info_get_purity_1_0);
MR_decl_entry(fn__hlds__hlds_goal__goal_info_get_instmap_delta_1_0);
MR_decl_entry(hlds__instmap__instmap_delta_to_assoc_list_2_0);
MR_decl_entry(fn__cord__snoc_2_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module2)
	MR_init_entry1(transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0);
	MR_init_label10(transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0,3,4,6,5,8,10,11,12,14,2)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'invariant_goal_candidates_handle_primitive_goal'/3 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(4);
	MR_sv(4) = (MR_Word) MR_succip;
	MR_sv(1) = MR_r1;
	MR_sv(2) = MR_tfield(0, MR_r1, 1);
	MR_sv(3) = MR_r2;
	MR_r1 = MR_sv(2);
	MR_np_call_localret_ent(fn__hlds__hlds_goal__goal_info_get_determinism_1_0,
		transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0_i3);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0,3)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_np_call_localret_ent(hlds__code_model__determinism_to_code_model_2_0,
		transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0_i4);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0,4)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_INT_NE(MR_r1,0)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0_i6);
	}
	MR_r1 = MR_sv(2);
	MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0_i5);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0,6)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_INT_NE(MR_r1,1)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0_i2);
	}
	MR_r1 = MR_sv(2);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0,5)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(2) = MR_r1;
	MR_np_call_localret_ent(fn__hlds__hlds_goal__goal_info_get_purity_1_0,
		transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0_i8);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0,8)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_INT_NE(MR_r1,0)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0_i2);
	}
	MR_r1 = MR_sv(2);
	MR_np_call_localret_ent(fn__hlds__hlds_goal__goal_info_get_instmap_delta_1_0,
		transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0_i10);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0,10)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_np_call_localret_ent(hlds__instmap__instmap_delta_to_assoc_list_2_0,
		transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0_i11);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0,11)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_tfield(0, MR_sv(3), 0);
	MR_r2 = MR_tempr1;
	}
	MR_np_call_localret_ent(transform_hlds__loop_inv__all_instmap_deltas_are_ground_2_0,
		transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0_i12);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0,12)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (!(MR_r1)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0_i2);
	}
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r2 = MR_tfield(0, MR_sv(3), 1);
	MR_r3 = MR_sv(1);
	MR_np_call_localret_ent(fn__cord__snoc_2_0,
		transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0_i14);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0,14)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_tag_alloc_heap(MR_r2, 0, (MR_Integer) 3);
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_sv(3);
	MR_tfield(0, MR_r2, 0) = MR_tfield(0, MR_tempr1, 0);
	MR_tfield(0, MR_r2, 1) = MR_r1;
	MR_tfield(0, MR_r2, 2) = MR_tfield(0, MR_tempr1, 2);
	MR_r1 = MR_r2;
	MR_decr_sp_and_return(4);
	}
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0,2)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = MR_sv(3);
	MR_decr_sp_and_return(4);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(require__unexpected_3_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module3)
	MR_init_entry1(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0);
	MR_init_label10(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,5,6,8,7,10,12,13,14,16,4)
	MR_init_label10(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,3,21,19,24,27,28,26,31,34,33)
	MR_init_label2(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,38,40)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'invariant_goal_candidates_in_goal'/4 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_tfield(0, MR_r2, 0);
	MR_r4 = MR_tempr1;
	if (!(((((MR_tag(MR_tempr1) == MR_mktag((MR_Integer) 3)) && ((MR_Integer) MR_tfield(3, MR_tempr1, 0) == (MR_Integer) 0)) || (MR_tag(MR_tempr1) == MR_mktag((MR_Integer) 2))) || (MR_tag(MR_tempr1) == MR_mktag((MR_Integer) 0))))) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i3);
	}
	MR_incr_sp(5);
	MR_sv(5) = (MR_Word) MR_succip;
	MR_sv(1) = MR_r2;
	MR_sv(2) = MR_tfield(0, MR_r2, 1);
	MR_sv(3) = MR_r3;
	MR_r1 = MR_sv(2);
	}
	MR_np_call_localret_ent(fn__hlds__hlds_goal__goal_info_get_determinism_1_0,
		transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i5);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,5)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_np_call_localret_ent(hlds__code_model__determinism_to_code_model_2_0,
		transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i6);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,6)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_INT_NE(MR_r1,0)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i8);
	}
	MR_r1 = MR_sv(2);
	MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i7);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,8)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_INT_NE(MR_r1,1)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i4);
	}
	MR_r1 = MR_sv(2);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,7)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(2) = MR_r1;
	MR_np_call_localret_ent(fn__hlds__hlds_goal__goal_info_get_purity_1_0,
		transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i10);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,10)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_INT_NE(MR_r1,0)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i4);
	}
	MR_r1 = MR_sv(2);
	MR_np_call_localret_ent(fn__hlds__hlds_goal__goal_info_get_instmap_delta_1_0,
		transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i12);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,12)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_np_call_localret_ent(hlds__instmap__instmap_delta_to_assoc_list_2_0,
		transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i13);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,13)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_tfield(0, MR_sv(3), 0);
	MR_r2 = MR_tempr1;
	}
	MR_np_call_localret_ent(transform_hlds__loop_inv__all_instmap_deltas_are_ground_2_0,
		transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i14);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,14)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (!(MR_r1)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i4);
	}
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r2 = MR_tfield(0, MR_sv(3), 1);
	MR_r3 = MR_sv(1);
	MR_np_call_localret_ent(fn__cord__snoc_2_0,
		transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i16);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,16)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_tag_alloc_heap(MR_r2, 0, (MR_Integer) 3);
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_sv(3);
	MR_tfield(0, MR_r2, 0) = MR_tfield(0, MR_tempr1, 0);
	MR_tfield(0, MR_r2, 1) = MR_r1;
	MR_tfield(0, MR_r2, 2) = MR_tfield(0, MR_tempr1, 2);
	MR_r1 = MR_r2;
	MR_decr_sp_and_return(5);
	}
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,4)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = MR_sv(3);
	MR_decr_sp_and_return(5);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,3)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r4,3,1)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i19);
	}
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tempr2 = MR_r4;
	MR_tempr1 = MR_tfield(3, MR_tempr2, 1);
	if (MR_INT_NE(MR_tempr1,1)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i21);
	}
	MR_r2 = MR_tfield(3, MR_tempr2, 2);
	MR_np_tailcall_ent(transform_hlds__loop_inv__invariant_goal_candidates_in_parallel_conj_4_0);
	}
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,21)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r2 = MR_tfield(3, MR_r4, 2);
	MR_np_tailcall_ent(transform_hlds__loop_inv__invariant_goal_candidates_in_plain_conj_4_0);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,19)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r4,3,2)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i24);
	}
	MR_r2 = MR_tfield(3, MR_r4, 1);
	MR_np_tailcall_ent(transform_hlds__loop_inv__invariant_goal_candidates_in_disj_4_0);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,24)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r4,3,6)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i26);
	}
	MR_incr_sp(5);
	MR_sv(5) = (MR_Word) MR_succip;
	MR_sv(1) = MR_r1;
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r4;
	MR_sv(2) = MR_tfield(3, MR_tempr1, 3);
	MR_sv(3) = MR_tfield(3, MR_tempr1, 4);
	MR_sv(4) = MR_tfield(0, MR_r3, 1);
	MR_r2 = MR_tfield(3, MR_tempr1, 2);
	}
	MR_np_localcall_lab(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,
		transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i27);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,27)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(1);
	MR_r2 = MR_sv(2);
	MR_r3 = MR_tempr1;
	}
	MR_np_localcall_lab(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,
		transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i28);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,28)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 3);
	MR_r3 = MR_tempr1;
	MR_tfield(0, MR_tempr1, 0) = MR_tfield(0, MR_r1, 0);
	MR_tfield(0, MR_tempr1, 1) = MR_sv(4);
	MR_tfield(0, MR_tempr1, 2) = MR_tfield(0, MR_r1, 2);
	MR_r1 = MR_sv(1);
	MR_r2 = MR_sv(3);
	MR_succip_word = MR_sv(5);
	MR_decr_sp(5);
	MR_np_tailcall_ent(transform_hlds__loop_inv__invariant_goal_candidates_keeping_path_candidates_4_0);
	}
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,26)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r4,3,4)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i31);
	}
	MR_r2 = MR_tfield(3, MR_r4, 1);
	MR_np_tailcall_ent(transform_hlds__loop_inv__invariant_goal_candidates_keeping_path_candidates_4_0);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,31)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_PTAG_TESTR(MR_r4,1)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i33);
	}
	{
	MR_Word MR_tempr1, MR_tempr2, MR_tempr3, MR_tempr4;
	MR_tempr4 = MR_r4;
	MR_tempr1 = MR_tfield(1, MR_tempr4, 0);
	MR_tempr2 = MR_tfield(0, MR_r1, 0);
	if ((MR_tempr1 != MR_tempr2)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i34);
	}
	MR_tempr1 = MR_tfield(1, MR_tempr4, 1);
	MR_tempr3 = MR_tfield(0, MR_r1, 1);
	if ((MR_tempr1 != MR_tempr3)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i34);
	}
	MR_r1 = MR_r2;
	MR_r2 = MR_r3;
	MR_np_tailcall_ent(transform_hlds__loop_inv__add_recursive_call_3_0);
	}
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,34)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = MR_r2;
	MR_r2 = MR_r3;
	MR_np_tailcall_ent(transform_hlds__loop_inv__invariant_goal_candidates_handle_primitive_goal_3_0);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,33)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r4,3,5)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i38);
	}
	MR_r2 = MR_tfield(3, MR_r4, 2);
	MR_np_tailcall_ent(transform_hlds__loop_inv__invariant_goal_candidates_keeping_path_candidates_4_0);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,38)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r4,3,3)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0_i40);
	}
	MR_r2 = MR_tfield(3, MR_r4, 3);
	MR_np_tailcall_ent(transform_hlds__loop_inv__invariant_goal_candidates_in_switch_4_0);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,40)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = (MR_Word) MR_string_const("transform_hlds.loop_inv", 23);
	MR_r2 = (MR_Word) MR_string_const("predicate \140transform_hlds.loop_inv.invariant_goal_candidates_in_goal\'/4", 71);
	MR_r3 = (MR_Word) MR_string_const("shorthand", 9);
	MR_np_tailcall_ent(require__unexpected_3_0);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE


MR_BEGIN_MODULE(transform_hlds__loop_inv_module4)
	MR_init_entry1(transform_hlds__loop_inv__invariant_goal_candidates_keeping_path_candidates_4_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__transform_hlds__loop_inv__invariant_goal_candidates_keeping_path_candidates_4_0);
	MR_init_label1(transform_hlds__loop_inv__invariant_goal_candidates_keeping_path_candidates_4_0,2)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'invariant_goal_candidates_keeping_path_candidates'/4 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(transform_hlds__loop_inv__invariant_goal_candidates_keeping_path_candidates_4_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(2);
	MR_sv(2) = (MR_Word) MR_succip;
	MR_sv(1) = MR_tfield(0, MR_r3, 1);
	MR_np_call_localret_ent(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,
		transform_hlds__loop_inv__invariant_goal_candidates_keeping_path_candidates_4_0_i2);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_keeping_path_candidates_4_0,2)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_tag_alloc_heap(MR_r2, 0, (MR_Integer) 3);
	MR_tfield(0, MR_r2, 0) = MR_tfield(0, MR_r1, 0);
	MR_tfield(0, MR_r2, 1) = MR_sv(1);
	MR_tfield(0, MR_r2, 2) = MR_tfield(0, MR_r1, 2);
	MR_r1 = MR_r2;
	MR_decr_sp_and_return(2);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE


MR_BEGIN_MODULE(transform_hlds__loop_inv_module5)
	MR_init_entry1(transform_hlds__loop_inv__invariant_goal_candidates_in_plain_conj_4_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__transform_hlds__loop_inv__invariant_goal_candidates_in_plain_conj_4_0);
	MR_init_label3(transform_hlds__loop_inv__invariant_goal_candidates_in_plain_conj_4_0,10,3,4)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'invariant_goal_candidates_in_plain_conj'/4 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(transform_hlds__loop_inv__invariant_goal_candidates_in_plain_conj_4_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(3);
	MR_sv(3) = (MR_Word) MR_succip;
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_plain_conj_4_0,10)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_LTAGS_TESTR(MR_r2,0,0)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_plain_conj_4_0_i3);
	}
	MR_r1 = MR_r3;
	MR_decr_sp_and_return(3);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_plain_conj_4_0,3)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(1) = MR_r1;
	MR_sv(2) = MR_tfield(1, MR_r2, 1);
	MR_r2 = MR_tfield(1, MR_r2, 0);
	MR_np_call_localret_ent(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,
		transform_hlds__loop_inv__invariant_goal_candidates_in_plain_conj_4_0_i4);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_plain_conj_4_0,4)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(1);
	MR_r2 = MR_sv(2);
	MR_r3 = MR_tempr1;
	MR_succip_word = MR_sv(3);
	MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_plain_conj_4_0_i10);
	}
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE


MR_BEGIN_MODULE(transform_hlds__loop_inv_module6)
	MR_init_entry1(transform_hlds__loop_inv__invariant_goal_candidates_in_parallel_conj_4_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__transform_hlds__loop_inv__invariant_goal_candidates_in_parallel_conj_4_0);
	MR_init_label3(transform_hlds__loop_inv__invariant_goal_candidates_in_parallel_conj_4_0,11,3,4)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'invariant_goal_candidates_in_parallel_conj'/4 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(transform_hlds__loop_inv__invariant_goal_candidates_in_parallel_conj_4_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(4);
	MR_sv(4) = (MR_Word) MR_succip;
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_parallel_conj_4_0,11)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_LTAGS_TESTR(MR_r2,0,0)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_parallel_conj_4_0_i3);
	}
	MR_r1 = MR_r3;
	MR_decr_sp_and_return(4);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_parallel_conj_4_0,3)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(1) = MR_r1;
	MR_sv(2) = MR_tfield(1, MR_r2, 1);
	MR_sv(3) = MR_tfield(0, MR_r3, 1);
	MR_r2 = MR_tfield(1, MR_r2, 0);
	MR_np_call_localret_ent(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,
		transform_hlds__loop_inv__invariant_goal_candidates_in_parallel_conj_4_0_i4);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_parallel_conj_4_0,4)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 3);
	MR_r3 = MR_tempr1;
	MR_tfield(0, MR_tempr1, 0) = MR_tfield(0, MR_r1, 0);
	MR_tfield(0, MR_tempr1, 1) = MR_sv(3);
	MR_tfield(0, MR_tempr1, 2) = MR_tfield(0, MR_r1, 2);
	MR_r1 = MR_sv(1);
	MR_r2 = MR_sv(2);
	MR_succip_word = MR_sv(4);
	MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_parallel_conj_4_0_i11);
	}
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE


MR_BEGIN_MODULE(transform_hlds__loop_inv_module7)
	MR_init_entry1(transform_hlds__loop_inv__invariant_goal_candidates_in_disj_4_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__transform_hlds__loop_inv__invariant_goal_candidates_in_disj_4_0);
	MR_init_label3(transform_hlds__loop_inv__invariant_goal_candidates_in_disj_4_0,11,3,4)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'invariant_goal_candidates_in_disj'/4 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(transform_hlds__loop_inv__invariant_goal_candidates_in_disj_4_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(4);
	MR_sv(4) = (MR_Word) MR_succip;
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_disj_4_0,11)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_LTAGS_TESTR(MR_r2,0,0)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_disj_4_0_i3);
	}
	MR_r1 = MR_r3;
	MR_decr_sp_and_return(4);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_disj_4_0,3)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(1) = MR_r1;
	MR_sv(2) = MR_tfield(1, MR_r2, 1);
	MR_sv(3) = MR_tfield(0, MR_r3, 1);
	MR_r2 = MR_tfield(1, MR_r2, 0);
	MR_np_call_localret_ent(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,
		transform_hlds__loop_inv__invariant_goal_candidates_in_disj_4_0_i4);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_disj_4_0,4)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 3);
	MR_r3 = MR_tempr1;
	MR_tfield(0, MR_tempr1, 0) = MR_tfield(0, MR_r1, 0);
	MR_tfield(0, MR_tempr1, 1) = MR_sv(3);
	MR_tfield(0, MR_tempr1, 2) = MR_tfield(0, MR_r1, 2);
	MR_r1 = MR_sv(1);
	MR_r2 = MR_sv(2);
	MR_succip_word = MR_sv(4);
	MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_disj_4_0_i11);
	}
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE


MR_BEGIN_MODULE(transform_hlds__loop_inv_module8)
	MR_init_entry1(transform_hlds__loop_inv__invariant_goal_candidates_in_switch_4_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__transform_hlds__loop_inv__invariant_goal_candidates_in_switch_4_0);
	MR_init_label3(transform_hlds__loop_inv__invariant_goal_candidates_in_switch_4_0,11,3,4)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'invariant_goal_candidates_in_switch'/4 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(transform_hlds__loop_inv__invariant_goal_candidates_in_switch_4_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(4);
	MR_sv(4) = (MR_Word) MR_succip;
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_switch_4_0,11)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_LTAGS_TESTR(MR_r2,0,0)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_switch_4_0_i3);
	}
	MR_r1 = MR_r3;
	MR_decr_sp_and_return(4);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_switch_4_0,3)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(1) = MR_r1;
	MR_sv(2) = MR_tfield(1, MR_r2, 1);
	MR_sv(3) = MR_tfield(0, MR_r3, 1);
	MR_r2 = MR_tfield(0, MR_tfield(1, MR_r2, 0), 2);
	MR_np_call_localret_ent(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,
		transform_hlds__loop_inv__invariant_goal_candidates_in_switch_4_0_i4);
MR_def_label(transform_hlds__loop_inv__invariant_goal_candidates_in_switch_4_0,4)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 3);
	MR_r3 = MR_tempr1;
	MR_tfield(0, MR_tempr1, 0) = MR_tfield(0, MR_r1, 0);
	MR_tfield(0, MR_tempr1, 1) = MR_sv(3);
	MR_tfield(0, MR_tempr1, 2) = MR_tfield(0, MR_r1, 2);
	MR_r1 = MR_sv(1);
	MR_r2 = MR_sv(2);
	MR_succip_word = MR_sv(4);
	MR_GOTO_LAB(transform_hlds__loop_inv__invariant_goal_candidates_in_switch_4_0_i11);
	}
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

extern const MR_TypeCtorInfo_Struct mercury_data_parse_tree__prog_data__type_ctor_info_mer_mode_0;
MR_decl_entry(fn__list__map_corresponding_3_0);
MR_decl_entry(fn__list__foldl_3_0);
MR_decl_entry(fn__list__filter_map_2_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module9)
	MR_init_entry1(fn__transform_hlds__loop_inv__inv_args_4_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__inv_args_4_0);
	MR_init_label2(fn__transform_hlds__loop_inv__inv_args_4_0,5,8)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'inv_args'/5 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__inv_args_4_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(4);
	MR_sv(4) = (MR_Word) MR_succip;
	{
	MR_Word MR_tempr1, MR_tempr2, MR_tempr3;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 4);
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(1,0);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_ENTRY_AP(fn__transform_hlds__loop_inv__arg_to_maybe_inv_arg_3_0);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr1, 3) = MR_r1;
	MR_sv(1) = MR_r4;
	MR_sv(2) = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_sv(3) = (MR_Word) MR_TAG_COMMON(0,0,1);
	MR_r1 = MR_sv(2);
	MR_tempr2 = MR_r2;
	MR_r2 = (MR_Word) MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode);
	MR_tempr3 = MR_r3;
	MR_r3 = MR_sv(3);
	MR_r4 = MR_tempr1;
	MR_r5 = MR_tempr2;
	MR_r6 = MR_tempr3;
	}
	MR_np_call_localret_ent(fn__list__map_corresponding_3_0,
		fn__transform_hlds__loop_inv__inv_args_4_0_i5);
MR_def_label(fn__transform_hlds__loop_inv__inv_args_4_0,5)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r2 = (MR_Word) MR_TAG_COMMON(0,0,5);
	MR_r3 = (MR_Word) MR_TAG_COMMON(0,3,0);
	MR_r4 = MR_sv(1);
	MR_r5 = MR_tempr1;
	}
	MR_np_call_localret_ent(fn__list__foldl_3_0,
		fn__transform_hlds__loop_inv__inv_args_4_0_i8);
MR_def_label(fn__transform_hlds__loop_inv__inv_args_4_0,8)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(3);
	MR_r2 = MR_sv(2);
	MR_r3 = (MR_Word) MR_TAG_COMMON(0,3,1);
	MR_r4 = MR_tempr1;
	MR_succip_word = MR_sv(4);
	MR_decr_sp(4);
	MR_np_tailcall_ent(fn__list__filter_map_2_0);
	}
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(list__foldl2_6_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module10)
	MR_init_entry1(transform_hlds__loop_inv__inv_goals_vars_6_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__transform_hlds__loop_inv__inv_goals_vars_6_0);
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'inv_goals_vars'/6 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(transform_hlds__loop_inv__inv_goals_vars_6_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2, MR_tempr3;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 5);
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(5,0);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_ENTRY_AP(transform_hlds__loop_inv__inv_goals_vars_2_7_0);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 2;
	MR_tfield(0, MR_tempr1, 3) = MR_r1;
	MR_tfield(0, MR_tempr1, 4) = MR_r2;
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r2 = (MR_Word) MR_TAG_COMMON(0,0,10);
	MR_tempr2 = MR_r3;
	MR_r3 = (MR_Word) MR_TAG_COMMON(0,0,11);
	MR_tempr3 = MR_r4;
	MR_r4 = MR_tempr1;
	MR_r5 = MR_tempr2;
	MR_r6 = (MR_Word) MR_tbmkword(0, 0);
	MR_r7 = MR_tempr3;
	MR_np_tailcall_ent(list__foldl2_6_0);
	}
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE


MR_BEGIN_MODULE(transform_hlds__loop_inv_module11)
	MR_init_entry1(fn__transform_hlds__loop_inv__compute_initial_aux_instmap_2_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__compute_initial_aux_instmap_2_0);
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'compute_initial_aux_instmap'/3 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__compute_initial_aux_instmap_2_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tempr1 = MR_r1;
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_tempr2 = MR_r2;
	MR_r2 = (MR_Word) MR_CTOR0_ADDR(hlds__instmap, instmap);
	MR_r3 = (MR_Word) MR_TAG_COMMON(0,3,2);
	MR_r4 = MR_tempr1;
	MR_r5 = MR_tempr2;
	MR_np_tailcall_ent(fn__list__foldl_3_0);
	}
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(fn__f_108_105_115_116_95_95_43_43_2_0);
MR_decl_entry(hlds__hlds_module__module_info_pred_proc_info_5_0);
MR_decl_entry(hlds__hlds_pred__proc_info_get_goal_2_0);
MR_decl_entry(hlds__hlds_pred__pred_info_get_typevarset_2_0);
MR_decl_entry(hlds__hlds_pred__proc_info_get_vartypes_2_0);
MR_decl_entry(hlds__hlds_pred__pred_info_get_class_context_2_0);
MR_decl_entry(hlds__hlds_pred__proc_info_get_rtti_varmaps_2_0);
MR_decl_entry(hlds__hlds_pred__proc_info_get_varset_2_0);
MR_decl_entry(hlds__hlds_pred__proc_info_get_inst_varset_2_0);
MR_decl_entry(hlds__hlds_pred__pred_info_get_markers_2_0);
MR_decl_entry(hlds__hlds_pred__pred_info_get_origin_2_0);
MR_decl_entry(hlds__hlds_pred__pred_info_get_var_name_remap_2_0);
MR_decl_entry(fn__hlds__hlds_pred__pred_info_module_1_0);
MR_decl_entry(fn__hlds__hlds_pred__pred_info_name_1_0);
MR_decl_entry(fn__hlds__hlds_pred__pred_info_is_pred_or_func_1_0);
MR_decl_entry(fn__hlds__hlds_goal__goal_info_get_context_1_0);
MR_decl_entry(term__context_line_2_0);
MR_decl_entry(fn__hlds__hlds_pred__pred_id_to_int_1_0);
MR_decl_entry(parse_tree__prog_util__make_pred_name_with_context_7_0);
MR_decl_entry(hlds__hlds_pred__proc_id_to_int_2_0);
MR_decl_entry(fn__string__int_to_string_1_0);
MR_decl_entry(fn__f_115_116_114_105_110_103_95_95_43_43_2_0);
MR_decl_entry(mdbcomp__prim_data__add_sym_name_suffix_3_0);
MR_decl_entry(hlds__hlds_pred__define_new_pred_19_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module12)
	MR_init_entry1(transform_hlds__loop_inv__create_aux_pred_10_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__transform_hlds__loop_inv__create_aux_pred_10_0);
	MR_init_label10(transform_hlds__loop_inv__create_aux_pred_10_0,3,4,5,6,7,8,9,10,11,12)
	MR_init_label10(transform_hlds__loop_inv__create_aux_pred_10_0,13,14,15,16,17,18,19,22,20,24)
	MR_init_label6(transform_hlds__loop_inv__create_aux_pred_10_0,25,26,27,28,31,32)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'create_aux_pred'/10 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(transform_hlds__loop_inv__create_aux_pred_10_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(20);
	MR_sv(20) = (MR_Word) MR_succip;
	MR_sv(1) = MR_r4;
	MR_sv(2) = MR_r5;
	MR_sv(3) = MR_tfield(0, MR_r1, 0);
	MR_sv(4) = MR_tfield(0, MR_r1, 1);
	MR_r1 = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_np_call_localret_ent(fn__f_108_105_115_116_95_95_43_43_2_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i3);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,3)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(5) = MR_r1;
	MR_r1 = MR_sv(2);
	MR_r2 = MR_sv(3);
	MR_r3 = MR_sv(4);
	MR_np_call_localret_ent(hlds__hlds_module__module_info_pred_proc_info_5_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i4);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,4)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(6) = MR_r1;
	MR_sv(7) = MR_r2;
	MR_r1 = MR_r2;
	MR_np_call_localret_ent(hlds__hlds_pred__proc_info_get_goal_2_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i5);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,5)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(8) = MR_r1;
	MR_sv(9) = MR_tfield(0, MR_r1, 1);
	MR_r1 = MR_sv(6);
	MR_np_call_localret_ent(hlds__hlds_pred__pred_info_get_typevarset_2_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i6);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,6)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(10) = MR_r1;
	MR_r1 = MR_sv(7);
	MR_np_call_localret_ent(hlds__hlds_pred__proc_info_get_vartypes_2_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i7);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,7)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(11) = MR_r1;
	MR_r1 = MR_sv(6);
	MR_np_call_localret_ent(hlds__hlds_pred__pred_info_get_class_context_2_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i8);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,8)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(12) = MR_r1;
	MR_r1 = MR_sv(7);
	MR_np_call_localret_ent(hlds__hlds_pred__proc_info_get_rtti_varmaps_2_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i9);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,9)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(13) = MR_r1;
	MR_r1 = MR_sv(7);
	MR_np_call_localret_ent(hlds__hlds_pred__proc_info_get_varset_2_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i10);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,10)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r2 = MR_sv(7);
	MR_sv(7) = MR_r1;
	MR_r1 = MR_r2;
	MR_np_call_localret_ent(hlds__hlds_pred__proc_info_get_inst_varset_2_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i11);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,11)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(14) = MR_r1;
	MR_r1 = MR_sv(6);
	MR_np_call_localret_ent(hlds__hlds_pred__pred_info_get_markers_2_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i12);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,12)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(15) = MR_r1;
	MR_r1 = MR_sv(6);
	MR_np_call_localret_ent(hlds__hlds_pred__pred_info_get_origin_2_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i13);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,13)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(16) = MR_r1;
	MR_r1 = MR_sv(6);
	MR_np_call_localret_ent(hlds__hlds_pred__pred_info_get_var_name_remap_2_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i14);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,14)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(17) = MR_r1;
	MR_r1 = MR_sv(6);
	MR_np_call_localret_ent(fn__hlds__hlds_pred__pred_info_module_1_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i15);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,15)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(18) = MR_r1;
	MR_r1 = MR_sv(6);
	MR_np_call_localret_ent(fn__hlds__hlds_pred__pred_info_name_1_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i16);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,16)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r2 = MR_sv(6);
	MR_sv(6) = MR_r1;
	MR_r1 = MR_r2;
	MR_np_call_localret_ent(fn__hlds__hlds_pred__pred_info_is_pred_or_func_1_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i17);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,17)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r2 = MR_sv(9);
	MR_sv(9) = MR_r1;
	MR_r1 = MR_r2;
	MR_np_call_localret_ent(fn__hlds__hlds_goal__goal_info_get_context_1_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i18);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,18)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_np_call_localret_ent(term__context_line_2_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i19);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,19)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_INT_NE(MR_r1,0)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__create_aux_pred_10_0_i20);
	}
	MR_sv(19) = MR_r1;
	MR_r1 = MR_sv(3);
	MR_np_call_localret_ent(fn__hlds__hlds_pred__pred_id_to_int_1_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i22);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,22)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(18);
	MR_r4 = MR_sv(6);
	MR_r3 = MR_sv(9);
	MR_r5 = MR_sv(19);
	MR_r6 = MR_tempr1;
	MR_r2 = (MR_Word) MR_string_const("loop_inv", 8);
	}
	MR_np_call_localret_ent(parse_tree__prog_util__make_pred_name_with_context_7_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i24);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,20)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(18);
	MR_r4 = MR_sv(6);
	MR_r3 = MR_sv(9);
	MR_r5 = MR_tempr1;
	MR_r6 = (MR_Integer) 1;
	MR_r2 = (MR_Word) MR_string_const("loop_inv", 8);
	}
	MR_np_call_localret_ent(parse_tree__prog_util__make_pred_name_with_context_7_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i24);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,24)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r2 = MR_sv(4);
	MR_sv(4) = MR_r1;
	MR_r1 = MR_r2;
	MR_np_call_localret_ent(hlds__hlds_pred__proc_id_to_int_2_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i25);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,25)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(6) = MR_r1;
	MR_np_call_localret_ent(fn__string__int_to_string_1_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i26);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,26)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = (MR_Word) MR_string_const("_", 1);
	MR_r2 = MR_tempr1;
	}
	MR_np_call_localret_ent(fn__f_115_116_114_105_110_103_95_95_43_43_2_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i27);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,27)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(4);
	MR_r2 = MR_tempr1;
	}
	MR_np_call_localret_ent(mdbcomp__prim_data__add_sym_name_suffix_3_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i28);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,28)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tag_alloc_heap(MR_tempr1, 3, (MR_Integer) 2);
	MR_tfield(3, MR_tempr1, 0) = (MR_Integer) 3;
	MR_tfield(3, MR_tempr1, 1) = MR_sv(6);
	MR_tag_alloc_heap(MR_tempr2, 2, (MR_Integer) 3);
	MR_tfield(2, MR_tempr2, 0) = MR_tempr1;
	MR_tfield(2, MR_tempr2, 1) = MR_sv(16);
	MR_tfield(2, MR_tempr2, 2) = MR_sv(3);
	MR_tempr1 = MR_r1;
	MR_r1 = MR_tempr2;
	MR_r2 = MR_sv(8);
	MR_r3 = MR_sv(5);
	MR_r4 = MR_sv(1);
	MR_r5 = MR_tempr1;
	MR_r6 = MR_sv(10);
	MR_r7 = MR_sv(11);
	MR_r8 = MR_sv(12);
	MR_r9 = MR_sv(13);
	MR_r10 = MR_sv(7);
	MR_r11 = MR_sv(14);
	MR_r12 = MR_sv(15);
	MR_r13 = (MR_Integer) 1;
	MR_r14 = MR_sv(17);
	MR_r15 = MR_sv(2);
	}
	MR_np_call_localret_ent(hlds__hlds_pred__define_new_pred_19_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i31);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,31)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tempr1 = MR_r4;
	MR_sv(1) = MR_tempr1;
	MR_sv(2) = MR_r1;
	MR_tempr2 = MR_r3;
	MR_sv(3) = MR_tempr2;
	MR_r1 = MR_tempr2;
	MR_r2 = MR_tfield(0, MR_tempr1, 0);
	MR_r3 = MR_tfield(0, MR_tempr1, 1);
	}
	MR_np_call_localret_ent(hlds__hlds_module__module_info_pred_proc_info_5_0,
		transform_hlds__loop_inv__create_aux_pred_10_0_i32);
MR_def_label(transform_hlds__loop_inv__create_aux_pred_10_0,32)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(1);
	MR_tempr2 = MR_r2;
	MR_r2 = MR_sv(2);
	MR_r3 = MR_tempr1;
	MR_r4 = MR_tempr2;
	MR_r5 = MR_sv(3);
	MR_decr_sp_and_return(20);
	}
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(list__member_2_1);
MR_decl_entry(__Unify___hlds__hlds_goal__hlds_goal_expr_0_0);
MR_declare_entry(MR_do_redo);
MR_decl_entry(__Unify___list__list_1_0);
MR_decl_entry(fn__hlds__hlds_goal__true_goal_0_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module13)
	MR_init_entry1(fn__transform_hlds__loop_inv__gen_aux_proc_handle_non_recursive_call_2_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__gen_aux_proc_handle_non_recursive_call_2_0);
	MR_init_label5(fn__transform_hlds__loop_inv__gen_aux_proc_handle_non_recursive_call_2_0,6,10,15,7,4)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'gen_aux_proc_handle_non_recursive_call'/3 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__gen_aux_proc_handle_non_recursive_call_2_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(7);
	MR_sv(7) = (MR_Word) MR_succip;
	MR_sv(4) = (MR_Word) MR_redoip_slot(MR_maxfr);
	MR_sv(5) = (MR_Word) MR_redofr_slot(MR_maxfr);
	MR_save_maxfr(MR_sv(6));
	MR_redofr_slot_word(MR_maxfr) = (MR_Word) MR_curfr;
	MR_redoip_slot_word(MR_maxfr) = (MR_Word) MR_LABEL_AP(fn__transform_hlds__loop_inv__gen_aux_proc_handle_non_recursive_call_2_0_i4);
	MR_sv(1) = MR_r2;
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r2 = MR_tfield(0, MR_tempr1, 1);
	}
	MR_np_call_localret_ent(list__member_2_1,
		fn__transform_hlds__loop_inv__gen_aux_proc_handle_non_recursive_call_2_0_i6);
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_handle_non_recursive_call_2_0,6)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r2 = MR_tfield(0, MR_sv(1), 0);
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_tfield(0, MR_r1, 0);
	MR_sv(2) = MR_tempr1;
	MR_sv(3) = MR_r2;
	MR_r1 = MR_tempr1;
	}
	MR_np_call_localret_ent(__Unify___hlds__hlds_goal__hlds_goal_expr_0_0,
		fn__transform_hlds__loop_inv__gen_aux_proc_handle_non_recursive_call_2_0_i10);
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_handle_non_recursive_call_2_0,10)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_r1) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__gen_aux_proc_handle_non_recursive_call_2_0_i7);
	}
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_sv(2);
	MR_r3 = MR_tempr1;
	MR_r2 = MR_sv(3);
	if (MR_PTAG_TESTR(MR_tempr1,1)) {
		MR_GOTO(MR_ENTRY(MR_do_redo));
	}
	if (MR_PTAG_TESTR(MR_r2,1)) {
		MR_GOTO(MR_ENTRY(MR_do_redo));
	}
	MR_r4 = MR_tfield(1, MR_tempr1, 0);
	MR_r5 = MR_tfield(1, MR_r2, 0);
	if ((MR_r4 != MR_r5)) {
		MR_GOTO(MR_ENTRY(MR_do_redo));
	}
	MR_r4 = MR_tfield(1, MR_tempr1, 1);
	MR_r5 = MR_tfield(1, MR_r2, 1);
	if ((MR_r4 != MR_r5)) {
		MR_GOTO(MR_ENTRY(MR_do_redo));
	}
	MR_r1 = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r2 = MR_tfield(1, MR_tempr1, 2);
	MR_r3 = MR_tfield(1, MR_sv(3), 2);
	}
	MR_np_call_localret_ent(__Unify___list__list_1_0,
		fn__transform_hlds__loop_inv__gen_aux_proc_handle_non_recursive_call_2_0_i15);
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_handle_non_recursive_call_2_0,15)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (!(MR_r1)) {
		MR_GOTO(MR_ENTRY(MR_do_redo));
	}
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_handle_non_recursive_call_2_0,7)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_restore_maxfr(MR_sv(6));
	MR_redoip_slot_word(MR_maxfr) = MR_sv(4);
	MR_redofr_slot_word(MR_maxfr) = MR_sv(5);
	MR_succip_word = MR_sv(7);
	MR_decr_sp(7);
	MR_np_tailcall_ent(fn__hlds__hlds_goal__true_goal_0_0);
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_handle_non_recursive_call_2_0,4)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r2 = MR_sv(1);
	MR_redoip_slot_word(MR_maxfr) = MR_sv(4);
	MR_redofr_slot_word(MR_maxfr) = MR_sv(5);
	MR_r1 = MR_r2;
	MR_decr_sp_and_return(7);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(fn__require__unexpected_3_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module14)
	MR_init_entry1(fn__transform_hlds__loop_inv__gen_aux_call_2_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__gen_aux_call_2_0);
	MR_init_label2(fn__transform_hlds__loop_inv__gen_aux_call_2_0,5,2)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'gen_aux_call'/3 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__gen_aux_call_2_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tempr1 = MR_tfield(0, MR_r1, 0);
	if (MR_PTAG_TESTR(MR_tempr1,1)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__gen_aux_call_2_0_i2);
	}
	MR_tempr2 = MR_tfield(0, MR_r2, 0);
	if (MR_PTAG_TESTR(MR_tempr2,1)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__gen_aux_call_2_0_i2);
	}
	MR_incr_sp(3);
	MR_sv(3) = (MR_Word) MR_succip;
	MR_sv(1) = MR_tempr1;
	MR_sv(2) = MR_tfield(0, MR_r2, 1);
	MR_r1 = MR_tfield(1, MR_tempr2, 2);
	MR_r2 = MR_tfield(1, MR_tempr1, 2);
	}
	MR_np_call_localret_ent(fn__f_116_114_97_110_115_102_111_114_109_95_104_108_100_115_95_95_108_111_111_112_95_105_110_118_95_95_85_110_117_115_101_100_65_114_103_115_95_95_102_117_110_99_95_95_114_101_112_108_97_99_101_95_105_110_105_116_105_97_108_95_97_114_103_115_95_95_91_49_93_95_48_2_0,
		fn__transform_hlds__loop_inv__gen_aux_call_2_0_i5);
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_call_2_0,5)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_tag_alloc_heap(MR_r2, 1, (MR_Integer) 6);
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_sv(1);
	MR_tfield(1, MR_r2, 0) = MR_tfield(1, MR_tempr1, 0);
	MR_tfield(1, MR_r2, 1) = MR_tfield(1, MR_tempr1, 1);
	MR_tfield(1, MR_r2, 2) = MR_r1;
	MR_tfield(1, MR_r2, 3) = MR_tfield(1, MR_tempr1, 3);
	MR_tfield(1, MR_r2, 4) = MR_tfield(1, MR_tempr1, 4);
	MR_tfield(1, MR_r2, 5) = MR_tfield(1, MR_tempr1, 5);
	MR_tag_alloc_heap(MR_r1, 0, (MR_Integer) 2);
	MR_tfield(0, MR_r1, 0) = MR_r2;
	MR_tfield(0, MR_r1, 1) = MR_sv(2);
	MR_decr_sp_and_return(3);
	}
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_call_2_0,2)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r2 = (MR_Word) MR_string_const("transform_hlds.loop_inv", 23);
	MR_r3 = (MR_Word) MR_string_const("function \140transform_hlds.loop_inv.gen_aux_call\'/2", 49);
	MR_r4 = (MR_Word) MR_string_const("args not both ordinary calls", 28);
	MR_np_tailcall_ent(fn__require__unexpected_3_0);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(fn__list__map_2_0);
MR_decl_entry(__Unify___hlds__hlds_pred__pred_proc_id_0_0);
extern const MR_TypeCtorInfo_Struct mercury_data_hlds__hlds_goal__type_ctor_info_case_0;

MR_BEGIN_MODULE(transform_hlds__loop_inv_module15)
	MR_init_entry1(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0);
	MR_init_label10(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,80,3,7,5,12,10,16,17,18,15)
	MR_init_label9(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,22,21,28,26,25,34,33,39,37)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'gen_aux_proc_goal'/3 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,80)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_tfield(0, MR_r2, 0);
	MR_r3 = MR_tempr1;
	if (!(((((MR_tag(MR_tempr1) == MR_mktag((MR_Integer) 3)) && ((MR_Integer) MR_tfield(3, MR_tempr1, 0) == (MR_Integer) 0)) || (MR_tag(MR_tempr1) == MR_mktag((MR_Integer) 2))) || (MR_tag(MR_tempr1) == MR_mktag((MR_Integer) 0))))) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_i3);
	}
	MR_np_tailcall_ent(fn__transform_hlds__loop_inv__gen_aux_proc_handle_non_recursive_call_2_0);
	}
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,3)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r3,3,1)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_i5);
	}
	MR_incr_sp(6);
	MR_sv(6) = (MR_Word) MR_succip;
	{
	MR_Word MR_tempr1, MR_tempr2, MR_tempr3;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 4);
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(2,2);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_LABEL_AP(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_i80);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr1, 3) = MR_r1;
	MR_sv(2) = MR_tfield(0, MR_r2, 1);
	MR_tempr3 = MR_r3;
	MR_sv(1) = MR_tfield(3, MR_tempr3, 1);
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r2 = MR_r1;
	MR_tempr2 = MR_tempr3;
	MR_r3 = MR_tempr1;
	MR_r4 = MR_tfield(3, MR_tempr2, 2);
	}
	MR_np_call_localret_ent(fn__list__map_2_0,
		fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_i7);
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,7)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 3, (MR_Integer) 3);
	MR_tfield(3, MR_tempr1, 0) = (MR_Integer) 1;
	MR_tfield(3, MR_tempr1, 1) = MR_sv(1);
	MR_tfield(3, MR_tempr1, 2) = MR_r1;
	MR_tag_alloc_heap(MR_r1, 0, (MR_Integer) 2);
	MR_tfield(0, MR_r1, 0) = MR_tempr1;
	MR_tfield(0, MR_r1, 1) = MR_sv(2);
	MR_decr_sp_and_return(6);
	}
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,5)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r3,3,2)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_i10);
	}
	MR_incr_sp(6);
	MR_sv(6) = (MR_Word) MR_succip;
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 4);
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(2,3);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_LABEL_AP(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_i80);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr1, 3) = MR_r1;
	MR_sv(2) = MR_tfield(0, MR_r2, 1);
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r2 = MR_r1;
	MR_tempr2 = MR_r3;
	MR_r3 = MR_tempr1;
	MR_r4 = MR_tfield(3, MR_tempr2, 1);
	}
	MR_np_call_localret_ent(fn__list__map_2_0,
		fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_i12);
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,12)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 3, (MR_Integer) 2);
	MR_tfield(3, MR_tempr1, 0) = (MR_Integer) 2;
	MR_tfield(3, MR_tempr1, 1) = MR_r1;
	MR_tag_alloc_heap(MR_r1, 0, (MR_Integer) 2);
	MR_tfield(0, MR_r1, 0) = MR_tempr1;
	MR_tfield(0, MR_r1, 1) = MR_sv(2);
	MR_decr_sp_and_return(6);
	}
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,10)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r3,3,6)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_i15);
	}
	MR_incr_sp(6);
	MR_sv(6) = (MR_Word) MR_succip;
	MR_sv(1) = MR_r1;
	MR_sv(2) = MR_tfield(0, MR_r2, 1);
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r3;
	MR_sv(3) = MR_tfield(3, MR_tempr1, 1);
	MR_sv(4) = MR_tfield(3, MR_tempr1, 3);
	MR_sv(5) = MR_tfield(3, MR_tempr1, 4);
	MR_r2 = MR_tfield(3, MR_tempr1, 2);
	}
	MR_np_localcall_lab(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,
		fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_i16);
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,16)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_sv(4);
	MR_sv(4) = MR_r1;
	MR_r1 = MR_sv(1);
	MR_r2 = MR_tempr1;
	}
	MR_np_localcall_lab(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,
		fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_i17);
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,17)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_sv(1);
	MR_sv(1) = MR_r1;
	MR_r1 = MR_tempr1;
	MR_r2 = MR_sv(5);
	}
	MR_np_localcall_lab(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,
		fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_i18);
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,18)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 3, (MR_Integer) 5);
	MR_tfield(3, MR_tempr1, 0) = (MR_Integer) 6;
	MR_tfield(3, MR_tempr1, 1) = MR_sv(3);
	MR_tfield(3, MR_tempr1, 2) = MR_sv(4);
	MR_tfield(3, MR_tempr1, 3) = MR_sv(1);
	MR_tfield(3, MR_tempr1, 4) = MR_r1;
	MR_tag_alloc_heap(MR_r1, 0, (MR_Integer) 2);
	MR_tfield(0, MR_r1, 0) = MR_tempr1;
	MR_tfield(0, MR_r1, 1) = MR_sv(2);
	MR_decr_sp_and_return(6);
	}
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,15)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r3,3,4)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_i21);
	}
	MR_incr_sp(6);
	MR_sv(6) = (MR_Word) MR_succip;
	MR_sv(2) = MR_tfield(0, MR_r2, 1);
	MR_r2 = MR_tfield(3, MR_r3, 1);
	MR_np_localcall_lab(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,
		fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_i22);
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,22)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 3, (MR_Integer) 2);
	MR_tfield(3, MR_tempr1, 0) = (MR_Integer) 4;
	MR_tfield(3, MR_tempr1, 1) = MR_r1;
	MR_tag_alloc_heap(MR_r1, 0, (MR_Integer) 2);
	MR_tfield(0, MR_r1, 0) = MR_tempr1;
	MR_tfield(0, MR_r1, 1) = MR_sv(2);
	MR_decr_sp_and_return(6);
	}
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,21)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_PTAG_TESTR(MR_r3,1)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_i25);
	}
	MR_incr_sp(6);
	MR_sv(6) = (MR_Word) MR_succip;
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 2);
	MR_tempr2 = MR_r3;
	MR_tfield(0, MR_tempr1, 0) = MR_tfield(1, MR_tempr2, 0);
	MR_tfield(0, MR_tempr1, 1) = MR_tfield(1, MR_tempr2, 1);
	MR_sv(1) = MR_r1;
	MR_sv(2) = MR_r2;
	MR_r1 = MR_tempr1;
	MR_r2 = MR_tfield(0, MR_sv(1), 2);
	}
	MR_np_call_localret_ent(__Unify___hlds__hlds_pred__pred_proc_id_0_0,
		fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_i28);
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,28)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (!(MR_r1)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_i26);
	}
	MR_r1 = MR_tfield(0, MR_sv(1), 3);
	MR_r2 = MR_sv(2);
	MR_succip_word = MR_sv(6);
	MR_decr_sp(6);
	MR_np_tailcall_ent(fn__transform_hlds__loop_inv__gen_aux_call_2_0);
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,26)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = MR_sv(1);
	MR_r2 = MR_sv(2);
	MR_succip_word = MR_sv(6);
	MR_decr_sp(6);
	MR_np_tailcall_ent(fn__transform_hlds__loop_inv__gen_aux_proc_handle_non_recursive_call_2_0);
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,25)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r3,3,5)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_i33);
	}
	MR_incr_sp(6);
	MR_sv(6) = (MR_Word) MR_succip;
	MR_sv(2) = MR_tfield(0, MR_r2, 1);
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r3;
	MR_sv(1) = MR_tfield(3, MR_tempr1, 1);
	MR_r2 = MR_tfield(3, MR_tempr1, 2);
	}
	MR_np_localcall_lab(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,
		fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_i34);
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,34)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 3, (MR_Integer) 3);
	MR_tfield(3, MR_tempr1, 0) = (MR_Integer) 5;
	MR_tfield(3, MR_tempr1, 1) = MR_sv(1);
	MR_tfield(3, MR_tempr1, 2) = MR_r1;
	MR_tag_alloc_heap(MR_r1, 0, (MR_Integer) 2);
	MR_tfield(0, MR_r1, 0) = MR_tempr1;
	MR_tfield(0, MR_r1, 1) = MR_sv(2);
	MR_decr_sp_and_return(6);
	}
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,33)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r3,3,3)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_i37);
	}
	MR_incr_sp(6);
	MR_sv(6) = (MR_Word) MR_succip;
	{
	MR_Word MR_tempr1, MR_tempr2, MR_tempr3;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 4);
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(2,4);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_ENTRY_AP(fn__transform_hlds__loop_inv__gen_aux_proc_case_2_0);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr1, 3) = MR_r1;
	MR_sv(2) = MR_tfield(0, MR_r2, 1);
	MR_tempr3 = MR_r3;
	MR_sv(1) = MR_tfield(3, MR_tempr3, 1);
	MR_sv(3) = MR_tfield(3, MR_tempr3, 2);
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, case);
	MR_r2 = MR_r1;
	MR_tempr2 = MR_tempr3;
	MR_r3 = MR_tempr1;
	MR_r4 = MR_tfield(3, MR_tempr2, 3);
	}
	MR_np_call_localret_ent(fn__list__map_2_0,
		fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0_i39);
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,39)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 3, (MR_Integer) 4);
	MR_tfield(3, MR_tempr1, 0) = (MR_Integer) 3;
	MR_tfield(3, MR_tempr1, 1) = MR_sv(1);
	MR_tfield(3, MR_tempr1, 2) = MR_sv(3);
	MR_tfield(3, MR_tempr1, 3) = MR_r1;
	MR_tag_alloc_heap(MR_r1, 0, (MR_Integer) 2);
	MR_tfield(0, MR_r1, 0) = MR_tempr1;
	MR_tfield(0, MR_r1, 1) = MR_sv(2);
	MR_decr_sp_and_return(6);
	}
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,37)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = (MR_Word) MR_string_const("transform_hlds.loop_inv", 23);
	MR_r2 = (MR_Word) MR_string_const("function \140transform_hlds.loop_inv.gen_aux_proc_goal\'/2", 54);
	MR_r3 = (MR_Word) MR_string_const("shorthand", 9);
	MR_np_tailcall_ent(require__unexpected_3_0);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(hlds__hlds_pred__proc_info_set_goal_3_0);
MR_decl_entry(hlds__quantification__requantify_proc_general_3_0);
MR_decl_entry(check_hlds__mode_util__recompute_instmap_delta_proc_5_0);
MR_decl_entry(hlds__hlds_module__module_info_set_pred_proc_info_6_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module16)
	MR_init_entry1(transform_hlds__loop_inv__gen_aux_proc_9_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__transform_hlds__loop_inv__gen_aux_proc_9_0);
	MR_init_label4(transform_hlds__loop_inv__gen_aux_proc_9_0,3,4,5,6)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'gen_aux_proc'/9 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(transform_hlds__loop_inv__gen_aux_proc_9_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(5);
	MR_sv(5) = (MR_Word) MR_succip;
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 4);
	MR_tempr2 = MR_r8;
	MR_tfield(0, MR_tempr1, 0) = MR_tempr2;
	MR_tfield(0, MR_tempr1, 1) = MR_r1;
	MR_tfield(0, MR_tempr1, 2) = MR_r2;
	MR_tfield(0, MR_tempr1, 3) = MR_r4;
	MR_sv(1) = MR_r3;
	MR_sv(2) = MR_r6;
	MR_sv(3) = MR_r7;
	MR_sv(4) = MR_tempr2;
	MR_r1 = MR_tempr1;
	MR_r2 = MR_r5;
	}
	MR_np_call_localret_ent(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,
		transform_hlds__loop_inv__gen_aux_proc_9_0_i3);
MR_def_label(transform_hlds__loop_inv__gen_aux_proc_9_0,3)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tempr1 = MR_sv(1);
	MR_sv(1) = MR_tfield(0, MR_tempr1, 0);
	MR_tempr2 = MR_sv(3);
	MR_sv(3) = MR_tfield(0, MR_tempr1, 1);
	MR_r2 = MR_tempr2;
	}
	MR_np_call_localret_ent(hlds__hlds_pred__proc_info_set_goal_3_0,
		transform_hlds__loop_inv__gen_aux_proc_9_0_i4);
MR_def_label(transform_hlds__loop_inv__gen_aux_proc_9_0,4)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = (MR_Integer) 1;
	MR_r2 = MR_tempr1;
	}
	MR_np_call_localret_ent(hlds__quantification__requantify_proc_general_3_0,
		transform_hlds__loop_inv__gen_aux_proc_9_0_i5);
MR_def_label(transform_hlds__loop_inv__gen_aux_proc_9_0,5)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = (MR_Integer) 1;
	MR_r2 = MR_tempr1;
	MR_r3 = MR_sv(4);
	}
	MR_np_call_localret_ent(check_hlds__mode_util__recompute_instmap_delta_proc_5_0,
		transform_hlds__loop_inv__gen_aux_proc_9_0_i6);
MR_def_label(transform_hlds__loop_inv__gen_aux_proc_9_0,6)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(1);
	MR_tempr2 = MR_r2;
	MR_r2 = MR_sv(3);
	MR_r3 = MR_sv(2);
	MR_r4 = MR_tempr1;
	MR_r5 = MR_tempr2;
	MR_succip_word = MR_sv(5);
	MR_decr_sp(5);
	MR_np_tailcall_ent(hlds__hlds_module__module_info_set_pred_proc_info_6_0);
	}
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE


MR_BEGIN_MODULE(transform_hlds__loop_inv_module17)
	MR_init_entry1(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0);
	MR_init_label10(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,76,38,3,6,4,11,9,15,16,17)
	MR_init_label8(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,14,21,20,24,29,28,34,32)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'gen_out_proc_goal'/4 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
MR_def_label(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,76)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_tfield(0, MR_r3, 0);
	MR_r4 = MR_tempr1;
	if (!(((((MR_tag(MR_tempr1) == MR_mktag((MR_Integer) 3)) && ((MR_Integer) MR_tfield(3, MR_tempr1, 0) == (MR_Integer) 0)) || (MR_tag(MR_tempr1) == MR_mktag((MR_Integer) 2))) || (MR_tag(MR_tempr1) == MR_mktag((MR_Integer) 0))))) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_i3);
	}
	}
MR_def_label(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,38)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = MR_r3;
	MR_proceed();
MR_def_label(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,3)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r4,3,1)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_i4);
	}
	MR_incr_sp(7);
	MR_sv(7) = (MR_Word) MR_succip;
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 5);
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(1,1);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_LABEL_AP(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_i76);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 2;
	MR_tfield(0, MR_tempr1, 3) = MR_r1;
	MR_tfield(0, MR_tempr1, 4) = MR_r2;
	MR_sv(3) = MR_tfield(0, MR_r3, 1);
	MR_sv(1) = MR_tfield(3, MR_r4, 1);
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r2 = MR_r1;
	MR_r3 = MR_tempr1;
	MR_r4 = MR_tfield(3, MR_r4, 2);
	}
	MR_np_call_localret_ent(fn__list__map_2_0,
		fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_i6);
MR_def_label(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,6)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_tag_alloc_heap(MR_r2, 3, (MR_Integer) 3);
	MR_tfield(3, MR_r2, 0) = (MR_Integer) 1;
	MR_tfield(3, MR_r2, 1) = MR_sv(1);
	MR_tfield(3, MR_r2, 2) = MR_r1;
	MR_tag_alloc_heap(MR_r1, 0, (MR_Integer) 2);
	MR_tfield(0, MR_r1, 0) = MR_r2;
	MR_tfield(0, MR_r1, 1) = MR_sv(3);
	MR_decr_sp_and_return(7);
MR_def_label(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,4)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r4,3,2)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_i9);
	}
	MR_incr_sp(7);
	MR_sv(7) = (MR_Word) MR_succip;
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 5);
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(1,2);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_LABEL_AP(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_i76);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 2;
	MR_tfield(0, MR_tempr1, 3) = MR_r1;
	MR_tfield(0, MR_tempr1, 4) = MR_r2;
	MR_sv(3) = MR_tfield(0, MR_r3, 1);
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r2 = MR_r1;
	MR_r3 = MR_tempr1;
	MR_r4 = MR_tfield(3, MR_r4, 1);
	}
	MR_np_call_localret_ent(fn__list__map_2_0,
		fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_i11);
MR_def_label(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,11)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 3, (MR_Integer) 2);
	MR_tfield(3, MR_tempr1, 0) = (MR_Integer) 2;
	MR_tfield(3, MR_tempr1, 1) = MR_r1;
	MR_tag_alloc_heap(MR_r1, 0, (MR_Integer) 2);
	MR_tfield(0, MR_r1, 0) = MR_tempr1;
	MR_tfield(0, MR_r1, 1) = MR_sv(3);
	MR_decr_sp_and_return(7);
	}
MR_def_label(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,9)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r4,3,6)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_i14);
	}
	MR_incr_sp(7);
	MR_sv(7) = (MR_Word) MR_succip;
	MR_sv(1) = MR_r1;
	MR_sv(2) = MR_r2;
	MR_sv(3) = MR_tfield(0, MR_r3, 1);
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r4;
	MR_sv(4) = MR_tfield(3, MR_tempr1, 1);
	MR_sv(5) = MR_tfield(3, MR_tempr1, 3);
	MR_sv(6) = MR_tfield(3, MR_tempr1, 4);
	MR_r3 = MR_tfield(3, MR_tempr1, 2);
	}
	MR_np_localcall_lab(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,
		fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_i15);
MR_def_label(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,15)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_sv(5);
	MR_sv(5) = MR_r1;
	MR_r1 = MR_sv(1);
	MR_r2 = MR_sv(2);
	MR_r3 = MR_tempr1;
	}
	MR_np_localcall_lab(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,
		fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_i16);
MR_def_label(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,16)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_sv(1);
	MR_sv(1) = MR_r1;
	MR_r1 = MR_tempr1;
	MR_r2 = MR_sv(2);
	MR_r3 = MR_sv(6);
	}
	MR_np_localcall_lab(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,
		fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_i17);
MR_def_label(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,17)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 3, (MR_Integer) 5);
	MR_tfield(3, MR_tempr1, 0) = (MR_Integer) 6;
	MR_tfield(3, MR_tempr1, 1) = MR_sv(4);
	MR_tfield(3, MR_tempr1, 2) = MR_sv(5);
	MR_tfield(3, MR_tempr1, 3) = MR_sv(1);
	MR_tfield(3, MR_tempr1, 4) = MR_r1;
	MR_tag_alloc_heap(MR_r1, 0, (MR_Integer) 2);
	MR_tfield(0, MR_r1, 0) = MR_tempr1;
	MR_tfield(0, MR_r1, 1) = MR_sv(3);
	MR_decr_sp_and_return(7);
	}
MR_def_label(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,14)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r4,3,4)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_i20);
	}
	MR_incr_sp(7);
	MR_sv(7) = (MR_Word) MR_succip;
	MR_sv(3) = MR_tfield(0, MR_r3, 1);
	MR_r3 = MR_tfield(3, MR_r4, 1);
	MR_np_localcall_lab(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,
		fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_i21);
MR_def_label(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,21)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 3, (MR_Integer) 2);
	MR_tfield(3, MR_tempr1, 0) = (MR_Integer) 4;
	MR_tfield(3, MR_tempr1, 1) = MR_r1;
	MR_tag_alloc_heap(MR_r1, 0, (MR_Integer) 2);
	MR_tfield(0, MR_r1, 0) = MR_tempr1;
	MR_tfield(0, MR_r1, 1) = MR_sv(3);
	MR_decr_sp_and_return(7);
	}
MR_def_label(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,20)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_PTAG_TESTR(MR_r4,1)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_i24);
	}
	{
	MR_Word MR_tempr1, MR_tempr2, MR_tempr3, MR_tempr4;
	MR_tempr4 = MR_r4;
	MR_tempr1 = MR_tfield(1, MR_tempr4, 0);
	MR_tempr2 = MR_tfield(0, MR_r1, 0);
	if ((MR_tempr1 != MR_tempr2)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_i38);
	}
	MR_tempr1 = MR_tfield(1, MR_tempr4, 1);
	MR_tempr3 = MR_tfield(0, MR_r1, 1);
	if ((MR_tempr1 != MR_tempr3)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_i38);
	}
	MR_r1 = MR_r2;
	MR_r2 = MR_r3;
	MR_np_tailcall_ent(fn__transform_hlds__loop_inv__gen_aux_call_2_0);
	}
MR_def_label(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,24)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r4,3,5)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_i28);
	}
	MR_incr_sp(7);
	MR_sv(7) = (MR_Word) MR_succip;
	MR_sv(3) = MR_tfield(0, MR_r3, 1);
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r4;
	MR_sv(1) = MR_tfield(3, MR_tempr1, 1);
	MR_r3 = MR_tfield(3, MR_tempr1, 2);
	}
	MR_np_localcall_lab(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,
		fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_i29);
MR_def_label(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,29)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 3, (MR_Integer) 3);
	MR_tfield(3, MR_tempr1, 0) = (MR_Integer) 5;
	MR_tfield(3, MR_tempr1, 1) = MR_sv(1);
	MR_tfield(3, MR_tempr1, 2) = MR_r1;
	MR_tag_alloc_heap(MR_r1, 0, (MR_Integer) 2);
	MR_tfield(0, MR_r1, 0) = MR_tempr1;
	MR_tfield(0, MR_r1, 1) = MR_sv(3);
	MR_decr_sp_and_return(7);
	}
MR_def_label(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,28)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r4,3,3)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_i32);
	}
	MR_incr_sp(7);
	MR_sv(7) = (MR_Word) MR_succip;
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 5);
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(1,3);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_ENTRY_AP(fn__transform_hlds__loop_inv__gen_out_proc_case_3_0);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 2;
	MR_tfield(0, MR_tempr1, 3) = MR_r1;
	MR_tfield(0, MR_tempr1, 4) = MR_r2;
	MR_sv(3) = MR_tfield(0, MR_r3, 1);
	MR_tempr2 = MR_r4;
	MR_sv(1) = MR_tfield(3, MR_tempr2, 1);
	MR_sv(2) = MR_tfield(3, MR_tempr2, 2);
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, case);
	MR_r2 = MR_r1;
	MR_r3 = MR_tempr1;
	MR_r4 = MR_tfield(3, MR_r4, 3);
	}
	MR_np_call_localret_ent(fn__list__map_2_0,
		fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0_i34);
MR_def_label(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,34)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 3, (MR_Integer) 4);
	MR_tfield(3, MR_tempr1, 0) = (MR_Integer) 3;
	MR_tfield(3, MR_tempr1, 1) = MR_sv(1);
	MR_tfield(3, MR_tempr1, 2) = MR_sv(2);
	MR_tfield(3, MR_tempr1, 3) = MR_r1;
	MR_tag_alloc_heap(MR_r1, 0, (MR_Integer) 2);
	MR_tfield(0, MR_r1, 0) = MR_tempr1;
	MR_tfield(0, MR_r1, 1) = MR_sv(3);
	MR_decr_sp_and_return(7);
	}
MR_def_label(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,32)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = (MR_Word) MR_string_const("transform_hlds.loop_inv", 23);
	MR_r2 = (MR_Word) MR_string_const("function \140transform_hlds.loop_inv.gen_out_proc_goal\'/3", 54);
	MR_r3 = (MR_Word) MR_string_const("shorthand", 9);
	MR_np_tailcall_ent(require__unexpected_3_0);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(hlds__hlds_pred__proc_info_get_headvars_2_0);
MR_decl_entry(hlds__hlds_pred__proc_info_set_body_7_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module18)
	MR_init_entry1(transform_hlds__loop_inv__gen_out_proc_8_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__transform_hlds__loop_inv__gen_out_proc_8_0);
	MR_init_label9(transform_hlds__loop_inv__gen_out_proc_8_0,2,3,4,5,6,7,8,9,10)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'gen_out_proc'/8 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(transform_hlds__loop_inv__gen_out_proc_8_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(10);
	MR_sv(10) = (MR_Word) MR_succip;
	MR_sv(1) = MR_r1;
	MR_sv(2) = MR_r2;
	MR_sv(3) = MR_r3;
	MR_sv(4) = MR_r6;
	MR_r2 = MR_r4;
	MR_r3 = MR_r5;
	MR_np_call_localret_ent(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,
		transform_hlds__loop_inv__gen_out_proc_8_0_i2);
MR_def_label(transform_hlds__loop_inv__gen_out_proc_8_0,2)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r2 = MR_sv(1);
	MR_sv(1) = MR_r1;
	MR_sv(5) = MR_tfield(0, MR_r2, 0);
	MR_sv(6) = MR_tfield(0, MR_r2, 1);
	MR_r1 = MR_sv(3);
	MR_np_call_localret_ent(hlds__hlds_pred__proc_info_get_varset_2_0,
		transform_hlds__loop_inv__gen_out_proc_8_0_i3);
MR_def_label(transform_hlds__loop_inv__gen_out_proc_8_0,3)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(7) = MR_r1;
	MR_r1 = MR_sv(3);
	MR_np_call_localret_ent(hlds__hlds_pred__proc_info_get_vartypes_2_0,
		transform_hlds__loop_inv__gen_out_proc_8_0_i4);
MR_def_label(transform_hlds__loop_inv__gen_out_proc_8_0,4)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(8) = MR_r1;
	MR_r1 = MR_sv(3);
	MR_np_call_localret_ent(hlds__hlds_pred__proc_info_get_headvars_2_0,
		transform_hlds__loop_inv__gen_out_proc_8_0_i5);
MR_def_label(transform_hlds__loop_inv__gen_out_proc_8_0,5)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(9) = MR_r1;
	MR_r1 = MR_sv(3);
	MR_np_call_localret_ent(hlds__hlds_pred__proc_info_get_rtti_varmaps_2_0,
		transform_hlds__loop_inv__gen_out_proc_8_0_i6);
MR_def_label(transform_hlds__loop_inv__gen_out_proc_8_0,6)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(7);
	MR_r2 = MR_sv(8);
	MR_r3 = MR_sv(9);
	MR_r4 = MR_sv(1);
	MR_r5 = MR_tempr1;
	MR_r6 = MR_sv(3);
	}
	MR_np_call_localret_ent(hlds__hlds_pred__proc_info_set_body_7_0,
		transform_hlds__loop_inv__gen_out_proc_8_0_i7);
MR_def_label(transform_hlds__loop_inv__gen_out_proc_8_0,7)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = (MR_Integer) 1;
	MR_r2 = MR_tempr1;
	}
	MR_np_call_localret_ent(hlds__quantification__requantify_proc_general_3_0,
		transform_hlds__loop_inv__gen_out_proc_8_0_i8);
MR_def_label(transform_hlds__loop_inv__gen_out_proc_8_0,8)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = (MR_Integer) 1;
	MR_r2 = MR_tempr1;
	MR_r3 = MR_sv(4);
	}
	MR_np_call_localret_ent(check_hlds__mode_util__recompute_instmap_delta_proc_5_0,
		transform_hlds__loop_inv__gen_out_proc_8_0_i9);
MR_def_label(transform_hlds__loop_inv__gen_out_proc_8_0,9)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(1) = MR_r1;
	MR_r1 = MR_sv(5);
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r2;
	MR_r2 = MR_sv(6);
	MR_r3 = MR_sv(2);
	MR_r4 = MR_sv(1);
	MR_r5 = MR_tempr1;
	}
	MR_np_call_localret_ent(hlds__hlds_module__module_info_set_pred_proc_info_6_0,
		transform_hlds__loop_inv__gen_out_proc_8_0_i10);
MR_def_label(transform_hlds__loop_inv__gen_out_proc_8_0,10)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(1);
	MR_r2 = MR_tempr1;
	MR_decr_sp_and_return(10);
	}
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE


MR_BEGIN_MODULE(transform_hlds__loop_inv_module19)
	MR_init_entry1(fn__transform_hlds__loop_inv__case_goals_1_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__case_goals_1_0);
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'case_goals'/2 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__case_goals_1_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, case);
	MR_r2 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r3 = (MR_Word) MR_TAG_COMMON(0,3,3);
	MR_r4 = MR_tempr1;
	MR_np_tailcall_ent(fn__list__map_2_0);
	}
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(hlds__hlds_pred__proc_info_get_argmodes_2_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module20)
	MR_init_entry1(fn__transform_hlds__loop_inv__argmodes_3_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__argmodes_3_0);
	MR_init_label1(fn__transform_hlds__loop_inv__argmodes_3_0,2)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'argmodes'/4 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__argmodes_3_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(1);
	MR_sv(1) = (MR_Word) MR_succip;
	MR_np_call_localret_ent(hlds__hlds_module__module_info_pred_proc_info_5_0,
		fn__transform_hlds__loop_inv__argmodes_3_0_i2);
MR_def_label(fn__transform_hlds__loop_inv__argmodes_3_0,2)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = MR_r2;
	MR_succip_word = MR_sv(1);
	MR_decr_sp(1);
	MR_np_tailcall_ent(hlds__hlds_pred__proc_info_get_argmodes_2_0);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

extern const MR_TypeCtorInfo_Struct mercury_data_hlds__hlds_goal__type_ctor_info_foreign_arg_0;
MR_decl_entry(fn__list__filter_map_corresponding_3_0);
MR_decl_entry(fn__list__condense_1_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module21)
	MR_init_entry1(fn__transform_hlds__loop_inv__used_vars_2_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__used_vars_2_0);
	MR_init_label10(fn__transform_hlds__loop_inv__used_vars_2_0,115,7,8,9,11,3,13,23,19,25)
	MR_init_label10(fn__transform_hlds__loop_inv__used_vars_2_0,31,32,33,34,29,36,41,38,43,49)
	MR_init_label3(fn__transform_hlds__loop_inv__used_vars_2_0,50,45,52)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'used_vars'/3 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__used_vars_2_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(8);
	MR_sv(8) = (MR_Word) MR_succip;
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,115)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tempr1 = MR_tfield(0, MR_r2, 0);
	MR_r5 = MR_tempr1;
	if (MR_RTAGS_TESTR(MR_tempr1,3,0)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__used_vars_2_0_i3);
	}
	MR_tag_alloc_heap(MR_tempr2, 0, (MR_Integer) 4);
	MR_sv(3) = MR_tempr2;
	MR_tfield(0, MR_tempr2, 0) = (MR_Word) MR_COMMON(1,4);
	MR_tfield(0, MR_tempr2, 1) = (MR_Word) MR_ENTRY_AP(fn__transform_hlds__loop_inv__uniquely_used_args_3_0);
	MR_tfield(0, MR_tempr2, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr2, 3) = MR_r1;
	MR_sv(1) = MR_r1;
	MR_sv(2) = MR_tfield(3, MR_tempr1, 5);
	MR_sv(4) = MR_tfield(3, MR_tempr1, 2);
	MR_sv(5) = MR_tfield(3, MR_tempr1, 3);
	MR_sv(6) = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_sv(7) = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, foreign_arg);
	MR_r1 = MR_sv(7);
	MR_r2 = MR_sv(6);
	MR_r3 = (MR_Word) MR_TAG_COMMON(0,3,4);
	MR_r4 = MR_tfield(3, MR_tempr1, 4);
	}
	MR_np_call_localret_ent(fn__list__map_2_0,
		fn__transform_hlds__loop_inv__used_vars_2_0_i7);
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,7)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(1) = MR_r1;
	MR_r1 = MR_tfield(0, MR_sv(3), 3);
	MR_r2 = MR_sv(4);
	MR_r3 = MR_sv(5);
	MR_np_call_localret_ent(fn__transform_hlds__loop_inv__argmodes_3_0,
		fn__transform_hlds__loop_inv__used_vars_2_0_i8);
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,8)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(6);
	MR_r2 = (MR_Word) MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode);
	MR_r3 = MR_r1;
	MR_r4 = MR_sv(3);
	MR_r5 = MR_sv(1);
	MR_r6 = MR_tempr1;
	}
	MR_np_call_localret_ent(fn__list__filter_map_corresponding_3_0,
		fn__transform_hlds__loop_inv__used_vars_2_0_i9);
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,9)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(1) = MR_r1;
	MR_r1 = MR_sv(7);
	MR_r2 = MR_sv(6);
	MR_r3 = (MR_Word) MR_TAG_COMMON(0,3,5);
	MR_r4 = MR_sv(2);
	MR_np_call_localret_ent(fn__list__map_2_0,
		fn__transform_hlds__loop_inv__used_vars_2_0_i11);
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,11)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(6);
	MR_r2 = MR_sv(1);
	MR_r3 = MR_tempr1;
	MR_succip_word = MR_sv(8);
	MR_decr_sp(8);
	MR_np_tailcall_ent(fn__f_108_105_115_116_95_95_43_43_2_0);
	}
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,3)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r5,3,1)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__used_vars_2_0_i13);
	}
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 4);
	MR_r3 = MR_tempr1;
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(2,5);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_ENTRY_AP(fn__transform_hlds__loop_inv__used_vars_2_0);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr1, 3) = MR_r1;
	MR_sv(1) = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r2 = (MR_Word) MR_TAG_COMMON(0,0,11);
	MR_r4 = MR_tfield(3, MR_r5, 2);
	}
	MR_np_call_localret_ent(fn__list__map_2_0,
		fn__transform_hlds__loop_inv__used_vars_2_0_i23);
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,13)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r5,3,2)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__used_vars_2_0_i19);
	}
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 4);
	MR_r3 = MR_tempr1;
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(2,6);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_ENTRY_AP(fn__transform_hlds__loop_inv__used_vars_2_0);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr1, 3) = MR_r1;
	MR_sv(1) = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r2 = (MR_Word) MR_TAG_COMMON(0,0,11);
	MR_r4 = MR_tfield(3, MR_r5, 1);
	}
	MR_np_call_localret_ent(fn__list__map_2_0,
		fn__transform_hlds__loop_inv__used_vars_2_0_i23);
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,23)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(1);
	MR_r2 = MR_tempr1;
	MR_succip_word = MR_sv(8);
	MR_decr_sp(8);
	MR_np_tailcall_ent(fn__list__condense_1_0);
	}
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,19)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_PTAG_TESTR(MR_r5,2)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__used_vars_2_0_i25);
	}
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 4);
	MR_r4 = MR_tempr1;
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(1,5);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_ENTRY_AP(fn__transform_hlds__loop_inv__uniquely_used_args_3_0);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr1, 3) = MR_r1;
	MR_r1 = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r2 = (MR_Word) MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode);
	MR_r3 = MR_r1;
	MR_tempr2 = MR_r5;
	MR_r5 = MR_tfield(2, MR_r5, 1);
	MR_r6 = MR_tfield(2, MR_tempr2, 2);
	MR_succip_word = MR_sv(8);
	MR_decr_sp(8);
	MR_np_tailcall_ent(fn__list__filter_map_corresponding_3_0);
	}
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,25)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r5,3,6)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__used_vars_2_0_i29);
	}
	MR_sv(1) = MR_r1;
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r5;
	MR_sv(2) = MR_tfield(3, MR_tempr1, 3);
	MR_sv(3) = MR_tfield(3, MR_tempr1, 4);
	MR_sv(4) = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r2 = MR_tfield(3, MR_tempr1, 2);
	}
	MR_np_localcall_lab(fn__transform_hlds__loop_inv__used_vars_2_0,
		fn__transform_hlds__loop_inv__used_vars_2_0_i31);
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,31)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_sv(2);
	MR_sv(2) = MR_r1;
	MR_r1 = MR_sv(1);
	MR_r2 = MR_tempr1;
	}
	MR_np_localcall_lab(fn__transform_hlds__loop_inv__used_vars_2_0,
		fn__transform_hlds__loop_inv__used_vars_2_0_i32);
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,32)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_sv(1);
	MR_sv(1) = MR_r1;
	MR_r1 = MR_tempr1;
	MR_r2 = MR_sv(3);
	}
	MR_np_localcall_lab(fn__transform_hlds__loop_inv__used_vars_2_0,
		fn__transform_hlds__loop_inv__used_vars_2_0_i33);
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,33)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(4);
	MR_r2 = MR_sv(1);
	MR_r3 = MR_tempr1;
	}
	MR_np_call_localret_ent(fn__f_108_105_115_116_95_95_43_43_2_0,
		fn__transform_hlds__loop_inv__used_vars_2_0_i34);
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,34)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(4);
	MR_r2 = MR_sv(2);
	MR_r3 = MR_tempr1;
	MR_succip_word = MR_sv(8);
	MR_decr_sp(8);
	MR_np_tailcall_ent(fn__f_108_105_115_116_95_95_43_43_2_0);
	}
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,29)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r5,3,4)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__used_vars_2_0_i36);
	}
	MR_r2 = MR_tfield(3, MR_r5, 1);
	MR_succip_word = MR_sv(8);
	MR_GOTO_LAB(fn__transform_hlds__loop_inv__used_vars_2_0_i115);
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,36)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_PTAG_TESTR(MR_r5,1)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__used_vars_2_0_i38);
	}
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 4);
	MR_sv(2) = MR_tempr1;
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(1,6);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_ENTRY_AP(fn__transform_hlds__loop_inv__uniquely_used_args_3_0);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr1, 3) = MR_r1;
	MR_tempr2 = MR_r5;
	MR_sv(1) = MR_tfield(1, MR_tempr2, 2);
	MR_sv(3) = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r2 = MR_tfield(1, MR_tempr2, 0);
	MR_r3 = MR_tfield(1, MR_tempr2, 1);
	}
	MR_np_call_localret_ent(fn__transform_hlds__loop_inv__argmodes_3_0,
		fn__transform_hlds__loop_inv__used_vars_2_0_i41);
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,41)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(3);
	MR_r2 = (MR_Word) MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode);
	MR_r3 = MR_r1;
	MR_r4 = MR_sv(2);
	MR_r5 = MR_sv(1);
	MR_r6 = MR_tempr1;
	MR_succip_word = MR_sv(8);
	MR_decr_sp(8);
	MR_np_tailcall_ent(fn__list__filter_map_corresponding_3_0);
	}
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,38)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r5,3,5)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__used_vars_2_0_i43);
	}
	MR_r2 = MR_tfield(3, MR_r5, 2);
	MR_succip_word = MR_sv(8);
	MR_GOTO_LAB(fn__transform_hlds__loop_inv__used_vars_2_0_i115);
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,43)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r5,3,3)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__used_vars_2_0_i45);
	}
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 4);
	MR_sv(1) = MR_tempr1;
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(2,7);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_ENTRY_AP(fn__transform_hlds__loop_inv__used_vars_2_0);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr1, 3) = MR_r1;
	MR_sv(2) = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_sv(3) = (MR_Word) MR_TAG_COMMON(0,0,11);
	MR_r1 = MR_tfield(3, MR_r5, 3);
	}
	MR_np_call_localret_ent(fn__transform_hlds__loop_inv__case_goals_1_0,
		fn__transform_hlds__loop_inv__used_vars_2_0_i49);
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,49)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r2 = MR_sv(3);
	MR_r3 = MR_sv(1);
	MR_r4 = MR_tempr1;
	}
	MR_np_call_localret_ent(fn__list__map_2_0,
		fn__transform_hlds__loop_inv__used_vars_2_0_i50);
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,50)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(2);
	MR_r2 = MR_tempr1;
	MR_succip_word = MR_sv(8);
	MR_decr_sp(8);
	MR_np_tailcall_ent(fn__list__condense_1_0);
	}
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,45)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_PTAG_TESTR(MR_r5,0)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__used_vars_2_0_i52);
	}
	MR_r1 = (MR_Word) MR_tbmkword(0, 0);
	MR_decr_sp_and_return(8);
MR_def_label(fn__transform_hlds__loop_inv__used_vars_2_0,52)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = (MR_Word) MR_string_const("transform_hlds.loop_inv", 23);
	MR_r2 = (MR_Word) MR_string_const("function \140transform_hlds.loop_inv.used_vars\'/2", 46);
	MR_r3 = (MR_Word) MR_string_const("shorthand", 9);
	MR_succip_word = MR_sv(8);
	MR_decr_sp(8);
	MR_np_tailcall_ent(require__unexpected_3_0);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(hlds__hlds_pred__pred_info_get_purity_2_0);
MR_decl_entry(fn__f_108_105_115_116_95_95_84_121_112_101_83_112_101_99_79_102_95_95_112_114_101_100_95_111_114_95_102_117_110_99_95_95_115_111_114_116_95_97_110_100_95_114_101_109_111_118_101_95_100_117_112_115_95_95_91_84_32_61_32_118_97_114_40_86_95_50_41_93_95_48_95_49_1_0);
MR_decl_entry(fn__cord__empty_0_0);
MR_decl_entry(assoc_list__keys_and_values_3_0);
MR_decl_entry(fn__list__filter_2_0);
MR_decl_entry(fn__list__delete_elems_2_0);
MR_decl_entry(hlds__hlds_pred__proc_info_get_initial_instmap_3_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module22)
	MR_init_entry1(transform_hlds__loop_inv__hoist_loop_invariants_6_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__transform_hlds__loop_inv__hoist_loop_invariants_6_0);
	MR_init_label10(transform_hlds__loop_inv__hoist_loop_invariants_6_0,3,4,5,6,8,9,10,12,14,16)
	MR_init_label10(transform_hlds__loop_inv__hoist_loop_invariants_6_0,18,15,19,20,21,24,25,26,28,29)
	MR_init_label4(transform_hlds__loop_inv__hoist_loop_invariants_6_0,30,31,32,2)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'hoist_loop_invariants'/6 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_define_entry(mercury__transform_hlds__loop_inv__hoist_loop_invariants_6_0);
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(12);
	MR_sv(12) = (MR_Word) MR_succip;
	MR_sv(1) = MR_r1;
	MR_sv(2) = MR_r2;
	MR_sv(8) = MR_r3;
	MR_sv(9) = MR_r4;
	MR_r1 = MR_r2;
	MR_np_call_localret_ent(hlds__hlds_pred__pred_info_get_purity_2_0,
		transform_hlds__loop_inv__hoist_loop_invariants_6_0_i3);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,3)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (((MR_Integer) 0 != (MR_Integer) MR_r1)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__hoist_loop_invariants_6_0_i2);
	}
	MR_r1 = MR_sv(8);
	MR_np_call_localret_ent(hlds__hlds_pred__proc_info_get_goal_2_0,
		transform_hlds__loop_inv__hoist_loop_invariants_6_0_i4);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,4)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(3) = MR_r1;
	MR_r1 = MR_sv(8);
	MR_np_call_localret_ent(hlds__hlds_pred__proc_info_get_headvars_2_0,
		transform_hlds__loop_inv__hoist_loop_invariants_6_0_i5);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,5)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(4) = MR_r1;
	MR_r1 = MR_sv(8);
	MR_np_call_localret_ent(hlds__hlds_pred__proc_info_get_argmodes_2_0,
		transform_hlds__loop_inv__hoist_loop_invariants_6_0_i6);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,6)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(5) = MR_r1;
	MR_sv(10) = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_sv(6) = (MR_Word) MR_CTOR0_ADDR(parse_tree__prog_data, prog_var_type);
	MR_r1 = MR_sv(9);
	MR_r2 = MR_sv(3);
	MR_np_call_localret_ent(fn__transform_hlds__loop_inv__used_vars_2_0,
		transform_hlds__loop_inv__hoist_loop_invariants_6_0_i8);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,8)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(6);
	MR_r2 = MR_sv(10);
	MR_r3 = MR_tempr1;
	}
	MR_np_call_localret_ent(fn__f_108_105_115_116_95_95_84_121_112_101_83_112_101_99_79_102_95_95_112_114_101_100_95_111_114_95_102_117_110_99_95_95_115_111_114_116_95_97_110_100_95_114_101_109_111_118_101_95_100_117_112_115_95_95_91_84_32_61_32_118_97_114_40_86_95_50_41_93_95_48_95_49_1_0,
		transform_hlds__loop_inv__hoist_loop_invariants_6_0_i9);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,9)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(6) = MR_r1;
	MR_sv(7) = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r1 = MR_sv(7);
	MR_np_call_localret_ent(fn__cord__empty_0_0,
		transform_hlds__loop_inv__hoist_loop_invariants_6_0_i10);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,10)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 3);
	MR_r3 = MR_tempr1;
	MR_tfield(0, MR_tempr1, 0) = MR_sv(9);
	MR_tfield(0, MR_tempr1, 1) = MR_r1;
	MR_tfield(0, MR_tempr1, 2) = (MR_Word) MR_tbmkword(0, 0);
	MR_r1 = MR_sv(1);
	MR_r2 = MR_sv(3);
	}
	MR_np_call_localret_ent(transform_hlds__loop_inv__invariant_goal_candidates_in_goal_4_0,
		transform_hlds__loop_inv__hoist_loop_invariants_6_0_i12);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,12)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(11) = (MR_Word) MR_TAG_COMMON(0,0,10);
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(7);
	MR_r2 = MR_sv(11);
	MR_r3 = MR_tfield(0, MR_tempr1, 2);
	}
	MR_np_call_localret_ent(assoc_list__keys_and_values_3_0,
		transform_hlds__loop_inv__hoist_loop_invariants_6_0_i14);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,14)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_LTAGS_TESTR(MR_r2,0,0)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__hoist_loop_invariants_6_0_i16);
	}
	MR_r2 = MR_sv(4);
	MR_r3 = MR_sv(5);
	MR_sv(5) = (MR_Word) MR_tbmkword(0, 0);
	MR_r4 = MR_r1;
	MR_r1 = MR_sv(9);
	MR_GOTO_LAB(transform_hlds__loop_inv__hoist_loop_invariants_6_0_i15);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,16)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 4);
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(4,4);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_ENTRY_AP(transform_hlds__loop_inv__common_goal_2_0);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr1, 3) = MR_tfield(1, MR_r2, 1);
	MR_sv(7) = MR_r1;
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_tempr2 = MR_r2;
	MR_r2 = MR_tempr1;
	MR_r3 = MR_tfield(1, MR_tempr2, 0);
	}
	MR_np_call_localret_ent(fn__list__filter_2_0,
		transform_hlds__loop_inv__hoist_loop_invariants_6_0_i18);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,18)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r2 = MR_sv(4);
	MR_r3 = MR_sv(5);
	MR_sv(5) = MR_r1;
	MR_r4 = MR_sv(7);
	MR_r1 = MR_sv(9);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,15)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(4) = MR_r2;
	MR_sv(9) = MR_r1;
	MR_np_call_localret_ent(fn__transform_hlds__loop_inv__inv_args_4_0,
		transform_hlds__loop_inv__hoist_loop_invariants_6_0_i19);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,19)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(10);
	MR_r2 = MR_tempr1;
	MR_r3 = MR_sv(6);
	}
	MR_np_call_localret_ent(fn__list__delete_elems_2_0,
		transform_hlds__loop_inv__hoist_loop_invariants_6_0_i20);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,20)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_sv(5);
	MR_sv(5) = MR_r1;
	MR_r1 = MR_sv(9);
	MR_r2 = MR_sv(6);
	MR_r3 = MR_tempr1;
	MR_r4 = MR_sv(5);
	}
	MR_np_call_localret_ent(transform_hlds__loop_inv__inv_goals_vars_6_0,
		transform_hlds__loop_inv__hoist_loop_invariants_6_0_i21);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,21)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 4);
	MR_r4 = MR_tempr1;
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(6,0);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_ENTRY_AP(transform_hlds__loop_inv__do_not_hoist_2_6_0);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr1, 3) = MR_sv(9);
	MR_tag_alloc_heap(MR_tempr2, 0, (MR_Integer) 2);
	MR_r3 = MR_tempr2;
	MR_tfield(0, MR_tempr2, 0) = (MR_Word) MR_LIST_CTOR_ADDR;
	MR_tfield(0, MR_tempr2, 1) = MR_sv(10);
	MR_sv(6) = MR_r1;
	MR_sv(7) = MR_r2;
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r2 = MR_sv(11);
	MR_r5 = MR_sv(6);
	MR_r6 = (MR_Word) MR_tbmkword(0, 0);
	MR_r7 = (MR_Word) MR_tbmkword(0, 0);
	}
	MR_np_call_localret_ent(list__foldl2_6_0,
		transform_hlds__loop_inv__hoist_loop_invariants_6_0_i24);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,24)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tempr1 = MR_sv(6);
	MR_sv(6) = MR_r2;
	MR_tempr2 = MR_r1;
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r2 = MR_tempr1;
	MR_r3 = MR_tempr2;
	}
	MR_np_call_localret_ent(fn__list__delete_elems_2_0,
		transform_hlds__loop_inv__hoist_loop_invariants_6_0_i25);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,25)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_sv(6);
	MR_sv(6) = MR_r1;
	MR_r1 = MR_sv(10);
	MR_r2 = MR_sv(7);
	MR_r3 = MR_tempr1;
	}
	MR_np_call_localret_ent(fn__list__delete_elems_2_0,
		transform_hlds__loop_inv__hoist_loop_invariants_6_0_i26);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,26)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_LTAGS_TEST(MR_sv(6),0,0)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__hoist_loop_invariants_6_0_i2);
	}
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(10);
	MR_r2 = MR_tempr1;
	MR_r3 = MR_sv(5);
	}
	MR_np_call_localret_ent(fn__list__delete_elems_2_0,
		transform_hlds__loop_inv__hoist_loop_invariants_6_0_i28);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,28)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(5) = MR_r1;
	MR_r1 = MR_sv(8);
	MR_r2 = MR_sv(9);
	MR_np_call_localret_ent(hlds__hlds_pred__proc_info_get_initial_instmap_3_0,
		transform_hlds__loop_inv__hoist_loop_invariants_6_0_i29);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,29)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(6);
	MR_r2 = MR_tempr1;
	}
	MR_np_call_localret_ent(fn__transform_hlds__loop_inv__compute_initial_aux_instmap_2_0,
		transform_hlds__loop_inv__hoist_loop_invariants_6_0_i30);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,30)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(1);
	MR_r2 = MR_sv(4);
	MR_r3 = MR_sv(5);
	MR_r4 = MR_tempr1;
	MR_r5 = MR_sv(9);
	}
	MR_np_call_localret_ent(transform_hlds__loop_inv__create_aux_pred_10_0,
		transform_hlds__loop_inv__hoist_loop_invariants_6_0_i31);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,31)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(4) = MR_r2;
	{
	MR_Word MR_tempr1, MR_tempr2, MR_tempr3, MR_tempr4;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(6);
	MR_r2 = MR_sv(1);
	MR_tempr2 = MR_r3;
	MR_r3 = MR_tempr1;
	MR_tempr3 = MR_r4;
	MR_r4 = MR_sv(4);
	MR_tempr4 = MR_r5;
	MR_r5 = MR_sv(3);
	MR_r6 = MR_tempr2;
	MR_r7 = MR_tempr3;
	MR_r8 = MR_tempr4;
	}
	MR_np_call_localret_ent(transform_hlds__loop_inv__gen_aux_proc_9_0,
		transform_hlds__loop_inv__hoist_loop_invariants_6_0_i32);
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,32)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(1);
	MR_r2 = MR_sv(2);
	MR_r3 = MR_sv(8);
	MR_r4 = MR_sv(4);
	MR_r5 = MR_sv(3);
	MR_r6 = MR_tempr1;
	MR_succip_word = MR_sv(12);
	MR_decr_sp(12);
	MR_np_tailcall_ent(transform_hlds__loop_inv__gen_out_proc_8_0);
	}
MR_def_label(transform_hlds__loop_inv__hoist_loop_invariants_6_0,2)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = MR_sv(8);
	MR_r2 = MR_sv(9);
	MR_decr_sp_and_return(12);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE


MR_BEGIN_MODULE(transform_hlds__loop_inv_module23)
	MR_init_entry1(transform_hlds__loop_inv__common_goal_2_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__transform_hlds__loop_inv__common_goal_2_0);
	MR_init_label7(transform_hlds__loop_inv__common_goal_2_0,7,12,16,21,13,11,5)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'common_goal'/2 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(transform_hlds__loop_inv__common_goal_2_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(11);
	MR_sv(11) = (MR_Word) MR_succip;
	MR_sv(5) = (MR_Word) MR_redoip_slot(MR_maxfr);
	MR_sv(6) = (MR_Word) MR_redofr_slot(MR_maxfr);
	MR_save_maxfr(MR_sv(7));
	MR_redofr_slot_word(MR_maxfr) = (MR_Word) MR_curfr;
	MR_redoip_slot_word(MR_maxfr) = (MR_Word) MR_LABEL_AP(transform_hlds__loop_inv__common_goal_2_0_i5);
	MR_sv(1) = MR_r2;
	MR_sv(2) = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = (MR_Word) MR_TAG_COMMON(0,0,10);
	MR_r2 = MR_tempr1;
	}
	MR_np_call_localret_ent(list__member_2_1,
		transform_hlds__loop_inv__common_goal_2_0_i7);
MR_def_label(transform_hlds__loop_inv__common_goal_2_0,7)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(8) = (MR_Word) MR_redoip_slot(MR_maxfr);
	MR_sv(9) = (MR_Word) MR_redofr_slot(MR_maxfr);
	MR_save_maxfr(MR_sv(10));
	MR_redofr_slot_word(MR_maxfr) = (MR_Word) MR_curfr;
	MR_redoip_slot_word(MR_maxfr) = (MR_Word) MR_LABEL_AP(transform_hlds__loop_inv__common_goal_2_0_i11);
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(2);
	MR_r2 = MR_tempr1;
	}
	MR_np_call_localret_ent(list__member_2_1,
		transform_hlds__loop_inv__common_goal_2_0_i12);
MR_def_label(transform_hlds__loop_inv__common_goal_2_0,12)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r2 = MR_tfield(0, MR_sv(1), 0);
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_tfield(0, MR_r1, 0);
	MR_sv(3) = MR_tempr1;
	MR_sv(4) = MR_r2;
	MR_r1 = MR_tempr1;
	}
	MR_np_call_localret_ent(__Unify___hlds__hlds_goal__hlds_goal_expr_0_0,
		transform_hlds__loop_inv__common_goal_2_0_i16);
MR_def_label(transform_hlds__loop_inv__common_goal_2_0,16)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_r1) {
		MR_GOTO_LAB(transform_hlds__loop_inv__common_goal_2_0_i13);
	}
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_sv(3);
	MR_r3 = MR_tempr1;
	MR_r2 = MR_sv(4);
	if (MR_PTAG_TESTR(MR_tempr1,1)) {
		MR_GOTO(MR_ENTRY(MR_do_redo));
	}
	if (MR_PTAG_TESTR(MR_r2,1)) {
		MR_GOTO(MR_ENTRY(MR_do_redo));
	}
	MR_r4 = MR_tfield(1, MR_tempr1, 0);
	MR_r5 = MR_tfield(1, MR_r2, 0);
	if ((MR_r4 != MR_r5)) {
		MR_GOTO(MR_ENTRY(MR_do_redo));
	}
	MR_r4 = MR_tfield(1, MR_tempr1, 1);
	MR_r5 = MR_tfield(1, MR_r2, 1);
	if ((MR_r4 != MR_r5)) {
		MR_GOTO(MR_ENTRY(MR_do_redo));
	}
	MR_r1 = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r2 = MR_tfield(1, MR_tempr1, 2);
	MR_r3 = MR_tfield(1, MR_sv(4), 2);
	}
	MR_np_call_localret_ent(__Unify___list__list_1_0,
		transform_hlds__loop_inv__common_goal_2_0_i21);
MR_def_label(transform_hlds__loop_inv__common_goal_2_0,21)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (!(MR_r1)) {
		MR_GOTO(MR_ENTRY(MR_do_redo));
	}
MR_def_label(transform_hlds__loop_inv__common_goal_2_0,13)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_restore_maxfr(MR_sv(10));
	MR_redoip_slot_word(MR_maxfr) = MR_sv(8);
	MR_redofr_slot_word(MR_maxfr) = MR_sv(9);
	MR_GOTO(MR_ENTRY(MR_do_redo));
MR_def_label(transform_hlds__loop_inv__common_goal_2_0,11)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_redoip_slot_word(MR_maxfr) = MR_sv(8);
	MR_redofr_slot_word(MR_maxfr) = MR_sv(9);
	MR_restore_maxfr(MR_sv(7));
	MR_redoip_slot_word(MR_maxfr) = MR_sv(5);
	MR_redofr_slot_word(MR_maxfr) = MR_sv(6);
	MR_succip_word = MR_sv(11);
	MR_decr_sp(11);
	MR_r1 = MR_FALSE;
	MR_proceed();
MR_def_label(transform_hlds__loop_inv__common_goal_2_0,5)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_redoip_slot_word(MR_maxfr) = MR_sv(5);
	MR_redofr_slot_word(MR_maxfr) = MR_sv(6);
	MR_succip_word = MR_sv(11);
	MR_decr_sp(11);
	MR_r1 = MR_TRUE;
	MR_proceed();
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(check_hlds__mode_util__mode_get_insts_4_0);
MR_decl_entry(check_hlds__inst_match__inst_is_free_2_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module24)
	MR_init_entry1(fn__transform_hlds__loop_inv__input_arg_3_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__input_arg_3_0);
	MR_init_label3(fn__transform_hlds__loop_inv__input_arg_3_0,2,5,1)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'input_arg'/4 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__input_arg_3_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(3);
	MR_sv(3) = (MR_Word) MR_succip;
	MR_sv(1) = MR_r2;
	MR_sv(2) = MR_r1;
	MR_r2 = MR_r3;
	MR_np_call_localret_ent(check_hlds__mode_util__mode_get_insts_4_0,
		fn__transform_hlds__loop_inv__input_arg_3_0_i2);
MR_def_label(fn__transform_hlds__loop_inv__input_arg_3_0,2)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(2);
	MR_r2 = MR_tempr1;
	}
	MR_np_call_localret_ent(check_hlds__inst_match__inst_is_free_2_0,
		fn__transform_hlds__loop_inv__input_arg_3_0_i5);
MR_def_label(fn__transform_hlds__loop_inv__input_arg_3_0,5)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_r1) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__input_arg_3_0_i1);
	}
	MR_r2 = MR_sv(1);
	MR_succip_word = MR_sv(3);
	MR_decr_sp(3);
	MR_r1 = MR_TRUE;
	MR_proceed();
MR_def_label(fn__transform_hlds__loop_inv__input_arg_3_0,1)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_succip_word = MR_sv(3);
	MR_decr_sp(3);
	MR_r1 = MR_FALSE;
	MR_proceed();
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE


MR_BEGIN_MODULE(transform_hlds__loop_inv_module25)
	MR_init_entry1(fn__transform_hlds__loop_inv__arg_to_maybe_inv_arg_3_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__arg_to_maybe_inv_arg_3_0);
	MR_init_label3(fn__transform_hlds__loop_inv__arg_to_maybe_inv_arg_3_0,3,6,2)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'arg_to_maybe_inv_arg'/4 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__arg_to_maybe_inv_arg_3_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(3);
	MR_sv(3) = (MR_Word) MR_succip;
	MR_sv(1) = MR_r1;
	MR_sv(2) = MR_r2;
	MR_r2 = MR_r3;
	MR_np_call_localret_ent(check_hlds__mode_util__mode_get_insts_4_0,
		fn__transform_hlds__loop_inv__arg_to_maybe_inv_arg_3_0_i3);
MR_def_label(fn__transform_hlds__loop_inv__arg_to_maybe_inv_arg_3_0,3)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(1);
	MR_r2 = MR_tempr1;
	}
	MR_np_call_localret_ent(check_hlds__inst_match__inst_is_free_2_0,
		fn__transform_hlds__loop_inv__arg_to_maybe_inv_arg_3_0_i6);
MR_def_label(fn__transform_hlds__loop_inv__arg_to_maybe_inv_arg_3_0,6)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_r1) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__arg_to_maybe_inv_arg_3_0_i2);
	}
	MR_tag_alloc_heap(MR_r1, 1, (MR_Integer) 1);
	MR_tfield(1, MR_r1, 0) = MR_sv(2);
	MR_decr_sp_and_return(3);
MR_def_label(fn__transform_hlds__loop_inv__arg_to_maybe_inv_arg_3_0,2)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = (MR_Word) MR_tbmkword(0, 0);
	MR_decr_sp_and_return(3);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE


MR_BEGIN_MODULE(transform_hlds__loop_inv_module26)
	MR_init_entry1(fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_0);
	MR_init_label1(fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_0,2)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'refine_candidate_inv_args'/3 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tempr1 = MR_tfield(0, MR_r1, 0);
	if (MR_PTAG_TESTR(MR_tempr1,1)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_0_i2);
	}
	MR_r1 = (MR_Word) MR_TAG_COMMON(0,0,1);
	MR_tempr2 = MR_r2;
	MR_r2 = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r3 = MR_r1;
	MR_r4 = (MR_Word) MR_TAG_COMMON(0,3,6);
	MR_r5 = MR_tempr2;
	MR_r6 = MR_tfield(1, MR_tempr1, 2);
	MR_np_tailcall_ent(fn__list__map_corresponding_3_0);
	}
MR_def_label(fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_0,2)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = (MR_Word) MR_TAG_COMMON(0,0,5);
	MR_r2 = (MR_Word) MR_string_const("transform_hlds.loop_inv", 23);
	MR_r3 = (MR_Word) MR_string_const("function \140transform_hlds.loop_inv.refine_candidate_inv_args\'/2", 62);
	MR_r4 = (MR_Word) MR_string_const("non call/6 found in argument 1", 30);
	MR_np_tailcall_ent(fn__require__unexpected_3_0);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(__Unify___term__var_1_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module27)
	MR_init_entry1(fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_2_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_2_0);
	MR_init_label3(fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_2_0,8,3,5)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'refine_candidate_inv_args_2'/3 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_2_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(2);
	MR_sv(2) = (MR_Word) MR_succip;
	if (MR_LTAGS_TESTR(MR_r1,0,0)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_2_0_i3);
	}
MR_def_label(fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_2_0,8)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = (MR_Word) MR_tbmkword(0, 0);
	MR_decr_sp_and_return(2);
MR_def_label(fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_2_0,3)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(1) = MR_r1;
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(parse_tree__prog_data, prog_var_type);
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r2;
	MR_r2 = MR_tfield(1, MR_sv(1), 0);
	MR_r3 = MR_tempr1;
	}
	MR_np_call_localret_ent(__Unify___term__var_1_0,
		fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_2_0_i5);
MR_def_label(fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_2_0,5)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (!(MR_r1)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__refine_candidate_inv_args_2_2_0_i8);
	}
	MR_r1 = MR_sv(1);
	MR_decr_sp_and_return(2);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

extern const MR_TypeCtorInfo_Struct mercury_data_hlds__hlds_goal__type_ctor_info_uni_mode_0;

MR_BEGIN_MODULE(transform_hlds__loop_inv_module28)
	MR_init_entry1(fn__transform_hlds__loop_inv__rhs_modes_1_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__rhs_modes_1_0);
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'rhs_modes'/2 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__rhs_modes_1_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, uni_mode);
	MR_r2 = (MR_Word) MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode);
	MR_r3 = (MR_Word) MR_TAG_COMMON(0,3,7);
	MR_r4 = MR_tempr1;
	MR_np_tailcall_ent(fn__list__map_2_0);
	}
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(hlds__goal_util__generic_call_vars_2_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module29)
	MR_init_entry1(fn__transform_hlds__loop_inv__goal_inputs_2_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__goal_inputs_2_0);
	MR_init_label10(fn__transform_hlds__loop_inv__goal_inputs_2_0,7,8,3,11,14,10,19,16,23,28)
	MR_init_label8(fn__transform_hlds__loop_inv__goal_inputs_2_0,25,33,34,30,38,40,36,21)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'goal_inputs'/3 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__goal_inputs_2_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2, MR_tempr3;
	MR_tempr1 = MR_tfield(0, MR_r2, 0);
	MR_r5 = MR_tempr1;
	if (MR_RTAGS_TESTR(MR_tempr1,3,0)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__goal_inputs_2_0_i3);
	}
	MR_incr_sp(6);
	MR_sv(6) = (MR_Word) MR_succip;
	MR_tag_alloc_heap(MR_tempr2, 0, (MR_Integer) 4);
	MR_sv(2) = MR_tempr2;
	MR_tfield(0, MR_tempr2, 0) = (MR_Word) MR_COMMON(1,7);
	MR_tfield(0, MR_tempr2, 1) = (MR_Word) MR_ENTRY_AP(fn__transform_hlds__loop_inv__input_arg_3_0);
	MR_tfield(0, MR_tempr2, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr2, 3) = MR_r1;
	MR_sv(1) = MR_r1;
	MR_tempr3 = MR_r5;
	MR_sv(3) = MR_tfield(3, MR_tempr3, 2);
	MR_sv(4) = MR_tfield(3, MR_tempr3, 3);
	MR_sv(5) = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, foreign_arg);
	MR_r2 = MR_sv(5);
	MR_r3 = (MR_Word) MR_TAG_COMMON(0,3,8);
	MR_r4 = MR_tfield(3, MR_tempr3, 4);
	}
	MR_np_call_localret_ent(fn__list__map_2_0,
		fn__transform_hlds__loop_inv__goal_inputs_2_0_i7);
MR_def_label(fn__transform_hlds__loop_inv__goal_inputs_2_0,7)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(1) = MR_r1;
	MR_r1 = MR_tfield(0, MR_sv(2), 3);
	MR_r2 = MR_sv(3);
	MR_r3 = MR_sv(4);
	MR_np_call_localret_ent(fn__transform_hlds__loop_inv__argmodes_3_0,
		fn__transform_hlds__loop_inv__goal_inputs_2_0_i8);
MR_def_label(fn__transform_hlds__loop_inv__goal_inputs_2_0,8)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(5);
	MR_r2 = (MR_Word) MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode);
	MR_r3 = MR_r1;
	MR_r4 = MR_sv(2);
	MR_r5 = MR_sv(1);
	MR_r6 = MR_tempr1;
	MR_succip_word = MR_sv(6);
	MR_decr_sp(6);
	MR_np_tailcall_ent(fn__list__filter_map_corresponding_3_0);
	}
MR_def_label(fn__transform_hlds__loop_inv__goal_inputs_2_0,3)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_PTAG_TESTR(MR_r5,2)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__goal_inputs_2_0_i10);
	}
	MR_incr_sp(6);
	MR_sv(6) = (MR_Word) MR_succip;
	MR_sv(1) = MR_r1;
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r5;
	MR_sv(2) = MR_tfield(2, MR_tempr1, 2);
	MR_sv(3) = MR_tfield(2, MR_tempr1, 1);
	MR_r1 = MR_tfield(2, MR_tempr1, 0);
	}
	MR_np_call_localret_ent(hlds__goal_util__generic_call_vars_2_0,
		fn__transform_hlds__loop_inv__goal_inputs_2_0_i11);
MR_def_label(fn__transform_hlds__loop_inv__goal_inputs_2_0,11)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 4);
	MR_r4 = MR_tempr1;
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(1,8);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_ENTRY_AP(fn__transform_hlds__loop_inv__input_arg_3_0);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr1, 3) = MR_sv(1);
	MR_sv(1) = MR_r1;
	MR_tempr2 = MR_sv(2);
	MR_sv(2) = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r1 = MR_sv(2);
	MR_r2 = (MR_Word) MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode);
	MR_r3 = MR_r1;
	MR_r5 = MR_sv(3);
	MR_r6 = MR_tempr2;
	}
	MR_np_call_localret_ent(fn__list__filter_map_corresponding_3_0,
		fn__transform_hlds__loop_inv__goal_inputs_2_0_i14);
MR_def_label(fn__transform_hlds__loop_inv__goal_inputs_2_0,14)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(2);
	MR_r2 = MR_sv(1);
	MR_r3 = MR_tempr1;
	MR_succip_word = MR_sv(6);
	MR_decr_sp(6);
	MR_np_tailcall_ent(fn__f_108_105_115_116_95_95_43_43_2_0);
	}
MR_def_label(fn__transform_hlds__loop_inv__goal_inputs_2_0,10)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_PTAG_TESTR(MR_r5,1)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__goal_inputs_2_0_i16);
	}
	MR_incr_sp(6);
	MR_sv(6) = (MR_Word) MR_succip;
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 4);
	MR_sv(2) = MR_tempr1;
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(1,9);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_ENTRY_AP(fn__transform_hlds__loop_inv__input_arg_3_0);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr1, 3) = MR_r1;
	MR_tempr2 = MR_r5;
	MR_sv(1) = MR_tfield(1, MR_tempr2, 2);
	MR_sv(3) = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r2 = MR_tfield(1, MR_tempr2, 0);
	MR_r3 = MR_tfield(1, MR_tempr2, 1);
	}
	MR_np_call_localret_ent(fn__transform_hlds__loop_inv__argmodes_3_0,
		fn__transform_hlds__loop_inv__goal_inputs_2_0_i19);
MR_def_label(fn__transform_hlds__loop_inv__goal_inputs_2_0,19)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(3);
	MR_r2 = (MR_Word) MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode);
	MR_r3 = MR_r1;
	MR_r4 = MR_sv(2);
	MR_r5 = MR_sv(1);
	MR_r6 = MR_tempr1;
	MR_succip_word = MR_sv(6);
	MR_decr_sp(6);
	MR_np_tailcall_ent(fn__list__filter_map_corresponding_3_0);
	}
MR_def_label(fn__transform_hlds__loop_inv__goal_inputs_2_0,16)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_PTAG_TESTR(MR_r5,0)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__goal_inputs_2_0_i21);
	}
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_tfield(0, MR_r5, 3);
	MR_r4 = MR_tempr1;
	if (MR_PTAG_TESTR(MR_tempr1,2)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__goal_inputs_2_0_i23);
	}
	MR_tag_alloc_heap(MR_r1, 1, (MR_Integer) 2);
	MR_tfield(1, MR_r1, 0) = MR_tfield(2, MR_tempr1, 1);
	MR_tfield(1, MR_r1, 1) = (MR_Word) MR_tbmkword(0, 0);
	MR_proceed();
	}
MR_def_label(fn__transform_hlds__loop_inv__goal_inputs_2_0,23)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_PTAG_TESTR(MR_r4,0)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__goal_inputs_2_0_i25);
	}
	MR_incr_sp(6);
	MR_sv(6) = (MR_Word) MR_succip;
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 4);
	MR_sv(2) = MR_tempr1;
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(1,10);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_ENTRY_AP(fn__transform_hlds__loop_inv__input_arg_3_0);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr1, 3) = MR_r1;
	MR_tempr2 = MR_r4;
	MR_sv(1) = MR_tfield(0, MR_tempr2, 2);
	MR_sv(3) = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r1 = MR_tfield(0, MR_tempr2, 3);
	}
	MR_np_call_localret_ent(fn__transform_hlds__loop_inv__rhs_modes_1_0,
		fn__transform_hlds__loop_inv__goal_inputs_2_0_i28);
MR_def_label(fn__transform_hlds__loop_inv__goal_inputs_2_0,28)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(3);
	MR_r2 = (MR_Word) MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode);
	MR_r3 = MR_r1;
	MR_r4 = MR_sv(2);
	MR_r5 = MR_sv(1);
	MR_r6 = MR_tempr1;
	MR_succip_word = MR_sv(6);
	MR_decr_sp(6);
	MR_np_tailcall_ent(fn__list__filter_map_corresponding_3_0);
	}
MR_def_label(fn__transform_hlds__loop_inv__goal_inputs_2_0,25)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_PTAG_TESTR(MR_r4,1)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__goal_inputs_2_0_i30);
	}
	MR_incr_sp(6);
	MR_sv(6) = (MR_Word) MR_succip;
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 4);
	MR_sv(2) = MR_tempr1;
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(1,11);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_ENTRY_AP(fn__transform_hlds__loop_inv__input_arg_3_0);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr1, 3) = MR_r1;
	MR_sv(1) = MR_tfield(0, MR_r5, 0);
	MR_tempr2 = MR_r4;
	MR_sv(3) = MR_tfield(1, MR_tempr2, 2);
	MR_sv(4) = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r1 = MR_tfield(1, MR_tempr2, 3);
	}
	MR_np_call_localret_ent(fn__transform_hlds__loop_inv__rhs_modes_1_0,
		fn__transform_hlds__loop_inv__goal_inputs_2_0_i33);
MR_def_label(fn__transform_hlds__loop_inv__goal_inputs_2_0,33)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(4);
	MR_r2 = (MR_Word) MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode);
	MR_r3 = MR_r1;
	MR_r4 = MR_sv(2);
	MR_r5 = MR_sv(3);
	MR_r6 = MR_tempr1;
	}
	MR_np_call_localret_ent(fn__list__filter_map_corresponding_3_0,
		fn__transform_hlds__loop_inv__goal_inputs_2_0_i34);
MR_def_label(fn__transform_hlds__loop_inv__goal_inputs_2_0,34)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_tag_alloc_heap(MR_r2, 1, (MR_Integer) 2);
	MR_tfield(1, MR_r2, 0) = MR_sv(1);
	MR_tfield(1, MR_r2, 1) = MR_r1;
	MR_r1 = MR_r2;
	MR_decr_sp_and_return(6);
MR_def_label(fn__transform_hlds__loop_inv__goal_inputs_2_0,30)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_RTAGS_TESTR(MR_r4,3,1)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__goal_inputs_2_0_i36);
	}
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r5;
	MR_r4 = MR_tfield(0, MR_tempr1, 1);
	if (MR_PTAG_TESTR(MR_r4,1)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__goal_inputs_2_0_i38);
	}
	MR_tag_alloc_heap(MR_r1, 1, (MR_Integer) 2);
	MR_tfield(1, MR_r1, 0) = MR_tfield(0, MR_tempr1, 0);
	MR_tfield(1, MR_r1, 1) = (MR_Word) MR_tbmkword(0, 0);
	MR_proceed();
	}
MR_def_label(fn__transform_hlds__loop_inv__goal_inputs_2_0,38)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_PTAG_TESTR(MR_r4,0)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__goal_inputs_2_0_i40);
	}
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 1, (MR_Integer) 2);
	MR_tfield(1, MR_tempr1, 0) = MR_tfield(0, MR_r4, 0);
	MR_tfield(1, MR_tempr1, 1) = (MR_Word) MR_tbmkword(0, 0);
	MR_tag_alloc_heap(MR_r1, 1, (MR_Integer) 2);
	MR_tfield(1, MR_r1, 0) = MR_tfield(0, MR_r5, 0);
	MR_tfield(1, MR_r1, 1) = MR_tempr1;
	MR_proceed();
	}
MR_def_label(fn__transform_hlds__loop_inv__goal_inputs_2_0,40)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = (MR_Word) MR_string_const("transform_hlds.loop_inv", 23);
	MR_r2 = (MR_Word) MR_string_const("function \140transform_hlds.loop_inv.goal_inputs\'/2", 48);
	MR_r3 = (MR_Word) MR_string_const("lambda goal", 11);
	MR_np_tailcall_ent(require__unexpected_3_0);
MR_def_label(fn__transform_hlds__loop_inv__goal_inputs_2_0,36)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_tag_alloc_heap(MR_r2, 1, (MR_Integer) 2);
	MR_tfield(1, MR_r2, 0) = MR_tfield(3, MR_r4, 2);
	MR_tfield(1, MR_r2, 1) = (MR_Word) MR_tbmkword(0, 0);
	MR_tag_alloc_heap(MR_r1, 1, (MR_Integer) 2);
	MR_tfield(1, MR_r1, 0) = MR_tfield(0, MR_r5, 0);
	MR_tfield(1, MR_r1, 1) = MR_r2;
	MR_proceed();
MR_def_label(fn__transform_hlds__loop_inv__goal_inputs_2_0,21)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = (MR_Word) MR_string_const("transform_hlds.loop_inv", 23);
	MR_r2 = (MR_Word) MR_string_const("function \140transform_hlds.loop_inv.goal_inputs\'/2", 48);
	MR_r3 = (MR_Word) MR_string_const("compound goal", 13);
	MR_np_tailcall_ent(require__unexpected_3_0);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE


MR_BEGIN_MODULE(transform_hlds__loop_inv_module30)
	MR_init_entry1(fn__transform_hlds__loop_inv__goal_outputs_2_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__goal_outputs_2_0);
	MR_init_label10(fn__transform_hlds__loop_inv__goal_outputs_2_0,7,8,3,10,17,14,21,23,28,25)
	MR_init_label1(fn__transform_hlds__loop_inv__goal_outputs_2_0,19)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'goal_outputs'/3 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__goal_outputs_2_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2, MR_tempr3;
	MR_tempr1 = MR_tfield(0, MR_r2, 0);
	MR_r5 = MR_tempr1;
	if (MR_RTAGS_TESTR(MR_tempr1,3,0)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__goal_outputs_2_0_i3);
	}
	MR_incr_sp(6);
	MR_sv(6) = (MR_Word) MR_succip;
	MR_tag_alloc_heap(MR_tempr2, 0, (MR_Integer) 4);
	MR_sv(2) = MR_tempr2;
	MR_tfield(0, MR_tempr2, 0) = (MR_Word) MR_COMMON(1,12);
	MR_tfield(0, MR_tempr2, 1) = (MR_Word) MR_ENTRY_AP(fn__transform_hlds__loop_inv__output_arg_3_0);
	MR_tfield(0, MR_tempr2, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr2, 3) = MR_r1;
	MR_sv(1) = MR_r1;
	MR_tempr3 = MR_r5;
	MR_sv(3) = MR_tfield(3, MR_tempr3, 2);
	MR_sv(4) = MR_tfield(3, MR_tempr3, 3);
	MR_sv(5) = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, foreign_arg);
	MR_r2 = MR_sv(5);
	MR_r3 = (MR_Word) MR_TAG_COMMON(0,3,9);
	MR_r4 = MR_tfield(3, MR_tempr3, 4);
	}
	MR_np_call_localret_ent(fn__list__map_2_0,
		fn__transform_hlds__loop_inv__goal_outputs_2_0_i7);
MR_def_label(fn__transform_hlds__loop_inv__goal_outputs_2_0,7)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(1) = MR_r1;
	MR_r1 = MR_tfield(0, MR_sv(2), 3);
	MR_r2 = MR_sv(3);
	MR_r3 = MR_sv(4);
	MR_np_call_localret_ent(fn__transform_hlds__loop_inv__argmodes_3_0,
		fn__transform_hlds__loop_inv__goal_outputs_2_0_i8);
MR_def_label(fn__transform_hlds__loop_inv__goal_outputs_2_0,8)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(5);
	MR_r2 = (MR_Word) MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode);
	MR_r3 = MR_r1;
	MR_r4 = MR_sv(2);
	MR_r5 = MR_sv(1);
	MR_r6 = MR_tempr1;
	MR_succip_word = MR_sv(6);
	MR_decr_sp(6);
	MR_np_tailcall_ent(fn__list__filter_map_corresponding_3_0);
	}
MR_def_label(fn__transform_hlds__loop_inv__goal_outputs_2_0,3)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_PTAG_TESTR(MR_r5,2)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__goal_outputs_2_0_i10);
	}
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 4);
	MR_r4 = MR_tempr1;
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(1,13);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_ENTRY_AP(fn__transform_hlds__loop_inv__output_arg_3_0);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr1, 3) = MR_r1;
	MR_r1 = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r2 = (MR_Word) MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode);
	MR_r3 = MR_r1;
	MR_tempr2 = MR_r5;
	MR_r5 = MR_tfield(2, MR_r5, 1);
	MR_r6 = MR_tfield(2, MR_tempr2, 2);
	MR_np_tailcall_ent(fn__list__filter_map_corresponding_3_0);
	}
MR_def_label(fn__transform_hlds__loop_inv__goal_outputs_2_0,10)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_PTAG_TESTR(MR_r5,1)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__goal_outputs_2_0_i14);
	}
	MR_incr_sp(6);
	MR_sv(6) = (MR_Word) MR_succip;
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 4);
	MR_sv(2) = MR_tempr1;
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(1,14);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_ENTRY_AP(fn__transform_hlds__loop_inv__output_arg_3_0);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr1, 3) = MR_r1;
	MR_tempr2 = MR_r5;
	MR_sv(1) = MR_tfield(1, MR_tempr2, 2);
	MR_sv(3) = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r2 = MR_tfield(1, MR_tempr2, 0);
	MR_r3 = MR_tfield(1, MR_tempr2, 1);
	}
	MR_np_call_localret_ent(fn__transform_hlds__loop_inv__argmodes_3_0,
		fn__transform_hlds__loop_inv__goal_outputs_2_0_i17);
MR_def_label(fn__transform_hlds__loop_inv__goal_outputs_2_0,17)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(3);
	MR_r2 = (MR_Word) MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode);
	MR_r3 = MR_r1;
	MR_r4 = MR_sv(2);
	MR_r5 = MR_sv(1);
	MR_r6 = MR_tempr1;
	MR_succip_word = MR_sv(6);
	MR_decr_sp(6);
	MR_np_tailcall_ent(fn__list__filter_map_corresponding_3_0);
	}
MR_def_label(fn__transform_hlds__loop_inv__goal_outputs_2_0,14)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_PTAG_TESTR(MR_r5,0)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__goal_outputs_2_0_i19);
	}
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r5;
	MR_r4 = MR_tfield(0, MR_tempr1, 3);
	if (MR_PTAG_TESTR(MR_r4,2)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__goal_outputs_2_0_i21);
	}
	MR_tag_alloc_heap(MR_r1, 1, (MR_Integer) 2);
	MR_tfield(1, MR_r1, 0) = MR_tfield(0, MR_tempr1, 0);
	MR_tfield(1, MR_r1, 1) = (MR_Word) MR_tbmkword(0, 0);
	MR_proceed();
	}
MR_def_label(fn__transform_hlds__loop_inv__goal_outputs_2_0,21)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_PTAG_TESTR(MR_r4,0)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__goal_outputs_2_0_i23);
	}
	MR_tag_alloc_heap(MR_r1, 1, (MR_Integer) 2);
	MR_tfield(1, MR_r1, 0) = MR_tfield(0, MR_r5, 0);
	MR_tfield(1, MR_r1, 1) = (MR_Word) MR_tbmkword(0, 0);
	MR_proceed();
MR_def_label(fn__transform_hlds__loop_inv__goal_outputs_2_0,23)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_PTAG_TESTR(MR_r4,1)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__goal_outputs_2_0_i25);
	}
	MR_incr_sp(6);
	MR_sv(6) = (MR_Word) MR_succip;
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 4);
	MR_sv(2) = MR_tempr1;
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(1,15);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_ENTRY_AP(fn__transform_hlds__loop_inv__output_arg_3_0);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr1, 3) = MR_r1;
	MR_tempr2 = MR_r4;
	MR_sv(1) = MR_tfield(1, MR_tempr2, 2);
	MR_sv(3) = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r1 = MR_tfield(1, MR_tempr2, 3);
	}
	MR_np_call_localret_ent(fn__transform_hlds__loop_inv__rhs_modes_1_0,
		fn__transform_hlds__loop_inv__goal_outputs_2_0_i28);
MR_def_label(fn__transform_hlds__loop_inv__goal_outputs_2_0,28)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(3);
	MR_r2 = (MR_Word) MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode);
	MR_r3 = MR_r1;
	MR_r4 = MR_sv(2);
	MR_r5 = MR_sv(1);
	MR_r6 = MR_tempr1;
	MR_succip_word = MR_sv(6);
	MR_decr_sp(6);
	MR_np_tailcall_ent(fn__list__filter_map_corresponding_3_0);
	}
MR_def_label(fn__transform_hlds__loop_inv__goal_outputs_2_0,25)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = (MR_Word) MR_tbmkword(0, 0);
	MR_proceed();
MR_def_label(fn__transform_hlds__loop_inv__goal_outputs_2_0,19)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = (MR_Word) MR_string_const("transform_hlds.loop_inv", 23);
	MR_r2 = (MR_Word) MR_string_const("function \140transform_hlds.loop_inv.goal_outputs\'/2", 49);
	MR_r3 = (MR_Word) MR_string_const("compound goal", 13);
	MR_np_tailcall_ent(require__unexpected_3_0);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(list__foldl_4_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module31)
	MR_init_entry1(transform_hlds__loop_inv__add_outputs_5_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__transform_hlds__loop_inv__add_outputs_5_0);
	MR_init_label1(transform_hlds__loop_inv__add_outputs_5_0,3)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'add_outputs'/5 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(transform_hlds__loop_inv__add_outputs_5_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(3);
	MR_sv(3) = (MR_Word) MR_succip;
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 0, (MR_Integer) 4);
	MR_sv(2) = MR_tempr1;
	MR_tfield(0, MR_tempr1, 0) = (MR_Word) MR_COMMON(1,16);
	MR_tfield(0, MR_tempr1, 1) = (MR_Word) MR_ENTRY_AP(transform_hlds__loop_inv__add_output_4_0);
	MR_tfield(0, MR_tempr1, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr1, 3) = MR_r2;
	MR_sv(1) = MR_r4;
	MR_r2 = MR_r3;
	}
	MR_np_call_localret_ent(fn__transform_hlds__loop_inv__goal_outputs_2_0,
		transform_hlds__loop_inv__add_outputs_5_0_i3);
MR_def_label(transform_hlds__loop_inv__add_outputs_5_0,3)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r2 = (MR_Word) MR_TAG_COMMON(0,0,11);
	MR_r3 = MR_sv(2);
	MR_r4 = MR_tempr1;
	MR_r5 = MR_sv(1);
	MR_succip_word = MR_sv(3);
	MR_decr_sp(3);
	MR_np_tailcall_ent(list__foldl_4_0);
	}
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(fn__hlds__hlds_goal__goal_info_get_nonlocals_1_0);
MR_decl_entry(f_115_101_116_95_95_84_121_112_101_83_112_101_99_79_102_95_95_112_114_101_100_95_95_109_101_109_98_101_114_95_95_91_84_32_61_32_118_97_114_40_86_95_50_41_93_95_48_95_49_2_0);
MR_decl_entry(f_108_105_115_116_95_95_84_121_112_101_83_112_101_99_79_102_95_95_112_114_101_100_95_95_109_101_109_98_101_114_95_95_91_84_32_61_32_118_97_114_40_86_95_50_41_93_95_48_95_49_2_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module32)
	MR_init_entry1(transform_hlds__loop_inv__inv_goals_vars_2_7_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__transform_hlds__loop_inv__inv_goals_vars_2_7_0);
	MR_init_label10(transform_hlds__loop_inv__inv_goals_vars_2_7_0,8,12,17,9,6,24,26,27,22,30)
	MR_init_label6(transform_hlds__loop_inv__inv_goals_vars_2_7_0,36,39,34,44,47,2)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'inv_goals_vars_2'/7 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(transform_hlds__loop_inv__inv_goals_vars_2_7_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(18);
	MR_sv(18) = (MR_Word) MR_succip;
	MR_sv(9) = (MR_Word) MR_redoip_slot(MR_maxfr);
	MR_sv(10) = (MR_Word) MR_redofr_slot(MR_maxfr);
	MR_save_maxfr(MR_sv(11));
	MR_redofr_slot_word(MR_maxfr) = (MR_Word) MR_curfr;
	MR_redoip_slot_word(MR_maxfr) = (MR_Word) MR_LABEL_AP(transform_hlds__loop_inv__inv_goals_vars_2_7_0_i6);
	MR_sv(1) = MR_r1;
	MR_sv(2) = MR_r2;
	MR_sv(3) = MR_r3;
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r4;
	MR_sv(4) = MR_tempr1;
	MR_sv(5) = MR_r5;
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r2 = MR_tempr1;
	}
	MR_np_call_localret_ent(list__member_2_1,
		transform_hlds__loop_inv__inv_goals_vars_2_7_0_i8);
MR_def_label(transform_hlds__loop_inv__inv_goals_vars_2_7_0,8)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r2 = MR_tfield(0, MR_sv(3), 0);
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_tfield(0, MR_r1, 0);
	MR_sv(6) = MR_tempr1;
	MR_sv(7) = MR_r2;
	MR_r1 = MR_tempr1;
	}
	MR_np_call_localret_ent(__Unify___hlds__hlds_goal__hlds_goal_expr_0_0,
		transform_hlds__loop_inv__inv_goals_vars_2_7_0_i12);
MR_def_label(transform_hlds__loop_inv__inv_goals_vars_2_7_0,12)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_r1) {
		MR_GOTO_LAB(transform_hlds__loop_inv__inv_goals_vars_2_7_0_i9);
	}
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_sv(6);
	MR_r3 = MR_tempr1;
	MR_r2 = MR_sv(7);
	if (MR_PTAG_TESTR(MR_tempr1,1)) {
		MR_GOTO(MR_ENTRY(MR_do_redo));
	}
	if (MR_PTAG_TESTR(MR_r2,1)) {
		MR_GOTO(MR_ENTRY(MR_do_redo));
	}
	MR_r4 = MR_tfield(1, MR_tempr1, 0);
	MR_r5 = MR_tfield(1, MR_r2, 0);
	if ((MR_r4 != MR_r5)) {
		MR_GOTO(MR_ENTRY(MR_do_redo));
	}
	MR_r4 = MR_tfield(1, MR_tempr1, 1);
	MR_r5 = MR_tfield(1, MR_r2, 1);
	if ((MR_r4 != MR_r5)) {
		MR_GOTO(MR_ENTRY(MR_do_redo));
	}
	MR_r1 = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r2 = MR_tfield(1, MR_tempr1, 2);
	MR_r3 = MR_tfield(1, MR_sv(7), 2);
	}
	MR_np_call_localret_ent(__Unify___list__list_1_0,
		transform_hlds__loop_inv__inv_goals_vars_2_7_0_i17);
MR_def_label(transform_hlds__loop_inv__inv_goals_vars_2_7_0,17)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (!(MR_r1)) {
		MR_GOTO(MR_ENTRY(MR_do_redo));
	}
MR_def_label(transform_hlds__loop_inv__inv_goals_vars_2_7_0,9)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_restore_maxfr(MR_sv(11));
	MR_redoip_slot_word(MR_maxfr) = MR_sv(9);
	MR_redofr_slot_word(MR_maxfr) = MR_sv(10);
	MR_GOTO_LAB(transform_hlds__loop_inv__inv_goals_vars_2_7_0_i2);
MR_def_label(transform_hlds__loop_inv__inv_goals_vars_2_7_0,6)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = MR_sv(1);
	MR_r2 = MR_sv(2);
	{
	MR_Word MR_tempr1, MR_tempr2, MR_tempr3;
	MR_tempr1 = MR_sv(3);
	MR_tempr2 = MR_sv(4);
	MR_tempr3 = MR_sv(5);
	MR_redoip_slot_word(MR_maxfr) = MR_sv(9);
	MR_redofr_slot_word(MR_maxfr) = MR_sv(10);
	MR_sv(12) = (MR_Word) MR_redoip_slot(MR_maxfr);
	MR_sv(13) = (MR_Word) MR_redofr_slot(MR_maxfr);
	MR_save_maxfr(MR_sv(14));
	MR_redofr_slot_word(MR_maxfr) = (MR_Word) MR_curfr;
	MR_redoip_slot_word(MR_maxfr) = (MR_Word) MR_LABEL_AP(transform_hlds__loop_inv__inv_goals_vars_2_7_0_i22);
	MR_r1 = MR_tfield(0, MR_tempr1, 1);
	}
	MR_np_call_localret_ent(fn__hlds__hlds_goal__goal_info_get_nonlocals_1_0,
		transform_hlds__loop_inv__inv_goals_vars_2_7_0_i24);
MR_def_label(transform_hlds__loop_inv__inv_goals_vars_2_7_0,24)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(6) = MR_r1;
	MR_sv(7) = (MR_Word) MR_CTOR0_ADDR(parse_tree__prog_data, prog_var_type);
	MR_sv(8) = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r1 = MR_sv(8);
	MR_r2 = MR_sv(2);
	MR_np_call_localret_ent(list__member_2_1,
		transform_hlds__loop_inv__inv_goals_vars_2_7_0_i26);
MR_def_label(transform_hlds__loop_inv__inv_goals_vars_2_7_0,26)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(7);
	MR_r2 = MR_sv(8);
	MR_r3 = MR_tempr1;
	MR_r4 = MR_sv(6);
	}
	MR_np_call_localret_ent(f_115_101_116_95_95_84_121_112_101_83_112_101_99_79_102_95_95_112_114_101_100_95_95_109_101_109_98_101_114_95_95_91_84_32_61_32_118_97_114_40_86_95_50_41_93_95_48_95_49_2_0,
		transform_hlds__loop_inv__inv_goals_vars_2_7_0_i27);
MR_def_label(transform_hlds__loop_inv__inv_goals_vars_2_7_0,27)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (!(MR_r1)) {
		MR_GOTO(MR_ENTRY(MR_do_redo));
	}
	MR_restore_maxfr(MR_sv(14));
	MR_redoip_slot_word(MR_maxfr) = MR_sv(12);
	MR_redofr_slot_word(MR_maxfr) = MR_sv(13);
	MR_GOTO_LAB(transform_hlds__loop_inv__inv_goals_vars_2_7_0_i2);
MR_def_label(transform_hlds__loop_inv__inv_goals_vars_2_7_0,22)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = MR_sv(1);
	MR_r2 = MR_sv(2);
	{
	MR_Word MR_tempr1, MR_tempr2, MR_tempr3;
	MR_tempr1 = MR_sv(3);
	MR_tempr2 = MR_sv(4);
	MR_tempr3 = MR_sv(5);
	MR_redoip_slot_word(MR_maxfr) = MR_sv(12);
	MR_redofr_slot_word(MR_maxfr) = MR_sv(13);
	MR_r2 = MR_tempr1;
	}
	MR_np_call_localret_ent(fn__transform_hlds__loop_inv__goal_inputs_2_0,
		transform_hlds__loop_inv__inv_goals_vars_2_7_0_i30);
MR_def_label(transform_hlds__loop_inv__inv_goals_vars_2_7_0,30)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(15) = (MR_Word) MR_redoip_slot(MR_maxfr);
	MR_sv(16) = (MR_Word) MR_redofr_slot(MR_maxfr);
	MR_save_maxfr(MR_sv(17));
	MR_redofr_slot_word(MR_maxfr) = (MR_Word) MR_curfr;
	MR_redoip_slot_word(MR_maxfr) = (MR_Word) MR_LABEL_AP(transform_hlds__loop_inv__inv_goals_vars_2_7_0_i34);
	MR_sv(6) = (MR_Word) MR_CTOR0_ADDR(parse_tree__prog_data, prog_var_type);
	MR_sv(7) = (MR_Word) MR_TAG_COMMON(0,0,0);
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(7);
	MR_r2 = MR_tempr1;
	}
	MR_np_call_localret_ent(list__member_2_1,
		transform_hlds__loop_inv__inv_goals_vars_2_7_0_i36);
MR_def_label(transform_hlds__loop_inv__inv_goals_vars_2_7_0,36)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(6);
	MR_r2 = MR_sv(7);
	MR_r3 = MR_tempr1;
	MR_r4 = MR_sv(5);
	}
	MR_np_call_localret_ent(f_108_105_115_116_95_95_84_121_112_101_83_112_101_99_79_102_95_95_112_114_101_100_95_95_109_101_109_98_101_114_95_95_91_84_32_61_32_118_97_114_40_86_95_50_41_93_95_48_95_49_2_0,
		transform_hlds__loop_inv__inv_goals_vars_2_7_0_i39);
MR_def_label(transform_hlds__loop_inv__inv_goals_vars_2_7_0,39)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_r1) {
		MR_GOTO(MR_ENTRY(MR_do_redo));
	}
	MR_restore_maxfr(MR_sv(17));
	MR_redoip_slot_word(MR_maxfr) = MR_sv(15);
	MR_redofr_slot_word(MR_maxfr) = MR_sv(16);
	MR_GOTO_LAB(transform_hlds__loop_inv__inv_goals_vars_2_7_0_i2);
MR_def_label(transform_hlds__loop_inv__inv_goals_vars_2_7_0,34)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_redoip_slot_word(MR_maxfr) = MR_sv(15);
	MR_redofr_slot_word(MR_maxfr) = MR_sv(16);
	{
	MR_Word MR_tempr1, MR_tempr2, MR_tempr3, MR_tempr4;
	MR_tag_alloc_heap(MR_tempr1, 1, (MR_Integer) 2);
	MR_tempr4 = MR_sv(3);
	MR_tfield(1, MR_tempr1, 0) = MR_tempr4;
	MR_tfield(1, MR_tempr1, 1) = MR_sv(4);
	MR_tag_alloc_heap(MR_tempr2, 0, (MR_Integer) 4);
	MR_tfield(0, MR_tempr2, 0) = (MR_Word) MR_COMMON(1,17);
	MR_tfield(0, MR_tempr2, 1) = (MR_Word) MR_ENTRY_AP(transform_hlds__loop_inv__add_output_4_0);
	MR_tfield(0, MR_tempr2, 2) = (MR_Integer) 1;
	MR_tfield(0, MR_tempr2, 3) = MR_sv(2);
	MR_tempr3 = MR_sv(1);
	MR_sv(1) = MR_tempr1;
	MR_sv(2) = MR_tempr2;
	MR_r1 = MR_tempr3;
	MR_r2 = MR_tempr4;
	}
	MR_np_call_localret_ent(fn__transform_hlds__loop_inv__goal_outputs_2_0,
		transform_hlds__loop_inv__inv_goals_vars_2_7_0_i44);
MR_def_label(transform_hlds__loop_inv__inv_goals_vars_2_7_0,44)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r2 = (MR_Word) MR_TAG_COMMON(0,0,11);
	MR_r3 = MR_sv(2);
	MR_r4 = MR_tempr1;
	MR_r5 = MR_sv(5);
	}
	MR_np_call_localret_ent(list__foldl_4_0,
		transform_hlds__loop_inv__inv_goals_vars_2_7_0_i47);
MR_def_label(transform_hlds__loop_inv__inv_goals_vars_2_7_0,47)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(1);
	MR_r2 = MR_tempr1;
	MR_decr_sp_and_return(18);
	}
MR_def_label(transform_hlds__loop_inv__inv_goals_vars_2_7_0,2)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tempr1 = MR_sv(4);
	MR_tempr2 = MR_sv(5);
	MR_r1 = MR_tempr1;
	MR_r2 = MR_tempr2;
	MR_decr_sp_and_return(18);
	}
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(fn__hlds__hlds_goal__goal_get_purity_1_0);
MR_decl_entry(parse_tree__prog_data__determinism_components_3_0);
MR_decl_entry(check_hlds__inst_util__inst_contains_any_2_0);
MR_decl_entry(list__cons_3_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module33)
	MR_init_entry1(transform_hlds__loop_inv__do_not_hoist_2_6_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__transform_hlds__loop_inv__do_not_hoist_2_6_0);
	MR_init_label10(transform_hlds__loop_inv__do_not_hoist_2_6_0,10,6,13,17,16,20,21,19,24,26)
	MR_init_label10(transform_hlds__loop_inv__do_not_hoist_2_6_0,27,23,30,31,35,33,37,32,28,4)
	MR_init_label4(transform_hlds__loop_inv__do_not_hoist_2_6_0,40,41,2,3)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'do_not_hoist_2'/6 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(transform_hlds__loop_inv__do_not_hoist_2_6_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(9);
	MR_sv(9) = (MR_Word) MR_succip;
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tempr1 = MR_tfield(0, MR_r2, 0);
	MR_r5 = MR_tempr1;
	if (MR_PTAG_TESTR(MR_tempr1,0)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__do_not_hoist_2_6_0_i6);
	}
	MR_tempr2 = MR_tfield(0, MR_tempr1, 3);
	MR_r6 = MR_tempr2;
	if (MR_PTAG_TESTR(MR_tempr2,0)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__do_not_hoist_2_6_0_i6);
	}
	MR_r5 = MR_tfield(0, MR_tempr2, 4);
	MR_r7 = MR_tfield(0, MR_tempr2, 2);
	if (MR_LTAGS_TESTR(MR_r7,0,0)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__do_not_hoist_2_6_0_i10);
	}
	MR_sv(1) = MR_r1;
	MR_sv(4) = MR_r4;
	MR_GOTO_LAB(transform_hlds__loop_inv__do_not_hoist_2_6_0_i4);
	}
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,10)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_LTAGS_TESTR(MR_r5,0,0)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__do_not_hoist_2_6_0_i6);
	}
	MR_sv(1) = MR_r1;
	MR_sv(4) = MR_r4;
	MR_GOTO_LAB(transform_hlds__loop_inv__do_not_hoist_2_6_0_i4);
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,6)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_tfield(0, MR_r2, 0);
	MR_r5 = MR_tempr1;
	if (MR_PTAG_TESTR(MR_tempr1,0)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__do_not_hoist_2_6_0_i13);
	}
	MR_r6 = MR_tfield(0, MR_tempr1, 3);
	if (MR_PTAG_TESTR(MR_r6,1)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__do_not_hoist_2_6_0_i13);
	}
	MR_sv(1) = MR_r1;
	MR_sv(4) = MR_r4;
	MR_GOTO_LAB(transform_hlds__loop_inv__do_not_hoist_2_6_0_i4);
	}
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,13)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(1) = MR_r1;
	MR_sv(2) = MR_r2;
	MR_sv(3) = MR_r3;
	MR_sv(4) = MR_r4;
	MR_r1 = MR_r2;
	MR_np_call_localret_ent(fn__hlds__hlds_goal__goal_get_purity_1_0,
		transform_hlds__loop_inv__do_not_hoist_2_6_0_i17);
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,17)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_INT_NE(MR_r1,2)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__do_not_hoist_2_6_0_i16);
	}
	MR_r2 = MR_sv(2);
	MR_r3 = MR_sv(3);
	MR_GOTO_LAB(transform_hlds__loop_inv__do_not_hoist_2_6_0_i4);
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,16)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = MR_tfield(0, MR_sv(2), 1);
	MR_np_call_localret_ent(fn__hlds__hlds_goal__goal_info_get_determinism_1_0,
		transform_hlds__loop_inv__do_not_hoist_2_6_0_i20);
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,20)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_np_call_localret_ent(parse_tree__prog_data__determinism_components_3_0,
		transform_hlds__loop_inv__do_not_hoist_2_6_0_i21);
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,21)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_INT_NE(MR_r2,0)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__do_not_hoist_2_6_0_i19);
	}
	MR_r2 = MR_sv(2);
	MR_r3 = MR_sv(3);
	MR_GOTO_LAB(transform_hlds__loop_inv__do_not_hoist_2_6_0_i4);
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,19)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_tfield(0, MR_sv(2), 0);
	MR_r3 = MR_tempr1;
	if (MR_PTAG_TESTR(MR_tempr1,2)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__do_not_hoist_2_6_0_i24);
	}
	MR_r2 = MR_tfield(2, MR_tempr1, 2);
	MR_GOTO_LAB(transform_hlds__loop_inv__do_not_hoist_2_6_0_i23);
	}
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,24)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_PTAG_TESTR(MR_r3,1)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__do_not_hoist_2_6_0_i2);
	}
	MR_r1 = MR_sv(1);
	MR_r2 = MR_tfield(1, MR_r3, 0);
	MR_r3 = MR_tfield(1, MR_r3, 1);
	MR_np_call_localret_ent(hlds__hlds_module__module_info_pred_proc_info_5_0,
		transform_hlds__loop_inv__do_not_hoist_2_6_0_i26);
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,26)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = MR_r2;
	MR_np_call_localret_ent(hlds__hlds_pred__proc_info_get_argmodes_2_0,
		transform_hlds__loop_inv__do_not_hoist_2_6_0_i27);
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,27)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r2 = MR_r1;
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,23)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(6) = (MR_Word) MR_redoip_slot(MR_maxfr);
	MR_sv(7) = (MR_Word) MR_redofr_slot(MR_maxfr);
	MR_save_maxfr(MR_sv(8));
	MR_redofr_slot_word(MR_maxfr) = (MR_Word) MR_curfr;
	MR_redoip_slot_word(MR_maxfr) = (MR_Word) MR_LABEL_AP(transform_hlds__loop_inv__do_not_hoist_2_6_0_i28);
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(parse_tree__prog_data, mer_mode);
	MR_np_call_localret_ent(list__member_2_1,
		transform_hlds__loop_inv__do_not_hoist_2_6_0_i30);
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,30)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(1);
	MR_r2 = MR_tempr1;
	}
	MR_np_call_localret_ent(check_hlds__mode_util__mode_get_insts_4_0,
		transform_hlds__loop_inv__do_not_hoist_2_6_0_i31);
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,31)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(5) = MR_r2;
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(1);
	MR_r2 = MR_tempr1;
	}
	MR_np_call_localret_ent(check_hlds__inst_util__inst_contains_any_2_0,
		transform_hlds__loop_inv__do_not_hoist_2_6_0_i35);
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,35)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (!(MR_r1)) {
		MR_GOTO_LAB(transform_hlds__loop_inv__do_not_hoist_2_6_0_i33);
	}
	MR_r2 = MR_sv(2);
	MR_r3 = MR_sv(3);
	MR_GOTO_LAB(transform_hlds__loop_inv__do_not_hoist_2_6_0_i32);
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,33)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r2 = MR_sv(5);
	MR_r1 = MR_sv(1);
	MR_np_call_localret_ent(check_hlds__inst_util__inst_contains_any_2_0,
		transform_hlds__loop_inv__do_not_hoist_2_6_0_i37);
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,37)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (!(MR_r1)) {
		MR_GOTO(MR_ENTRY(MR_do_redo));
	}
	MR_r2 = MR_sv(2);
	MR_r3 = MR_sv(3);
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,32)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_restore_maxfr(MR_sv(8));
	MR_redoip_slot_word(MR_maxfr) = MR_sv(6);
	MR_redofr_slot_word(MR_maxfr) = MR_sv(7);
	MR_GOTO_LAB(transform_hlds__loop_inv__do_not_hoist_2_6_0_i4);
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,28)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r3 = MR_sv(3);
	MR_r4 = MR_sv(4);
	MR_redoip_slot_word(MR_maxfr) = MR_sv(6);
	MR_redofr_slot_word(MR_maxfr) = MR_sv(7);
	MR_GOTO_LAB(transform_hlds__loop_inv__do_not_hoist_2_6_0_i3);
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,4)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_sv(2) = MR_r2;
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_np_call_localret_ent(list__cons_3_0,
		transform_hlds__loop_inv__do_not_hoist_2_6_0_i40);
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,40)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_sv(1);
	MR_sv(1) = MR_r1;
	MR_r1 = MR_tempr1;
	MR_r2 = (MR_Word) MR_tbmkword(0, 0);
	MR_r3 = MR_sv(2);
	MR_r4 = MR_sv(4);
	}
	MR_np_call_localret_ent(transform_hlds__loop_inv__add_outputs_5_0,
		transform_hlds__loop_inv__do_not_hoist_2_6_0_i41);
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,41)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(1);
	MR_r2 = MR_tempr1;
	MR_decr_sp_and_return(9);
	}
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,2)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r3 = MR_sv(3);
	MR_r4 = MR_sv(4);
MR_def_label(transform_hlds__loop_inv__do_not_hoist_2_6_0,3)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = MR_r3;
	MR_r2 = MR_r4;
	MR_decr_sp_and_return(9);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE


MR_BEGIN_MODULE(transform_hlds__loop_inv_module34)
	MR_init_entry1(transform_hlds__loop_inv__add_output_4_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__transform_hlds__loop_inv__add_output_4_0);
	MR_init_label3(transform_hlds__loop_inv__add_output_4_0,6,10,2)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'add_output'/4 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(transform_hlds__loop_inv__add_output_4_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(4);
	MR_sv(4) = (MR_Word) MR_succip;
	MR_sv(1) = MR_r1;
	MR_sv(2) = MR_r2;
	MR_sv(3) = MR_r3;
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(parse_tree__prog_data, prog_var_type);
	MR_r2 = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r3 = MR_sv(2);
	MR_r4 = MR_sv(3);
	MR_np_call_localret_ent(f_108_105_115_116_95_95_84_121_112_101_83_112_101_99_79_102_95_95_112_114_101_100_95_95_109_101_109_98_101_114_95_95_91_84_32_61_32_118_97_114_40_86_95_50_41_93_95_48_95_49_2_0,
		transform_hlds__loop_inv__add_output_4_0_i6);
MR_def_label(transform_hlds__loop_inv__add_output_4_0,6)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_r1) {
		MR_GOTO_LAB(transform_hlds__loop_inv__add_output_4_0_i2);
	}
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(parse_tree__prog_data, prog_var_type);
	MR_r2 = (MR_Word) MR_TAG_COMMON(0,0,0);
	MR_r3 = MR_sv(2);
	MR_r4 = MR_sv(1);
	MR_np_call_localret_ent(f_108_105_115_116_95_95_84_121_112_101_83_112_101_99_79_102_95_95_112_114_101_100_95_95_109_101_109_98_101_114_95_95_91_84_32_61_32_118_97_114_40_86_95_50_41_93_95_48_95_49_2_0,
		transform_hlds__loop_inv__add_output_4_0_i10);
MR_def_label(transform_hlds__loop_inv__add_output_4_0,10)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_r1) {
		MR_GOTO_LAB(transform_hlds__loop_inv__add_output_4_0_i2);
	}
	MR_tag_alloc_heap(MR_r1, 1, (MR_Integer) 2);
	MR_tfield(1, MR_r1, 0) = MR_sv(2);
	MR_tfield(1, MR_r1, 1) = MR_sv(3);
	MR_decr_sp_and_return(4);
MR_def_label(transform_hlds__loop_inv__add_output_4_0,2)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_sv(3);
	MR_r1 = MR_tempr1;
	MR_decr_sp_and_return(4);
	}
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE


MR_BEGIN_MODULE(transform_hlds__loop_inv_module35)
	MR_init_entry1(fn__transform_hlds__loop_inv__gen_aux_proc_case_2_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__gen_aux_proc_case_2_0);
	MR_init_label1(fn__transform_hlds__loop_inv__gen_aux_proc_case_2_0,2)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'gen_aux_proc_case'/3 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__gen_aux_proc_case_2_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(3);
	MR_sv(3) = (MR_Word) MR_succip;
	MR_sv(1) = MR_tfield(0, MR_r2, 0);
	MR_sv(2) = MR_tfield(0, MR_r2, 1);
	MR_r2 = MR_tfield(0, MR_r2, 2);
	MR_np_call_localret_ent(fn__transform_hlds__loop_inv__gen_aux_proc_goal_2_0,
		fn__transform_hlds__loop_inv__gen_aux_proc_case_2_0_i2);
MR_def_label(fn__transform_hlds__loop_inv__gen_aux_proc_case_2_0,2)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_tag_alloc_heap(MR_r2, 0, (MR_Integer) 3);
	MR_tfield(0, MR_r2, 0) = MR_sv(1);
	MR_tfield(0, MR_r2, 1) = MR_sv(2);
	MR_tfield(0, MR_r2, 2) = MR_r1;
	MR_r1 = MR_r2;
	MR_decr_sp_and_return(3);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE


MR_BEGIN_MODULE(transform_hlds__loop_inv_module36)
	MR_init_entry1(fn__transform_hlds__loop_inv__gen_out_proc_case_3_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__gen_out_proc_case_3_0);
	MR_init_label1(fn__transform_hlds__loop_inv__gen_out_proc_case_3_0,2)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'gen_out_proc_case'/4 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__gen_out_proc_case_3_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(3);
	MR_sv(3) = (MR_Word) MR_succip;
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r3;
	MR_sv(1) = MR_tfield(0, MR_tempr1, 0);
	MR_sv(2) = MR_tfield(0, MR_tempr1, 1);
	MR_r3 = MR_tfield(0, MR_r3, 2);
	}
	MR_np_call_localret_ent(fn__transform_hlds__loop_inv__gen_out_proc_goal_3_0,
		fn__transform_hlds__loop_inv__gen_out_proc_case_3_0_i2);
MR_def_label(fn__transform_hlds__loop_inv__gen_out_proc_case_3_0,2)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_tag_alloc_heap(MR_r2, 0, (MR_Integer) 3);
	MR_tfield(0, MR_r2, 0) = MR_sv(1);
	MR_tfield(0, MR_r2, 1) = MR_sv(2);
	MR_tfield(0, MR_r2, 2) = MR_r1;
	MR_r1 = MR_r2;
	MR_decr_sp_and_return(3);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(check_hlds__inst_match__inst_is_not_partly_unique_2_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module37)
	MR_init_entry1(fn__transform_hlds__loop_inv__uniquely_used_args_3_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__uniquely_used_args_3_0);
	MR_init_label3(fn__transform_hlds__loop_inv__uniquely_used_args_3_0,2,5,1)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'uniquely_used_args'/4 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__uniquely_used_args_3_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(3);
	MR_sv(3) = (MR_Word) MR_succip;
	MR_sv(1) = MR_r2;
	MR_sv(2) = MR_r1;
	MR_r2 = MR_r3;
	MR_np_call_localret_ent(check_hlds__mode_util__mode_get_insts_4_0,
		fn__transform_hlds__loop_inv__uniquely_used_args_3_0_i2);
MR_def_label(fn__transform_hlds__loop_inv__uniquely_used_args_3_0,2)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(2);
	MR_r2 = MR_tempr1;
	}
	MR_np_call_localret_ent(check_hlds__inst_match__inst_is_not_partly_unique_2_0,
		fn__transform_hlds__loop_inv__uniquely_used_args_3_0_i5);
MR_def_label(fn__transform_hlds__loop_inv__uniquely_used_args_3_0,5)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_r1) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__uniquely_used_args_3_0_i1);
	}
	MR_r2 = MR_sv(1);
	MR_succip_word = MR_sv(3);
	MR_decr_sp(3);
	MR_r1 = MR_TRUE;
	MR_proceed();
MR_def_label(fn__transform_hlds__loop_inv__uniquely_used_args_3_0,1)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_succip_word = MR_sv(3);
	MR_decr_sp(3);
	MR_r1 = MR_FALSE;
	MR_proceed();
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(check_hlds__mode_util__mode_is_fully_output_2_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module38)
	MR_init_entry1(fn__transform_hlds__loop_inv__output_arg_3_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__output_arg_3_0);
	MR_init_label2(fn__transform_hlds__loop_inv__output_arg_3_0,2,1)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'output_arg'/4 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__output_arg_3_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(2);
	MR_sv(2) = (MR_Word) MR_succip;
	MR_sv(1) = MR_r2;
	MR_r2 = MR_r3;
	MR_np_call_localret_ent(check_hlds__mode_util__mode_is_fully_output_2_0,
		fn__transform_hlds__loop_inv__output_arg_3_0_i2);
MR_def_label(fn__transform_hlds__loop_inv__output_arg_3_0,2)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (!(MR_r1)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__output_arg_3_0_i1);
	}
	MR_r2 = MR_sv(1);
	MR_succip_word = MR_sv(2);
	MR_decr_sp(2);
	MR_r1 = MR_TRUE;
	MR_proceed();
MR_def_label(fn__transform_hlds__loop_inv__output_arg_3_0,1)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_succip_word = MR_sv(2);
	MR_decr_sp(2);
	MR_r1 = MR_FALSE;
	MR_proceed();
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(__Unify___hlds__hlds_module__module_info_0_0);
MR_decl_entry(__Unify___hlds__hlds_goal__hlds_goal_0_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module39)
	MR_init_entry1(__Unify___transform_hlds__loop_inv__gen_aux_proc_info_0_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury____Unify___transform_hlds__loop_inv__gen_aux_proc_info_0_0);
	MR_init_label5(__Unify___transform_hlds__loop_inv__gen_aux_proc_info_0_0,4,6,8,12,1)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for '__Unify__'/2 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(__Unify___transform_hlds__loop_inv__gen_aux_proc_info_0_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if ((MR_r1 == MR_r2)) {
		MR_GOTO_LAB(__Unify___transform_hlds__loop_inv__gen_aux_proc_info_0_0_i12);
	}
	MR_incr_sp(7);
	MR_sv(7) = (MR_Word) MR_succip;
	MR_sv(1) = MR_r1;
	MR_sv(2) = MR_r2;
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tempr1 = MR_sv(1);
	MR_sv(1) = MR_tfield(0, MR_tempr1, 1);
	MR_tempr2 = MR_sv(2);
	MR_sv(2) = MR_tfield(0, MR_tempr1, 2);
	MR_sv(3) = MR_tfield(0, MR_tempr1, 3);
	MR_sv(4) = MR_tfield(0, MR_tempr2, 1);
	MR_sv(5) = MR_tfield(0, MR_tempr2, 2);
	MR_sv(6) = MR_tfield(0, MR_tempr2, 3);
	MR_r1 = MR_tfield(0, MR_tempr1, 0);
	MR_r2 = MR_tfield(0, MR_tempr2, 0);
	}
	MR_np_call_localret_ent(__Unify___hlds__hlds_module__module_info_0_0,
		__Unify___transform_hlds__loop_inv__gen_aux_proc_info_0_0_i4);
MR_def_label(__Unify___transform_hlds__loop_inv__gen_aux_proc_info_0_0,4)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (!(MR_r1)) {
		MR_GOTO_LAB(__Unify___transform_hlds__loop_inv__gen_aux_proc_info_0_0_i1);
	}
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r2 = MR_sv(1);
	MR_r3 = MR_sv(4);
	MR_np_call_localret_ent(__Unify___list__list_1_0,
		__Unify___transform_hlds__loop_inv__gen_aux_proc_info_0_0_i6);
MR_def_label(__Unify___transform_hlds__loop_inv__gen_aux_proc_info_0_0,6)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (!(MR_r1)) {
		MR_GOTO_LAB(__Unify___transform_hlds__loop_inv__gen_aux_proc_info_0_0_i1);
	}
	MR_r1 = MR_sv(2);
	MR_r2 = MR_sv(5);
	MR_np_call_localret_ent(__Unify___hlds__hlds_pred__pred_proc_id_0_0,
		__Unify___transform_hlds__loop_inv__gen_aux_proc_info_0_0_i8);
MR_def_label(__Unify___transform_hlds__loop_inv__gen_aux_proc_info_0_0,8)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (!(MR_r1)) {
		MR_GOTO_LAB(__Unify___transform_hlds__loop_inv__gen_aux_proc_info_0_0_i1);
	}
	MR_r1 = MR_sv(3);
	MR_r2 = MR_sv(6);
	MR_succip_word = MR_sv(7);
	MR_decr_sp(7);
	MR_np_tailcall_ent(__Unify___hlds__hlds_goal__hlds_goal_0_0);
MR_def_label(__Unify___transform_hlds__loop_inv__gen_aux_proc_info_0_0,12)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = MR_TRUE;
	MR_proceed();
MR_def_label(__Unify___transform_hlds__loop_inv__gen_aux_proc_info_0_0,1)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = MR_FALSE;
	MR_decr_sp_and_return(7);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(__Compare___hlds__hlds_module__module_info_0_0);
MR_decl_entry(__Compare___list__list_1_0);
MR_decl_entry(__Compare___hlds__hlds_pred__pred_proc_id_0_0);
MR_decl_entry(__Compare___hlds__hlds_goal__hlds_goal_0_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module40)
	MR_init_entry1(__Compare___transform_hlds__loop_inv__gen_aux_proc_info_0_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury____Compare___transform_hlds__loop_inv__gen_aux_proc_info_0_0);
	MR_init_label6(__Compare___transform_hlds__loop_inv__gen_aux_proc_info_0_0,3,2,5,9,13,37)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for '__Compare__'/3 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(__Compare___transform_hlds__loop_inv__gen_aux_proc_info_0_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if ((MR_r1 == MR_r2)) {
		MR_GOTO_LAB(__Compare___transform_hlds__loop_inv__gen_aux_proc_info_0_0_i3);
	}
	MR_incr_sp(7);
	MR_sv(7) = (MR_Word) MR_succip;
	MR_sv(1) = MR_r1;
	MR_sv(2) = MR_r2;
	MR_GOTO_LAB(__Compare___transform_hlds__loop_inv__gen_aux_proc_info_0_0_i2);
MR_def_label(__Compare___transform_hlds__loop_inv__gen_aux_proc_info_0_0,3)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = (MR_Integer) 0;
	MR_proceed();
MR_def_label(__Compare___transform_hlds__loop_inv__gen_aux_proc_info_0_0,2)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2, MR_tempr3, MR_tempr4, MR_tempr5, MR_tempr6;
	MR_tempr5 = MR_sv(2);
	MR_sv(6) = MR_tfield(0, MR_tempr5, 3);
	MR_sv(5) = MR_tfield(0, MR_tempr5, 2);
	MR_sv(4) = MR_tfield(0, MR_tempr5, 1);
	MR_tempr6 = MR_sv(1);
	MR_sv(3) = MR_tfield(0, MR_tempr6, 3);
	MR_tempr1 = MR_tfield(0, MR_tempr6, 2);
	MR_tempr2 = MR_tfield(0, MR_tempr6, 1);
	MR_tempr3 = MR_tempr6;
	MR_sv(1) = MR_tempr2;
	MR_tempr4 = MR_tempr5;
	MR_sv(2) = MR_tempr1;
	MR_r1 = MR_tfield(0, MR_tempr3, 0);
	MR_r2 = MR_tfield(0, MR_tempr4, 0);
	}
	MR_np_call_localret_ent(__Compare___hlds__hlds_module__module_info_0_0,
		__Compare___transform_hlds__loop_inv__gen_aux_proc_info_0_0_i5);
MR_def_label(__Compare___transform_hlds__loop_inv__gen_aux_proc_info_0_0,5)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_INT_NE(MR_r1,0)) {
		MR_GOTO_LAB(__Compare___transform_hlds__loop_inv__gen_aux_proc_info_0_0_i37);
	}
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r2 = MR_sv(1);
	MR_r3 = MR_sv(4);
	MR_np_call_localret_ent(__Compare___list__list_1_0,
		__Compare___transform_hlds__loop_inv__gen_aux_proc_info_0_0_i9);
MR_def_label(__Compare___transform_hlds__loop_inv__gen_aux_proc_info_0_0,9)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_INT_NE(MR_r1,0)) {
		MR_GOTO_LAB(__Compare___transform_hlds__loop_inv__gen_aux_proc_info_0_0_i37);
	}
	MR_r1 = MR_sv(2);
	MR_r2 = MR_sv(5);
	MR_np_call_localret_ent(__Compare___hlds__hlds_pred__pred_proc_id_0_0,
		__Compare___transform_hlds__loop_inv__gen_aux_proc_info_0_0_i13);
MR_def_label(__Compare___transform_hlds__loop_inv__gen_aux_proc_info_0_0,13)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_INT_NE(MR_r1,0)) {
		MR_GOTO_LAB(__Compare___transform_hlds__loop_inv__gen_aux_proc_info_0_0_i37);
	}
	MR_r1 = MR_sv(3);
	MR_r2 = MR_sv(6);
	MR_succip_word = MR_sv(7);
	MR_decr_sp(7);
	MR_np_tailcall_ent(__Compare___hlds__hlds_goal__hlds_goal_0_0);
MR_def_label(__Compare___transform_hlds__loop_inv__gen_aux_proc_info_0_0,37)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_decr_sp_and_return(7);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(__Unify___cord__cord_1_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module41)
	MR_init_entry1(__Unify___transform_hlds__loop_inv__igc_info_0_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury____Unify___transform_hlds__loop_inv__igc_info_0_0);
	MR_init_label4(__Unify___transform_hlds__loop_inv__igc_info_0_0,4,6,12,1)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for '__Unify__'/2 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(__Unify___transform_hlds__loop_inv__igc_info_0_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if ((MR_r1 == MR_r2)) {
		MR_GOTO_LAB(__Unify___transform_hlds__loop_inv__igc_info_0_0_i12);
	}
	MR_incr_sp(5);
	MR_sv(5) = (MR_Word) MR_succip;
	MR_sv(1) = MR_r1;
	MR_sv(2) = MR_r2;
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tempr1 = MR_sv(1);
	MR_sv(1) = MR_tfield(0, MR_tempr1, 1);
	MR_tempr2 = MR_sv(2);
	MR_sv(2) = MR_tfield(0, MR_tempr1, 2);
	MR_sv(3) = MR_tfield(0, MR_tempr2, 1);
	MR_sv(4) = MR_tfield(0, MR_tempr2, 2);
	MR_r1 = MR_tfield(0, MR_tempr1, 0);
	MR_r2 = MR_tfield(0, MR_tempr2, 0);
	}
	MR_np_call_localret_ent(__Unify___hlds__hlds_module__module_info_0_0,
		__Unify___transform_hlds__loop_inv__igc_info_0_0_i4);
MR_def_label(__Unify___transform_hlds__loop_inv__igc_info_0_0,4)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (!(MR_r1)) {
		MR_GOTO_LAB(__Unify___transform_hlds__loop_inv__igc_info_0_0_i1);
	}
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r2 = MR_sv(1);
	MR_r3 = MR_sv(3);
	MR_np_call_localret_ent(__Unify___cord__cord_1_0,
		__Unify___transform_hlds__loop_inv__igc_info_0_0_i6);
MR_def_label(__Unify___transform_hlds__loop_inv__igc_info_0_0,6)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (!(MR_r1)) {
		MR_GOTO_LAB(__Unify___transform_hlds__loop_inv__igc_info_0_0_i1);
	}
	MR_r1 = (MR_Word) MR_TAG_COMMON(0,7,0);
	MR_r2 = MR_sv(2);
	MR_r3 = MR_sv(4);
	MR_succip_word = MR_sv(5);
	MR_decr_sp(5);
	MR_np_tailcall_ent(__Unify___list__list_1_0);
MR_def_label(__Unify___transform_hlds__loop_inv__igc_info_0_0,12)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = MR_TRUE;
	MR_proceed();
MR_def_label(__Unify___transform_hlds__loop_inv__igc_info_0_0,1)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = MR_FALSE;
	MR_decr_sp_and_return(5);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(__Compare___cord__cord_1_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module42)
	MR_init_entry1(__Compare___transform_hlds__loop_inv__igc_info_0_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury____Compare___transform_hlds__loop_inv__igc_info_0_0);
	MR_init_label5(__Compare___transform_hlds__loop_inv__igc_info_0_0,3,2,5,9,40)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for '__Compare__'/3 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(__Compare___transform_hlds__loop_inv__igc_info_0_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if ((MR_r1 == MR_r2)) {
		MR_GOTO_LAB(__Compare___transform_hlds__loop_inv__igc_info_0_0_i3);
	}
	MR_incr_sp(5);
	MR_sv(5) = (MR_Word) MR_succip;
	MR_sv(1) = MR_r1;
	MR_sv(2) = MR_r2;
	MR_GOTO_LAB(__Compare___transform_hlds__loop_inv__igc_info_0_0_i2);
MR_def_label(__Compare___transform_hlds__loop_inv__igc_info_0_0,3)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = (MR_Integer) 0;
	MR_proceed();
MR_def_label(__Compare___transform_hlds__loop_inv__igc_info_0_0,2)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2, MR_tempr3, MR_tempr4, MR_tempr5, MR_tempr6;
	MR_tempr5 = MR_sv(2);
	MR_sv(4) = MR_tfield(0, MR_tempr5, 2);
	MR_sv(3) = MR_tfield(0, MR_tempr5, 1);
	MR_tempr6 = MR_sv(1);
	MR_tempr1 = MR_tfield(0, MR_tempr6, 2);
	MR_tempr2 = MR_tfield(0, MR_tempr6, 1);
	MR_tempr3 = MR_tempr6;
	MR_sv(1) = MR_tempr2;
	MR_tempr4 = MR_tempr5;
	MR_sv(2) = MR_tempr1;
	MR_r1 = MR_tfield(0, MR_tempr3, 0);
	MR_r2 = MR_tfield(0, MR_tempr4, 0);
	}
	MR_np_call_localret_ent(__Compare___hlds__hlds_module__module_info_0_0,
		__Compare___transform_hlds__loop_inv__igc_info_0_0_i5);
MR_def_label(__Compare___transform_hlds__loop_inv__igc_info_0_0,5)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_INT_NE(MR_r1,0)) {
		MR_GOTO_LAB(__Compare___transform_hlds__loop_inv__igc_info_0_0_i40);
	}
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_r2 = MR_sv(1);
	MR_r3 = MR_sv(3);
	MR_np_call_localret_ent(__Compare___cord__cord_1_0,
		__Compare___transform_hlds__loop_inv__igc_info_0_0_i9);
MR_def_label(__Compare___transform_hlds__loop_inv__igc_info_0_0,9)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_INT_NE(MR_r1,0)) {
		MR_GOTO_LAB(__Compare___transform_hlds__loop_inv__igc_info_0_0_i40);
	}
	MR_r1 = (MR_Word) MR_TAG_COMMON(0,7,0);
	MR_r2 = MR_sv(2);
	MR_r3 = MR_sv(4);
	MR_succip_word = MR_sv(5);
	MR_decr_sp(5);
	MR_np_tailcall_ent(__Compare___list__list_1_0);
MR_def_label(__Compare___transform_hlds__loop_inv__igc_info_0_0,40)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_decr_sp_and_return(5);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(builtin__unify_2_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module43)
	MR_init_entry1(__Unify___transform_hlds__loop_inv__inst_info_0_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury____Unify___transform_hlds__loop_inv__inst_info_0_0);
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for '__Unify__'/2 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(__Unify___transform_hlds__loop_inv__inst_info_0_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tempr1 = MR_r1;
	MR_r1 = (MR_Word) MR_TAG_COMMON(0,8,0);
	MR_tempr2 = MR_r2;
	MR_r2 = MR_tempr1;
	MR_r3 = MR_tempr2;
	MR_np_tailcall_ent(builtin__unify_2_0);
	}
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(builtin__compare_3_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module44)
	MR_init_entry1(__Compare___transform_hlds__loop_inv__inst_info_0_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury____Compare___transform_hlds__loop_inv__inst_info_0_0);
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for '__Compare__'/3 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(__Compare___transform_hlds__loop_inv__inst_info_0_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tempr1 = MR_r1;
	MR_r1 = (MR_Word) MR_TAG_COMMON(0,8,0);
	MR_tempr2 = MR_r2;
	MR_r2 = MR_tempr1;
	MR_r3 = MR_tempr2;
	MR_np_tailcall_ent(builtin__compare_3_0);
	}
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(__Unify___pair__pair_2_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module45)
	MR_init_entry1(__Unify___transform_hlds__loop_inv__rec_call_0_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury____Unify___transform_hlds__loop_inv__rec_call_0_0);
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for '__Unify__'/2 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(__Unify___transform_hlds__loop_inv__rec_call_0_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tempr1 = MR_r1;
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_tempr2 = MR_r2;
	MR_r2 = (MR_Word) MR_TAG_COMMON(0,0,10);
	MR_r3 = MR_tempr1;
	MR_r4 = MR_tempr2;
	MR_np_tailcall_ent(__Unify___pair__pair_2_0);
	}
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(__Compare___pair__pair_2_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module46)
	MR_init_entry1(__Compare___transform_hlds__loop_inv__rec_call_0_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury____Compare___transform_hlds__loop_inv__rec_call_0_0);
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for '__Compare__'/3 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(__Compare___transform_hlds__loop_inv__rec_call_0_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1, MR_tempr2;
	MR_tempr1 = MR_r1;
	MR_r1 = (MR_Word) MR_CTOR0_ADDR(hlds__hlds_goal, hlds_goal);
	MR_tempr2 = MR_r2;
	MR_r2 = (MR_Word) MR_TAG_COMMON(0,0,10);
	MR_r3 = MR_tempr1;
	MR_r4 = MR_tempr2;
	MR_np_tailcall_ent(__Compare___pair__pair_2_0);
	}
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE


MR_BEGIN_MODULE(transform_hlds__loop_inv_module47)
	MR_init_entry1(fn__transform_hlds__loop_inv__IntroducedFrom__func__inv_args__490__1_1_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__IntroducedFrom__func__inv_args__490__1_1_0);
	MR_init_label1(fn__transform_hlds__loop_inv__IntroducedFrom__func__inv_args__490__1_1_0,1)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'IntroducedFrom__func__inv_args__490__1'/2 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__IntroducedFrom__func__inv_args__490__1_1_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_LTAGS_TEST(MR_r1,0,0)) {
		MR_GOTO_LAB(fn__transform_hlds__loop_inv__IntroducedFrom__func__inv_args__490__1_1_0_i1);
	}
	MR_r2 = MR_tfield(1, MR_r1, 0);
	MR_r1 = MR_TRUE;
	MR_proceed();
MR_def_label(fn__transform_hlds__loop_inv__IntroducedFrom__func__inv_args__490__1_1_0,1)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = MR_FALSE;
	MR_proceed();
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

MR_decl_entry(hlds__instmap__apply_instmap_delta_3_0);

MR_BEGIN_MODULE(transform_hlds__loop_inv_module48)
	MR_init_entry1(fn__transform_hlds__loop_inv__IntroducedFrom__func__compute_initial_aux_instmap__736__1_2_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__IntroducedFrom__func__compute_initial_aux_instmap__736__1_2_0);
	MR_init_label1(fn__transform_hlds__loop_inv__IntroducedFrom__func__compute_initial_aux_instmap__736__1_2_0,2)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'IntroducedFrom__func__compute_initial_aux_instmap__736__1'/3 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__IntroducedFrom__func__compute_initial_aux_instmap__736__1_2_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_incr_sp(2);
	MR_sv(2) = (MR_Word) MR_succip;
	MR_sv(1) = MR_r2;
	MR_r1 = MR_tfield(0, MR_r1, 1);
	MR_np_call_localret_ent(fn__hlds__hlds_goal__goal_info_get_instmap_delta_1_0,
		fn__transform_hlds__loop_inv__IntroducedFrom__func__compute_initial_aux_instmap__736__1_2_0_i2);
MR_def_label(fn__transform_hlds__loop_inv__IntroducedFrom__func__compute_initial_aux_instmap__736__1_2_0,2)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tempr1 = MR_r1;
	MR_r1 = MR_sv(1);
	MR_r2 = MR_tempr1;
	MR_succip_word = MR_sv(2);
	MR_decr_sp(2);
	MR_np_tailcall_ent(hlds__instmap__apply_instmap_delta_3_0);
	}
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE


MR_BEGIN_MODULE(transform_hlds__loop_inv_module49)
	MR_init_entry1(fn__transform_hlds__loop_inv__IntroducedFrom__func__case_goals__1148__1_1_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__IntroducedFrom__func__case_goals__1148__1_1_0);
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'IntroducedFrom__func__case_goals__1148__1'/2 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__IntroducedFrom__func__case_goals__1148__1_1_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = MR_tfield(0, MR_r1, 2);
	MR_proceed();
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE


MR_BEGIN_MODULE(transform_hlds__loop_inv_module50)
	MR_init_entry1(fn__transform_hlds__loop_inv__IntroducedFrom__func__rhs_modes__1321__1_1_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__transform_hlds__loop_inv__IntroducedFrom__func__rhs_modes__1321__1_1_0);
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'IntroducedFrom__func__rhs_modes__1321__1'/2 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__transform_hlds__loop_inv__IntroducedFrom__func__rhs_modes__1321__1_1_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_tag_alloc_heap(MR_r2, 0, (MR_Integer) 2);
	MR_tfield(0, MR_r2, 0) = MR_tfield(0, MR_tfield(0, MR_r1, 0), 1);
	MR_tfield(0, MR_r2, 1) = MR_tfield(0, MR_tfield(0, MR_r1, 1), 1);
	MR_r1 = MR_r2;
	MR_proceed();
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE


MR_BEGIN_MODULE(transform_hlds__loop_inv_module51)
	MR_init_entry1(fn__f_116_114_97_110_115_102_111_114_109_95_104_108_100_115_95_95_108_111_111_112_95_105_110_118_95_95_85_110_117_115_101_100_65_114_103_115_95_95_102_117_110_99_95_95_114_101_112_108_97_99_101_95_105_110_105_116_105_97_108_95_97_114_103_115_95_95_91_49_93_95_48_2_0);
	MR_INIT_PROC_LAYOUT_ADDR(mercury__fn__f_116_114_97_110_115_102_111_114_109_95_104_108_100_115_95_95_108_111_111_112_95_105_110_118_95_95_85_110_117_115_101_100_65_114_103_115_95_95_102_117_110_99_95_95_114_101_112_108_97_99_101_95_105_110_105_116_105_97_108_95_97_114_103_115_95_95_91_49_93_95_48_2_0);
	MR_init_label3(fn__f_116_114_97_110_115_102_111_114_109_95_104_108_100_115_95_95_108_111_111_112_95_105_110_118_95_95_85_110_117_115_101_100_65_114_103_115_95_95_102_117_110_99_95_95_114_101_112_108_97_99_101_95_105_110_105_116_105_97_108_95_97_114_103_115_95_95_91_49_93_95_48_2_0,3,6,5)
MR_BEGIN_CODE

/*-------------------------------------------------------------------------*/
/* code for 'UnusedArgs__func__replace_initial_args__[1]_0'/3 mode 0 */
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_local_thread_engine_base
#endif
MR_def_static(fn__f_116_114_97_110_115_102_111_114_109_95_104_108_100_115_95_95_108_111_111_112_95_105_110_118_95_95_85_110_117_115_101_100_65_114_103_115_95_95_102_117_110_99_95_95_114_101_112_108_97_99_101_95_105_110_105_116_105_97_108_95_97_114_103_115_95_95_91_49_93_95_48_2_0)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_LTAGS_TESTR(MR_r1,0,0)) {
		MR_GOTO_LAB(fn__f_116_114_97_110_115_102_111_114_109_95_104_108_100_115_95_95_108_111_111_112_95_105_110_118_95_95_85_110_117_115_101_100_65_114_103_115_95_95_102_117_110_99_95_95_114_101_112_108_97_99_101_95_105_110_105_116_105_97_108_95_97_114_103_115_95_95_91_49_93_95_48_2_0_i3);
	}
	MR_r1 = MR_r2;
	MR_proceed();
MR_def_label(fn__f_116_114_97_110_115_102_111_114_109_95_104_108_100_115_95_95_108_111_111_112_95_105_110_118_95_95_85_110_117_115_101_100_65_114_103_115_95_95_102_117_110_99_95_95_114_101_112_108_97_99_101_95_105_110_105_116_105_97_108_95_97_114_103_115_95_95_91_49_93_95_48_2_0,3)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	if (MR_LTAGS_TEST(MR_r2,0,0)) {
		MR_GOTO_LAB(fn__f_116_114_97_110_115_102_111_114_109_95_104_108_100_115_95_95_108_111_111_112_95_105_110_118_95_95_85_110_117_115_101_100_65_114_103_115_95_95_102_117_110_99_95_95_114_101_112_108_97_99_101_95_105_110_105_116_105_97_108_95_97_114_103_115_95_95_91_49_93_95_48_2_0_i5);
	}
	MR_incr_sp(2);
	MR_sv(2) = (MR_Word) MR_succip;
	MR_sv(1) = MR_tfield(1, MR_r1, 0);
	MR_r1 = MR_tfield(1, MR_r1, 1);
	MR_r2 = MR_tfield(1, MR_r2, 1);
	MR_np_localcall_lab(fn__f_116_114_97_110_115_102_111_114_109_95_104_108_100_115_95_95_108_111_111_112_95_105_110_118_95_95_85_110_117_115_101_100_65_114_103_115_95_95_102_117_110_99_95_95_114_101_112_108_97_99_101_95_105_110_105_116_105_97_108_95_97_114_103_115_95_95_91_49_93_95_48_2_0,
		fn__f_116_114_97_110_115_102_111_114_109_95_104_108_100_115_95_95_108_111_111_112_95_105_110_118_95_95_85_110_117_115_101_100_65_114_103_115_95_95_102_117_110_99_95_95_114_101_112_108_97_99_101_95_105_110_105_116_105_97_108_95_97_114_103_115_95_95_91_49_93_95_48_2_0_i6);
MR_def_label(fn__f_116_114_97_110_115_102_111_114_109_95_104_108_100_115_95_95_108_111_111_112_95_105_110_118_95_95_85_110_117_115_101_100_65_114_103_115_95_95_102_117_110_99_95_95_114_101_112_108_97_99_101_95_105_110_105_116_105_97_108_95_97_114_103_115_95_95_91_49_93_95_48_2_0,6)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	{
	MR_Word MR_tempr1;
	MR_tag_alloc_heap(MR_tempr1, 1, (MR_Integer) 2);
	MR_tfield(1, MR_tempr1, 0) = MR_sv(1);
	MR_tfield(1, MR_tempr1, 1) = MR_r1;
	MR_r1 = MR_tempr1;
	MR_decr_sp_and_return(2);
	}
MR_def_label(fn__f_116_114_97_110_115_102_111_114_109_95_104_108_100_115_95_95_108_111_111_112_95_105_110_118_95_95_85_110_117_115_101_100_65_114_103_115_95_95_102_117_110_99_95_95_114_101_112_108_97_99_101_95_105_110_105_116_105_97_108_95_97_114_103_115_95_95_91_49_93_95_48_2_0,5)
	MR_MAYBE_INIT_LOCAL_THREAD_ENGINE_BASE
	MR_r1 = (MR_Word) MR_string_const("transform_hlds.loop_inv", 23);
	MR_r2 = (MR_Word) MR_string_const("function \140transform_hlds.loop_inv.replace_initial_args\'/2", 57);
	MR_r3 = (MR_Word) MR_string_const("first arg longer than second", 28);
	MR_np_tailcall_ent(require__unexpected_3_0);
#ifdef MR_maybe_local_thread_engine_base
	#undef MR_maybe_local_thread_engine_base
	#define MR_maybe_local_thread_engine_base MR_thread_engine_base
#endif
MR_END_MODULE

static void mercury__transform_hlds__loop_inv_maybe_bunch_0(void)
{
	transform_hlds__loop_inv_module0();
	transform_hlds__loop_inv_module1();
	transform_hlds__loop_inv_module2();
	transform_hlds__loop_inv_module3();
	transform_hlds__loop_inv_module4();
	transform_hlds__loop_inv_module5();
	transform_hlds__loop_inv_module6();
	transform_hlds__loop_inv_module7();
	transform_hlds__loop_inv_module8();
	transform_hlds__loop_inv_module9();
	transform_hlds__loop_inv_module10();
	transform_hlds__loop_inv_module11();
	transform_hlds__loop_inv_module12();
	transform_hlds__loop_inv_module13();
	transform_hlds__loop_inv_module14();
	transform_hlds__loop_inv_module15();
	transform_hlds__loop_inv_module16();
	transform_hlds__loop_inv_module17();
	transform_hlds__loop_inv_module18();
	transform_hlds__loop_inv_module19();
	transform_hlds__loop_inv_module20();
	transform_hlds__loop_inv_module21();
	transform_hlds__loop_inv_module22();
	transform_hlds__loop_inv_module23();
	transform_hlds__loop_inv_module24();
	transform_hlds__loop_inv_module25();
	transform_hlds__loop_inv_module26();
	transform_hlds__loop_inv_module27();
	transform_hlds__loop_inv_module28();
	transform_hlds__loop_inv_module29();
	transform_hlds__loop_inv_module30();
	transform_hlds__loop_inv_module31();
	transform_hlds__loop_inv_module32();
	transform_hlds__loop_inv_module33();
	transform_hlds__loop_inv_module34();
	transform_hlds__loop_inv_module35();
	transform_hlds__loop_inv_module36();
	transform_hlds__loop_inv_module37();
	transform_hlds__loop_inv_module38();
	transform_hlds__loop_inv_module39();
}

static void mercury__transform_hlds__loop_inv_maybe_bunch_1(void)
{
	transform_hlds__loop_inv_module40();
	transform_hlds__loop_inv_module41();
	transform_hlds__loop_inv_module42();
	transform_hlds__loop_inv_module43();
	transform_hlds__loop_inv_module44();
	transform_hlds__loop_inv_module45();
	transform_hlds__loop_inv_module46();
	transform_hlds__loop_inv_module47();
	transform_hlds__loop_inv_module48();
	transform_hlds__loop_inv_module49();
	transform_hlds__loop_inv_module50();
	transform_hlds__loop_inv_module51();
}

/* suppress gcc -Wmissing-decls warnings */
void mercury__transform_hlds__loop_inv__init(void);
void mercury__transform_hlds__loop_inv__init_type_tables(void);
void mercury__transform_hlds__loop_inv__init_debugger(void);
#ifdef MR_DEEP_PROFILING
void mercury__transform_hlds__loop_inv__write_out_proc_statics(FILE *deep_fp, FILE *procrep_fp);
#endif
#ifdef MR_RECORD_TERM_SIZES
void mercury__transform_hlds__loop_inv__init_complexity_procs(void);
#endif
#ifdef MR_THREADSCOPE
void mercury__transform_hlds__loop_inv__init_threadscope_string_table(void);
#endif

void mercury__transform_hlds__loop_inv__init(void)
{
	static MR_bool done = MR_FALSE;
	if (done) {
		return;
	}
	done = MR_TRUE;
	mercury__transform_hlds__loop_inv_maybe_bunch_0();
	mercury__transform_hlds__loop_inv_maybe_bunch_1();
	MR_INIT_TYPE_CTOR_INFO(
		mercury_data_transform_hlds__loop_inv__type_ctor_info_gen_aux_proc_info_0,
		transform_hlds__loop_inv__gen_aux_proc_info_0_0);
	MR_INIT_TYPE_CTOR_INFO(
		mercury_data_transform_hlds__loop_inv__type_ctor_info_igc_info_0,
		transform_hlds__loop_inv__igc_info_0_0);
	MR_INIT_TYPE_CTOR_INFO(
		mercury_data_transform_hlds__loop_inv__type_ctor_info_inst_info_0,
		transform_hlds__loop_inv__inst_info_0_0);
	MR_INIT_TYPE_CTOR_INFO(
		mercury_data_transform_hlds__loop_inv__type_ctor_info_rec_call_0,
		transform_hlds__loop_inv__rec_call_0_0);
	mercury__transform_hlds__loop_inv__init_debugger();
}

void mercury__transform_hlds__loop_inv__init_type_tables(void)
{
	static MR_bool done = MR_FALSE;
	if (done) {
		return;
	}
	done = MR_TRUE;
	{
		MR_register_type_ctor_info(
		&mercury_data_transform_hlds__loop_inv__type_ctor_info_gen_aux_proc_info_0);
	}
	{
		MR_register_type_ctor_info(
		&mercury_data_transform_hlds__loop_inv__type_ctor_info_igc_info_0);
	}
	{
		MR_register_type_ctor_info(
		&mercury_data_transform_hlds__loop_inv__type_ctor_info_inst_info_0);
	}
	{
		MR_register_type_ctor_info(
		&mercury_data_transform_hlds__loop_inv__type_ctor_info_rec_call_0);
	}
}


void mercury__transform_hlds__loop_inv__init_debugger(void)
{
	static MR_bool done = MR_FALSE;
	if (done) {
		return;
	}
	done = MR_TRUE;
}

#ifdef MR_DEEP_PROFILING

void mercury__transform_hlds__loop_inv__write_out_proc_statics(FILE *deep_fp, FILE *procrep_fp)
{
	MR_write_out_module_proc_reps_start(procrep_fp, &mercury_data__module_common_layout__transform_hlds__loop_inv);
	MR_write_out_module_proc_reps_end(procrep_fp);
}

#endif

#ifdef MR_RECORD_TERM_SIZES

void mercury__transform_hlds__loop_inv__init_complexity_procs(void)
{
}

#endif

#ifdef MR_THREADSCOPE

void mercury__transform_hlds__loop_inv__init_threadscope_string_table(void)
{
}

#endif

/* ensure everything is compiled with the same grade */
static const void *const MR_grade = &MR_GRADE_VAR;
