/*
** Automatically generated from `hlds_goal.m'
** by the Mercury compiler,
** version rotd-2023-08-08
** configured for x86_64-pc-linux-gnu.
** Do not edit.
**
** The autoconfigured grade settings governing
** the generation of this C file were
**
** TAG_BITS=2
** UNBOXED_FLOAT=no
** UNBOXED_INT64S=no
** PREGENERATED_DIST=yes
** HIGHLEVEL_CODE=yes
**
** END_OF_C_GRADE_INFO
*/


// :- module hlds.hlds_goal.
// :- implementation.

/*
INIT mercury__hlds__hlds_goal__init
ENDINIT
*/

#include "hlds.hlds_goal.mih"


#include "analysis.mih"
#include "array.mih"
#include "assoc_list.mih"
#include "bimap.mih"
#include "bitmap.mih"
#include "bool.mih"
#include "builtin.mih"
#include "char.mih"
#include "check_hlds.mih"
#include "construct.mih"
#include "cord.mih"
#include "deconstruct.mih"
#include "enum.mih"
#include "hlds.mih"
#include "io.mih"
#include "libs.mih"
#include "list.mih"
#include "map.mih"
#include "maybe.mih"
#include "mdbcomp.mih"
#include "mode_robdd.mih"
#include "one_or_more.mih"
#include "one_or_more_map.mih"
#include "ops.mih"
#include "pair.mih"
#include "parse_tree.mih"
#include "pretty_printer.mih"
#include "private_builtin.mih"
#include "require.mih"
#include "robdd.mih"
#include "set.mih"
#include "set_ordlist.mih"
#include "sparse_bitset.mih"
#include "stack.mih"
#include "stream.mih"
#include "string.mih"
#include "term.mih"
#include "term_context.mih"
#include "time.mih"
#include "transform_hlds.mih"
#include "tree234.mih"
#include "type_desc.mih"
#include "unit.mih"
#include "univ.mih"
#include "varset.mih"
#include "check_hlds.mode_constraint_robdd.mih"
#include "check_hlds.mode_errors.mih"
#include "check_hlds.mode_info.mih"
#include "hlds.goal_mode.mih"
#include "hlds.hlds_class.mih"
#include "hlds.hlds_clauses.mih"
#include "hlds.hlds_cons.mih"
#include "hlds.hlds_data.mih"
#include "hlds.hlds_llds.mih"
#include "hlds.hlds_module.mih"
#include "hlds.hlds_pred.mih"
#include "hlds.hlds_promise.mih"
#include "hlds.hlds_rtti.mih"
#include "hlds.inst_graph.mih"
#include "hlds.instmap.mih"
#include "hlds.pred_name.mih"
#include "hlds.pred_table.mih"
#include "hlds.status.mih"
#include "libs.compiler_util.mih"
#include "libs.globals.mih"
#include "libs.polyhedron.mih"
#include "libs.rat.mih"
#include "mdbcomp.goal_path.mih"
#include "mdbcomp.prim_data.mih"
#include "mdbcomp.program_representation.mih"
#include "mdbcomp.sym_name.mih"
#include "mode_robdd.tfeirn.mih"
#include "parse_tree.error_spec.mih"
#include "parse_tree.prog_data.mih"
#include "parse_tree.prog_data_foreign.mih"
#include "parse_tree.prog_data_pragma.mih"
#include "parse_tree.prog_detism.mih"
#include "parse_tree.prog_item.mih"
#include "parse_tree.prog_rename.mih"
#include "parse_tree.prog_type.mih"
#include "parse_tree.set_of_var.mih"
#include "parse_tree.var_table.mih"
#include "parse_tree.vartypes.mih"
#include "string.format.mih"
#include "string.parse_util.mih"
#include "transform_hlds.term_constr_errors.mih"
#include "transform_hlds.term_constr_main_types.mih"
#include "transform_hlds.term_errors.mih"
#include "transform_hlds.term_util.mih"




static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0;

static const MR_FA_PseudoTypeInfo_Struct2 hlds__hlds_goal__pair__pti_pair_2__plain_term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0__plain_term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0;

static const MR_FA_PseudoTypeInfo_Struct2 hlds__hlds_goal__tree234__pti_tree234_2__plain_term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0__plain_term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0;

static const MR_FA_PseudoTypeInfo_Struct1 hlds__hlds_goal__sparse_bitset__pti_sparse_bitset_1__plain_term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_atomic_goal_type_0_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_atomic_goal_type_0_1;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_atomic_goal_type_0_2;

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_atomic_goal_type_0[3];

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_atomic_goal_type_0[3];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_atomic_goal_type_0[3];

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_atomic_interface_vars_0_0[2];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_atomic_interface_vars_0_0[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_atomic_interface_vars_0_0;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_atomic_interface_vars_0_0[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_atomic_interface_vars_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_atomic_interface_vars_0[1];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_atomic_interface_vars_0[1];

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_builtin_state_0_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_builtin_state_0_1;

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_builtin_state_0[2];

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_builtin_state_0[2];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_builtin_state_0[2];

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_call_unify_context_0_0[3];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_call_unify_context_0_0;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_call_unify_context_0_0[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_call_unify_context_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_call_unify_context_0[1];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_call_unify_context_0[1];

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_can_cgc_0_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_can_cgc_0_1;

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_can_cgc_0[2];

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_can_cgc_0[2];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_can_cgc_0[2];

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1parse_tree__prog_data__type_ctor_info_cons_id_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_case_0_0[3];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_case_0_0[3];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_case_0_0;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_case_0_0[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_case_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_case_0[1];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_case_0[1];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_case_id_0[1];

static const MR_NotagFunctorDesc hlds__hlds_goal__hlds__hlds_goal__notag_functor_desc_case_id_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cast_kind_0_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cast_kind_0_1;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cast_kind_0_2;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cast_kind_0_3;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cast_kind_0_4;

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_cast_kind_0[5];

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_cast_kind_0[5];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_cast_kind_0[5];

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_catch_part_0_0[2];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_catch_part_0_0[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_catch_part_0_0;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_catch_part_0_0[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_catch_part_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_catch_part_0[1];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_catch_part_0[1];

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cell_is_unique_0_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cell_is_unique_0_1;

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_cell_is_unique_0[2];

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_cell_is_unique_0[2];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_cell_is_unique_0[2];

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_needs_update_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_cell_to_reuse_0_0[3];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_cell_to_reuse_0_0;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_cell_to_reuse_0_0[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_cell_to_reuse_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_cell_to_reuse_0[1];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_cell_to_reuse_0[1];

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_conj_type_0_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_conj_type_0_1;

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_conj_type_0[2];

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_conj_type_0[2];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_conj_type_0[2];

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1builtin__type_ctor_info_int_0;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1list__ti_list_1builtin__type_ctor_info_int_0;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_term_size_value_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_construct_sub_info_0_0[2];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_construct_sub_info_0_0[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_construct_sub_info_0_0;

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_construct_sub_info_0_1;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_construct_sub_info_0_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_construct_sub_info_0_1[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_construct_sub_info_0[2];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_construct_sub_info_0[2];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_construct_sub_info_0[2];

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_contains_trace_goal_0_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_contains_trace_goal_0_1;

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_contains_trace_goal_0[2];

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_contains_trace_goal_0[2];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_contains_trace_goal_0[2];

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__sparse_bitset__ti_sparse_bitset_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_ctgc_goal_info_0_0[3];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_ctgc_goal_info_0_0[3];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_ctgc_goal_info_0_0;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_ctgc_goal_info_0_0[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_ctgc_goal_info_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_ctgc_goal_info_0[1];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_ctgc_goal_info_0[1];

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_dp_coverage_goal_info_0_0[2];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_dp_coverage_goal_info_0_0[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_dp_coverage_goal_info_0_0;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_dp_coverage_goal_info_0_0[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_dp_coverage_goal_info_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_dp_coverage_goal_info_0[1];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_dp_coverage_goal_info_0[1];

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_dp_coverage_goal_info_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_dp_goal_info_0_0[2];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_dp_goal_info_0_0[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_dp_goal_info_0_0;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_dp_goal_info_0_0[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_dp_goal_info_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_dp_goal_info_0[1];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_dp_goal_info_0[1];

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_force_pruning_0_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_force_pruning_0_1;

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_force_pruning_0[2];

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_force_pruning_0[2];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_force_pruning_0[2];

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1parse_tree__prog_data_foreign__type_ctor_info_foreign_arg_name_mode_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_foreign_arg_0_0[4];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_foreign_arg_0_0[4];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_foreign_arg_0_0[4];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_foreign_arg_0_0;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_foreign_arg_0_0[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_foreign_arg_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_foreign_arg_0[1];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_foreign_arg_0[1];

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_from_ground_term_kind_0_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_from_ground_term_kind_0_1;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_from_ground_term_kind_0_2;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_from_ground_term_kind_0_3;

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_from_ground_term_kind_0[4];

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_from_ground_term_kind_0[4];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_from_ground_term_kind_0[4];

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_generic_call_0_0[4];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_generic_call_0_0[4];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_generic_call_0_0[4];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_generic_call_0_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_generic_call_0_1[4];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_generic_call_0_1[4];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_generic_call_0_1;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_generic_call_0_2[1];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_generic_call_0_2[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_generic_call_0_2;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_generic_call_0_3[1];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_generic_call_0_3[1];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_generic_call_0_3[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_generic_call_0_3;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_generic_call_0_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_generic_call_0_1[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_generic_call_0_2[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_generic_call_0_3[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_generic_call_0[4];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_generic_call_0[4];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_generic_call_0[4];

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_1;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_2;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_3;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_4;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_5;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_6;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_7;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_8;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_9;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_10;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_11;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_12;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_13;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_14;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_15;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_16;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_17;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_18;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_19;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_20;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_21;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_22;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_23;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_24;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_25;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_26;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_27;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_28;

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_goal_feature_0[29];

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_goal_feature_0[29];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_goal_feature_0[29];

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_is_mdprof_inst_0_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_is_mdprof_inst_0_1;

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_goal_is_mdprof_inst_0[2];

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_goal_is_mdprof_inst_0[2];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_goal_is_mdprof_inst_0[2];

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_trivial_0_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_trivial_0_1;

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_goal_trivial_0[2];

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_goal_trivial_0[2];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_goal_trivial_0[2];

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__set_ordlist__ti_set_ordlist_1hlds__hlds_pred__type_ctor_info_pred_proc_id_0;

static const MR_FA_TypeInfo_Struct2 hlds__hlds_goal__tree234__ti_tree234_2term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0set_ordlist__ti_set_ordlist_1hlds__hlds_pred__type_ctor_info_pred_proc_id_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_0_0[2];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_0_0[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_0_0;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_0_0[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_hlds_goal_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_hlds_goal_0[1];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_hlds_goal_0[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_code_gen_info_0_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_code_gen_info_0_1[1];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_code_gen_info_0_1[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_code_gen_info_0_1;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_code_gen_info_0_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_code_gen_info_0_1[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_hlds_goal_code_gen_info_0[2];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_hlds_goal_code_gen_info_0[2];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_hlds_goal_code_gen_info_0[2];

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_0[5];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_expr_0_0[5];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_0;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_call_unify_context_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_1[6];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_expr_0_1[6];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_hlds_goal_expr_0_1[6];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_1;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1parse_tree__prog_data__type_ctor_info_mer_mode_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_2[5];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_expr_0_2[5];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_hlds_goal_expr_0_2[5];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_2;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_foreign_arg_0;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__parse_tree__prog_data__ti_trace_expr_1parse_tree__prog_data__type_ctor_info_trace_runtime_0;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1parse_tree__prog_data__ti_trace_expr_1parse_tree__prog_data__type_ctor_info_trace_runtime_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_3[7];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_expr_0_3[7];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_3;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_hlds_goal_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_4[2];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_hlds_goal_expr_0_4[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_4;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_5[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_5;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_case_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_6[3];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_expr_0_6[3];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_hlds_goal_expr_0_6[3];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_6;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_7[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_7;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_8[2];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_expr_0_8[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_8;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_9[4];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_expr_0_9[4];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_9;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_10[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_10;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_expr_0_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_expr_0_1[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_expr_0_2[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_expr_0_3[8];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_hlds_goal_expr_0[4];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_hlds_goal_expr_0[11];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_hlds_goal_expr_0[11];

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_ctgc_goal_info_0;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_rbmm_goal_info_0;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_mode_constr_goal_info_0;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_dp_goal_info_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_extra_info_0_0[8];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_extra_info_0_0[8];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_extra_info_0_0;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_extra_info_0_0[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_hlds_goal_extra_info_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_hlds_goal_extra_info_0[1];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_hlds_goal_extra_info_0[1];

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__set_ordlist__ti_set_ordlist_1hlds__hlds_goal__type_ctor_info_goal_feature_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_info_0_0[8];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_info_0_0[8];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_hlds_goal_info_0_0[8];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_info_0_0;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_info_0_0[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_hlds_goal_info_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_hlds_goal_info_0[1];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_hlds_goal_info_0[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_how_to_construct_0_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_how_to_construct_0_1[1];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_how_to_construct_0_1[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_how_to_construct_0_1;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_how_to_construct_0_2[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_how_to_construct_0_2;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_how_to_construct_0_3[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_how_to_construct_0_3;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_how_to_construct_0_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_how_to_construct_0_1[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_how_to_construct_0_2[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_how_to_construct_0_3[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_how_to_construct_0[4];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_how_to_construct_0[4];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_how_to_construct_0[4];

static const MR_FA_TypeInfo_Struct2 hlds__hlds_goal__pair__ti_pair_2term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1pair__ti_pair_2term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0;

static const MR_FA_TypeInfo_Struct2 hlds__hlds_goal__tree234__ti_tree234_2mdbcomp__goal_path__type_ctor_info_goal_id_0list__ti_list_1pair__ti_pair_2term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_conditional_0_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_conditional_0_1;

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_is_conditional_0[2];

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_is_conditional_0[2];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_is_conditional_0[2];

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_exist_constr_0_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_exist_constr_0_1;

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_is_exist_constr_0[2];

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_is_exist_constr_0[2];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_is_exist_constr_0[2];

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_first_disjunct_0_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_first_disjunct_0_1;

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_is_first_disjunct_0[2];

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_is_first_disjunct_0[2];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_is_first_disjunct_0[2];

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_lc_use_parent_stack_0_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_lc_use_parent_stack_0_1;

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_lc_use_parent_stack_0[2];

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_lc_use_parent_stack_0[2];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_lc_use_parent_stack_0[2];

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_mode_constr_goal_info_0_0[5];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_mode_constr_goal_info_0_0[5];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_mode_constr_goal_info_0_0;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_mode_constr_goal_info_0_0[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_mode_constr_goal_info_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_mode_constr_goal_info_0[1];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_mode_constr_goal_info_0[1];

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_needs_update_0_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_needs_update_0_1;

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_needs_update_0[2];

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_needs_update_0[2];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_needs_update_0[2];

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_port_counts_give_coverage_after_0_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_port_counts_give_coverage_after_0_1;

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_port_counts_give_coverage_after_0[2];

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_port_counts_give_coverage_after_0[2];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_port_counts_give_coverage_after_0[2];

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_promise_solutions_kind_0_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_promise_solutions_kind_0_1;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_promise_solutions_kind_0_2;

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_promise_solutions_kind_0[3];

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_promise_solutions_kind_0[3];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_promise_solutions_kind_0[3];

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_quant_creator_0_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_quant_creator_0_1;

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_quant_creator_0[2];

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_quant_creator_0[2];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_quant_creator_0[2];

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__set_ordlist__ti_set_ordlist_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_rbmm_goal_info_0_0[5];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_rbmm_goal_info_0_0[5];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_rbmm_goal_info_0_0;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_rbmm_goal_info_0_0[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_rbmm_goal_info_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_rbmm_goal_info_0[1];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_rbmm_goal_info_0[1];

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_removable_0_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_removable_0_1;

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_removable_0[2];

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_removable_0[2];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_removable_0[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_reuse_description_0_0;

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_reuse_description_0_1;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1builtin__type_ctor_info_string_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_reuse_description_0_2[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_reuse_description_0_2;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_reuse_description_0_3[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_reuse_description_0_3;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_reuse_description_0_4[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_reuse_description_0_4;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_reuse_description_0_0[2];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_reuse_description_0_1[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_reuse_description_0_2[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_reuse_description_0_3[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_reuse_description_0[4];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_reuse_description_0[5];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_reuse_description_0[5];

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_0[2];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_0[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_0;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1parse_tree__prog_data__type_ctor_info_goal_warning_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_1[2];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_1[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_1;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_2[2];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_2[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_2;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_3[1];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_3[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_3;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_4[1];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_4[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_4;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_5[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_5;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_6[2];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_6[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_6;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_7[1];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_7[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_7;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_8[1];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_8[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_8;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_9[2];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_9[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_9;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__parse_tree__prog_data__ti_trace_expr_1parse_tree__prog_data__type_ctor_info_trace_compiletime_0;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1parse_tree__prog_data__ti_trace_expr_1parse_tree__prog_data__type_ctor_info_trace_compiletime_0;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1builtin__type_ctor_info_string_0;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_trace_mutable_var_hlds_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_10[5];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_scope_reason_0_10[5];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_10;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_11[3];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_scope_reason_0_11[3];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_11[3];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_11;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_scope_reason_0_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_scope_reason_0_1[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_scope_reason_0_2[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_scope_reason_0_3[9];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_scope_reason_0[4];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_scope_reason_0[12];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_scope_reason_0[12];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_short_reuse_description_0_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_short_reuse_description_0_1[4];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_short_reuse_description_0_1[4];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_short_reuse_description_0_1;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_short_reuse_description_0_2[2];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_short_reuse_description_0_2[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_short_reuse_description_0_2;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_short_reuse_description_0_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_short_reuse_description_0_1[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_short_reuse_description_0_2[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_short_reuse_description_0[3];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_short_reuse_description_0[3];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_short_reuse_description_0[3];

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_shorthand_goal_expr_0_0[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_shorthand_goal_expr_0_0;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1list__ti_list_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_atomic_interface_vars_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_shorthand_goal_expr_0_1[7];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_shorthand_goal_expr_0_1[7];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_shorthand_goal_expr_0_1[7];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_shorthand_goal_expr_0_1;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_try_io_state_vars_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_shorthand_goal_expr_0_2[3];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_shorthand_goal_expr_0_2[3];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_shorthand_goal_expr_0_2;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_shorthand_goal_expr_0_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_shorthand_goal_expr_0_1[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_shorthand_goal_expr_0_2[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_shorthand_goal_expr_0[3];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_shorthand_goal_expr_0[3];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_shorthand_goal_expr_0[3];

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_static_how_0_0;

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_static_how_0_1;

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_static_how_0[2];

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_static_how_0[2];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_static_how_0[2];

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1hlds__hlds_data__type_ctor_info_tagged_cons_id_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_tagged_case_0_0[4];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_tagged_case_0_0[4];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_tagged_case_0_0;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_tagged_case_0_0[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_tagged_case_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_tagged_case_0[1];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_tagged_case_0[1];

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_term_size_value_0_0[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_term_size_value_0_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_term_size_value_0_1[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_term_size_value_0_1;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_term_size_value_0_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_term_size_value_0_1[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_term_size_value_0[2];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_term_size_value_0[2];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_term_size_value_0[2];

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_trace_mutable_var_hlds_0_0[2];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_trace_mutable_var_hlds_0_0[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_trace_mutable_var_hlds_0_0;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_trace_mutable_var_hlds_0_0[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_trace_mutable_var_hlds_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_trace_mutable_var_hlds_0[1];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_trace_mutable_var_hlds_0[1];

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_try_io_state_vars_0_0[2];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_try_io_state_vars_0_0[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_try_io_state_vars_0_0;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_try_io_state_vars_0_0[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_try_io_state_vars_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_try_io_state_vars_0[1];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_try_io_state_vars_0[1];

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_unify_mode_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unification_0_0[7];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_unification_0_0[7];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_unification_0_0[7];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unification_0_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unification_0_1[6];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_unification_0_1[6];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_unification_0_1[6];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unification_0_1;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unification_0_2[2];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_unification_0_2[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unification_0_2;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unification_0_3[2];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_unification_0_3[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unification_0_3;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unification_0_4[3];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_unification_0_4[3];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_unification_0_4[3];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unification_0_4;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unification_0_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unification_0_1[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unification_0_2[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unification_0_3[2];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_unification_0[4];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_unification_0[5];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_unification_0[5];

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_unify_sub_context_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unify_context_0_0[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_context_0_0;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_context_0_0[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_unify_context_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_unify_context_0[1];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_unify_context_0[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_main_context_0_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unify_main_context_0_1[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_main_context_0_1;

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_main_context_0_2;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unify_main_context_0_3[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_main_context_0_3;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unify_main_context_0_4[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_main_context_0_4;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_main_context_0_0[2];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_main_context_0_1[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_main_context_0_2[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_main_context_0_3[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_unify_main_context_0[4];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_unify_main_context_0[5];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_unify_main_context_0[5];

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unify_mode_0_0[4];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_mode_0_0;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_mode_0_0[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_unify_mode_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_unify_mode_0[1];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_unify_mode_0[1];

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unify_rhs_0_0[1];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_rhs_0_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unify_rhs_0_1[3];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_unify_rhs_0_1[3];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_unify_rhs_0_1[3];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_rhs_0_1;

static const MR_FA_TypeInfo_Struct2 hlds__hlds_goal__pair__ti_pair_2term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0parse_tree__prog_data__type_ctor_info_mer_mode_0;

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1pair__ti_pair_2term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0parse_tree__prog_data__type_ctor_info_mer_mode_0;

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unify_rhs_0_2[8];

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_unify_rhs_0_2[8];

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_unify_rhs_0_2[8];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_rhs_0_2;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_rhs_0_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_rhs_0_1[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_rhs_0_2[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_unify_rhs_0[3];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_unify_rhs_0[3];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_unify_rhs_0[3];

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unify_sub_context_0_0[2];

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_sub_context_0_0;

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_sub_context_0_0[1];

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_unify_sub_context_0[1];

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_unify_sub_context_0[1];

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_unify_sub_context_0[1];

static void MR_CALL 
hlds__hlds_goal__IntroducedFrom__pred__goal_list_purity__3541__1_3_p_0(
  MR_Word LambdaHeadVar__1_12,
  MR_Word LambdaHeadVar__2_13,
  MR_Word * LambdaHeadVar__3_14);

static void MR_CALL 
hlds__hlds_goal__IntroducedFrom__pred__goal_list_determinism__3533__1_3_p_0(
  MR_Word LambdaHeadVar__1_12,
  MR_Word LambdaHeadVar__2_13,
  MR_Word * LambdaHeadVar__3_14);

static void MR_CALL 
hlds__hlds_goal__IntroducedFrom__pred__goal_list_instmap_delta__3524__1_3_p_0(
  MR_Word LambdaHeadVar__1_13,
  MR_Word LambdaHeadVar__2_14,
  MR_Word * LambdaHeadVar__3_15);

static void MR_CALL 
hlds__hlds_goal____Compare____hlds_goal_extra_info_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____hlds_goal_extra_info_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2);

static void MR_CALL 
hlds__hlds_goal__set_case_contexts_3_p_0(
  MR_Word Context_4,
  MR_Word Case0_5,
  MR_Word * Case_6);

static void MR_CALL 
hlds__hlds_goal__follow_subn_until_fixpoint_3_p_0(
  MR_Word HeadVar__1_1,
  MR_Word STATE_VARIABLE_Subn_0_13,
  MR_Word * STATE_VARIABLE_Subn_14);

static void MR_CALL 
hlds__hlds_goal__set_goal_contexts_3_p_0_4(
  MR_Box closure_arg,
  MR_Box wrapper_arg_1,
  MR_Box * wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal__set_goal_contexts_3_p_0_3(
  MR_Box closure_arg,
  MR_Box wrapper_arg_1,
  MR_Box * wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal__set_goal_contexts_3_p_0_2(
  MR_Box closure_arg,
  MR_Box wrapper_arg_1,
  MR_Box * wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal__set_goal_contexts_3_p_0_1(
  MR_Box closure_arg,
  MR_Box wrapper_arg_1,
  MR_Box * wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal__goal_list_purity_2_p_0_1(
  MR_Box closure_arg,
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box * wrapper_arg_3);

static void MR_CALL 
hlds__hlds_goal__goal_list_determinism_2_p_0_1(
  MR_Box closure_arg,
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box * wrapper_arg_3);

static void MR_CALL 
hlds__hlds_goal__goal_list_instmap_delta_2_p_0_1(
  MR_Box closure_arg,
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box * wrapper_arg_3);

static MR_Box MR_CALL 
hlds__hlds_goal__goal_list_nonlocals_2_p_0_1(
  MR_Box closure_arg,
  MR_Box wrapper_arg_1);

static MR_bool MR_CALL 
hlds__hlds_goal__all_negated_2_p_0(
  MR_Word HeadVar__1_1,
  MR_Word * HeadVar__2_2);

static void MR_CALL 
hlds__hlds_goal__incremental_rename_var_in_unify_rhs_4_p_0(
  MR_Word Subn_5,
  MR_Word SubnUpdates_6,
  MR_Word RHS0_7,
  MR_Word * RHS_8);

static void MR_CALL 
hlds__hlds_goal__incremental_rename_vars_in_goal_expr_4_p_0(
  MR_Word Subn_5,
  MR_Word SubnUpdates_6,
  MR_Word Expr0_7,
  MR_Word * Expr_8);

static void MR_CALL 
hlds__hlds_goal__incremental_rename_vars_in_cases_4_p_0(
  MR_Word Subn_1,
  MR_Word SubnUpdates_2,
  MR_Word HeadVar__3_3,
  MR_Word * HeadVar__4_4);

static void MR_CALL 
hlds__hlds_goal__incremental_rename_vars_in_goals_4_p_0(
  MR_Word Subn_1,
  MR_Word SubnUpdates_2,
  MR_Word HeadVar__3_3,
  MR_Word * HeadVar__4_4);

static void MR_CALL 
hlds__hlds_goal__incremental_rename_vars_in_goal_4_p_0_1(
  MR_Box closure_arg,
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box * wrapper_arg_3);

static void MR_CALL 
hlds__hlds_goal__rename_var_in_call_unify_context_4_p_0(
  MR_Word Must_5,
  MR_Word Subn_6,
  MR_Word MaybeCallUnifyContext0_7,
  MR_Word * MaybeCallUnifyContext_8);

static void MR_CALL 
hlds__hlds_goal__rename_var_in_unify_rhs_4_p_0(
  MR_Word Must_5,
  MR_Word Subn_6,
  MR_Word RHS0_7,
  MR_Word * RHS_8);

static void MR_CALL 
hlds__hlds_goal__rename_vars_in_cases_4_p_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3,
  MR_Word * HeadVar__4_4);

static void MR_CALL 
hlds__hlds_goal__rename_vars_in_goal_4_p_0(
  MR_Word Must_5,
  MR_Word Subn_6,
  MR_Word Goal0_7,
  MR_Word * Goal_8);

static void MR_CALL 
hlds__hlds_goal__rename_generic_call_4_p_0(
  MR_Word Must_5,
  MR_Word Subn_6,
  MR_Word Call0_7,
  MR_Word * Call_8);

static void MR_CALL 
hlds__hlds_goal__rename_var_in_unify_4_p_0(
  MR_Word Must_5,
  MR_Word Subn_6,
  MR_Word Unify0_7,
  MR_Word * Unify_8);

static void MR_CALL 
hlds__hlds_goal__rename_arg_list_4_p_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3,
  MR_Word * HeadVar__4_4);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____atomic_goal_type_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____atomic_goal_type_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____atomic_interface_vars_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____atomic_interface_vars_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____builtin_state_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____builtin_state_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____call_unify_context_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____call_unify_context_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____can_cgc_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____can_cgc_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____case_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____case_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____case_id_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____case_id_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____cast_kind_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____cast_kind_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____catch_part_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____catch_part_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____cell_is_unique_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____cell_is_unique_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____cell_to_reuse_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____cell_to_reuse_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____conj_type_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____conj_type_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____construct_sub_info_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____construct_sub_info_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____contains_trace_goal_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____contains_trace_goal_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____ctgc_goal_info_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____ctgc_goal_info_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____dp_coverage_goal_info_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____dp_coverage_goal_info_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____dp_goal_info_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____dp_goal_info_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____force_pruning_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____force_pruning_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____foreign_arg_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____foreign_arg_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____from_ground_term_kind_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____from_ground_term_kind_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____generic_call_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____generic_call_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____goal_feature_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____goal_feature_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____goal_is_mdprof_inst_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____goal_is_mdprof_inst_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____goal_trivial_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____goal_trivial_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____higher_order_value_map_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____higher_order_value_map_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____hlds_goal_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____hlds_goal_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____hlds_goal_code_gen_info_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____hlds_goal_code_gen_info_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____hlds_goal_expr_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____hlds_goal_expr_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____hlds_goal_extra_info_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____hlds_goal_extra_info_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____hlds_goal_info_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____hlds_goal_info_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____hlds_goals_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____hlds_goals_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____how_to_construct_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____how_to_construct_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____incremental_rename_map_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____incremental_rename_map_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____is_conditional_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____is_conditional_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____is_exist_constr_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____is_exist_constr_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____is_first_disjunct_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____is_first_disjunct_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____lc_use_parent_stack_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____lc_use_parent_stack_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____missed_message_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____missed_message_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____mode_constr_goal_info_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____mode_constr_goal_info_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____needs_update_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____needs_update_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____port_counts_give_coverage_after_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____port_counts_give_coverage_after_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____promise_solutions_kind_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____promise_solutions_kind_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____quant_creator_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____quant_creator_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____rbmm_goal_info_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____rbmm_goal_info_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____removable_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____removable_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____reuse_description_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____reuse_description_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____scope_reason_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____scope_reason_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____short_reuse_description_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____short_reuse_description_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____shorthand_goal_expr_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____shorthand_goal_expr_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____static_how_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____static_how_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____tagged_case_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____tagged_case_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____term_size_value_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____term_size_value_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____trace_mutable_var_hlds_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____trace_mutable_var_hlds_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____try_io_state_vars_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____try_io_state_vars_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____unification_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____unification_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____unify_context_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____unify_context_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____unify_main_context_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____unify_main_context_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____unify_mode_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____unify_mode_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____unify_rhs_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____unify_rhs_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____unify_sub_context_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____unify_sub_context_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____unify_sub_contexts_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2);

static void MR_CALL 
hlds__hlds_goal____Compare____unify_sub_contexts_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3);


static /* final */ const MR_Box hlds__hlds_goal_scalar_common_1[38][2];

static /* final */ const MR_Box hlds__hlds_goal_scalar_common_2[10][3];

static /* final */ const MR_Box hlds__hlds_goal_scalar_common_3[6][6];

static /* final */ const MR_Box hlds__hlds_goal_scalar_common_4[1][5];




static /* final */ const MR_Box hlds__hlds_goal_scalar_common_1[38][2] = {
  /* row   0 */
  {
    ((MR_Box) (&mercury__term__term__type_ctor_info_var_1)),
    ((MR_Box) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0))
  },
  /* row   1 */
  {
    ((MR_Box) (&mercury__set_ordlist__set_ordlist__type_ctor_info_set_ordlist_1)),
    ((MR_Box) (&hlds__hlds_pred__hlds__hlds_pred__type_ctor_info_pred_proc_id_0))
  },
  /* row   2 */
  {
    ((MR_Box) (&mercury__list__list__type_ctor_info_list_1)),
    ((MR_Box) (&hlds__hlds_goal_scalar_common_2[1]))
  },
  /* row   3 */
  {
    ((MR_Box) (&parse_tree__set_of_var__parse_tree__set_of_var__type_ctor_info_set_of_var_1)),
    ((MR_Box) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0))
  },
  /* row   4 */
  {
    ((MR_Box) (&mercury__list__list__type_ctor_info_list_1)),
    ((MR_Box) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_cons_id_0))
  },
  /* row   5 */
  {
    ((MR_Box) (&mercury__list__list__type_ctor_info_list_1)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_needs_update_0))
  },
  /* row   6 */
  {
    ((MR_Box) (&mercury__list__list__type_ctor_info_list_1)),
    ((MR_Box) (&mercury__builtin__builtin__type_ctor_info_int_0))
  },
  /* row   7 */
  {
    ((MR_Box) (&mercury__maybe__maybe__type_ctor_info_maybe_1)),
    ((MR_Box) (&hlds__hlds_goal_scalar_common_1[6]))
  },
  /* row   8 */
  {
    ((MR_Box) (&mercury__maybe__maybe__type_ctor_info_maybe_1)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_term_size_value_0))
  },
  /* row   9 */
  {
    ((MR_Box) (&mercury__maybe__maybe__type_ctor_info_maybe_1)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_dp_coverage_goal_info_0))
  },
  /* row  10 */
  {
    ((MR_Box) (&mercury__maybe__maybe__type_ctor_info_maybe_1)),
    ((MR_Box) (&parse_tree__prog_data_foreign__parse_tree__prog_data_foreign__type_ctor_info_foreign_arg_name_mode_0))
  },
  /* row  11 */
  {
    ((MR_Box) (&mercury__list__list__type_ctor_info_list_1)),
    ((MR_Box) (&hlds__hlds_goal_scalar_common_1[0]))
  },
  /* row  12 */
  {
    ((MR_Box) (&mercury__list__list__type_ctor_info_list_1)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_case_0))
  },
  /* row  13 */
  {
    ((MR_Box) (&mercury__list__list__type_ctor_info_list_1)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0))
  },
  /* row  14 */
  {
    ((MR_Box) (&mercury__list__list__type_ctor_info_list_1)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_foreign_arg_0))
  },
  /* row  15 */
  {
    ((MR_Box) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_trace_expr_1)),
    ((MR_Box) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_trace_runtime_0))
  },
  /* row  16 */
  {
    ((MR_Box) (&mercury__maybe__maybe__type_ctor_info_maybe_1)),
    ((MR_Box) (&hlds__hlds_goal_scalar_common_1[15]))
  },
  /* row  17 */
  {
    ((MR_Box) (&mercury__list__list__type_ctor_info_list_1)),
    ((MR_Box) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_mer_mode_0))
  },
  /* row  18 */
  {
    ((MR_Box) (&mercury__maybe__maybe__type_ctor_info_maybe_1)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_call_unify_context_0))
  },
  /* row  19 */
  {
    ((MR_Box) (&mercury__maybe__maybe__type_ctor_info_maybe_1)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_ctgc_goal_info_0))
  },
  /* row  20 */
  {
    ((MR_Box) (&mercury__maybe__maybe__type_ctor_info_maybe_1)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_rbmm_goal_info_0))
  },
  /* row  21 */
  {
    ((MR_Box) (&mercury__maybe__maybe__type_ctor_info_maybe_1)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_mode_constr_goal_info_0))
  },
  /* row  22 */
  {
    ((MR_Box) (&mercury__maybe__maybe__type_ctor_info_maybe_1)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_dp_goal_info_0))
  },
  /* row  23 */
  {
    ((MR_Box) (&mercury__set_ordlist__set_ordlist__type_ctor_info_set_ordlist_1)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_feature_0))
  },
  /* row  24 */
  {
    ((MR_Box) (&mercury__set_ordlist__set_ordlist__type_ctor_info_set_ordlist_1)),
    ((MR_Box) (&hlds__hlds_goal_scalar_common_1[0]))
  },
  /* row  25 */
  {
    ((MR_Box) (&mercury__list__list__type_ctor_info_list_1)),
    ((MR_Box) (&mercury__builtin__builtin__type_ctor_info_string_0))
  },
  /* row  26 */
  {
    ((MR_Box) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_trace_expr_1)),
    ((MR_Box) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_trace_compiletime_0))
  },
  /* row  27 */
  {
    ((MR_Box) (&mercury__maybe__maybe__type_ctor_info_maybe_1)),
    ((MR_Box) (&hlds__hlds_goal_scalar_common_1[26]))
  },
  /* row  28 */
  {
    ((MR_Box) (&mercury__maybe__maybe__type_ctor_info_maybe_1)),
    ((MR_Box) (&mercury__builtin__builtin__type_ctor_info_string_0))
  },
  /* row  29 */
  {
    ((MR_Box) (&mercury__list__list__type_ctor_info_list_1)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_trace_mutable_var_hlds_0))
  },
  /* row  30 */
  {
    ((MR_Box) (&mercury__list__list__type_ctor_info_list_1)),
    ((MR_Box) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_goal_warning_0))
  },
  /* row  31 */
  {
    ((MR_Box) (&mercury__maybe__maybe__type_ctor_info_maybe_1)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_try_io_state_vars_0))
  },
  /* row  32 */
  {
    ((MR_Box) (&mercury__maybe__maybe__type_ctor_info_maybe_1)),
    ((MR_Box) (&hlds__hlds_goal_scalar_common_1[11]))
  },
  /* row  33 */
  {
    ((MR_Box) (&mercury__list__list__type_ctor_info_list_1)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_atomic_interface_vars_0))
  },
  /* row  34 */
  {
    ((MR_Box) (&mercury__list__list__type_ctor_info_list_1)),
    ((MR_Box) (&hlds__hlds_data__hlds__hlds_data__type_ctor_info_tagged_cons_id_0))
  },
  /* row  35 */
  {
    ((MR_Box) (&mercury__list__list__type_ctor_info_list_1)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_mode_0))
  },
  /* row  36 */
  {
    ((MR_Box) (&mercury__list__list__type_ctor_info_list_1)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_sub_context_0))
  },
  /* row  37 */
  {
    ((MR_Box) (&mercury__list__list__type_ctor_info_list_1)),
    ((MR_Box) (&hlds__hlds_goal_scalar_common_2[4]))
  },
};

static /* final */ const MR_Box hlds__hlds_goal_scalar_common_2[10][3] = {
  /* row   0 */
  {
    ((MR_Box) (&mercury__tree234__tree234__type_ctor_info_tree234_2)),
    ((MR_Box) (&hlds__hlds_goal_scalar_common_1[0])),
    ((MR_Box) (&hlds__hlds_goal_scalar_common_1[1]))
  },
  /* row   1 */
  {
    ((MR_Box) (&mercury__pair__pair__type_ctor_info_pair_2)),
    ((MR_Box) (&hlds__hlds_goal_scalar_common_1[0])),
    ((MR_Box) (&hlds__hlds_goal_scalar_common_1[0]))
  },
  /* row   2 */
  {
    ((MR_Box) (&mercury__tree234__tree234__type_ctor_info_tree234_2)),
    ((MR_Box) (&hlds__hlds_goal_scalar_common_1[0])),
    ((MR_Box) (&hlds__hlds_goal_scalar_common_1[0]))
  },
  /* row   3 */
  {
    ((MR_Box) (&mercury__tree234__tree234__type_ctor_info_tree234_2)),
    ((MR_Box) (&mdbcomp__goal_path__mdbcomp__goal_path__type_ctor_info_goal_id_0)),
    ((MR_Box) (&hlds__hlds_goal_scalar_common_1[2]))
  },
  /* row   4 */
  {
    ((MR_Box) (&mercury__pair__pair__type_ctor_info_pair_2)),
    ((MR_Box) (&hlds__hlds_goal_scalar_common_1[0])),
    ((MR_Box) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_mer_mode_0))
  },
  /* row   5 */
  {
    ((MR_Box) (&hlds__hlds_goal_scalar_common_3[0])),
    ((MR_Box) (hlds__hlds_goal__incremental_rename_vars_in_goal_4_p_0_1)),
    ((MR_Box) ((MR_Integer) 0))
  },
  /* row   6 */
  {
    ((MR_Box) (&hlds__hlds_goal_scalar_common_4[0])),
    ((MR_Box) (hlds__hlds_goal__goal_list_nonlocals_2_p_0_1)),
    ((MR_Box) ((MR_Integer) 0))
  },
  /* row   7 */
  {
    ((MR_Box) (&hlds__hlds_goal_scalar_common_3[1])),
    ((MR_Box) (hlds__hlds_goal__goal_list_instmap_delta_2_p_0_1)),
    ((MR_Box) ((MR_Integer) 0))
  },
  /* row   8 */
  {
    ((MR_Box) (&hlds__hlds_goal_scalar_common_3[2])),
    ((MR_Box) (hlds__hlds_goal__goal_list_determinism_2_p_0_1)),
    ((MR_Box) ((MR_Integer) 0))
  },
  /* row   9 */
  {
    ((MR_Box) (&hlds__hlds_goal_scalar_common_3[3])),
    ((MR_Box) (hlds__hlds_goal__goal_list_purity_2_p_0_1)),
    ((MR_Box) ((MR_Integer) 0))
  },
};

static /* final */ const MR_Box hlds__hlds_goal_scalar_common_3[6][6] = {
  /* row   0 */
  {
    NULL,
    ((MR_Box) (NULL)),
    ((MR_Box) ((MR_Integer) 3)),
    ((MR_Box) (&hlds__hlds_goal__pair__pti_pair_2__plain_term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0__plain_term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0)),
    ((MR_Box) (&hlds__hlds_goal__tree234__pti_tree234_2__plain_term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0__plain_term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0)),
    ((MR_Box) (&hlds__hlds_goal__tree234__pti_tree234_2__plain_term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0__plain_term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0))
  },
  /* row   1 */
  {
    NULL,
    ((MR_Box) (NULL)),
    ((MR_Box) ((MR_Integer) 3)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0)),
    ((MR_Box) (&hlds__instmap__hlds__instmap__type_ctor_info_instmap_0)),
    ((MR_Box) (&hlds__instmap__hlds__instmap__type_ctor_info_instmap_0))
  },
  /* row   2 */
  {
    NULL,
    ((MR_Box) (NULL)),
    ((MR_Box) ((MR_Integer) 3)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0)),
    ((MR_Box) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_determinism_0)),
    ((MR_Box) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_determinism_0))
  },
  /* row   3 */
  {
    NULL,
    ((MR_Box) (NULL)),
    ((MR_Box) ((MR_Integer) 3)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0)),
    ((MR_Box) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_purity_0)),
    ((MR_Box) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_purity_0))
  },
  /* row   4 */
  {
    NULL,
    ((MR_Box) (NULL)),
    ((MR_Box) ((MR_Integer) 3)),
    ((MR_Box) (&mercury__term_context__term_context__type_ctor_info_term_context_0)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0))
  },
  /* row   5 */
  {
    NULL,
    ((MR_Box) (NULL)),
    ((MR_Box) ((MR_Integer) 3)),
    ((MR_Box) (&mercury__term_context__term_context__type_ctor_info_term_context_0)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_case_0)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_case_0))
  },
};

static /* final */ const MR_Box hlds__hlds_goal_scalar_common_4[1][5] = {
  /* row   0 */
  {
    NULL,
    ((MR_Box) (NULL)),
    ((MR_Box) ((MR_Integer) 2)),
    ((MR_Box) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0)),
    ((MR_Box) (&hlds__hlds_goal__sparse_bitset__pti_sparse_bitset_1__plain_term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0))
  },
};



#include "array.mh"
#include "bitmap.mh"
#include "io.mh"
#include "string.mh"
#include "time.mh"
#include "io.stream_ops.mh"


static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0 = {
  &mercury__term__term__type_ctor_info_var_1,
  { (MR_TypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0) }
};

static const MR_FA_PseudoTypeInfo_Struct2 hlds__hlds_goal__pair__pti_pair_2__plain_term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0__plain_term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0 = {
  &mercury__pair__pair__type_ctor_info_pair_2,
  {
    (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
    (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0)
  }
};

static const MR_FA_PseudoTypeInfo_Struct2 hlds__hlds_goal__tree234__pti_tree234_2__plain_term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0__plain_term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0 = {
  &mercury__tree234__tree234__type_ctor_info_tree234_2,
  {
    (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
    (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0)
  }
};

static const MR_FA_PseudoTypeInfo_Struct1 hlds__hlds_goal__sparse_bitset__pti_sparse_bitset_1__plain_term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0 = {
  &mercury__sparse_bitset__sparse_bitset__type_ctor_info_sparse_bitset_1,
  { (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0) }
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_atomic_goal_type_0_0 = {
  (MR_String) "unknown_atomic_goal_type",
  INT32_C(0)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_atomic_goal_type_0_1 = {
  (MR_String) "top_level_atomic_goal",
  INT32_C(1)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_atomic_goal_type_0_2 = {
  (MR_String) "nested_atomic_goal",
  INT32_C(2)
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_atomic_goal_type_0[3] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_atomic_goal_type_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_atomic_goal_type_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_atomic_goal_type_0_2
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_atomic_goal_type_0[3] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_atomic_goal_type_0_2,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_atomic_goal_type_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_atomic_goal_type_0_0
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_atomic_goal_type_0[3] = {
  (MR_Integer) 2,
  (MR_Integer) 1,
  (MR_Integer) 0
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_atomic_goal_type_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_ENUM,
  ((MR_Box) (hlds__hlds_goal____Unify____atomic_goal_type_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____atomic_goal_type_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "atomic_goal_type",
  { hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_atomic_goal_type_0 },
  { hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_atomic_goal_type_0 },
  (MR_Integer) 3,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_atomic_goal_type_0,

};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_atomic_interface_vars_0_0[2] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_atomic_interface_vars_0_0[2] = {
  (MR_String) "atomic_initial",
  (MR_String) "atomic_final"
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_atomic_interface_vars_0_0 = {
  (MR_String) "atomic_interface_vars",
  INT16_C(2),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_atomic_interface_vars_0_0,
  hlds__hlds_goal__hlds__hlds_goal__field_names_atomic_interface_vars_0_0,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_atomic_interface_vars_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_atomic_interface_vars_0_0 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_atomic_interface_vars_0[1] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_atomic_interface_vars_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_atomic_interface_vars_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_atomic_interface_vars_0_0 };

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_atomic_interface_vars_0[1] = { (MR_Integer) 0 };

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_atomic_interface_vars_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(1),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____atomic_interface_vars_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____atomic_interface_vars_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "atomic_interface_vars",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_atomic_interface_vars_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_atomic_interface_vars_0 },
  (MR_Integer) 1,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_atomic_interface_vars_0,

};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_builtin_state_0_0 = {
  (MR_String) "inline_builtin",
  INT32_C(0)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_builtin_state_0_1 = {
  (MR_String) "not_builtin",
  INT32_C(1)
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_builtin_state_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_builtin_state_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_builtin_state_0_1
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_builtin_state_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_builtin_state_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_builtin_state_0_1
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_builtin_state_0[2] = {
  (MR_Integer) 0,
  (MR_Integer) 1
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_builtin_state_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_ENUM,
  ((MR_Box) (hlds__hlds_goal____Unify____builtin_state_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____builtin_state_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "builtin_state",
  { hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_builtin_state_0 },
  { hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_builtin_state_0 },
  (MR_Integer) 2,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_builtin_state_0,

};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_call_unify_context_0_0[3] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_rhs_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_context_0)
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_call_unify_context_0_0 = {
  (MR_String) "call_unify_context",
  INT16_C(3),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_call_unify_context_0_0,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_call_unify_context_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_call_unify_context_0_0 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_call_unify_context_0[1] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_call_unify_context_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_call_unify_context_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_call_unify_context_0_0 };

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_call_unify_context_0[1] = { (MR_Integer) 0 };

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_call_unify_context_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(1),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____call_unify_context_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____call_unify_context_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "call_unify_context",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_call_unify_context_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_call_unify_context_0 },
  (MR_Integer) 1,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_call_unify_context_0,

};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_can_cgc_0_0 = {
  (MR_String) "can_cgc",
  INT32_C(0)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_can_cgc_0_1 = {
  (MR_String) "cannot_cgc",
  INT32_C(1)
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_can_cgc_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_can_cgc_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_can_cgc_0_1
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_can_cgc_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_can_cgc_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_can_cgc_0_1
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_can_cgc_0[2] = {
  (MR_Integer) 0,
  (MR_Integer) 1
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_can_cgc_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_ENUM,
  ((MR_Box) (hlds__hlds_goal____Unify____can_cgc_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____can_cgc_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "can_cgc",
  { hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_can_cgc_0 },
  { hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_can_cgc_0 },
  (MR_Integer) 2,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_can_cgc_0,

};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1parse_tree__prog_data__type_ctor_info_cons_id_0 = {
  &mercury__list__list__type_ctor_info_list_1,
  { (MR_TypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_cons_id_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_case_0_0[3] = {
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_cons_id_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1parse_tree__prog_data__type_ctor_info_cons_id_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_case_0_0[3] = {
  (MR_String) "case_first_functor",
  (MR_String) "case_later_functors",
  (MR_String) "case_goal"
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_case_0_0 = {
  (MR_String) "case",
  INT16_C(3),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_case_0_0,
  hlds__hlds_goal__hlds__hlds_goal__field_names_case_0_0,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_case_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_case_0_0 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_case_0[1] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_case_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_case_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_case_0_0 };

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_case_0[1] = { (MR_Integer) 0 };

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_case_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(1),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____case_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____case_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "case",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_case_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_case_0 },
  (MR_Integer) 1,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_case_0,

};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_case_id_0[1] = { (MR_Integer) 0 };

static const MR_NotagFunctorDesc hlds__hlds_goal__hlds__hlds_goal__notag_functor_desc_case_id_0 = {
  (MR_String) "case_id",
  (MR_PseudoTypeInfo) (&mercury__builtin__builtin__type_ctor_info_int_0),
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_case_id_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_NOTAG_GROUND,
  ((MR_Box) (hlds__hlds_goal____Unify____case_id_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____case_id_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "case_id",
  { &hlds__hlds_goal__hlds__hlds_goal__notag_functor_desc_case_id_0 },
  { &hlds__hlds_goal__hlds__hlds_goal__notag_functor_desc_case_id_0 },
  (MR_Integer) 1,
  UINT16_C(4),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_case_id_0,

};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cast_kind_0_0 = {
  (MR_String) "unsafe_type_cast",
  INT32_C(0)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cast_kind_0_1 = {
  (MR_String) "unsafe_type_inst_cast",
  INT32_C(1)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cast_kind_0_2 = {
  (MR_String) "equiv_type_cast",
  INT32_C(2)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cast_kind_0_3 = {
  (MR_String) "exists_cast",
  INT32_C(3)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cast_kind_0_4 = {
  (MR_String) "subtype_coerce",
  INT32_C(4)
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_cast_kind_0[5] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cast_kind_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cast_kind_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cast_kind_0_2,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cast_kind_0_3,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cast_kind_0_4
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_cast_kind_0[5] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cast_kind_0_2,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cast_kind_0_3,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cast_kind_0_4,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cast_kind_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cast_kind_0_1
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_cast_kind_0[5] = {
  (MR_Integer) 3,
  (MR_Integer) 4,
  (MR_Integer) 0,
  (MR_Integer) 1,
  (MR_Integer) 2
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_cast_kind_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_ENUM,
  ((MR_Box) (hlds__hlds_goal____Unify____cast_kind_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____cast_kind_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "cast_kind",
  { hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_cast_kind_0 },
  { hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_cast_kind_0 },
  (MR_Integer) 5,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_cast_kind_0,

};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_catch_part_0_0[2] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_expr_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_catch_part_0_0[2] = {
  (MR_String) "catch_expr",
  (MR_String) "catch_goal"
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_catch_part_0_0 = {
  (MR_String) "catch_part",
  INT16_C(2),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_catch_part_0_0,
  hlds__hlds_goal__hlds__hlds_goal__field_names_catch_part_0_0,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_catch_part_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_catch_part_0_0 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_catch_part_0[1] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_catch_part_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_catch_part_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_catch_part_0_0 };

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_catch_part_0[1] = { (MR_Integer) 0 };

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_catch_part_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(1),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____catch_part_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____catch_part_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "catch_part",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_catch_part_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_catch_part_0 },
  (MR_Integer) 1,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_catch_part_0,

};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cell_is_unique_0_0 = {
  (MR_String) "cell_is_unique",
  INT32_C(0)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cell_is_unique_0_1 = {
  (MR_String) "cell_is_shared",
  INT32_C(1)
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_cell_is_unique_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cell_is_unique_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cell_is_unique_0_1
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_cell_is_unique_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cell_is_unique_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_cell_is_unique_0_0
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_cell_is_unique_0[2] = {
  (MR_Integer) 1,
  (MR_Integer) 0
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_cell_is_unique_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_ENUM,
  ((MR_Box) (hlds__hlds_goal____Unify____cell_is_unique_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____cell_is_unique_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "cell_is_unique",
  { hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_cell_is_unique_0 },
  { hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_cell_is_unique_0 },
  (MR_Integer) 2,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_cell_is_unique_0,

};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_needs_update_0 = {
  &mercury__list__list__type_ctor_info_list_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_needs_update_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_cell_to_reuse_0_0[3] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1parse_tree__prog_data__type_ctor_info_cons_id_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_needs_update_0)
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_cell_to_reuse_0_0 = {
  (MR_String) "cell_to_reuse",
  INT16_C(3),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_cell_to_reuse_0_0,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_cell_to_reuse_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_cell_to_reuse_0_0 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_cell_to_reuse_0[1] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_cell_to_reuse_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_cell_to_reuse_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_cell_to_reuse_0_0 };

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_cell_to_reuse_0[1] = { (MR_Integer) 0 };

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_cell_to_reuse_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(1),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____cell_to_reuse_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____cell_to_reuse_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "cell_to_reuse",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_cell_to_reuse_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_cell_to_reuse_0 },
  (MR_Integer) 1,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_cell_to_reuse_0,

};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_conj_type_0_0 = {
  (MR_String) "plain_conj",
  INT32_C(0)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_conj_type_0_1 = {
  (MR_String) "parallel_conj",
  INT32_C(1)
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_conj_type_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_conj_type_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_conj_type_0_1
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_conj_type_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_conj_type_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_conj_type_0_0
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_conj_type_0[2] = {
  (MR_Integer) 1,
  (MR_Integer) 0
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_conj_type_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_ENUM,
  ((MR_Box) (hlds__hlds_goal____Unify____conj_type_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____conj_type_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "conj_type",
  { hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_conj_type_0 },
  { hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_conj_type_0 },
  (MR_Integer) 2,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_conj_type_0,

};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1builtin__type_ctor_info_int_0 = {
  &mercury__list__list__type_ctor_info_list_1,
  { (MR_TypeInfo) (&mercury__builtin__builtin__type_ctor_info_int_0) }
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1list__ti_list_1builtin__type_ctor_info_int_0 = {
  &mercury__maybe__maybe__type_ctor_info_maybe_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__list__ti_list_1builtin__type_ctor_info_int_0) }
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_term_size_value_0 = {
  &mercury__maybe__maybe__type_ctor_info_maybe_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_term_size_value_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_construct_sub_info_0_0[2] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__maybe__ti_maybe_1list__ti_list_1builtin__type_ctor_info_int_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_term_size_value_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_construct_sub_info_0_0[2] = {
  (MR_String) "take_address_args",
  (MR_String) "term_size_slot"
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_construct_sub_info_0_0 = {
  (MR_String) "construct_sub_info",
  INT16_C(2),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(1),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_construct_sub_info_0_0,
  hlds__hlds_goal__hlds__hlds_goal__field_names_construct_sub_info_0_0,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_construct_sub_info_0_1 = {
  (MR_String) "no_construct_sub_info",
  INT16_C(0),
  UINT16_C(0),
  MR_SECTAG_LOCAL_REST_OF_WORD,
  UINT8_C(0),
  (MR_Integer) 0,
  INT32_C(1),
  NULL,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_construct_sub_info_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_construct_sub_info_0_1 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_construct_sub_info_0_1[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_construct_sub_info_0_0 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_construct_sub_info_0[2] = {
  {
    UINT32_C(1),
    MR_SECTAG_LOCAL_REST_OF_WORD,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_construct_sub_info_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_construct_sub_info_0_1,
    INT8_C(-1),
    UINT8_C(1),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_construct_sub_info_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_construct_sub_info_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_construct_sub_info_0_1
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_construct_sub_info_0[2] = {
  (MR_Integer) 0,
  (MR_Integer) 1
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_construct_sub_info_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(2),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____construct_sub_info_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____construct_sub_info_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "construct_sub_info",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_construct_sub_info_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_construct_sub_info_0 },
  (MR_Integer) 2,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_construct_sub_info_0,

};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_contains_trace_goal_0_0 = {
  (MR_String) "contains_trace_goal",
  INT32_C(0)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_contains_trace_goal_0_1 = {
  (MR_String) "contains_no_trace_goal",
  INT32_C(1)
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_contains_trace_goal_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_contains_trace_goal_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_contains_trace_goal_0_1
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_contains_trace_goal_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_contains_trace_goal_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_contains_trace_goal_0_0
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_contains_trace_goal_0[2] = {
  (MR_Integer) 1,
  (MR_Integer) 0
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_contains_trace_goal_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_ENUM,
  ((MR_Box) (hlds__hlds_goal____Unify____contains_trace_goal_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____contains_trace_goal_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "contains_trace_goal",
  { hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_contains_trace_goal_0 },
  { hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_contains_trace_goal_0 },
  (MR_Integer) 2,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_contains_trace_goal_0,

};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__sparse_bitset__ti_sparse_bitset_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0 = {
  &mercury__sparse_bitset__sparse_bitset__type_ctor_info_sparse_bitset_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_ctgc_goal_info_0_0[3] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__sparse_bitset__ti_sparse_bitset_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__sparse_bitset__ti_sparse_bitset_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_reuse_description_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_ctgc_goal_info_0_0[3] = {
  (MR_String) "ctgc_lfu",
  (MR_String) "ctgc_lbu",
  (MR_String) "ctgc_reuse"
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_ctgc_goal_info_0_0 = {
  (MR_String) "ctgc_goal_info",
  INT16_C(3),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_ctgc_goal_info_0_0,
  hlds__hlds_goal__hlds__hlds_goal__field_names_ctgc_goal_info_0_0,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_ctgc_goal_info_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_ctgc_goal_info_0_0 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_ctgc_goal_info_0[1] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_ctgc_goal_info_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_ctgc_goal_info_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_ctgc_goal_info_0_0 };

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_ctgc_goal_info_0[1] = { (MR_Integer) 0 };

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_ctgc_goal_info_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(1),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____ctgc_goal_info_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____ctgc_goal_info_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "ctgc_goal_info",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_ctgc_goal_info_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_ctgc_goal_info_0 },
  (MR_Integer) 1,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_ctgc_goal_info_0,

};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_dp_coverage_goal_info_0_0[2] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_trivial_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_port_counts_give_coverage_after_0)
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_dp_coverage_goal_info_0_0[2] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 1,
    (MR_Integer) 1
  },
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 1
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_dp_coverage_goal_info_0_0 = {
  (MR_String) "dp_coverage_goal_info",
  INT16_C(2),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_dp_coverage_goal_info_0_0,
  NULL,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_dp_coverage_goal_info_0_0,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_dp_coverage_goal_info_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_dp_coverage_goal_info_0_0 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_dp_coverage_goal_info_0[1] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_dp_coverage_goal_info_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_dp_coverage_goal_info_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_dp_coverage_goal_info_0_0 };

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_dp_coverage_goal_info_0[1] = { (MR_Integer) 0 };

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_dp_coverage_goal_info_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(1),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____dp_coverage_goal_info_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____dp_coverage_goal_info_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "dp_coverage_goal_info",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_dp_coverage_goal_info_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_dp_coverage_goal_info_0 },
  (MR_Integer) 1,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_dp_coverage_goal_info_0,

};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_dp_coverage_goal_info_0 = {
  &mercury__maybe__maybe__type_ctor_info_maybe_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_dp_coverage_goal_info_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_dp_goal_info_0_0[2] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_is_mdprof_inst_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_dp_coverage_goal_info_0)
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_dp_goal_info_0_0[2] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 1
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 0,
    (MR_Integer) 0
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_dp_goal_info_0_0 = {
  (MR_String) "dp_goal_info",
  INT16_C(2),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_dp_goal_info_0_0,
  NULL,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_dp_goal_info_0_0,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_dp_goal_info_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_dp_goal_info_0_0 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_dp_goal_info_0[1] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_dp_goal_info_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_dp_goal_info_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_dp_goal_info_0_0 };

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_dp_goal_info_0[1] = { (MR_Integer) 0 };

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_dp_goal_info_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(1),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____dp_goal_info_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____dp_goal_info_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "dp_goal_info",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_dp_goal_info_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_dp_goal_info_0 },
  (MR_Integer) 1,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_dp_goal_info_0,

};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_force_pruning_0_0 = {
  (MR_String) "force_pruning",
  INT32_C(0)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_force_pruning_0_1 = {
  (MR_String) "dont_force_pruning",
  INT32_C(1)
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_force_pruning_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_force_pruning_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_force_pruning_0_1
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_force_pruning_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_force_pruning_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_force_pruning_0_0
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_force_pruning_0[2] = {
  (MR_Integer) 1,
  (MR_Integer) 0
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_force_pruning_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_ENUM,
  ((MR_Box) (hlds__hlds_goal____Unify____force_pruning_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____force_pruning_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "force_pruning",
  { hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_force_pruning_0 },
  { hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_force_pruning_0 },
  (MR_Integer) 2,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_force_pruning_0,

};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1parse_tree__prog_data_foreign__type_ctor_info_foreign_arg_name_mode_0 = {
  &mercury__maybe__maybe__type_ctor_info_maybe_1,
  { (MR_TypeInfo) (&parse_tree__prog_data_foreign__parse_tree__prog_data_foreign__type_ctor_info_foreign_arg_name_mode_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_foreign_arg_0_0[4] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__maybe__ti_maybe_1parse_tree__prog_data_foreign__type_ctor_info_foreign_arg_name_mode_0),
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_mer_type_0),
  (MR_PseudoTypeInfo) (&parse_tree__prog_data_foreign__parse_tree__prog_data_foreign__type_ctor_info_box_policy_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_foreign_arg_0_0[4] = {
  (MR_String) "arg_var",
  (MR_String) "arg_name_mode",
  (MR_String) "arg_type",
  (MR_String) "arg_box_policy"
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_foreign_arg_0_0[4] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 2,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 3,
    (MR_Integer) 0,
    (MR_Integer) 1
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_foreign_arg_0_0 = {
  (MR_String) "foreign_arg",
  INT16_C(4),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_foreign_arg_0_0,
  hlds__hlds_goal__hlds__hlds_goal__field_names_foreign_arg_0_0,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_foreign_arg_0_0,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_foreign_arg_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_foreign_arg_0_0 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_foreign_arg_0[1] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_foreign_arg_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_foreign_arg_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_foreign_arg_0_0 };

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_foreign_arg_0[1] = { (MR_Integer) 0 };

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_foreign_arg_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(1),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____foreign_arg_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____foreign_arg_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "foreign_arg",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_foreign_arg_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_foreign_arg_0 },
  (MR_Integer) 1,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_foreign_arg_0,

};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_from_ground_term_kind_0_0 = {
  (MR_String) "from_ground_term_initial",
  INT32_C(0)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_from_ground_term_kind_0_1 = {
  (MR_String) "from_ground_term_construct",
  INT32_C(1)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_from_ground_term_kind_0_2 = {
  (MR_String) "from_ground_term_deconstruct",
  INT32_C(2)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_from_ground_term_kind_0_3 = {
  (MR_String) "from_ground_term_other",
  INT32_C(3)
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_from_ground_term_kind_0[4] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_from_ground_term_kind_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_from_ground_term_kind_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_from_ground_term_kind_0_2,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_from_ground_term_kind_0_3
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_from_ground_term_kind_0[4] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_from_ground_term_kind_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_from_ground_term_kind_0_2,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_from_ground_term_kind_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_from_ground_term_kind_0_3
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_from_ground_term_kind_0[4] = {
  (MR_Integer) 2,
  (MR_Integer) 0,
  (MR_Integer) 1,
  (MR_Integer) 3
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_from_ground_term_kind_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_ENUM,
  ((MR_Box) (hlds__hlds_goal____Unify____from_ground_term_kind_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____from_ground_term_kind_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "from_ground_term_kind",
  { hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_from_ground_term_kind_0 },
  { hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_from_ground_term_kind_0 },
  (MR_Integer) 4,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_from_ground_term_kind_0,

};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_generic_call_0_0[4] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_purity_0),
  (MR_PseudoTypeInfo) (&mdbcomp__prim_data__mdbcomp__prim_data__type_ctor_info_pred_or_func_0),
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_pred_form_arity_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_generic_call_0_0[4] = {
  (MR_String) "ho_call_var",
  (MR_String) "ho_call_purity",
  (MR_String) "ho_call_kind",
  (MR_String) "ho_call_arity"
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_generic_call_0_0[4] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 1,
    (MR_Integer) 2
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 0,
    (MR_Integer) 1
  },
  {
    (MR_Integer) 2,
    (MR_Integer) 0,
    (MR_Integer) 0
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_generic_call_0_0 = {
  (MR_String) "higher_order",
  INT16_C(4),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_generic_call_0_0,
  hlds__hlds_goal__hlds__hlds_goal__field_names_generic_call_0_0,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_generic_call_0_0,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_generic_call_0_1[4] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_class__hlds__hlds_class__type_ctor_info_method_proc_num_0),
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_class_id_0),
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_pf_sym_name_arity_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_generic_call_0_1[4] = {
  (MR_String) "method_tci",
  (MR_String) "method_num",
  (MR_String) "method_class_id",
  (MR_String) "method_name"
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_generic_call_0_1 = {
  (MR_String) "class_method",
  INT16_C(4),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(1),
  (MR_Integer) -1,
  INT32_C(1),
  hlds__hlds_goal__hlds__hlds_goal__field_types_generic_call_0_1,
  hlds__hlds_goal__hlds__hlds_goal__field_names_generic_call_0_1,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_generic_call_0_2[1] = { (MR_PseudoTypeInfo) (&mercury__builtin__builtin__type_ctor_info_string_0) };

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_generic_call_0_2[1] = { (MR_String) "event_name" };

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_generic_call_0_2 = {
  (MR_String) "event_call",
  INT16_C(1),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(2),
  (MR_Integer) -1,
  INT32_C(2),
  hlds__hlds_goal__hlds__hlds_goal__field_types_generic_call_0_2,
  hlds__hlds_goal__hlds__hlds_goal__field_names_generic_call_0_2,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_generic_call_0_3[1] = { (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_cast_kind_0) };

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_generic_call_0_3[1] = { (MR_String) "cast_kind" };

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_generic_call_0_3[1] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 3
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_generic_call_0_3 = {
  (MR_String) "cast",
  INT16_C(1),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(3),
  (MR_Integer) -1,
  INT32_C(3),
  hlds__hlds_goal__hlds__hlds_goal__field_types_generic_call_0_3,
  hlds__hlds_goal__hlds__hlds_goal__field_names_generic_call_0_3,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_generic_call_0_3,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_generic_call_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_generic_call_0_0 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_generic_call_0_1[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_generic_call_0_1 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_generic_call_0_2[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_generic_call_0_2 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_generic_call_0_3[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_generic_call_0_3 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_generic_call_0[4] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_generic_call_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_generic_call_0_1,
    INT8_C(-1),
    UINT8_C(1),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_generic_call_0_2,
    INT8_C(-1),
    UINT8_C(2),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_generic_call_0_3,
    INT8_C(-1),
    UINT8_C(3),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_generic_call_0[4] = {
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_generic_call_0_3,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_generic_call_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_generic_call_0_2,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_generic_call_0_0
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_generic_call_0[4] = {
  (MR_Integer) 3,
  (MR_Integer) 1,
  (MR_Integer) 2,
  (MR_Integer) 0
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_generic_call_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(4),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____generic_call_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____generic_call_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "generic_call",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_generic_call_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_generic_call_0 },
  (MR_Integer) 4,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_generic_call_0,

};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_0 = {
  (MR_String) "feature_constraint",
  INT32_C(0)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_1 = {
  (MR_String) "feature_from_head",
  INT32_C(1)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_2 = {
  (MR_String) "feature_not_impure_for_determinism",
  INT32_C(2)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_3 = {
  (MR_String) "feature_stack_opt",
  INT32_C(3)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_4 = {
  (MR_String) "feature_tuple_opt",
  INT32_C(4)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_5 = {
  (MR_String) "feature_call_table_gen",
  INT32_C(5)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_6 = {
  (MR_String) "feature_preserve_backtrack_into",
  INT32_C(6)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_7 = {
  (MR_String) "feature_save_deep_excp_vars",
  INT32_C(7)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_8 = {
  (MR_String) "feature_hide_debug_event",
  INT32_C(8)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_9 = {
  (MR_String) "feature_deep_self_tail_rec_call",
  INT32_C(9)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_10 = {
  (MR_String) "feature_debug_self_tail_rec_call",
  INT32_C(10)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_11 = {
  (MR_String) "feature_self_or_mutual_tail_rec_call",
  INT32_C(11)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_12 = {
  (MR_String) "feature_obvious_nontail_rec_call",
  INT32_C(12)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_13 = {
  (MR_String) "feature_keep_constant_binding",
  INT32_C(13)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_14 = {
  (MR_String) "feature_dont_warn_singleton",
  INT32_C(14)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_15 = {
  (MR_String) "feature_state_var_copy",
  INT32_C(15)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_16 = {
  (MR_String) "feature_duplicated_for_switch",
  INT32_C(16)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_17 = {
  (MR_String) "feature_mode_check_clauses_goal",
  INT32_C(17)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_18 = {
  (MR_String) "feature_will_not_modify_trail",
  INT32_C(18)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_19 = {
  (MR_String) "feature_will_not_call_mm_tabled",
  INT32_C(19)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_20 = {
  (MR_String) "feature_contains_trace",
  INT32_C(20)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_21 = {
  (MR_String) "feature_pretest_equality",
  INT32_C(21)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_22 = {
  (MR_String) "feature_pretest_equality_condition",
  INT32_C(22)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_23 = {
  (MR_String) "feature_lambda_undetermined_mode",
  INT32_C(23)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_24 = {
  (MR_String) "feature_contains_stm_inner_outer",
  INT32_C(24)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_25 = {
  (MR_String) "feature_do_not_tailcall",
  INT32_C(25)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_26 = {
  (MR_String) "feature_do_not_warn_implicit_stream",
  INT32_C(26)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_27 = {
  (MR_String) "feature_lifted_by_cse",
  INT32_C(27)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_28 = {
  (MR_String) "feature_lambda_from_try",
  INT32_C(28)
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_goal_feature_0[29] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_2,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_3,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_4,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_5,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_6,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_7,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_8,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_9,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_10,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_11,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_12,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_13,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_14,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_15,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_16,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_17,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_18,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_19,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_20,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_21,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_22,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_23,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_24,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_25,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_26,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_27,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_28
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_goal_feature_0[29] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_5,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_24,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_20,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_10,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_9,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_25,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_26,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_14,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_16,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_8,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_13,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_28,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_23,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_27,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_17,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_2,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_12,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_6,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_21,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_22,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_7,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_11,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_3,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_15,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_4,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_19,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_feature_0_18
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_goal_feature_0[29] = {
  (MR_Integer) 1,
  (MR_Integer) 10,
  (MR_Integer) 17,
  (MR_Integer) 24,
  (MR_Integer) 26,
  (MR_Integer) 0,
  (MR_Integer) 19,
  (MR_Integer) 22,
  (MR_Integer) 11,
  (MR_Integer) 5,
  (MR_Integer) 4,
  (MR_Integer) 23,
  (MR_Integer) 18,
  (MR_Integer) 12,
  (MR_Integer) 8,
  (MR_Integer) 25,
  (MR_Integer) 9,
  (MR_Integer) 16,
  (MR_Integer) 28,
  (MR_Integer) 27,
  (MR_Integer) 3,
  (MR_Integer) 20,
  (MR_Integer) 21,
  (MR_Integer) 14,
  (MR_Integer) 2,
  (MR_Integer) 6,
  (MR_Integer) 7,
  (MR_Integer) 15,
  (MR_Integer) 13
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_feature_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_ENUM,
  ((MR_Box) (hlds__hlds_goal____Unify____goal_feature_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____goal_feature_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "goal_feature",
  { hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_goal_feature_0 },
  { hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_goal_feature_0 },
  (MR_Integer) 29,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_goal_feature_0,

};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_is_mdprof_inst_0_0 = {
  (MR_String) "goal_is_mdprof_inst",
  INT32_C(0)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_is_mdprof_inst_0_1 = {
  (MR_String) "goal_is_not_mdprof_inst",
  INT32_C(1)
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_goal_is_mdprof_inst_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_is_mdprof_inst_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_is_mdprof_inst_0_1
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_goal_is_mdprof_inst_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_is_mdprof_inst_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_is_mdprof_inst_0_1
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_goal_is_mdprof_inst_0[2] = {
  (MR_Integer) 0,
  (MR_Integer) 1
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_is_mdprof_inst_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_ENUM,
  ((MR_Box) (hlds__hlds_goal____Unify____goal_is_mdprof_inst_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____goal_is_mdprof_inst_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "goal_is_mdprof_inst",
  { hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_goal_is_mdprof_inst_0 },
  { hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_goal_is_mdprof_inst_0 },
  (MR_Integer) 2,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_goal_is_mdprof_inst_0,

};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_trivial_0_0 = {
  (MR_String) "goal_is_trivial",
  INT32_C(0)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_trivial_0_1 = {
  (MR_String) "goal_is_nontrivial",
  INT32_C(1)
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_goal_trivial_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_trivial_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_trivial_0_1
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_goal_trivial_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_trivial_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_goal_trivial_0_0
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_goal_trivial_0[2] = {
  (MR_Integer) 1,
  (MR_Integer) 0
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_trivial_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_ENUM,
  ((MR_Box) (hlds__hlds_goal____Unify____goal_trivial_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____goal_trivial_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "goal_trivial",
  { hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_goal_trivial_0 },
  { hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_goal_trivial_0 },
  (MR_Integer) 2,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_goal_trivial_0,

};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__set_ordlist__ti_set_ordlist_1hlds__hlds_pred__type_ctor_info_pred_proc_id_0 = {
  &mercury__set_ordlist__set_ordlist__type_ctor_info_set_ordlist_1,
  { (MR_TypeInfo) (&hlds__hlds_pred__hlds__hlds_pred__type_ctor_info_pred_proc_id_0) }
};

static const MR_FA_TypeInfo_Struct2 hlds__hlds_goal__tree234__ti_tree234_2term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0set_ordlist__ti_set_ordlist_1hlds__hlds_pred__type_ctor_info_pred_proc_id_0 = {
  &mercury__tree234__tree234__type_ctor_info_tree234_2,
  {
    (MR_TypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
    (MR_TypeInfo) (&hlds__hlds_goal__set_ordlist__ti_set_ordlist_1hlds__hlds_pred__type_ctor_info_pred_proc_id_0)
  }
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_higher_order_value_map_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_EQUIV_GROUND,
  ((MR_Box) (hlds__hlds_goal____Unify____higher_order_value_map_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____higher_order_value_map_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "higher_order_value_map",
  { NULL },
  { (MR_PseudoTypeInfo) (&hlds__hlds_goal__tree234__ti_tree234_2term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0set_ordlist__ti_set_ordlist_1hlds__hlds_pred__type_ctor_info_pred_proc_id_0) },
  (MR_Integer) -1,
  UINT16_C(0),
  NULL,

};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_0_0[2] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_expr_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_info_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_0_0[2] = {
  (MR_String) "hg_expr",
  (MR_String) "hg_info"
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_0_0 = {
  (MR_String) "hlds_goal",
  INT16_C(2),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_0_0,
  hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_0_0,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_0_0 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_hlds_goal_0[1] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_hlds_goal_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_0_0 };

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_hlds_goal_0[1] = { (MR_Integer) 0 };

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(1),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____hlds_goal_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____hlds_goal_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "hlds_goal",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_hlds_goal_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_hlds_goal_0 },
  (MR_Integer) 1,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_hlds_goal_0,

};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_code_gen_info_0_0 = {
  (MR_String) "no_code_gen_info",
  INT16_C(0),
  UINT16_C(0),
  MR_SECTAG_LOCAL_REST_OF_WORD,
  UINT8_C(0),
  (MR_Integer) 0,
  INT32_C(0),
  NULL,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_code_gen_info_0_1[1] = { (MR_PseudoTypeInfo) (&hlds__hlds_llds__hlds__hlds_llds__type_ctor_info_llds_code_gen_details_0) };

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_code_gen_info_0_1[1] = { (MR_String) "llds_code_gen" };

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_code_gen_info_0_1 = {
  (MR_String) "llds_code_gen_info",
  INT16_C(1),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(1),
  (MR_Integer) -1,
  INT32_C(1),
  hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_code_gen_info_0_1,
  hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_code_gen_info_0_1,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_code_gen_info_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_code_gen_info_0_0 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_code_gen_info_0_1[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_code_gen_info_0_1 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_hlds_goal_code_gen_info_0[2] = {
  {
    UINT32_C(1),
    MR_SECTAG_LOCAL_REST_OF_WORD,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_code_gen_info_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_code_gen_info_0_1,
    INT8_C(-1),
    UINT8_C(1),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_hlds_goal_code_gen_info_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_code_gen_info_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_code_gen_info_0_0
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_hlds_goal_code_gen_info_0[2] = {
  (MR_Integer) 1,
  (MR_Integer) 0
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_code_gen_info_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(2),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____hlds_goal_code_gen_info_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____hlds_goal_code_gen_info_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "hlds_goal_code_gen_info",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_hlds_goal_code_gen_info_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_hlds_goal_code_gen_info_0 },
  (MR_Integer) 2,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_hlds_goal_code_gen_info_0,

};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_0[5] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_rhs_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_mode_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unification_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_context_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_expr_0_0[5] = {
  (MR_String) "unify_lhs",
  (MR_String) "unify_rhs",
  (MR_String) "unify_mode",
  (MR_String) "unify_kind",
  (MR_String) "unify_context"
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_0 = {
  (MR_String) "unify",
  INT16_C(5),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(1),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_0,
  hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_expr_0_0,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0 = {
  &mercury__list__list__type_ctor_info_list_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0) }
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_call_unify_context_0 = {
  &mercury__maybe__maybe__type_ctor_info_maybe_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_call_unify_context_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_1[6] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_pred__hlds__hlds_pred__type_ctor_info_pred_id_0),
  (MR_PseudoTypeInfo) (&mercury__builtin__builtin__type_ctor_info_int_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_builtin_state_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_call_unify_context_0),
  (MR_PseudoTypeInfo) (&mdbcomp__sym_name__mdbcomp__sym_name__type_ctor_info_sym_name_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_expr_0_1[6] = {
  (MR_String) "call_pred_id",
  (MR_String) "call_proc_id",
  (MR_String) "call_args",
  (MR_String) "call_builtin",
  (MR_String) "call_unify_context",
  (MR_String) "call_sym_name"
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_hlds_goal_expr_0_1[6] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 2,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 3,
    (MR_Integer) 0,
    (MR_Integer) 1
  },
  {
    (MR_Integer) 4,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 5,
    (MR_Integer) 0,
    (MR_Integer) 0
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_1 = {
  (MR_String) "plain_call",
  INT16_C(6),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(2),
  (MR_Integer) -1,
  INT32_C(1),
  hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_1,
  hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_expr_0_1,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_hlds_goal_expr_0_1,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1parse_tree__prog_data__type_ctor_info_mer_mode_0 = {
  &mercury__list__list__type_ctor_info_list_1,
  { (MR_TypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_mer_mode_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_2[5] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_generic_call_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1parse_tree__prog_data__type_ctor_info_mer_mode_0),
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_arg_reg_type_info_0),
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_determinism_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_expr_0_2[5] = {
  (MR_String) "gcall_details",
  (MR_String) "gcall_args",
  (MR_String) "gcall_modes",
  (MR_String) "gcall_reg_types",
  (MR_String) "gcall_detism"
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_hlds_goal_expr_0_2[5] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 2,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 3,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 4,
    (MR_Integer) 0,
    (MR_Integer) 3
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_2 = {
  (MR_String) "generic_call",
  INT16_C(5),
  UINT16_C(0),
  MR_SECTAG_REMOTE_FULL_WORD,
  UINT8_C(3),
  (MR_Integer) 0,
  INT32_C(2),
  hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_2,
  hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_expr_0_2,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_hlds_goal_expr_0_2,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_foreign_arg_0 = {
  &mercury__list__list__type_ctor_info_list_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_foreign_arg_0) }
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__parse_tree__prog_data__ti_trace_expr_1parse_tree__prog_data__type_ctor_info_trace_runtime_0 = {
  &parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_trace_expr_1,
  { (MR_TypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_trace_runtime_0) }
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1parse_tree__prog_data__ti_trace_expr_1parse_tree__prog_data__type_ctor_info_trace_runtime_0 = {
  &mercury__maybe__maybe__type_ctor_info_maybe_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__parse_tree__prog_data__ti_trace_expr_1parse_tree__prog_data__type_ctor_info_trace_runtime_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_3[7] = {
  (MR_PseudoTypeInfo) (&parse_tree__prog_data_foreign__parse_tree__prog_data_foreign__type_ctor_info_foreign_proc_attributes_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_pred__hlds__hlds_pred__type_ctor_info_pred_id_0),
  (MR_PseudoTypeInfo) (&mercury__builtin__builtin__type_ctor_info_int_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_foreign_arg_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_foreign_arg_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__maybe__ti_maybe_1parse_tree__prog_data__ti_trace_expr_1parse_tree__prog_data__type_ctor_info_trace_runtime_0),
  (MR_PseudoTypeInfo) (&parse_tree__prog_data_foreign__parse_tree__prog_data_foreign__type_ctor_info_pragma_foreign_proc_impl_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_expr_0_3[7] = {
  (MR_String) "foreign_attr",
  (MR_String) "foreign_pred_id",
  (MR_String) "foreign_proc_id",
  (MR_String) "foreign_args",
  (MR_String) "foreign_extra_args",
  (MR_String) "foreign_trace_cond",
  (MR_String) "foreign_impl"
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_3 = {
  (MR_String) "call_foreign_proc",
  INT16_C(7),
  UINT16_C(0),
  MR_SECTAG_REMOTE_FULL_WORD,
  UINT8_C(3),
  (MR_Integer) 1,
  INT32_C(3),
  hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_3,
  hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_expr_0_3,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_hlds_goal_0 = {
  &mercury__list__list__type_ctor_info_list_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_4[2] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_conj_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_hlds_goal_0)
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_hlds_goal_expr_0_4[2] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 1
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 0,
    (MR_Integer) 0
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_4 = {
  (MR_String) "conj",
  INT16_C(2),
  UINT16_C(0),
  MR_SECTAG_REMOTE_FULL_WORD,
  UINT8_C(3),
  (MR_Integer) 2,
  INT32_C(4),
  hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_4,
  NULL,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_hlds_goal_expr_0_4,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_5[1] = { (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_hlds_goal_0) };

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_5 = {
  (MR_String) "disj",
  INT16_C(1),
  UINT16_C(0),
  MR_SECTAG_REMOTE_FULL_WORD,
  UINT8_C(3),
  (MR_Integer) 3,
  INT32_C(5),
  hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_5,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_case_0 = {
  &mercury__list__list__type_ctor_info_list_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_case_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_6[3] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_can_fail_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_case_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_expr_0_6[3] = {
  (MR_String) "switch_var",
  (MR_String) "switch_canfail",
  (MR_String) "switch_cases"
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_hlds_goal_expr_0_6[3] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 0,
    (MR_Integer) 1
  },
  {
    (MR_Integer) 2,
    (MR_Integer) 0,
    (MR_Integer) 0
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_6 = {
  (MR_String) "switch",
  INT16_C(3),
  UINT16_C(0),
  MR_SECTAG_REMOTE_FULL_WORD,
  UINT8_C(3),
  (MR_Integer) 4,
  INT32_C(6),
  hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_6,
  hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_expr_0_6,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_hlds_goal_expr_0_6,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_7[1] = { (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0) };

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_7 = {
  (MR_String) "negation",
  INT16_C(1),
  UINT16_C(0),
  MR_SECTAG_NONE_DIRECT_ARG,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(7),
  hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_7,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_8[2] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_scope_reason_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_expr_0_8[2] = {
  (MR_String) "scope_reason",
  (MR_String) "scope_goal"
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_8 = {
  (MR_String) "scope",
  INT16_C(2),
  UINT16_C(0),
  MR_SECTAG_REMOTE_FULL_WORD,
  UINT8_C(3),
  (MR_Integer) 5,
  INT32_C(8),
  hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_8,
  hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_expr_0_8,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_9[4] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_expr_0_9[4] = {
  (MR_String) "ite_exist_vars",
  (MR_String) "ite_cond",
  (MR_String) "ite_then",
  (MR_String) "ite_else"
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_9 = {
  (MR_String) "if_then_else",
  INT16_C(4),
  UINT16_C(0),
  MR_SECTAG_REMOTE_FULL_WORD,
  UINT8_C(3),
  (MR_Integer) 6,
  INT32_C(9),
  hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_9,
  hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_expr_0_9,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_10[1] = { (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_shorthand_goal_expr_0) };

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_10 = {
  (MR_String) "shorthand",
  INT16_C(1),
  UINT16_C(0),
  MR_SECTAG_REMOTE_FULL_WORD,
  UINT8_C(3),
  (MR_Integer) 7,
  INT32_C(10),
  hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_expr_0_10,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_expr_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_7 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_expr_0_1[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_0 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_expr_0_2[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_1 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_expr_0_3[8] = {
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_2,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_3,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_4,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_5,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_6,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_8,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_9,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_10
};

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_hlds_goal_expr_0[4] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE_DIRECT_ARG,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_expr_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_expr_0_1,
    INT8_C(-1),
    UINT8_C(1),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_expr_0_2,
    INT8_C(-1),
    UINT8_C(2),
    UINT8_C(1)
  },
  {
    UINT32_C(8),
    MR_SECTAG_REMOTE_FULL_WORD,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_expr_0_3,
    INT8_C(-1),
    UINT8_C(3),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_hlds_goal_expr_0[11] = {
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_3,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_4,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_5,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_2,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_9,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_7,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_8,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_10,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_6,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_expr_0_0
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_hlds_goal_expr_0[11] = {
  (MR_Integer) 10,
  (MR_Integer) 6,
  (MR_Integer) 3,
  (MR_Integer) 0,
  (MR_Integer) 1,
  (MR_Integer) 2,
  (MR_Integer) 9,
  (MR_Integer) 5,
  (MR_Integer) 7,
  (MR_Integer) 4,
  (MR_Integer) 8
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_expr_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(4),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____hlds_goal_expr_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____hlds_goal_expr_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "hlds_goal_expr",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_hlds_goal_expr_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_hlds_goal_expr_0 },
  (MR_Integer) 11,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_hlds_goal_expr_0,

};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_ctgc_goal_info_0 = {
  &mercury__maybe__maybe__type_ctor_info_maybe_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_ctgc_goal_info_0) }
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_rbmm_goal_info_0 = {
  &mercury__maybe__maybe__type_ctor_info_maybe_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_rbmm_goal_info_0) }
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_mode_constr_goal_info_0 = {
  &mercury__maybe__maybe__type_ctor_info_maybe_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_mode_constr_goal_info_0) }
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_dp_goal_info_0 = {
  &mercury__maybe__maybe__type_ctor_info_maybe_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_dp_goal_info_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_extra_info_0_0[8] = {
  (MR_PseudoTypeInfo) (&mercury__term_context__term_context__type_ctor_info_term_context_0),
  (MR_PseudoTypeInfo) (&mdbcomp__goal_path__mdbcomp__goal_path__type_ctor_info_reverse_goal_path_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__tree234__ti_tree234_2term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0set_ordlist__ti_set_ordlist_1hlds__hlds_pred__type_ctor_info_pred_proc_id_0),
  (MR_PseudoTypeInfo) (&hlds__goal_mode__hlds__goal_mode__type_ctor_info_goal_mode_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_ctgc_goal_info_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_rbmm_goal_info_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_mode_constr_goal_info_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_dp_goal_info_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_extra_info_0_0[8] = {
  (MR_String) "egi_context",
  (MR_String) "egi_rev_goal_path",
  (MR_String) "egi_ho_value_map",
  (MR_String) "egi_goal_mode",
  (MR_String) "egi_maybe_ctgc",
  (MR_String) "egi_maybe_rbmm",
  (MR_String) "egi_maybe_mode_constr",
  (MR_String) "egi_maybe_dp"
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_extra_info_0_0 = {
  (MR_String) "extra_goal_info",
  INT16_C(8),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_extra_info_0_0,
  hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_extra_info_0_0,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_extra_info_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_extra_info_0_0 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_hlds_goal_extra_info_0[1] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_extra_info_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_hlds_goal_extra_info_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_extra_info_0_0 };

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_hlds_goal_extra_info_0[1] = { (MR_Integer) 0 };

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_extra_info_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(1),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____hlds_goal_extra_info_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____hlds_goal_extra_info_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "hlds_goal_extra_info",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_hlds_goal_extra_info_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_hlds_goal_extra_info_0 },
  (MR_Integer) 1,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_hlds_goal_extra_info_0,

};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__set_ordlist__ti_set_ordlist_1hlds__hlds_goal__type_ctor_info_goal_feature_0 = {
  &mercury__set_ordlist__set_ordlist__type_ctor_info_set_ordlist_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_feature_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_info_0_0[8] = {
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_determinism_0),
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_purity_0),
  (MR_PseudoTypeInfo) (&hlds__instmap__hlds__instmap__type_ctor_info_instmap_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__sparse_bitset__ti_sparse_bitset_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__set_ordlist__ti_set_ordlist_1hlds__hlds_goal__type_ctor_info_goal_feature_0),
  (MR_PseudoTypeInfo) (&mdbcomp__goal_path__mdbcomp__goal_path__type_ctor_info_goal_id_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_code_gen_info_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_extra_info_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_info_0_0[8] = {
  (MR_String) "gi_determinism",
  (MR_String) "gi_purity",
  (MR_String) "gi_instmap_delta",
  (MR_String) "gi_nonlocals",
  (MR_String) "gi_features",
  (MR_String) "gi_goal_id",
  (MR_String) "gi_code_gen_info",
  (MR_String) "gi_extra"
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_hlds_goal_info_0_0[8] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 2,
    (MR_Integer) 3
  },
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 2
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 2,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 3,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 4,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 5,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 6,
    (MR_Integer) 0,
    (MR_Integer) 0
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_info_0_0 = {
  (MR_String) "goal_info",
  INT16_C(8),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_hlds_goal_info_0_0,
  hlds__hlds_goal__hlds__hlds_goal__field_names_hlds_goal_info_0_0,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_hlds_goal_info_0_0,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_info_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_info_0_0 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_hlds_goal_info_0[1] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_hlds_goal_info_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_hlds_goal_info_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_hlds_goal_info_0_0 };

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_hlds_goal_info_0[1] = { (MR_Integer) 0 };

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_info_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(1),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____hlds_goal_info_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____hlds_goal_info_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "hlds_goal_info",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_hlds_goal_info_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_hlds_goal_info_0 },
  (MR_Integer) 1,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_hlds_goal_info_0,

};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goals_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_EQUIV_GROUND,
  ((MR_Box) (hlds__hlds_goal____Unify____hlds_goals_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____hlds_goals_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "hlds_goals",
  { NULL },
  { (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_hlds_goal_0) },
  (MR_Integer) -1,
  UINT16_C(0),
  NULL,

};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_how_to_construct_0_0 = {
  (MR_String) "construct_dynamically",
  INT16_C(0),
  UINT16_C(0),
  MR_SECTAG_LOCAL_REST_OF_WORD,
  UINT8_C(0),
  (MR_Integer) 0,
  INT32_C(0),
  NULL,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_how_to_construct_0_1[1] = { (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_static_how_0) };

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_how_to_construct_0_1[1] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 1
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_how_to_construct_0_1 = {
  (MR_String) "construct_statically",
  INT16_C(1),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(2),
  (MR_Integer) -1,
  INT32_C(1),
  hlds__hlds_goal__hlds__hlds_goal__field_types_how_to_construct_0_1,
  NULL,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_how_to_construct_0_1,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_how_to_construct_0_2[1] = { (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0) };

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_how_to_construct_0_2 = {
  (MR_String) "construct_in_region",
  INT16_C(1),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(3),
  (MR_Integer) -1,
  INT32_C(2),
  hlds__hlds_goal__hlds__hlds_goal__field_types_how_to_construct_0_2,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_how_to_construct_0_3[1] = { (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_cell_to_reuse_0) };

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_how_to_construct_0_3 = {
  (MR_String) "reuse_cell",
  INT16_C(1),
  UINT16_C(0),
  MR_SECTAG_NONE_DIRECT_ARG,
  UINT8_C(1),
  (MR_Integer) -1,
  INT32_C(3),
  hlds__hlds_goal__hlds__hlds_goal__field_types_how_to_construct_0_3,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_how_to_construct_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_how_to_construct_0_0 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_how_to_construct_0_1[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_how_to_construct_0_3 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_how_to_construct_0_2[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_how_to_construct_0_1 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_how_to_construct_0_3[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_how_to_construct_0_2 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_how_to_construct_0[4] = {
  {
    UINT32_C(1),
    MR_SECTAG_LOCAL_REST_OF_WORD,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_how_to_construct_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE_DIRECT_ARG,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_how_to_construct_0_1,
    INT8_C(-1),
    UINT8_C(1),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_how_to_construct_0_2,
    INT8_C(-1),
    UINT8_C(2),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_how_to_construct_0_3,
    INT8_C(-1),
    UINT8_C(3),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_how_to_construct_0[4] = {
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_how_to_construct_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_how_to_construct_0_2,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_how_to_construct_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_how_to_construct_0_3
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_how_to_construct_0[4] = {
  (MR_Integer) 0,
  (MR_Integer) 2,
  (MR_Integer) 1,
  (MR_Integer) 3
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_how_to_construct_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(4),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____how_to_construct_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____how_to_construct_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "how_to_construct",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_how_to_construct_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_how_to_construct_0 },
  (MR_Integer) 4,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_how_to_construct_0,

};

static const MR_FA_TypeInfo_Struct2 hlds__hlds_goal__pair__ti_pair_2term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0 = {
  &mercury__pair__pair__type_ctor_info_pair_2,
  {
    (MR_TypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
    (MR_TypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0)
  }
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1pair__ti_pair_2term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0 = {
  &mercury__list__list__type_ctor_info_list_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__pair__ti_pair_2term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0) }
};

static const MR_FA_TypeInfo_Struct2 hlds__hlds_goal__tree234__ti_tree234_2mdbcomp__goal_path__type_ctor_info_goal_id_0list__ti_list_1pair__ti_pair_2term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0 = {
  &mercury__tree234__tree234__type_ctor_info_tree234_2,
  {
    (MR_TypeInfo) (&mdbcomp__goal_path__mdbcomp__goal_path__type_ctor_info_goal_id_0),
    (MR_TypeInfo) (&hlds__hlds_goal__list__ti_list_1pair__ti_pair_2term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0)
  }
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_incremental_rename_map_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_EQUIV_GROUND,
  ((MR_Box) (hlds__hlds_goal____Unify____incremental_rename_map_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____incremental_rename_map_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "incremental_rename_map",
  { NULL },
  { (MR_PseudoTypeInfo) (&hlds__hlds_goal__tree234__ti_tree234_2mdbcomp__goal_path__type_ctor_info_goal_id_0list__ti_list_1pair__ti_pair_2term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0) },
  (MR_Integer) -1,
  UINT16_C(0),
  NULL,

};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_conditional_0_0 = {
  (MR_String) "conditional_reuse",
  INT32_C(0)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_conditional_0_1 = {
  (MR_String) "unconditional_reuse",
  INT32_C(1)
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_is_conditional_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_conditional_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_conditional_0_1
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_is_conditional_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_conditional_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_conditional_0_1
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_is_conditional_0[2] = {
  (MR_Integer) 0,
  (MR_Integer) 1
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_is_conditional_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_ENUM,
  ((MR_Box) (hlds__hlds_goal____Unify____is_conditional_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____is_conditional_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "is_conditional",
  { hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_is_conditional_0 },
  { hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_is_conditional_0 },
  (MR_Integer) 2,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_is_conditional_0,

};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_exist_constr_0_0 = {
  (MR_String) "is_not_exist_constr",
  INT32_C(0)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_exist_constr_0_1 = {
  (MR_String) "is_exist_constr",
  INT32_C(1)
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_is_exist_constr_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_exist_constr_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_exist_constr_0_1
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_is_exist_constr_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_exist_constr_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_exist_constr_0_0
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_is_exist_constr_0[2] = {
  (MR_Integer) 1,
  (MR_Integer) 0
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_is_exist_constr_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_ENUM,
  ((MR_Box) (hlds__hlds_goal____Unify____is_exist_constr_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____is_exist_constr_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "is_exist_constr",
  { hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_is_exist_constr_0 },
  { hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_is_exist_constr_0 },
  (MR_Integer) 2,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_is_exist_constr_0,

};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_first_disjunct_0_0 = {
  (MR_String) "is_first_disjunct",
  INT32_C(0)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_first_disjunct_0_1 = {
  (MR_String) "is_not_first_disjunct",
  INT32_C(1)
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_is_first_disjunct_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_first_disjunct_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_first_disjunct_0_1
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_is_first_disjunct_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_first_disjunct_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_is_first_disjunct_0_1
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_is_first_disjunct_0[2] = {
  (MR_Integer) 0,
  (MR_Integer) 1
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_is_first_disjunct_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_ENUM,
  ((MR_Box) (hlds__hlds_goal____Unify____is_first_disjunct_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____is_first_disjunct_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "is_first_disjunct",
  { hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_is_first_disjunct_0 },
  { hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_is_first_disjunct_0 },
  (MR_Integer) 2,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_is_first_disjunct_0,

};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_lc_use_parent_stack_0_0 = {
  (MR_String) "lc_use_parent_stack_frame",
  INT32_C(0)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_lc_use_parent_stack_0_1 = {
  (MR_String) "lc_create_frame_on_child_stack",
  INT32_C(1)
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_lc_use_parent_stack_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_lc_use_parent_stack_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_lc_use_parent_stack_0_1
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_lc_use_parent_stack_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_lc_use_parent_stack_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_lc_use_parent_stack_0_0
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_lc_use_parent_stack_0[2] = {
  (MR_Integer) 1,
  (MR_Integer) 0
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_lc_use_parent_stack_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_ENUM,
  ((MR_Box) (hlds__hlds_goal____Unify____lc_use_parent_stack_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____lc_use_parent_stack_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "lc_use_parent_stack",
  { hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_lc_use_parent_stack_0 },
  { hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_lc_use_parent_stack_0 },
  (MR_Integer) 2,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_lc_use_parent_stack_0,

};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_missed_message_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_EQUIV_GROUND,
  ((MR_Box) (hlds__hlds_goal____Unify____missed_message_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____missed_message_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "missed_message",
  { NULL },
  { (MR_PseudoTypeInfo) (&mercury__builtin__builtin__type_ctor_info_string_0) },
  (MR_Integer) -1,
  UINT16_C(0),
  NULL,

};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_mode_constr_goal_info_0_0[5] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__sparse_bitset__ti_sparse_bitset_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__sparse_bitset__ti_sparse_bitset_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__sparse_bitset__ti_sparse_bitset_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__sparse_bitset__ti_sparse_bitset_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__sparse_bitset__ti_sparse_bitset_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_mode_constr_goal_info_0_0[5] = {
  (MR_String) "mci_occurring_vars",
  (MR_String) "mci_producing_vars",
  (MR_String) "mci_consuming_vars",
  (MR_String) "mci_make_visible_vars",
  (MR_String) "mci_need_visible_vars"
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_mode_constr_goal_info_0_0 = {
  (MR_String) "mode_constr_goal_info",
  INT16_C(5),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_mode_constr_goal_info_0_0,
  hlds__hlds_goal__hlds__hlds_goal__field_names_mode_constr_goal_info_0_0,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_mode_constr_goal_info_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_mode_constr_goal_info_0_0 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_mode_constr_goal_info_0[1] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_mode_constr_goal_info_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_mode_constr_goal_info_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_mode_constr_goal_info_0_0 };

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_mode_constr_goal_info_0[1] = { (MR_Integer) 0 };

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_mode_constr_goal_info_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(1),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____mode_constr_goal_info_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____mode_constr_goal_info_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "mode_constr_goal_info",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_mode_constr_goal_info_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_mode_constr_goal_info_0 },
  (MR_Integer) 1,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_mode_constr_goal_info_0,

};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_needs_update_0_0 = {
  (MR_String) "needs_update",
  INT32_C(0)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_needs_update_0_1 = {
  (MR_String) "does_not_need_update",
  INT32_C(1)
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_needs_update_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_needs_update_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_needs_update_0_1
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_needs_update_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_needs_update_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_needs_update_0_0
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_needs_update_0[2] = {
  (MR_Integer) 1,
  (MR_Integer) 0
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_needs_update_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_ENUM,
  ((MR_Box) (hlds__hlds_goal____Unify____needs_update_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____needs_update_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "needs_update",
  { hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_needs_update_0 },
  { hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_needs_update_0 },
  (MR_Integer) 2,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_needs_update_0,

};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_port_counts_give_coverage_after_0_0 = {
  (MR_String) "port_counts_give_coverage_after",
  INT32_C(0)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_port_counts_give_coverage_after_0_1 = {
  (MR_String) "no_port_counts_give_coverage_after",
  INT32_C(1)
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_port_counts_give_coverage_after_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_port_counts_give_coverage_after_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_port_counts_give_coverage_after_0_1
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_port_counts_give_coverage_after_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_port_counts_give_coverage_after_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_port_counts_give_coverage_after_0_0
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_port_counts_give_coverage_after_0[2] = {
  (MR_Integer) 1,
  (MR_Integer) 0
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_port_counts_give_coverage_after_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_ENUM,
  ((MR_Box) (hlds__hlds_goal____Unify____port_counts_give_coverage_after_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____port_counts_give_coverage_after_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "port_counts_give_coverage_after",
  { hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_port_counts_give_coverage_after_0 },
  { hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_port_counts_give_coverage_after_0 },
  (MR_Integer) 2,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_port_counts_give_coverage_after_0,

};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_promise_solutions_kind_0_0 = {
  (MR_String) "equivalent_solutions",
  INT32_C(0)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_promise_solutions_kind_0_1 = {
  (MR_String) "equivalent_solution_sets",
  INT32_C(1)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_promise_solutions_kind_0_2 = {
  (MR_String) "equivalent_solution_sets_arbitrary",
  INT32_C(2)
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_promise_solutions_kind_0[3] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_promise_solutions_kind_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_promise_solutions_kind_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_promise_solutions_kind_0_2
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_promise_solutions_kind_0[3] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_promise_solutions_kind_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_promise_solutions_kind_0_2,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_promise_solutions_kind_0_0
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_promise_solutions_kind_0[3] = {
  (MR_Integer) 2,
  (MR_Integer) 0,
  (MR_Integer) 1
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_promise_solutions_kind_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_ENUM,
  ((MR_Box) (hlds__hlds_goal____Unify____promise_solutions_kind_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____promise_solutions_kind_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "promise_solutions_kind",
  { hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_promise_solutions_kind_0 },
  { hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_promise_solutions_kind_0 },
  (MR_Integer) 3,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_promise_solutions_kind_0,

};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_quant_creator_0_0 = {
  (MR_String) "user_quant",
  INT32_C(0)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_quant_creator_0_1 = {
  (MR_String) "compiler_quant",
  INT32_C(1)
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_quant_creator_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_quant_creator_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_quant_creator_0_1
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_quant_creator_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_quant_creator_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_quant_creator_0_0
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_quant_creator_0[2] = {
  (MR_Integer) 1,
  (MR_Integer) 0
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_quant_creator_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_ENUM,
  ((MR_Box) (hlds__hlds_goal____Unify____quant_creator_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____quant_creator_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "quant_creator",
  { hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_quant_creator_0 },
  { hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_quant_creator_0 },
  (MR_Integer) 2,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_quant_creator_0,

};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__set_ordlist__ti_set_ordlist_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0 = {
  &mercury__set_ordlist__set_ordlist__type_ctor_info_set_ordlist_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_rbmm_goal_info_0_0[5] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__set_ordlist__ti_set_ordlist_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__set_ordlist__ti_set_ordlist_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__set_ordlist__ti_set_ordlist_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__set_ordlist__ti_set_ordlist_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__set_ordlist__ti_set_ordlist_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_rbmm_goal_info_0_0[5] = {
  (MR_String) "created_regions",
  (MR_String) "removed_regions",
  (MR_String) "carried_regions",
  (MR_String) "allocated_into_regions",
  (MR_String) "used_regions"
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_rbmm_goal_info_0_0 = {
  (MR_String) "rbmm_goal_info",
  INT16_C(5),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_rbmm_goal_info_0_0,
  hlds__hlds_goal__hlds__hlds_goal__field_names_rbmm_goal_info_0_0,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_rbmm_goal_info_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_rbmm_goal_info_0_0 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_rbmm_goal_info_0[1] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_rbmm_goal_info_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_rbmm_goal_info_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_rbmm_goal_info_0_0 };

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_rbmm_goal_info_0[1] = { (MR_Integer) 0 };

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_rbmm_goal_info_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(1),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____rbmm_goal_info_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____rbmm_goal_info_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "rbmm_goal_info",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_rbmm_goal_info_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_rbmm_goal_info_0 },
  (MR_Integer) 1,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_rbmm_goal_info_0,

};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_removable_0_0 = {
  (MR_String) "removable",
  INT32_C(0)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_removable_0_1 = {
  (MR_String) "not_removable",
  INT32_C(1)
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_removable_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_removable_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_removable_0_1
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_removable_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_removable_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_removable_0_0
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_removable_0[2] = {
  (MR_Integer) 1,
  (MR_Integer) 0
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_removable_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_ENUM,
  ((MR_Box) (hlds__hlds_goal____Unify____removable_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____removable_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "removable",
  { hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_removable_0 },
  { hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_removable_0 },
  (MR_Integer) 2,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_removable_0,

};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_reuse_description_0_0 = {
  (MR_String) "no_reuse_info",
  INT16_C(0),
  UINT16_C(0),
  MR_SECTAG_LOCAL_REST_OF_WORD,
  UINT8_C(0),
  (MR_Integer) 0,
  INT32_C(0),
  NULL,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_reuse_description_0_1 = {
  (MR_String) "no_possible_reuse",
  INT16_C(0),
  UINT16_C(0),
  MR_SECTAG_LOCAL_REST_OF_WORD,
  UINT8_C(0),
  (MR_Integer) 1,
  INT32_C(1),
  NULL,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1builtin__type_ctor_info_string_0 = {
  &mercury__list__list__type_ctor_info_list_1,
  { (MR_TypeInfo) (&mercury__builtin__builtin__type_ctor_info_string_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_reuse_description_0_2[1] = { (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1builtin__type_ctor_info_string_0) };

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_reuse_description_0_2 = {
  (MR_String) "missed_reuse",
  INT16_C(1),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(1),
  (MR_Integer) -1,
  INT32_C(2),
  hlds__hlds_goal__hlds__hlds_goal__field_types_reuse_description_0_2,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_reuse_description_0_3[1] = { (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_short_reuse_description_0) };

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_reuse_description_0_3 = {
  (MR_String) "potential_reuse",
  INT16_C(1),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(2),
  (MR_Integer) -1,
  INT32_C(3),
  hlds__hlds_goal__hlds__hlds_goal__field_types_reuse_description_0_3,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_reuse_description_0_4[1] = { (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_short_reuse_description_0) };

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_reuse_description_0_4 = {
  (MR_String) "reuse",
  INT16_C(1),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(3),
  (MR_Integer) -1,
  INT32_C(4),
  hlds__hlds_goal__hlds__hlds_goal__field_types_reuse_description_0_4,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_reuse_description_0_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_reuse_description_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_reuse_description_0_1
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_reuse_description_0_1[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_reuse_description_0_2 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_reuse_description_0_2[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_reuse_description_0_3 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_reuse_description_0_3[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_reuse_description_0_4 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_reuse_description_0[4] = {
  {
    UINT32_C(2),
    MR_SECTAG_LOCAL_REST_OF_WORD,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_reuse_description_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_reuse_description_0_1,
    INT8_C(-1),
    UINT8_C(1),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_reuse_description_0_2,
    INT8_C(-1),
    UINT8_C(2),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_reuse_description_0_3,
    INT8_C(-1),
    UINT8_C(3),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_reuse_description_0[5] = {
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_reuse_description_0_2,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_reuse_description_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_reuse_description_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_reuse_description_0_3,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_reuse_description_0_4
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_reuse_description_0[5] = {
  (MR_Integer) 2,
  (MR_Integer) 1,
  (MR_Integer) 0,
  (MR_Integer) 3,
  (MR_Integer) 4
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_reuse_description_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(4),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____reuse_description_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____reuse_description_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "reuse_description",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_reuse_description_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_reuse_description_0 },
  (MR_Integer) 5,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_reuse_description_0,

};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_0[2] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_quant_creator_0)
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_0[2] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 0,
    (MR_Integer) 1
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_0 = {
  (MR_String) "exist_quant",
  INT16_C(2),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_0,
  NULL,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_0,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1parse_tree__prog_data__type_ctor_info_goal_warning_0 = {
  &mercury__list__list__type_ctor_info_list_1,
  { (MR_TypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_goal_warning_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_1[2] = {
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_goal_warning_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1parse_tree__prog_data__type_ctor_info_goal_warning_0)
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_1[2] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 3
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 0,
    (MR_Integer) 0
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_1 = {
  (MR_String) "disable_warnings",
  INT16_C(2),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(1),
  (MR_Integer) -1,
  INT32_C(1),
  hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_1,
  NULL,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_1,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_2[2] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_promise_solutions_kind_0)
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_2[2] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 0,
    (MR_Integer) 2
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_2 = {
  (MR_String) "promise_solutions",
  INT16_C(2),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(2),
  (MR_Integer) -1,
  INT32_C(2),
  hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_2,
  NULL,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_2,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_3[1] = { (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_purity_0) };

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_3[1] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 2
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_3 = {
  (MR_String) "promise_purity",
  INT16_C(1),
  UINT16_C(0),
  MR_SECTAG_REMOTE_FULL_WORD,
  UINT8_C(3),
  (MR_Integer) 0,
  INT32_C(3),
  hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_3,
  NULL,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_3,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_4[1] = { (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_determinism_0) };

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_4[1] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 3
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_4 = {
  (MR_String) "require_detism",
  INT16_C(1),
  UINT16_C(0),
  MR_SECTAG_REMOTE_FULL_WORD,
  UINT8_C(3),
  (MR_Integer) 1,
  INT32_C(4),
  hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_4,
  NULL,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_4,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_5[1] = { (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0) };

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_5 = {
  (MR_String) "require_complete_switch",
  INT16_C(1),
  UINT16_C(0),
  MR_SECTAG_REMOTE_FULL_WORD,
  UINT8_C(3),
  (MR_Integer) 2,
  INT32_C(5),
  hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_5,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_6[2] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_determinism_0)
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_6[2] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 0,
    (MR_Integer) 3
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_6 = {
  (MR_String) "require_switch_arms_detism",
  INT16_C(2),
  UINT16_C(0),
  MR_SECTAG_REMOTE_FULL_WORD,
  UINT8_C(3),
  (MR_Integer) 3,
  INT32_C(6),
  hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_6,
  NULL,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_6,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_7[1] = { (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_force_pruning_0) };

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_7[1] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 1
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_7 = {
  (MR_String) "commit",
  INT16_C(1),
  UINT16_C(0),
  MR_SECTAG_REMOTE_FULL_WORD,
  UINT8_C(3),
  (MR_Integer) 4,
  INT32_C(7),
  hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_7,
  NULL,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_7,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_8[1] = { (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_removable_0) };

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_8[1] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 1
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_8 = {
  (MR_String) "barrier",
  INT16_C(1),
  UINT16_C(0),
  MR_SECTAG_REMOTE_FULL_WORD,
  UINT8_C(3),
  (MR_Integer) 5,
  INT32_C(8),
  hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_8,
  NULL,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_8,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_9[2] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_from_ground_term_kind_0)
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_9[2] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 0,
    (MR_Integer) 2
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_9 = {
  (MR_String) "from_ground_term",
  INT16_C(2),
  UINT16_C(0),
  MR_SECTAG_REMOTE_FULL_WORD,
  UINT8_C(3),
  (MR_Integer) 6,
  INT32_C(9),
  hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_9,
  NULL,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_9,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__parse_tree__prog_data__ti_trace_expr_1parse_tree__prog_data__type_ctor_info_trace_compiletime_0 = {
  &parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_trace_expr_1,
  { (MR_TypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_trace_compiletime_0) }
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1parse_tree__prog_data__ti_trace_expr_1parse_tree__prog_data__type_ctor_info_trace_compiletime_0 = {
  &mercury__maybe__maybe__type_ctor_info_maybe_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__parse_tree__prog_data__ti_trace_expr_1parse_tree__prog_data__type_ctor_info_trace_compiletime_0) }
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1builtin__type_ctor_info_string_0 = {
  &mercury__maybe__maybe__type_ctor_info_maybe_1,
  { (MR_TypeInfo) (&mercury__builtin__builtin__type_ctor_info_string_0) }
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_trace_mutable_var_hlds_0 = {
  &mercury__list__list__type_ctor_info_list_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_trace_mutable_var_hlds_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_10[5] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__maybe__ti_maybe_1parse_tree__prog_data__ti_trace_expr_1parse_tree__prog_data__type_ctor_info_trace_compiletime_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__maybe__ti_maybe_1parse_tree__prog_data__ti_trace_expr_1parse_tree__prog_data__type_ctor_info_trace_runtime_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__maybe__ti_maybe_1builtin__type_ctor_info_string_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_trace_mutable_var_hlds_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_scope_reason_0_10[5] = {
  (MR_String) "trace_compiletime",
  (MR_String) "trace_runtime",
  (MR_String) "trace_maybe_io",
  (MR_String) "trace_mutable_vars",
  (MR_String) "trace_quant_vars"
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_10 = {
  (MR_String) "trace_goal",
  INT16_C(5),
  UINT16_C(0),
  MR_SECTAG_REMOTE_FULL_WORD,
  UINT8_C(3),
  (MR_Integer) 7,
  INT32_C(10),
  hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_10,
  hlds__hlds_goal__hlds__hlds_goal__field_names_scope_reason_0_10,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_11[3] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_lc_use_parent_stack_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_scope_reason_0_11[3] = {
  (MR_String) "lc_lc_var",
  (MR_String) "lc_lcs_var",
  (MR_String) "lc_use_parent_stack"
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_11[3] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 2,
    (MR_Integer) 0,
    (MR_Integer) 1
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_11 = {
  (MR_String) "loop_control",
  INT16_C(3),
  UINT16_C(0),
  MR_SECTAG_REMOTE_FULL_WORD,
  UINT8_C(3),
  (MR_Integer) 8,
  INT32_C(11),
  hlds__hlds_goal__hlds__hlds_goal__field_types_scope_reason_0_11,
  hlds__hlds_goal__hlds__hlds_goal__field_names_scope_reason_0_11,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_scope_reason_0_11,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_scope_reason_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_0 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_scope_reason_0_1[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_1 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_scope_reason_0_2[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_2 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_scope_reason_0_3[9] = {
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_3,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_4,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_5,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_6,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_7,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_8,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_9,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_10,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_11
};

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_scope_reason_0[4] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_scope_reason_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_scope_reason_0_1,
    INT8_C(-1),
    UINT8_C(1),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_scope_reason_0_2,
    INT8_C(-1),
    UINT8_C(2),
    UINT8_C(1)
  },
  {
    UINT32_C(9),
    MR_SECTAG_REMOTE_FULL_WORD,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_scope_reason_0_3,
    INT8_C(-1),
    UINT8_C(3),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_scope_reason_0[12] = {
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_8,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_7,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_9,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_11,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_3,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_2,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_5,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_4,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_6,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_scope_reason_0_10
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_scope_reason_0[12] = {
  (MR_Integer) 3,
  (MR_Integer) 2,
  (MR_Integer) 7,
  (MR_Integer) 6,
  (MR_Integer) 9,
  (MR_Integer) 8,
  (MR_Integer) 10,
  (MR_Integer) 1,
  (MR_Integer) 0,
  (MR_Integer) 4,
  (MR_Integer) 11,
  (MR_Integer) 5
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_scope_reason_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(4),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____scope_reason_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____scope_reason_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "scope_reason",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_scope_reason_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_scope_reason_0 },
  (MR_Integer) 12,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_scope_reason_0,

};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_short_reuse_description_0_0 = {
  (MR_String) "cell_died",
  INT16_C(0),
  UINT16_C(0),
  MR_SECTAG_LOCAL_REST_OF_WORD,
  UINT8_C(0),
  (MR_Integer) 0,
  INT32_C(0),
  NULL,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_short_reuse_description_0_1[4] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_is_conditional_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1parse_tree__prog_data__type_ctor_info_cons_id_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_needs_update_0)
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_short_reuse_description_0_1[4] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 0,
    (MR_Integer) 1
  },
  {
    (MR_Integer) 2,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 3,
    (MR_Integer) 0,
    (MR_Integer) 0
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_short_reuse_description_0_1 = {
  (MR_String) "cell_reused",
  INT16_C(4),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(1),
  (MR_Integer) -1,
  INT32_C(1),
  hlds__hlds_goal__hlds__hlds_goal__field_types_short_reuse_description_0_1,
  NULL,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_short_reuse_description_0_1,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_short_reuse_description_0_2[2] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_is_conditional_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1builtin__type_ctor_info_int_0)
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_short_reuse_description_0_2[2] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 1
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 0,
    (MR_Integer) 0
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_short_reuse_description_0_2 = {
  (MR_String) "reuse_call",
  INT16_C(2),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(2),
  (MR_Integer) -1,
  INT32_C(2),
  hlds__hlds_goal__hlds__hlds_goal__field_types_short_reuse_description_0_2,
  NULL,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_short_reuse_description_0_2,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_short_reuse_description_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_short_reuse_description_0_0 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_short_reuse_description_0_1[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_short_reuse_description_0_1 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_short_reuse_description_0_2[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_short_reuse_description_0_2 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_short_reuse_description_0[3] = {
  {
    UINT32_C(1),
    MR_SECTAG_LOCAL_REST_OF_WORD,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_short_reuse_description_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_short_reuse_description_0_1,
    INT8_C(-1),
    UINT8_C(1),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_short_reuse_description_0_2,
    INT8_C(-1),
    UINT8_C(2),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_short_reuse_description_0[3] = {
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_short_reuse_description_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_short_reuse_description_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_short_reuse_description_0_2
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_short_reuse_description_0[3] = {
  (MR_Integer) 0,
  (MR_Integer) 1,
  (MR_Integer) 2
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_short_reuse_description_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(3),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____short_reuse_description_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____short_reuse_description_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "short_reuse_description",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_short_reuse_description_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_short_reuse_description_0 },
  (MR_Integer) 3,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_short_reuse_description_0,

};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_shorthand_goal_expr_0_0[2] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0)
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_shorthand_goal_expr_0_0 = {
  (MR_String) "bi_implication",
  INT16_C(2),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_shorthand_goal_expr_0_0,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1list__ti_list_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0 = {
  &mercury__maybe__maybe__type_ctor_info_maybe_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__list__ti_list_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0) }
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_atomic_interface_vars_0 = {
  &mercury__list__list__type_ctor_info_list_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_atomic_interface_vars_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_shorthand_goal_expr_0_1[7] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_atomic_goal_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_atomic_interface_vars_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_atomic_interface_vars_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__maybe__ti_maybe_1list__ti_list_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_hlds_goal_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_atomic_interface_vars_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_shorthand_goal_expr_0_1[7] = {
  (MR_String) "atomic_goal_type",
  (MR_String) "atomic_outer",
  (MR_String) "atomic_inner",
  (MR_String) "atomic_output_vars",
  (MR_String) "atomic_main_goal",
  (MR_String) "orelse_alternatives",
  (MR_String) "orelse_inners"
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_shorthand_goal_expr_0_1[7] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 2
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 2,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 3,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 4,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 5,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 6,
    (MR_Integer) 0,
    (MR_Integer) 0
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_shorthand_goal_expr_0_1 = {
  (MR_String) "atomic_goal",
  INT16_C(7),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(1),
  (MR_Integer) -1,
  INT32_C(1),
  hlds__hlds_goal__hlds__hlds_goal__field_types_shorthand_goal_expr_0_1,
  hlds__hlds_goal__hlds__hlds_goal__field_names_shorthand_goal_expr_0_1,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_shorthand_goal_expr_0_1,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_try_io_state_vars_0 = {
  &mercury__maybe__maybe__type_ctor_info_maybe_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_try_io_state_vars_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_shorthand_goal_expr_0_2[3] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__maybe__ti_maybe_1hlds__hlds_goal__type_ctor_info_try_io_state_vars_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_shorthand_goal_expr_0_2[3] = {
  (MR_String) "try_maybe_io",
  (MR_String) "try_result_var",
  (MR_String) "try_goal"
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_shorthand_goal_expr_0_2 = {
  (MR_String) "try_goal",
  INT16_C(3),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(2),
  (MR_Integer) -1,
  INT32_C(2),
  hlds__hlds_goal__hlds__hlds_goal__field_types_shorthand_goal_expr_0_2,
  hlds__hlds_goal__hlds__hlds_goal__field_names_shorthand_goal_expr_0_2,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_shorthand_goal_expr_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_shorthand_goal_expr_0_0 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_shorthand_goal_expr_0_1[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_shorthand_goal_expr_0_1 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_shorthand_goal_expr_0_2[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_shorthand_goal_expr_0_2 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_shorthand_goal_expr_0[3] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_shorthand_goal_expr_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_shorthand_goal_expr_0_1,
    INT8_C(-1),
    UINT8_C(1),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_shorthand_goal_expr_0_2,
    INT8_C(-1),
    UINT8_C(2),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_shorthand_goal_expr_0[3] = {
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_shorthand_goal_expr_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_shorthand_goal_expr_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_shorthand_goal_expr_0_2
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_shorthand_goal_expr_0[3] = {
  (MR_Integer) 1,
  (MR_Integer) 0,
  (MR_Integer) 2
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_shorthand_goal_expr_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(3),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____shorthand_goal_expr_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____shorthand_goal_expr_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "shorthand_goal_expr",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_shorthand_goal_expr_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_shorthand_goal_expr_0 },
  (MR_Integer) 3,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_shorthand_goal_expr_0,

};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_static_how_0_0 = {
  (MR_String) "born_static",
  INT32_C(0)
};

static const MR_EnumFunctorDesc hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_static_how_0_1 = {
  (MR_String) "marked_static",
  INT32_C(1)
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_static_how_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_static_how_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_static_how_0_1
};

static const MR_EnumFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_static_how_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_static_how_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__enum_functor_desc_static_how_0_1
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_static_how_0[2] = {
  (MR_Integer) 0,
  (MR_Integer) 1
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_static_how_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_ENUM,
  ((MR_Box) (hlds__hlds_goal____Unify____static_how_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____static_how_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "static_how",
  { hlds__hlds_goal__hlds__hlds_goal__enum_name_ordered_static_how_0 },
  { hlds__hlds_goal__hlds__hlds_goal__enum_ordinal_ordered_static_how_0 },
  (MR_Integer) 2,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_static_how_0,

};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1hlds__hlds_data__type_ctor_info_tagged_cons_id_0 = {
  &mercury__list__list__type_ctor_info_list_1,
  { (MR_TypeInfo) (&hlds__hlds_data__hlds__hlds_data__type_ctor_info_tagged_cons_id_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_tagged_case_0_0[4] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_data__hlds__hlds_data__type_ctor_info_tagged_cons_id_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1hlds__hlds_data__type_ctor_info_tagged_cons_id_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_case_id_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_tagged_case_0_0[4] = {
  (MR_String) "tagged_case_first_functor",
  (MR_String) "tagged_case_later_functors",
  (MR_String) "tagged_case_id",
  (MR_String) "tagged_case_goal"
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_tagged_case_0_0 = {
  (MR_String) "tagged_case",
  INT16_C(4),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_tagged_case_0_0,
  hlds__hlds_goal__hlds__hlds_goal__field_names_tagged_case_0_0,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_tagged_case_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_tagged_case_0_0 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_tagged_case_0[1] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_tagged_case_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_tagged_case_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_tagged_case_0_0 };

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_tagged_case_0[1] = { (MR_Integer) 0 };

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_tagged_case_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(1),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____tagged_case_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____tagged_case_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "tagged_case",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_tagged_case_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_tagged_case_0 },
  (MR_Integer) 1,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_tagged_case_0,

};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_term_size_value_0_0[1] = { (MR_PseudoTypeInfo) (&mercury__builtin__builtin__type_ctor_info_int_0) };

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_term_size_value_0_0 = {
  (MR_String) "known_size",
  INT16_C(1),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_term_size_value_0_0,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_term_size_value_0_1[1] = { (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0) };

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_term_size_value_0_1 = {
  (MR_String) "dynamic_size",
  INT16_C(1),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(1),
  (MR_Integer) -1,
  INT32_C(1),
  hlds__hlds_goal__hlds__hlds_goal__field_types_term_size_value_0_1,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_term_size_value_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_term_size_value_0_0 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_term_size_value_0_1[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_term_size_value_0_1 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_term_size_value_0[2] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_term_size_value_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_term_size_value_0_1,
    INT8_C(-1),
    UINT8_C(1),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_term_size_value_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_term_size_value_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_term_size_value_0_0
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_term_size_value_0[2] = {
  (MR_Integer) 1,
  (MR_Integer) 0
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_term_size_value_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(2),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____term_size_value_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____term_size_value_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "term_size_value",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_term_size_value_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_term_size_value_0 },
  (MR_Integer) 2,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_term_size_value_0,

};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_trace_mutable_var_hlds_0_0[2] = {
  (MR_PseudoTypeInfo) (&mercury__builtin__builtin__type_ctor_info_string_0),
  (MR_PseudoTypeInfo) (&mercury__builtin__builtin__type_ctor_info_string_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_trace_mutable_var_hlds_0_0[2] = {
  (MR_String) "tmvh_mutable_name",
  (MR_String) "tmvh_state_var_name"
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_trace_mutable_var_hlds_0_0 = {
  (MR_String) "trace_mutable_var_hlds",
  INT16_C(2),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_trace_mutable_var_hlds_0_0,
  hlds__hlds_goal__hlds__hlds_goal__field_names_trace_mutable_var_hlds_0_0,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_trace_mutable_var_hlds_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_trace_mutable_var_hlds_0_0 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_trace_mutable_var_hlds_0[1] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_trace_mutable_var_hlds_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_trace_mutable_var_hlds_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_trace_mutable_var_hlds_0_0 };

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_trace_mutable_var_hlds_0[1] = { (MR_Integer) 0 };

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_trace_mutable_var_hlds_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(1),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____trace_mutable_var_hlds_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____trace_mutable_var_hlds_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "trace_mutable_var_hlds",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_trace_mutable_var_hlds_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_trace_mutable_var_hlds_0 },
  (MR_Integer) 1,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_trace_mutable_var_hlds_0,

};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_try_io_state_vars_0_0[2] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_try_io_state_vars_0_0[2] = {
  (MR_String) "try_io_initial",
  (MR_String) "try_io_final"
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_try_io_state_vars_0_0 = {
  (MR_String) "try_io_state_vars",
  INT16_C(2),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_try_io_state_vars_0_0,
  hlds__hlds_goal__hlds__hlds_goal__field_names_try_io_state_vars_0_0,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_try_io_state_vars_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_try_io_state_vars_0_0 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_try_io_state_vars_0[1] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_try_io_state_vars_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_try_io_state_vars_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_try_io_state_vars_0_0 };

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_try_io_state_vars_0[1] = { (MR_Integer) 0 };

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_try_io_state_vars_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(1),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____try_io_state_vars_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____try_io_state_vars_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "try_io_state_vars",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_try_io_state_vars_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_try_io_state_vars_0 },
  (MR_Integer) 1,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_try_io_state_vars_0,

};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_unify_mode_0 = {
  &mercury__list__list__type_ctor_info_list_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_mode_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unification_0_0[7] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_cons_id_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_unify_mode_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_how_to_construct_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_cell_is_unique_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_construct_sub_info_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_unification_0_0[7] = {
  (MR_String) "construct_cell_var",
  (MR_String) "construct_cons_id",
  (MR_String) "construct_args",
  (MR_String) "construct_arg_modes",
  (MR_String) "construct_how",
  (MR_String) "construct_is_unique",
  (MR_String) "construct_sub_info"
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_unification_0_0[7] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 2,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 3,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 4,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 5,
    (MR_Integer) 0,
    (MR_Integer) 1
  },
  {
    (MR_Integer) 6,
    (MR_Integer) 0,
    (MR_Integer) 0
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unification_0_0 = {
  (MR_String) "construct",
  INT16_C(7),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_unification_0_0,
  hlds__hlds_goal__hlds__hlds_goal__field_names_unification_0_0,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_unification_0_0,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unification_0_1[6] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_cons_id_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_unify_mode_0),
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_can_fail_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_can_cgc_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_unification_0_1[6] = {
  (MR_String) "deconstruct_cell_var",
  (MR_String) "deconstruct_cons_id",
  (MR_String) "deconstruct_args",
  (MR_String) "deconstruct_arg_modes",
  (MR_String) "deconstruct_can_fail",
  (MR_String) "deconstruct_can_cgc"
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_unification_0_1[6] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 2,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 3,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 4,
    (MR_Integer) 1,
    (MR_Integer) 1
  },
  {
    (MR_Integer) 4,
    (MR_Integer) 0,
    (MR_Integer) 1
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unification_0_1 = {
  (MR_String) "deconstruct",
  INT16_C(6),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(1),
  (MR_Integer) -1,
  INT32_C(1),
  hlds__hlds_goal__hlds__hlds_goal__field_types_unification_0_1,
  hlds__hlds_goal__hlds__hlds_goal__field_names_unification_0_1,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_unification_0_1,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unification_0_2[2] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_unification_0_2[2] = {
  (MR_String) "assign_to_var",
  (MR_String) "assign_from_var"
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unification_0_2 = {
  (MR_String) "assign",
  INT16_C(2),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(2),
  (MR_Integer) -1,
  INT32_C(2),
  hlds__hlds_goal__hlds__hlds_goal__field_types_unification_0_2,
  hlds__hlds_goal__hlds__hlds_goal__field_names_unification_0_2,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unification_0_3[2] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_unification_0_3[2] = {
  (MR_String) "test_var1",
  (MR_String) "test_var2"
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unification_0_3 = {
  (MR_String) "simple_test",
  INT16_C(2),
  UINT16_C(0),
  MR_SECTAG_REMOTE_FULL_WORD,
  UINT8_C(3),
  (MR_Integer) 0,
  INT32_C(3),
  hlds__hlds_goal__hlds__hlds_goal__field_types_unification_0_3,
  hlds__hlds_goal__hlds__hlds_goal__field_names_unification_0_3,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unification_0_4[3] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_mode_0),
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_can_fail_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_unification_0_4[3] = {
  (MR_String) "compl_unify_mode",
  (MR_String) "compl_unify_can_fail",
  (MR_String) "compl_unify_typeinfos"
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_unification_0_4[3] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 0,
    (MR_Integer) 1
  },
  {
    (MR_Integer) 2,
    (MR_Integer) 0,
    (MR_Integer) 0
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unification_0_4 = {
  (MR_String) "complicated_unify",
  INT16_C(3),
  UINT16_C(0),
  MR_SECTAG_REMOTE_FULL_WORD,
  UINT8_C(3),
  (MR_Integer) 1,
  INT32_C(4),
  hlds__hlds_goal__hlds__hlds_goal__field_types_unification_0_4,
  hlds__hlds_goal__hlds__hlds_goal__field_names_unification_0_4,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_unification_0_4,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unification_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unification_0_0 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unification_0_1[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unification_0_1 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unification_0_2[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unification_0_2 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unification_0_3[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unification_0_3,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unification_0_4
};

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_unification_0[4] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unification_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unification_0_1,
    INT8_C(-1),
    UINT8_C(1),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unification_0_2,
    INT8_C(-1),
    UINT8_C(2),
    UINT8_C(1)
  },
  {
    UINT32_C(2),
    MR_SECTAG_REMOTE_FULL_WORD,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unification_0_3,
    INT8_C(-1),
    UINT8_C(3),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_unification_0[5] = {
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unification_0_2,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unification_0_4,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unification_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unification_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unification_0_3
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_unification_0[5] = {
  (MR_Integer) 2,
  (MR_Integer) 3,
  (MR_Integer) 0,
  (MR_Integer) 4,
  (MR_Integer) 1
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unification_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(4),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____unification_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____unification_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "unification",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_unification_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_unification_0 },
  (MR_Integer) 5,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_unification_0,

};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_unify_sub_context_0 = {
  &mercury__list__list__type_ctor_info_list_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_sub_context_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unify_context_0_0[2] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_main_context_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_unify_sub_context_0)
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_context_0_0 = {
  (MR_String) "unify_context",
  INT16_C(2),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_unify_context_0_0,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_context_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_context_0_0 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_unify_context_0[1] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_context_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_unify_context_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_context_0_0 };

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_unify_context_0[1] = { (MR_Integer) 0 };

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_context_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(1),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____unify_context_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____unify_context_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "unify_context",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_unify_context_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_unify_context_0 },
  (MR_Integer) 1,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_unify_context_0,

};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_main_context_0_0 = {
  (MR_String) "umc_explicit",
  INT16_C(0),
  UINT16_C(0),
  MR_SECTAG_LOCAL_REST_OF_WORD,
  UINT8_C(0),
  (MR_Integer) 0,
  INT32_C(0),
  NULL,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unify_main_context_0_1[1] = { (MR_PseudoTypeInfo) (&mercury__builtin__builtin__type_ctor_info_int_0) };

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_main_context_0_1 = {
  (MR_String) "umc_head",
  INT16_C(1),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(1),
  (MR_Integer) -1,
  INT32_C(1),
  hlds__hlds_goal__hlds__hlds_goal__field_types_unify_main_context_0_1,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_main_context_0_2 = {
  (MR_String) "umc_head_result",
  INT16_C(0),
  UINT16_C(0),
  MR_SECTAG_LOCAL_REST_OF_WORD,
  UINT8_C(0),
  (MR_Integer) 1,
  INT32_C(2),
  NULL,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unify_main_context_0_3[2] = {
  (MR_PseudoTypeInfo) (&hlds__hlds_pred__hlds__hlds_pred__type_ctor_info_call_id_0),
  (MR_PseudoTypeInfo) (&mercury__builtin__builtin__type_ctor_info_int_0)
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_main_context_0_3 = {
  (MR_String) "umc_call",
  INT16_C(2),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(2),
  (MR_Integer) -1,
  INT32_C(3),
  hlds__hlds_goal__hlds__hlds_goal__field_types_unify_main_context_0_3,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unify_main_context_0_4[1] = { (MR_PseudoTypeInfo) (&mercury__builtin__builtin__type_ctor_info_string_0) };

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_main_context_0_4 = {
  (MR_String) "umc_implicit",
  INT16_C(1),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(3),
  (MR_Integer) -1,
  INT32_C(4),
  hlds__hlds_goal__hlds__hlds_goal__field_types_unify_main_context_0_4,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_main_context_0_0[2] = {
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_main_context_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_main_context_0_2
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_main_context_0_1[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_main_context_0_1 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_main_context_0_2[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_main_context_0_3 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_main_context_0_3[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_main_context_0_4 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_unify_main_context_0[4] = {
  {
    UINT32_C(2),
    MR_SECTAG_LOCAL_REST_OF_WORD,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_main_context_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_main_context_0_1,
    INT8_C(-1),
    UINT8_C(1),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_main_context_0_2,
    INT8_C(-1),
    UINT8_C(2),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_main_context_0_3,
    INT8_C(-1),
    UINT8_C(3),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_unify_main_context_0[5] = {
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_main_context_0_3,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_main_context_0_0,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_main_context_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_main_context_0_2,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_main_context_0_4
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_unify_main_context_0[5] = {
  (MR_Integer) 1,
  (MR_Integer) 2,
  (MR_Integer) 3,
  (MR_Integer) 0,
  (MR_Integer) 4
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_main_context_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(4),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____unify_main_context_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____unify_main_context_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "unify_main_context",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_unify_main_context_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_unify_main_context_0 },
  (MR_Integer) 5,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_unify_main_context_0,

};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unify_mode_0_0[4] = {
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_mer_inst_0),
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_mer_inst_0),
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_mer_inst_0),
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_mer_inst_0)
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_mode_0_0 = {
  (MR_String) "unify_modes_li_lf_ri_rf",
  INT16_C(4),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_unify_mode_0_0,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_mode_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_mode_0_0 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_unify_mode_0[1] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_mode_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_unify_mode_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_mode_0_0 };

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_unify_mode_0[1] = { (MR_Integer) 0 };

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_mode_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(1),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____unify_mode_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____unify_mode_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "unify_mode",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_unify_mode_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_unify_mode_0 },
  (MR_Integer) 1,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_unify_mode_0,

};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unify_rhs_0_0[1] = { (MR_PseudoTypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0) };

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_rhs_0_0 = {
  (MR_String) "rhs_var",
  INT16_C(1),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_unify_rhs_0_0,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unify_rhs_0_1[3] = {
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_cons_id_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_is_exist_constr_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_unify_rhs_0_1[3] = {
  (MR_String) "rhs_cons_id",
  (MR_String) "rhs_is_exist_constr",
  (MR_String) "rhs_args"
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_unify_rhs_0_1[3] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 0,
    (MR_Integer) 1
  },
  {
    (MR_Integer) 2,
    (MR_Integer) 0,
    (MR_Integer) 0
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_rhs_0_1 = {
  (MR_String) "rhs_functor",
  INT16_C(3),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(1),
  (MR_Integer) -1,
  INT32_C(1),
  hlds__hlds_goal__hlds__hlds_goal__field_types_unify_rhs_0_1,
  hlds__hlds_goal__hlds__hlds_goal__field_names_unify_rhs_0_1,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_unify_rhs_0_1,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_FA_TypeInfo_Struct2 hlds__hlds_goal__pair__ti_pair_2term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0parse_tree__prog_data__type_ctor_info_mer_mode_0 = {
  &mercury__pair__pair__type_ctor_info_pair_2,
  {
    (MR_TypeInfo) (&hlds__hlds_goal__term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
    (MR_TypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_mer_mode_0)
  }
};

static const MR_FA_TypeInfo_Struct1 hlds__hlds_goal__list__ti_list_1pair__ti_pair_2term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0parse_tree__prog_data__type_ctor_info_mer_mode_0 = {
  &mercury__list__list__type_ctor_info_list_1,
  { (MR_TypeInfo) (&hlds__hlds_goal__pair__ti_pair_2term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0parse_tree__prog_data__type_ctor_info_mer_mode_0) }
};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unify_rhs_0_2[8] = {
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_purity_0),
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_ho_groundness_0),
  (MR_PseudoTypeInfo) (&mdbcomp__prim_data__mdbcomp__prim_data__type_ctor_info_pred_or_func_0),
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_lambda_eval_method_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1pair__ti_pair_2term__ti_var_1parse_tree__prog_data__type_ctor_info_prog_var_type_0parse_tree__prog_data__type_ctor_info_mer_mode_0),
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_determinism_0),
  (MR_PseudoTypeInfo) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0)
};

static const MR_ConstString hlds__hlds_goal__hlds__hlds_goal__field_names_unify_rhs_0_2[8] = {
  (MR_String) "rhs_purity",
  (MR_String) "rhs_groundness",
  (MR_String) "rhs_p_or_f",
  (MR_String) "rhs_eval_method",
  (MR_String) "rhs_closure_vars",
  (MR_String) "rhs_arg_vars_modes",
  (MR_String) "rhs_detism",
  (MR_String) "rhs_lambda_goal"
};

static const MR_DuArgLocn hlds__hlds_goal__hlds__hlds_goal__field_locns_unify_rhs_0_2[8] = {
  {
    (MR_Integer) 0,
    (MR_Integer) 2,
    (MR_Integer) 2
  },
  {
    (MR_Integer) 0,
    (MR_Integer) 1,
    (MR_Integer) 1
  },
  {
    (MR_Integer) 0,
    (MR_Integer) 0,
    (MR_Integer) 1
  },
  {
    (MR_Integer) 1,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 2,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 3,
    (MR_Integer) 0,
    (MR_Integer) 0
  },
  {
    (MR_Integer) 4,
    (MR_Integer) 0,
    (MR_Integer) 3
  },
  {
    (MR_Integer) 5,
    (MR_Integer) 0,
    (MR_Integer) 0
  }
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_rhs_0_2 = {
  (MR_String) "rhs_lambda_goal",
  INT16_C(8),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(2),
  (MR_Integer) -1,
  INT32_C(2),
  hlds__hlds_goal__hlds__hlds_goal__field_types_unify_rhs_0_2,
  hlds__hlds_goal__hlds__hlds_goal__field_names_unify_rhs_0_2,
  hlds__hlds_goal__hlds__hlds_goal__field_locns_unify_rhs_0_2,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_rhs_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_rhs_0_0 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_rhs_0_1[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_rhs_0_1 };

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_rhs_0_2[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_rhs_0_2 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_unify_rhs_0[3] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_rhs_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_rhs_0_1,
    INT8_C(-1),
    UINT8_C(1),
    UINT8_C(1)
  },
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_rhs_0_2,
    INT8_C(-1),
    UINT8_C(2),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_unify_rhs_0[3] = {
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_rhs_0_1,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_rhs_0_2,
  &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_rhs_0_0
};

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_unify_rhs_0[3] = {
  (MR_Integer) 2,
  (MR_Integer) 0,
  (MR_Integer) 1
};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_rhs_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(3),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____unify_rhs_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____unify_rhs_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "unify_rhs",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_unify_rhs_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_unify_rhs_0 },
  (MR_Integer) 3,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_unify_rhs_0,

};

static const MR_PseudoTypeInfo hlds__hlds_goal__hlds__hlds_goal__field_types_unify_sub_context_0_0[2] = {
  (MR_PseudoTypeInfo) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_cons_id_0),
  (MR_PseudoTypeInfo) (&mercury__builtin__builtin__type_ctor_info_int_0)
};

static const MR_DuFunctorDesc hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_sub_context_0_0 = {
  (MR_String) "unify_sub_context",
  INT16_C(2),
  UINT16_C(0),
  MR_SECTAG_NONE,
  UINT8_C(0),
  (MR_Integer) -1,
  INT32_C(0),
  hlds__hlds_goal__hlds__hlds_goal__field_types_unify_sub_context_0_0,
  NULL,
  NULL,
  NULL,
  MR_FUNCTOR_SUBTYPE_NONE,
  UINT8_C(0)
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_sub_context_0_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_sub_context_0_0 };

static const MR_DuPtagLayout hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_unify_sub_context_0[1] = {
  {
    UINT32_C(1),
    MR_SECTAG_NONE,
    hlds__hlds_goal__hlds__hlds_goal__du_stag_ordered_unify_sub_context_0_0,
    INT8_C(-1),
    UINT8_C(0),
    UINT8_C(1)
  }
};

static const MR_DuFunctorDescPtr hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_unify_sub_context_0[1] = { &hlds__hlds_goal__hlds__hlds_goal__du_functor_desc_unify_sub_context_0_0 };

static const MR_Integer hlds__hlds_goal__hlds__hlds_goal__functor_number_map_unify_sub_context_0[1] = { (MR_Integer) 0 };

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_sub_context_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(1),
  MR_TYPECTOR_REP_DU,
  ((MR_Box) (hlds__hlds_goal____Unify____unify_sub_context_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____unify_sub_context_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "unify_sub_context",
  { hlds__hlds_goal__hlds__hlds_goal__du_name_ordered_unify_sub_context_0 },
  { hlds__hlds_goal__hlds__hlds_goal__du_ptag_ordered_unify_sub_context_0 },
  (MR_Integer) 1,
  UINT16_C(12),
  hlds__hlds_goal__hlds__hlds_goal__functor_number_map_unify_sub_context_0,

};

const MR_TypeCtorInfo_Struct hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_sub_contexts_0 = {
  (MR_Integer) 0,
  UINT8_C(18),
  INT8_C(-1),
  MR_TYPECTOR_REP_EQUIV_GROUND,
  ((MR_Box) (hlds__hlds_goal____Unify____unify_sub_contexts_0_0_10001)),
  ((MR_Box) (hlds__hlds_goal____Compare____unify_sub_contexts_0_0_10001)),
  (MR_String) "hlds.hlds_goal",
  (MR_String) "unify_sub_contexts",
  { NULL },
  { (MR_PseudoTypeInfo) (&hlds__hlds_goal__list__ti_list_1hlds__hlds_goal__type_ctor_info_unify_sub_context_0) },
  (MR_Integer) -1,
  UINT16_C(0),
  NULL,

};

static void MR_CALL 
hlds__hlds_goal__IntroducedFrom__pred__goal_list_purity__3541__1_3_p_0(
  MR_Word LambdaHeadVar__1_12,
  MR_Word LambdaHeadVar__2_13,
  MR_Word * LambdaHeadVar__3_14)
{
  MR_Word GoalInfo_10 = ((MR_Word) ((MR_hl_field(0, LambdaHeadVar__1_12, (MR_Integer) 1))));
  MR_Word Purity1_11 = ((MR_Unsigned) ((MR_hl_field(0, GoalInfo_10, (MR_Integer) 0))) & (MR_Integer) 3);

  *LambdaHeadVar__3_14 = parse_tree__prog_data__worst_purity_2_f_0(LambdaHeadVar__2_13, Purity1_11);
}

static void MR_CALL 
hlds__hlds_goal__IntroducedFrom__pred__goal_list_determinism__3533__1_3_p_0(
  MR_Word LambdaHeadVar__1_12,
  MR_Word LambdaHeadVar__2_13,
  MR_Word * LambdaHeadVar__3_14)
{
  MR_Word GoalInfo_10 = ((MR_Word) ((MR_hl_field(0, LambdaHeadVar__1_12, (MR_Integer) 1))));
  MR_Word Det1_11 = ((((MR_Unsigned) ((MR_hl_field(0, GoalInfo_10, (MR_Integer) 0))) >> 2)) & (MR_Integer) 7);

  parse_tree__prog_detism__det_conjunction_detism_3_p_0(LambdaHeadVar__2_13, Det1_11, LambdaHeadVar__3_14);
}

static void MR_CALL 
hlds__hlds_goal__IntroducedFrom__pred__goal_list_instmap_delta__3524__1_3_p_0(
  MR_Word LambdaHeadVar__1_13,
  MR_Word LambdaHeadVar__2_14,
  MR_Word * LambdaHeadVar__3_15)
{
  MR_Word GoalInfo_10 = ((MR_Word) ((MR_hl_field(0, LambdaHeadVar__1_13, (MR_Integer) 1))));
  MR_Word Delta1_11 = ((MR_Word) ((MR_hl_field(0, GoalInfo_10, (MR_Integer) 1))));

  hlds__instmap__instmap_delta_apply_instmap_delta_4_p_0(LambdaHeadVar__2_14, Delta1_11, (MR_Integer) 2, LambdaHeadVar__3_15);
}

void MR_CALL 
hlds__hlds_goal____Compare____unify_sub_contexts_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_Word Cast_HeadVar1_4 = HeadVar__2_2;
  MR_Word Cast_HeadVar2_5 = HeadVar__3_3;

  mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[36]), HeadVar__1_1, ((MR_Box) (Cast_HeadVar1_4)), ((MR_Box) (Cast_HeadVar2_5)));
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____unify_sub_contexts_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Word Cast_HeadVar1_3 = HeadVar__1_1;
  MR_Word Cast_HeadVar2_4 = HeadVar__2_2;

  succeeded = mercury__builtin__unify_2_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[36]), ((MR_Box) (Cast_HeadVar1_3)), ((MR_Box) (Cast_HeadVar2_4)));
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____unify_sub_context_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_9 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_10 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_9 == CastY_10);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  {
    MR_Word ArgX1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));
    MR_Integer ArgX2_7 = ((MR_Integer) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Integer ArgY2_8 = ((MR_Integer) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word SubResult1_6;

    parse_tree__prog_data____Compare____cons_id_0_0(&SubResult1_6, ArgX1_4, ArgY1_5);
    succeeded = (SubResult1_6 != (MR_Integer) 0);
    if (succeeded)
      *HeadVar__1_1 = SubResult1_6;
    else
    {
      succeeded = (ArgX2_7 < ArgY2_8);
      if (succeeded)
        *HeadVar__1_1 = (MR_Integer) 1;
      else
      {
        succeeded = (ArgX2_7 > ArgY2_8);
        if (succeeded)
          *HeadVar__1_1 = (MR_Integer) 2;
        else
          *HeadVar__1_1 = (MR_Integer) 0;
      }
    }
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____unify_sub_context_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_7 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_8 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_7 == CastY_8);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  {
    MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
    MR_Word ArgY1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Integer ArgX2_5 = ((MR_Integer) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
    MR_Integer ArgY2_6 = ((MR_Integer) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));

    succeeded = parse_tree__prog_data____Unify____cons_id_0_0(ArgX1_3, ArgY1_4);
    if (succeeded)
      succeeded = (ArgX2_5 == ArgY2_6);
  }
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____try_io_state_vars_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_9 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_10 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_9 == CastY_10);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  {
    MR_Word ArgX1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));
    MR_Word ArgX2_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgY2_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word SubResult1_6;

    mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), &SubResult1_6, ((MR_Box) (ArgX1_4)), ((MR_Box) (ArgY1_5)));
    succeeded = (SubResult1_6 != (MR_Integer) 0);
    if (succeeded)
      *HeadVar__1_1 = SubResult1_6;
    else
      mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), HeadVar__1_1, ((MR_Box) (ArgX2_7)), ((MR_Box) (ArgY2_8)));
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____try_io_state_vars_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_7 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_8 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_7 == CastY_8);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  {
    MR_Word TypeInfo_10_10;
    MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
    MR_Word ArgY1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgX2_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
    MR_Word ArgY2_6 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));

    succeeded = mercury__builtin__unify_2_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), ((MR_Box) (ArgX1_3)), ((MR_Box) (ArgY1_4)));
    if (succeeded)
    {
      TypeInfo_10_10 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]);
      succeeded = mercury__builtin__unify_2_p_0(TypeInfo_10_10, ((MR_Box) (ArgX2_5)), ((MR_Box) (ArgY2_6)));
    }
  }
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____trace_mutable_var_hlds_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_9 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_10 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_9 == CastY_10);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  {
    MR_String ArgX1_4 = ((MR_String) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_String ArgY1_5 = ((MR_String) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));
    MR_String ArgX2_7 = ((MR_String) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_String ArgY2_8 = ((MR_String) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word SubResult1_6;

    mercury__private_builtin__builtin_compare_string_3_p_0(&SubResult1_6, ArgX1_4, ArgY1_5);
    succeeded = (SubResult1_6 != (MR_Integer) 0);
    if (succeeded)
      *HeadVar__1_1 = SubResult1_6;
    else
      mercury__private_builtin__builtin_compare_string_3_p_0(HeadVar__1_1, ArgX2_7, ArgY2_8);
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____trace_mutable_var_hlds_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_7 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_8 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_7 == CastY_8);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  {
    MR_String ArgX1_3 = ((MR_String) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
    MR_String ArgY1_4 = ((MR_String) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_String ArgX2_5 = ((MR_String) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
    MR_String ArgY2_6 = ((MR_String) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));

    succeeded = (strcmp(ArgX1_3, ArgY1_4) == 0);
    if (succeeded)
      succeeded = (strcmp(ArgX2_5, ArgY2_6) == 0);
  }
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____term_size_value_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_12 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_13 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_12 == CastY_13);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  if (((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 1))
  {
    MR_Word Var_16 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))));

    if (((MR_tag((MR_Word) HeadVar__3_3)) == (MR_Integer) 1))
    {
      MR_Word ArgY1_11 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 0))));

      mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), HeadVar__1_1, ((MR_Box) (Var_16)), ((MR_Box) (ArgY1_11)));
    }
    else
      *HeadVar__1_1 = (MR_Integer) 2;
  }
  else
  {
    MR_Integer Var_17 = ((MR_Integer) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));

    if (((MR_tag((MR_Word) HeadVar__3_3)) == (MR_Integer) 1))
      *HeadVar__1_1 = (MR_Integer) 1;
    else
    {
      MR_Integer ArgY1_5 = ((MR_Integer) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));

      succeeded = (Var_17 < ArgY1_5);
      if (succeeded)
        *HeadVar__1_1 = (MR_Integer) 1;
      else
      {
        succeeded = (Var_17 > ArgY1_5);
        if (succeeded)
          *HeadVar__1_1 = (MR_Integer) 2;
        else
          *HeadVar__1_1 = (MR_Integer) 0;
      }
    }
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____term_size_value_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_7 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_8 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_7 == CastY_8);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  if (((MR_tag((MR_Word) HeadVar__1_1)) == (MR_Integer) 1))
  {
    MR_Word TypeInfo_9_9;
    MR_Word ArgX1_5 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 0))));
    MR_Word ArgY1_6;

    succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 1);
    if (succeeded)
    {
      ArgY1_6 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))));
      TypeInfo_9_9 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]);
      succeeded = mercury__builtin__unify_2_p_0(TypeInfo_9_9, ((MR_Box) (ArgX1_5)), ((MR_Box) (ArgY1_6)));
    }
  }
  else
  {
    MR_Integer ArgX1_3 = ((MR_Integer) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
    MR_Integer ArgY1_4;

    succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 0);
    if (succeeded)
    {
      ArgY1_4 = ((MR_Integer) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
      succeeded = (ArgX1_3 == ArgY1_4);
    }
  }
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____tagged_case_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_15 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_16 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_15 == CastY_16);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  {
    MR_Word ArgX1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));
    MR_Word ArgX2_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgY2_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word ArgX3_10 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));
    MR_Word ArgY3_11 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 2))));
    MR_Word ArgX4_13 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 3))));
    MR_Word ArgY4_14 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 3))));
    MR_Word SubResult1_6;

    hlds__hlds_data____Compare____tagged_cons_id_0_0(&SubResult1_6, ArgX1_4, ArgY1_5);
    succeeded = (SubResult1_6 != (MR_Integer) 0);
    if (succeeded)
      *HeadVar__1_1 = SubResult1_6;
    else
    {
      MR_Word SubResult2_9;

      mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[34]), &SubResult2_9, ((MR_Box) (ArgX2_7)), ((MR_Box) (ArgY2_8)));
      succeeded = (SubResult2_9 != (MR_Integer) 0);
      if (succeeded)
        *HeadVar__1_1 = SubResult2_9;
      else
      {
        MR_Word SubResult3_12;
        MR_Integer Var_21 = (MR_Integer) (ArgX3_10);
        MR_Integer Var_22 = (MR_Integer) (ArgY3_11);

        succeeded = (Var_21 < Var_22);
        if (succeeded)
        {
          SubResult3_12 = (MR_Integer) 1;
          succeeded = MR_TRUE;
        }
        else
        {
          succeeded = (Var_21 > Var_22);
          if (succeeded)
          {
            SubResult3_12 = (MR_Integer) 2;
            succeeded = MR_TRUE;
          }
          else
          {
            succeeded = MR_TRUE;
            succeeded = !(succeeded);
            if (succeeded)
            {
              SubResult3_12 = (MR_Integer) 0;
              succeeded = MR_TRUE;
            }
          }
        }
        if (succeeded)
          *HeadVar__1_1 = SubResult3_12;
        else
          hlds__hlds_goal____Compare____hlds_goal_0_0(HeadVar__1_1, ArgX4_13, ArgY4_14);
      }
    }
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____tagged_case_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_11 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_12 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_11 == CastY_12);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  {
    MR_Word TypeInfo_14_14;
    MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
    MR_Word ArgY1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgX2_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
    MR_Word ArgY2_6 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgX3_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 2))));
    MR_Word ArgY3_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));
    MR_Word ArgX4_9 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 3))));
    MR_Word ArgY4_10 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 3))));
    MR_Integer CastX_17;
    MR_Integer CastY_18;

    succeeded = hlds__hlds_data____Unify____tagged_cons_id_0_0(ArgX1_3, ArgY1_4);
    if (succeeded)
    {
      TypeInfo_14_14 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[34]);
      succeeded = mercury__builtin__unify_2_p_0(TypeInfo_14_14, ((MR_Box) (ArgX2_5)), ((MR_Box) (ArgY2_6)));
      if (succeeded)
      {
        CastX_17 = (MR_Integer) (ArgX3_7);
        CastY_18 = (MR_Integer) (ArgY3_8);
        succeeded = (CastX_17 == CastY_18);
        if (succeeded)
          succeeded = MR_TRUE;
        else
        {
          MR_Integer ArgX1_15 = (MR_Integer) (ArgX3_7);
          MR_Integer ArgY1_16 = (MR_Integer) (ArgY3_8);

          succeeded = (ArgX1_15 == ArgY1_16);
        }
        if (succeeded)
          succeeded = hlds__hlds_goal____Unify____hlds_goal_0_0(ArgX4_9, ArgY4_10);
      }
    }
  }
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____static_how_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer Cast_HeadVar1_4 = (MR_Integer) (HeadVar__2_2);
  MR_Integer Cast_HeadVar2_5 = (MR_Integer) (HeadVar__3_3);

  succeeded = (Cast_HeadVar1_4 < Cast_HeadVar2_5);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    succeeded = (Cast_HeadVar1_4 > Cast_HeadVar2_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 2;
    else
      *HeadVar__1_1 = (MR_Integer) 0;
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____static_how_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded = (HeadVar__1_1 == HeadVar__2_2);

  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____removable_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer Cast_HeadVar1_4 = (MR_Integer) (HeadVar__2_2);
  MR_Integer Cast_HeadVar2_5 = (MR_Integer) (HeadVar__3_3);

  succeeded = (Cast_HeadVar1_4 < Cast_HeadVar2_5);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    succeeded = (Cast_HeadVar1_4 > Cast_HeadVar2_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 2;
    else
      *HeadVar__1_1 = (MR_Integer) 0;
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____removable_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded = (HeadVar__1_1 == HeadVar__2_2);

  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____rbmm_goal_info_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_18 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_19 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_18 == CastY_19);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  {
    MR_Word ArgX1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));
    MR_Word ArgX2_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgY2_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word ArgX3_10 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));
    MR_Word ArgY3_11 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 2))));
    MR_Word ArgX4_13 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 3))));
    MR_Word ArgY4_14 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 3))));
    MR_Word ArgX5_16 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 4))));
    MR_Word ArgY5_17 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 4))));
    MR_Word SubResult1_6;

    mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[24]), &SubResult1_6, ((MR_Box) (ArgX1_4)), ((MR_Box) (ArgY1_5)));
    succeeded = (SubResult1_6 != (MR_Integer) 0);
    if (succeeded)
      *HeadVar__1_1 = SubResult1_6;
    else
    {
      MR_Word SubResult2_9;

      mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[24]), &SubResult2_9, ((MR_Box) (ArgX2_7)), ((MR_Box) (ArgY2_8)));
      succeeded = (SubResult2_9 != (MR_Integer) 0);
      if (succeeded)
        *HeadVar__1_1 = SubResult2_9;
      else
      {
        MR_Word SubResult3_12;

        mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[24]), &SubResult3_12, ((MR_Box) (ArgX3_10)), ((MR_Box) (ArgY3_11)));
        succeeded = (SubResult3_12 != (MR_Integer) 0);
        if (succeeded)
          *HeadVar__1_1 = SubResult3_12;
        else
        {
          MR_Word SubResult4_15;

          mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[24]), &SubResult4_15, ((MR_Box) (ArgX4_13)), ((MR_Box) (ArgY4_14)));
          succeeded = (SubResult4_15 != (MR_Integer) 0);
          if (succeeded)
            *HeadVar__1_1 = SubResult4_15;
          else
            mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[24]), HeadVar__1_1, ((MR_Box) (ArgX5_16)), ((MR_Box) (ArgY5_17)));
        }
      }
    }
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____rbmm_goal_info_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_13 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_14 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_13 == CastY_14);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  {
    MR_Word TypeInfo_16_16;
    MR_Word TypeInfo_17_17;
    MR_Word TypeInfo_18_18;
    MR_Word TypeInfo_19_19;
    MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
    MR_Word ArgY1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgX2_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
    MR_Word ArgY2_6 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgX3_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 2))));
    MR_Word ArgY3_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));
    MR_Word ArgX4_9 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 3))));
    MR_Word ArgY4_10 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 3))));
    MR_Word ArgX5_11 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 4))));
    MR_Word ArgY5_12 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 4))));

    succeeded = mercury__builtin__unify_2_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[24]), ((MR_Box) (ArgX1_3)), ((MR_Box) (ArgY1_4)));
    if (succeeded)
    {
      TypeInfo_16_16 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[24]);
      succeeded = mercury__builtin__unify_2_p_0(TypeInfo_16_16, ((MR_Box) (ArgX2_5)), ((MR_Box) (ArgY2_6)));
      if (succeeded)
      {
        TypeInfo_17_17 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[24]);
        succeeded = mercury__builtin__unify_2_p_0(TypeInfo_17_17, ((MR_Box) (ArgX3_7)), ((MR_Box) (ArgY3_8)));
        if (succeeded)
        {
          TypeInfo_18_18 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[24]);
          succeeded = mercury__builtin__unify_2_p_0(TypeInfo_18_18, ((MR_Box) (ArgX4_9)), ((MR_Box) (ArgY4_10)));
          if (succeeded)
          {
            TypeInfo_19_19 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[24]);
            succeeded = mercury__builtin__unify_2_p_0(TypeInfo_19_19, ((MR_Box) (ArgX5_11)), ((MR_Box) (ArgY5_12)));
          }
        }
      }
    }
  }
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____quant_creator_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer Cast_HeadVar1_4 = (MR_Integer) (HeadVar__2_2);
  MR_Integer Cast_HeadVar2_5 = (MR_Integer) (HeadVar__3_3);

  succeeded = (Cast_HeadVar1_4 < Cast_HeadVar2_5);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    succeeded = (Cast_HeadVar1_4 > Cast_HeadVar2_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 2;
    else
      *HeadVar__1_1 = (MR_Integer) 0;
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____quant_creator_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded = (HeadVar__1_1 == HeadVar__2_2);

  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____promise_solutions_kind_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer Cast_HeadVar1_4 = (MR_Integer) (HeadVar__2_2);
  MR_Integer Cast_HeadVar2_5 = (MR_Integer) (HeadVar__3_3);

  succeeded = (Cast_HeadVar1_4 < Cast_HeadVar2_5);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    succeeded = (Cast_HeadVar1_4 > Cast_HeadVar2_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 2;
    else
      *HeadVar__1_1 = (MR_Integer) 0;
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____promise_solutions_kind_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded = (HeadVar__1_1 == HeadVar__2_2);

  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____port_counts_give_coverage_after_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer Cast_HeadVar1_4 = (MR_Integer) (HeadVar__2_2);
  MR_Integer Cast_HeadVar2_5 = (MR_Integer) (HeadVar__3_3);

  succeeded = (Cast_HeadVar1_4 < Cast_HeadVar2_5);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    succeeded = (Cast_HeadVar1_4 > Cast_HeadVar2_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 2;
    else
      *HeadVar__1_1 = (MR_Integer) 0;
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____port_counts_give_coverage_after_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded = (HeadVar__1_1 == HeadVar__2_2);

  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____needs_update_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer Cast_HeadVar1_4 = (MR_Integer) (HeadVar__2_2);
  MR_Integer Cast_HeadVar2_5 = (MR_Integer) (HeadVar__3_3);

  succeeded = (Cast_HeadVar1_4 < Cast_HeadVar2_5);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    succeeded = (Cast_HeadVar1_4 > Cast_HeadVar2_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 2;
    else
      *HeadVar__1_1 = (MR_Integer) 0;
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____needs_update_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded = (HeadVar__1_1 == HeadVar__2_2);

  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____mode_constr_goal_info_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_18 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_19 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_18 == CastY_19);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  {
    MR_Word ArgX1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));
    MR_Word ArgX2_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgY2_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word ArgX3_10 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));
    MR_Word ArgY3_11 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 2))));
    MR_Word ArgX4_13 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 3))));
    MR_Word ArgY4_14 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 3))));
    MR_Word ArgX5_16 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 4))));
    MR_Word ArgY5_17 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 4))));
    MR_Word SubResult1_6;

    mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[3]), &SubResult1_6, ((MR_Box) (ArgX1_4)), ((MR_Box) (ArgY1_5)));
    succeeded = (SubResult1_6 != (MR_Integer) 0);
    if (succeeded)
      *HeadVar__1_1 = SubResult1_6;
    else
    {
      MR_Word SubResult2_9;

      mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[3]), &SubResult2_9, ((MR_Box) (ArgX2_7)), ((MR_Box) (ArgY2_8)));
      succeeded = (SubResult2_9 != (MR_Integer) 0);
      if (succeeded)
        *HeadVar__1_1 = SubResult2_9;
      else
      {
        MR_Word SubResult3_12;

        mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[3]), &SubResult3_12, ((MR_Box) (ArgX3_10)), ((MR_Box) (ArgY3_11)));
        succeeded = (SubResult3_12 != (MR_Integer) 0);
        if (succeeded)
          *HeadVar__1_1 = SubResult3_12;
        else
        {
          MR_Word SubResult4_15;

          mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[3]), &SubResult4_15, ((MR_Box) (ArgX4_13)), ((MR_Box) (ArgY4_14)));
          succeeded = (SubResult4_15 != (MR_Integer) 0);
          if (succeeded)
            *HeadVar__1_1 = SubResult4_15;
          else
            mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[3]), HeadVar__1_1, ((MR_Box) (ArgX5_16)), ((MR_Box) (ArgY5_17)));
        }
      }
    }
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____mode_constr_goal_info_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_13 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_14 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_13 == CastY_14);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  {
    MR_Word TypeInfo_16_16;
    MR_Word TypeInfo_17_17;
    MR_Word TypeInfo_18_18;
    MR_Word TypeInfo_19_19;
    MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
    MR_Word ArgY1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgX2_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
    MR_Word ArgY2_6 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgX3_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 2))));
    MR_Word ArgY3_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));
    MR_Word ArgX4_9 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 3))));
    MR_Word ArgY4_10 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 3))));
    MR_Word ArgX5_11 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 4))));
    MR_Word ArgY5_12 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 4))));

    succeeded = mercury__builtin__unify_2_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[3]), ((MR_Box) (ArgX1_3)), ((MR_Box) (ArgY1_4)));
    if (succeeded)
    {
      TypeInfo_16_16 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[3]);
      succeeded = mercury__builtin__unify_2_p_0(TypeInfo_16_16, ((MR_Box) (ArgX2_5)), ((MR_Box) (ArgY2_6)));
      if (succeeded)
      {
        TypeInfo_17_17 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[3]);
        succeeded = mercury__builtin__unify_2_p_0(TypeInfo_17_17, ((MR_Box) (ArgX3_7)), ((MR_Box) (ArgY3_8)));
        if (succeeded)
        {
          TypeInfo_18_18 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[3]);
          succeeded = mercury__builtin__unify_2_p_0(TypeInfo_18_18, ((MR_Box) (ArgX4_9)), ((MR_Box) (ArgY4_10)));
          if (succeeded)
          {
            TypeInfo_19_19 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[3]);
            succeeded = mercury__builtin__unify_2_p_0(TypeInfo_19_19, ((MR_Box) (ArgX5_11)), ((MR_Box) (ArgY5_12)));
          }
        }
      }
    }
  }
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____missed_message_0_0(
  MR_Word * HeadVar__1_1,
  MR_String HeadVar__2_2,
  MR_String HeadVar__3_3)
{
  MR_String Cast_HeadVar1_4 = HeadVar__2_2;
  MR_String Cast_HeadVar2_5 = HeadVar__3_3;

  mercury__private_builtin__builtin_compare_string_3_p_0(HeadVar__1_1, Cast_HeadVar1_4, Cast_HeadVar2_5);
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____missed_message_0_0(
  MR_String HeadVar__1_1,
  MR_String HeadVar__2_2)
{
  MR_bool succeeded;
  MR_String Cast_HeadVar1_3 = HeadVar__1_1;
  MR_String Cast_HeadVar2_4 = HeadVar__2_2;

  succeeded = (strcmp(Cast_HeadVar1_3, Cast_HeadVar2_4) == 0);
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____lc_use_parent_stack_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer Cast_HeadVar1_4 = (MR_Integer) (HeadVar__2_2);
  MR_Integer Cast_HeadVar2_5 = (MR_Integer) (HeadVar__3_3);

  succeeded = (Cast_HeadVar1_4 < Cast_HeadVar2_5);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    succeeded = (Cast_HeadVar1_4 > Cast_HeadVar2_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 2;
    else
      *HeadVar__1_1 = (MR_Integer) 0;
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____lc_use_parent_stack_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded = (HeadVar__1_1 == HeadVar__2_2);

  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____is_first_disjunct_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer Cast_HeadVar1_4 = (MR_Integer) (HeadVar__2_2);
  MR_Integer Cast_HeadVar2_5 = (MR_Integer) (HeadVar__3_3);

  succeeded = (Cast_HeadVar1_4 < Cast_HeadVar2_5);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    succeeded = (Cast_HeadVar1_4 > Cast_HeadVar2_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 2;
    else
      *HeadVar__1_1 = (MR_Integer) 0;
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____is_first_disjunct_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded = (HeadVar__1_1 == HeadVar__2_2);

  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____is_exist_constr_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer Cast_HeadVar1_4 = (MR_Integer) (HeadVar__2_2);
  MR_Integer Cast_HeadVar2_5 = (MR_Integer) (HeadVar__3_3);

  succeeded = (Cast_HeadVar1_4 < Cast_HeadVar2_5);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    succeeded = (Cast_HeadVar1_4 > Cast_HeadVar2_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 2;
    else
      *HeadVar__1_1 = (MR_Integer) 0;
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____is_exist_constr_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded = (HeadVar__1_1 == HeadVar__2_2);

  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____is_conditional_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer Cast_HeadVar1_4 = (MR_Integer) (HeadVar__2_2);
  MR_Integer Cast_HeadVar2_5 = (MR_Integer) (HeadVar__3_3);

  succeeded = (Cast_HeadVar1_4 < Cast_HeadVar2_5);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    succeeded = (Cast_HeadVar1_4 > Cast_HeadVar2_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 2;
    else
      *HeadVar__1_1 = (MR_Integer) 0;
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____is_conditional_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded = (HeadVar__1_1 == HeadVar__2_2);

  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____incremental_rename_map_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_Word Cast_HeadVar1_4 = HeadVar__2_2;
  MR_Word Cast_HeadVar2_5 = HeadVar__3_3;

  mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_2[3]), HeadVar__1_1, ((MR_Box) (Cast_HeadVar1_4)), ((MR_Box) (Cast_HeadVar2_5)));
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____incremental_rename_map_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Word Cast_HeadVar1_3 = HeadVar__1_1;
  MR_Word Cast_HeadVar2_4 = HeadVar__2_2;

  succeeded = mercury__builtin__unify_2_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_2[3]), ((MR_Box) (Cast_HeadVar1_3)), ((MR_Box) (Cast_HeadVar2_4)));
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____hlds_goals_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_Word Cast_HeadVar1_4 = HeadVar__2_2;
  MR_Word Cast_HeadVar2_5 = HeadVar__3_3;

  mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[13]), HeadVar__1_1, ((MR_Box) (Cast_HeadVar1_4)), ((MR_Box) (Cast_HeadVar2_5)));
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____hlds_goals_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Word Cast_HeadVar1_3 = HeadVar__1_1;
  MR_Word Cast_HeadVar2_4 = HeadVar__2_2;

  succeeded = mercury__builtin__unify_2_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[13]), ((MR_Box) (Cast_HeadVar1_3)), ((MR_Box) (Cast_HeadVar2_4)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____hlds_goal_extra_info_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_27 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_28 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_27 == CastY_28);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  {
    MR_Word ArgX1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));
    MR_Word ArgX2_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgY2_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word ArgX3_10 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));
    MR_Word ArgY3_11 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 2))));
    MR_Word ArgX4_13 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 3))));
    MR_Word ArgY4_14 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 3))));
    MR_Word ArgX5_16 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 4))));
    MR_Word ArgY5_17 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 4))));
    MR_Word ArgX6_19 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 5))));
    MR_Word ArgY6_20 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 5))));
    MR_Word ArgX7_22 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 6))));
    MR_Word ArgY7_23 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 6))));
    MR_Word ArgX8_25 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 7))));
    MR_Word ArgY8_26 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 7))));
    MR_Word SubResult1_6;

    mercury__term_context____Compare____term_context_0_0(&SubResult1_6, ArgX1_4, ArgY1_5);
    succeeded = (SubResult1_6 != (MR_Integer) 0);
    if (succeeded)
      *HeadVar__1_1 = SubResult1_6;
    else
    {
      MR_Word SubResult2_9;

      mdbcomp__goal_path____Compare____reverse_goal_path_0_0(&SubResult2_9, ArgX2_7, ArgY2_8);
      succeeded = (SubResult2_9 != (MR_Integer) 0);
      if (succeeded)
        *HeadVar__1_1 = SubResult2_9;
      else
      {
        MR_Word SubResult3_12;

        mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_2[0]), &SubResult3_12, ((MR_Box) (ArgX3_10)), ((MR_Box) (ArgY3_11)));
        succeeded = (SubResult3_12 != (MR_Integer) 0);
        if (succeeded)
          *HeadVar__1_1 = SubResult3_12;
        else
        {
          MR_Word SubResult4_15;

          hlds__goal_mode____Compare____goal_mode_0_0(&SubResult4_15, ArgX4_13, ArgY4_14);
          succeeded = (SubResult4_15 != (MR_Integer) 0);
          if (succeeded)
            *HeadVar__1_1 = SubResult4_15;
          else
          {
            MR_Word SubResult5_18;

            mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[19]), &SubResult5_18, ((MR_Box) (ArgX5_16)), ((MR_Box) (ArgY5_17)));
            succeeded = (SubResult5_18 != (MR_Integer) 0);
            if (succeeded)
              *HeadVar__1_1 = SubResult5_18;
            else
            {
              MR_Word SubResult6_21;

              mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[20]), &SubResult6_21, ((MR_Box) (ArgX6_19)), ((MR_Box) (ArgY6_20)));
              succeeded = (SubResult6_21 != (MR_Integer) 0);
              if (succeeded)
                *HeadVar__1_1 = SubResult6_21;
              else
              {
                MR_Word SubResult7_24;

                mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[21]), &SubResult7_24, ((MR_Box) (ArgX7_22)), ((MR_Box) (ArgY7_23)));
                succeeded = (SubResult7_24 != (MR_Integer) 0);
                if (succeeded)
                  *HeadVar__1_1 = SubResult7_24;
                else
                  mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[22]), HeadVar__1_1, ((MR_Box) (ArgX8_25)), ((MR_Box) (ArgY8_26)));
              }
            }
          }
        }
      }
    }
  }
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____hlds_goal_extra_info_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_19 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_20 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_19 == CastY_20);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  {
    MR_Word TypeInfo_23_23;
    MR_Word TypeInfo_25_25;
    MR_Word TypeInfo_26_26;
    MR_Word TypeInfo_27_27;
    MR_Word TypeInfo_28_28;
    MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
    MR_Word ArgY1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgX2_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
    MR_Word ArgY2_6 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgX3_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 2))));
    MR_Word ArgY3_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));
    MR_Word ArgX4_9 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 3))));
    MR_Word ArgY4_10 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 3))));
    MR_Word ArgX5_11 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 4))));
    MR_Word ArgY5_12 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 4))));
    MR_Word ArgX6_13 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 5))));
    MR_Word ArgY6_14 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 5))));
    MR_Word ArgX7_15 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 6))));
    MR_Word ArgY7_16 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 6))));
    MR_Word ArgX8_17 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 7))));
    MR_Word ArgY8_18 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 7))));

    succeeded = mercury__term_context____Unify____term_context_0_0(ArgX1_3, ArgY1_4);
    if (succeeded)
    {
      succeeded = mdbcomp__goal_path____Unify____reverse_goal_path_0_0(ArgX2_5, ArgY2_6);
      if (succeeded)
      {
        TypeInfo_23_23 = (MR_Word) (&hlds__hlds_goal_scalar_common_2[0]);
        succeeded = mercury__builtin__unify_2_p_0(TypeInfo_23_23, ((MR_Box) (ArgX3_7)), ((MR_Box) (ArgY3_8)));
        if (succeeded)
        {
          succeeded = hlds__goal_mode____Unify____goal_mode_0_0(ArgX4_9, ArgY4_10);
          if (succeeded)
          {
            TypeInfo_25_25 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[19]);
            succeeded = mercury__builtin__unify_2_p_0(TypeInfo_25_25, ((MR_Box) (ArgX5_11)), ((MR_Box) (ArgY5_12)));
            if (succeeded)
            {
              TypeInfo_26_26 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[20]);
              succeeded = mercury__builtin__unify_2_p_0(TypeInfo_26_26, ((MR_Box) (ArgX6_13)), ((MR_Box) (ArgY6_14)));
              if (succeeded)
              {
                TypeInfo_27_27 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[21]);
                succeeded = mercury__builtin__unify_2_p_0(TypeInfo_27_27, ((MR_Box) (ArgX7_15)), ((MR_Box) (ArgY7_16)));
                if (succeeded)
                {
                  TypeInfo_28_28 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[22]);
                  succeeded = mercury__builtin__unify_2_p_0(TypeInfo_28_28, ((MR_Box) (ArgX8_17)), ((MR_Box) (ArgY8_18)));
                }
              }
            }
          }
        }
      }
    }
  }
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____higher_order_value_map_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_Word Cast_HeadVar1_4 = HeadVar__2_2;
  MR_Word Cast_HeadVar2_5 = HeadVar__3_3;

  mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_2[0]), HeadVar__1_1, ((MR_Box) (Cast_HeadVar1_4)), ((MR_Box) (Cast_HeadVar2_5)));
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____higher_order_value_map_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Word Cast_HeadVar1_3 = HeadVar__1_1;
  MR_Word Cast_HeadVar2_4 = HeadVar__2_2;

  succeeded = mercury__builtin__unify_2_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_2[0]), ((MR_Box) (Cast_HeadVar1_3)), ((MR_Box) (Cast_HeadVar2_4)));
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____goal_trivial_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer Cast_HeadVar1_4 = (MR_Integer) (HeadVar__2_2);
  MR_Integer Cast_HeadVar2_5 = (MR_Integer) (HeadVar__3_3);

  succeeded = (Cast_HeadVar1_4 < Cast_HeadVar2_5);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    succeeded = (Cast_HeadVar1_4 > Cast_HeadVar2_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 2;
    else
      *HeadVar__1_1 = (MR_Integer) 0;
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____goal_trivial_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded = (HeadVar__1_1 == HeadVar__2_2);

  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____goal_is_mdprof_inst_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer Cast_HeadVar1_4 = (MR_Integer) (HeadVar__2_2);
  MR_Integer Cast_HeadVar2_5 = (MR_Integer) (HeadVar__3_3);

  succeeded = (Cast_HeadVar1_4 < Cast_HeadVar2_5);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    succeeded = (Cast_HeadVar1_4 > Cast_HeadVar2_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 2;
    else
      *HeadVar__1_1 = (MR_Integer) 0;
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____goal_is_mdprof_inst_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded = (HeadVar__1_1 == HeadVar__2_2);

  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____goal_feature_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer Cast_HeadVar1_4 = (MR_Integer) (HeadVar__2_2);
  MR_Integer Cast_HeadVar2_5 = (MR_Integer) (HeadVar__3_3);

  succeeded = (Cast_HeadVar1_4 < Cast_HeadVar2_5);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    succeeded = (Cast_HeadVar1_4 > Cast_HeadVar2_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 2;
    else
      *HeadVar__1_1 = (MR_Integer) 0;
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____goal_feature_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded = (HeadVar__1_1 == HeadVar__2_2);

  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____from_ground_term_kind_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer Cast_HeadVar1_4 = (MR_Integer) (HeadVar__2_2);
  MR_Integer Cast_HeadVar2_5 = (MR_Integer) (HeadVar__3_3);

  succeeded = (Cast_HeadVar1_4 < Cast_HeadVar2_5);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    succeeded = (Cast_HeadVar1_4 > Cast_HeadVar2_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 2;
    else
      *HeadVar__1_1 = (MR_Integer) 0;
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____from_ground_term_kind_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded = (HeadVar__1_1 == HeadVar__2_2);

  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____foreign_arg_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_15 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_16 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_15 == CastY_16);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  {
    MR_Word ArgX1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));
    MR_Word ArgX2_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgY2_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word ArgX3_10 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));
    MR_Word ArgY3_11 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 2))));
    MR_Word ArgX4_13 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 3))) & (MR_Integer) 1);
    MR_Word ArgY4_14 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 3))) & (MR_Integer) 1);
    MR_Word SubResult1_6;

    mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), &SubResult1_6, ((MR_Box) (ArgX1_4)), ((MR_Box) (ArgY1_5)));
    succeeded = (SubResult1_6 != (MR_Integer) 0);
    if (succeeded)
      *HeadVar__1_1 = SubResult1_6;
    else
    {
      MR_Word SubResult2_9;

      mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[10]), &SubResult2_9, ((MR_Box) (ArgX2_7)), ((MR_Box) (ArgY2_8)));
      succeeded = (SubResult2_9 != (MR_Integer) 0);
      if (succeeded)
        *HeadVar__1_1 = SubResult2_9;
      else
      {
        MR_Word SubResult3_12;

        parse_tree__prog_data____Compare____mer_type_0_0(&SubResult3_12, ArgX3_10, ArgY3_11);
        succeeded = (SubResult3_12 != (MR_Integer) 0);
        if (succeeded)
          *HeadVar__1_1 = SubResult3_12;
        else
        {
          MR_Integer Var_21 = (MR_Integer) (ArgX4_13);
          MR_Integer Var_22 = (MR_Integer) (ArgY4_14);

          succeeded = (Var_21 < Var_22);
          if (succeeded)
            *HeadVar__1_1 = (MR_Integer) 1;
          else
          {
            succeeded = (Var_21 > Var_22);
            if (succeeded)
              *HeadVar__1_1 = (MR_Integer) 2;
            else
              *HeadVar__1_1 = (MR_Integer) 0;
          }
        }
      }
    }
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____foreign_arg_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_11 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_12 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_11 == CastY_12);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  {
    MR_Word TypeInfo_14_14;
    MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
    MR_Word ArgY1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgX2_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
    MR_Word ArgY2_6 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgX3_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 2))));
    MR_Word ArgY3_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));
    MR_Word ArgX4_9 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 3))) & (MR_Integer) 1);
    MR_Word ArgY4_10 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 3))) & (MR_Integer) 1);

    succeeded = mercury__builtin__unify_2_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), ((MR_Box) (ArgX1_3)), ((MR_Box) (ArgY1_4)));
    if (succeeded)
    {
      TypeInfo_14_14 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[10]);
      succeeded = mercury__builtin__unify_2_p_0(TypeInfo_14_14, ((MR_Box) (ArgX2_5)), ((MR_Box) (ArgY2_6)));
      if (succeeded)
      {
        succeeded = parse_tree__prog_data____Unify____mer_type_0_0(ArgX3_7, ArgY3_8);
        if (succeeded)
          succeeded = (ArgX4_9 == ArgY4_10);
      }
    }
  }
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____force_pruning_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer Cast_HeadVar1_4 = (MR_Integer) (HeadVar__2_2);
  MR_Integer Cast_HeadVar2_5 = (MR_Integer) (HeadVar__3_3);

  succeeded = (Cast_HeadVar1_4 < Cast_HeadVar2_5);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    succeeded = (Cast_HeadVar1_4 > Cast_HeadVar2_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 2;
    else
      *HeadVar__1_1 = (MR_Integer) 0;
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____force_pruning_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded = (HeadVar__1_1 == HeadVar__2_2);

  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____dp_goal_info_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_9 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_10 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_9 == CastY_10);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  {
    MR_Word ArgX1_4 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))) & (MR_Integer) 1);
    MR_Word ArgY1_5 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))) & (MR_Integer) 1);
    MR_Word ArgX2_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgY2_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word SubResult1_6;
    MR_Integer Var_13 = (MR_Integer) (ArgX1_4);
    MR_Integer Var_14 = (MR_Integer) (ArgY1_5);

    succeeded = (Var_13 < Var_14);
    if (succeeded)
    {
      SubResult1_6 = (MR_Integer) 1;
      succeeded = MR_TRUE;
    }
    else
    {
      succeeded = (Var_13 > Var_14);
      if (succeeded)
      {
        SubResult1_6 = (MR_Integer) 2;
        succeeded = MR_TRUE;
      }
      else
      {
        succeeded = MR_TRUE;
        succeeded = !(succeeded);
        if (succeeded)
        {
          SubResult1_6 = (MR_Integer) 0;
          succeeded = MR_TRUE;
        }
      }
    }
    if (succeeded)
      *HeadVar__1_1 = SubResult1_6;
    else
      mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[9]), HeadVar__1_1, ((MR_Box) (ArgX2_7)), ((MR_Box) (ArgY2_8)));
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____dp_goal_info_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_7 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_8 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_7 == CastY_8);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  {
    MR_Word TypeInfo_9_9;
    MR_Word ArgX1_3 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))) & (MR_Integer) 1);
    MR_Word ArgY1_4 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))) & (MR_Integer) 1);
    MR_Word ArgX2_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
    MR_Word ArgY2_6 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));

    succeeded = (ArgX1_3 == ArgY1_4);
    if (succeeded)
    {
      TypeInfo_9_9 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[9]);
      succeeded = mercury__builtin__unify_2_p_0(TypeInfo_9_9, ((MR_Box) (ArgX2_5)), ((MR_Box) (ArgY2_6)));
    }
  }
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____dp_coverage_goal_info_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_9 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_10 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_9 == CastY_10);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  {
    MR_Word ArgX1_4 = ((((MR_Unsigned) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))) >> 1)) & (MR_Integer) 1);
    MR_Word ArgY1_5 = ((((MR_Unsigned) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))) >> 1)) & (MR_Integer) 1);
    MR_Word ArgX2_7 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))) & (MR_Integer) 1);
    MR_Word ArgY2_8 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))) & (MR_Integer) 1);
    MR_Word SubResult1_6;
    MR_Integer Var_13 = (MR_Integer) (ArgX1_4);
    MR_Integer Var_14 = (MR_Integer) (ArgY1_5);

    succeeded = (Var_13 < Var_14);
    if (succeeded)
    {
      SubResult1_6 = (MR_Integer) 1;
      succeeded = MR_TRUE;
    }
    else
    {
      succeeded = (Var_13 > Var_14);
      if (succeeded)
      {
        SubResult1_6 = (MR_Integer) 2;
        succeeded = MR_TRUE;
      }
      else
      {
        succeeded = MR_TRUE;
        succeeded = !(succeeded);
        if (succeeded)
        {
          SubResult1_6 = (MR_Integer) 0;
          succeeded = MR_TRUE;
        }
      }
    }
    if (succeeded)
      *HeadVar__1_1 = SubResult1_6;
    else
    {
      MR_Integer Var_15 = (MR_Integer) (ArgX2_7);
      MR_Integer Var_16 = (MR_Integer) (ArgY2_8);

      succeeded = (Var_15 < Var_16);
      if (succeeded)
        *HeadVar__1_1 = (MR_Integer) 1;
      else
      {
        succeeded = (Var_15 > Var_16);
        if (succeeded)
          *HeadVar__1_1 = (MR_Integer) 2;
        else
          *HeadVar__1_1 = (MR_Integer) 0;
      }
    }
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____dp_coverage_goal_info_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_7 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_8 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_7 == CastY_8);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  {
    MR_Word ArgX1_3 = ((((MR_Unsigned) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))) >> 1)) & (MR_Integer) 1);
    MR_Word ArgY1_4 = ((((MR_Unsigned) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))) >> 1)) & (MR_Integer) 1);
    MR_Word ArgX2_5 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))) & (MR_Integer) 1);
    MR_Word ArgY2_6 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))) & (MR_Integer) 1);

    succeeded = (ArgX1_3 == ArgY1_4);
    if (succeeded)
      succeeded = (ArgX2_5 == ArgY2_6);
  }
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____ctgc_goal_info_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_12 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_13 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_12 == CastY_13);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  {
    MR_Word ArgX1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));
    MR_Word ArgX2_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgY2_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word ArgX3_10 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));
    MR_Word ArgY3_11 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 2))));
    MR_Word SubResult1_6;

    mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[3]), &SubResult1_6, ((MR_Box) (ArgX1_4)), ((MR_Box) (ArgY1_5)));
    succeeded = (SubResult1_6 != (MR_Integer) 0);
    if (succeeded)
      *HeadVar__1_1 = SubResult1_6;
    else
    {
      MR_Word SubResult2_9;

      mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[3]), &SubResult2_9, ((MR_Box) (ArgX2_7)), ((MR_Box) (ArgY2_8)));
      succeeded = (SubResult2_9 != (MR_Integer) 0);
      if (succeeded)
        *HeadVar__1_1 = SubResult2_9;
      else
        hlds__hlds_goal____Compare____reuse_description_0_0(HeadVar__1_1, ArgX3_10, ArgY3_11);
    }
  }
}

void MR_CALL 
hlds__hlds_goal____Compare____reuse_description_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_34 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_35 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_34 == CastY_35);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
    switch (MR_tag((MR_Word) HeadVar__2_2)) {
      default: /*NOTREACHED*/ MR_assert(0);
      case (MR_Integer) 0:
        switch (MR_unmkbody(HeadVar__2_2)) {
          default: /*NOTREACHED*/ MR_assert(0);
          case (MR_Integer) 0:
            switch (MR_tag((MR_Word) HeadVar__3_3)) {
              default: /*NOTREACHED*/ MR_assert(0);
              case (MR_Integer) 0:
                switch (MR_unmkbody(HeadVar__3_3)) {
                  default: /*NOTREACHED*/ MR_assert(0);
                  case (MR_Integer) 0:
                    *HeadVar__1_1 = (MR_Integer) 0;
                    break;
                  case (MR_Integer) 1:
                    *HeadVar__1_1 = (MR_Integer) 1;
                    break;
                }
                break;
              case (MR_Integer) 1:
                *HeadVar__1_1 = (MR_Integer) 1;
                break;
              case (MR_Integer) 2:
                *HeadVar__1_1 = (MR_Integer) 1;
                break;
              case (MR_Integer) 3:
                *HeadVar__1_1 = (MR_Integer) 1;
                break;
            }
            break;
          case (MR_Integer) 1:
            switch (MR_tag((MR_Word) HeadVar__3_3)) {
              default: /*NOTREACHED*/ MR_assert(0);
              case (MR_Integer) 0:
                switch (MR_unmkbody(HeadVar__3_3)) {
                  default: /*NOTREACHED*/ MR_assert(0);
                  case (MR_Integer) 0:
                    *HeadVar__1_1 = (MR_Integer) 2;
                    break;
                  case (MR_Integer) 1:
                    *HeadVar__1_1 = (MR_Integer) 0;
                    break;
                }
                break;
              case (MR_Integer) 1:
                *HeadVar__1_1 = (MR_Integer) 1;
                break;
              case (MR_Integer) 2:
                *HeadVar__1_1 = (MR_Integer) 1;
                break;
              case (MR_Integer) 3:
                *HeadVar__1_1 = (MR_Integer) 1;
                break;
            }
            break;
        }
        break;
      case (MR_Integer) 1:
        {
          MR_Word Var_39 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              switch (MR_unmkbody(HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
              }
              break;
            case (MR_Integer) 1:
              {
                MR_Word ArgY1_13 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 0))));

                mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[25]), HeadVar__1_1, ((MR_Box) (Var_39)), ((MR_Box) (ArgY1_13)));
              }
              break;
            case (MR_Integer) 2:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
            case (MR_Integer) 3:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
          }
        }
        break;
      case (MR_Integer) 2:
        {
          MR_Word Var_40 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              switch (MR_unmkbody(HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
              }
              break;
            case (MR_Integer) 1:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 2:
              {
                MR_Word ArgY1_23 = ((MR_Word) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 0))));

                hlds__hlds_goal____Compare____short_reuse_description_0_0(HeadVar__1_1, Var_40, ArgY1_23);
              }
              break;
            case (MR_Integer) 3:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
          }
        }
        break;
      case (MR_Integer) 3:
        {
          MR_Word Var_41 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0))));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              switch (MR_unmkbody(HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
              }
              break;
            case (MR_Integer) 1:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 2:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 3:
              {
                MR_Word ArgY1_33 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))));

                hlds__hlds_goal____Compare____short_reuse_description_0_0(HeadVar__1_1, Var_41, ArgY1_33);
              }
              break;
          }
        }
        break;
    }
}

void MR_CALL 
hlds__hlds_goal____Compare____short_reuse_description_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_44 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_45 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_44 == CastY_45);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
    switch (MR_tag((MR_Word) HeadVar__2_2)) {
      default: /*NOTREACHED*/ MR_assert(0);
      case (MR_Integer) 0:
        switch (MR_tag((MR_Word) HeadVar__3_3)) {
          default: /*NOTREACHED*/ MR_assert(0);
          case (MR_Integer) 0:
            *HeadVar__1_1 = (MR_Integer) 0;
            break;
          case (MR_Integer) 1:
            *HeadVar__1_1 = (MR_Integer) 1;
            break;
          case (MR_Integer) 2:
            *HeadVar__1_1 = (MR_Integer) 1;
            break;
        }
        break;
      case (MR_Integer) 1:
        {
          MR_Word Var_52 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 3))));
          MR_Word Var_53 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 2))));
          MR_Word Var_54 = ((MR_Unsigned) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 1))) & (MR_Integer) 1);
          MR_Word Var_55 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 1:
              {
                MR_Word ArgY1_15 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 0))));
                MR_Word ArgY2_18 = ((MR_Unsigned) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 1))) & (MR_Integer) 1);
                MR_Word ArgY3_21 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 2))));
                MR_Word ArgY4_24 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 3))));
                MR_Word SubResult1_16;

                mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), &SubResult1_16, ((MR_Box) (Var_55)), ((MR_Box) (ArgY1_15)));
                succeeded = (SubResult1_16 != (MR_Integer) 0);
                if (succeeded)
                  *HeadVar__1_1 = SubResult1_16;
                else
                {
                  MR_Word SubResult2_19;
                  MR_Integer Var_58 = (MR_Integer) (Var_54);
                  MR_Integer Var_59 = (MR_Integer) (ArgY2_18);

                  succeeded = (Var_58 < Var_59);
                  if (succeeded)
                  {
                    SubResult2_19 = (MR_Integer) 1;
                    succeeded = MR_TRUE;
                  }
                  else
                  {
                    succeeded = (Var_58 > Var_59);
                    if (succeeded)
                    {
                      SubResult2_19 = (MR_Integer) 2;
                      succeeded = MR_TRUE;
                    }
                    else
                    {
                      succeeded = MR_TRUE;
                      succeeded = !(succeeded);
                      if (succeeded)
                      {
                        SubResult2_19 = (MR_Integer) 0;
                        succeeded = MR_TRUE;
                      }
                    }
                  }
                  if (succeeded)
                    *HeadVar__1_1 = SubResult2_19;
                  else
                  {
                    MR_Word SubResult3_22;

                    mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[4]), &SubResult3_22, ((MR_Box) (Var_53)), ((MR_Box) (ArgY3_21)));
                    succeeded = (SubResult3_22 != (MR_Integer) 0);
                    if (succeeded)
                      *HeadVar__1_1 = SubResult3_22;
                    else
                      mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[5]), HeadVar__1_1, ((MR_Box) (Var_52)), ((MR_Box) (ArgY4_24)));
                  }
                }
              }
              break;
            case (MR_Integer) 2:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
          }
        }
        break;
      case (MR_Integer) 2:
        {
          MR_Word Var_56 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 1))));
          MR_Word Var_57 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))) & (MR_Integer) 1);

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 1:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 2:
              {
                MR_Word ArgY1_40 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 0))) & (MR_Integer) 1);
                MR_Word ArgY2_43 = ((MR_Word) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 1))));
                MR_Word SubResult1_41;
                MR_Integer Var_60 = (MR_Integer) (Var_57);
                MR_Integer Var_61 = (MR_Integer) (ArgY1_40);

                succeeded = (Var_60 < Var_61);
                if (succeeded)
                {
                  SubResult1_41 = (MR_Integer) 1;
                  succeeded = MR_TRUE;
                }
                else
                {
                  succeeded = (Var_60 > Var_61);
                  if (succeeded)
                  {
                    SubResult1_41 = (MR_Integer) 2;
                    succeeded = MR_TRUE;
                  }
                  else
                  {
                    succeeded = MR_TRUE;
                    succeeded = !(succeeded);
                    if (succeeded)
                    {
                      SubResult1_41 = (MR_Integer) 0;
                      succeeded = MR_TRUE;
                    }
                  }
                }
                if (succeeded)
                  *HeadVar__1_1 = SubResult1_41;
                else
                  mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[6]), HeadVar__1_1, ((MR_Box) (Var_56)), ((MR_Box) (ArgY2_43)));
              }
              break;
          }
        }
        break;
    }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____ctgc_goal_info_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_9 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_10 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_9 == CastY_10);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  {
    MR_Word TypeInfo_12_12;
    MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
    MR_Word ArgY1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgX2_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
    MR_Word ArgY2_6 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgX3_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 2))));
    MR_Word ArgY3_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));

    succeeded = mercury__builtin__unify_2_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[3]), ((MR_Box) (ArgX1_3)), ((MR_Box) (ArgY1_4)));
    if (succeeded)
    {
      TypeInfo_12_12 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[3]);
      succeeded = mercury__builtin__unify_2_p_0(TypeInfo_12_12, ((MR_Box) (ArgX2_5)), ((MR_Box) (ArgY2_6)));
      if (succeeded)
        succeeded = hlds__hlds_goal____Unify____reuse_description_0_0(ArgX3_7, ArgY3_8);
    }
  }
  return succeeded;
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____reuse_description_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_13 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_14 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_13 == CastY_14);
  if (succeeded)
    succeeded = MR_TRUE;
  else
    switch (MR_tag((MR_Word) HeadVar__1_1)) {
      default: /*NOTREACHED*/ MR_assert(0);
      case (MR_Integer) 0:
        switch (MR_unmkbody(HeadVar__1_1)) {
          default: /*NOTREACHED*/ MR_assert(0);
          case (MR_Integer) 0:
            {
              MR_Integer CastX_3 = (MR_Integer) (HeadVar__1_1);
              MR_Integer CastY_4 = (MR_Integer) (HeadVar__2_2);

              succeeded = (CastY_4 == CastX_3);
            }
            break;
          case (MR_Integer) 1:
            {
              MR_Integer CastX_5 = (MR_Integer) (HeadVar__1_1);
              MR_Integer CastY_6 = (MR_Integer) (HeadVar__2_2);

              succeeded = (CastY_6 == CastX_5);
            }
            break;
        }
        break;
      case (MR_Integer) 1:
        {
          MR_Word TypeInfo_15_15;
          MR_Word ArgX1_7 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 0))));
          MR_Word ArgY1_8;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 1);
          if (succeeded)
          {
            ArgY1_8 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))));
            TypeInfo_15_15 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[25]);
            succeeded = mercury__builtin__unify_2_p_0(TypeInfo_15_15, ((MR_Box) (ArgX1_7)), ((MR_Box) (ArgY1_8)));
          }
        }
        break;
      case (MR_Integer) 2:
        {
          MR_Word ArgX1_9 = ((MR_Word) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 0))));
          MR_Word ArgY1_10;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 2);
          if (succeeded)
          {
            ArgY1_10 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))));
            succeeded = hlds__hlds_goal____Unify____short_reuse_description_0_0(ArgX1_9, ArgY1_10);
          }
        }
        break;
      case (MR_Integer) 3:
        {
          MR_Word ArgX1_11 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 0))));
          MR_Word ArgY1_12;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3);
          if (succeeded)
          {
            ArgY1_12 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0))));
            succeeded = hlds__hlds_goal____Unify____short_reuse_description_0_0(ArgX1_11, ArgY1_12);
          }
        }
        break;
    }
  return succeeded;
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____short_reuse_description_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_17 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_18 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_17 == CastY_18);
  if (succeeded)
    succeeded = MR_TRUE;
  else
    switch (MR_tag((MR_Word) HeadVar__1_1)) {
      default: /*NOTREACHED*/ MR_assert(0);
      case (MR_Integer) 0:
        {
          MR_Integer CastX_3 = (MR_Integer) (HeadVar__1_1);
          MR_Integer CastY_4 = (MR_Integer) (HeadVar__2_2);

          succeeded = (CastY_4 == CastX_3);
        }
        break;
      case (MR_Integer) 1:
        {
          MR_Word TypeInfo_19_19;
          MR_Word TypeInfo_20_20;
          MR_Word TypeInfo_21_21;
          MR_Word ArgX1_5 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 0))));
          MR_Word ArgY1_6;
          MR_Word ArgX2_7 = ((MR_Unsigned) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 1))) & (MR_Integer) 1);
          MR_Word ArgY2_8;
          MR_Word ArgX3_9 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 2))));
          MR_Word ArgY3_10;
          MR_Word ArgX4_11 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 3))));
          MR_Word ArgY4_12;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 1);
          if (succeeded)
          {
            ArgY1_6 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))));
            ArgY2_8 = ((MR_Unsigned) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 1))) & (MR_Integer) 1);
            ArgY3_10 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 2))));
            ArgY4_12 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 3))));
            TypeInfo_19_19 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]);
            succeeded = mercury__builtin__unify_2_p_0(TypeInfo_19_19, ((MR_Box) (ArgX1_5)), ((MR_Box) (ArgY1_6)));
            if (succeeded)
            {
              succeeded = (ArgX2_7 == ArgY2_8);
              if (succeeded)
              {
                TypeInfo_20_20 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[4]);
                succeeded = mercury__builtin__unify_2_p_0(TypeInfo_20_20, ((MR_Box) (ArgX3_9)), ((MR_Box) (ArgY3_10)));
                if (succeeded)
                {
                  TypeInfo_21_21 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[5]);
                  succeeded = mercury__builtin__unify_2_p_0(TypeInfo_21_21, ((MR_Box) (ArgX4_11)), ((MR_Box) (ArgY4_12)));
                }
              }
            }
          }
        }
        break;
      case (MR_Integer) 2:
        {
          MR_Word TypeInfo_22_22;
          MR_Word ArgX1_13 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 0))) & (MR_Integer) 1);
          MR_Word ArgY1_14;
          MR_Word ArgX2_15 = ((MR_Word) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 1))));
          MR_Word ArgY2_16;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 2);
          if (succeeded)
          {
            ArgY1_14 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))) & (MR_Integer) 1);
            ArgY2_16 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 1))));
            succeeded = (ArgX1_13 == ArgY1_14);
            if (succeeded)
            {
              TypeInfo_22_22 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[6]);
              succeeded = mercury__builtin__unify_2_p_0(TypeInfo_22_22, ((MR_Box) (ArgX2_15)), ((MR_Box) (ArgY2_16)));
            }
          }
        }
        break;
    }
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____contains_trace_goal_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer Cast_HeadVar1_4 = (MR_Integer) (HeadVar__2_2);
  MR_Integer Cast_HeadVar2_5 = (MR_Integer) (HeadVar__3_3);

  succeeded = (Cast_HeadVar1_4 < Cast_HeadVar2_5);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    succeeded = (Cast_HeadVar1_4 > Cast_HeadVar2_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 2;
    else
      *HeadVar__1_1 = (MR_Integer) 0;
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____contains_trace_goal_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded = (HeadVar__1_1 == HeadVar__2_2);

  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____conj_type_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer Cast_HeadVar1_4 = (MR_Integer) (HeadVar__2_2);
  MR_Integer Cast_HeadVar2_5 = (MR_Integer) (HeadVar__3_3);

  succeeded = (Cast_HeadVar1_4 < Cast_HeadVar2_5);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    succeeded = (Cast_HeadVar1_4 > Cast_HeadVar2_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 2;
    else
      *HeadVar__1_1 = (MR_Integer) 0;
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____conj_type_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded = (HeadVar__1_1 == HeadVar__2_2);

  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____cell_is_unique_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer Cast_HeadVar1_4 = (MR_Integer) (HeadVar__2_2);
  MR_Integer Cast_HeadVar2_5 = (MR_Integer) (HeadVar__3_3);

  succeeded = (Cast_HeadVar1_4 < Cast_HeadVar2_5);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    succeeded = (Cast_HeadVar1_4 > Cast_HeadVar2_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 2;
    else
      *HeadVar__1_1 = (MR_Integer) 0;
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____cell_is_unique_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded = (HeadVar__1_1 == HeadVar__2_2);

  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____catch_part_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_9 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_10 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_9 == CastY_10);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  {
    MR_Word ArgX1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));
    MR_Word ArgX2_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgY2_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word SubResult1_6;

    hlds__hlds_goal____Compare____hlds_goal_expr_0_0(&SubResult1_6, ArgX1_4, ArgY1_5);
    succeeded = (SubResult1_6 != (MR_Integer) 0);
    if (succeeded)
      *HeadVar__1_1 = SubResult1_6;
    else
      hlds__hlds_goal____Compare____hlds_goal_0_0(HeadVar__1_1, ArgX2_7, ArgY2_8);
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____catch_part_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_7 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_8 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_7 == CastY_8);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  {
    MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
    MR_Word ArgY1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgX2_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
    MR_Word ArgY2_6 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));

    succeeded = hlds__hlds_goal____Unify____hlds_goal_expr_0_0(ArgX1_3, ArgY1_4);
    if (succeeded)
      succeeded = hlds__hlds_goal____Unify____hlds_goal_0_0(ArgX2_5, ArgY2_6);
  }
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____cast_kind_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer Cast_HeadVar1_4 = (MR_Integer) (HeadVar__2_2);
  MR_Integer Cast_HeadVar2_5 = (MR_Integer) (HeadVar__3_3);

  succeeded = (Cast_HeadVar1_4 < Cast_HeadVar2_5);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    succeeded = (Cast_HeadVar1_4 > Cast_HeadVar2_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 2;
    else
      *HeadVar__1_1 = (MR_Integer) 0;
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____cast_kind_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded = (HeadVar__1_1 == HeadVar__2_2);

  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____case_id_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_6 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_7 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_6 == CastY_7);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  {
    MR_Integer ArgX1_4 = (MR_Integer) (HeadVar__2_2);
    MR_Integer ArgY1_5 = (MR_Integer) (HeadVar__3_3);

    succeeded = (ArgX1_4 < ArgY1_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 1;
    else
    {
      succeeded = (ArgX1_4 > ArgY1_5);
      if (succeeded)
        *HeadVar__1_1 = (MR_Integer) 2;
      else
        *HeadVar__1_1 = (MR_Integer) 0;
    }
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____case_id_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_5 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_6 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_5 == CastY_6);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  {
    MR_Integer ArgX1_3 = (MR_Integer) (HeadVar__1_1);
    MR_Integer ArgY1_4 = (MR_Integer) (HeadVar__2_2);

    succeeded = (ArgX1_3 == ArgY1_4);
  }
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____case_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_12 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_13 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_12 == CastY_13);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  {
    MR_Word ArgX1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));
    MR_Word ArgX2_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgY2_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word ArgX3_10 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));
    MR_Word ArgY3_11 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 2))));
    MR_Word SubResult1_6;

    parse_tree__prog_data____Compare____cons_id_0_0(&SubResult1_6, ArgX1_4, ArgY1_5);
    succeeded = (SubResult1_6 != (MR_Integer) 0);
    if (succeeded)
      *HeadVar__1_1 = SubResult1_6;
    else
    {
      MR_Word SubResult2_9;

      mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[4]), &SubResult2_9, ((MR_Box) (ArgX2_7)), ((MR_Box) (ArgY2_8)));
      succeeded = (SubResult2_9 != (MR_Integer) 0);
      if (succeeded)
        *HeadVar__1_1 = SubResult2_9;
      else
        hlds__hlds_goal____Compare____hlds_goal_0_0(HeadVar__1_1, ArgX3_10, ArgY3_11);
    }
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____case_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_9 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_10 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_9 == CastY_10);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  {
    MR_Word TypeInfo_12_12;
    MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
    MR_Word ArgY1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgX2_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
    MR_Word ArgY2_6 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgX3_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 2))));
    MR_Word ArgY3_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));

    succeeded = parse_tree__prog_data____Unify____cons_id_0_0(ArgX1_3, ArgY1_4);
    if (succeeded)
    {
      TypeInfo_12_12 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[4]);
      succeeded = mercury__builtin__unify_2_p_0(TypeInfo_12_12, ((MR_Box) (ArgX2_5)), ((MR_Box) (ArgY2_6)));
      if (succeeded)
        succeeded = hlds__hlds_goal____Unify____hlds_goal_0_0(ArgX3_7, ArgY3_8);
    }
  }
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____can_cgc_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer Cast_HeadVar1_4 = (MR_Integer) (HeadVar__2_2);
  MR_Integer Cast_HeadVar2_5 = (MR_Integer) (HeadVar__3_3);

  succeeded = (Cast_HeadVar1_4 < Cast_HeadVar2_5);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    succeeded = (Cast_HeadVar1_4 > Cast_HeadVar2_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 2;
    else
      *HeadVar__1_1 = (MR_Integer) 0;
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____can_cgc_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded = (HeadVar__1_1 == HeadVar__2_2);

  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____call_unify_context_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_12 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_13 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_12 == CastY_13);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  {
    MR_Word ArgX1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));
    MR_Word ArgX2_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgY2_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word ArgX3_10 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));
    MR_Word ArgY3_11 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 2))));
    MR_Word SubResult1_6;

    mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), &SubResult1_6, ((MR_Box) (ArgX1_4)), ((MR_Box) (ArgY1_5)));
    succeeded = (SubResult1_6 != (MR_Integer) 0);
    if (succeeded)
      *HeadVar__1_1 = SubResult1_6;
    else
    {
      MR_Word SubResult2_9;

      hlds__hlds_goal____Compare____unify_rhs_0_0(&SubResult2_9, ArgX2_7, ArgY2_8);
      succeeded = (SubResult2_9 != (MR_Integer) 0);
      if (succeeded)
        *HeadVar__1_1 = SubResult2_9;
      else
        hlds__hlds_goal____Compare____unify_context_0_0(HeadVar__1_1, ArgX3_10, ArgY3_11);
    }
  }
}

void MR_CALL 
hlds__hlds_goal____Compare____unify_rhs_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_84 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_85 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_84 == CastY_85);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
    switch (MR_tag((MR_Word) HeadVar__2_2)) {
      default: /*NOTREACHED*/ MR_assert(0);
      case (MR_Integer) 0:
        {
          MR_Word Var_108 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              {
                MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));

                mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), HeadVar__1_1, ((MR_Box) (Var_108)), ((MR_Box) (ArgY1_5)));
              }
              break;
            case (MR_Integer) 1:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
            case (MR_Integer) 2:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
          }
        }
        break;
      case (MR_Integer) 1:
        {
          MR_Word Var_97 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 2))));
          MR_Word Var_98 = ((MR_Unsigned) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 1))) & (MR_Integer) 1);
          MR_Word Var_99 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 1:
              {
                MR_Word ArgY1_24 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 0))));
                MR_Word ArgY2_27 = ((MR_Unsigned) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 1))) & (MR_Integer) 1);
                MR_Word ArgY3_30 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 2))));
                MR_Word SubResult1_25;

                parse_tree__prog_data____Compare____cons_id_0_0(&SubResult1_25, Var_99, ArgY1_24);
                succeeded = (SubResult1_25 != (MR_Integer) 0);
                if (succeeded)
                  *HeadVar__1_1 = SubResult1_25;
                else
                {
                  MR_Word SubResult2_28;
                  MR_Integer Var_109 = (MR_Integer) (Var_98);
                  MR_Integer Var_110 = (MR_Integer) (ArgY2_27);

                  succeeded = (Var_109 < Var_110);
                  if (succeeded)
                  {
                    SubResult2_28 = (MR_Integer) 1;
                    succeeded = MR_TRUE;
                  }
                  else
                  {
                    succeeded = (Var_109 > Var_110);
                    if (succeeded)
                    {
                      SubResult2_28 = (MR_Integer) 2;
                      succeeded = MR_TRUE;
                    }
                    else
                    {
                      succeeded = MR_TRUE;
                      succeeded = !(succeeded);
                      if (succeeded)
                      {
                        SubResult2_28 = (MR_Integer) 0;
                        succeeded = MR_TRUE;
                      }
                    }
                  }
                  if (succeeded)
                    *HeadVar__1_1 = SubResult2_28;
                  else
                    mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[11]), HeadVar__1_1, ((MR_Box) (Var_97)), ((MR_Box) (ArgY3_30)));
                }
              }
              break;
            case (MR_Integer) 2:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
          }
        }
        break;
      case (MR_Integer) 2:
        {
          MR_Word Var_100 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 5))));
          MR_Word Var_101 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 4))) & (MR_Integer) 7);
          MR_Word Var_102 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 3))));
          MR_Word Var_103 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 2))));
          MR_Word Var_105 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))) & (MR_Integer) 1);
          MR_Word Var_106 = ((((MR_Unsigned) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))) >> 1)) & (MR_Integer) 1);
          MR_Word Var_107 = ((((MR_Unsigned) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))) >> 2)) & (MR_Integer) 3);

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 1:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 2:
              {
                MR_Word ArgY1_63 = ((((MR_Unsigned) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 0))) >> 2)) & (MR_Integer) 3);
                MR_Word ArgY2_66 = ((((MR_Unsigned) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 0))) >> 1)) & (MR_Integer) 1);
                MR_Word ArgY3_69 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 0))) & (MR_Integer) 1);
                MR_Word ArgY5_74 = ((MR_Word) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 2))));
                MR_Word ArgY6_77 = ((MR_Word) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 3))));
                MR_Word ArgY7_80 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 4))) & (MR_Integer) 7);
                MR_Word ArgY8_83 = ((MR_Word) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 5))));
                MR_Word SubResult1_64;
                MR_Integer Var_111 = (MR_Integer) (Var_107);
                MR_Integer Var_112 = (MR_Integer) (ArgY1_63);

                succeeded = (Var_111 < Var_112);
                if (succeeded)
                {
                  SubResult1_64 = (MR_Integer) 1;
                  succeeded = MR_TRUE;
                }
                else
                {
                  succeeded = (Var_111 > Var_112);
                  if (succeeded)
                  {
                    SubResult1_64 = (MR_Integer) 2;
                    succeeded = MR_TRUE;
                  }
                  else
                  {
                    succeeded = MR_TRUE;
                    succeeded = !(succeeded);
                    if (succeeded)
                    {
                      SubResult1_64 = (MR_Integer) 0;
                      succeeded = MR_TRUE;
                    }
                  }
                }
                if (succeeded)
                  *HeadVar__1_1 = SubResult1_64;
                else
                {
                  MR_Word SubResult2_67;
                  MR_Integer Var_113 = (MR_Integer) (Var_106);
                  MR_Integer Var_114 = (MR_Integer) (ArgY2_66);

                  succeeded = (Var_113 < Var_114);
                  if (succeeded)
                  {
                    SubResult2_67 = (MR_Integer) 1;
                    succeeded = MR_TRUE;
                  }
                  else
                  {
                    succeeded = (Var_113 > Var_114);
                    if (succeeded)
                    {
                      SubResult2_67 = (MR_Integer) 2;
                      succeeded = MR_TRUE;
                    }
                    else
                    {
                      succeeded = MR_TRUE;
                      succeeded = !(succeeded);
                      if (succeeded)
                      {
                        SubResult2_67 = (MR_Integer) 0;
                        succeeded = MR_TRUE;
                      }
                    }
                  }
                  if (succeeded)
                    *HeadVar__1_1 = SubResult2_67;
                  else
                  {
                    MR_Word SubResult3_70;
                    MR_Integer Var_115 = (MR_Integer) (Var_105);
                    MR_Integer Var_116 = (MR_Integer) (ArgY3_69);

                    succeeded = (Var_115 < Var_116);
                    if (succeeded)
                    {
                      SubResult3_70 = (MR_Integer) 1;
                      succeeded = MR_TRUE;
                    }
                    else
                    {
                      succeeded = (Var_115 > Var_116);
                      if (succeeded)
                      {
                        SubResult3_70 = (MR_Integer) 2;
                        succeeded = MR_TRUE;
                      }
                      else
                      {
                        succeeded = MR_TRUE;
                        succeeded = !(succeeded);
                        if (succeeded)
                        {
                          SubResult3_70 = (MR_Integer) 0;
                          succeeded = MR_TRUE;
                        }
                      }
                    }
                    if (succeeded)
                      *HeadVar__1_1 = SubResult3_70;
                    else
                    {
                      MR_Word SubResult5_75;

                      mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[11]), &SubResult5_75, ((MR_Box) (Var_103)), ((MR_Box) (ArgY5_74)));
                      succeeded = (SubResult5_75 != (MR_Integer) 0);
                      if (succeeded)
                        *HeadVar__1_1 = SubResult5_75;
                      else
                      {
                        MR_Word SubResult6_78;

                        mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[37]), &SubResult6_78, ((MR_Box) (Var_102)), ((MR_Box) (ArgY6_77)));
                        succeeded = (SubResult6_78 != (MR_Integer) 0);
                        if (succeeded)
                          *HeadVar__1_1 = SubResult6_78;
                        else
                        {
                          MR_Word SubResult7_81;
                          MR_Integer Var_117 = (MR_Integer) (Var_101);
                          MR_Integer Var_118 = (MR_Integer) (ArgY7_80);

                          succeeded = (Var_117 < Var_118);
                          if (succeeded)
                          {
                            SubResult7_81 = (MR_Integer) 1;
                            succeeded = MR_TRUE;
                          }
                          else
                          {
                            succeeded = (Var_117 > Var_118);
                            if (succeeded)
                            {
                              SubResult7_81 = (MR_Integer) 2;
                              succeeded = MR_TRUE;
                            }
                            else
                            {
                              succeeded = MR_TRUE;
                              succeeded = !(succeeded);
                              if (succeeded)
                              {
                                SubResult7_81 = (MR_Integer) 0;
                                succeeded = MR_TRUE;
                              }
                            }
                          }
                          if (succeeded)
                            *HeadVar__1_1 = SubResult7_81;
                          else
                            hlds__hlds_goal____Compare____hlds_goal_0_0(HeadVar__1_1, Var_100, ArgY8_83);
                        }
                      }
                    }
                  }
                }
              }
              break;
          }
        }
        break;
    }
}

void MR_CALL 
hlds__hlds_goal____Compare____hlds_goal_expr_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_844 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_845 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_844 == CastY_845);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
    switch (MR_tag((MR_Word) HeadVar__2_2)) {
      default: /*NOTREACHED*/ MR_assert(0);
      case (MR_Integer) 0:
        {
          MR_Word Var_902 = (MR_Word) ((MR_Word) (HeadVar__2_2));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              {
                MR_Word ArgY1_641 = (MR_Word) ((MR_Word) (HeadVar__3_3));

                hlds__hlds_goal____Compare____hlds_goal_0_0(HeadVar__1_1, Var_902, ArgY1_641);
              }
              break;
            case (MR_Integer) 1:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 2:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 3:
              switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 3:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 4:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 5:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 6:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 7:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
              }
              break;
          }
        }
        break;
      case (MR_Integer) 1:
        {
          MR_Word Var_915 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 4))));
          MR_Word Var_916 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 3))));
          MR_Word Var_917 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 2))));
          MR_Word Var_918 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 1))));
          MR_Word Var_919 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
            case (MR_Integer) 1:
              {
                MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 0))));
                MR_Word ArgY2_8 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 1))));
                MR_Word ArgY3_11 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 2))));
                MR_Word ArgY4_14 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 3))));
                MR_Word ArgY5_17 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 4))));
                MR_Word SubResult1_6;

                mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), &SubResult1_6, ((MR_Box) (Var_919)), ((MR_Box) (ArgY1_5)));
                succeeded = (SubResult1_6 != (MR_Integer) 0);
                if (succeeded)
                  *HeadVar__1_1 = SubResult1_6;
                else
                {
                  MR_Word SubResult2_9;

                  hlds__hlds_goal____Compare____unify_rhs_0_0(&SubResult2_9, Var_918, ArgY2_8);
                  succeeded = (SubResult2_9 != (MR_Integer) 0);
                  if (succeeded)
                    *HeadVar__1_1 = SubResult2_9;
                  else
                  {
                    MR_Word SubResult3_12;

                    hlds__hlds_goal____Compare____unify_mode_0_0(&SubResult3_12, Var_917, ArgY3_11);
                    succeeded = (SubResult3_12 != (MR_Integer) 0);
                    if (succeeded)
                      *HeadVar__1_1 = SubResult3_12;
                    else
                    {
                      MR_Word SubResult4_15;

                      hlds__hlds_goal____Compare____unification_0_0(&SubResult4_15, Var_916, ArgY4_14);
                      succeeded = (SubResult4_15 != (MR_Integer) 0);
                      if (succeeded)
                        *HeadVar__1_1 = SubResult4_15;
                      else
                        hlds__hlds_goal____Compare____unify_context_0_0(HeadVar__1_1, Var_915, ArgY5_17);
                    }
                  }
                }
              }
              break;
            case (MR_Integer) 2:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
            case (MR_Integer) 3:
              switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 3:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 4:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 5:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 6:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 7:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
              }
              break;
          }
        }
        break;
      case (MR_Integer) 2:
        {
          MR_Word Var_903 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 5))));
          MR_Word Var_904 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 4))));
          MR_Word Var_905 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 3))) & (MR_Integer) 1);
          MR_Word Var_906 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 2))));
          MR_Integer Var_907 = ((MR_Integer) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 1))));
          MR_Word Var_908 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
            case (MR_Integer) 1:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 2:
              {
                MR_Word ArgY1_112 = ((MR_Word) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 0))));
                MR_Integer ArgY2_115 = ((MR_Integer) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 1))));
                MR_Word ArgY3_118 = ((MR_Word) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 2))));
                MR_Word ArgY4_121 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 3))) & (MR_Integer) 1);
                MR_Word ArgY5_124 = ((MR_Word) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 4))));
                MR_Word ArgY6_127 = ((MR_Word) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 5))));
                MR_Word SubResult1_113;

                hlds__hlds_pred____Compare____pred_id_0_0(&SubResult1_113, Var_908, ArgY1_112);
                succeeded = (SubResult1_113 != (MR_Integer) 0);
                if (succeeded)
                  *HeadVar__1_1 = SubResult1_113;
                else
                {
                  MR_Word SubResult2_116;

                  succeeded = (Var_907 < ArgY2_115);
                  if (succeeded)
                  {
                    SubResult2_116 = (MR_Integer) 1;
                    succeeded = MR_TRUE;
                  }
                  else
                  {
                    succeeded = (Var_907 > ArgY2_115);
                    if (succeeded)
                    {
                      SubResult2_116 = (MR_Integer) 2;
                      succeeded = MR_TRUE;
                    }
                    else
                    {
                      succeeded = MR_TRUE;
                      succeeded = !(succeeded);
                      if (succeeded)
                      {
                        SubResult2_116 = (MR_Integer) 0;
                        succeeded = MR_TRUE;
                      }
                    }
                  }
                  if (succeeded)
                    *HeadVar__1_1 = SubResult2_116;
                  else
                  {
                    MR_Word SubResult3_119;

                    mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[11]), &SubResult3_119, ((MR_Box) (Var_906)), ((MR_Box) (ArgY3_118)));
                    succeeded = (SubResult3_119 != (MR_Integer) 0);
                    if (succeeded)
                      *HeadVar__1_1 = SubResult3_119;
                    else
                    {
                      MR_Word SubResult4_122;
                      MR_Integer Var_924 = (MR_Integer) (Var_905);
                      MR_Integer Var_925 = (MR_Integer) (ArgY4_121);

                      succeeded = (Var_924 < Var_925);
                      if (succeeded)
                      {
                        SubResult4_122 = (MR_Integer) 1;
                        succeeded = MR_TRUE;
                      }
                      else
                      {
                        succeeded = (Var_924 > Var_925);
                        if (succeeded)
                        {
                          SubResult4_122 = (MR_Integer) 2;
                          succeeded = MR_TRUE;
                        }
                        else
                        {
                          succeeded = MR_TRUE;
                          succeeded = !(succeeded);
                          if (succeeded)
                          {
                            SubResult4_122 = (MR_Integer) 0;
                            succeeded = MR_TRUE;
                          }
                        }
                      }
                      if (succeeded)
                        *HeadVar__1_1 = SubResult4_122;
                      else
                      {
                        MR_Word SubResult5_125;

                        mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[18]), &SubResult5_125, ((MR_Box) (Var_904)), ((MR_Box) (ArgY5_124)));
                        succeeded = (SubResult5_125 != (MR_Integer) 0);
                        if (succeeded)
                          *HeadVar__1_1 = SubResult5_125;
                        else
                          mdbcomp__sym_name____Compare____sym_name_0_0(HeadVar__1_1, Var_903, ArgY6_127);
                      }
                    }
                  }
                }
              }
              break;
            case (MR_Integer) 3:
              switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 3:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 4:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 5:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 6:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 7:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
              }
              break;
          }
        }
        break;
      case (MR_Integer) 3:
        switch (((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0))))) {
          default: /*NOTREACHED*/ MR_assert(0);
          case (MR_Integer) 0:
            {
              MR_Word Var_893 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 5))) & (MR_Integer) 7);
              MR_Word Var_894 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 4))));
              MR_Word Var_895 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 3))));
              MR_Word Var_896 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))));
              MR_Word Var_897 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));

              switch (MR_tag((MR_Word) HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 3:
                  switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                    default: /*NOTREACHED*/ MR_assert(0);
                    case (MR_Integer) 0:
                      {
                        MR_Word ArgY1_230 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 1))));
                        MR_Word ArgY2_233 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 2))));
                        MR_Word ArgY3_236 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 3))));
                        MR_Word ArgY4_239 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 4))));
                        MR_Word ArgY5_242 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 5))) & (MR_Integer) 7);
                        MR_Word SubResult1_231;

                        hlds__hlds_goal____Compare____generic_call_0_0(&SubResult1_231, Var_897, ArgY1_230);
                        succeeded = (SubResult1_231 != (MR_Integer) 0);
                        if (succeeded)
                          *HeadVar__1_1 = SubResult1_231;
                        else
                        {
                          MR_Word SubResult2_234;

                          mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[11]), &SubResult2_234, ((MR_Box) (Var_896)), ((MR_Box) (ArgY2_233)));
                          succeeded = (SubResult2_234 != (MR_Integer) 0);
                          if (succeeded)
                            *HeadVar__1_1 = SubResult2_234;
                          else
                          {
                            MR_Word SubResult3_237;

                            mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[17]), &SubResult3_237, ((MR_Box) (Var_895)), ((MR_Box) (ArgY3_236)));
                            succeeded = (SubResult3_237 != (MR_Integer) 0);
                            if (succeeded)
                              *HeadVar__1_1 = SubResult3_237;
                            else
                            {
                              MR_Word SubResult4_240;

                              parse_tree__prog_data____Compare____arg_reg_type_info_0_0(&SubResult4_240, Var_894, ArgY4_239);
                              succeeded = (SubResult4_240 != (MR_Integer) 0);
                              if (succeeded)
                                *HeadVar__1_1 = SubResult4_240;
                              else
                              {
                                MR_Integer Var_922 = (MR_Integer) (Var_893);
                                MR_Integer Var_923 = (MR_Integer) (ArgY5_242);

                                succeeded = (Var_922 < Var_923);
                                if (succeeded)
                                  *HeadVar__1_1 = (MR_Integer) 1;
                                else
                                {
                                  succeeded = (Var_922 > Var_923);
                                  if (succeeded)
                                    *HeadVar__1_1 = (MR_Integer) 2;
                                  else
                                    *HeadVar__1_1 = (MR_Integer) 0;
                                }
                              }
                            }
                          }
                        }
                      }
                      break;
                    case (MR_Integer) 1:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 2:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 3:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 4:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 5:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 6:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 7:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                  }
                  break;
              }
            }
            break;
          case (MR_Integer) 1:
            {
              MR_Word Var_883 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 7))));
              MR_Word Var_884 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 6))));
              MR_Word Var_885 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 5))));
              MR_Word Var_886 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 4))));
              MR_Integer Var_887 = ((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 3))));
              MR_Word Var_888 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))));
              MR_Word Var_889 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));

              switch (MR_tag((MR_Word) HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 3:
                  switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                    default: /*NOTREACHED*/ MR_assert(0);
                    case (MR_Integer) 0:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 1:
                      {
                        MR_Word ArgY1_342 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 1))));
                        MR_Word ArgY2_345 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 2))));
                        MR_Integer ArgY3_348 = ((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 3))));
                        MR_Word ArgY4_351 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 4))));
                        MR_Word ArgY5_354 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 5))));
                        MR_Word ArgY6_357 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 6))));
                        MR_Word ArgY7_360 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 7))));
                        MR_Word SubResult1_343;

                        parse_tree__prog_data_foreign____Compare____foreign_proc_attributes_0_0(&SubResult1_343, Var_889, ArgY1_342);
                        succeeded = (SubResult1_343 != (MR_Integer) 0);
                        if (succeeded)
                          *HeadVar__1_1 = SubResult1_343;
                        else
                        {
                          MR_Word SubResult2_346;

                          hlds__hlds_pred____Compare____pred_id_0_0(&SubResult2_346, Var_888, ArgY2_345);
                          succeeded = (SubResult2_346 != (MR_Integer) 0);
                          if (succeeded)
                            *HeadVar__1_1 = SubResult2_346;
                          else
                          {
                            MR_Word SubResult3_349;

                            succeeded = (Var_887 < ArgY3_348);
                            if (succeeded)
                            {
                              SubResult3_349 = (MR_Integer) 1;
                              succeeded = MR_TRUE;
                            }
                            else
                            {
                              succeeded = (Var_887 > ArgY3_348);
                              if (succeeded)
                              {
                                SubResult3_349 = (MR_Integer) 2;
                                succeeded = MR_TRUE;
                              }
                              else
                              {
                                succeeded = MR_TRUE;
                                succeeded = !(succeeded);
                                if (succeeded)
                                {
                                  SubResult3_349 = (MR_Integer) 0;
                                  succeeded = MR_TRUE;
                                }
                              }
                            }
                            if (succeeded)
                              *HeadVar__1_1 = SubResult3_349;
                            else
                            {
                              MR_Word SubResult4_352;

                              mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[14]), &SubResult4_352, ((MR_Box) (Var_886)), ((MR_Box) (ArgY4_351)));
                              succeeded = (SubResult4_352 != (MR_Integer) 0);
                              if (succeeded)
                                *HeadVar__1_1 = SubResult4_352;
                              else
                              {
                                MR_Word SubResult5_355;

                                mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[14]), &SubResult5_355, ((MR_Box) (Var_885)), ((MR_Box) (ArgY5_354)));
                                succeeded = (SubResult5_355 != (MR_Integer) 0);
                                if (succeeded)
                                  *HeadVar__1_1 = SubResult5_355;
                                else
                                {
                                  MR_Word SubResult6_358;

                                  mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[16]), &SubResult6_358, ((MR_Box) (Var_884)), ((MR_Box) (ArgY6_357)));
                                  succeeded = (SubResult6_358 != (MR_Integer) 0);
                                  if (succeeded)
                                    *HeadVar__1_1 = SubResult6_358;
                                  else
                                    parse_tree__prog_data_foreign____Compare____pragma_foreign_proc_impl_0_0(HeadVar__1_1, Var_883, ArgY7_360);
                                }
                              }
                            }
                          }
                        }
                      }
                      break;
                    case (MR_Integer) 2:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 3:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 4:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 5:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 6:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 7:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                  }
                  break;
              }
            }
            break;
          case (MR_Integer) 2:
            {
              MR_Word Var_890 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))));
              MR_Word Var_891 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))) & (MR_Integer) 1);

              switch (MR_tag((MR_Word) HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 3:
                  switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                    default: /*NOTREACHED*/ MR_assert(0);
                    case (MR_Integer) 0:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 1:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 2:
                      {
                        MR_Word ArgY1_456 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 1))) & (MR_Integer) 1);
                        MR_Word ArgY2_459 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 2))));
                        MR_Word SubResult1_457;
                        MR_Integer Var_920 = (MR_Integer) (Var_891);
                        MR_Integer Var_921 = (MR_Integer) (ArgY1_456);

                        succeeded = (Var_920 < Var_921);
                        if (succeeded)
                        {
                          SubResult1_457 = (MR_Integer) 1;
                          succeeded = MR_TRUE;
                        }
                        else
                        {
                          succeeded = (Var_920 > Var_921);
                          if (succeeded)
                          {
                            SubResult1_457 = (MR_Integer) 2;
                            succeeded = MR_TRUE;
                          }
                          else
                          {
                            succeeded = MR_TRUE;
                            succeeded = !(succeeded);
                            if (succeeded)
                            {
                              SubResult1_457 = (MR_Integer) 0;
                              succeeded = MR_TRUE;
                            }
                          }
                        }
                        if (succeeded)
                          *HeadVar__1_1 = SubResult1_457;
                        else
                          mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[13]), HeadVar__1_1, ((MR_Box) (Var_890)), ((MR_Box) (ArgY2_459)));
                      }
                      break;
                    case (MR_Integer) 3:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 4:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 5:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 6:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 7:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                  }
                  break;
              }
            }
            break;
          case (MR_Integer) 3:
            {
              MR_Word Var_892 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));

              switch (MR_tag((MR_Word) HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 3:
                  switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                    default: /*NOTREACHED*/ MR_assert(0);
                    case (MR_Integer) 0:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 1:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 2:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 3:
                      {
                        MR_Word ArgY1_515 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 1))));

                        mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[13]), HeadVar__1_1, ((MR_Box) (Var_892)), ((MR_Box) (ArgY1_515)));
                      }
                      break;
                    case (MR_Integer) 4:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 5:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 6:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 7:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                  }
                  break;
              }
            }
            break;
          case (MR_Integer) 4:
            {
              MR_Word Var_912 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 3))));
              MR_Word Var_913 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))) & (MR_Integer) 1);
              MR_Word Var_914 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));

              switch (MR_tag((MR_Word) HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 3:
                  switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                    default: /*NOTREACHED*/ MR_assert(0);
                    case (MR_Integer) 0:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 1:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 2:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 3:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 4:
                      {
                        MR_Word ArgY1_577 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 1))));
                        MR_Word ArgY2_580 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 2))) & (MR_Integer) 1);
                        MR_Word ArgY3_583 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 3))));
                        MR_Word SubResult1_578;

                        mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), &SubResult1_578, ((MR_Box) (Var_914)), ((MR_Box) (ArgY1_577)));
                        succeeded = (SubResult1_578 != (MR_Integer) 0);
                        if (succeeded)
                          *HeadVar__1_1 = SubResult1_578;
                        else
                        {
                          MR_Word SubResult2_581;
                          MR_Integer Var_926 = (MR_Integer) (Var_913);
                          MR_Integer Var_927 = (MR_Integer) (ArgY2_580);

                          succeeded = (Var_926 < Var_927);
                          if (succeeded)
                          {
                            SubResult2_581 = (MR_Integer) 1;
                            succeeded = MR_TRUE;
                          }
                          else
                          {
                            succeeded = (Var_926 > Var_927);
                            if (succeeded)
                            {
                              SubResult2_581 = (MR_Integer) 2;
                              succeeded = MR_TRUE;
                            }
                            else
                            {
                              succeeded = MR_TRUE;
                              succeeded = !(succeeded);
                              if (succeeded)
                              {
                                SubResult2_581 = (MR_Integer) 0;
                                succeeded = MR_TRUE;
                              }
                            }
                          }
                          if (succeeded)
                            *HeadVar__1_1 = SubResult2_581;
                          else
                            mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[12]), HeadVar__1_1, ((MR_Box) (Var_912)), ((MR_Box) (ArgY3_583)));
                        }
                      }
                      break;
                    case (MR_Integer) 5:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 6:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 7:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                  }
                  break;
              }
            }
            break;
          case (MR_Integer) 5:
            {
              MR_Word Var_909 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))));
              MR_Word Var_910 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));

              switch (MR_tag((MR_Word) HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 3:
                  switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                    default: /*NOTREACHED*/ MR_assert(0);
                    case (MR_Integer) 0:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 1:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 2:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 3:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 4:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 5:
                      {
                        MR_Word ArgY1_699 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 1))));
                        MR_Word ArgY2_702 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 2))));
                        MR_Word SubResult1_700;

                        hlds__hlds_goal____Compare____scope_reason_0_0(&SubResult1_700, Var_910, ArgY1_699);
                        succeeded = (SubResult1_700 != (MR_Integer) 0);
                        if (succeeded)
                          *HeadVar__1_1 = SubResult1_700;
                        else
                          hlds__hlds_goal____Compare____hlds_goal_0_0(HeadVar__1_1, Var_909, ArgY2_702);
                      }
                      break;
                    case (MR_Integer) 6:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 7:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                  }
                  break;
              }
            }
            break;
          case (MR_Integer) 6:
            {
              MR_Word Var_898 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 4))));
              MR_Word Var_899 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 3))));
              MR_Word Var_900 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))));
              MR_Word Var_901 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));

              switch (MR_tag((MR_Word) HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 3:
                  switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                    default: /*NOTREACHED*/ MR_assert(0);
                    case (MR_Integer) 0:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 1:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 2:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 3:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 4:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 5:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 6:
                      {
                        MR_Word ArgY1_781 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 1))));
                        MR_Word ArgY2_784 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 2))));
                        MR_Word ArgY3_787 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 3))));
                        MR_Word ArgY4_790 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 4))));
                        MR_Word SubResult1_782;

                        mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[11]), &SubResult1_782, ((MR_Box) (Var_901)), ((MR_Box) (ArgY1_781)));
                        succeeded = (SubResult1_782 != (MR_Integer) 0);
                        if (succeeded)
                          *HeadVar__1_1 = SubResult1_782;
                        else
                        {
                          MR_Word SubResult2_785;

                          hlds__hlds_goal____Compare____hlds_goal_0_0(&SubResult2_785, Var_900, ArgY2_784);
                          succeeded = (SubResult2_785 != (MR_Integer) 0);
                          if (succeeded)
                            *HeadVar__1_1 = SubResult2_785;
                          else
                          {
                            MR_Word SubResult3_788;

                            hlds__hlds_goal____Compare____hlds_goal_0_0(&SubResult3_788, Var_899, ArgY3_787);
                            succeeded = (SubResult3_788 != (MR_Integer) 0);
                            if (succeeded)
                              *HeadVar__1_1 = SubResult3_788;
                            else
                              hlds__hlds_goal____Compare____hlds_goal_0_0(HeadVar__1_1, Var_898, ArgY4_790);
                          }
                        }
                      }
                      break;
                    case (MR_Integer) 7:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                  }
                  break;
              }
            }
            break;
          case (MR_Integer) 7:
            {
              MR_Word Var_911 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));

              switch (MR_tag((MR_Word) HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 3:
                  switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                    default: /*NOTREACHED*/ MR_assert(0);
                    case (MR_Integer) 0:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 1:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 2:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 3:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 4:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 5:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 6:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 7:
                      {
                        MR_Word ArgY1_843 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 1))));

                        hlds__hlds_goal____Compare____shorthand_goal_expr_0_0(HeadVar__1_1, Var_911, ArgY1_843);
                      }
                      break;
                  }
                  break;
              }
            }
            break;
        }
        break;
    }
}

void MR_CALL 
hlds__hlds_goal____Compare____shorthand_goal_expr_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_85 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_86 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_85 == CastY_86);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
    switch (MR_tag((MR_Word) HeadVar__2_2)) {
      default: /*NOTREACHED*/ MR_assert(0);
      case (MR_Integer) 0:
        {
          MR_Word Var_106 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
          MR_Word Var_107 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              {
                MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));
                MR_Word ArgY2_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))));
                MR_Word SubResult1_6;

                hlds__hlds_goal____Compare____hlds_goal_0_0(&SubResult1_6, Var_107, ArgY1_5);
                succeeded = (SubResult1_6 != (MR_Integer) 0);
                if (succeeded)
                  *HeadVar__1_1 = SubResult1_6;
                else
                  hlds__hlds_goal____Compare____hlds_goal_0_0(HeadVar__1_1, Var_106, ArgY2_8);
              }
              break;
            case (MR_Integer) 1:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
            case (MR_Integer) 2:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
          }
        }
        break;
      case (MR_Integer) 1:
        {
          MR_Word Var_99 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 6))));
          MR_Word Var_100 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 5))));
          MR_Word Var_101 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 4))));
          MR_Word Var_102 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 3))));
          MR_Word Var_103 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 2))));
          MR_Word Var_104 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 1))));
          MR_Word Var_105 = ((MR_Unsigned) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))) & (MR_Integer) 3);

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 1:
              {
                MR_Word ArgY1_33 = ((MR_Unsigned) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 0))) & (MR_Integer) 3);
                MR_Word ArgY2_36 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 1))));
                MR_Word ArgY3_39 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 2))));
                MR_Word ArgY4_42 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 3))));
                MR_Word ArgY5_45 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 4))));
                MR_Word ArgY6_48 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 5))));
                MR_Word ArgY7_51 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 6))));
                MR_Word SubResult1_34;
                MR_Integer Var_111 = (MR_Integer) (Var_105);
                MR_Integer Var_112 = (MR_Integer) (ArgY1_33);

                succeeded = (Var_111 < Var_112);
                if (succeeded)
                {
                  SubResult1_34 = (MR_Integer) 1;
                  succeeded = MR_TRUE;
                }
                else
                {
                  succeeded = (Var_111 > Var_112);
                  if (succeeded)
                  {
                    SubResult1_34 = (MR_Integer) 2;
                    succeeded = MR_TRUE;
                  }
                  else
                  {
                    succeeded = MR_TRUE;
                    succeeded = !(succeeded);
                    if (succeeded)
                    {
                      SubResult1_34 = (MR_Integer) 0;
                      succeeded = MR_TRUE;
                    }
                  }
                }
                if (succeeded)
                  *HeadVar__1_1 = SubResult1_34;
                else
                {
                  MR_Word SubResult2_37;

                  hlds__hlds_goal____Compare____atomic_interface_vars_0_0(&SubResult2_37, Var_104, ArgY2_36);
                  succeeded = (SubResult2_37 != (MR_Integer) 0);
                  if (succeeded)
                    *HeadVar__1_1 = SubResult2_37;
                  else
                  {
                    MR_Word SubResult3_40;

                    hlds__hlds_goal____Compare____atomic_interface_vars_0_0(&SubResult3_40, Var_103, ArgY3_39);
                    succeeded = (SubResult3_40 != (MR_Integer) 0);
                    if (succeeded)
                      *HeadVar__1_1 = SubResult3_40;
                    else
                    {
                      MR_Word SubResult4_43;

                      mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[32]), &SubResult4_43, ((MR_Box) (Var_102)), ((MR_Box) (ArgY4_42)));
                      succeeded = (SubResult4_43 != (MR_Integer) 0);
                      if (succeeded)
                        *HeadVar__1_1 = SubResult4_43;
                      else
                      {
                        MR_Word SubResult5_46;

                        hlds__hlds_goal____Compare____hlds_goal_0_0(&SubResult5_46, Var_101, ArgY5_45);
                        succeeded = (SubResult5_46 != (MR_Integer) 0);
                        if (succeeded)
                          *HeadVar__1_1 = SubResult5_46;
                        else
                        {
                          MR_Word SubResult6_49;

                          mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[13]), &SubResult6_49, ((MR_Box) (Var_100)), ((MR_Box) (ArgY6_48)));
                          succeeded = (SubResult6_49 != (MR_Integer) 0);
                          if (succeeded)
                            *HeadVar__1_1 = SubResult6_49;
                          else
                            mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[33]), HeadVar__1_1, ((MR_Box) (Var_99)), ((MR_Box) (ArgY7_51)));
                        }
                      }
                    }
                  }
                }
              }
              break;
            case (MR_Integer) 2:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
          }
        }
        break;
      case (MR_Integer) 2:
        {
          MR_Word Var_108 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 2))));
          MR_Word Var_109 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 1))));
          MR_Word Var_110 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 1:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 2:
              {
                MR_Word ArgY1_78 = ((MR_Word) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 0))));
                MR_Word ArgY2_81 = ((MR_Word) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 1))));
                MR_Word ArgY3_84 = ((MR_Word) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 2))));
                MR_Word SubResult1_79;

                mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[31]), &SubResult1_79, ((MR_Box) (Var_110)), ((MR_Box) (ArgY1_78)));
                succeeded = (SubResult1_79 != (MR_Integer) 0);
                if (succeeded)
                  *HeadVar__1_1 = SubResult1_79;
                else
                {
                  MR_Word SubResult2_82;

                  mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), &SubResult2_82, ((MR_Box) (Var_109)), ((MR_Box) (ArgY2_81)));
                  succeeded = (SubResult2_82 != (MR_Integer) 0);
                  if (succeeded)
                    *HeadVar__1_1 = SubResult2_82;
                  else
                    hlds__hlds_goal____Compare____hlds_goal_0_0(HeadVar__1_1, Var_108, ArgY3_84);
                }
              }
              break;
          }
        }
        break;
    }
}

void MR_CALL 
hlds__hlds_goal____Compare____hlds_goal_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_9 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_10 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_9 == CastY_10);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  {
    MR_Word ArgX1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));
    MR_Word ArgX2_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgY2_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word SubResult1_6;

    hlds__hlds_goal____Compare____hlds_goal_expr_0_0(&SubResult1_6, ArgX1_4, ArgY1_5);
    succeeded = (SubResult1_6 != (MR_Integer) 0);
    if (succeeded)
      *HeadVar__1_1 = SubResult1_6;
    else
      hlds__hlds_goal____Compare____hlds_goal_info_0_0(HeadVar__1_1, ArgX2_7, ArgY2_8);
  }
}

void MR_CALL 
hlds__hlds_goal____Compare____hlds_goal_info_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_27 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_28 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_27 == CastY_28);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  {
    MR_Word ArgX1_4 = ((((MR_Unsigned) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))) >> 2)) & (MR_Integer) 7);
    MR_Word ArgY1_5 = ((((MR_Unsigned) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))) >> 2)) & (MR_Integer) 7);
    MR_Word ArgX2_7 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))) & (MR_Integer) 3);
    MR_Word ArgY2_8 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))) & (MR_Integer) 3);
    MR_Word ArgX3_10 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgY3_11 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word ArgX4_13 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));
    MR_Word ArgY4_14 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 2))));
    MR_Word ArgX5_16 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 3))));
    MR_Word ArgY5_17 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 3))));
    MR_Word ArgX6_19 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 4))));
    MR_Word ArgY6_20 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 4))));
    MR_Word ArgX7_22 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 5))));
    MR_Word ArgY7_23 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 5))));
    MR_Word ArgX8_25 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 6))));
    MR_Word ArgY8_26 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 6))));
    MR_Word SubResult1_6;
    MR_Integer Var_37 = (MR_Integer) (ArgX1_4);
    MR_Integer Var_38 = (MR_Integer) (ArgY1_5);

    succeeded = (Var_37 < Var_38);
    if (succeeded)
    {
      SubResult1_6 = (MR_Integer) 1;
      succeeded = MR_TRUE;
    }
    else
    {
      succeeded = (Var_37 > Var_38);
      if (succeeded)
      {
        SubResult1_6 = (MR_Integer) 2;
        succeeded = MR_TRUE;
      }
      else
      {
        succeeded = MR_TRUE;
        succeeded = !(succeeded);
        if (succeeded)
        {
          SubResult1_6 = (MR_Integer) 0;
          succeeded = MR_TRUE;
        }
      }
    }
    if (succeeded)
      *HeadVar__1_1 = SubResult1_6;
    else
    {
      MR_Word SubResult2_9;
      MR_Integer Var_39 = (MR_Integer) (ArgX2_7);
      MR_Integer Var_40 = (MR_Integer) (ArgY2_8);

      succeeded = (Var_39 < Var_40);
      if (succeeded)
      {
        SubResult2_9 = (MR_Integer) 1;
        succeeded = MR_TRUE;
      }
      else
      {
        succeeded = (Var_39 > Var_40);
        if (succeeded)
        {
          SubResult2_9 = (MR_Integer) 2;
          succeeded = MR_TRUE;
        }
        else
        {
          succeeded = MR_TRUE;
          succeeded = !(succeeded);
          if (succeeded)
          {
            SubResult2_9 = (MR_Integer) 0;
            succeeded = MR_TRUE;
          }
        }
      }
      if (succeeded)
        *HeadVar__1_1 = SubResult2_9;
      else
      {
        MR_Word SubResult3_12;

        hlds__instmap____Compare____instmap_0_0(&SubResult3_12, ArgX3_10, ArgY3_11);
        succeeded = (SubResult3_12 != (MR_Integer) 0);
        if (succeeded)
          *HeadVar__1_1 = SubResult3_12;
        else
        {
          MR_Word SubResult4_15;

          mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[3]), &SubResult4_15, ((MR_Box) (ArgX4_13)), ((MR_Box) (ArgY4_14)));
          succeeded = (SubResult4_15 != (MR_Integer) 0);
          if (succeeded)
            *HeadVar__1_1 = SubResult4_15;
          else
          {
            MR_Word SubResult5_18;

            mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[23]), &SubResult5_18, ((MR_Box) (ArgX5_16)), ((MR_Box) (ArgY5_17)));
            succeeded = (SubResult5_18 != (MR_Integer) 0);
            if (succeeded)
              *HeadVar__1_1 = SubResult5_18;
            else
            {
              MR_Word SubResult6_21;
              MR_Integer Var_41 = (MR_Integer) (ArgX6_19);
              MR_Integer Var_42 = (MR_Integer) (ArgY6_20);

              succeeded = (Var_41 < Var_42);
              if (succeeded)
              {
                SubResult6_21 = (MR_Integer) 1;
                succeeded = MR_TRUE;
              }
              else
              {
                succeeded = (Var_41 > Var_42);
                if (succeeded)
                {
                  SubResult6_21 = (MR_Integer) 2;
                  succeeded = MR_TRUE;
                }
                else
                {
                  succeeded = MR_TRUE;
                  succeeded = !(succeeded);
                  if (succeeded)
                  {
                    SubResult6_21 = (MR_Integer) 0;
                    succeeded = MR_TRUE;
                  }
                }
              }
              if (succeeded)
                *HeadVar__1_1 = SubResult6_21;
              else
              {
                MR_Word SubResult7_24;

                hlds__hlds_goal____Compare____hlds_goal_code_gen_info_0_0(&SubResult7_24, ArgX7_22, ArgY7_23);
                succeeded = (SubResult7_24 != (MR_Integer) 0);
                if (succeeded)
                  *HeadVar__1_1 = SubResult7_24;
                else
                {
                  MR_Integer CastX_66 = (MR_Integer) (ArgX8_25);
                  MR_Integer CastY_67 = (MR_Integer) (ArgY8_26);

                  succeeded = (CastX_66 == CastY_67);
                  if (succeeded)
                    *HeadVar__1_1 = (MR_Integer) 0;
                  else
                  {
                    MR_Word ArgX1_43 = ((MR_Word) ((MR_hl_field(0, ArgX8_25, (MR_Integer) 0))));
                    MR_Word ArgY1_44 = ((MR_Word) ((MR_hl_field(0, ArgY8_26, (MR_Integer) 0))));
                    MR_Word ArgX2_46 = ((MR_Word) ((MR_hl_field(0, ArgX8_25, (MR_Integer) 1))));
                    MR_Word ArgY2_47 = ((MR_Word) ((MR_hl_field(0, ArgY8_26, (MR_Integer) 1))));
                    MR_Word ArgX3_49 = ((MR_Word) ((MR_hl_field(0, ArgX8_25, (MR_Integer) 2))));
                    MR_Word ArgY3_50 = ((MR_Word) ((MR_hl_field(0, ArgY8_26, (MR_Integer) 2))));
                    MR_Word ArgX4_52 = ((MR_Word) ((MR_hl_field(0, ArgX8_25, (MR_Integer) 3))));
                    MR_Word ArgY4_53 = ((MR_Word) ((MR_hl_field(0, ArgY8_26, (MR_Integer) 3))));
                    MR_Word ArgX5_55 = ((MR_Word) ((MR_hl_field(0, ArgX8_25, (MR_Integer) 4))));
                    MR_Word ArgY5_56 = ((MR_Word) ((MR_hl_field(0, ArgY8_26, (MR_Integer) 4))));
                    MR_Word ArgX6_58 = ((MR_Word) ((MR_hl_field(0, ArgX8_25, (MR_Integer) 5))));
                    MR_Word ArgY6_59 = ((MR_Word) ((MR_hl_field(0, ArgY8_26, (MR_Integer) 5))));
                    MR_Word ArgX7_61 = ((MR_Word) ((MR_hl_field(0, ArgX8_25, (MR_Integer) 6))));
                    MR_Word ArgY7_62 = ((MR_Word) ((MR_hl_field(0, ArgY8_26, (MR_Integer) 6))));
                    MR_Word ArgX8_64 = ((MR_Word) ((MR_hl_field(0, ArgX8_25, (MR_Integer) 7))));
                    MR_Word ArgY8_65 = ((MR_Word) ((MR_hl_field(0, ArgY8_26, (MR_Integer) 7))));
                    MR_Word SubResult1_45;

                    mercury__term_context____Compare____term_context_0_0(&SubResult1_45, ArgX1_43, ArgY1_44);
                    succeeded = (SubResult1_45 != (MR_Integer) 0);
                    if (succeeded)
                      *HeadVar__1_1 = SubResult1_45;
                    else
                    {
                      MR_Word SubResult2_48;

                      mdbcomp__goal_path____Compare____reverse_goal_path_0_0(&SubResult2_48, ArgX2_46, ArgY2_47);
                      succeeded = (SubResult2_48 != (MR_Integer) 0);
                      if (succeeded)
                        *HeadVar__1_1 = SubResult2_48;
                      else
                      {
                        MR_Word SubResult3_51;

                        mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_2[0]), &SubResult3_51, ((MR_Box) (ArgX3_49)), ((MR_Box) (ArgY3_50)));
                        succeeded = (SubResult3_51 != (MR_Integer) 0);
                        if (succeeded)
                          *HeadVar__1_1 = SubResult3_51;
                        else
                        {
                          MR_Word SubResult4_54;

                          hlds__goal_mode____Compare____goal_mode_0_0(&SubResult4_54, ArgX4_52, ArgY4_53);
                          succeeded = (SubResult4_54 != (MR_Integer) 0);
                          if (succeeded)
                            *HeadVar__1_1 = SubResult4_54;
                          else
                          {
                            MR_Word SubResult5_57;

                            mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[19]), &SubResult5_57, ((MR_Box) (ArgX5_55)), ((MR_Box) (ArgY5_56)));
                            succeeded = (SubResult5_57 != (MR_Integer) 0);
                            if (succeeded)
                              *HeadVar__1_1 = SubResult5_57;
                            else
                            {
                              MR_Word SubResult6_60;

                              mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[20]), &SubResult6_60, ((MR_Box) (ArgX6_58)), ((MR_Box) (ArgY6_59)));
                              succeeded = (SubResult6_60 != (MR_Integer) 0);
                              if (succeeded)
                                *HeadVar__1_1 = SubResult6_60;
                              else
                              {
                                MR_Word SubResult7_63;

                                mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[21]), &SubResult7_63, ((MR_Box) (ArgX7_61)), ((MR_Box) (ArgY7_62)));
                                succeeded = (SubResult7_63 != (MR_Integer) 0);
                                if (succeeded)
                                  *HeadVar__1_1 = SubResult7_63;
                                else
                                  mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[22]), HeadVar__1_1, ((MR_Box) (ArgX8_64)), ((MR_Box) (ArgY8_65)));
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

void MR_CALL 
hlds__hlds_goal____Compare____hlds_goal_code_gen_info_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_8 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_9 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_8 == CastY_9);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  if ((HeadVar__2_2 == (MR_Word) ((MR_Unsigned) 0U)))
    if ((HeadVar__3_3 == (MR_Word) ((MR_Unsigned) 0U)))
      *HeadVar__1_1 = (MR_Integer) 0;
    else
      *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    MR_Word Var_11 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))));

    if ((HeadVar__3_3 == (MR_Word) ((MR_Unsigned) 0U)))
      *HeadVar__1_1 = (MR_Integer) 2;
    else
    {
      MR_Word ArgY1_7 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 0))));

      hlds__hlds_llds____Compare____llds_code_gen_details_0_0(HeadVar__1_1, Var_11, ArgY1_7);
    }
  }
}

void MR_CALL 
hlds__hlds_goal____Compare____unification_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_219 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_220 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_219 == CastY_220);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
    switch (MR_tag((MR_Word) HeadVar__2_2)) {
      default: /*NOTREACHED*/ MR_assert(0);
      case (MR_Integer) 0:
        {
          MR_Word Var_246 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 6))));
          MR_Word Var_247 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 5))) & (MR_Integer) 1);
          MR_Word Var_248 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 4))));
          MR_Word Var_249 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 3))));
          MR_Word Var_250 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));
          MR_Word Var_251 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
          MR_Word Var_252 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              {
                MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));
                MR_Word ArgY2_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))));
                MR_Word ArgY3_11 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 2))));
                MR_Word ArgY4_14 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 3))));
                MR_Word ArgY5_17 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 4))));
                MR_Word ArgY6_20 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 5))) & (MR_Integer) 1);
                MR_Word ArgY7_23 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 6))));
                MR_Word SubResult1_6;

                mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), &SubResult1_6, ((MR_Box) (Var_252)), ((MR_Box) (ArgY1_5)));
                succeeded = (SubResult1_6 != (MR_Integer) 0);
                if (succeeded)
                  *HeadVar__1_1 = SubResult1_6;
                else
                {
                  MR_Word SubResult2_9;

                  parse_tree__prog_data____Compare____cons_id_0_0(&SubResult2_9, Var_251, ArgY2_8);
                  succeeded = (SubResult2_9 != (MR_Integer) 0);
                  if (succeeded)
                    *HeadVar__1_1 = SubResult2_9;
                  else
                  {
                    MR_Word SubResult3_12;

                    mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[11]), &SubResult3_12, ((MR_Box) (Var_250)), ((MR_Box) (ArgY3_11)));
                    succeeded = (SubResult3_12 != (MR_Integer) 0);
                    if (succeeded)
                      *HeadVar__1_1 = SubResult3_12;
                    else
                    {
                      MR_Word SubResult4_15;

                      mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[35]), &SubResult4_15, ((MR_Box) (Var_249)), ((MR_Box) (ArgY4_14)));
                      succeeded = (SubResult4_15 != (MR_Integer) 0);
                      if (succeeded)
                        *HeadVar__1_1 = SubResult4_15;
                      else
                      {
                        MR_Word SubResult5_18;

                        hlds__hlds_goal____Compare____how_to_construct_0_0(&SubResult5_18, Var_248, ArgY5_17);
                        succeeded = (SubResult5_18 != (MR_Integer) 0);
                        if (succeeded)
                          *HeadVar__1_1 = SubResult5_18;
                        else
                        {
                          MR_Word SubResult6_21;
                          MR_Integer Var_263 = (MR_Integer) (Var_247);
                          MR_Integer Var_264 = (MR_Integer) (ArgY6_20);

                          succeeded = (Var_263 < Var_264);
                          if (succeeded)
                          {
                            SubResult6_21 = (MR_Integer) 1;
                            succeeded = MR_TRUE;
                          }
                          else
                          {
                            succeeded = (Var_263 > Var_264);
                            if (succeeded)
                            {
                              SubResult6_21 = (MR_Integer) 2;
                              succeeded = MR_TRUE;
                            }
                            else
                            {
                              succeeded = MR_TRUE;
                              succeeded = !(succeeded);
                              if (succeeded)
                              {
                                SubResult6_21 = (MR_Integer) 0;
                                succeeded = MR_TRUE;
                              }
                            }
                          }
                          if (succeeded)
                            *HeadVar__1_1 = SubResult6_21;
                          else
                            hlds__hlds_goal____Compare____construct_sub_info_0_0(HeadVar__1_1, Var_246, ArgY7_23);
                        }
                      }
                    }
                  }
                }
              }
              break;
            case (MR_Integer) 1:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
            case (MR_Integer) 2:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
            case (MR_Integer) 3:
              switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
              }
              break;
          }
        }
        break;
      case (MR_Integer) 1:
        {
          MR_Word Var_253 = ((MR_Unsigned) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 4))) & (MR_Integer) 1);
          MR_Word Var_254 = ((((MR_Unsigned) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 4))) >> 1)) & (MR_Integer) 1);
          MR_Word Var_255 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 3))));
          MR_Word Var_256 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 2))));
          MR_Word Var_257 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 1))));
          MR_Word Var_258 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 1:
              {
                MR_Word ArgY1_79 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 0))));
                MR_Word ArgY2_82 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 1))));
                MR_Word ArgY3_85 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 2))));
                MR_Word ArgY4_88 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 3))));
                MR_Word ArgY5_91 = ((((MR_Unsigned) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 4))) >> 1)) & (MR_Integer) 1);
                MR_Word ArgY6_94 = ((MR_Unsigned) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 4))) & (MR_Integer) 1);
                MR_Word SubResult1_80;

                mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), &SubResult1_80, ((MR_Box) (Var_258)), ((MR_Box) (ArgY1_79)));
                succeeded = (SubResult1_80 != (MR_Integer) 0);
                if (succeeded)
                  *HeadVar__1_1 = SubResult1_80;
                else
                {
                  MR_Word SubResult2_83;

                  parse_tree__prog_data____Compare____cons_id_0_0(&SubResult2_83, Var_257, ArgY2_82);
                  succeeded = (SubResult2_83 != (MR_Integer) 0);
                  if (succeeded)
                    *HeadVar__1_1 = SubResult2_83;
                  else
                  {
                    MR_Word SubResult3_86;

                    mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[11]), &SubResult3_86, ((MR_Box) (Var_256)), ((MR_Box) (ArgY3_85)));
                    succeeded = (SubResult3_86 != (MR_Integer) 0);
                    if (succeeded)
                      *HeadVar__1_1 = SubResult3_86;
                    else
                    {
                      MR_Word SubResult4_89;

                      mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[35]), &SubResult4_89, ((MR_Box) (Var_255)), ((MR_Box) (ArgY4_88)));
                      succeeded = (SubResult4_89 != (MR_Integer) 0);
                      if (succeeded)
                        *HeadVar__1_1 = SubResult4_89;
                      else
                      {
                        MR_Word SubResult5_92;
                        MR_Integer Var_265 = (MR_Integer) (Var_254);
                        MR_Integer Var_266 = (MR_Integer) (ArgY5_91);

                        succeeded = (Var_265 < Var_266);
                        if (succeeded)
                        {
                          SubResult5_92 = (MR_Integer) 1;
                          succeeded = MR_TRUE;
                        }
                        else
                        {
                          succeeded = (Var_265 > Var_266);
                          if (succeeded)
                          {
                            SubResult5_92 = (MR_Integer) 2;
                            succeeded = MR_TRUE;
                          }
                          else
                          {
                            succeeded = MR_TRUE;
                            succeeded = !(succeeded);
                            if (succeeded)
                            {
                              SubResult5_92 = (MR_Integer) 0;
                              succeeded = MR_TRUE;
                            }
                          }
                        }
                        if (succeeded)
                          *HeadVar__1_1 = SubResult5_92;
                        else
                        {
                          MR_Integer Var_267 = (MR_Integer) (Var_253);
                          MR_Integer Var_268 = (MR_Integer) (ArgY6_94);

                          succeeded = (Var_267 < Var_268);
                          if (succeeded)
                            *HeadVar__1_1 = (MR_Integer) 1;
                          else
                          {
                            succeeded = (Var_267 > Var_268);
                            if (succeeded)
                              *HeadVar__1_1 = (MR_Integer) 2;
                            else
                              *HeadVar__1_1 = (MR_Integer) 0;
                          }
                        }
                      }
                    }
                  }
                }
              }
              break;
            case (MR_Integer) 2:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
            case (MR_Integer) 3:
              switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
              }
              break;
          }
        }
        break;
      case (MR_Integer) 2:
        {
          MR_Word Var_241 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 1))));
          MR_Word Var_242 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 1:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 2:
              {
                MR_Word ArgY1_138 = ((MR_Word) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 0))));
                MR_Word ArgY2_141 = ((MR_Word) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 1))));
                MR_Word SubResult1_139;

                mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), &SubResult1_139, ((MR_Box) (Var_242)), ((MR_Box) (ArgY1_138)));
                succeeded = (SubResult1_139 != (MR_Integer) 0);
                if (succeeded)
                  *HeadVar__1_1 = SubResult1_139;
                else
                  mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), HeadVar__1_1, ((MR_Box) (Var_241)), ((MR_Box) (ArgY2_141)));
              }
              break;
            case (MR_Integer) 3:
              switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
              }
              break;
          }
        }
        break;
      case (MR_Integer) 3:
        switch (((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0))))) {
          default: /*NOTREACHED*/ MR_assert(0);
          case (MR_Integer) 0:
            {
              MR_Word Var_259 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))));
              MR_Word Var_260 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));

              switch (MR_tag((MR_Word) HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 3:
                  switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                    default: /*NOTREACHED*/ MR_assert(0);
                    case (MR_Integer) 0:
                      {
                        MR_Word ArgY1_173 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 1))));
                        MR_Word ArgY2_176 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 2))));
                        MR_Word SubResult1_174;

                        mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), &SubResult1_174, ((MR_Box) (Var_260)), ((MR_Box) (ArgY1_173)));
                        succeeded = (SubResult1_174 != (MR_Integer) 0);
                        if (succeeded)
                          *HeadVar__1_1 = SubResult1_174;
                        else
                          mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), HeadVar__1_1, ((MR_Box) (Var_259)), ((MR_Box) (ArgY2_176)));
                      }
                      break;
                    case (MR_Integer) 1:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                  }
                  break;
              }
            }
            break;
          case (MR_Integer) 1:
            {
              MR_Word Var_243 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 3))));
              MR_Word Var_244 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))) & (MR_Integer) 1);
              MR_Word Var_245 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));

              switch (MR_tag((MR_Word) HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 3:
                  switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                    default: /*NOTREACHED*/ MR_assert(0);
                    case (MR_Integer) 0:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 1:
                      {
                        MR_Word ArgY1_212 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 1))));
                        MR_Word ArgY2_215 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 2))) & (MR_Integer) 1);
                        MR_Word ArgY3_218 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 3))));
                        MR_Word SubResult1_213;

                        hlds__hlds_goal____Compare____unify_mode_0_0(&SubResult1_213, Var_245, ArgY1_212);
                        succeeded = (SubResult1_213 != (MR_Integer) 0);
                        if (succeeded)
                          *HeadVar__1_1 = SubResult1_213;
                        else
                        {
                          MR_Word SubResult2_216;
                          MR_Integer Var_261 = (MR_Integer) (Var_244);
                          MR_Integer Var_262 = (MR_Integer) (ArgY2_215);

                          succeeded = (Var_261 < Var_262);
                          if (succeeded)
                          {
                            SubResult2_216 = (MR_Integer) 1;
                            succeeded = MR_TRUE;
                          }
                          else
                          {
                            succeeded = (Var_261 > Var_262);
                            if (succeeded)
                            {
                              SubResult2_216 = (MR_Integer) 2;
                              succeeded = MR_TRUE;
                            }
                            else
                            {
                              succeeded = MR_TRUE;
                              succeeded = !(succeeded);
                              if (succeeded)
                              {
                                SubResult2_216 = (MR_Integer) 0;
                                succeeded = MR_TRUE;
                              }
                            }
                          }
                          if (succeeded)
                            *HeadVar__1_1 = SubResult2_216;
                          else
                            mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[11]), HeadVar__1_1, ((MR_Box) (Var_243)), ((MR_Box) (ArgY3_218)));
                        }
                      }
                      break;
                  }
                  break;
              }
            }
            break;
        }
        break;
    }
}

void MR_CALL 
hlds__hlds_goal____Compare____unify_mode_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_15 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_16 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_15 == CastY_16);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  {
    MR_Word ArgX1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));
    MR_Word ArgX2_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgY2_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word ArgX3_10 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));
    MR_Word ArgY3_11 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 2))));
    MR_Word ArgX4_13 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 3))));
    MR_Word ArgY4_14 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 3))));
    MR_Word SubResult1_6;

    parse_tree__prog_data____Compare____mer_inst_0_0(&SubResult1_6, ArgX1_4, ArgY1_5);
    succeeded = (SubResult1_6 != (MR_Integer) 0);
    if (succeeded)
      *HeadVar__1_1 = SubResult1_6;
    else
    {
      MR_Word SubResult2_9;

      parse_tree__prog_data____Compare____mer_inst_0_0(&SubResult2_9, ArgX2_7, ArgY2_8);
      succeeded = (SubResult2_9 != (MR_Integer) 0);
      if (succeeded)
        *HeadVar__1_1 = SubResult2_9;
      else
      {
        MR_Word SubResult3_12;

        parse_tree__prog_data____Compare____mer_inst_0_0(&SubResult3_12, ArgX3_10, ArgY3_11);
        succeeded = (SubResult3_12 != (MR_Integer) 0);
        if (succeeded)
          *HeadVar__1_1 = SubResult3_12;
        else
          parse_tree__prog_data____Compare____mer_inst_0_0(HeadVar__1_1, ArgX4_13, ArgY4_14);
      }
    }
  }
}

void MR_CALL 
hlds__hlds_goal____Compare____how_to_construct_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_28 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_29 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_28 == CastY_29);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
    switch (MR_tag((MR_Word) HeadVar__2_2)) {
      default: /*NOTREACHED*/ MR_assert(0);
      case (MR_Integer) 0:
        switch (MR_tag((MR_Word) HeadVar__3_3)) {
          default: /*NOTREACHED*/ MR_assert(0);
          case (MR_Integer) 0:
            *HeadVar__1_1 = (MR_Integer) 0;
            break;
          case (MR_Integer) 1:
            *HeadVar__1_1 = (MR_Integer) 1;
            break;
          case (MR_Integer) 2:
            *HeadVar__1_1 = (MR_Integer) 1;
            break;
          case (MR_Integer) 3:
            *HeadVar__1_1 = (MR_Integer) 1;
            break;
        }
        break;
      case (MR_Integer) 1:
        {
          MR_Word Var_35 = (MR_Word) (MR_body((MR_Word) (HeadVar__2_2), (MR_Integer) 1));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 1:
              {
                MR_Word ArgY1_27 = (MR_Word) (MR_body((MR_Word) (HeadVar__3_3), (MR_Integer) 1));

                hlds__hlds_goal____Compare____cell_to_reuse_0_0(HeadVar__1_1, Var_35, ArgY1_27);
              }
              break;
            case (MR_Integer) 2:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 3:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
          }
        }
        break;
      case (MR_Integer) 2:
        {
          MR_Word Var_34 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))) & (MR_Integer) 1);

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 1:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
            case (MR_Integer) 2:
              {
                MR_Word ArgY1_9 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 0))) & (MR_Integer) 1);
                MR_Integer Var_36 = (MR_Integer) (Var_34);
                MR_Integer Var_37 = (MR_Integer) (ArgY1_9);

                succeeded = (Var_36 < Var_37);
                if (succeeded)
                  *HeadVar__1_1 = (MR_Integer) 1;
                else
                {
                  succeeded = (Var_36 > Var_37);
                  if (succeeded)
                    *HeadVar__1_1 = (MR_Integer) 2;
                  else
                    *HeadVar__1_1 = (MR_Integer) 0;
                }
              }
              break;
            case (MR_Integer) 3:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
          }
        }
        break;
      case (MR_Integer) 3:
        {
          MR_Word Var_33 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0))));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 1:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
            case (MR_Integer) 2:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 3:
              {
                MR_Word ArgY1_18 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))));

                mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), HeadVar__1_1, ((MR_Box) (Var_33)), ((MR_Box) (ArgY1_18)));
              }
              break;
          }
        }
        break;
    }
}

void MR_CALL 
hlds__hlds_goal____Compare____cell_to_reuse_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_12 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_13 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_12 == CastY_13);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  {
    MR_Word ArgX1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));
    MR_Word ArgX2_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgY2_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word ArgX3_10 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));
    MR_Word ArgY3_11 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 2))));
    MR_Word SubResult1_6;

    mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), &SubResult1_6, ((MR_Box) (ArgX1_4)), ((MR_Box) (ArgY1_5)));
    succeeded = (SubResult1_6 != (MR_Integer) 0);
    if (succeeded)
      *HeadVar__1_1 = SubResult1_6;
    else
    {
      MR_Word SubResult2_9;

      mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[4]), &SubResult2_9, ((MR_Box) (ArgX2_7)), ((MR_Box) (ArgY2_8)));
      succeeded = (SubResult2_9 != (MR_Integer) 0);
      if (succeeded)
        *HeadVar__1_1 = SubResult2_9;
      else
        mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[5]), HeadVar__1_1, ((MR_Box) (ArgX3_10)), ((MR_Box) (ArgY3_11)));
    }
  }
}

void MR_CALL 
hlds__hlds_goal____Compare____construct_sub_info_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_13 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_14 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_13 == CastY_14);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  if ((HeadVar__2_2 == (MR_Word) ((MR_Unsigned) 0U)))
    if ((HeadVar__3_3 == (MR_Word) ((MR_Unsigned) 0U)))
      *HeadVar__1_1 = (MR_Integer) 0;
    else
      *HeadVar__1_1 = (MR_Integer) 2;
  else
  {
    MR_Word Var_17 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word Var_18 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))));

    if ((HeadVar__3_3 == (MR_Word) ((MR_Unsigned) 0U)))
      *HeadVar__1_1 = (MR_Integer) 1;
    else
    {
      MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 0))));
      MR_Word ArgY2_8 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 1))));
      MR_Word SubResult1_6;

      mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[7]), &SubResult1_6, ((MR_Box) (Var_18)), ((MR_Box) (ArgY1_5)));
      succeeded = (SubResult1_6 != (MR_Integer) 0);
      if (succeeded)
        *HeadVar__1_1 = SubResult1_6;
      else
        mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[8]), HeadVar__1_1, ((MR_Box) (Var_17)), ((MR_Box) (ArgY2_8)));
    }
  }
}

void MR_CALL 
hlds__hlds_goal____Compare____scope_reason_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_567 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_568 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_567 == CastY_568);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
    switch (MR_tag((MR_Word) HeadVar__2_2)) {
      default: /*NOTREACHED*/ MR_assert(0);
      case (MR_Integer) 0:
        {
          MR_Word Var_596 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))) & (MR_Integer) 1);
          MR_Word Var_597 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              {
                MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));
                MR_Word ArgY2_8 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))) & (MR_Integer) 1);
                MR_Word SubResult1_6;

                mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[11]), &SubResult1_6, ((MR_Box) (Var_597)), ((MR_Box) (ArgY1_5)));
                succeeded = (SubResult1_6 != (MR_Integer) 0);
                if (succeeded)
                  *HeadVar__1_1 = SubResult1_6;
                else
                {
                  MR_Integer Var_621 = (MR_Integer) (Var_596);
                  MR_Integer Var_622 = (MR_Integer) (ArgY2_8);

                  succeeded = (Var_621 < Var_622);
                  if (succeeded)
                    *HeadVar__1_1 = (MR_Integer) 1;
                  else
                  {
                    succeeded = (Var_621 > Var_622);
                    if (succeeded)
                      *HeadVar__1_1 = (MR_Integer) 2;
                    else
                      *HeadVar__1_1 = (MR_Integer) 0;
                  }
                }
              }
              break;
            case (MR_Integer) 1:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
            case (MR_Integer) 2:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
            case (MR_Integer) 3:
              switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 3:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 4:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 5:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 6:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 7:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 8:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
              }
              break;
          }
        }
        break;
      case (MR_Integer) 1:
        {
          MR_Word Var_594 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 1))));
          MR_Word Var_595 = ((MR_Unsigned) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))) & (MR_Integer) 7);

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 1:
              {
                MR_Word ArgY1_57 = ((MR_Unsigned) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 0))) & (MR_Integer) 7);
                MR_Word ArgY2_60 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 1))));
                MR_Word SubResult1_58;
                MR_Integer Var_619 = (MR_Integer) (Var_595);
                MR_Integer Var_620 = (MR_Integer) (ArgY1_57);

                succeeded = (Var_619 < Var_620);
                if (succeeded)
                {
                  SubResult1_58 = (MR_Integer) 1;
                  succeeded = MR_TRUE;
                }
                else
                {
                  succeeded = (Var_619 > Var_620);
                  if (succeeded)
                  {
                    SubResult1_58 = (MR_Integer) 2;
                    succeeded = MR_TRUE;
                  }
                  else
                  {
                    succeeded = MR_TRUE;
                    succeeded = !(succeeded);
                    if (succeeded)
                    {
                      SubResult1_58 = (MR_Integer) 0;
                      succeeded = MR_TRUE;
                    }
                  }
                }
                if (succeeded)
                  *HeadVar__1_1 = SubResult1_58;
                else
                  mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[30]), HeadVar__1_1, ((MR_Box) (Var_594)), ((MR_Box) (ArgY2_60)));
              }
              break;
            case (MR_Integer) 2:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
            case (MR_Integer) 3:
              switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 3:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 4:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 5:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 6:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 7:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 8:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
              }
              break;
          }
        }
        break;
      case (MR_Integer) 2:
        {
          MR_Word Var_604 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 1))) & (MR_Integer) 3);
          MR_Word Var_605 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 1:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 2:
              {
                MR_Word ArgY1_109 = ((MR_Word) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 0))));
                MR_Word ArgY2_112 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 1))) & (MR_Integer) 3);
                MR_Word SubResult1_110;

                mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[11]), &SubResult1_110, ((MR_Box) (Var_605)), ((MR_Box) (ArgY1_109)));
                succeeded = (SubResult1_110 != (MR_Integer) 0);
                if (succeeded)
                  *HeadVar__1_1 = SubResult1_110;
                else
                {
                  MR_Integer Var_629 = (MR_Integer) (Var_604);
                  MR_Integer Var_630 = (MR_Integer) (ArgY2_112);

                  succeeded = (Var_629 < Var_630);
                  if (succeeded)
                    *HeadVar__1_1 = (MR_Integer) 1;
                  else
                  {
                    succeeded = (Var_629 > Var_630);
                    if (succeeded)
                      *HeadVar__1_1 = (MR_Integer) 2;
                    else
                      *HeadVar__1_1 = (MR_Integer) 0;
                  }
                }
              }
              break;
            case (MR_Integer) 3:
              switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 3:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 4:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 5:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 6:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 7:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
                case (MR_Integer) 8:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
              }
              break;
          }
        }
        break;
      case (MR_Integer) 3:
        switch (((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0))))) {
          default: /*NOTREACHED*/ MR_assert(0);
          case (MR_Integer) 0:
            {
              MR_Word Var_603 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))) & (MR_Integer) 3);

              switch (MR_tag((MR_Word) HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 3:
                  switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                    default: /*NOTREACHED*/ MR_assert(0);
                    case (MR_Integer) 0:
                      {
                        MR_Word ArgY1_158 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 1))) & (MR_Integer) 3);
                        MR_Integer Var_627 = (MR_Integer) (Var_603);
                        MR_Integer Var_628 = (MR_Integer) (ArgY1_158);

                        succeeded = (Var_627 < Var_628);
                        if (succeeded)
                          *HeadVar__1_1 = (MR_Integer) 1;
                        else
                        {
                          succeeded = (Var_627 > Var_628);
                          if (succeeded)
                            *HeadVar__1_1 = (MR_Integer) 2;
                          else
                            *HeadVar__1_1 = (MR_Integer) 0;
                        }
                      }
                      break;
                    case (MR_Integer) 1:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 2:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 3:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 4:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 5:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 6:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 7:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 8:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                  }
                  break;
              }
            }
            break;
          case (MR_Integer) 1:
            {
              MR_Word Var_607 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))) & (MR_Integer) 7);

              switch (MR_tag((MR_Word) HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 3:
                  switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                    default: /*NOTREACHED*/ MR_assert(0);
                    case (MR_Integer) 0:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 1:
                      {
                        MR_Word ArgY1_195 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 1))) & (MR_Integer) 7);
                        MR_Integer Var_631 = (MR_Integer) (Var_607);
                        MR_Integer Var_632 = (MR_Integer) (ArgY1_195);

                        succeeded = (Var_631 < Var_632);
                        if (succeeded)
                          *HeadVar__1_1 = (MR_Integer) 1;
                        else
                        {
                          succeeded = (Var_631 > Var_632);
                          if (succeeded)
                            *HeadVar__1_1 = (MR_Integer) 2;
                          else
                            *HeadVar__1_1 = (MR_Integer) 0;
                        }
                      }
                      break;
                    case (MR_Integer) 2:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 3:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 4:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 5:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 6:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 7:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 8:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                  }
                  break;
              }
            }
            break;
          case (MR_Integer) 2:
            {
              MR_Word Var_606 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));

              switch (MR_tag((MR_Word) HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 3:
                  switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                    default: /*NOTREACHED*/ MR_assert(0);
                    case (MR_Integer) 0:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 1:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 2:
                      {
                        MR_Word ArgY1_232 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 1))));

                        mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), HeadVar__1_1, ((MR_Box) (Var_606)), ((MR_Box) (ArgY1_232)));
                      }
                      break;
                    case (MR_Integer) 3:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 4:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 5:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 6:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 7:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 8:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                  }
                  break;
              }
            }
            break;
          case (MR_Integer) 3:
            {
              MR_Word Var_608 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))) & (MR_Integer) 7);
              MR_Word Var_609 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));

              switch (MR_tag((MR_Word) HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 3:
                  switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                    default: /*NOTREACHED*/ MR_assert(0);
                    case (MR_Integer) 0:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 1:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 2:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 3:
                      {
                        MR_Word ArgY1_275 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 1))));
                        MR_Word ArgY2_278 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 2))) & (MR_Integer) 7);
                        MR_Word SubResult1_276;

                        mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), &SubResult1_276, ((MR_Box) (Var_609)), ((MR_Box) (ArgY1_275)));
                        succeeded = (SubResult1_276 != (MR_Integer) 0);
                        if (succeeded)
                          *HeadVar__1_1 = SubResult1_276;
                        else
                        {
                          MR_Integer Var_633 = (MR_Integer) (Var_608);
                          MR_Integer Var_634 = (MR_Integer) (ArgY2_278);

                          succeeded = (Var_633 < Var_634);
                          if (succeeded)
                            *HeadVar__1_1 = (MR_Integer) 1;
                          else
                          {
                            succeeded = (Var_633 > Var_634);
                            if (succeeded)
                              *HeadVar__1_1 = (MR_Integer) 2;
                            else
                              *HeadVar__1_1 = (MR_Integer) 0;
                          }
                        }
                      }
                      break;
                    case (MR_Integer) 4:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 5:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 6:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 7:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 8:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                  }
                  break;
              }
            }
            break;
          case (MR_Integer) 4:
            {
              MR_Word Var_593 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))) & (MR_Integer) 1);

              switch (MR_tag((MR_Word) HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 3:
                  switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                    default: /*NOTREACHED*/ MR_assert(0);
                    case (MR_Integer) 0:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 1:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 2:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 3:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 4:
                      {
                        MR_Word ArgY1_320 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 1))) & (MR_Integer) 1);
                        MR_Integer Var_617 = (MR_Integer) (Var_593);
                        MR_Integer Var_618 = (MR_Integer) (ArgY1_320);

                        succeeded = (Var_617 < Var_618);
                        if (succeeded)
                          *HeadVar__1_1 = (MR_Integer) 1;
                        else
                        {
                          succeeded = (Var_617 > Var_618);
                          if (succeeded)
                            *HeadVar__1_1 = (MR_Integer) 2;
                          else
                            *HeadVar__1_1 = (MR_Integer) 0;
                        }
                      }
                      break;
                    case (MR_Integer) 5:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 6:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 7:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 8:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                  }
                  break;
              }
            }
            break;
          case (MR_Integer) 5:
            {
              MR_Word Var_592 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))) & (MR_Integer) 1);

              switch (MR_tag((MR_Word) HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 3:
                  switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                    default: /*NOTREACHED*/ MR_assert(0);
                    case (MR_Integer) 0:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 1:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 2:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 3:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 4:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 5:
                      {
                        MR_Word ArgY1_357 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 1))) & (MR_Integer) 1);
                        MR_Integer Var_615 = (MR_Integer) (Var_592);
                        MR_Integer Var_616 = (MR_Integer) (ArgY1_357);

                        succeeded = (Var_615 < Var_616);
                        if (succeeded)
                          *HeadVar__1_1 = (MR_Integer) 1;
                        else
                        {
                          succeeded = (Var_615 > Var_616);
                          if (succeeded)
                            *HeadVar__1_1 = (MR_Integer) 2;
                          else
                            *HeadVar__1_1 = (MR_Integer) 0;
                        }
                      }
                      break;
                    case (MR_Integer) 6:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 7:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 8:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                  }
                  break;
              }
            }
            break;
          case (MR_Integer) 6:
            {
              MR_Word Var_598 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))) & (MR_Integer) 3);
              MR_Word Var_599 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));

              switch (MR_tag((MR_Word) HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 3:
                  switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                    default: /*NOTREACHED*/ MR_assert(0);
                    case (MR_Integer) 0:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 1:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 2:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 3:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 4:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 5:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 6:
                      {
                        MR_Word ArgY1_403 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 1))));
                        MR_Word ArgY2_406 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 2))) & (MR_Integer) 3);
                        MR_Word SubResult1_404;

                        mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), &SubResult1_404, ((MR_Box) (Var_599)), ((MR_Box) (ArgY1_403)));
                        succeeded = (SubResult1_404 != (MR_Integer) 0);
                        if (succeeded)
                          *HeadVar__1_1 = SubResult1_404;
                        else
                        {
                          MR_Integer Var_623 = (MR_Integer) (Var_598);
                          MR_Integer Var_624 = (MR_Integer) (ArgY2_406);

                          succeeded = (Var_623 < Var_624);
                          if (succeeded)
                            *HeadVar__1_1 = (MR_Integer) 1;
                          else
                          {
                            succeeded = (Var_623 > Var_624);
                            if (succeeded)
                              *HeadVar__1_1 = (MR_Integer) 2;
                            else
                              *HeadVar__1_1 = (MR_Integer) 0;
                          }
                        }
                      }
                      break;
                    case (MR_Integer) 7:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                    case (MR_Integer) 8:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                  }
                  break;
              }
            }
            break;
          case (MR_Integer) 7:
            {
              MR_Word Var_610 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 5))));
              MR_Word Var_611 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 4))));
              MR_Word Var_612 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 3))));
              MR_Word Var_613 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))));
              MR_Word Var_614 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));

              switch (MR_tag((MR_Word) HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 3:
                  switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                    default: /*NOTREACHED*/ MR_assert(0);
                    case (MR_Integer) 0:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 1:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 2:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 3:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 4:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 5:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 6:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 7:
                      {
                        MR_Word ArgY1_485 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 1))));
                        MR_Word ArgY2_488 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 2))));
                        MR_Word ArgY3_491 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 3))));
                        MR_Word ArgY4_494 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 4))));
                        MR_Word ArgY5_497 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 5))));
                        MR_Word SubResult1_486;

                        mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[27]), &SubResult1_486, ((MR_Box) (Var_614)), ((MR_Box) (ArgY1_485)));
                        succeeded = (SubResult1_486 != (MR_Integer) 0);
                        if (succeeded)
                          *HeadVar__1_1 = SubResult1_486;
                        else
                        {
                          MR_Word SubResult2_489;

                          mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[16]), &SubResult2_489, ((MR_Box) (Var_613)), ((MR_Box) (ArgY2_488)));
                          succeeded = (SubResult2_489 != (MR_Integer) 0);
                          if (succeeded)
                            *HeadVar__1_1 = SubResult2_489;
                          else
                          {
                            MR_Word SubResult3_492;

                            mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[28]), &SubResult3_492, ((MR_Box) (Var_612)), ((MR_Box) (ArgY3_491)));
                            succeeded = (SubResult3_492 != (MR_Integer) 0);
                            if (succeeded)
                              *HeadVar__1_1 = SubResult3_492;
                            else
                            {
                              MR_Word SubResult4_495;

                              mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[29]), &SubResult4_495, ((MR_Box) (Var_611)), ((MR_Box) (ArgY4_494)));
                              succeeded = (SubResult4_495 != (MR_Integer) 0);
                              if (succeeded)
                                *HeadVar__1_1 = SubResult4_495;
                              else
                                mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[11]), HeadVar__1_1, ((MR_Box) (Var_610)), ((MR_Box) (ArgY5_497)));
                            }
                          }
                        }
                      }
                      break;
                    case (MR_Integer) 8:
                      *HeadVar__1_1 = (MR_Integer) 1;
                      break;
                  }
                  break;
              }
            }
            break;
          case (MR_Integer) 8:
            {
              MR_Word Var_600 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 3))) & (MR_Integer) 1);
              MR_Word Var_601 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))));
              MR_Word Var_602 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));

              switch (MR_tag((MR_Word) HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 2:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 3:
                  switch (((MR_Integer) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))))) {
                    default: /*NOTREACHED*/ MR_assert(0);
                    case (MR_Integer) 0:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 1:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 2:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 3:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 4:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 5:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 6:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 7:
                      *HeadVar__1_1 = (MR_Integer) 2;
                      break;
                    case (MR_Integer) 8:
                      {
                        MR_Word ArgY1_560 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 1))));
                        MR_Word ArgY2_563 = ((MR_Word) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 2))));
                        MR_Word ArgY3_566 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 3))) & (MR_Integer) 1);
                        MR_Word SubResult1_561;

                        mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), &SubResult1_561, ((MR_Box) (Var_602)), ((MR_Box) (ArgY1_560)));
                        succeeded = (SubResult1_561 != (MR_Integer) 0);
                        if (succeeded)
                          *HeadVar__1_1 = SubResult1_561;
                        else
                        {
                          MR_Word SubResult2_564;

                          mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), &SubResult2_564, ((MR_Box) (Var_601)), ((MR_Box) (ArgY2_563)));
                          succeeded = (SubResult2_564 != (MR_Integer) 0);
                          if (succeeded)
                            *HeadVar__1_1 = SubResult2_564;
                          else
                          {
                            MR_Integer Var_625 = (MR_Integer) (Var_600);
                            MR_Integer Var_626 = (MR_Integer) (ArgY3_566);

                            succeeded = (Var_625 < Var_626);
                            if (succeeded)
                              *HeadVar__1_1 = (MR_Integer) 1;
                            else
                            {
                              succeeded = (Var_625 > Var_626);
                              if (succeeded)
                                *HeadVar__1_1 = (MR_Integer) 2;
                              else
                                *HeadVar__1_1 = (MR_Integer) 0;
                            }
                          }
                        }
                      }
                      break;
                  }
                  break;
              }
            }
            break;
        }
        break;
    }
}

void MR_CALL 
hlds__hlds_goal____Compare____generic_call_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_90 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_91 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_90 == CastY_91);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
    switch (MR_tag((MR_Word) HeadVar__2_2)) {
      default: /*NOTREACHED*/ MR_assert(0);
      case (MR_Integer) 0:
        {
          MR_Word Var_108 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));
          MR_Word Var_109 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))) & (MR_Integer) 1);
          MR_Word Var_110 = ((((MR_Unsigned) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))) >> 1)) & (MR_Integer) 3);
          MR_Word Var_111 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              {
                MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));
                MR_Word ArgY2_8 = ((((MR_Unsigned) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))) >> 1)) & (MR_Integer) 3);
                MR_Word ArgY3_11 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))) & (MR_Integer) 1);
                MR_Word ArgY4_14 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 2))));
                MR_Word SubResult1_6;

                mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), &SubResult1_6, ((MR_Box) (Var_111)), ((MR_Box) (ArgY1_5)));
                succeeded = (SubResult1_6 != (MR_Integer) 0);
                if (succeeded)
                  *HeadVar__1_1 = SubResult1_6;
                else
                {
                  MR_Word SubResult2_9;
                  MR_Integer Var_116 = (MR_Integer) (Var_110);
                  MR_Integer Var_117 = (MR_Integer) (ArgY2_8);

                  succeeded = (Var_116 < Var_117);
                  if (succeeded)
                  {
                    SubResult2_9 = (MR_Integer) 1;
                    succeeded = MR_TRUE;
                  }
                  else
                  {
                    succeeded = (Var_116 > Var_117);
                    if (succeeded)
                    {
                      SubResult2_9 = (MR_Integer) 2;
                      succeeded = MR_TRUE;
                    }
                    else
                    {
                      succeeded = MR_TRUE;
                      succeeded = !(succeeded);
                      if (succeeded)
                      {
                        SubResult2_9 = (MR_Integer) 0;
                        succeeded = MR_TRUE;
                      }
                    }
                  }
                  if (succeeded)
                    *HeadVar__1_1 = SubResult2_9;
                  else
                  {
                    MR_Word SubResult3_12;
                    MR_Integer Var_118 = (MR_Integer) (Var_109);
                    MR_Integer Var_119 = (MR_Integer) (ArgY3_11);

                    succeeded = (Var_118 < Var_119);
                    if (succeeded)
                    {
                      SubResult3_12 = (MR_Integer) 1;
                      succeeded = MR_TRUE;
                    }
                    else
                    {
                      succeeded = (Var_118 > Var_119);
                      if (succeeded)
                      {
                        SubResult3_12 = (MR_Integer) 2;
                        succeeded = MR_TRUE;
                      }
                      else
                      {
                        succeeded = MR_TRUE;
                        succeeded = !(succeeded);
                        if (succeeded)
                        {
                          SubResult3_12 = (MR_Integer) 0;
                          succeeded = MR_TRUE;
                        }
                      }
                    }
                    if (succeeded)
                      *HeadVar__1_1 = SubResult3_12;
                    else
                    {
                      MR_Integer Var_120 = (MR_Integer) (Var_108);
                      MR_Integer Var_121 = (MR_Integer) (ArgY4_14);

                      succeeded = (Var_120 < Var_121);
                      if (succeeded)
                        *HeadVar__1_1 = (MR_Integer) 1;
                      else
                      {
                        succeeded = (Var_120 > Var_121);
                        if (succeeded)
                          *HeadVar__1_1 = (MR_Integer) 2;
                        else
                          *HeadVar__1_1 = (MR_Integer) 0;
                      }
                    }
                  }
                }
              }
              break;
            case (MR_Integer) 1:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
            case (MR_Integer) 2:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
            case (MR_Integer) 3:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
          }
        }
        break;
      case (MR_Integer) 1:
        {
          MR_Word Var_103 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 3))));
          MR_Word Var_104 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 2))));
          MR_Word Var_105 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 1))));
          MR_Word Var_106 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 1:
              {
                MR_Word ArgY1_42 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 0))));
                MR_Word ArgY2_45 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 1))));
                MR_Word ArgY3_48 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 2))));
                MR_Word ArgY4_51 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 3))));
                MR_Word SubResult1_43;

                mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), &SubResult1_43, ((MR_Box) (Var_106)), ((MR_Box) (ArgY1_42)));
                succeeded = (SubResult1_43 != (MR_Integer) 0);
                if (succeeded)
                  *HeadVar__1_1 = SubResult1_43;
                else
                {
                  MR_Word SubResult2_46;
                  MR_Integer Var_114 = (MR_Integer) (Var_105);
                  MR_Integer Var_115 = (MR_Integer) (ArgY2_45);

                  succeeded = (Var_114 < Var_115);
                  if (succeeded)
                  {
                    SubResult2_46 = (MR_Integer) 1;
                    succeeded = MR_TRUE;
                  }
                  else
                  {
                    succeeded = (Var_114 > Var_115);
                    if (succeeded)
                    {
                      SubResult2_46 = (MR_Integer) 2;
                      succeeded = MR_TRUE;
                    }
                    else
                    {
                      succeeded = MR_TRUE;
                      succeeded = !(succeeded);
                      if (succeeded)
                      {
                        SubResult2_46 = (MR_Integer) 0;
                        succeeded = MR_TRUE;
                      }
                    }
                  }
                  if (succeeded)
                    *HeadVar__1_1 = SubResult2_46;
                  else
                  {
                    MR_Word SubResult3_49;

                    parse_tree__prog_data____Compare____class_id_0_0(&SubResult3_49, Var_104, ArgY3_48);
                    succeeded = (SubResult3_49 != (MR_Integer) 0);
                    if (succeeded)
                      *HeadVar__1_1 = SubResult3_49;
                    else
                      parse_tree__prog_data____Compare____pf_sym_name_arity_0_0(HeadVar__1_1, Var_103, ArgY4_51);
                  }
                }
              }
              break;
            case (MR_Integer) 2:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
            case (MR_Integer) 3:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
          }
        }
        break;
      case (MR_Integer) 2:
        {
          MR_String Var_107 = ((MR_String) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 1:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 2:
              {
                MR_String ArgY1_73 = ((MR_String) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 0))));

                mercury__private_builtin__builtin_compare_string_3_p_0(HeadVar__1_1, Var_107, ArgY1_73);
              }
              break;
            case (MR_Integer) 3:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
          }
        }
        break;
      case (MR_Integer) 3:
        {
          MR_Word Var_102 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0))) & (MR_Integer) 7);

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 1:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 2:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 3:
              {
                MR_Word ArgY1_89 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))) & (MR_Integer) 7);
                MR_Integer Var_112 = (MR_Integer) (Var_102);
                MR_Integer Var_113 = (MR_Integer) (ArgY1_89);

                succeeded = (Var_112 < Var_113);
                if (succeeded)
                  *HeadVar__1_1 = (MR_Integer) 1;
                else
                {
                  succeeded = (Var_112 > Var_113);
                  if (succeeded)
                    *HeadVar__1_1 = (MR_Integer) 2;
                  else
                    *HeadVar__1_1 = (MR_Integer) 0;
                }
              }
              break;
          }
        }
        break;
    }
}

void MR_CALL 
hlds__hlds_goal____Compare____unify_context_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_9 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_10 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_9 == CastY_10);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  {
    MR_Word ArgX1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));
    MR_Word ArgX2_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgY2_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word SubResult1_6;

    hlds__hlds_goal____Compare____unify_main_context_0_0(&SubResult1_6, ArgX1_4, ArgY1_5);
    succeeded = (SubResult1_6 != (MR_Integer) 0);
    if (succeeded)
      *HeadVar__1_1 = SubResult1_6;
    else
      mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[36]), HeadVar__1_1, ((MR_Box) (ArgX2_7)), ((MR_Box) (ArgY2_8)));
  }
}

void MR_CALL 
hlds__hlds_goal____Compare____unify_main_context_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_45 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_46 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_45 == CastY_46);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
    switch (MR_tag((MR_Word) HeadVar__2_2)) {
      default: /*NOTREACHED*/ MR_assert(0);
      case (MR_Integer) 0:
        switch (MR_unmkbody(HeadVar__2_2)) {
          default: /*NOTREACHED*/ MR_assert(0);
          case (MR_Integer) 0:
            switch (MR_tag((MR_Word) HeadVar__3_3)) {
              default: /*NOTREACHED*/ MR_assert(0);
              case (MR_Integer) 0:
                switch (MR_unmkbody(HeadVar__3_3)) {
                  default: /*NOTREACHED*/ MR_assert(0);
                  case (MR_Integer) 0:
                    *HeadVar__1_1 = (MR_Integer) 0;
                    break;
                  case (MR_Integer) 1:
                    *HeadVar__1_1 = (MR_Integer) 1;
                    break;
                }
                break;
              case (MR_Integer) 1:
                *HeadVar__1_1 = (MR_Integer) 1;
                break;
              case (MR_Integer) 2:
                *HeadVar__1_1 = (MR_Integer) 1;
                break;
              case (MR_Integer) 3:
                *HeadVar__1_1 = (MR_Integer) 1;
                break;
            }
            break;
          case (MR_Integer) 1:
            switch (MR_tag((MR_Word) HeadVar__3_3)) {
              default: /*NOTREACHED*/ MR_assert(0);
              case (MR_Integer) 0:
                switch (MR_unmkbody(HeadVar__3_3)) {
                  default: /*NOTREACHED*/ MR_assert(0);
                  case (MR_Integer) 0:
                    *HeadVar__1_1 = (MR_Integer) 2;
                    break;
                  case (MR_Integer) 1:
                    *HeadVar__1_1 = (MR_Integer) 0;
                    break;
                }
                break;
              case (MR_Integer) 1:
                *HeadVar__1_1 = (MR_Integer) 2;
                break;
              case (MR_Integer) 2:
                *HeadVar__1_1 = (MR_Integer) 1;
                break;
              case (MR_Integer) 3:
                *HeadVar__1_1 = (MR_Integer) 1;
                break;
            }
            break;
        }
        break;
      case (MR_Integer) 1:
        {
          MR_Integer Var_53 = ((MR_Integer) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              switch (MR_unmkbody(HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 1;
                  break;
              }
              break;
            case (MR_Integer) 1:
              {
                MR_Integer ArgY1_10 = ((MR_Integer) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 0))));

                succeeded = (Var_53 < ArgY1_10);
                if (succeeded)
                  *HeadVar__1_1 = (MR_Integer) 1;
                else
                {
                  succeeded = (Var_53 > ArgY1_10);
                  if (succeeded)
                    *HeadVar__1_1 = (MR_Integer) 2;
                  else
                    *HeadVar__1_1 = (MR_Integer) 0;
                }
              }
              break;
            case (MR_Integer) 2:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
            case (MR_Integer) 3:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
          }
        }
        break;
      case (MR_Integer) 2:
        {
          MR_Integer Var_51 = ((MR_Integer) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 1))));
          MR_Word Var_52 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              switch (MR_unmkbody(HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
              }
              break;
            case (MR_Integer) 1:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 2:
              {
                MR_Word ArgY1_29 = ((MR_Word) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 0))));
                MR_Integer ArgY2_32 = ((MR_Integer) ((MR_hl_field(2, HeadVar__3_3, (MR_Integer) 1))));
                MR_Word SubResult1_30;

                hlds__hlds_pred____Compare____call_id_0_0(&SubResult1_30, Var_52, ArgY1_29);
                succeeded = (SubResult1_30 != (MR_Integer) 0);
                if (succeeded)
                  *HeadVar__1_1 = SubResult1_30;
                else
                {
                  succeeded = (Var_51 < ArgY2_32);
                  if (succeeded)
                    *HeadVar__1_1 = (MR_Integer) 1;
                  else
                  {
                    succeeded = (Var_51 > ArgY2_32);
                    if (succeeded)
                      *HeadVar__1_1 = (MR_Integer) 2;
                    else
                      *HeadVar__1_1 = (MR_Integer) 0;
                  }
                }
              }
              break;
            case (MR_Integer) 3:
              *HeadVar__1_1 = (MR_Integer) 1;
              break;
          }
        }
        break;
      case (MR_Integer) 3:
        {
          MR_String Var_54 = ((MR_String) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0))));

          switch (MR_tag((MR_Word) HeadVar__3_3)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              switch (MR_unmkbody(HeadVar__3_3)) {
                default: /*NOTREACHED*/ MR_assert(0);
                case (MR_Integer) 0:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
                case (MR_Integer) 1:
                  *HeadVar__1_1 = (MR_Integer) 2;
                  break;
              }
              break;
            case (MR_Integer) 1:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 2:
              *HeadVar__1_1 = (MR_Integer) 2;
              break;
            case (MR_Integer) 3:
              {
                MR_String ArgY1_44 = ((MR_String) ((MR_hl_field(3, HeadVar__3_3, (MR_Integer) 0))));

                mercury__private_builtin__builtin_compare_string_3_p_0(HeadVar__1_1, Var_54, ArgY1_44);
              }
              break;
          }
        }
        break;
    }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____call_unify_context_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_9 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_10 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_9 == CastY_10);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  {
    MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
    MR_Word ArgY1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgX2_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
    MR_Word ArgY2_6 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgX3_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 2))));
    MR_Word ArgY3_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));

    succeeded = mercury__builtin__unify_2_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), ((MR_Box) (ArgX1_3)), ((MR_Box) (ArgY1_4)));
    if (succeeded)
    {
      succeeded = hlds__hlds_goal____Unify____unify_rhs_0_0(ArgX2_5, ArgY2_6);
      if (succeeded)
        succeeded = hlds__hlds_goal____Unify____unify_context_0_0(ArgX3_7, ArgY3_8);
    }
  }
  return succeeded;
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____unify_rhs_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_27 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_28 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_27 == CastY_28);
  if (succeeded)
    succeeded = MR_TRUE;
  else
    switch (MR_tag((MR_Word) HeadVar__1_1)) {
      default: /*NOTREACHED*/ MR_assert(0);
      case (MR_Integer) 0:
        {
          MR_Word TypeInfo_33_33;
          MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
          MR_Word ArgY1_4;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 0);
          if (succeeded)
          {
            ArgY1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
            TypeInfo_33_33 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]);
            succeeded = mercury__builtin__unify_2_p_0(TypeInfo_33_33, ((MR_Box) (ArgX1_3)), ((MR_Box) (ArgY1_4)));
          }
        }
        break;
      case (MR_Integer) 1:
        {
          MR_Word TypeInfo_30_30;
          MR_Word ArgX1_5 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 0))));
          MR_Word ArgY1_6;
          MR_Word ArgX2_7 = ((MR_Unsigned) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 1))) & (MR_Integer) 1);
          MR_Word ArgY2_8;
          MR_Word ArgX3_9 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 2))));
          MR_Word ArgY3_10;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 1);
          if (succeeded)
          {
            ArgY1_6 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))));
            ArgY2_8 = ((MR_Unsigned) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 1))) & (MR_Integer) 1);
            ArgY3_10 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 2))));
            succeeded = parse_tree__prog_data____Unify____cons_id_0_0(ArgX1_5, ArgY1_6);
            if (succeeded)
            {
              succeeded = (ArgX2_7 == ArgY2_8);
              if (succeeded)
              {
                TypeInfo_30_30 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[11]);
                succeeded = mercury__builtin__unify_2_p_0(TypeInfo_30_30, ((MR_Box) (ArgX3_9)), ((MR_Box) (ArgY3_10)));
              }
            }
          }
        }
        break;
      case (MR_Integer) 2:
        {
          MR_Word TypeInfo_31_31;
          MR_Word TypeInfo_32_32;
          MR_Word ArgX1_11 = ((((MR_Unsigned) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 0))) >> 2)) & (MR_Integer) 3);
          MR_Word ArgY1_12;
          MR_Word ArgX2_13 = ((((MR_Unsigned) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 0))) >> 1)) & (MR_Integer) 1);
          MR_Word ArgY2_14;
          MR_Word ArgX3_15 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 0))) & (MR_Integer) 1);
          MR_Word ArgY3_16;
          MR_Word ArgX5_19 = ((MR_Word) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 2))));
          MR_Word ArgY5_20;
          MR_Word ArgX6_21 = ((MR_Word) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 3))));
          MR_Word ArgY6_22;
          MR_Word ArgX7_23 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 4))) & (MR_Integer) 7);
          MR_Word ArgY7_24;
          MR_Word ArgX8_25 = ((MR_Word) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 5))));
          MR_Word ArgY8_26;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 2);
          if (succeeded)
          {
            ArgY1_12 = ((((MR_Unsigned) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))) >> 2)) & (MR_Integer) 3);
            ArgY2_14 = ((((MR_Unsigned) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))) >> 1)) & (MR_Integer) 1);
            ArgY3_16 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))) & (MR_Integer) 1);
            ArgY5_20 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 2))));
            ArgY6_22 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 3))));
            ArgY7_24 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 4))) & (MR_Integer) 7);
            ArgY8_26 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 5))));
            succeeded = (ArgX1_11 == ArgY1_12);
            if (succeeded)
            {
              succeeded = (ArgX2_13 == ArgY2_14);
              if (succeeded)
              {
                succeeded = (ArgX3_15 == ArgY3_16);
                if (succeeded)
                {
                  TypeInfo_31_31 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[11]);
                  succeeded = mercury__builtin__unify_2_p_0(TypeInfo_31_31, ((MR_Box) (ArgX5_19)), ((MR_Box) (ArgY5_20)));
                  if (succeeded)
                  {
                    TypeInfo_32_32 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[37]);
                    succeeded = mercury__builtin__unify_2_p_0(TypeInfo_32_32, ((MR_Box) (ArgX6_21)), ((MR_Box) (ArgY6_22)));
                    if (succeeded)
                    {
                      succeeded = (ArgX7_23 == ArgY7_24);
                      if (succeeded)
                        succeeded = hlds__hlds_goal____Unify____hlds_goal_0_0(ArgX8_25, ArgY8_26);
                    }
                  }
                }
              }
            }
          }
        }
        break;
    }
  return succeeded;
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____hlds_goal_expr_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_77 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_78 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_77 == CastY_78);
  if (succeeded)
    succeeded = MR_TRUE;
  else
    switch (MR_tag((MR_Word) HeadVar__1_1)) {
      default: /*NOTREACHED*/ MR_assert(0);
      case (MR_Integer) 0:
        {
          MR_Word ArgX1_61 = (MR_Word) ((MR_Word) (HeadVar__1_1));
          MR_Word ArgY1_62;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 0);
          if (succeeded)
          {
            ArgY1_62 = (MR_Word) ((MR_Word) (HeadVar__2_2));
            succeeded = hlds__hlds_goal____Unify____hlds_goal_0_0(ArgX1_61, ArgY1_62);
          }
        }
        break;
      case (MR_Integer) 1:
        {
          MR_Word TypeInfo_99_99;
          MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 0))));
          MR_Word ArgY1_4;
          MR_Word ArgX2_5 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 1))));
          MR_Word ArgY2_6;
          MR_Word ArgX3_7 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 2))));
          MR_Word ArgY3_8;
          MR_Word ArgX4_9 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 3))));
          MR_Word ArgY4_10;
          MR_Word ArgX5_11 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 4))));
          MR_Word ArgY5_12;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 1);
          if (succeeded)
          {
            ArgY1_4 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))));
            ArgY2_6 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 1))));
            ArgY3_8 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 2))));
            ArgY4_10 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 3))));
            ArgY5_12 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 4))));
            TypeInfo_99_99 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]);
            succeeded = mercury__builtin__unify_2_p_0(TypeInfo_99_99, ((MR_Box) (ArgX1_3)), ((MR_Box) (ArgY1_4)));
            if (succeeded)
            {
              succeeded = hlds__hlds_goal____Unify____unify_rhs_0_0(ArgX2_5, ArgY2_6);
              if (succeeded)
              {
                succeeded = hlds__hlds_goal____Unify____unify_mode_0_0(ArgX3_7, ArgY3_8);
                if (succeeded)
                {
                  succeeded = hlds__hlds_goal____Unify____unification_0_0(ArgX4_9, ArgY4_10);
                  if (succeeded)
                    succeeded = hlds__hlds_goal____Unify____unify_context_0_0(ArgX5_11, ArgY5_12);
                }
              }
            }
          }
        }
        break;
      case (MR_Integer) 2:
        {
          MR_Word TypeInfo_94_94;
          MR_Word TypeInfo_95_95;
          MR_Word ArgX1_13 = ((MR_Word) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 0))));
          MR_Word ArgY1_14;
          MR_Integer ArgX2_15 = ((MR_Integer) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 1))));
          MR_Integer ArgY2_16;
          MR_Word ArgX3_17 = ((MR_Word) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 2))));
          MR_Word ArgY3_18;
          MR_Word ArgX4_19 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 3))) & (MR_Integer) 1);
          MR_Word ArgY4_20;
          MR_Word ArgX5_21 = ((MR_Word) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 4))));
          MR_Word ArgY5_22;
          MR_Word ArgX6_23 = ((MR_Word) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 5))));
          MR_Word ArgY6_24;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 2);
          if (succeeded)
          {
            ArgY1_14 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))));
            ArgY2_16 = ((MR_Integer) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 1))));
            ArgY3_18 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 2))));
            ArgY4_20 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 3))) & (MR_Integer) 1);
            ArgY5_22 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 4))));
            ArgY6_24 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 5))));
            succeeded = hlds__hlds_pred____Unify____pred_id_0_0(ArgX1_13, ArgY1_14);
            if (succeeded)
            {
              succeeded = (ArgX2_15 == ArgY2_16);
              if (succeeded)
              {
                TypeInfo_94_94 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[11]);
                succeeded = mercury__builtin__unify_2_p_0(TypeInfo_94_94, ((MR_Box) (ArgX3_17)), ((MR_Box) (ArgY3_18)));
                if (succeeded)
                {
                  succeeded = (ArgX4_19 == ArgY4_20);
                  if (succeeded)
                  {
                    TypeInfo_95_95 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[18]);
                    succeeded = mercury__builtin__unify_2_p_0(TypeInfo_95_95, ((MR_Box) (ArgX5_21)), ((MR_Box) (ArgY5_22)));
                    if (succeeded)
                      succeeded = mdbcomp__sym_name____Unify____sym_name_0_0(ArgX6_23, ArgY6_24);
                  }
                }
              }
            }
          }
        }
        break;
      case (MR_Integer) 3:
        switch (((MR_Integer) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 0))))) {
          default: /*NOTREACHED*/ MR_assert(0);
          case (MR_Integer) 0:
            {
              MR_Word TypeInfo_88_88;
              MR_Word TypeInfo_89_89;
              MR_Word ArgX1_25 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 1))));
              MR_Word ArgY1_26;
              MR_Word ArgX2_27 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 2))));
              MR_Word ArgY2_28;
              MR_Word ArgX3_29 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 3))));
              MR_Word ArgY3_30;
              MR_Word ArgX4_31 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 4))));
              MR_Word ArgY4_32;
              MR_Word ArgX5_33 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 5))) & (MR_Integer) 7);
              MR_Word ArgY5_34;

              succeeded = ((((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0)))) == (MR_Integer) 0)));
              if (succeeded)
              {
                ArgY1_26 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));
                ArgY2_28 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))));
                ArgY3_30 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 3))));
                ArgY4_32 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 4))));
                ArgY5_34 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 5))) & (MR_Integer) 7);
                succeeded = hlds__hlds_goal____Unify____generic_call_0_0(ArgX1_25, ArgY1_26);
                if (succeeded)
                {
                  TypeInfo_88_88 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[11]);
                  succeeded = mercury__builtin__unify_2_p_0(TypeInfo_88_88, ((MR_Box) (ArgX2_27)), ((MR_Box) (ArgY2_28)));
                  if (succeeded)
                  {
                    TypeInfo_89_89 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[17]);
                    succeeded = mercury__builtin__unify_2_p_0(TypeInfo_89_89, ((MR_Box) (ArgX3_29)), ((MR_Box) (ArgY3_30)));
                    if (succeeded)
                    {
                      succeeded = parse_tree__prog_data____Unify____arg_reg_type_info_0_0(ArgX4_31, ArgY4_32);
                      if (succeeded)
                        succeeded = (ArgX5_33 == ArgY5_34);
                    }
                  }
                }
              }
            }
            break;
          case (MR_Integer) 1:
            {
              MR_Word TypeInfo_82_82;
              MR_Word TypeInfo_83_83;
              MR_Word TypeInfo_84_84;
              MR_Word ArgX1_35 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 1))));
              MR_Word ArgY1_36;
              MR_Word ArgX2_37 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 2))));
              MR_Word ArgY2_38;
              MR_Integer ArgX3_39 = ((MR_Integer) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 3))));
              MR_Integer ArgY3_40;
              MR_Word ArgX4_41 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 4))));
              MR_Word ArgY4_42;
              MR_Word ArgX5_43 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 5))));
              MR_Word ArgY5_44;
              MR_Word ArgX6_45 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 6))));
              MR_Word ArgY6_46;
              MR_Word ArgX7_47 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 7))));
              MR_Word ArgY7_48;

              succeeded = ((((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0)))) == (MR_Integer) 1)));
              if (succeeded)
              {
                ArgY1_36 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));
                ArgY2_38 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))));
                ArgY3_40 = ((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 3))));
                ArgY4_42 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 4))));
                ArgY5_44 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 5))));
                ArgY6_46 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 6))));
                ArgY7_48 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 7))));
                succeeded = parse_tree__prog_data_foreign____Unify____foreign_proc_attributes_0_0(ArgX1_35, ArgY1_36);
                if (succeeded)
                {
                  succeeded = hlds__hlds_pred____Unify____pred_id_0_0(ArgX2_37, ArgY2_38);
                  if (succeeded)
                  {
                    succeeded = (ArgX3_39 == ArgY3_40);
                    if (succeeded)
                    {
                      TypeInfo_82_82 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[14]);
                      succeeded = mercury__builtin__unify_2_p_0(TypeInfo_82_82, ((MR_Box) (ArgX4_41)), ((MR_Box) (ArgY4_42)));
                      if (succeeded)
                      {
                        TypeInfo_83_83 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[14]);
                        succeeded = mercury__builtin__unify_2_p_0(TypeInfo_83_83, ((MR_Box) (ArgX5_43)), ((MR_Box) (ArgY5_44)));
                        if (succeeded)
                        {
                          TypeInfo_84_84 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[16]);
                          succeeded = mercury__builtin__unify_2_p_0(TypeInfo_84_84, ((MR_Box) (ArgX6_45)), ((MR_Box) (ArgY6_46)));
                          if (succeeded)
                            succeeded = parse_tree__prog_data_foreign____Unify____pragma_foreign_proc_impl_0_0(ArgX7_47, ArgY7_48);
                        }
                      }
                    }
                  }
                }
              }
            }
            break;
          case (MR_Integer) 2:
            {
              MR_Word TypeInfo_86_86;
              MR_Word ArgX1_49 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 1))) & (MR_Integer) 1);
              MR_Word ArgY1_50;
              MR_Word ArgX2_51 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 2))));
              MR_Word ArgY2_52;

              succeeded = ((((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0)))) == (MR_Integer) 2)));
              if (succeeded)
              {
                ArgY1_50 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))) & (MR_Integer) 1);
                ArgY2_52 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))));
                succeeded = (ArgX1_49 == ArgY1_50);
                if (succeeded)
                {
                  TypeInfo_86_86 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[13]);
                  succeeded = mercury__builtin__unify_2_p_0(TypeInfo_86_86, ((MR_Box) (ArgX2_51)), ((MR_Box) (ArgY2_52)));
                }
              }
            }
            break;
          case (MR_Integer) 3:
            {
              MR_Word TypeInfo_87_87;
              MR_Word ArgX1_53 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 1))));
              MR_Word ArgY1_54;

              succeeded = ((((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0)))) == (MR_Integer) 3)));
              if (succeeded)
              {
                ArgY1_54 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));
                TypeInfo_87_87 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[13]);
                succeeded = mercury__builtin__unify_2_p_0(TypeInfo_87_87, ((MR_Box) (ArgX1_53)), ((MR_Box) (ArgY1_54)));
              }
            }
            break;
          case (MR_Integer) 4:
            {
              MR_Word TypeInfo_97_97;
              MR_Word TypeInfo_98_98;
              MR_Word ArgX1_55 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 1))));
              MR_Word ArgY1_56;
              MR_Word ArgX2_57 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 2))) & (MR_Integer) 1);
              MR_Word ArgY2_58;
              MR_Word ArgX3_59 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 3))));
              MR_Word ArgY3_60;

              succeeded = ((((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0)))) == (MR_Integer) 4)));
              if (succeeded)
              {
                ArgY1_56 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));
                ArgY2_58 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))) & (MR_Integer) 1);
                ArgY3_60 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 3))));
                TypeInfo_97_97 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]);
                succeeded = mercury__builtin__unify_2_p_0(TypeInfo_97_97, ((MR_Box) (ArgX1_55)), ((MR_Box) (ArgY1_56)));
                if (succeeded)
                {
                  succeeded = (ArgX2_57 == ArgY2_58);
                  if (succeeded)
                  {
                    TypeInfo_98_98 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[12]);
                    succeeded = mercury__builtin__unify_2_p_0(TypeInfo_98_98, ((MR_Box) (ArgX3_59)), ((MR_Box) (ArgY3_60)));
                  }
                }
              }
            }
            break;
          case (MR_Integer) 5:
            {
              MR_Word ArgX1_63 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 1))));
              MR_Word ArgY1_64;
              MR_Word ArgX2_65 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 2))));
              MR_Word ArgY2_66;

              succeeded = ((((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0)))) == (MR_Integer) 5)));
              if (succeeded)
              {
                ArgY1_64 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));
                ArgY2_66 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))));
                succeeded = hlds__hlds_goal____Unify____scope_reason_0_0(ArgX1_63, ArgY1_64);
                if (succeeded)
                  succeeded = hlds__hlds_goal____Unify____hlds_goal_0_0(ArgX2_65, ArgY2_66);
              }
            }
            break;
          case (MR_Integer) 6:
            {
              MR_Word TypeInfo_91_91;
              MR_Word ArgX1_67 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 1))));
              MR_Word ArgY1_68;
              MR_Word ArgX2_69 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 2))));
              MR_Word ArgY2_70;
              MR_Word ArgX3_71 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 3))));
              MR_Word ArgY3_72;
              MR_Word ArgX4_73 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 4))));
              MR_Word ArgY4_74;

              succeeded = ((((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0)))) == (MR_Integer) 6)));
              if (succeeded)
              {
                ArgY1_68 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));
                ArgY2_70 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))));
                ArgY3_72 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 3))));
                ArgY4_74 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 4))));
                TypeInfo_91_91 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[11]);
                succeeded = mercury__builtin__unify_2_p_0(TypeInfo_91_91, ((MR_Box) (ArgX1_67)), ((MR_Box) (ArgY1_68)));
                if (succeeded)
                {
                  succeeded = hlds__hlds_goal____Unify____hlds_goal_0_0(ArgX2_69, ArgY2_70);
                  if (succeeded)
                  {
                    succeeded = hlds__hlds_goal____Unify____hlds_goal_0_0(ArgX3_71, ArgY3_72);
                    if (succeeded)
                      succeeded = hlds__hlds_goal____Unify____hlds_goal_0_0(ArgX4_73, ArgY4_74);
                  }
                }
              }
            }
            break;
          case (MR_Integer) 7:
            {
              MR_Word ArgX1_75 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 1))));
              MR_Word ArgY1_76;

              succeeded = ((((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0)))) == (MR_Integer) 7)));
              if (succeeded)
              {
                ArgY1_76 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));
                succeeded = hlds__hlds_goal____Unify____shorthand_goal_expr_0_0(ArgX1_75, ArgY1_76);
              }
            }
            break;
        }
        break;
    }
  return succeeded;
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____shorthand_goal_expr_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_27 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_28 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_27 == CastY_28);
  if (succeeded)
    succeeded = MR_TRUE;
  else
    switch (MR_tag((MR_Word) HeadVar__1_1)) {
      default: /*NOTREACHED*/ MR_assert(0);
      case (MR_Integer) 0:
        {
          MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
          MR_Word ArgY1_4;
          MR_Word ArgX2_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
          MR_Word ArgY2_6;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 0);
          if (succeeded)
          {
            ArgY1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
            ArgY2_6 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
            succeeded = hlds__hlds_goal____Unify____hlds_goal_0_0(ArgX1_3, ArgY1_4);
            if (succeeded)
              succeeded = hlds__hlds_goal____Unify____hlds_goal_0_0(ArgX2_5, ArgY2_6);
          }
        }
        break;
      case (MR_Integer) 1:
        {
          MR_Word TypeInfo_29_29;
          MR_Word TypeInfo_30_30;
          MR_Word TypeInfo_31_31;
          MR_Word ArgX1_7 = ((MR_Unsigned) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 0))) & (MR_Integer) 3);
          MR_Word ArgY1_8;
          MR_Word ArgX2_9 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 1))));
          MR_Word ArgY2_10;
          MR_Word ArgX3_11 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 2))));
          MR_Word ArgY3_12;
          MR_Word ArgX4_13 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 3))));
          MR_Word ArgY4_14;
          MR_Word ArgX5_15 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 4))));
          MR_Word ArgY5_16;
          MR_Word ArgX6_17 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 5))));
          MR_Word ArgY6_18;
          MR_Word ArgX7_19 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 6))));
          MR_Word ArgY7_20;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 1);
          if (succeeded)
          {
            ArgY1_8 = ((MR_Unsigned) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))) & (MR_Integer) 3);
            ArgY2_10 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 1))));
            ArgY3_12 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 2))));
            ArgY4_14 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 3))));
            ArgY5_16 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 4))));
            ArgY6_18 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 5))));
            ArgY7_20 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 6))));
            succeeded = (ArgX1_7 == ArgY1_8);
            if (succeeded)
            {
              succeeded = hlds__hlds_goal____Unify____atomic_interface_vars_0_0(ArgX2_9, ArgY2_10);
              if (succeeded)
              {
                succeeded = hlds__hlds_goal____Unify____atomic_interface_vars_0_0(ArgX3_11, ArgY3_12);
                if (succeeded)
                {
                  TypeInfo_29_29 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[32]);
                  succeeded = mercury__builtin__unify_2_p_0(TypeInfo_29_29, ((MR_Box) (ArgX4_13)), ((MR_Box) (ArgY4_14)));
                  if (succeeded)
                  {
                    succeeded = hlds__hlds_goal____Unify____hlds_goal_0_0(ArgX5_15, ArgY5_16);
                    if (succeeded)
                    {
                      TypeInfo_30_30 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[13]);
                      succeeded = mercury__builtin__unify_2_p_0(TypeInfo_30_30, ((MR_Box) (ArgX6_17)), ((MR_Box) (ArgY6_18)));
                      if (succeeded)
                      {
                        TypeInfo_31_31 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[33]);
                        succeeded = mercury__builtin__unify_2_p_0(TypeInfo_31_31, ((MR_Box) (ArgX7_19)), ((MR_Box) (ArgY7_20)));
                      }
                    }
                  }
                }
              }
            }
          }
        }
        break;
      case (MR_Integer) 2:
        {
          MR_Word TypeInfo_32_32;
          MR_Word TypeInfo_33_33;
          MR_Word ArgX1_21 = ((MR_Word) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 0))));
          MR_Word ArgY1_22;
          MR_Word ArgX2_23 = ((MR_Word) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 1))));
          MR_Word ArgY2_24;
          MR_Word ArgX3_25 = ((MR_Word) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 2))));
          MR_Word ArgY3_26;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 2);
          if (succeeded)
          {
            ArgY1_22 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))));
            ArgY2_24 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 1))));
            ArgY3_26 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 2))));
            TypeInfo_32_32 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[31]);
            succeeded = mercury__builtin__unify_2_p_0(TypeInfo_32_32, ((MR_Box) (ArgX1_21)), ((MR_Box) (ArgY1_22)));
            if (succeeded)
            {
              TypeInfo_33_33 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]);
              succeeded = mercury__builtin__unify_2_p_0(TypeInfo_33_33, ((MR_Box) (ArgX2_23)), ((MR_Box) (ArgY2_24)));
              if (succeeded)
                succeeded = hlds__hlds_goal____Unify____hlds_goal_0_0(ArgX3_25, ArgY3_26);
            }
          }
        }
        break;
    }
  return succeeded;
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____hlds_goal_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_7 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_8 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_7 == CastY_8);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  {
    MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
    MR_Word ArgY1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgX2_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
    MR_Word ArgY2_6 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));

    succeeded = hlds__hlds_goal____Unify____hlds_goal_expr_0_0(ArgX1_3, ArgY1_4);
    if (succeeded)
      succeeded = hlds__hlds_goal____Unify____hlds_goal_info_0_0(ArgX2_5, ArgY2_6);
  }
  return succeeded;
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____hlds_goal_info_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_19 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_20 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_19 == CastY_20);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  {
    MR_Word TypeInfo_22_22;
    MR_Word TypeInfo_23_23;
    MR_Word ArgX1_3 = ((((MR_Unsigned) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))) >> 2)) & (MR_Integer) 7);
    MR_Word ArgY1_4 = ((((MR_Unsigned) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))) >> 2)) & (MR_Integer) 7);
    MR_Word ArgX2_5 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))) & (MR_Integer) 3);
    MR_Word ArgY2_6 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))) & (MR_Integer) 3);
    MR_Word ArgX3_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
    MR_Word ArgY3_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgX4_9 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 2))));
    MR_Word ArgY4_10 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));
    MR_Word ArgX5_11 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 3))));
    MR_Word ArgY5_12 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 3))));
    MR_Word ArgX6_13 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 4))));
    MR_Word ArgY6_14 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 4))));
    MR_Word ArgX7_15 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 5))));
    MR_Word ArgY7_16 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 5))));
    MR_Word ArgX8_17 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 6))));
    MR_Word ArgY8_18 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 6))));
    MR_Integer Var_25;
    MR_Integer Var_26;
    MR_Integer CastX_43;
    MR_Integer CastY_44;

    succeeded = (ArgX1_3 == ArgY1_4);
    if (succeeded)
    {
      succeeded = (ArgX2_5 == ArgY2_6);
      if (succeeded)
      {
        succeeded = hlds__instmap____Unify____instmap_0_0(ArgX3_7, ArgY3_8);
        if (succeeded)
        {
          TypeInfo_22_22 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[3]);
          succeeded = mercury__builtin__unify_2_p_0(TypeInfo_22_22, ((MR_Box) (ArgX4_9)), ((MR_Box) (ArgY4_10)));
          if (succeeded)
          {
            TypeInfo_23_23 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[23]);
            succeeded = mercury__builtin__unify_2_p_0(TypeInfo_23_23, ((MR_Box) (ArgX5_11)), ((MR_Box) (ArgY5_12)));
            if (succeeded)
            {
              Var_25 = (MR_Integer) (ArgX6_13);
              Var_26 = (MR_Integer) (ArgY6_14);
              succeeded = (Var_25 == Var_26);
              if (succeeded)
              {
                succeeded = hlds__hlds_goal____Unify____hlds_goal_code_gen_info_0_0(ArgX7_15, ArgY7_16);
                if (succeeded)
                {
                  CastX_43 = (MR_Integer) (ArgX8_17);
                  CastY_44 = (MR_Integer) (ArgY8_18);
                  succeeded = (CastX_43 == CastY_44);
                  if (succeeded)
                    succeeded = MR_TRUE;
                  else
                  {
                    MR_Word TypeInfo_23_47;
                    MR_Word TypeInfo_25_49;
                    MR_Word TypeInfo_26_50;
                    MR_Word TypeInfo_27_51;
                    MR_Word TypeInfo_28_52;
                    MR_Word ArgX1_27 = ((MR_Word) ((MR_hl_field(0, ArgX8_17, (MR_Integer) 0))));
                    MR_Word ArgY1_28 = ((MR_Word) ((MR_hl_field(0, ArgY8_18, (MR_Integer) 0))));
                    MR_Word ArgX2_29 = ((MR_Word) ((MR_hl_field(0, ArgX8_17, (MR_Integer) 1))));
                    MR_Word ArgY2_30 = ((MR_Word) ((MR_hl_field(0, ArgY8_18, (MR_Integer) 1))));
                    MR_Word ArgX3_31 = ((MR_Word) ((MR_hl_field(0, ArgX8_17, (MR_Integer) 2))));
                    MR_Word ArgY3_32 = ((MR_Word) ((MR_hl_field(0, ArgY8_18, (MR_Integer) 2))));
                    MR_Word ArgX4_33 = ((MR_Word) ((MR_hl_field(0, ArgX8_17, (MR_Integer) 3))));
                    MR_Word ArgY4_34 = ((MR_Word) ((MR_hl_field(0, ArgY8_18, (MR_Integer) 3))));
                    MR_Word ArgX5_35 = ((MR_Word) ((MR_hl_field(0, ArgX8_17, (MR_Integer) 4))));
                    MR_Word ArgY5_36 = ((MR_Word) ((MR_hl_field(0, ArgY8_18, (MR_Integer) 4))));
                    MR_Word ArgX6_37 = ((MR_Word) ((MR_hl_field(0, ArgX8_17, (MR_Integer) 5))));
                    MR_Word ArgY6_38 = ((MR_Word) ((MR_hl_field(0, ArgY8_18, (MR_Integer) 5))));
                    MR_Word ArgX7_39 = ((MR_Word) ((MR_hl_field(0, ArgX8_17, (MR_Integer) 6))));
                    MR_Word ArgY7_40 = ((MR_Word) ((MR_hl_field(0, ArgY8_18, (MR_Integer) 6))));
                    MR_Word ArgX8_41 = ((MR_Word) ((MR_hl_field(0, ArgX8_17, (MR_Integer) 7))));
                    MR_Word ArgY8_42 = ((MR_Word) ((MR_hl_field(0, ArgY8_18, (MR_Integer) 7))));

                    succeeded = mercury__term_context____Unify____term_context_0_0(ArgX1_27, ArgY1_28);
                    if (succeeded)
                    {
                      succeeded = mdbcomp__goal_path____Unify____reverse_goal_path_0_0(ArgX2_29, ArgY2_30);
                      if (succeeded)
                      {
                        TypeInfo_23_47 = (MR_Word) (&hlds__hlds_goal_scalar_common_2[0]);
                        succeeded = mercury__builtin__unify_2_p_0(TypeInfo_23_47, ((MR_Box) (ArgX3_31)), ((MR_Box) (ArgY3_32)));
                        if (succeeded)
                        {
                          succeeded = hlds__goal_mode____Unify____goal_mode_0_0(ArgX4_33, ArgY4_34);
                          if (succeeded)
                          {
                            TypeInfo_25_49 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[19]);
                            succeeded = mercury__builtin__unify_2_p_0(TypeInfo_25_49, ((MR_Box) (ArgX5_35)), ((MR_Box) (ArgY5_36)));
                            if (succeeded)
                            {
                              TypeInfo_26_50 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[20]);
                              succeeded = mercury__builtin__unify_2_p_0(TypeInfo_26_50, ((MR_Box) (ArgX6_37)), ((MR_Box) (ArgY6_38)));
                              if (succeeded)
                              {
                                TypeInfo_27_51 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[21]);
                                succeeded = mercury__builtin__unify_2_p_0(TypeInfo_27_51, ((MR_Box) (ArgX7_39)), ((MR_Box) (ArgY7_40)));
                                if (succeeded)
                                {
                                  TypeInfo_28_52 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[22]);
                                  succeeded = mercury__builtin__unify_2_p_0(TypeInfo_28_52, ((MR_Box) (ArgX8_41)), ((MR_Box) (ArgY8_42)));
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  return succeeded;
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____hlds_goal_code_gen_info_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_7 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_8 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_7 == CastY_8);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  if ((HeadVar__1_1 == (MR_Word) ((MR_Unsigned) 0U)))
  {
    MR_Integer CastX_3 = (MR_Integer) (HeadVar__1_1);
    MR_Integer CastY_4 = (MR_Integer) (HeadVar__2_2);

    succeeded = (CastY_4 == CastX_3);
  }
  else
  {
    MR_Word ArgX1_5 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 0))));
    MR_Word ArgY1_6;

    succeeded = (HeadVar__2_2 != (MR_Word) ((MR_Unsigned) 0U));
    if (succeeded)
    {
      ArgY1_6 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))));
      succeeded = hlds__hlds_llds____Unify____llds_code_gen_details_0_0(ArgX1_5, ArgY1_6);
    }
  }
  return succeeded;
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____unification_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_43 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_44 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_43 == CastY_44);
  if (succeeded)
    succeeded = MR_TRUE;
  else
    switch (MR_tag((MR_Word) HeadVar__1_1)) {
      default: /*NOTREACHED*/ MR_assert(0);
      case (MR_Integer) 0:
        {
          MR_Word TypeInfo_48_48;
          MR_Word TypeInfo_50_50;
          MR_Word TypeInfo_51_51;
          MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
          MR_Word ArgY1_4;
          MR_Word ArgX2_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
          MR_Word ArgY2_6;
          MR_Word ArgX3_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 2))));
          MR_Word ArgY3_8;
          MR_Word ArgX4_9 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 3))));
          MR_Word ArgY4_10;
          MR_Word ArgX5_11 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 4))));
          MR_Word ArgY5_12;
          MR_Word ArgX6_13 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 5))) & (MR_Integer) 1);
          MR_Word ArgY6_14;
          MR_Word ArgX7_15 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 6))));
          MR_Word ArgY7_16;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 0);
          if (succeeded)
          {
            ArgY1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
            ArgY2_6 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
            ArgY3_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));
            ArgY4_10 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 3))));
            ArgY5_12 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 4))));
            ArgY6_14 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 5))) & (MR_Integer) 1);
            ArgY7_16 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 6))));
            TypeInfo_48_48 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]);
            succeeded = mercury__builtin__unify_2_p_0(TypeInfo_48_48, ((MR_Box) (ArgX1_3)), ((MR_Box) (ArgY1_4)));
            if (succeeded)
            {
              succeeded = parse_tree__prog_data____Unify____cons_id_0_0(ArgX2_5, ArgY2_6);
              if (succeeded)
              {
                TypeInfo_50_50 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[11]);
                succeeded = mercury__builtin__unify_2_p_0(TypeInfo_50_50, ((MR_Box) (ArgX3_7)), ((MR_Box) (ArgY3_8)));
                if (succeeded)
                {
                  TypeInfo_51_51 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[35]);
                  succeeded = mercury__builtin__unify_2_p_0(TypeInfo_51_51, ((MR_Box) (ArgX4_9)), ((MR_Box) (ArgY4_10)));
                  if (succeeded)
                  {
                    succeeded = hlds__hlds_goal____Unify____how_to_construct_0_0(ArgX5_11, ArgY5_12);
                    if (succeeded)
                    {
                      succeeded = (ArgX6_13 == ArgY6_14);
                      if (succeeded)
                        succeeded = hlds__hlds_goal____Unify____construct_sub_info_0_0(ArgX7_15, ArgY7_16);
                    }
                  }
                }
              }
            }
          }
        }
        break;
      case (MR_Integer) 1:
        {
          MR_Word TypeInfo_52_52;
          MR_Word TypeInfo_54_54;
          MR_Word TypeInfo_55_55;
          MR_Word ArgX1_17 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 0))));
          MR_Word ArgY1_18;
          MR_Word ArgX2_19 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 1))));
          MR_Word ArgY2_20;
          MR_Word ArgX3_21 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 2))));
          MR_Word ArgY3_22;
          MR_Word ArgX4_23 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 3))));
          MR_Word ArgY4_24;
          MR_Word ArgX5_25 = ((((MR_Unsigned) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 4))) >> 1)) & (MR_Integer) 1);
          MR_Word ArgY5_26;
          MR_Word ArgX6_27 = ((MR_Unsigned) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 4))) & (MR_Integer) 1);
          MR_Word ArgY6_28;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 1);
          if (succeeded)
          {
            ArgY1_18 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))));
            ArgY2_20 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 1))));
            ArgY3_22 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 2))));
            ArgY4_24 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 3))));
            ArgY5_26 = ((((MR_Unsigned) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 4))) >> 1)) & (MR_Integer) 1);
            ArgY6_28 = ((MR_Unsigned) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 4))) & (MR_Integer) 1);
            TypeInfo_52_52 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]);
            succeeded = mercury__builtin__unify_2_p_0(TypeInfo_52_52, ((MR_Box) (ArgX1_17)), ((MR_Box) (ArgY1_18)));
            if (succeeded)
            {
              succeeded = parse_tree__prog_data____Unify____cons_id_0_0(ArgX2_19, ArgY2_20);
              if (succeeded)
              {
                TypeInfo_54_54 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[11]);
                succeeded = mercury__builtin__unify_2_p_0(TypeInfo_54_54, ((MR_Box) (ArgX3_21)), ((MR_Box) (ArgY3_22)));
                if (succeeded)
                {
                  TypeInfo_55_55 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[35]);
                  succeeded = mercury__builtin__unify_2_p_0(TypeInfo_55_55, ((MR_Box) (ArgX4_23)), ((MR_Box) (ArgY4_24)));
                  if (succeeded)
                  {
                    succeeded = (ArgX5_25 == ArgY5_26);
                    if (succeeded)
                      succeeded = (ArgX6_27 == ArgY6_28);
                  }
                }
              }
            }
          }
        }
        break;
      case (MR_Integer) 2:
        {
          MR_Word TypeInfo_45_45;
          MR_Word TypeInfo_46_46;
          MR_Word ArgX1_29 = ((MR_Word) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 0))));
          MR_Word ArgY1_30;
          MR_Word ArgX2_31 = ((MR_Word) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 1))));
          MR_Word ArgY2_32;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 2);
          if (succeeded)
          {
            ArgY1_30 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))));
            ArgY2_32 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 1))));
            TypeInfo_45_45 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]);
            succeeded = mercury__builtin__unify_2_p_0(TypeInfo_45_45, ((MR_Box) (ArgX1_29)), ((MR_Box) (ArgY1_30)));
            if (succeeded)
            {
              TypeInfo_46_46 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]);
              succeeded = mercury__builtin__unify_2_p_0(TypeInfo_46_46, ((MR_Box) (ArgX2_31)), ((MR_Box) (ArgY2_32)));
            }
          }
        }
        break;
      case (MR_Integer) 3:
        switch (((MR_Integer) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 0))))) {
          default: /*NOTREACHED*/ MR_assert(0);
          case (MR_Integer) 0:
            {
              MR_Word TypeInfo_56_56;
              MR_Word TypeInfo_57_57;
              MR_Word ArgX1_33 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 1))));
              MR_Word ArgY1_34;
              MR_Word ArgX2_35 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 2))));
              MR_Word ArgY2_36;

              succeeded = ((((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0)))) == (MR_Integer) 0)));
              if (succeeded)
              {
                ArgY1_34 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));
                ArgY2_36 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))));
                TypeInfo_56_56 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]);
                succeeded = mercury__builtin__unify_2_p_0(TypeInfo_56_56, ((MR_Box) (ArgX1_33)), ((MR_Box) (ArgY1_34)));
                if (succeeded)
                {
                  TypeInfo_57_57 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]);
                  succeeded = mercury__builtin__unify_2_p_0(TypeInfo_57_57, ((MR_Box) (ArgX2_35)), ((MR_Box) (ArgY2_36)));
                }
              }
            }
            break;
          case (MR_Integer) 1:
            {
              MR_Word TypeInfo_47_47;
              MR_Word ArgX1_37 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 1))));
              MR_Word ArgY1_38;
              MR_Word ArgX2_39 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 2))) & (MR_Integer) 1);
              MR_Word ArgY2_40;
              MR_Word ArgX3_41 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 3))));
              MR_Word ArgY3_42;

              succeeded = ((((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0)))) == (MR_Integer) 1)));
              if (succeeded)
              {
                ArgY1_38 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));
                ArgY2_40 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))) & (MR_Integer) 1);
                ArgY3_42 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 3))));
                succeeded = hlds__hlds_goal____Unify____unify_mode_0_0(ArgX1_37, ArgY1_38);
                if (succeeded)
                {
                  succeeded = (ArgX2_39 == ArgY2_40);
                  if (succeeded)
                  {
                    TypeInfo_47_47 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[11]);
                    succeeded = mercury__builtin__unify_2_p_0(TypeInfo_47_47, ((MR_Box) (ArgX3_41)), ((MR_Box) (ArgY3_42)));
                  }
                }
              }
            }
            break;
        }
        break;
    }
  return succeeded;
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____unify_mode_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_11 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_12 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_11 == CastY_12);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  {
    MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
    MR_Word ArgY1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgX2_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
    MR_Word ArgY2_6 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgX3_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 2))));
    MR_Word ArgY3_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));
    MR_Word ArgX4_9 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 3))));
    MR_Word ArgY4_10 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 3))));

    succeeded = parse_tree__prog_data____Unify____mer_inst_0_0(ArgX1_3, ArgY1_4);
    if (succeeded)
    {
      succeeded = parse_tree__prog_data____Unify____mer_inst_0_0(ArgX2_5, ArgY2_6);
      if (succeeded)
      {
        succeeded = parse_tree__prog_data____Unify____mer_inst_0_0(ArgX3_7, ArgY3_8);
        if (succeeded)
          succeeded = parse_tree__prog_data____Unify____mer_inst_0_0(ArgX4_9, ArgY4_10);
      }
    }
  }
  return succeeded;
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____how_to_construct_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_11 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_12 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_11 == CastY_12);
  if (succeeded)
    succeeded = MR_TRUE;
  else
    switch (MR_tag((MR_Word) HeadVar__1_1)) {
      default: /*NOTREACHED*/ MR_assert(0);
      case (MR_Integer) 0:
        {
          MR_Integer CastX_3 = (MR_Integer) (HeadVar__1_1);
          MR_Integer CastY_4 = (MR_Integer) (HeadVar__2_2);

          succeeded = (CastY_4 == CastX_3);
        }
        break;
      case (MR_Integer) 1:
        {
          MR_Word ArgX1_9 = (MR_Word) (MR_body((MR_Word) (HeadVar__1_1), (MR_Integer) 1));
          MR_Word ArgY1_10;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 1);
          if (succeeded)
          {
            ArgY1_10 = (MR_Word) (MR_body((MR_Word) (HeadVar__2_2), (MR_Integer) 1));
            succeeded = hlds__hlds_goal____Unify____cell_to_reuse_0_0(ArgX1_9, ArgY1_10);
          }
        }
        break;
      case (MR_Integer) 2:
        {
          MR_Word ArgX1_5 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 0))) & (MR_Integer) 1);
          MR_Word ArgY1_6;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 2);
          if (succeeded)
          {
            ArgY1_6 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))) & (MR_Integer) 1);
            succeeded = (ArgX1_5 == ArgY1_6);
          }
        }
        break;
      case (MR_Integer) 3:
        {
          MR_Word TypeInfo_13_13;
          MR_Word ArgX1_7 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 0))));
          MR_Word ArgY1_8;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3);
          if (succeeded)
          {
            ArgY1_8 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0))));
            TypeInfo_13_13 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]);
            succeeded = mercury__builtin__unify_2_p_0(TypeInfo_13_13, ((MR_Box) (ArgX1_7)), ((MR_Box) (ArgY1_8)));
          }
        }
        break;
    }
  return succeeded;
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____cell_to_reuse_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_9 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_10 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_9 == CastY_10);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  {
    MR_Word TypeInfo_12_12;
    MR_Word TypeInfo_13_13;
    MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
    MR_Word ArgY1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgX2_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
    MR_Word ArgY2_6 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgX3_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 2))));
    MR_Word ArgY3_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));

    succeeded = mercury__builtin__unify_2_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), ((MR_Box) (ArgX1_3)), ((MR_Box) (ArgY1_4)));
    if (succeeded)
    {
      TypeInfo_12_12 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[4]);
      succeeded = mercury__builtin__unify_2_p_0(TypeInfo_12_12, ((MR_Box) (ArgX2_5)), ((MR_Box) (ArgY2_6)));
      if (succeeded)
      {
        TypeInfo_13_13 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[5]);
        succeeded = mercury__builtin__unify_2_p_0(TypeInfo_13_13, ((MR_Box) (ArgX3_7)), ((MR_Box) (ArgY3_8)));
      }
    }
  }
  return succeeded;
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____construct_sub_info_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_9 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_10 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_9 == CastY_10);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  if ((HeadVar__1_1 == (MR_Word) ((MR_Unsigned) 0U)))
  {
    MR_Integer CastX_7 = (MR_Integer) (HeadVar__1_1);
    MR_Integer CastY_8 = (MR_Integer) (HeadVar__2_2);

    succeeded = (CastY_8 == CastX_7);
  }
  else
  {
    MR_Word TypeInfo_11_11;
    MR_Word TypeInfo_12_12;
    MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 0))));
    MR_Word ArgY1_4;
    MR_Word ArgX2_5 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 1))));
    MR_Word ArgY2_6;

    succeeded = (HeadVar__2_2 != (MR_Word) ((MR_Unsigned) 0U));
    if (succeeded)
    {
      ArgY1_4 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))));
      ArgY2_6 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 1))));
      TypeInfo_11_11 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[7]);
      succeeded = mercury__builtin__unify_2_p_0(TypeInfo_11_11, ((MR_Box) (ArgX1_3)), ((MR_Box) (ArgY1_4)));
      if (succeeded)
      {
        TypeInfo_12_12 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[8]);
        succeeded = mercury__builtin__unify_2_p_0(TypeInfo_12_12, ((MR_Box) (ArgX2_5)), ((MR_Box) (ArgY2_6)));
      }
    }
  }
  return succeeded;
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____scope_reason_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_49 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_50 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_49 == CastY_50);
  if (succeeded)
    succeeded = MR_TRUE;
  else
    switch (MR_tag((MR_Word) HeadVar__1_1)) {
      default: /*NOTREACHED*/ MR_assert(0);
      case (MR_Integer) 0:
        {
          MR_Word TypeInfo_52_52;
          MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
          MR_Word ArgY1_4;
          MR_Word ArgX2_5 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))) & (MR_Integer) 1);
          MR_Word ArgY2_6;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 0);
          if (succeeded)
          {
            ArgY1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
            ArgY2_6 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))) & (MR_Integer) 1);
            TypeInfo_52_52 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[11]);
            succeeded = mercury__builtin__unify_2_p_0(TypeInfo_52_52, ((MR_Box) (ArgX1_3)), ((MR_Box) (ArgY1_4)));
            if (succeeded)
              succeeded = (ArgX2_5 == ArgY2_6);
          }
        }
        break;
      case (MR_Integer) 1:
        {
          MR_Word TypeInfo_51_51;
          MR_Word ArgX1_7 = ((MR_Unsigned) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 0))) & (MR_Integer) 7);
          MR_Word ArgY1_8;
          MR_Word ArgX2_9 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 1))));
          MR_Word ArgY2_10;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 1);
          if (succeeded)
          {
            ArgY1_8 = ((MR_Unsigned) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))) & (MR_Integer) 7);
            ArgY2_10 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 1))));
            succeeded = (ArgX1_7 == ArgY1_8);
            if (succeeded)
            {
              TypeInfo_51_51 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[30]);
              succeeded = mercury__builtin__unify_2_p_0(TypeInfo_51_51, ((MR_Box) (ArgX2_9)), ((MR_Box) (ArgY2_10)));
            }
          }
        }
        break;
      case (MR_Integer) 2:
        {
          MR_Word TypeInfo_56_56;
          MR_Word ArgX1_11 = ((MR_Word) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 0))));
          MR_Word ArgY1_12;
          MR_Word ArgX2_13 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 1))) & (MR_Integer) 3);
          MR_Word ArgY2_14;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 2);
          if (succeeded)
          {
            ArgY1_12 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))));
            ArgY2_14 = ((MR_Unsigned) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 1))) & (MR_Integer) 3);
            TypeInfo_56_56 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[11]);
            succeeded = mercury__builtin__unify_2_p_0(TypeInfo_56_56, ((MR_Box) (ArgX1_11)), ((MR_Box) (ArgY1_12)));
            if (succeeded)
              succeeded = (ArgX2_13 == ArgY2_14);
          }
        }
        break;
      case (MR_Integer) 3:
        switch (((MR_Integer) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 0))))) {
          default: /*NOTREACHED*/ MR_assert(0);
          case (MR_Integer) 0:
            {
              MR_Word ArgX1_15 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 1))) & (MR_Integer) 3);
              MR_Word ArgY1_16;

              succeeded = ((((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0)))) == (MR_Integer) 0)));
              if (succeeded)
              {
                ArgY1_16 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))) & (MR_Integer) 3);
                succeeded = (ArgX1_15 == ArgY1_16);
              }
            }
            break;
          case (MR_Integer) 1:
            {
              MR_Word ArgX1_17 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 1))) & (MR_Integer) 7);
              MR_Word ArgY1_18;

              succeeded = ((((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0)))) == (MR_Integer) 1)));
              if (succeeded)
              {
                ArgY1_18 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))) & (MR_Integer) 7);
                succeeded = (ArgX1_17 == ArgY1_18);
              }
            }
            break;
          case (MR_Integer) 2:
            {
              MR_Word TypeInfo_57_57;
              MR_Word ArgX1_19 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 1))));
              MR_Word ArgY1_20;

              succeeded = ((((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0)))) == (MR_Integer) 2)));
              if (succeeded)
              {
                ArgY1_20 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));
                TypeInfo_57_57 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]);
                succeeded = mercury__builtin__unify_2_p_0(TypeInfo_57_57, ((MR_Box) (ArgX1_19)), ((MR_Box) (ArgY1_20)));
              }
            }
            break;
          case (MR_Integer) 3:
            {
              MR_Word TypeInfo_58_58;
              MR_Word ArgX1_21 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 1))));
              MR_Word ArgY1_22;
              MR_Word ArgX2_23 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 2))) & (MR_Integer) 7);
              MR_Word ArgY2_24;

              succeeded = ((((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0)))) == (MR_Integer) 3)));
              if (succeeded)
              {
                ArgY1_22 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));
                ArgY2_24 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))) & (MR_Integer) 7);
                TypeInfo_58_58 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]);
                succeeded = mercury__builtin__unify_2_p_0(TypeInfo_58_58, ((MR_Box) (ArgX1_21)), ((MR_Box) (ArgY1_22)));
                if (succeeded)
                  succeeded = (ArgX2_23 == ArgY2_24);
              }
            }
            break;
          case (MR_Integer) 4:
            {
              MR_Word ArgX1_25 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 1))) & (MR_Integer) 1);
              MR_Word ArgY1_26;

              succeeded = ((((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0)))) == (MR_Integer) 4)));
              if (succeeded)
              {
                ArgY1_26 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))) & (MR_Integer) 1);
                succeeded = (ArgX1_25 == ArgY1_26);
              }
            }
            break;
          case (MR_Integer) 5:
            {
              MR_Word ArgX1_27 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 1))) & (MR_Integer) 1);
              MR_Word ArgY1_28;

              succeeded = ((((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0)))) == (MR_Integer) 5)));
              if (succeeded)
              {
                ArgY1_28 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))) & (MR_Integer) 1);
                succeeded = (ArgX1_27 == ArgY1_28);
              }
            }
            break;
          case (MR_Integer) 6:
            {
              MR_Word TypeInfo_53_53;
              MR_Word ArgX1_29 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 1))));
              MR_Word ArgY1_30;
              MR_Word ArgX2_31 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 2))) & (MR_Integer) 3);
              MR_Word ArgY2_32;

              succeeded = ((((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0)))) == (MR_Integer) 6)));
              if (succeeded)
              {
                ArgY1_30 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));
                ArgY2_32 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))) & (MR_Integer) 3);
                TypeInfo_53_53 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]);
                succeeded = mercury__builtin__unify_2_p_0(TypeInfo_53_53, ((MR_Box) (ArgX1_29)), ((MR_Box) (ArgY1_30)));
                if (succeeded)
                  succeeded = (ArgX2_31 == ArgY2_32);
              }
            }
            break;
          case (MR_Integer) 7:
            {
              MR_Word TypeInfo_59_59;
              MR_Word TypeInfo_60_60;
              MR_Word TypeInfo_61_61;
              MR_Word TypeInfo_62_62;
              MR_Word TypeInfo_63_63;
              MR_Word ArgX1_33 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 1))));
              MR_Word ArgY1_34;
              MR_Word ArgX2_35 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 2))));
              MR_Word ArgY2_36;
              MR_Word ArgX3_37 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 3))));
              MR_Word ArgY3_38;
              MR_Word ArgX4_39 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 4))));
              MR_Word ArgY4_40;
              MR_Word ArgX5_41 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 5))));
              MR_Word ArgY5_42;

              succeeded = ((((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0)))) == (MR_Integer) 7)));
              if (succeeded)
              {
                ArgY1_34 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));
                ArgY2_36 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))));
                ArgY3_38 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 3))));
                ArgY4_40 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 4))));
                ArgY5_42 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 5))));
                TypeInfo_59_59 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[27]);
                succeeded = mercury__builtin__unify_2_p_0(TypeInfo_59_59, ((MR_Box) (ArgX1_33)), ((MR_Box) (ArgY1_34)));
                if (succeeded)
                {
                  TypeInfo_60_60 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[16]);
                  succeeded = mercury__builtin__unify_2_p_0(TypeInfo_60_60, ((MR_Box) (ArgX2_35)), ((MR_Box) (ArgY2_36)));
                  if (succeeded)
                  {
                    TypeInfo_61_61 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[28]);
                    succeeded = mercury__builtin__unify_2_p_0(TypeInfo_61_61, ((MR_Box) (ArgX3_37)), ((MR_Box) (ArgY3_38)));
                    if (succeeded)
                    {
                      TypeInfo_62_62 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[29]);
                      succeeded = mercury__builtin__unify_2_p_0(TypeInfo_62_62, ((MR_Box) (ArgX4_39)), ((MR_Box) (ArgY4_40)));
                      if (succeeded)
                      {
                        TypeInfo_63_63 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[11]);
                        succeeded = mercury__builtin__unify_2_p_0(TypeInfo_63_63, ((MR_Box) (ArgX5_41)), ((MR_Box) (ArgY5_42)));
                      }
                    }
                  }
                }
              }
            }
            break;
          case (MR_Integer) 8:
            {
              MR_Word TypeInfo_54_54;
              MR_Word TypeInfo_55_55;
              MR_Word ArgX1_43 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 1))));
              MR_Word ArgY1_44;
              MR_Word ArgX2_45 = ((MR_Word) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 2))));
              MR_Word ArgY2_46;
              MR_Word ArgX3_47 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 3))) & (MR_Integer) 1);
              MR_Word ArgY3_48;

              succeeded = ((((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0)))) == (MR_Integer) 8)));
              if (succeeded)
              {
                ArgY1_44 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 1))));
                ArgY2_46 = ((MR_Word) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 2))));
                ArgY3_48 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 3))) & (MR_Integer) 1);
                TypeInfo_54_54 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]);
                succeeded = mercury__builtin__unify_2_p_0(TypeInfo_54_54, ((MR_Box) (ArgX1_43)), ((MR_Box) (ArgY1_44)));
                if (succeeded)
                {
                  TypeInfo_55_55 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]);
                  succeeded = mercury__builtin__unify_2_p_0(TypeInfo_55_55, ((MR_Box) (ArgX2_45)), ((MR_Box) (ArgY2_46)));
                  if (succeeded)
                    succeeded = (ArgX3_47 == ArgY3_48);
                }
              }
            }
            break;
        }
        break;
    }
  return succeeded;
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____generic_call_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_23 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_24 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_23 == CastY_24);
  if (succeeded)
    succeeded = MR_TRUE;
  else
    switch (MR_tag((MR_Word) HeadVar__1_1)) {
      default: /*NOTREACHED*/ MR_assert(0);
      case (MR_Integer) 0:
        {
          MR_Word TypeInfo_29_29;
          MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
          MR_Word ArgY1_4;
          MR_Word ArgX2_5 = ((((MR_Unsigned) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))) >> 1)) & (MR_Integer) 3);
          MR_Word ArgY2_6;
          MR_Word ArgX3_7 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))) & (MR_Integer) 1);
          MR_Word ArgY3_8;
          MR_Word ArgX4_9 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 2))));
          MR_Word ArgY4_10;
          MR_Integer Var_33;
          MR_Integer Var_34;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 0);
          if (succeeded)
          {
            ArgY1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
            ArgY2_6 = ((((MR_Unsigned) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))) >> 1)) & (MR_Integer) 3);
            ArgY3_8 = ((MR_Unsigned) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))) & (MR_Integer) 1);
            ArgY4_10 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 2))));
            TypeInfo_29_29 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]);
            succeeded = mercury__builtin__unify_2_p_0(TypeInfo_29_29, ((MR_Box) (ArgX1_3)), ((MR_Box) (ArgY1_4)));
            if (succeeded)
            {
              succeeded = (ArgX2_5 == ArgY2_6);
              if (succeeded)
              {
                succeeded = (ArgX3_7 == ArgY3_8);
                if (succeeded)
                {
                  Var_33 = (MR_Integer) (ArgX4_9);
                  Var_34 = (MR_Integer) (ArgY4_10);
                  succeeded = (Var_33 == Var_34);
                }
              }
            }
          }
        }
        break;
      case (MR_Integer) 1:
        {
          MR_Word TypeInfo_25_25;
          MR_Word ArgX1_11 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 0))));
          MR_Word ArgY1_12;
          MR_Word ArgX2_13 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 1))));
          MR_Word ArgY2_14;
          MR_Word ArgX3_15 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 2))));
          MR_Word ArgY3_16;
          MR_Word ArgX4_17 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 3))));
          MR_Word ArgY4_18;
          MR_Integer Var_31;
          MR_Integer Var_32;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 1);
          if (succeeded)
          {
            ArgY1_12 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))));
            ArgY2_14 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 1))));
            ArgY3_16 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 2))));
            ArgY4_18 = ((MR_Word) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 3))));
            TypeInfo_25_25 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]);
            succeeded = mercury__builtin__unify_2_p_0(TypeInfo_25_25, ((MR_Box) (ArgX1_11)), ((MR_Box) (ArgY1_12)));
            if (succeeded)
            {
              Var_31 = (MR_Integer) (ArgX2_13);
              Var_32 = (MR_Integer) (ArgY2_14);
              succeeded = (Var_31 == Var_32);
              if (succeeded)
              {
                succeeded = parse_tree__prog_data____Unify____class_id_0_0(ArgX3_15, ArgY3_16);
                if (succeeded)
                  succeeded = parse_tree__prog_data____Unify____pf_sym_name_arity_0_0(ArgX4_17, ArgY4_18);
              }
            }
          }
        }
        break;
      case (MR_Integer) 2:
        {
          MR_String ArgX1_19 = ((MR_String) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 0))));
          MR_String ArgY1_20;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 2);
          if (succeeded)
          {
            ArgY1_20 = ((MR_String) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))));
            succeeded = (strcmp(ArgX1_19, ArgY1_20) == 0);
          }
        }
        break;
      case (MR_Integer) 3:
        {
          MR_Word ArgX1_21 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 0))) & (MR_Integer) 7);
          MR_Word ArgY1_22;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3);
          if (succeeded)
          {
            ArgY1_22 = ((MR_Unsigned) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0))) & (MR_Integer) 7);
            succeeded = (ArgX1_21 == ArgY1_22);
          }
        }
        break;
    }
  return succeeded;
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____unify_context_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_7 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_8 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_7 == CastY_8);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  {
    MR_Word TypeInfo_9_9;
    MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
    MR_Word ArgY1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgX2_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
    MR_Word ArgY2_6 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));

    succeeded = hlds__hlds_goal____Unify____unify_main_context_0_0(ArgX1_3, ArgY1_4);
    if (succeeded)
    {
      TypeInfo_9_9 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[36]);
      succeeded = mercury__builtin__unify_2_p_0(TypeInfo_9_9, ((MR_Box) (ArgX2_5)), ((MR_Box) (ArgY2_6)));
    }
  }
  return succeeded;
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____unify_main_context_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_15 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_16 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_15 == CastY_16);
  if (succeeded)
    succeeded = MR_TRUE;
  else
    switch (MR_tag((MR_Word) HeadVar__1_1)) {
      default: /*NOTREACHED*/ MR_assert(0);
      case (MR_Integer) 0:
        switch (MR_unmkbody(HeadVar__1_1)) {
          default: /*NOTREACHED*/ MR_assert(0);
          case (MR_Integer) 0:
            {
              MR_Integer CastX_3 = (MR_Integer) (HeadVar__1_1);
              MR_Integer CastY_4 = (MR_Integer) (HeadVar__2_2);

              succeeded = (CastY_4 == CastX_3);
            }
            break;
          case (MR_Integer) 1:
            {
              MR_Integer CastX_7 = (MR_Integer) (HeadVar__1_1);
              MR_Integer CastY_8 = (MR_Integer) (HeadVar__2_2);

              succeeded = (CastY_8 == CastX_7);
            }
            break;
        }
        break;
      case (MR_Integer) 1:
        {
          MR_Integer ArgX1_5 = ((MR_Integer) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 0))));
          MR_Integer ArgY1_6;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 1);
          if (succeeded)
          {
            ArgY1_6 = ((MR_Integer) ((MR_hl_field(1, HeadVar__2_2, (MR_Integer) 0))));
            succeeded = (ArgX1_5 == ArgY1_6);
          }
        }
        break;
      case (MR_Integer) 2:
        {
          MR_Word ArgX1_9 = ((MR_Word) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 0))));
          MR_Word ArgY1_10;
          MR_Integer ArgX2_11 = ((MR_Integer) ((MR_hl_field(2, HeadVar__1_1, (MR_Integer) 1))));
          MR_Integer ArgY2_12;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 2);
          if (succeeded)
          {
            ArgY1_10 = ((MR_Word) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 0))));
            ArgY2_12 = ((MR_Integer) ((MR_hl_field(2, HeadVar__2_2, (MR_Integer) 1))));
            succeeded = hlds__hlds_pred____Unify____call_id_0_0(ArgX1_9, ArgY1_10);
            if (succeeded)
              succeeded = (ArgX2_11 == ArgY2_12);
          }
        }
        break;
      case (MR_Integer) 3:
        {
          MR_String ArgX1_13 = ((MR_String) ((MR_hl_field(3, HeadVar__1_1, (MR_Integer) 0))));
          MR_String ArgY1_14;

          succeeded = ((MR_tag((MR_Word) HeadVar__2_2)) == (MR_Integer) 3);
          if (succeeded)
          {
            ArgY1_14 = ((MR_String) ((MR_hl_field(3, HeadVar__2_2, (MR_Integer) 0))));
            succeeded = (strcmp(ArgX1_13, ArgY1_14) == 0);
          }
        }
        break;
    }
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____builtin_state_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer Cast_HeadVar1_4 = (MR_Integer) (HeadVar__2_2);
  MR_Integer Cast_HeadVar2_5 = (MR_Integer) (HeadVar__3_3);

  succeeded = (Cast_HeadVar1_4 < Cast_HeadVar2_5);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    succeeded = (Cast_HeadVar1_4 > Cast_HeadVar2_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 2;
    else
      *HeadVar__1_1 = (MR_Integer) 0;
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____builtin_state_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded = (HeadVar__1_1 == HeadVar__2_2);

  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____atomic_interface_vars_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer CastX_9 = (MR_Integer) (HeadVar__2_2);
  MR_Integer CastY_10 = (MR_Integer) (HeadVar__3_3);

  succeeded = (CastX_9 == CastY_10);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 0;
  else
  {
    MR_Word ArgX1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgY1_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 0))));
    MR_Word ArgX2_7 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));
    MR_Word ArgY2_8 = ((MR_Word) ((MR_hl_field(0, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word SubResult1_6;

    mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), &SubResult1_6, ((MR_Box) (ArgX1_4)), ((MR_Box) (ArgY1_5)));
    succeeded = (SubResult1_6 != (MR_Integer) 0);
    if (succeeded)
      *HeadVar__1_1 = SubResult1_6;
    else
      mercury__builtin__compare_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), HeadVar__1_1, ((MR_Box) (ArgX2_7)), ((MR_Box) (ArgY2_8)));
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____atomic_interface_vars_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded;
  MR_Integer CastX_7 = (MR_Integer) (HeadVar__1_1);
  MR_Integer CastY_8 = (MR_Integer) (HeadVar__2_2);

  succeeded = (CastX_7 == CastY_8);
  if (succeeded)
    succeeded = MR_TRUE;
  else
  {
    MR_Word TypeInfo_10_10;
    MR_Word ArgX1_3 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
    MR_Word ArgY1_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 0))));
    MR_Word ArgX2_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
    MR_Word ArgY2_6 = ((MR_Word) ((MR_hl_field(0, HeadVar__2_2, (MR_Integer) 1))));

    succeeded = mercury__builtin__unify_2_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), ((MR_Box) (ArgX1_3)), ((MR_Box) (ArgY1_4)));
    if (succeeded)
    {
      TypeInfo_10_10 = (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]);
      succeeded = mercury__builtin__unify_2_p_0(TypeInfo_10_10, ((MR_Box) (ArgX2_5)), ((MR_Box) (ArgY2_6)));
    }
  }
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal____Compare____atomic_goal_type_0_0(
  MR_Word * HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3)
{
  MR_bool succeeded;
  MR_Integer Cast_HeadVar1_4 = (MR_Integer) (HeadVar__2_2);
  MR_Integer Cast_HeadVar2_5 = (MR_Integer) (HeadVar__3_3);

  succeeded = (Cast_HeadVar1_4 < Cast_HeadVar2_5);
  if (succeeded)
    *HeadVar__1_1 = (MR_Integer) 1;
  else
  {
    succeeded = (Cast_HeadVar1_4 > Cast_HeadVar2_5);
    if (succeeded)
      *HeadVar__1_1 = (MR_Integer) 2;
    else
      *HeadVar__1_1 = (MR_Integer) 0;
  }
}

MR_bool MR_CALL 
hlds__hlds_goal____Unify____atomic_goal_type_0_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_bool succeeded = (HeadVar__1_1 == HeadVar__2_2);

  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal__set_case_contexts_3_p_0(
  MR_Word Context_4,
  MR_Word Case0_5,
  MR_Word * Case_6)
{
  MR_Word MainConsId_7 = ((MR_Word) ((MR_hl_field(0, Case0_5, (MR_Integer) 0))));
  MR_Word OtherConsIds_8 = ((MR_Word) ((MR_hl_field(0, Case0_5, (MR_Integer) 1))));
  MR_Word Goal0_9 = ((MR_Word) ((MR_hl_field(0, Case0_5, (MR_Integer) 2))));
  MR_Word Goal_10;

  hlds__hlds_goal__set_goal_contexts_3_p_0(Context_4, Goal0_9, &Goal_10);
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL);
    *Case_6 = base;
    MR_hl_field(0, base, 0) = ((MR_Box) (MainConsId_7));
    MR_hl_field(0, base, 1) = ((MR_Box) (OtherConsIds_8));
    MR_hl_field(0, base, 2) = ((MR_Box) (Goal_10));
  }
}

static void MR_CALL 
hlds__hlds_goal__follow_subn_until_fixpoint_3_p_0(
  MR_Word HeadVar__1_1,
  MR_Word STATE_VARIABLE_Subn_0_13,
  MR_Word * STATE_VARIABLE_Subn_14)
{
  while (MR_TRUE)
  {
    MR_bool succeeded;
    MR_Word FromVar_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 0))));
    MR_Word ToVar_5 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
    MR_Word SubstitutedToVar_7;
    MR_Box conv0_SubstitutedToVar_7;

    // setup for model_det tailcalls optimized into a loop
    ;
    succeeded = mercury__map__search_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), STATE_VARIABLE_Subn_0_13, ((MR_Box) (ToVar_5)), &conv0_SubstitutedToVar_7);
    if (succeeded)
    {
      SubstitutedToVar_7 = ((MR_Word) (conv0_SubstitutedToVar_7));
      succeeded = MR_TRUE;
    }
    if (succeeded)
    {
      MR_Word Var_26;
      MR_Word next_value_of_HeadVar__1_1;

      {
        Var_26 = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
        MR_hl_field(0, Var_26, 0) = ((MR_Box) (FromVar_4));
        MR_hl_field(0, Var_26, 1) = ((MR_Box) (SubstitutedToVar_7));
      }
      // direct tailcall eliminated
      ;
      next_value_of_HeadVar__1_1 = Var_26;
      HeadVar__1_1 = next_value_of_HeadVar__1_1;
      continue;
    }
    else
      mercury__map__det_insert_4_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), (MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), ((MR_Box) (FromVar_4)), ((MR_Box) (ToVar_5)), STATE_VARIABLE_Subn_0_13, STATE_VARIABLE_Subn_14);
    break;
  }
}

static void MR_CALL 
hlds__hlds_goal__set_goal_contexts_3_p_0_4(
  MR_Box closure_arg,
  MR_Box wrapper_arg_1,
  MR_Box * wrapper_arg_2)
{
  MR_Box closure = closure_arg;
  MR_Word conv3_Case_6;

  hlds__hlds_goal__set_case_contexts_3_p_0(((MR_Word) ((MR_hl_field(0, closure, (MR_Integer) 3)))), ((MR_Word) (wrapper_arg_1)), &conv3_Case_6);
  *wrapper_arg_2 = ((MR_Box) (conv3_Case_6));
}

static void MR_CALL 
hlds__hlds_goal__set_goal_contexts_3_p_0_3(
  MR_Box closure_arg,
  MR_Box wrapper_arg_1,
  MR_Box * wrapper_arg_2)
{
  MR_Box closure = closure_arg;
  MR_Word conv2_Goal_6;

  hlds__hlds_goal__set_goal_contexts_3_p_0(((MR_Word) ((MR_hl_field(0, closure, (MR_Integer) 3)))), ((MR_Word) (wrapper_arg_1)), &conv2_Goal_6);
  *wrapper_arg_2 = ((MR_Box) (conv2_Goal_6));
}

static void MR_CALL 
hlds__hlds_goal__set_goal_contexts_3_p_0_2(
  MR_Box closure_arg,
  MR_Box wrapper_arg_1,
  MR_Box * wrapper_arg_2)
{
  MR_Box closure = closure_arg;
  MR_Word conv1_Goal_6;

  hlds__hlds_goal__set_goal_contexts_3_p_0(((MR_Word) ((MR_hl_field(0, closure, (MR_Integer) 3)))), ((MR_Word) (wrapper_arg_1)), &conv1_Goal_6);
  *wrapper_arg_2 = ((MR_Box) (conv1_Goal_6));
}

static void MR_CALL 
hlds__hlds_goal__set_goal_contexts_3_p_0_1(
  MR_Box closure_arg,
  MR_Box wrapper_arg_1,
  MR_Box * wrapper_arg_2)
{
  MR_Box closure = closure_arg;
  MR_Word conv0_Goal_6;

  hlds__hlds_goal__set_goal_contexts_3_p_0(((MR_Word) ((MR_hl_field(0, closure, (MR_Integer) 3)))), ((MR_Word) (wrapper_arg_1)), &conv0_Goal_6);
  *wrapper_arg_2 = ((MR_Box) (conv0_Goal_6));
}

void MR_CALL 
hlds__hlds_goal__set_goal_contexts_3_p_0(
  MR_Word Context_4,
  MR_Word Goal0_5,
  MR_Word * Goal_6)
{
  MR_Word GoalExpr0_7 = ((MR_Word) ((MR_hl_field(0, Goal0_5, (MR_Integer) 0))));
  MR_Word GoalInfo0_8 = ((MR_Word) ((MR_hl_field(0, Goal0_5, (MR_Integer) 1))));
  MR_Word GoalInfo_9;
  MR_Word GoalExpr_13;
  MR_Word Var_90 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 6))));
  MR_Word Var_91;
  MR_Word Var_94 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 1))));
  MR_Word Var_95 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 2))));
  MR_Word Var_96 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 3))));
  MR_Word Var_97 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 4))));
  MR_Word Var_98 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 5))));
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 0)));
  MR_Word Var_100 = ((MR_Word) ((MR_hl_field(0, Var_90, (MR_Integer) 1))));
  MR_Word Var_101 = ((MR_Word) ((MR_hl_field(0, Var_90, (MR_Integer) 2))));
  MR_Word Var_102 = ((MR_Word) ((MR_hl_field(0, Var_90, (MR_Integer) 3))));
  MR_Word Var_103 = ((MR_Word) ((MR_hl_field(0, Var_90, (MR_Integer) 4))));
  MR_Word Var_104 = ((MR_Word) ((MR_hl_field(0, Var_90, (MR_Integer) 5))));
  MR_Word Var_105 = ((MR_Word) ((MR_hl_field(0, Var_90, (MR_Integer) 6))));
  MR_Word Var_106 = ((MR_Word) ((MR_hl_field(0, Var_90, (MR_Integer) 7))));

  {
    Var_91 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_91, 0) = ((MR_Box) (Context_4));
    MR_hl_field(0, Var_91, 1) = ((MR_Box) (Var_100));
    MR_hl_field(0, Var_91, 2) = ((MR_Box) (Var_101));
    MR_hl_field(0, Var_91, 3) = ((MR_Box) (Var_102));
    MR_hl_field(0, Var_91, 4) = ((MR_Box) (Var_103));
    MR_hl_field(0, Var_91, 5) = ((MR_Box) (Var_104));
    MR_hl_field(0, Var_91, 6) = ((MR_Box) (Var_105));
    MR_hl_field(0, Var_91, 7) = ((MR_Box) (Var_106));
  }
  {
    GoalInfo_9 = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, GoalInfo_9, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, GoalInfo_9, 1) = ((MR_Box) (Var_94));
    MR_hl_field(0, GoalInfo_9, 2) = ((MR_Box) (Var_95));
    MR_hl_field(0, GoalInfo_9, 3) = ((MR_Box) (Var_96));
    MR_hl_field(0, GoalInfo_9, 4) = ((MR_Box) (Var_97));
    MR_hl_field(0, GoalInfo_9, 5) = ((MR_Box) (Var_98));
    MR_hl_field(0, GoalInfo_9, 6) = ((MR_Box) (Var_91));
  }
  switch (MR_tag((MR_Word) GoalExpr0_7)) {
    default: /*NOTREACHED*/ MR_assert(0);
    case (MR_Integer) 0:
      {
        MR_Word SubGoal0_74 = (MR_Word) ((MR_Word) (GoalExpr0_7));
        MR_Word SubGoal_75;

        hlds__hlds_goal__set_goal_contexts_3_p_0(Context_4, SubGoal0_74, &SubGoal_75);
        GoalExpr_13 = (MR_Word) ((MR_Word) (SubGoal_75));
      }
      break;
    case (MR_Integer) 1:
    case (MR_Integer) 2:
      GoalExpr_13 = GoalExpr0_7;
      break;
    case (MR_Integer) 3:
      switch (((MR_Integer) ((MR_hl_field(3, GoalExpr0_7, (MR_Integer) 0))))) {
        default: /*NOTREACHED*/ MR_assert(0);
        case (MR_Integer) 0:
        case (MR_Integer) 1:
          GoalExpr_13 = GoalExpr0_7;
          break;
        case (MR_Integer) 2:
          {
            MR_Word ConjType_10 = ((MR_Unsigned) ((MR_hl_field(3, GoalExpr0_7, (MR_Integer) 1))) & (MR_Integer) 1);
            MR_Word SubGoals0_11 = ((MR_Word) ((MR_hl_field(3, GoalExpr0_7, (MR_Integer) 2))));
            MR_Word SubGoals_12;
            MR_Word Var_68;

            {
              Var_68 = (MR_Word) MR_new_object(MR_Word, (4 * sizeof(MR_Word)), NULL, NULL);
              MR_hl_field(0, Var_68, 0) = ((MR_Box) (&hlds__hlds_goal_scalar_common_3[4]));
              MR_hl_field(0, Var_68, 1) = ((MR_Box) (hlds__hlds_goal__set_goal_contexts_3_p_0_1));
              MR_hl_field(0, Var_68, 2) = ((MR_Box) ((MR_Integer) 1));
              MR_hl_field(0, Var_68, 3) = ((MR_Box) (Context_4));
            }
            mercury__list__map_3_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0), (MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0), Var_68, SubGoals0_11, &SubGoals_12);
            {
              GoalExpr_13 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL));
              MR_hl_field(3, GoalExpr_13, 0) = ((MR_Box) ((MR_Unsigned) 2U));
              MR_hl_field(3, GoalExpr_13, 1) = (MR_Box) ((MR_Unsigned) (ConjType_10));
              MR_hl_field(3, GoalExpr_13, 2) = ((MR_Box) (SubGoals_12));
            }
          }
          break;
        case (MR_Integer) 3:
          {
            MR_Word Var_69;
            MR_Word SubGoals0_72 = ((MR_Word) ((MR_hl_field(3, GoalExpr0_7, (MR_Integer) 1))));
            MR_Word SubGoals_73;

            {
              Var_69 = (MR_Word) MR_new_object(MR_Word, (4 * sizeof(MR_Word)), NULL, NULL);
              MR_hl_field(0, Var_69, 0) = ((MR_Box) (&hlds__hlds_goal_scalar_common_3[4]));
              MR_hl_field(0, Var_69, 1) = ((MR_Box) (hlds__hlds_goal__set_goal_contexts_3_p_0_2));
              MR_hl_field(0, Var_69, 2) = ((MR_Box) ((MR_Integer) 1));
              MR_hl_field(0, Var_69, 3) = ((MR_Box) (Context_4));
            }
            mercury__list__map_3_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0), (MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0), Var_69, SubGoals0_72, &SubGoals_73);
            {
              GoalExpr_13 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
              MR_hl_field(3, GoalExpr_13, 0) = ((MR_Box) ((MR_Unsigned) 3U));
              MR_hl_field(3, GoalExpr_13, 1) = ((MR_Box) (SubGoals_73));
            }
          }
          break;
        case (MR_Integer) 4:
          {
            MR_Word Var_21 = ((MR_Word) ((MR_hl_field(3, GoalExpr0_7, (MR_Integer) 1))));
            MR_Word CanFail_22 = ((MR_Unsigned) ((MR_hl_field(3, GoalExpr0_7, (MR_Integer) 2))) & (MR_Integer) 1);
            MR_Word Cases0_23 = ((MR_Word) ((MR_hl_field(3, GoalExpr0_7, (MR_Integer) 3))));
            MR_Word Cases_24;
            MR_Word Var_70;

            {
              Var_70 = (MR_Word) MR_new_object(MR_Word, (4 * sizeof(MR_Word)), NULL, NULL);
              MR_hl_field(0, Var_70, 0) = ((MR_Box) (&hlds__hlds_goal_scalar_common_3[5]));
              MR_hl_field(0, Var_70, 1) = ((MR_Box) (hlds__hlds_goal__set_goal_contexts_3_p_0_4));
              MR_hl_field(0, Var_70, 2) = ((MR_Box) ((MR_Integer) 1));
              MR_hl_field(0, Var_70, 3) = ((MR_Box) (Context_4));
            }
            mercury__list__map_3_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_case_0), (MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_case_0), Var_70, Cases0_23, &Cases_24);
            {
              GoalExpr_13 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (4 * sizeof(MR_Word)), NULL, NULL));
              MR_hl_field(3, GoalExpr_13, 0) = ((MR_Box) ((MR_Unsigned) 4U));
              MR_hl_field(3, GoalExpr_13, 1) = ((MR_Box) (Var_21));
              MR_hl_field(3, GoalExpr_13, 2) = (MR_Box) ((MR_Unsigned) (CanFail_22));
              MR_hl_field(3, GoalExpr_13, 3) = ((MR_Box) (Cases_24));
            }
          }
          break;
        case (MR_Integer) 5:
          {
            MR_Word Reason_25 = ((MR_Word) ((MR_hl_field(3, GoalExpr0_7, (MR_Integer) 1))));
            MR_Word SubGoal0_26 = ((MR_Word) ((MR_hl_field(3, GoalExpr0_7, (MR_Integer) 2))));
            MR_Word SubGoal_27;

            hlds__hlds_goal__set_goal_contexts_3_p_0(Context_4, SubGoal0_26, &SubGoal_27);
            {
              GoalExpr_13 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL));
              MR_hl_field(3, GoalExpr_13, 0) = ((MR_Box) ((MR_Unsigned) 5U));
              MR_hl_field(3, GoalExpr_13, 1) = ((MR_Box) (Reason_25));
              MR_hl_field(3, GoalExpr_13, 2) = ((MR_Box) (SubGoal_27));
            }
          }
          break;
        case (MR_Integer) 6:
          {
            MR_Word Vars_14 = ((MR_Word) ((MR_hl_field(3, GoalExpr0_7, (MR_Integer) 1))));
            MR_Word Cond0_15 = ((MR_Word) ((MR_hl_field(3, GoalExpr0_7, (MR_Integer) 2))));
            MR_Word Then0_16 = ((MR_Word) ((MR_hl_field(3, GoalExpr0_7, (MR_Integer) 3))));
            MR_Word Else0_17 = ((MR_Word) ((MR_hl_field(3, GoalExpr0_7, (MR_Integer) 4))));
            MR_Word Cond_18;
            MR_Word Then_19;
            MR_Word Else_20;

            hlds__hlds_goal__set_goal_contexts_3_p_0(Context_4, Cond0_15, &Cond_18);
            hlds__hlds_goal__set_goal_contexts_3_p_0(Context_4, Then0_16, &Then_19);
            hlds__hlds_goal__set_goal_contexts_3_p_0(Context_4, Else0_17, &Else_20);
            {
              GoalExpr_13 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (5 * sizeof(MR_Word)), NULL, NULL));
              MR_hl_field(3, GoalExpr_13, 0) = ((MR_Box) ((MR_Unsigned) 6U));
              MR_hl_field(3, GoalExpr_13, 1) = ((MR_Box) (Vars_14));
              MR_hl_field(3, GoalExpr_13, 2) = ((MR_Box) (Cond_18));
              MR_hl_field(3, GoalExpr_13, 3) = ((MR_Box) (Then_19));
              MR_hl_field(3, GoalExpr_13, 4) = ((MR_Box) (Else_20));
            }
          }
          break;
        case (MR_Integer) 7:
          {
            MR_Word ShortHand0_51 = ((MR_Word) ((MR_hl_field(3, GoalExpr0_7, (MR_Integer) 1))));
            MR_Word ShortHand_61;

            switch (MR_tag((MR_Word) ShortHand0_51)) {
              default: /*NOTREACHED*/ MR_assert(0);
              case (MR_Integer) 0:
                {
                  MR_Word LHS0_64 = ((MR_Word) ((MR_hl_field(0, ShortHand0_51, (MR_Integer) 0))));
                  MR_Word RHS0_65 = ((MR_Word) ((MR_hl_field(0, ShortHand0_51, (MR_Integer) 1))));
                  MR_Word LHS_66;
                  MR_Word RHS_67;

                  hlds__hlds_goal__set_goal_contexts_3_p_0(Context_4, LHS0_64, &LHS_66);
                  hlds__hlds_goal__set_goal_contexts_3_p_0(Context_4, RHS0_65, &RHS_67);
                  {
                    ShortHand_61 = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
                    MR_hl_field(0, ShortHand_61, 0) = ((MR_Box) (LHS_66));
                    MR_hl_field(0, ShortHand_61, 1) = ((MR_Box) (RHS_67));
                  }
                }
                break;
              case (MR_Integer) 1:
                {
                  MR_Word GoalType_52 = ((MR_Unsigned) ((MR_hl_field(1, ShortHand0_51, (MR_Integer) 0))) & (MR_Integer) 3);
                  MR_Word Outer_53 = ((MR_Word) ((MR_hl_field(1, ShortHand0_51, (MR_Integer) 1))));
                  MR_Word Inner_54 = ((MR_Word) ((MR_hl_field(1, ShortHand0_51, (MR_Integer) 2))));
                  MR_Word MaybeOutputVars_55 = ((MR_Word) ((MR_hl_field(1, ShortHand0_51, (MR_Integer) 3))));
                  MR_Word MainGoal0_56 = ((MR_Word) ((MR_hl_field(1, ShortHand0_51, (MR_Integer) 4))));
                  MR_Word OrElseGoals0_57 = ((MR_Word) ((MR_hl_field(1, ShortHand0_51, (MR_Integer) 5))));
                  MR_Word OrElseInners_58 = ((MR_Word) ((MR_hl_field(1, ShortHand0_51, (MR_Integer) 6))));
                  MR_Word MainGoal_59;
                  MR_Word OrElseGoals_60;
                  MR_Word Var_71;

                  hlds__hlds_goal__set_goal_contexts_3_p_0(Context_4, MainGoal0_56, &MainGoal_59);
                  {
                    Var_71 = (MR_Word) MR_new_object(MR_Word, (4 * sizeof(MR_Word)), NULL, NULL);
                    MR_hl_field(0, Var_71, 0) = ((MR_Box) (&hlds__hlds_goal_scalar_common_3[4]));
                    MR_hl_field(0, Var_71, 1) = ((MR_Box) (hlds__hlds_goal__set_goal_contexts_3_p_0_3));
                    MR_hl_field(0, Var_71, 2) = ((MR_Box) ((MR_Integer) 1));
                    MR_hl_field(0, Var_71, 3) = ((MR_Box) (Context_4));
                  }
                  mercury__list__map_3_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0), (MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0), Var_71, OrElseGoals0_57, &OrElseGoals_60);
                  {
                    ShortHand_61 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL));
                    MR_hl_field(1, ShortHand_61, 0) = (MR_Box) ((MR_Unsigned) (GoalType_52));
                    MR_hl_field(1, ShortHand_61, 1) = ((MR_Box) (Outer_53));
                    MR_hl_field(1, ShortHand_61, 2) = ((MR_Box) (Inner_54));
                    MR_hl_field(1, ShortHand_61, 3) = ((MR_Box) (MaybeOutputVars_55));
                    MR_hl_field(1, ShortHand_61, 4) = ((MR_Box) (MainGoal_59));
                    MR_hl_field(1, ShortHand_61, 5) = ((MR_Box) (OrElseGoals_60));
                    MR_hl_field(1, ShortHand_61, 6) = ((MR_Box) (OrElseInners_58));
                  }
                }
                break;
              case (MR_Integer) 2:
                {
                  MR_Word MaybeIO_62 = ((MR_Word) ((MR_hl_field(2, ShortHand0_51, (MR_Integer) 0))));
                  MR_Word ResultVar_63 = ((MR_Word) ((MR_hl_field(2, ShortHand0_51, (MR_Integer) 1))));
                  MR_Word SubGoal0_76 = ((MR_Word) ((MR_hl_field(2, ShortHand0_51, (MR_Integer) 2))));
                  MR_Word SubGoal_77;

                  hlds__hlds_goal__set_goal_contexts_3_p_0(Context_4, SubGoal0_76, &SubGoal_77);
                  {
                    ShortHand_61 = (MR_Word) MR_mkword(2, MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL));
                    MR_hl_field(2, ShortHand_61, 0) = ((MR_Box) (MaybeIO_62));
                    MR_hl_field(2, ShortHand_61, 1) = ((MR_Box) (ResultVar_63));
                    MR_hl_field(2, ShortHand_61, 2) = ((MR_Box) (SubGoal_77));
                  }
                }
                break;
            }
            {
              GoalExpr_13 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
              MR_hl_field(3, GoalExpr_13, 0) = ((MR_Box) ((MR_Unsigned) 7U));
              MR_hl_field(3, GoalExpr_13, 1) = ((MR_Box) (ShortHand_61));
            }
          }
          break;
      }
      break;
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
    *Goal_6 = base;
    MR_hl_field(0, base, 0) = ((MR_Box) (GoalExpr_13));
    MR_hl_field(0, base, 1) = ((MR_Box) (GoalInfo_9));
  }
}

static void MR_CALL 
hlds__hlds_goal__goal_list_purity_2_p_0_1(
  MR_Box closure_arg,
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box * wrapper_arg_3)
{
  MR_Box closure = closure_arg;
  MR_Word conv0_LambdaHeadVar__3_14;

  hlds__hlds_goal__IntroducedFrom__pred__goal_list_purity__3541__1_3_p_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)), &conv0_LambdaHeadVar__3_14);
  *wrapper_arg_3 = ((MR_Box) (conv0_LambdaHeadVar__3_14));
}

void MR_CALL 
hlds__hlds_goal__goal_list_purity_2_p_0(
  MR_Word Goals_3,
  MR_Word * GoalsPurity_4)
{
  MR_Box conv1_GoalsPurity_4;

  mercury__list__foldl_4_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0), (MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_purity_0), (MR_Word) (&hlds__hlds_goal_scalar_common_2[9]), Goals_3, ((MR_Box) ((MR_Integer) 0)), &conv1_GoalsPurity_4);
  *GoalsPurity_4 = ((MR_Word) (conv1_GoalsPurity_4));
}

static void MR_CALL 
hlds__hlds_goal__goal_list_determinism_2_p_0_1(
  MR_Box closure_arg,
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box * wrapper_arg_3)
{
  MR_Box closure = closure_arg;
  MR_Word conv0_LambdaHeadVar__3_14;

  hlds__hlds_goal__IntroducedFrom__pred__goal_list_determinism__3533__1_3_p_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)), &conv0_LambdaHeadVar__3_14);
  *wrapper_arg_3 = ((MR_Box) (conv0_LambdaHeadVar__3_14));
}

void MR_CALL 
hlds__hlds_goal__goal_list_determinism_2_p_0(
  MR_Word Goals_3,
  MR_Word * Determinism_4)
{
  MR_Box conv1_Determinism_4;

  mercury__list__foldl_4_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0), (MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_determinism_0), (MR_Word) (&hlds__hlds_goal_scalar_common_2[8]), Goals_3, ((MR_Box) ((MR_Integer) 0)), &conv1_Determinism_4);
  *Determinism_4 = ((MR_Word) (conv1_Determinism_4));
}

static void MR_CALL 
hlds__hlds_goal__goal_list_instmap_delta_2_p_0_1(
  MR_Box closure_arg,
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box * wrapper_arg_3)
{
  MR_Box closure = closure_arg;
  MR_Word conv0_LambdaHeadVar__3_15;

  hlds__hlds_goal__IntroducedFrom__pred__goal_list_instmap_delta__3524__1_3_p_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)), &conv0_LambdaHeadVar__3_15);
  *wrapper_arg_3 = ((MR_Box) (conv0_LambdaHeadVar__3_15));
}

void MR_CALL 
hlds__hlds_goal__goal_list_instmap_delta_2_p_0(
  MR_Word Goals_3,
  MR_Word * InstMapDelta_4)
{
  MR_Word InstMapDelta0_12;
  MR_Box conv1_InstMapDelta_4;

  hlds__instmap__instmap_delta_init_reachable_1_p_0(&InstMapDelta0_12);
  mercury__list__foldl_4_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0), (MR_Word) (&hlds__instmap__hlds__instmap__type_ctor_info_instmap_delta_0), (MR_Word) (&hlds__hlds_goal_scalar_common_2[7]), Goals_3, ((MR_Box) (InstMapDelta0_12)), &conv1_InstMapDelta_4);
  *InstMapDelta_4 = ((MR_Word) (conv1_InstMapDelta_4));
}

static MR_Box MR_CALL 
hlds__hlds_goal__goal_list_nonlocals_2_p_0_1(
  MR_Box closure_arg,
  MR_Box wrapper_arg_1)
{
  MR_Box wrapper_arg_2;
  MR_Box closure = closure_arg;
  MR_Word conv0_HeadVar__2_2;

  conv0_HeadVar__2_2 = hlds__hlds_goal__goal_get_nonlocals_1_f_0(((MR_Word) (wrapper_arg_1)));
  wrapper_arg_2 = ((MR_Box) (conv0_HeadVar__2_2));
  return wrapper_arg_2;
}

void MR_CALL 
hlds__hlds_goal__goal_list_nonlocals_2_p_0(
  MR_Word Goals_3,
  MR_Word * NonLocals_4)
{
  MR_Word GoalNonLocals_5;

  GoalNonLocals_5 = mercury__list__map_2_f_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0), (MR_Word) (&hlds__hlds_goal_scalar_common_1[3]), (MR_Word) (&hlds__hlds_goal_scalar_common_2[6]), Goals_3);
  parse_tree__set_of_var__union_list_2_p_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), GoalNonLocals_5, NonLocals_4);
}

void MR_CALL 
hlds__hlds_goal__negate_goal_3_p_0(
  MR_Word Goal_4,
  MR_Word GoalInfo_5,
  MR_Word * NegatedGoal_6)
{
  MR_bool succeeded;
  MR_Word Goal1_7;
  MR_Word Var_12 = ((MR_Word) ((MR_hl_field(0, Goal_4, (MR_Integer) 0))));

  succeeded = ((MR_tag((MR_Word) Var_12)) == (MR_Integer) 0);
  if (succeeded)
  {
    Goal1_7 = (MR_Word) ((MR_Word) (Var_12));
    *NegatedGoal_6 = Goal1_7;
  }
  else
  {
    MR_Word UnnegatedGoals_11;
    MR_Word NegatedGoals_9;
    MR_Word Var_13 = ((MR_Word) ((MR_hl_field(0, Goal_4, (MR_Integer) 0))));
    MR_Word Var_14;

    succeeded = ((((MR_tag((MR_Word) Var_13)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, Var_13, (MR_Integer) 0)))) == (MR_Integer) 2)));
    if (succeeded)
    {
      Var_14 = ((MR_Unsigned) ((MR_hl_field(3, Var_13, (MR_Integer) 1))) & (MR_Integer) 1);
      NegatedGoals_9 = ((MR_Word) ((MR_hl_field(3, Var_13, (MR_Integer) 2))));
      succeeded = (Var_14 == (MR_Integer) 0);
      if (succeeded)
        succeeded = hlds__hlds_goal__all_negated_2_p_0(NegatedGoals_9, &UnnegatedGoals_11);
    }
    if (succeeded)
    {
      MR_Word Var_15;

      {
        Var_15 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
        MR_hl_field(3, Var_15, 0) = ((MR_Box) ((MR_Unsigned) 3U));
        MR_hl_field(3, Var_15, 1) = ((MR_Box) (UnnegatedGoals_11));
      }
      {
        MR_Word base;
        base = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
        *NegatedGoal_6 = base;
        MR_hl_field(0, base, 0) = ((MR_Box) (Var_15));
        MR_hl_field(0, base, 1) = ((MR_Box) (GoalInfo_5));
      }
    }
    else
    {
      MR_Word Var_16 = (MR_Word) ((MR_Word) (Goal_4));

      {
        MR_Word base;
        base = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
        *NegatedGoal_6 = base;
        MR_hl_field(0, base, 0) = ((MR_Box) (Var_16));
        MR_hl_field(0, base, 1) = ((MR_Box) (GoalInfo_5));
      }
    }
  }
}

static MR_bool MR_CALL 
hlds__hlds_goal__all_negated_2_p_0(
  MR_Word HeadVar__1_1,
  MR_Word * HeadVar__2_2)
{
  MR_bool succeeded;

  if ((HeadVar__1_1 == (MR_Word) ((MR_Unsigned) 0U)))
  {
    *HeadVar__2_2 = (MR_Word) ((MR_Unsigned) 0U);
    succeeded = MR_TRUE;
  }
  else
  {
    MR_Word Var_19 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 1))));
    MR_Word Var_20 = ((MR_Word) ((MR_hl_field(1, HeadVar__1_1, (MR_Integer) 0))));
    MR_Word Var_22 = ((MR_Word) ((MR_hl_field(0, Var_20, (MR_Integer) 0))));

    if (((MR_tag((MR_Word) Var_22)) == (MR_Integer) 0))
    {
      MR_Word Goal_3 = (MR_Word) ((MR_Word) (Var_22));
      MR_Word Goals_6;

      succeeded = hlds__hlds_goal__all_negated_2_p_0(Var_19, &Goals_6);
      if (succeeded)
      {
        {
          MR_Word base;
          base = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
          *HeadVar__2_2 = base;
          MR_hl_field(1, base, 0) = ((MR_Box) (Goal_3));
          MR_hl_field(1, base, 1) = ((MR_Box) (Goals_6));
        }
        succeeded = MR_TRUE;
      }
    }
    else
    if (((((MR_tag((MR_Word) Var_22)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, Var_22, (MR_Integer) 0)))) == (MR_Integer) 2))))
    {
      MR_Word TypeCtorInfo_18_18;
      MR_Word NegatedConj_9 = ((MR_Word) ((MR_hl_field(3, Var_22, (MR_Integer) 2))));
      MR_Word Goals1_13;
      MR_Word Goals2_14;
      MR_Word Var_17 = ((MR_Unsigned) ((MR_hl_field(3, Var_22, (MR_Integer) 1))) & (MR_Integer) 1);

      succeeded = (Var_17 == (MR_Integer) 0);
      if (succeeded)
      {
        succeeded = hlds__hlds_goal__all_negated_2_p_0(NegatedConj_9, &Goals1_13);
        if (succeeded)
        {
          succeeded = hlds__hlds_goal__all_negated_2_p_0(Var_19, &Goals2_14);
          if (succeeded)
          {
            TypeCtorInfo_18_18 = (MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0);
            *HeadVar__2_2 = mercury__list__f_43_43_2_f_0(TypeCtorInfo_18_18, Goals1_13, Goals2_14);
            succeeded = MR_TRUE;
          }
        }
      }
    }
    else
      succeeded = MR_FALSE;
  }
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal__conjoin_goals_3_p_0(
  MR_Word Goal1_4,
  MR_Word Goal2_5,
  MR_Word * Goal_6)
{
  MR_bool succeeded;
  MR_Word GoalList_9;
  MR_Word Goals2_7;
  MR_Word Var_10 = ((MR_Word) ((MR_hl_field(0, Goal2_5, (MR_Integer) 0))));
  MR_Word Var_11;

  succeeded = ((((MR_tag((MR_Word) Var_10)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, Var_10, (MR_Integer) 0)))) == (MR_Integer) 2)));
  if (succeeded)
  {
    Var_11 = ((MR_Unsigned) ((MR_hl_field(3, Var_10, (MR_Integer) 1))) & (MR_Integer) 1);
    Goals2_7 = ((MR_Word) ((MR_hl_field(3, Var_10, (MR_Integer) 2))));
    succeeded = (Var_11 == (MR_Integer) 0);
  }
  if (succeeded)
    GoalList_9 = Goals2_7;
  else
    {
      GoalList_9 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
      MR_hl_field(1, GoalList_9, 0) = ((MR_Box) (Goal2_5));
      MR_hl_field(1, GoalList_9, 1) = ((MR_Box) ((MR_Unsigned) 0U));
    }
  hlds__hlds_goal__conjoin_goal_and_goal_list_3_p_0(Goal1_4, GoalList_9, Goal_6);
}

void MR_CALL 
hlds__hlds_goal__conjoin_goal_and_goal_list_3_p_0(
  MR_Word Goal0_4,
  MR_Word Goals_5,
  MR_Word * Goal_6)
{
  MR_bool succeeded;
  MR_Word GoalExpr0_7 = ((MR_Word) ((MR_hl_field(0, Goal0_4, (MR_Integer) 0))));
  MR_Word GoalInfo0_8 = ((MR_Word) ((MR_hl_field(0, Goal0_4, (MR_Integer) 1))));
  MR_Word GoalExpr_11;
  MR_Word GoalList0_9;
  MR_Word Var_12;

  succeeded = ((((MR_tag((MR_Word) GoalExpr0_7)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, GoalExpr0_7, (MR_Integer) 0)))) == (MR_Integer) 2)));
  if (succeeded)
  {
    Var_12 = ((MR_Unsigned) ((MR_hl_field(3, GoalExpr0_7, (MR_Integer) 1))) & (MR_Integer) 1);
    GoalList0_9 = ((MR_Word) ((MR_hl_field(3, GoalExpr0_7, (MR_Integer) 2))));
    succeeded = (Var_12 == (MR_Integer) 0);
  }
  if (succeeded)
  {
    MR_Word GoalList_10;

    GoalList_10 = mercury__list__f_43_43_2_f_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0), GoalList0_9, Goals_5);
    {
      GoalExpr_11 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL));
      MR_hl_field(3, GoalExpr_11, 0) = ((MR_Box) ((MR_Unsigned) 2U));
      MR_hl_field(3, GoalExpr_11, 1) = (MR_Box) ((MR_Unsigned) ((MR_Integer) 0));
      MR_hl_field(3, GoalExpr_11, 2) = ((MR_Box) (GoalList_10));
    }
  }
  else
  {
    MR_Word Var_15;

    {
      Var_15 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
      MR_hl_field(1, Var_15, 0) = ((MR_Box) (Goal0_4));
      MR_hl_field(1, Var_15, 1) = ((MR_Box) (Goals_5));
    }
    {
      GoalExpr_11 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL));
      MR_hl_field(3, GoalExpr_11, 0) = ((MR_Box) ((MR_Unsigned) 2U));
      MR_hl_field(3, GoalExpr_11, 1) = (MR_Box) ((MR_Unsigned) ((MR_Integer) 0));
      MR_hl_field(3, GoalExpr_11, 2) = ((MR_Box) (Var_15));
    }
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
    *Goal_6 = base;
    MR_hl_field(0, base, 0) = ((MR_Box) (GoalExpr_11));
    MR_hl_field(0, base, 1) = ((MR_Box) (GoalInfo0_8));
  }
}

void MR_CALL 
hlds__hlds_goal__disj_list_to_goal_3_p_0(
  MR_Word DisjList_4,
  MR_Word GoalInfo_5,
  MR_Word * Goal_6)
{
  MR_bool succeeded = (DisjList_4 != (MR_Word) ((MR_Unsigned) 0U));
  MR_Word Goal0_7;
  MR_Word Var_8;

  if (succeeded)
  {
    Goal0_7 = ((MR_Word) ((MR_hl_field(1, DisjList_4, (MR_Integer) 0))));
    Var_8 = ((MR_Word) ((MR_hl_field(1, DisjList_4, (MR_Integer) 1))));
    succeeded = (Var_8 == (MR_Word) ((MR_Unsigned) 0U));
  }
  if (succeeded)
    *Goal_6 = Goal0_7;
  else
  {
    MR_Word Var_9;

    {
      Var_9 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
      MR_hl_field(3, Var_9, 0) = ((MR_Box) ((MR_Unsigned) 3U));
      MR_hl_field(3, Var_9, 1) = ((MR_Box) (DisjList_4));
    }
    {
      MR_Word base;
      base = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
      *Goal_6 = base;
      MR_hl_field(0, base, 0) = ((MR_Box) (Var_9));
      MR_hl_field(0, base, 1) = ((MR_Box) (GoalInfo_5));
    }
  }
}

void MR_CALL 
hlds__hlds_goal__par_conj_list_to_goal_3_p_0(
  MR_Word ConjList_4,
  MR_Word GoalInfo_5,
  MR_Word * Goal_6)
{
  MR_bool succeeded = (ConjList_4 != (MR_Word) ((MR_Unsigned) 0U));
  MR_Word Goal0_7;
  MR_Word Var_8;

  if (succeeded)
  {
    Goal0_7 = ((MR_Word) ((MR_hl_field(1, ConjList_4, (MR_Integer) 0))));
    Var_8 = ((MR_Word) ((MR_hl_field(1, ConjList_4, (MR_Integer) 1))));
    succeeded = (Var_8 == (MR_Word) ((MR_Unsigned) 0U));
  }
  if (succeeded)
    *Goal_6 = Goal0_7;
  else
  {
    MR_Word Var_9;

    {
      Var_9 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL));
      MR_hl_field(3, Var_9, 0) = ((MR_Box) ((MR_Unsigned) 2U));
      MR_hl_field(3, Var_9, 1) = (MR_Box) ((MR_Unsigned) ((MR_Integer) 1));
      MR_hl_field(3, Var_9, 2) = ((MR_Box) (ConjList_4));
    }
    {
      MR_Word base;
      base = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
      *Goal_6 = base;
      MR_hl_field(0, base, 0) = ((MR_Box) (Var_9));
      MR_hl_field(0, base, 1) = ((MR_Box) (GoalInfo_5));
    }
  }
}

void MR_CALL 
hlds__hlds_goal__conj_list_to_goal_3_p_0(
  MR_Word ConjList_4,
  MR_Word GoalInfo_5,
  MR_Word * Goal_6)
{
  MR_bool succeeded = (ConjList_4 != (MR_Word) ((MR_Unsigned) 0U));
  MR_Word Goal0_7;
  MR_Word Var_8;

  if (succeeded)
  {
    Goal0_7 = ((MR_Word) ((MR_hl_field(1, ConjList_4, (MR_Integer) 0))));
    Var_8 = ((MR_Word) ((MR_hl_field(1, ConjList_4, (MR_Integer) 1))));
    succeeded = (Var_8 == (MR_Word) ((MR_Unsigned) 0U));
  }
  if (succeeded)
    *Goal_6 = Goal0_7;
  else
  {
    MR_Word Var_9;

    {
      Var_9 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL));
      MR_hl_field(3, Var_9, 0) = ((MR_Box) ((MR_Unsigned) 2U));
      MR_hl_field(3, Var_9, 1) = (MR_Box) ((MR_Unsigned) ((MR_Integer) 0));
      MR_hl_field(3, Var_9, 2) = ((MR_Box) (ConjList_4));
    }
    {
      MR_Word base;
      base = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
      *Goal_6 = base;
      MR_hl_field(0, base, 0) = ((MR_Box) (Var_9));
      MR_hl_field(0, base, 1) = ((MR_Box) (GoalInfo_5));
    }
  }
}

void MR_CALL 
hlds__hlds_goal__goal_to_disj_list_2_p_0(
  MR_Word Goal_3,
  MR_Word * DisjList_4)
{
  MR_bool succeeded;
  MR_Word List_5;
  MR_Word Var_7 = ((MR_Word) ((MR_hl_field(0, Goal_3, (MR_Integer) 0))));

  succeeded = ((((MR_tag((MR_Word) Var_7)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, Var_7, (MR_Integer) 0)))) == (MR_Integer) 3)));
  if (succeeded)
  {
    List_5 = ((MR_Word) ((MR_hl_field(3, Var_7, (MR_Integer) 1))));
    *DisjList_4 = List_5;
  }
  else
    {
      MR_Word base;
      base = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
      *DisjList_4 = base;
      MR_hl_field(1, base, 0) = ((MR_Box) (Goal_3));
      MR_hl_field(1, base, 1) = ((MR_Box) ((MR_Unsigned) 0U));
    }
}

void MR_CALL 
hlds__hlds_goal__goal_to_par_conj_list_2_p_0(
  MR_Word Goal_3,
  MR_Word * ConjList_4)
{
  MR_bool succeeded;
  MR_Word List_5;
  MR_Word Var_7 = ((MR_Word) ((MR_hl_field(0, Goal_3, (MR_Integer) 0))));
  MR_Word Var_8;

  succeeded = ((((MR_tag((MR_Word) Var_7)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, Var_7, (MR_Integer) 0)))) == (MR_Integer) 2)));
  if (succeeded)
  {
    Var_8 = ((MR_Unsigned) ((MR_hl_field(3, Var_7, (MR_Integer) 1))) & (MR_Integer) 1);
    List_5 = ((MR_Word) ((MR_hl_field(3, Var_7, (MR_Integer) 2))));
    succeeded = (Var_8 == (MR_Integer) 1);
  }
  if (succeeded)
    *ConjList_4 = List_5;
  else
    {
      MR_Word base;
      base = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
      *ConjList_4 = base;
      MR_hl_field(1, base, 0) = ((MR_Box) (Goal_3));
      MR_hl_field(1, base, 1) = ((MR_Box) ((MR_Unsigned) 0U));
    }
}

void MR_CALL 
hlds__hlds_goal__goal_to_conj_list_2_p_0(
  MR_Word Goal_3,
  MR_Word * ConjList_4)
{
  MR_bool succeeded;
  MR_Word List_5;
  MR_Word Var_7 = ((MR_Word) ((MR_hl_field(0, Goal_3, (MR_Integer) 0))));
  MR_Word Var_8;

  succeeded = ((((MR_tag((MR_Word) Var_7)) == (MR_Integer) 3)) && ((((MR_Integer) ((MR_hl_field(3, Var_7, (MR_Integer) 0)))) == (MR_Integer) 2)));
  if (succeeded)
  {
    Var_8 = ((MR_Unsigned) ((MR_hl_field(3, Var_7, (MR_Integer) 1))) & (MR_Integer) 1);
    List_5 = ((MR_Word) ((MR_hl_field(3, Var_7, (MR_Integer) 2))));
    succeeded = (Var_8 == (MR_Integer) 0);
  }
  if (succeeded)
    *ConjList_4 = List_5;
  else
    {
      MR_Word base;
      base = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
      *ConjList_4 = base;
      MR_hl_field(1, base, 0) = ((MR_Box) (Goal_3));
      MR_hl_field(1, base, 1) = ((MR_Box) ((MR_Unsigned) 0U));
    }
}

static void MR_CALL 
hlds__hlds_goal__incremental_rename_var_in_unify_rhs_4_p_0(
  MR_Word Subn_5,
  MR_Word SubnUpdates_6,
  MR_Word RHS0_7,
  MR_Word * RHS_8)
{
  switch (MR_tag((MR_Word) RHS0_7)) {
    default: /*NOTREACHED*/ MR_assert(0);
    case (MR_Integer) 0:
      {
        MR_Word Var0_9 = ((MR_Word) ((MR_hl_field(0, RHS0_7, (MR_Integer) 0))));
        MR_Word Var_10;

        parse_tree__prog_rename__rename_var_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, Var0_9, &Var_10);
        {
          MR_Word base;
          base = (MR_Word) MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL);
          *RHS_8 = base;
          MR_hl_field(0, base, 0) = ((MR_Box) (Var_10));
        }
      }
      break;
    case (MR_Integer) 1:
      {
        MR_Word Functor_11 = ((MR_Word) ((MR_hl_field(1, RHS0_7, (MR_Integer) 0))));
        MR_Word E_12 = ((MR_Unsigned) ((MR_hl_field(1, RHS0_7, (MR_Integer) 1))) & (MR_Integer) 1);
        MR_Word ArgVars0_13 = ((MR_Word) ((MR_hl_field(1, RHS0_7, (MR_Integer) 2))));
        MR_Word ArgVars_14;

        parse_tree__prog_rename__rename_var_list_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, ArgVars0_13, &ArgVars_14);
        {
          MR_Word base;
          base = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL));
          *RHS_8 = base;
          MR_hl_field(1, base, 0) = ((MR_Box) (Functor_11));
          MR_hl_field(1, base, 1) = (MR_Box) ((MR_Unsigned) (E_12));
          MR_hl_field(1, base, 2) = ((MR_Box) (ArgVars_14));
        }
      }
      break;
    case (MR_Integer) 2:
      {
        MR_Word NonLocals0_19 = ((MR_Word) ((MR_hl_field(2, RHS0_7, (MR_Integer) 2))));
        MR_Word VarsModes0_20 = ((MR_Word) ((MR_hl_field(2, RHS0_7, (MR_Integer) 3))));
        MR_Word Det_21 = ((MR_Unsigned) ((MR_hl_field(2, RHS0_7, (MR_Integer) 4))) & (MR_Integer) 7);
        MR_Word Goal0_22 = ((MR_Word) ((MR_hl_field(2, RHS0_7, (MR_Integer) 5))));
        MR_Word NonLocals_23;
        MR_Word Vars0_24;
        MR_Word Modes_25;
        MR_Word Vars_26;
        MR_Word VarsModes_27;
        MR_Word Goal_28;
        MR_Unsigned packed_word_1 = (MR_Unsigned) ((MR_hl_field(2, RHS0_7, (MR_Integer) 0)));

        parse_tree__prog_rename__rename_var_list_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, NonLocals0_19, &NonLocals_23);
        mercury__assoc_list__keys_and_values_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), (MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_mer_mode_0), VarsModes0_20, &Vars0_24, &Modes_25);
        parse_tree__prog_rename__rename_var_list_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, Vars0_24, &Vars_26);
        mercury__assoc_list__from_corresponding_lists_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), (MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_mer_mode_0), Vars_26, Modes_25, &VarsModes_27);
        hlds__hlds_goal__incremental_rename_vars_in_goal_4_p_0(Subn_5, SubnUpdates_6, Goal0_22, &Goal_28);
        {
          MR_Word base;
          base = (MR_Word) MR_mkword(2, MR_new_object(MR_Word, (6 * sizeof(MR_Word)), NULL, NULL));
          *RHS_8 = base;
          MR_hl_field(2, base, 0) = (MR_Box) (packed_word_1);
          MR_hl_field(2, base, 1) = NULL;
          MR_hl_field(2, base, 2) = ((MR_Box) (NonLocals_23));
          MR_hl_field(2, base, 3) = ((MR_Box) (VarsModes_27));
          MR_hl_field(2, base, 4) = (MR_Box) ((MR_Unsigned) (Det_21));
          MR_hl_field(2, base, 5) = ((MR_Box) (Goal_28));
        }
      }
      break;
  }
}

static void MR_CALL 
hlds__hlds_goal__incremental_rename_vars_in_goal_expr_4_p_0(
  MR_Word Subn_5,
  MR_Word SubnUpdates_6,
  MR_Word Expr0_7,
  MR_Word * Expr_8)
{
  switch (MR_tag((MR_Word) Expr0_7)) {
    default: /*NOTREACHED*/ MR_assert(0);
    case (MR_Integer) 0:
      {
        MR_Word Goal0_25 = (MR_Word) ((MR_Word) (Expr0_7));
        MR_Word Goal_26;

        hlds__hlds_goal__incremental_rename_vars_in_goal_4_p_0(Subn_5, SubnUpdates_6, Goal0_25, &Goal_26);
        *Expr_8 = (MR_Word) ((MR_Word) (Goal_26));
      }
      break;
    case (MR_Integer) 1:
      {
        MR_Word LHS0_60 = ((MR_Word) ((MR_hl_field(1, Expr0_7, (MR_Integer) 0))));
        MR_Word RHS0_61 = ((MR_Word) ((MR_hl_field(1, Expr0_7, (MR_Integer) 1))));
        MR_Word Mode_62 = ((MR_Word) ((MR_hl_field(1, Expr0_7, (MR_Integer) 2))));
        MR_Word Unify0_63 = ((MR_Word) ((MR_hl_field(1, Expr0_7, (MR_Integer) 3))));
        MR_Word LHS_64;
        MR_Word RHS_65;
        MR_Word Unify_66;
        MR_Word Context_164 = ((MR_Word) ((MR_hl_field(1, Expr0_7, (MR_Integer) 4))));

        parse_tree__prog_rename__rename_var_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, LHS0_60, &LHS_64);
        hlds__hlds_goal__incremental_rename_var_in_unify_rhs_4_p_0(Subn_5, SubnUpdates_6, RHS0_61, &RHS_65);
        hlds__hlds_goal__rename_var_in_unify_4_p_0((MR_Integer) 1, Subn_5, Unify0_63, &Unify_66);
        {
          MR_Word base;
          base = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (5 * sizeof(MR_Word)), NULL, NULL));
          *Expr_8 = base;
          MR_hl_field(1, base, 0) = ((MR_Box) (LHS_64));
          MR_hl_field(1, base, 1) = ((MR_Box) (RHS_65));
          MR_hl_field(1, base, 2) = ((MR_Box) (Mode_62));
          MR_hl_field(1, base, 3) = ((MR_Box) (Unify_66));
          MR_hl_field(1, base, 4) = ((MR_Box) (Context_164));
        }
      }
      break;
    case (MR_Integer) 2:
      {
        MR_Word PredId_55 = ((MR_Word) ((MR_hl_field(2, Expr0_7, (MR_Integer) 0))));
        MR_Integer ProcId_56 = ((MR_Integer) ((MR_hl_field(2, Expr0_7, (MR_Integer) 1))));
        MR_Word Builtin_57 = ((MR_Unsigned) ((MR_hl_field(2, Expr0_7, (MR_Integer) 3))) & (MR_Integer) 1);
        MR_Word Context_58 = ((MR_Word) ((MR_hl_field(2, Expr0_7, (MR_Integer) 4))));
        MR_Word Sym_59 = ((MR_Word) ((MR_hl_field(2, Expr0_7, (MR_Integer) 5))));
        MR_Word Args0_162 = ((MR_Word) ((MR_hl_field(2, Expr0_7, (MR_Integer) 2))));
        MR_Word Args_163;

        parse_tree__prog_rename__rename_var_list_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, Args0_162, &Args_163);
        {
          MR_Word base;
          base = (MR_Word) MR_mkword(2, MR_new_object(MR_Word, (6 * sizeof(MR_Word)), NULL, NULL));
          *Expr_8 = base;
          MR_hl_field(2, base, 0) = ((MR_Box) (PredId_55));
          MR_hl_field(2, base, 1) = ((MR_Box) (ProcId_56));
          MR_hl_field(2, base, 2) = ((MR_Box) (Args_163));
          MR_hl_field(2, base, 3) = (MR_Box) ((MR_Unsigned) (Builtin_57));
          MR_hl_field(2, base, 4) = ((MR_Box) (Context_58));
          MR_hl_field(2, base, 5) = ((MR_Box) (Sym_59));
        }
      }
      break;
    case (MR_Integer) 3:
      switch (((MR_Integer) ((MR_hl_field(3, Expr0_7, (MR_Integer) 0))))) {
        default: /*NOTREACHED*/ MR_assert(0);
        case (MR_Integer) 0:
          {
            MR_Word GenericCall0_48 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 1))));
            MR_Word Args0_49 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 2))));
            MR_Word Modes_50 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 3))));
            MR_Word MaybeArgRegs_51 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 4))));
            MR_Word Det_52 = ((MR_Unsigned) ((MR_hl_field(3, Expr0_7, (MR_Integer) 5))) & (MR_Integer) 7);
            MR_Word GenericCall_53;
            MR_Word Args_54;

            hlds__hlds_goal__rename_generic_call_4_p_0((MR_Integer) 1, Subn_5, GenericCall0_48, &GenericCall_53);
            parse_tree__prog_rename__rename_var_list_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, Args0_49, &Args_54);
            {
              MR_Word base;
              base = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (6 * sizeof(MR_Word)), NULL, NULL));
              *Expr_8 = base;
              MR_hl_field(3, base, 0) = ((MR_Box) ((MR_Unsigned) 0U));
              MR_hl_field(3, base, 1) = ((MR_Box) (GenericCall_53));
              MR_hl_field(3, base, 2) = ((MR_Box) (Args_54));
              MR_hl_field(3, base, 3) = ((MR_Box) (Modes_50));
              MR_hl_field(3, base, 4) = ((MR_Box) (MaybeArgRegs_51));
              MR_hl_field(3, base, 5) = (MR_Box) ((MR_Unsigned) (Det_52));
            }
          }
          break;
        case (MR_Integer) 1:
          {
            MR_Word Attrs_67 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 1))));
            MR_Word Extra0_68 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 5))));
            MR_Word MTRC_69 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 6))));
            MR_Word Impl_70 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 7))));
            MR_Word Extra_71;
            MR_Word Args0_165 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 4))));
            MR_Word Args_166;
            MR_Word PredId_167 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 2))));
            MR_Integer ProcId_168 = ((MR_Integer) ((MR_hl_field(3, Expr0_7, (MR_Integer) 3))));

            hlds__hlds_goal__rename_arg_list_4_p_0((MR_Integer) 1, Subn_5, Args0_165, &Args_166);
            hlds__hlds_goal__rename_arg_list_4_p_0((MR_Integer) 1, Subn_5, Extra0_68, &Extra_71);
            {
              MR_Word base;
              base = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL));
              *Expr_8 = base;
              MR_hl_field(3, base, 0) = ((MR_Box) ((MR_Unsigned) 1U));
              MR_hl_field(3, base, 1) = ((MR_Box) (Attrs_67));
              MR_hl_field(3, base, 2) = ((MR_Box) (PredId_167));
              MR_hl_field(3, base, 3) = ((MR_Box) (ProcId_168));
              MR_hl_field(3, base, 4) = ((MR_Box) (Args_166));
              MR_hl_field(3, base, 5) = ((MR_Box) (Extra_71));
              MR_hl_field(3, base, 6) = ((MR_Box) (MTRC_69));
              MR_hl_field(3, base, 7) = ((MR_Box) (Impl_70));
            }
          }
          break;
        case (MR_Integer) 2:
          {
            MR_Word ConjType_9 = ((MR_Unsigned) ((MR_hl_field(3, Expr0_7, (MR_Integer) 1))) & (MR_Integer) 1);
            MR_Word Goals0_10 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 2))));
            MR_Word Goals_11;

            hlds__hlds_goal__incremental_rename_vars_in_goals_4_p_0(Subn_5, SubnUpdates_6, Goals0_10, &Goals_11);
            {
              MR_Word base;
              base = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL));
              *Expr_8 = base;
              MR_hl_field(3, base, 0) = ((MR_Box) ((MR_Unsigned) 2U));
              MR_hl_field(3, base, 1) = (MR_Box) ((MR_Unsigned) (ConjType_9));
              MR_hl_field(3, base, 2) = ((MR_Box) (Goals_11));
            }
          }
          break;
        case (MR_Integer) 3:
          {
            MR_Word Goals0_138 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 1))));
            MR_Word Goals_139;

            hlds__hlds_goal__incremental_rename_vars_in_goals_4_p_0(Subn_5, SubnUpdates_6, Goals0_138, &Goals_139);
            {
              MR_Word base;
              base = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
              *Expr_8 = base;
              MR_hl_field(3, base, 0) = ((MR_Box) ((MR_Unsigned) 3U));
              MR_hl_field(3, base, 1) = ((MR_Box) (Goals_139));
            }
          }
          break;
        case (MR_Integer) 4:
          {
            MR_Word Var0_12 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 1))));
            MR_Word CanFail_13 = ((MR_Unsigned) ((MR_hl_field(3, Expr0_7, (MR_Integer) 2))) & (MR_Integer) 1);
            MR_Word Cases0_14 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 3))));
            MR_Word Var_15;
            MR_Word Cases_16;

            parse_tree__prog_rename__rename_var_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, Var0_12, &Var_15);
            hlds__hlds_goal__incremental_rename_vars_in_cases_4_p_0(Subn_5, SubnUpdates_6, Cases0_14, &Cases_16);
            {
              MR_Word base;
              base = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (4 * sizeof(MR_Word)), NULL, NULL));
              *Expr_8 = base;
              MR_hl_field(3, base, 0) = ((MR_Box) ((MR_Unsigned) 4U));
              MR_hl_field(3, base, 1) = ((MR_Box) (Var_15));
              MR_hl_field(3, base, 2) = (MR_Box) ((MR_Unsigned) (CanFail_13));
              MR_hl_field(3, base, 3) = ((MR_Box) (Cases_16));
            }
          }
          break;
        case (MR_Integer) 5:
          {
            MR_Word Reason0_27 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 1))));
            MR_Word Reason_29;
            MR_Word Goal0_160 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 2))));
            MR_Word Goal_161;

            switch (MR_tag((MR_Word) Reason0_27)) {
              default: /*NOTREACHED*/ MR_assert(0);
              case (MR_Integer) 0:
                {
                  MR_Word Creator_28 = ((MR_Unsigned) ((MR_hl_field(0, Reason0_27, (MR_Integer) 1))) & (MR_Integer) 1);
                  MR_Word Vars0_140 = ((MR_Word) ((MR_hl_field(0, Reason0_27, (MR_Integer) 0))));
                  MR_Word Vars_141;

                  parse_tree__prog_rename__rename_var_list_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, Vars0_140, &Vars_141);
                  {
                    Reason_29 = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
                    MR_hl_field(0, Reason_29, 0) = ((MR_Box) (Vars_141));
                    MR_hl_field(0, Reason_29, 1) = (MR_Box) ((MR_Unsigned) (Creator_28));
                  }
                }
                break;
              case (MR_Integer) 1:
                Reason_29 = Reason0_27;
                break;
              case (MR_Integer) 2:
                {
                  MR_Word Kind_30 = ((MR_Unsigned) ((MR_hl_field(2, Reason0_27, (MR_Integer) 1))) & (MR_Integer) 3);
                  MR_Word Vars0_142 = ((MR_Word) ((MR_hl_field(2, Reason0_27, (MR_Integer) 0))));
                  MR_Word Vars_143;

                  parse_tree__prog_rename__rename_var_list_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, Vars0_142, &Vars_143);
                  {
                    Reason_29 = (MR_Word) MR_mkword(2, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
                    MR_hl_field(2, Reason_29, 0) = ((MR_Box) (Vars_143));
                    MR_hl_field(2, Reason_29, 1) = (MR_Box) ((MR_Unsigned) (Kind_30));
                  }
                }
                break;
              case (MR_Integer) 3:
                switch (((MR_Integer) ((MR_hl_field(3, Reason0_27, (MR_Integer) 0))))) {
                  default: /*NOTREACHED*/ MR_assert(0);
                  case (MR_Integer) 0:
                  case (MR_Integer) 1:
                  case (MR_Integer) 4:
                  case (MR_Integer) 5:
                    Reason_29 = Reason0_27;
                    break;
                  case (MR_Integer) 2:
                    {
                      MR_Word Var0_144 = ((MR_Word) ((MR_hl_field(3, Reason0_27, (MR_Integer) 1))));
                      MR_Word Var_145;

                      parse_tree__prog_rename__rename_var_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, Var0_144, &Var_145);
                      {
                        Reason_29 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
                        MR_hl_field(3, Reason_29, 0) = ((MR_Box) ((MR_Unsigned) 2U));
                        MR_hl_field(3, Reason_29, 1) = ((MR_Box) (Var_145));
                      }
                    }
                    break;
                  case (MR_Integer) 3:
                    {
                      MR_Word Detism_31 = ((MR_Unsigned) ((MR_hl_field(3, Reason0_27, (MR_Integer) 2))) & (MR_Integer) 7);
                      MR_Word Var0_146 = ((MR_Word) ((MR_hl_field(3, Reason0_27, (MR_Integer) 1))));
                      MR_Word Var_147;

                      parse_tree__prog_rename__rename_var_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, Var0_146, &Var_147);
                      {
                        Reason_29 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL));
                        MR_hl_field(3, Reason_29, 0) = ((MR_Box) ((MR_Unsigned) 3U));
                        MR_hl_field(3, Reason_29, 1) = ((MR_Box) (Var_147));
                        MR_hl_field(3, Reason_29, 2) = (MR_Box) ((MR_Unsigned) (Detism_31));
                      }
                    }
                    break;
                  case (MR_Integer) 6:
                    {
                      MR_Word Var0_148 = ((MR_Word) ((MR_hl_field(3, Reason0_27, (MR_Integer) 1))));
                      MR_Word Var_149;
                      MR_Word Kind_150 = ((MR_Unsigned) ((MR_hl_field(3, Reason0_27, (MR_Integer) 2))) & (MR_Integer) 3);

                      parse_tree__prog_rename__rename_var_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, Var0_148, &Var_149);
                      {
                        Reason_29 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL));
                        MR_hl_field(3, Reason_29, 0) = ((MR_Box) ((MR_Unsigned) 6U));
                        MR_hl_field(3, Reason_29, 1) = ((MR_Box) (Var_149));
                        MR_hl_field(3, Reason_29, 2) = (MR_Box) ((MR_Unsigned) (Kind_150));
                      }
                    }
                    break;
                  case (MR_Integer) 7:
                    {
                      MR_Word Flag_32 = ((MR_Word) ((MR_hl_field(3, Reason0_27, (MR_Integer) 1))));
                      MR_Word Grade_33 = ((MR_Word) ((MR_hl_field(3, Reason0_27, (MR_Integer) 2))));
                      MR_Word Env_34 = ((MR_Word) ((MR_hl_field(3, Reason0_27, (MR_Integer) 3))));
                      MR_Word QuantVars0_35 = ((MR_Word) ((MR_hl_field(3, Reason0_27, (MR_Integer) 5))));
                      MR_Word QuantVars_36;
                      MR_Word Vars_151 = ((MR_Word) ((MR_hl_field(3, Reason0_27, (MR_Integer) 4))));

                      parse_tree__prog_rename__rename_var_list_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, QuantVars0_35, &QuantVars_36);
                      {
                        Reason_29 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (6 * sizeof(MR_Word)), NULL, NULL));
                        MR_hl_field(3, Reason_29, 0) = ((MR_Box) ((MR_Unsigned) 7U));
                        MR_hl_field(3, Reason_29, 1) = ((MR_Box) (Flag_32));
                        MR_hl_field(3, Reason_29, 2) = ((MR_Box) (Grade_33));
                        MR_hl_field(3, Reason_29, 3) = ((MR_Box) (Env_34));
                        MR_hl_field(3, Reason_29, 4) = ((MR_Box) (Vars_151));
                        MR_hl_field(3, Reason_29, 5) = ((MR_Box) (QuantVars_36));
                      }
                    }
                    break;
                  case (MR_Integer) 8:
                    {
                      MR_Word LCVar0_37 = ((MR_Word) ((MR_hl_field(3, Reason0_27, (MR_Integer) 1))));
                      MR_Word LCSVar0_38 = ((MR_Word) ((MR_hl_field(3, Reason0_27, (MR_Integer) 2))));
                      MR_Word UseParentStack_39 = ((MR_Unsigned) ((MR_hl_field(3, Reason0_27, (MR_Integer) 3))) & (MR_Integer) 1);
                      MR_Word LCVar_40;
                      MR_Word LCSVar_41;

                      parse_tree__prog_rename__rename_var_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, LCVar0_37, &LCVar_40);
                      parse_tree__prog_rename__rename_var_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, LCSVar0_38, &LCSVar_41);
                      {
                        Reason_29 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (4 * sizeof(MR_Word)), NULL, NULL));
                        MR_hl_field(3, Reason_29, 0) = ((MR_Box) ((MR_Unsigned) 8U));
                        MR_hl_field(3, Reason_29, 1) = ((MR_Box) (LCVar_40));
                        MR_hl_field(3, Reason_29, 2) = ((MR_Box) (LCSVar_41));
                        MR_hl_field(3, Reason_29, 3) = (MR_Box) ((MR_Unsigned) (UseParentStack_39));
                      }
                    }
                    break;
                }
                break;
            }
            hlds__hlds_goal__incremental_rename_vars_in_goal_4_p_0(Subn_5, SubnUpdates_6, Goal0_160, &Goal_161);
            {
              MR_Word base;
              base = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL));
              *Expr_8 = base;
              MR_hl_field(3, base, 0) = ((MR_Box) ((MR_Unsigned) 5U));
              MR_hl_field(3, base, 1) = ((MR_Box) (Reason_29));
              MR_hl_field(3, base, 2) = ((MR_Box) (Goal_161));
            }
          }
          break;
        case (MR_Integer) 6:
          {
            MR_Word Vars0_17 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 1))));
            MR_Word Cond0_18 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 2))));
            MR_Word Then0_19 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 3))));
            MR_Word Else0_20 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 4))));
            MR_Word Vars_21;
            MR_Word Cond_22;
            MR_Word Then_23;
            MR_Word Else_24;

            parse_tree__prog_rename__rename_var_list_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, Vars0_17, &Vars_21);
            hlds__hlds_goal__incremental_rename_vars_in_goal_4_p_0(Subn_5, SubnUpdates_6, Cond0_18, &Cond_22);
            hlds__hlds_goal__incremental_rename_vars_in_goal_4_p_0(Subn_5, SubnUpdates_6, Then0_19, &Then_23);
            hlds__hlds_goal__incremental_rename_vars_in_goal_4_p_0(Subn_5, SubnUpdates_6, Else0_20, &Else_24);
            {
              MR_Word base;
              base = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (5 * sizeof(MR_Word)), NULL, NULL));
              *Expr_8 = base;
              MR_hl_field(3, base, 0) = ((MR_Box) ((MR_Unsigned) 6U));
              MR_hl_field(3, base, 1) = ((MR_Box) (Vars_21));
              MR_hl_field(3, base, 2) = ((MR_Box) (Cond_22));
              MR_hl_field(3, base, 3) = ((MR_Box) (Then_23));
              MR_hl_field(3, base, 4) = ((MR_Box) (Else_24));
            }
          }
          break;
        case (MR_Integer) 7:
          {
            MR_Word Shorthand0_72 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 1))));
            MR_Word Shorthand_96;

            switch (MR_tag((MR_Word) Shorthand0_72)) {
              default: /*NOTREACHED*/ MR_assert(0);
              case (MR_Integer) 0:
                {
                  MR_Word LeftGoal0_107 = ((MR_Word) ((MR_hl_field(0, Shorthand0_72, (MR_Integer) 0))));
                  MR_Word RightGoal0_108 = ((MR_Word) ((MR_hl_field(0, Shorthand0_72, (MR_Integer) 1))));
                  MR_Word LeftGoal_109;
                  MR_Word RightGoal_110;

                  hlds__hlds_goal__incremental_rename_vars_in_goal_4_p_0(Subn_5, SubnUpdates_6, LeftGoal0_107, &LeftGoal_109);
                  hlds__hlds_goal__incremental_rename_vars_in_goal_4_p_0(Subn_5, SubnUpdates_6, RightGoal0_108, &RightGoal_110);
                  {
                    Shorthand_96 = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
                    MR_hl_field(0, Shorthand_96, 0) = ((MR_Box) (LeftGoal_109));
                    MR_hl_field(0, Shorthand_96, 1) = ((MR_Box) (RightGoal_110));
                  }
                }
                break;
              case (MR_Integer) 1:
                {
                  MR_Word Outer0_74 = ((MR_Word) ((MR_hl_field(1, Shorthand0_72, (MR_Integer) 1))));
                  MR_Word Inner0_75 = ((MR_Word) ((MR_hl_field(1, Shorthand0_72, (MR_Integer) 2))));
                  MR_Word MaybeOutputVars0_76 = ((MR_Word) ((MR_hl_field(1, Shorthand0_72, (MR_Integer) 3))));
                  MR_Word MainGoal0_77 = ((MR_Word) ((MR_hl_field(1, Shorthand0_72, (MR_Integer) 4))));
                  MR_Word OrElseGoals0_78 = ((MR_Word) ((MR_hl_field(1, Shorthand0_72, (MR_Integer) 5))));
                  MR_Word OrElseInners_79 = ((MR_Word) ((MR_hl_field(1, Shorthand0_72, (MR_Integer) 6))));
                  MR_Word GoalType_80 = ((MR_Unsigned) ((MR_hl_field(1, Shorthand0_72, (MR_Integer) 0))) & (MR_Integer) 3);
                  MR_Word OuterDI0_81 = ((MR_Word) ((MR_hl_field(0, Outer0_74, (MR_Integer) 0))));
                  MR_Word OuterUO0_82 = ((MR_Word) ((MR_hl_field(0, Outer0_74, (MR_Integer) 1))));
                  MR_Word OuterDI_83;
                  MR_Word OuterUO_84;
                  MR_Word Outer_85;
                  MR_Word InnerDI0_86;
                  MR_Word InnerUO0_87;
                  MR_Word InnerDI_88;
                  MR_Word InnerUO_89;
                  MR_Word Inner_90;
                  MR_Word MaybeOutputVars_91;
                  MR_Word MainGoal_94;
                  MR_Word OrElseGoals_95;

                  parse_tree__prog_rename__rename_var_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, OuterDI0_81, &OuterDI_83);
                  parse_tree__prog_rename__rename_var_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, OuterUO0_82, &OuterUO_84);
                  {
                    Outer_85 = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
                    MR_hl_field(0, Outer_85, 0) = ((MR_Box) (OuterDI_83));
                    MR_hl_field(0, Outer_85, 1) = ((MR_Box) (OuterUO_84));
                  }
                  InnerDI0_86 = ((MR_Word) ((MR_hl_field(0, Inner0_75, (MR_Integer) 0))));
                  InnerUO0_87 = ((MR_Word) ((MR_hl_field(0, Inner0_75, (MR_Integer) 1))));
                  parse_tree__prog_rename__rename_var_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, InnerDI0_86, &InnerDI_88);
                  parse_tree__prog_rename__rename_var_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, InnerUO0_87, &InnerUO_89);
                  {
                    Inner_90 = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
                    MR_hl_field(0, Inner_90, 0) = ((MR_Box) (InnerDI_88));
                    MR_hl_field(0, Inner_90, 1) = ((MR_Box) (InnerUO_89));
                  }
                  if ((MaybeOutputVars0_76 == (MR_Word) ((MR_Unsigned) 0U)))
                    MaybeOutputVars_91 = MaybeOutputVars0_76;
                  else
                  {
                    MR_Word OutputVars0_92 = ((MR_Word) ((MR_hl_field(1, MaybeOutputVars0_76, (MR_Integer) 0))));
                    MR_Word OutputVars_93;

                    parse_tree__prog_rename__rename_var_list_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, OutputVars0_92, &OutputVars_93);
                    {
                      MaybeOutputVars_91 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
                      MR_hl_field(1, MaybeOutputVars_91, 0) = ((MR_Box) (OutputVars_93));
                    }
                  }
                  hlds__hlds_goal__incremental_rename_vars_in_goal_4_p_0(Subn_5, SubnUpdates_6, MainGoal0_77, &MainGoal_94);
                  hlds__hlds_goal__incremental_rename_vars_in_goals_4_p_0(Subn_5, SubnUpdates_6, OrElseGoals0_78, &OrElseGoals_95);
                  {
                    Shorthand_96 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL));
                    MR_hl_field(1, Shorthand_96, 0) = (MR_Box) ((MR_Unsigned) (GoalType_80));
                    MR_hl_field(1, Shorthand_96, 1) = ((MR_Box) (Outer_85));
                    MR_hl_field(1, Shorthand_96, 2) = ((MR_Box) (Inner_90));
                    MR_hl_field(1, Shorthand_96, 3) = ((MR_Box) (MaybeOutputVars_91));
                    MR_hl_field(1, Shorthand_96, 4) = ((MR_Box) (MainGoal_94));
                    MR_hl_field(1, Shorthand_96, 5) = ((MR_Box) (OrElseGoals_95));
                    MR_hl_field(1, Shorthand_96, 6) = ((MR_Box) (OrElseInners_79));
                  }
                }
                break;
              case (MR_Integer) 2:
                {
                  MR_Word MaybeIO0_97 = ((MR_Word) ((MR_hl_field(2, Shorthand0_72, (MR_Integer) 0))));
                  MR_Word ResultVar0_98 = ((MR_Word) ((MR_hl_field(2, Shorthand0_72, (MR_Integer) 1))));
                  MR_Word SubGoal0_99 = ((MR_Word) ((MR_hl_field(2, Shorthand0_72, (MR_Integer) 2))));
                  MR_Word MaybeIO_104;
                  MR_Word ResultVar_105;
                  MR_Word SubGoal_106;

                  if ((MaybeIO0_97 == (MR_Word) ((MR_Unsigned) 0U)))
                    MaybeIO_104 = (MR_Word) ((MR_Unsigned) 0U);
                  else
                  {
                    MR_Word IOVarInitial0_100;
                    MR_Word IOVarFinal0_101;
                    MR_Word IOVarInitial_102;
                    MR_Word IOVarFinal_103;
                    MR_Word Var_133 = ((MR_Word) ((MR_hl_field(1, MaybeIO0_97, (MR_Integer) 0))));
                    MR_Word Var_136;

                    IOVarInitial0_100 = ((MR_Word) ((MR_hl_field(0, Var_133, (MR_Integer) 0))));
                    IOVarFinal0_101 = ((MR_Word) ((MR_hl_field(0, Var_133, (MR_Integer) 1))));
                    parse_tree__prog_rename__rename_var_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, IOVarInitial0_100, &IOVarInitial_102);
                    parse_tree__prog_rename__rename_var_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, IOVarFinal0_101, &IOVarFinal_103);
                    {
                      Var_136 = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
                      MR_hl_field(0, Var_136, 0) = ((MR_Box) (IOVarInitial_102));
                      MR_hl_field(0, Var_136, 1) = ((MR_Box) (IOVarFinal_103));
                    }
                    {
                      MaybeIO_104 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
                      MR_hl_field(1, MaybeIO_104, 0) = ((MR_Box) (Var_136));
                    }
                  }
                  parse_tree__prog_rename__rename_var_4_p_1((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), (MR_Integer) 1, Subn_5, ResultVar0_98, &ResultVar_105);
                  hlds__hlds_goal__incremental_rename_vars_in_goal_4_p_0(Subn_5, SubnUpdates_6, SubGoal0_99, &SubGoal_106);
                  {
                    Shorthand_96 = (MR_Word) MR_mkword(2, MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL));
                    MR_hl_field(2, Shorthand_96, 0) = ((MR_Box) (MaybeIO_104));
                    MR_hl_field(2, Shorthand_96, 1) = ((MR_Box) (ResultVar_105));
                    MR_hl_field(2, Shorthand_96, 2) = ((MR_Box) (SubGoal_106));
                  }
                }
                break;
            }
            {
              MR_Word base;
              base = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
              *Expr_8 = base;
              MR_hl_field(3, base, 0) = ((MR_Box) ((MR_Unsigned) 7U));
              MR_hl_field(3, base, 1) = ((MR_Box) (Shorthand_96));
            }
          }
          break;
      }
      break;
  }
}

static void MR_CALL 
hlds__hlds_goal__incremental_rename_vars_in_cases_4_p_0(
  MR_Word Subn_1,
  MR_Word SubnUpdates_2,
  MR_Word HeadVar__3_3,
  MR_Word * HeadVar__4_4)
{
  if ((HeadVar__3_3 == (MR_Word) ((MR_Unsigned) 0U)))
    *HeadVar__4_4 = (MR_Word) ((MR_Unsigned) 0U);
  else
  {
    MR_Word Case0_9 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 0))));
    MR_Word Cases0_10 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word Case_11;
    MR_Word Cases_12;
    MR_Word MainConsId_13 = ((MR_Word) ((MR_hl_field(0, Case0_9, (MR_Integer) 0))));
    MR_Word OtherConsIds_14 = ((MR_Word) ((MR_hl_field(0, Case0_9, (MR_Integer) 1))));
    MR_Word Goal0_15 = ((MR_Word) ((MR_hl_field(0, Case0_9, (MR_Integer) 2))));
    MR_Word Goal_16;

    hlds__hlds_goal__incremental_rename_vars_in_goal_4_p_0(Subn_1, SubnUpdates_2, Goal0_15, &Goal_16);
    {
      Case_11 = (MR_Word) MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, Case_11, 0) = ((MR_Box) (MainConsId_13));
      MR_hl_field(0, Case_11, 1) = ((MR_Box) (OtherConsIds_14));
      MR_hl_field(0, Case_11, 2) = ((MR_Box) (Goal_16));
    }
    hlds__hlds_goal__incremental_rename_vars_in_cases_4_p_0(Subn_1, SubnUpdates_2, Cases0_10, &Cases_12);
    {
      MR_Word base;
      base = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
      *HeadVar__4_4 = base;
      MR_hl_field(1, base, 0) = ((MR_Box) (Case_11));
      MR_hl_field(1, base, 1) = ((MR_Box) (Cases_12));
    }
  }
}

static void MR_CALL 
hlds__hlds_goal__incremental_rename_vars_in_goals_4_p_0(
  MR_Word Subn_1,
  MR_Word SubnUpdates_2,
  MR_Word HeadVar__3_3,
  MR_Word * HeadVar__4_4)
{
  if ((HeadVar__3_3 == (MR_Word) ((MR_Unsigned) 0U)))
    *HeadVar__4_4 = (MR_Word) ((MR_Unsigned) 0U);
  else
  {
    MR_Word Goal0_9 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 0))));
    MR_Word Goals0_10 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word Goal_11;
    MR_Word Goals_12;

    hlds__hlds_goal__incremental_rename_vars_in_goal_4_p_0(Subn_1, SubnUpdates_2, Goal0_9, &Goal_11);
    hlds__hlds_goal__incremental_rename_vars_in_goals_4_p_0(Subn_1, SubnUpdates_2, Goals0_10, &Goals_12);
    {
      MR_Word base;
      base = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
      *HeadVar__4_4 = base;
      MR_hl_field(1, base, 0) = ((MR_Box) (Goal_11));
      MR_hl_field(1, base, 1) = ((MR_Box) (Goals_12));
    }
  }
}

static void MR_CALL 
hlds__hlds_goal__incremental_rename_vars_in_goal_4_p_0_1(
  MR_Box closure_arg,
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box * wrapper_arg_3)
{
  MR_Box closure = closure_arg;
  MR_Word conv1_STATE_VARIABLE_Subn_14;

  hlds__hlds_goal__follow_subn_until_fixpoint_3_p_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)), &conv1_STATE_VARIABLE_Subn_14);
  *wrapper_arg_3 = ((MR_Box) (conv1_STATE_VARIABLE_Subn_14));
}

void MR_CALL 
hlds__hlds_goal__incremental_rename_vars_in_goal_4_p_0(
  MR_Word Subn0_5,
  MR_Word SubnUpdates_6,
  MR_Word Goal0_7,
  MR_Word * Goal_8)
{
  MR_bool succeeded;
  MR_Word GoalExpr0_9 = ((MR_Word) ((MR_hl_field(0, Goal0_7, (MR_Integer) 0))));
  MR_Word GoalInfo0_10 = ((MR_Word) ((MR_hl_field(0, Goal0_7, (MR_Integer) 1))));
  MR_Word GoalId_11 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_10, (MR_Integer) 4))));
  MR_Word Subn_16;
  MR_Word GoalExpr_17;
  MR_Word GoalInfo_18;
  MR_Word GoalSubns_12;
  MR_Box conv0_GoalSubns_12;

  succeeded = mercury__map__search_3_p_0((MR_Word) (&mdbcomp__goal_path__mdbcomp__goal_path__type_ctor_info_goal_id_0), (MR_Word) (&hlds__hlds_goal_scalar_common_1[2]), SubnUpdates_6, ((MR_Box) (GoalId_11)), &conv0_GoalSubns_12);
  if (succeeded)
  {
    GoalSubns_12 = ((MR_Word) (conv0_GoalSubns_12));
    succeeded = MR_TRUE;
  }
  if (succeeded)
  {
    MR_Box conv2_Subn_16;

    mercury__list__foldl_4_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_2[1]), (MR_Word) (&hlds__hlds_goal_scalar_common_2[2]), (MR_Word) (&hlds__hlds_goal_scalar_common_2[5]), GoalSubns_12, ((MR_Box) (Subn0_5)), &conv2_Subn_16);
    Subn_16 = ((MR_Word) (conv2_Subn_16));
  }
  else
    Subn_16 = Subn0_5;
  hlds__hlds_goal__incremental_rename_vars_in_goal_expr_4_p_0(Subn_16, SubnUpdates_6, GoalExpr0_9, &GoalExpr_17);
  hlds__hlds_goal__rename_vars_in_goal_info_4_p_0((MR_Integer) 1, Subn_16, GoalInfo0_10, &GoalInfo_18);
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
    *Goal_8 = base;
    MR_hl_field(0, base, 0) = ((MR_Box) (GoalExpr_17));
    MR_hl_field(0, base, 1) = ((MR_Box) (GoalInfo_18));
  }
}

void MR_CALL 
hlds__hlds_goal__rename_vars_in_goal_expr_4_p_3(
  MR_Word Must_5,
  MR_Word Subn_6,
  MR_Word Expr0_7,
  MR_Word * Expr_8)
{
  MR_Word Attrs_69 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 1))));
  MR_Word Extra0_70 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 5))));
  MR_Word MTRC_71 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 6))));
  MR_Word Impl_72 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 7))));
  MR_Word Extra_73;
  MR_Word Args0_141 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 4))));
  MR_Word Args_142;
  MR_Word PredId_143 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 2))));
  MR_Integer ProcId_144 = ((MR_Integer) ((MR_hl_field(3, Expr0_7, (MR_Integer) 3))));

  hlds__hlds_goal__rename_arg_list_4_p_0(Must_5, Subn_6, Args0_141, &Args_142);
  hlds__hlds_goal__rename_arg_list_4_p_0(Must_5, Subn_6, Extra0_70, &Extra_73);
  {
    MR_Word base;
    base = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL));
    *Expr_8 = base;
    MR_hl_field(3, base, 0) = ((MR_Box) ((MR_Unsigned) 1U));
    MR_hl_field(3, base, 1) = ((MR_Box) (Attrs_69));
    MR_hl_field(3, base, 2) = ((MR_Box) (PredId_143));
    MR_hl_field(3, base, 3) = ((MR_Box) (ProcId_144));
    MR_hl_field(3, base, 4) = ((MR_Box) (Args_142));
    MR_hl_field(3, base, 5) = ((MR_Box) (Extra_73));
    MR_hl_field(3, base, 6) = ((MR_Box) (MTRC_71));
    MR_hl_field(3, base, 7) = ((MR_Box) (Impl_72));
  }
}

void MR_CALL 
hlds__hlds_goal__rename_vars_in_goal_expr_4_p_2(
  MR_Word Must_5,
  MR_Word Subn_6,
  MR_Word Expr0_7,
  MR_Word * Expr_8)
{
  MR_Word GenericCall0_48 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 1))));
  MR_Word Args0_49 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 2))));
  MR_Word Modes_50 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 3))));
  MR_Word MaybeArgRegs_51 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 4))));
  MR_Word Det_52 = ((MR_Unsigned) ((MR_hl_field(3, Expr0_7, (MR_Integer) 5))) & (MR_Integer) 7);
  MR_Word GenericCall_53;
  MR_Word Args_54;

  hlds__hlds_goal__rename_generic_call_4_p_0(Must_5, Subn_6, GenericCall0_48, &GenericCall_53);
  parse_tree__prog_rename__rename_var_list_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Args0_49, &Args_54);
  {
    MR_Word base;
    base = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (6 * sizeof(MR_Word)), NULL, NULL));
    *Expr_8 = base;
    MR_hl_field(3, base, 0) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(3, base, 1) = ((MR_Box) (GenericCall_53));
    MR_hl_field(3, base, 2) = ((MR_Box) (Args_54));
    MR_hl_field(3, base, 3) = ((MR_Box) (Modes_50));
    MR_hl_field(3, base, 4) = ((MR_Box) (MaybeArgRegs_51));
    MR_hl_field(3, base, 5) = (MR_Box) ((MR_Unsigned) (Det_52));
  }
}

void MR_CALL 
hlds__hlds_goal__rename_vars_in_goal_expr_4_p_1(
  MR_Word Must_5,
  MR_Word Subn_6,
  MR_Word Expr0_7,
  MR_Word * Expr_8)
{
  MR_Word PredId_55 = ((MR_Word) ((MR_hl_field(2, Expr0_7, (MR_Integer) 0))));
  MR_Integer ProcId_56 = ((MR_Integer) ((MR_hl_field(2, Expr0_7, (MR_Integer) 1))));
  MR_Word Builtin_57 = ((MR_Unsigned) ((MR_hl_field(2, Expr0_7, (MR_Integer) 3))) & (MR_Integer) 1);
  MR_Word CallUC0_58 = ((MR_Word) ((MR_hl_field(2, Expr0_7, (MR_Integer) 4))));
  MR_Word Sym_59 = ((MR_Word) ((MR_hl_field(2, Expr0_7, (MR_Integer) 5))));
  MR_Word CallUC_60;
  MR_Word Args0_139 = ((MR_Word) ((MR_hl_field(2, Expr0_7, (MR_Integer) 2))));
  MR_Word Args_140;

  hlds__hlds_goal__rename_var_in_call_unify_context_4_p_0(Must_5, Subn_6, CallUC0_58, &CallUC_60);
  parse_tree__prog_rename__rename_var_list_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Args0_139, &Args_140);
  {
    MR_Word base;
    base = (MR_Word) MR_mkword(2, MR_new_object(MR_Word, (6 * sizeof(MR_Word)), NULL, NULL));
    *Expr_8 = base;
    MR_hl_field(2, base, 0) = ((MR_Box) (PredId_55));
    MR_hl_field(2, base, 1) = ((MR_Box) (ProcId_56));
    MR_hl_field(2, base, 2) = ((MR_Box) (Args_140));
    MR_hl_field(2, base, 3) = (MR_Box) ((MR_Unsigned) (Builtin_57));
    MR_hl_field(2, base, 4) = ((MR_Box) (CallUC_60));
    MR_hl_field(2, base, 5) = ((MR_Box) (Sym_59));
  }
}

void MR_CALL 
hlds__hlds_goal__rename_vars_in_goal_expr_4_p_0(
  MR_Word Must_5,
  MR_Word Subn_6,
  MR_Word Expr0_7,
  MR_Word * Expr_8)
{
  MR_Word LHS0_61 = ((MR_Word) ((MR_hl_field(1, Expr0_7, (MR_Integer) 0))));
  MR_Word RHS0_62 = ((MR_Word) ((MR_hl_field(1, Expr0_7, (MR_Integer) 1))));
  MR_Word Mode_63 = ((MR_Word) ((MR_hl_field(1, Expr0_7, (MR_Integer) 2))));
  MR_Word Unify0_64 = ((MR_Word) ((MR_hl_field(1, Expr0_7, (MR_Integer) 3))));
  MR_Word Context_65 = ((MR_Word) ((MR_hl_field(1, Expr0_7, (MR_Integer) 4))));
  MR_Word LHS_66;
  MR_Word RHS_67;
  MR_Word Unify_68;

  parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, LHS0_61, &LHS_66);
  hlds__hlds_goal__rename_var_in_unify_rhs_4_p_0(Must_5, Subn_6, RHS0_62, &RHS_67);
  hlds__hlds_goal__rename_var_in_unify_4_p_0(Must_5, Subn_6, Unify0_64, &Unify_68);
  {
    MR_Word base;
    base = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (5 * sizeof(MR_Word)), NULL, NULL));
    *Expr_8 = base;
    MR_hl_field(1, base, 0) = ((MR_Box) (LHS_66));
    MR_hl_field(1, base, 1) = ((MR_Box) (RHS_67));
    MR_hl_field(1, base, 2) = ((MR_Box) (Mode_63));
    MR_hl_field(1, base, 3) = ((MR_Box) (Unify_68));
    MR_hl_field(1, base, 4) = ((MR_Box) (Context_65));
  }
}

void MR_CALL 
hlds__hlds_goal__must_rename_vars_in_goal_3_p_0(
  MR_Word Subn_4,
  MR_Word Goal0_5,
  MR_Word * Goal_6)
{
  MR_Word GoalExpr0_8 = ((MR_Word) ((MR_hl_field(0, Goal0_5, (MR_Integer) 0))));
  MR_Word GoalInfo0_9 = ((MR_Word) ((MR_hl_field(0, Goal0_5, (MR_Integer) 1))));
  MR_Word GoalExpr_10;
  MR_Word GoalInfo_11;

  hlds__hlds_goal__rename_vars_in_goal_expr_4_p_4((MR_Integer) 0, Subn_4, GoalExpr0_8, &GoalExpr_10);
  hlds__hlds_goal__rename_vars_in_goal_info_4_p_0((MR_Integer) 0, Subn_4, GoalInfo0_9, &GoalInfo_11);
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
    *Goal_6 = base;
    MR_hl_field(0, base, 0) = ((MR_Box) (GoalExpr_10));
    MR_hl_field(0, base, 1) = ((MR_Box) (GoalInfo_11));
  }
}

void MR_CALL 
hlds__hlds_goal__rename_some_vars_in_goal_3_p_0(
  MR_Word Subn_4,
  MR_Word Goal0_5,
  MR_Word * Goal_6)
{
  MR_Word GoalExpr0_8 = ((MR_Word) ((MR_hl_field(0, Goal0_5, (MR_Integer) 0))));
  MR_Word GoalInfo0_9 = ((MR_Word) ((MR_hl_field(0, Goal0_5, (MR_Integer) 1))));
  MR_Word GoalExpr_10;
  MR_Word GoalInfo_11;

  hlds__hlds_goal__rename_vars_in_goal_expr_4_p_4((MR_Integer) 1, Subn_4, GoalExpr0_8, &GoalExpr_10);
  hlds__hlds_goal__rename_vars_in_goal_info_4_p_0((MR_Integer) 1, Subn_4, GoalInfo0_9, &GoalInfo_11);
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
    *Goal_6 = base;
    MR_hl_field(0, base, 0) = ((MR_Box) (GoalExpr_10));
    MR_hl_field(0, base, 1) = ((MR_Box) (GoalInfo_11));
  }
}

static void MR_CALL 
hlds__hlds_goal__rename_var_in_call_unify_context_4_p_0(
  MR_Word Must_5,
  MR_Word Subn_6,
  MR_Word MaybeCallUnifyContext0_7,
  MR_Word * MaybeCallUnifyContext_8)
{
  if ((MaybeCallUnifyContext0_7 == (MR_Word) ((MR_Unsigned) 0U)))
    *MaybeCallUnifyContext_8 = (MR_Word) ((MR_Unsigned) 0U);
  else
  {
    MR_Word CallUnifyContext0_9 = ((MR_Word) ((MR_hl_field(1, MaybeCallUnifyContext0_7, (MR_Integer) 0))));
    MR_Word LHSVar0_10 = ((MR_Word) ((MR_hl_field(0, CallUnifyContext0_9, (MR_Integer) 0))));
    MR_Word RHS0_11 = ((MR_Word) ((MR_hl_field(0, CallUnifyContext0_9, (MR_Integer) 1))));
    MR_Word UnifyContext_12 = ((MR_Word) ((MR_hl_field(0, CallUnifyContext0_9, (MR_Integer) 2))));
    MR_Word LHSVar_13;
    MR_Word RHS_14;
    MR_Word CallUnifyContext_15;

    parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, LHSVar0_10, &LHSVar_13);
    switch (MR_tag((MR_Word) RHS0_11)) {
      default: /*NOTREACHED*/ MR_assert(0);
      case (MR_Integer) 0:
        {
          MR_Word Var0_17 = ((MR_Word) ((MR_hl_field(0, RHS0_11, (MR_Integer) 0))));
          MR_Word Var_18;

          parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Var0_17, &Var_18);
          {
            RHS_14 = (MR_Word) MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL);
            MR_hl_field(0, RHS_14, 0) = ((MR_Box) (Var_18));
          }
        }
        break;
      case (MR_Integer) 1:
        {
          MR_Word Functor_19 = ((MR_Word) ((MR_hl_field(1, RHS0_11, (MR_Integer) 0))));
          MR_Word E_20 = ((MR_Unsigned) ((MR_hl_field(1, RHS0_11, (MR_Integer) 1))) & (MR_Integer) 1);
          MR_Word ArgVars0_21 = ((MR_Word) ((MR_hl_field(1, RHS0_11, (MR_Integer) 2))));
          MR_Word ArgVars_22;

          parse_tree__prog_rename__rename_var_list_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, ArgVars0_21, &ArgVars_22);
          {
            RHS_14 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL));
            MR_hl_field(1, RHS_14, 0) = ((MR_Box) (Functor_19));
            MR_hl_field(1, RHS_14, 1) = (MR_Box) ((MR_Unsigned) (E_20));
            MR_hl_field(1, RHS_14, 2) = ((MR_Box) (ArgVars_22));
          }
        }
        break;
      case (MR_Integer) 2:
        {
          MR_Word NonLocals0_27 = ((MR_Word) ((MR_hl_field(2, RHS0_11, (MR_Integer) 2))));
          MR_Word VarsModes0_28 = ((MR_Word) ((MR_hl_field(2, RHS0_11, (MR_Integer) 3))));
          MR_Word Det_29 = ((MR_Unsigned) ((MR_hl_field(2, RHS0_11, (MR_Integer) 4))) & (MR_Integer) 7);
          MR_Word Goal0_30 = ((MR_Word) ((MR_hl_field(2, RHS0_11, (MR_Integer) 5))));
          MR_Word NonLocals_31;
          MR_Word Vars0_32;
          MR_Word Modes_33;
          MR_Word Vars_34;
          MR_Word VarsModes_35;
          MR_Word Goal_36;
          MR_Word GoalExpr0_42;
          MR_Word GoalInfo0_43;
          MR_Word GoalExpr_44;
          MR_Word GoalInfo_45;
          MR_Unsigned packed_word_1 = (MR_Unsigned) ((MR_hl_field(2, RHS0_11, (MR_Integer) 0)));

          parse_tree__prog_rename__rename_var_list_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, NonLocals0_27, &NonLocals_31);
          mercury__assoc_list__keys_and_values_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), (MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_mer_mode_0), VarsModes0_28, &Vars0_32, &Modes_33);
          parse_tree__prog_rename__rename_var_list_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Vars0_32, &Vars_34);
          mercury__assoc_list__from_corresponding_lists_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), (MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_mer_mode_0), Vars_34, Modes_33, &VarsModes_35);
          GoalExpr0_42 = ((MR_Word) ((MR_hl_field(0, Goal0_30, (MR_Integer) 0))));
          GoalInfo0_43 = ((MR_Word) ((MR_hl_field(0, Goal0_30, (MR_Integer) 1))));
          hlds__hlds_goal__rename_vars_in_goal_expr_4_p_4(Must_5, Subn_6, GoalExpr0_42, &GoalExpr_44);
          hlds__hlds_goal__rename_vars_in_goal_info_4_p_0(Must_5, Subn_6, GoalInfo0_43, &GoalInfo_45);
          {
            Goal_36 = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
            MR_hl_field(0, Goal_36, 0) = ((MR_Box) (GoalExpr_44));
            MR_hl_field(0, Goal_36, 1) = ((MR_Box) (GoalInfo_45));
          }
          {
            RHS_14 = (MR_Word) MR_mkword(2, MR_new_object(MR_Word, (6 * sizeof(MR_Word)), NULL, NULL));
            MR_hl_field(2, RHS_14, 0) = (MR_Box) (packed_word_1);
            MR_hl_field(2, RHS_14, 1) = NULL;
            MR_hl_field(2, RHS_14, 2) = ((MR_Box) (NonLocals_31));
            MR_hl_field(2, RHS_14, 3) = ((MR_Box) (VarsModes_35));
            MR_hl_field(2, RHS_14, 4) = (MR_Box) ((MR_Unsigned) (Det_29));
            MR_hl_field(2, RHS_14, 5) = ((MR_Box) (Goal_36));
          }
        }
        break;
    }
    {
      CallUnifyContext_15 = (MR_Word) MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, CallUnifyContext_15, 0) = ((MR_Box) (LHSVar_13));
      MR_hl_field(0, CallUnifyContext_15, 1) = ((MR_Box) (RHS_14));
      MR_hl_field(0, CallUnifyContext_15, 2) = ((MR_Box) (UnifyContext_12));
    }
    {
      MR_Word base;
      base = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
      *MaybeCallUnifyContext_8 = base;
      MR_hl_field(1, base, 0) = ((MR_Box) (CallUnifyContext_15));
    }
  }
}

static void MR_CALL 
hlds__hlds_goal__rename_var_in_unify_rhs_4_p_0(
  MR_Word Must_5,
  MR_Word Subn_6,
  MR_Word RHS0_7,
  MR_Word * RHS_8)
{
  switch (MR_tag((MR_Word) RHS0_7)) {
    default: /*NOTREACHED*/ MR_assert(0);
    case (MR_Integer) 0:
      {
        MR_Word Var0_9 = ((MR_Word) ((MR_hl_field(0, RHS0_7, (MR_Integer) 0))));
        MR_Word Var_10;

        parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Var0_9, &Var_10);
        {
          MR_Word base;
          base = (MR_Word) MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL);
          *RHS_8 = base;
          MR_hl_field(0, base, 0) = ((MR_Box) (Var_10));
        }
      }
      break;
    case (MR_Integer) 1:
      {
        MR_Word Functor_11 = ((MR_Word) ((MR_hl_field(1, RHS0_7, (MR_Integer) 0))));
        MR_Word E_12 = ((MR_Unsigned) ((MR_hl_field(1, RHS0_7, (MR_Integer) 1))) & (MR_Integer) 1);
        MR_Word ArgVars0_13 = ((MR_Word) ((MR_hl_field(1, RHS0_7, (MR_Integer) 2))));
        MR_Word ArgVars_14;

        parse_tree__prog_rename__rename_var_list_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, ArgVars0_13, &ArgVars_14);
        {
          MR_Word base;
          base = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL));
          *RHS_8 = base;
          MR_hl_field(1, base, 0) = ((MR_Box) (Functor_11));
          MR_hl_field(1, base, 1) = (MR_Box) ((MR_Unsigned) (E_12));
          MR_hl_field(1, base, 2) = ((MR_Box) (ArgVars_14));
        }
      }
      break;
    case (MR_Integer) 2:
      {
        MR_Word NonLocals0_19 = ((MR_Word) ((MR_hl_field(2, RHS0_7, (MR_Integer) 2))));
        MR_Word VarsModes0_20 = ((MR_Word) ((MR_hl_field(2, RHS0_7, (MR_Integer) 3))));
        MR_Word Det_21 = ((MR_Unsigned) ((MR_hl_field(2, RHS0_7, (MR_Integer) 4))) & (MR_Integer) 7);
        MR_Word Goal0_22 = ((MR_Word) ((MR_hl_field(2, RHS0_7, (MR_Integer) 5))));
        MR_Word NonLocals_23;
        MR_Word Vars0_24;
        MR_Word Modes_25;
        MR_Word Vars_26;
        MR_Word VarsModes_27;
        MR_Word Goal_28;
        MR_Word GoalExpr0_34;
        MR_Word GoalInfo0_35;
        MR_Word GoalExpr_36;
        MR_Word GoalInfo_37;
        MR_Unsigned packed_word_1 = (MR_Unsigned) ((MR_hl_field(2, RHS0_7, (MR_Integer) 0)));

        parse_tree__prog_rename__rename_var_list_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, NonLocals0_19, &NonLocals_23);
        mercury__assoc_list__keys_and_values_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), (MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_mer_mode_0), VarsModes0_20, &Vars0_24, &Modes_25);
        parse_tree__prog_rename__rename_var_list_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Vars0_24, &Vars_26);
        mercury__assoc_list__from_corresponding_lists_3_p_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), (MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_mer_mode_0), Vars_26, Modes_25, &VarsModes_27);
        GoalExpr0_34 = ((MR_Word) ((MR_hl_field(0, Goal0_22, (MR_Integer) 0))));
        GoalInfo0_35 = ((MR_Word) ((MR_hl_field(0, Goal0_22, (MR_Integer) 1))));
        hlds__hlds_goal__rename_vars_in_goal_expr_4_p_4(Must_5, Subn_6, GoalExpr0_34, &GoalExpr_36);
        hlds__hlds_goal__rename_vars_in_goal_info_4_p_0(Must_5, Subn_6, GoalInfo0_35, &GoalInfo_37);
        {
          Goal_28 = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
          MR_hl_field(0, Goal_28, 0) = ((MR_Box) (GoalExpr_36));
          MR_hl_field(0, Goal_28, 1) = ((MR_Box) (GoalInfo_37));
        }
        {
          MR_Word base;
          base = (MR_Word) MR_mkword(2, MR_new_object(MR_Word, (6 * sizeof(MR_Word)), NULL, NULL));
          *RHS_8 = base;
          MR_hl_field(2, base, 0) = (MR_Box) (packed_word_1);
          MR_hl_field(2, base, 1) = NULL;
          MR_hl_field(2, base, 2) = ((MR_Box) (NonLocals_23));
          MR_hl_field(2, base, 3) = ((MR_Box) (VarsModes_27));
          MR_hl_field(2, base, 4) = (MR_Box) ((MR_Unsigned) (Det_21));
          MR_hl_field(2, base, 5) = ((MR_Box) (Goal_28));
        }
      }
      break;
  }
}

static void MR_CALL 
hlds__hlds_goal__rename_vars_in_cases_4_p_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3,
  MR_Word * HeadVar__4_4)
{
  if ((HeadVar__3_3 == (MR_Word) ((MR_Unsigned) 0U)))
    *HeadVar__4_4 = (MR_Word) ((MR_Unsigned) 0U);
  else
  {
    MR_Word Case0_9 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 0))));
    MR_Word Cases0_10 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word Case_11;
    MR_Word Cases_12;
    MR_Word MainConsId_13 = ((MR_Word) ((MR_hl_field(0, Case0_9, (MR_Integer) 0))));
    MR_Word OtherConsIds_14 = ((MR_Word) ((MR_hl_field(0, Case0_9, (MR_Integer) 1))));
    MR_Word Goal0_15 = ((MR_Word) ((MR_hl_field(0, Case0_9, (MR_Integer) 2))));
    MR_Word Goal_16;
    MR_Word GoalExpr0_17 = ((MR_Word) ((MR_hl_field(0, Goal0_15, (MR_Integer) 0))));
    MR_Word GoalInfo0_18 = ((MR_Word) ((MR_hl_field(0, Goal0_15, (MR_Integer) 1))));
    MR_Word GoalExpr_19;
    MR_Word GoalInfo_20;

    hlds__hlds_goal__rename_vars_in_goal_expr_4_p_4(HeadVar__1_1, HeadVar__2_2, GoalExpr0_17, &GoalExpr_19);
    hlds__hlds_goal__rename_vars_in_goal_info_4_p_0(HeadVar__1_1, HeadVar__2_2, GoalInfo0_18, &GoalInfo_20);
    {
      Goal_16 = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, Goal_16, 0) = ((MR_Box) (GoalExpr_19));
      MR_hl_field(0, Goal_16, 1) = ((MR_Box) (GoalInfo_20));
    }
    {
      Case_11 = (MR_Word) MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, Case_11, 0) = ((MR_Box) (MainConsId_13));
      MR_hl_field(0, Case_11, 1) = ((MR_Box) (OtherConsIds_14));
      MR_hl_field(0, Case_11, 2) = ((MR_Box) (Goal_16));
    }
    hlds__hlds_goal__rename_vars_in_cases_4_p_0(HeadVar__1_1, HeadVar__2_2, Cases0_10, &Cases_12);
    {
      MR_Word base;
      base = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
      *HeadVar__4_4 = base;
      MR_hl_field(1, base, 0) = ((MR_Box) (Case_11));
      MR_hl_field(1, base, 1) = ((MR_Box) (Cases_12));
    }
  }
}

static void MR_CALL 
hlds__hlds_goal__rename_vars_in_goal_4_p_0(
  MR_Word Must_5,
  MR_Word Subn_6,
  MR_Word Goal0_7,
  MR_Word * Goal_8)
{
  MR_Word GoalExpr0_9 = ((MR_Word) ((MR_hl_field(0, Goal0_7, (MR_Integer) 0))));
  MR_Word GoalInfo0_10 = ((MR_Word) ((MR_hl_field(0, Goal0_7, (MR_Integer) 1))));
  MR_Word GoalExpr_11;
  MR_Word GoalInfo_12;

  hlds__hlds_goal__rename_vars_in_goal_expr_4_p_4(Must_5, Subn_6, GoalExpr0_9, &GoalExpr_11);
  hlds__hlds_goal__rename_vars_in_goal_info_4_p_0(Must_5, Subn_6, GoalInfo0_10, &GoalInfo_12);
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
    *Goal_8 = base;
    MR_hl_field(0, base, 0) = ((MR_Box) (GoalExpr_11));
    MR_hl_field(0, base, 1) = ((MR_Box) (GoalInfo_12));
  }
}

void MR_CALL 
hlds__hlds_goal__rename_vars_in_goal_expr_4_p_4(
  MR_Word Must_5,
  MR_Word Subn_6,
  MR_Word Expr0_7,
  MR_Word * Expr_8)
{
  switch (MR_tag((MR_Word) Expr0_7)) {
    default: /*NOTREACHED*/ MR_assert(0);
    case (MR_Integer) 0:
      {
        MR_Word Goal0_25 = (MR_Word) ((MR_Word) (Expr0_7));
        MR_Word Goal_26;

        hlds__hlds_goal__rename_vars_in_goal_4_p_0(Must_5, Subn_6, Goal0_25, &Goal_26);
        *Expr_8 = (MR_Word) ((MR_Word) (Goal_26));
      }
      break;
    case (MR_Integer) 1:
      {
        MR_Word LHS0_61 = ((MR_Word) ((MR_hl_field(1, Expr0_7, (MR_Integer) 0))));
        MR_Word RHS0_62 = ((MR_Word) ((MR_hl_field(1, Expr0_7, (MR_Integer) 1))));
        MR_Word Mode_63 = ((MR_Word) ((MR_hl_field(1, Expr0_7, (MR_Integer) 2))));
        MR_Word Unify0_64 = ((MR_Word) ((MR_hl_field(1, Expr0_7, (MR_Integer) 3))));
        MR_Word Context_65 = ((MR_Word) ((MR_hl_field(1, Expr0_7, (MR_Integer) 4))));
        MR_Word LHS_66;
        MR_Word RHS_67;
        MR_Word Unify_68;

        parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, LHS0_61, &LHS_66);
        hlds__hlds_goal__rename_var_in_unify_rhs_4_p_0(Must_5, Subn_6, RHS0_62, &RHS_67);
        hlds__hlds_goal__rename_var_in_unify_4_p_0(Must_5, Subn_6, Unify0_64, &Unify_68);
        {
          MR_Word base;
          base = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (5 * sizeof(MR_Word)), NULL, NULL));
          *Expr_8 = base;
          MR_hl_field(1, base, 0) = ((MR_Box) (LHS_66));
          MR_hl_field(1, base, 1) = ((MR_Box) (RHS_67));
          MR_hl_field(1, base, 2) = ((MR_Box) (Mode_63));
          MR_hl_field(1, base, 3) = ((MR_Box) (Unify_68));
          MR_hl_field(1, base, 4) = ((MR_Box) (Context_65));
        }
      }
      break;
    case (MR_Integer) 2:
      {
        MR_Word PredId_55 = ((MR_Word) ((MR_hl_field(2, Expr0_7, (MR_Integer) 0))));
        MR_Integer ProcId_56 = ((MR_Integer) ((MR_hl_field(2, Expr0_7, (MR_Integer) 1))));
        MR_Word Builtin_57 = ((MR_Unsigned) ((MR_hl_field(2, Expr0_7, (MR_Integer) 3))) & (MR_Integer) 1);
        MR_Word CallUC0_58 = ((MR_Word) ((MR_hl_field(2, Expr0_7, (MR_Integer) 4))));
        MR_Word Sym_59 = ((MR_Word) ((MR_hl_field(2, Expr0_7, (MR_Integer) 5))));
        MR_Word CallUC_60;
        MR_Word Args0_139 = ((MR_Word) ((MR_hl_field(2, Expr0_7, (MR_Integer) 2))));
        MR_Word Args_140;

        hlds__hlds_goal__rename_var_in_call_unify_context_4_p_0(Must_5, Subn_6, CallUC0_58, &CallUC_60);
        parse_tree__prog_rename__rename_var_list_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Args0_139, &Args_140);
        {
          MR_Word base;
          base = (MR_Word) MR_mkword(2, MR_new_object(MR_Word, (6 * sizeof(MR_Word)), NULL, NULL));
          *Expr_8 = base;
          MR_hl_field(2, base, 0) = ((MR_Box) (PredId_55));
          MR_hl_field(2, base, 1) = ((MR_Box) (ProcId_56));
          MR_hl_field(2, base, 2) = ((MR_Box) (Args_140));
          MR_hl_field(2, base, 3) = (MR_Box) ((MR_Unsigned) (Builtin_57));
          MR_hl_field(2, base, 4) = ((MR_Box) (CallUC_60));
          MR_hl_field(2, base, 5) = ((MR_Box) (Sym_59));
        }
      }
      break;
    case (MR_Integer) 3:
      switch (((MR_Integer) ((MR_hl_field(3, Expr0_7, (MR_Integer) 0))))) {
        default: /*NOTREACHED*/ MR_assert(0);
        case (MR_Integer) 0:
          {
            MR_Word GenericCall0_48 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 1))));
            MR_Word Args0_49 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 2))));
            MR_Word Modes_50 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 3))));
            MR_Word MaybeArgRegs_51 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 4))));
            MR_Word Det_52 = ((MR_Unsigned) ((MR_hl_field(3, Expr0_7, (MR_Integer) 5))) & (MR_Integer) 7);
            MR_Word GenericCall_53;
            MR_Word Args_54;

            hlds__hlds_goal__rename_generic_call_4_p_0(Must_5, Subn_6, GenericCall0_48, &GenericCall_53);
            parse_tree__prog_rename__rename_var_list_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Args0_49, &Args_54);
            {
              MR_Word base;
              base = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (6 * sizeof(MR_Word)), NULL, NULL));
              *Expr_8 = base;
              MR_hl_field(3, base, 0) = ((MR_Box) ((MR_Unsigned) 0U));
              MR_hl_field(3, base, 1) = ((MR_Box) (GenericCall_53));
              MR_hl_field(3, base, 2) = ((MR_Box) (Args_54));
              MR_hl_field(3, base, 3) = ((MR_Box) (Modes_50));
              MR_hl_field(3, base, 4) = ((MR_Box) (MaybeArgRegs_51));
              MR_hl_field(3, base, 5) = (MR_Box) ((MR_Unsigned) (Det_52));
            }
          }
          break;
        case (MR_Integer) 1:
          {
            MR_Word Attrs_69 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 1))));
            MR_Word Extra0_70 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 5))));
            MR_Word MTRC_71 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 6))));
            MR_Word Impl_72 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 7))));
            MR_Word Extra_73;
            MR_Word Args0_141 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 4))));
            MR_Word Args_142;
            MR_Word PredId_143 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 2))));
            MR_Integer ProcId_144 = ((MR_Integer) ((MR_hl_field(3, Expr0_7, (MR_Integer) 3))));

            hlds__hlds_goal__rename_arg_list_4_p_0(Must_5, Subn_6, Args0_141, &Args_142);
            hlds__hlds_goal__rename_arg_list_4_p_0(Must_5, Subn_6, Extra0_70, &Extra_73);
            {
              MR_Word base;
              base = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL));
              *Expr_8 = base;
              MR_hl_field(3, base, 0) = ((MR_Box) ((MR_Unsigned) 1U));
              MR_hl_field(3, base, 1) = ((MR_Box) (Attrs_69));
              MR_hl_field(3, base, 2) = ((MR_Box) (PredId_143));
              MR_hl_field(3, base, 3) = ((MR_Box) (ProcId_144));
              MR_hl_field(3, base, 4) = ((MR_Box) (Args_142));
              MR_hl_field(3, base, 5) = ((MR_Box) (Extra_73));
              MR_hl_field(3, base, 6) = ((MR_Box) (MTRC_71));
              MR_hl_field(3, base, 7) = ((MR_Box) (Impl_72));
            }
          }
          break;
        case (MR_Integer) 2:
          {
            MR_Word ConjType_9 = ((MR_Unsigned) ((MR_hl_field(3, Expr0_7, (MR_Integer) 1))) & (MR_Integer) 1);
            MR_Word Goals0_10 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 2))));
            MR_Word Goals_11;

            hlds__hlds_goal__rename_vars_in_goals_4_p_0(Must_5, Subn_6, Goals0_10, &Goals_11);
            {
              MR_Word base;
              base = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL));
              *Expr_8 = base;
              MR_hl_field(3, base, 0) = ((MR_Box) ((MR_Unsigned) 2U));
              MR_hl_field(3, base, 1) = (MR_Box) ((MR_Unsigned) (ConjType_9));
              MR_hl_field(3, base, 2) = ((MR_Box) (Goals_11));
            }
          }
          break;
        case (MR_Integer) 3:
          {
            MR_Word Goals0_115 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 1))));
            MR_Word Goals_116;

            hlds__hlds_goal__rename_vars_in_goals_4_p_0(Must_5, Subn_6, Goals0_115, &Goals_116);
            {
              MR_Word base;
              base = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
              *Expr_8 = base;
              MR_hl_field(3, base, 0) = ((MR_Box) ((MR_Unsigned) 3U));
              MR_hl_field(3, base, 1) = ((MR_Box) (Goals_116));
            }
          }
          break;
        case (MR_Integer) 4:
          {
            MR_Word Var0_12 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 1))));
            MR_Word CanFail_13 = ((MR_Unsigned) ((MR_hl_field(3, Expr0_7, (MR_Integer) 2))) & (MR_Integer) 1);
            MR_Word Cases0_14 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 3))));
            MR_Word Var_15;
            MR_Word Cases_16;

            parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Var0_12, &Var_15);
            hlds__hlds_goal__rename_vars_in_cases_4_p_0(Must_5, Subn_6, Cases0_14, &Cases_16);
            {
              MR_Word base;
              base = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (4 * sizeof(MR_Word)), NULL, NULL));
              *Expr_8 = base;
              MR_hl_field(3, base, 0) = ((MR_Box) ((MR_Unsigned) 4U));
              MR_hl_field(3, base, 1) = ((MR_Box) (Var_15));
              MR_hl_field(3, base, 2) = (MR_Box) ((MR_Unsigned) (CanFail_13));
              MR_hl_field(3, base, 3) = ((MR_Box) (Cases_16));
            }
          }
          break;
        case (MR_Integer) 5:
          {
            MR_Word Reason0_27 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 1))));
            MR_Word Reason_29;
            MR_Word Goal0_137 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 2))));
            MR_Word Goal_138;

            switch (MR_tag((MR_Word) Reason0_27)) {
              default: /*NOTREACHED*/ MR_assert(0);
              case (MR_Integer) 0:
                {
                  MR_Word Creator_28 = ((MR_Unsigned) ((MR_hl_field(0, Reason0_27, (MR_Integer) 1))) & (MR_Integer) 1);
                  MR_Word Vars0_117 = ((MR_Word) ((MR_hl_field(0, Reason0_27, (MR_Integer) 0))));
                  MR_Word Vars_118;

                  parse_tree__prog_rename__rename_var_list_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Vars0_117, &Vars_118);
                  {
                    Reason_29 = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
                    MR_hl_field(0, Reason_29, 0) = ((MR_Box) (Vars_118));
                    MR_hl_field(0, Reason_29, 1) = (MR_Box) ((MR_Unsigned) (Creator_28));
                  }
                }
                break;
              case (MR_Integer) 1:
                Reason_29 = Reason0_27;
                break;
              case (MR_Integer) 2:
                {
                  MR_Word Kind_30 = ((MR_Unsigned) ((MR_hl_field(2, Reason0_27, (MR_Integer) 1))) & (MR_Integer) 3);
                  MR_Word Vars0_119 = ((MR_Word) ((MR_hl_field(2, Reason0_27, (MR_Integer) 0))));
                  MR_Word Vars_120;

                  parse_tree__prog_rename__rename_var_list_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Vars0_119, &Vars_120);
                  {
                    Reason_29 = (MR_Word) MR_mkword(2, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
                    MR_hl_field(2, Reason_29, 0) = ((MR_Box) (Vars_120));
                    MR_hl_field(2, Reason_29, 1) = (MR_Box) ((MR_Unsigned) (Kind_30));
                  }
                }
                break;
              case (MR_Integer) 3:
                switch (((MR_Integer) ((MR_hl_field(3, Reason0_27, (MR_Integer) 0))))) {
                  default: /*NOTREACHED*/ MR_assert(0);
                  case (MR_Integer) 0:
                  case (MR_Integer) 1:
                  case (MR_Integer) 4:
                  case (MR_Integer) 5:
                    Reason_29 = Reason0_27;
                    break;
                  case (MR_Integer) 2:
                    {
                      MR_Word Var0_121 = ((MR_Word) ((MR_hl_field(3, Reason0_27, (MR_Integer) 1))));
                      MR_Word Var_122;

                      parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Var0_121, &Var_122);
                      {
                        Reason_29 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
                        MR_hl_field(3, Reason_29, 0) = ((MR_Box) ((MR_Unsigned) 2U));
                        MR_hl_field(3, Reason_29, 1) = ((MR_Box) (Var_122));
                      }
                    }
                    break;
                  case (MR_Integer) 3:
                    {
                      MR_Word Detism_31 = ((MR_Unsigned) ((MR_hl_field(3, Reason0_27, (MR_Integer) 2))) & (MR_Integer) 7);
                      MR_Word Var0_123 = ((MR_Word) ((MR_hl_field(3, Reason0_27, (MR_Integer) 1))));
                      MR_Word Var_124;

                      parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Var0_123, &Var_124);
                      {
                        Reason_29 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL));
                        MR_hl_field(3, Reason_29, 0) = ((MR_Box) ((MR_Unsigned) 3U));
                        MR_hl_field(3, Reason_29, 1) = ((MR_Box) (Var_124));
                        MR_hl_field(3, Reason_29, 2) = (MR_Box) ((MR_Unsigned) (Detism_31));
                      }
                    }
                    break;
                  case (MR_Integer) 6:
                    {
                      MR_Word Var0_125 = ((MR_Word) ((MR_hl_field(3, Reason0_27, (MR_Integer) 1))));
                      MR_Word Var_126;
                      MR_Word Kind_127 = ((MR_Unsigned) ((MR_hl_field(3, Reason0_27, (MR_Integer) 2))) & (MR_Integer) 3);

                      parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Var0_125, &Var_126);
                      {
                        Reason_29 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL));
                        MR_hl_field(3, Reason_29, 0) = ((MR_Box) ((MR_Unsigned) 6U));
                        MR_hl_field(3, Reason_29, 1) = ((MR_Box) (Var_126));
                        MR_hl_field(3, Reason_29, 2) = (MR_Box) ((MR_Unsigned) (Kind_127));
                      }
                    }
                    break;
                  case (MR_Integer) 7:
                    {
                      MR_Word Flag_32 = ((MR_Word) ((MR_hl_field(3, Reason0_27, (MR_Integer) 1))));
                      MR_Word Grade_33 = ((MR_Word) ((MR_hl_field(3, Reason0_27, (MR_Integer) 2))));
                      MR_Word Env_34 = ((MR_Word) ((MR_hl_field(3, Reason0_27, (MR_Integer) 3))));
                      MR_Word QuantVars0_35 = ((MR_Word) ((MR_hl_field(3, Reason0_27, (MR_Integer) 5))));
                      MR_Word QuantVars_36;
                      MR_Word Vars_128 = ((MR_Word) ((MR_hl_field(3, Reason0_27, (MR_Integer) 4))));

                      parse_tree__prog_rename__rename_var_list_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, QuantVars0_35, &QuantVars_36);
                      {
                        Reason_29 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (6 * sizeof(MR_Word)), NULL, NULL));
                        MR_hl_field(3, Reason_29, 0) = ((MR_Box) ((MR_Unsigned) 7U));
                        MR_hl_field(3, Reason_29, 1) = ((MR_Box) (Flag_32));
                        MR_hl_field(3, Reason_29, 2) = ((MR_Box) (Grade_33));
                        MR_hl_field(3, Reason_29, 3) = ((MR_Box) (Env_34));
                        MR_hl_field(3, Reason_29, 4) = ((MR_Box) (Vars_128));
                        MR_hl_field(3, Reason_29, 5) = ((MR_Box) (QuantVars_36));
                      }
                    }
                    break;
                  case (MR_Integer) 8:
                    {
                      MR_Word LCVar0_37 = ((MR_Word) ((MR_hl_field(3, Reason0_27, (MR_Integer) 1))));
                      MR_Word LCSVar0_38 = ((MR_Word) ((MR_hl_field(3, Reason0_27, (MR_Integer) 2))));
                      MR_Word UseParentStack_39 = ((MR_Unsigned) ((MR_hl_field(3, Reason0_27, (MR_Integer) 3))) & (MR_Integer) 1);
                      MR_Word LCVar_40;
                      MR_Word LCSVar_41;

                      parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, LCVar0_37, &LCVar_40);
                      parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, LCSVar0_38, &LCSVar_41);
                      {
                        Reason_29 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (4 * sizeof(MR_Word)), NULL, NULL));
                        MR_hl_field(3, Reason_29, 0) = ((MR_Box) ((MR_Unsigned) 8U));
                        MR_hl_field(3, Reason_29, 1) = ((MR_Box) (LCVar_40));
                        MR_hl_field(3, Reason_29, 2) = ((MR_Box) (LCSVar_41));
                        MR_hl_field(3, Reason_29, 3) = (MR_Box) ((MR_Unsigned) (UseParentStack_39));
                      }
                    }
                    break;
                }
                break;
            }
            hlds__hlds_goal__rename_vars_in_goal_4_p_0(Must_5, Subn_6, Goal0_137, &Goal_138);
            {
              MR_Word base;
              base = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL));
              *Expr_8 = base;
              MR_hl_field(3, base, 0) = ((MR_Box) ((MR_Unsigned) 5U));
              MR_hl_field(3, base, 1) = ((MR_Box) (Reason_29));
              MR_hl_field(3, base, 2) = ((MR_Box) (Goal_138));
            }
          }
          break;
        case (MR_Integer) 6:
          {
            MR_Word Vars0_17 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 1))));
            MR_Word Cond0_18 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 2))));
            MR_Word Then0_19 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 3))));
            MR_Word Else0_20 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 4))));
            MR_Word Vars_21;
            MR_Word Cond_22;
            MR_Word Then_23;
            MR_Word Else_24;

            parse_tree__prog_rename__rename_var_list_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Vars0_17, &Vars_21);
            hlds__hlds_goal__rename_vars_in_goal_4_p_0(Must_5, Subn_6, Cond0_18, &Cond_22);
            hlds__hlds_goal__rename_vars_in_goal_4_p_0(Must_5, Subn_6, Then0_19, &Then_23);
            hlds__hlds_goal__rename_vars_in_goal_4_p_0(Must_5, Subn_6, Else0_20, &Else_24);
            {
              MR_Word base;
              base = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (5 * sizeof(MR_Word)), NULL, NULL));
              *Expr_8 = base;
              MR_hl_field(3, base, 0) = ((MR_Box) ((MR_Unsigned) 6U));
              MR_hl_field(3, base, 1) = ((MR_Box) (Vars_21));
              MR_hl_field(3, base, 2) = ((MR_Box) (Cond_22));
              MR_hl_field(3, base, 3) = ((MR_Box) (Then_23));
              MR_hl_field(3, base, 4) = ((MR_Box) (Else_24));
            }
          }
          break;
        case (MR_Integer) 7:
          {
            MR_Word Shorthand0_74 = ((MR_Word) ((MR_hl_field(3, Expr0_7, (MR_Integer) 1))));
            MR_Word Shorthand_98;

            switch (MR_tag((MR_Word) Shorthand0_74)) {
              default: /*NOTREACHED*/ MR_assert(0);
              case (MR_Integer) 0:
                {
                  MR_Word LeftGoal0_109 = ((MR_Word) ((MR_hl_field(0, Shorthand0_74, (MR_Integer) 0))));
                  MR_Word RightGoal0_110 = ((MR_Word) ((MR_hl_field(0, Shorthand0_74, (MR_Integer) 1))));
                  MR_Word LeftGoal_111;
                  MR_Word RightGoal_112;

                  hlds__hlds_goal__rename_vars_in_goal_4_p_0(Must_5, Subn_6, LeftGoal0_109, &LeftGoal_111);
                  hlds__hlds_goal__rename_vars_in_goal_4_p_0(Must_5, Subn_6, RightGoal0_110, &RightGoal_112);
                  {
                    Shorthand_98 = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
                    MR_hl_field(0, Shorthand_98, 0) = ((MR_Box) (LeftGoal_111));
                    MR_hl_field(0, Shorthand_98, 1) = ((MR_Box) (RightGoal_112));
                  }
                }
                break;
              case (MR_Integer) 1:
                {
                  MR_Word Outer0_76 = ((MR_Word) ((MR_hl_field(1, Shorthand0_74, (MR_Integer) 1))));
                  MR_Word Inner0_77 = ((MR_Word) ((MR_hl_field(1, Shorthand0_74, (MR_Integer) 2))));
                  MR_Word MaybeOutputVars0_78 = ((MR_Word) ((MR_hl_field(1, Shorthand0_74, (MR_Integer) 3))));
                  MR_Word MainGoal0_79 = ((MR_Word) ((MR_hl_field(1, Shorthand0_74, (MR_Integer) 4))));
                  MR_Word OrElseGoals0_80 = ((MR_Word) ((MR_hl_field(1, Shorthand0_74, (MR_Integer) 5))));
                  MR_Word OrElseInners_81 = ((MR_Word) ((MR_hl_field(1, Shorthand0_74, (MR_Integer) 6))));
                  MR_Word GoalType_82 = ((MR_Unsigned) ((MR_hl_field(1, Shorthand0_74, (MR_Integer) 0))) & (MR_Integer) 3);
                  MR_Word OuterDI0_83 = ((MR_Word) ((MR_hl_field(0, Outer0_76, (MR_Integer) 0))));
                  MR_Word OuterUO0_84 = ((MR_Word) ((MR_hl_field(0, Outer0_76, (MR_Integer) 1))));
                  MR_Word OuterDI_85;
                  MR_Word OuterUO_86;
                  MR_Word Outer_87;
                  MR_Word InnerDI0_88;
                  MR_Word InnerUO0_89;
                  MR_Word InnerDI_90;
                  MR_Word InnerUO_91;
                  MR_Word Inner_92;
                  MR_Word MaybeOutputVars_93;
                  MR_Word MainGoal_96;
                  MR_Word OrElseGoals_97;

                  parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, OuterDI0_83, &OuterDI_85);
                  parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, OuterUO0_84, &OuterUO_86);
                  {
                    Outer_87 = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
                    MR_hl_field(0, Outer_87, 0) = ((MR_Box) (OuterDI_85));
                    MR_hl_field(0, Outer_87, 1) = ((MR_Box) (OuterUO_86));
                  }
                  InnerDI0_88 = ((MR_Word) ((MR_hl_field(0, Inner0_77, (MR_Integer) 0))));
                  InnerUO0_89 = ((MR_Word) ((MR_hl_field(0, Inner0_77, (MR_Integer) 1))));
                  parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, InnerDI0_88, &InnerDI_90);
                  parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, InnerUO0_89, &InnerUO_91);
                  {
                    Inner_92 = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
                    MR_hl_field(0, Inner_92, 0) = ((MR_Box) (InnerDI_90));
                    MR_hl_field(0, Inner_92, 1) = ((MR_Box) (InnerUO_91));
                  }
                  if ((MaybeOutputVars0_78 == (MR_Word) ((MR_Unsigned) 0U)))
                    MaybeOutputVars_93 = MaybeOutputVars0_78;
                  else
                  {
                    MR_Word OutputVars0_94 = ((MR_Word) ((MR_hl_field(1, MaybeOutputVars0_78, (MR_Integer) 0))));
                    MR_Word OutputVars_95;

                    parse_tree__prog_rename__rename_var_list_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, OutputVars0_94, &OutputVars_95);
                    {
                      MaybeOutputVars_93 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
                      MR_hl_field(1, MaybeOutputVars_93, 0) = ((MR_Box) (OutputVars_95));
                    }
                  }
                  hlds__hlds_goal__rename_vars_in_goal_4_p_0(Must_5, Subn_6, MainGoal0_79, &MainGoal_96);
                  hlds__hlds_goal__rename_vars_in_goals_4_p_0(Must_5, Subn_6, OrElseGoals0_80, &OrElseGoals_97);
                  {
                    Shorthand_98 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL));
                    MR_hl_field(1, Shorthand_98, 0) = (MR_Box) ((MR_Unsigned) (GoalType_82));
                    MR_hl_field(1, Shorthand_98, 1) = ((MR_Box) (Outer_87));
                    MR_hl_field(1, Shorthand_98, 2) = ((MR_Box) (Inner_92));
                    MR_hl_field(1, Shorthand_98, 3) = ((MR_Box) (MaybeOutputVars_93));
                    MR_hl_field(1, Shorthand_98, 4) = ((MR_Box) (MainGoal_96));
                    MR_hl_field(1, Shorthand_98, 5) = ((MR_Box) (OrElseGoals_97));
                    MR_hl_field(1, Shorthand_98, 6) = ((MR_Box) (OrElseInners_81));
                  }
                }
                break;
              case (MR_Integer) 2:
                {
                  MR_Word MaybeIO0_99 = ((MR_Word) ((MR_hl_field(2, Shorthand0_74, (MR_Integer) 0))));
                  MR_Word ResultVar0_100 = ((MR_Word) ((MR_hl_field(2, Shorthand0_74, (MR_Integer) 1))));
                  MR_Word SubGoal0_101 = ((MR_Word) ((MR_hl_field(2, Shorthand0_74, (MR_Integer) 2))));
                  MR_Word MaybeIO_106;
                  MR_Word ResultVar_107;
                  MR_Word SubGoal_108;

                  if ((MaybeIO0_99 == (MR_Word) ((MR_Unsigned) 0U)))
                    MaybeIO_106 = (MR_Word) ((MR_Unsigned) 0U);
                  else
                  {
                    MR_Word IOVarInitial0_102;
                    MR_Word IOVarFinal0_103;
                    MR_Word IOVarInitial_104;
                    MR_Word IOVarFinal_105;
                    MR_Word Var_113 = ((MR_Word) ((MR_hl_field(1, MaybeIO0_99, (MR_Integer) 0))));
                    MR_Word Var_114;

                    IOVarInitial0_102 = ((MR_Word) ((MR_hl_field(0, Var_113, (MR_Integer) 0))));
                    IOVarFinal0_103 = ((MR_Word) ((MR_hl_field(0, Var_113, (MR_Integer) 1))));
                    parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, IOVarInitial0_102, &IOVarInitial_104);
                    parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, IOVarFinal0_103, &IOVarFinal_105);
                    {
                      Var_114 = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
                      MR_hl_field(0, Var_114, 0) = ((MR_Box) (IOVarInitial_104));
                      MR_hl_field(0, Var_114, 1) = ((MR_Box) (IOVarFinal_105));
                    }
                    {
                      MaybeIO_106 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
                      MR_hl_field(1, MaybeIO_106, 0) = ((MR_Box) (Var_114));
                    }
                  }
                  parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, ResultVar0_100, &ResultVar_107);
                  hlds__hlds_goal__rename_vars_in_goal_4_p_0(Must_5, Subn_6, SubGoal0_101, &SubGoal_108);
                  {
                    Shorthand_98 = (MR_Word) MR_mkword(2, MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL));
                    MR_hl_field(2, Shorthand_98, 0) = ((MR_Box) (MaybeIO_106));
                    MR_hl_field(2, Shorthand_98, 1) = ((MR_Box) (ResultVar_107));
                    MR_hl_field(2, Shorthand_98, 2) = ((MR_Box) (SubGoal_108));
                  }
                }
                break;
            }
            {
              MR_Word base;
              base = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
              *Expr_8 = base;
              MR_hl_field(3, base, 0) = ((MR_Box) ((MR_Unsigned) 7U));
              MR_hl_field(3, base, 1) = ((MR_Box) (Shorthand_98));
            }
          }
          break;
      }
      break;
  }
}

void MR_CALL 
hlds__hlds_goal__rename_vars_in_goals_4_p_0(
  MR_Word Must_1,
  MR_Word Subn_2,
  MR_Word HeadVar__3_3,
  MR_Word * HeadVar__4_4)
{
  if ((HeadVar__3_3 == (MR_Word) ((MR_Unsigned) 0U)))
    *HeadVar__4_4 = (MR_Word) ((MR_Unsigned) 0U);
  else
  {
    MR_Word Goal0_9 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 0))));
    MR_Word Goals0_10 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word Goal_11;
    MR_Word Goals_12;
    MR_Word GoalExpr0_13 = ((MR_Word) ((MR_hl_field(0, Goal0_9, (MR_Integer) 0))));
    MR_Word GoalInfo0_14 = ((MR_Word) ((MR_hl_field(0, Goal0_9, (MR_Integer) 1))));
    MR_Word GoalExpr_15;
    MR_Word GoalInfo_16;

    hlds__hlds_goal__rename_vars_in_goal_expr_4_p_4(Must_1, Subn_2, GoalExpr0_13, &GoalExpr_15);
    hlds__hlds_goal__rename_vars_in_goal_info_4_p_0(Must_1, Subn_2, GoalInfo0_14, &GoalInfo_16);
    {
      Goal_11 = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, Goal_11, 0) = ((MR_Box) (GoalExpr_15));
      MR_hl_field(0, Goal_11, 1) = ((MR_Box) (GoalInfo_16));
    }
    hlds__hlds_goal__rename_vars_in_goals_4_p_0(Must_1, Subn_2, Goals0_10, &Goals_12);
    {
      MR_Word base;
      base = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
      *HeadVar__4_4 = base;
      MR_hl_field(1, base, 0) = ((MR_Box) (Goal_11));
      MR_hl_field(1, base, 1) = ((MR_Box) (Goals_12));
    }
  }
}

static void MR_CALL 
hlds__hlds_goal__rename_generic_call_4_p_0(
  MR_Word Must_5,
  MR_Word Subn_6,
  MR_Word Call0_7,
  MR_Word * Call_8)
{
  switch (MR_tag((MR_Word) Call0_7)) {
    default: /*NOTREACHED*/ MR_assert(0);
    case (MR_Integer) 0:
      {
        MR_Word Var0_9 = ((MR_Word) ((MR_hl_field(0, Call0_7, (MR_Integer) 0))));
        MR_Word Arity_12 = ((MR_Word) ((MR_hl_field(0, Call0_7, (MR_Integer) 2))));
        MR_Word Var_13;
        MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, Call0_7, (MR_Integer) 1)));

        parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Var0_9, &Var_13);
        {
          MR_Word base;
          base = (MR_Word) MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL);
          *Call_8 = base;
          MR_hl_field(0, base, 0) = ((MR_Box) (Var_13));
          MR_hl_field(0, base, 1) = (MR_Box) (packed_word_0);
          MR_hl_field(0, base, 2) = ((MR_Box) (Arity_12));
        }
      }
      break;
    case (MR_Integer) 1:
      {
        MR_Word Method_14 = ((MR_Word) ((MR_hl_field(1, Call0_7, (MR_Integer) 1))));
        MR_Word ClassId_15 = ((MR_Word) ((MR_hl_field(1, Call0_7, (MR_Integer) 2))));
        MR_Word MethodId_16 = ((MR_Word) ((MR_hl_field(1, Call0_7, (MR_Integer) 3))));
        MR_Word Var0_19 = ((MR_Word) ((MR_hl_field(1, Call0_7, (MR_Integer) 0))));
        MR_Word Var_20;

        parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Var0_19, &Var_20);
        {
          MR_Word base;
          base = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (4 * sizeof(MR_Word)), NULL, NULL));
          *Call_8 = base;
          MR_hl_field(1, base, 0) = ((MR_Box) (Var_20));
          MR_hl_field(1, base, 1) = ((MR_Box) (Method_14));
          MR_hl_field(1, base, 2) = ((MR_Box) (ClassId_15));
          MR_hl_field(1, base, 3) = ((MR_Box) (MethodId_16));
        }
      }
      break;
    case (MR_Integer) 2:
    case (MR_Integer) 3:
      *Call_8 = Call0_7;
      break;
  }
}

static void MR_CALL 
hlds__hlds_goal__rename_var_in_unify_4_p_0(
  MR_Word Must_5,
  MR_Word Subn_6,
  MR_Word Unify0_7,
  MR_Word * Unify_8)
{
  switch (MR_tag((MR_Word) Unify0_7)) {
    default: /*NOTREACHED*/ MR_assert(0);
    case (MR_Integer) 0:
      {
        MR_Word Var0_9 = ((MR_Word) ((MR_hl_field(0, Unify0_7, (MR_Integer) 0))));
        MR_Word ConsId_10 = ((MR_Word) ((MR_hl_field(0, Unify0_7, (MR_Integer) 1))));
        MR_Word Vars0_11 = ((MR_Word) ((MR_hl_field(0, Unify0_7, (MR_Integer) 2))));
        MR_Word Modes_12 = ((MR_Word) ((MR_hl_field(0, Unify0_7, (MR_Integer) 3))));
        MR_Word How0_13 = ((MR_Word) ((MR_hl_field(0, Unify0_7, (MR_Integer) 4))));
        MR_Word Uniq_14 = ((MR_Unsigned) ((MR_hl_field(0, Unify0_7, (MR_Integer) 5))) & (MR_Integer) 1);
        MR_Word SubInfo0_15 = ((MR_Word) ((MR_hl_field(0, Unify0_7, (MR_Integer) 6))));
        MR_Word Var_16;
        MR_Word Vars_17;
        MR_Word How_18;
        MR_Word SubInfo_34;

        parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Var0_9, &Var_16);
        parse_tree__prog_rename__rename_var_list_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Vars0_11, &Vars_17);
        switch (MR_tag((MR_Word) How0_13)) {
          default: /*NOTREACHED*/ MR_assert(0);
          case (MR_Integer) 0:
            How_18 = How0_13;
            break;
          case (MR_Integer) 1:
            {
              MR_Word ReuseVar0_20;
              MR_Word B_21;
              MR_Word C_22;
              MR_Word ReuseVar_23;
              MR_Word Var_43 = (MR_Word) (MR_body((MR_Word) (How0_13), (MR_Integer) 1));
              MR_Word Var_44;

              ReuseVar0_20 = ((MR_Word) ((MR_hl_field(0, Var_43, (MR_Integer) 0))));
              B_21 = ((MR_Word) ((MR_hl_field(0, Var_43, (MR_Integer) 1))));
              C_22 = ((MR_Word) ((MR_hl_field(0, Var_43, (MR_Integer) 2))));
              parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, ReuseVar0_20, &ReuseVar_23);
              {
                Var_44 = (MR_Word) MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL);
                MR_hl_field(0, Var_44, 0) = ((MR_Box) (ReuseVar_23));
                MR_hl_field(0, Var_44, 1) = ((MR_Box) (B_21));
                MR_hl_field(0, Var_44, 2) = ((MR_Box) (C_22));
              }
              How_18 = (MR_Word) (MR_mkword(1, (MR_Word) (Var_44)));
            }
            break;
          case (MR_Integer) 2:
            How_18 = How0_13;
            break;
          case (MR_Integer) 3:
            {
              MR_Word RegVar0_24 = ((MR_Word) ((MR_hl_field(3, How0_13, (MR_Integer) 0))));
              MR_Word RegVar_25;

              parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, RegVar0_24, &RegVar_25);
              {
                How_18 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
                MR_hl_field(3, How_18, 0) = ((MR_Box) (RegVar_25));
              }
            }
            break;
        }
        if ((SubInfo0_15 == (MR_Word) ((MR_Unsigned) 0U)))
          SubInfo_34 = (MR_Word) ((MR_Unsigned) 0U);
        else
        {
          MR_Word MTA_26 = ((MR_Word) ((MR_hl_field(1, SubInfo0_15, (MR_Integer) 0))));
          MR_Word MaybeSize0_27 = ((MR_Word) ((MR_hl_field(1, SubInfo0_15, (MR_Integer) 1))));
          MR_Word MaybeSize_28;

          if ((MaybeSize0_27 == (MR_Word) ((MR_Unsigned) 0U)))
            MaybeSize_28 = (MR_Word) ((MR_Unsigned) 0U);
          else
          {
            MR_Word Size0_29 = ((MR_Word) ((MR_hl_field(1, MaybeSize0_27, (MR_Integer) 0))));
            MR_Word Size_31;

            if (((MR_tag((MR_Word) Size0_29)) == (MR_Integer) 1))
            {
              MR_Word SizeVar0_32 = ((MR_Word) ((MR_hl_field(1, Size0_29, (MR_Integer) 0))));
              MR_Word SizeVar_33;

              parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, SizeVar0_32, &SizeVar_33);
              {
                Size_31 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
                MR_hl_field(1, Size_31, 0) = ((MR_Box) (SizeVar_33));
              }
            }
            else
              Size_31 = Size0_29;
            {
              MaybeSize_28 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
              MR_hl_field(1, MaybeSize_28, 0) = ((MR_Box) (Size_31));
            }
          }
          {
            SubInfo_34 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
            MR_hl_field(1, SubInfo_34, 0) = ((MR_Box) (MTA_26));
            MR_hl_field(1, SubInfo_34, 1) = ((MR_Box) (MaybeSize_28));
          }
        }
        {
          MR_Word base;
          base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
          *Unify_8 = base;
          MR_hl_field(0, base, 0) = ((MR_Box) (Var_16));
          MR_hl_field(0, base, 1) = ((MR_Box) (ConsId_10));
          MR_hl_field(0, base, 2) = ((MR_Box) (Vars_17));
          MR_hl_field(0, base, 3) = ((MR_Box) (Modes_12));
          MR_hl_field(0, base, 4) = ((MR_Box) (How_18));
          MR_hl_field(0, base, 5) = (MR_Box) ((MR_Unsigned) (Uniq_14));
          MR_hl_field(0, base, 6) = ((MR_Box) (SubInfo_34));
        }
      }
      break;
    case (MR_Integer) 1:
      {
        MR_Word Var0_45 = ((MR_Word) ((MR_hl_field(1, Unify0_7, (MR_Integer) 0))));
        MR_Word ConsId_46 = ((MR_Word) ((MR_hl_field(1, Unify0_7, (MR_Integer) 1))));
        MR_Word Vars0_47 = ((MR_Word) ((MR_hl_field(1, Unify0_7, (MR_Integer) 2))));
        MR_Word Modes_48 = ((MR_Word) ((MR_hl_field(1, Unify0_7, (MR_Integer) 3))));
        MR_Word Var_49;
        MR_Word Vars_50;
        MR_Unsigned packed_word_2 = (MR_Unsigned) ((MR_hl_field(1, Unify0_7, (MR_Integer) 4)));

        parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Var0_45, &Var_49);
        parse_tree__prog_rename__rename_var_list_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Vars0_47, &Vars_50);
        {
          MR_Word base;
          base = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (5 * sizeof(MR_Word)), NULL, NULL));
          *Unify_8 = base;
          MR_hl_field(1, base, 0) = ((MR_Box) (Var_49));
          MR_hl_field(1, base, 1) = ((MR_Box) (ConsId_46));
          MR_hl_field(1, base, 2) = ((MR_Box) (Vars_50));
          MR_hl_field(1, base, 3) = ((MR_Box) (Modes_48));
          MR_hl_field(1, base, 4) = (MR_Box) (packed_word_2);
        }
      }
      break;
    case (MR_Integer) 2:
      {
        MR_Word L0_37 = ((MR_Word) ((MR_hl_field(2, Unify0_7, (MR_Integer) 0))));
        MR_Word R0_38 = ((MR_Word) ((MR_hl_field(2, Unify0_7, (MR_Integer) 1))));
        MR_Word L_39;
        MR_Word R_40;

        parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, L0_37, &L_39);
        parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, R0_38, &R_40);
        {
          MR_Word base;
          base = (MR_Word) MR_mkword(2, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
          *Unify_8 = base;
          MR_hl_field(2, base, 0) = ((MR_Box) (L_39));
          MR_hl_field(2, base, 1) = ((MR_Box) (R_40));
        }
      }
      break;
    case (MR_Integer) 3:
      switch (((MR_Integer) ((MR_hl_field(3, Unify0_7, (MR_Integer) 0))))) {
        default: /*NOTREACHED*/ MR_assert(0);
        case (MR_Integer) 0:
          {
            MR_Word L0_51 = ((MR_Word) ((MR_hl_field(3, Unify0_7, (MR_Integer) 1))));
            MR_Word R0_52 = ((MR_Word) ((MR_hl_field(3, Unify0_7, (MR_Integer) 2))));
            MR_Word L_53;
            MR_Word R_54;

            parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, L0_51, &L_53);
            parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, R0_52, &R_54);
            {
              MR_Word base;
              base = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL));
              *Unify_8 = base;
              MR_hl_field(3, base, 0) = ((MR_Box) ((MR_Unsigned) 0U));
              MR_hl_field(3, base, 1) = ((MR_Box) (L_53));
              MR_hl_field(3, base, 2) = ((MR_Box) (R_54));
            }
          }
          break;
        case (MR_Integer) 1:
          {
            MR_Word TypeInfoVars0_41 = ((MR_Word) ((MR_hl_field(3, Unify0_7, (MR_Integer) 3))));
            MR_Word TypeInfoVars_42;
            MR_Word Modes_55 = ((MR_Word) ((MR_hl_field(3, Unify0_7, (MR_Integer) 1))));
            MR_Word Cat_56 = ((MR_Unsigned) ((MR_hl_field(3, Unify0_7, (MR_Integer) 2))) & (MR_Integer) 1);

            parse_tree__prog_rename__rename_var_list_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, TypeInfoVars0_41, &TypeInfoVars_42);
            {
              MR_Word base;
              base = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (4 * sizeof(MR_Word)), NULL, NULL));
              *Unify_8 = base;
              MR_hl_field(3, base, 0) = ((MR_Box) ((MR_Unsigned) 1U));
              MR_hl_field(3, base, 1) = ((MR_Box) (Modes_55));
              MR_hl_field(3, base, 2) = (MR_Box) ((MR_Unsigned) (Cat_56));
              MR_hl_field(3, base, 3) = ((MR_Box) (TypeInfoVars_42));
            }
          }
          break;
      }
      break;
  }
}

static void MR_CALL 
hlds__hlds_goal__rename_arg_list_4_p_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2,
  MR_Word HeadVar__3_3,
  MR_Word * HeadVar__4_4)
{
  if ((HeadVar__3_3 == (MR_Word) ((MR_Unsigned) 0U)))
    *HeadVar__4_4 = (MR_Word) ((MR_Unsigned) 0U);
  else
  {
    MR_Word Arg0_9 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 0))));
    MR_Word Args0_10 = ((MR_Word) ((MR_hl_field(1, HeadVar__3_3, (MR_Integer) 1))));
    MR_Word Arg_11;
    MR_Word Args_12;
    MR_Word Var0_13 = ((MR_Word) ((MR_hl_field(0, Arg0_9, (MR_Integer) 0))));
    MR_Word B_14 = ((MR_Word) ((MR_hl_field(0, Arg0_9, (MR_Integer) 1))));
    MR_Word C_15 = ((MR_Word) ((MR_hl_field(0, Arg0_9, (MR_Integer) 2))));
    MR_Word D_16 = ((MR_Unsigned) ((MR_hl_field(0, Arg0_9, (MR_Integer) 3))) & (MR_Integer) 1);
    MR_Word Var_17;

    parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), HeadVar__1_1, HeadVar__2_2, Var0_13, &Var_17);
    {
      Arg_11 = (MR_Word) MR_new_object(MR_Word, (4 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, Arg_11, 0) = ((MR_Box) (Var_17));
      MR_hl_field(0, Arg_11, 1) = ((MR_Box) (B_14));
      MR_hl_field(0, Arg_11, 2) = ((MR_Box) (C_15));
      MR_hl_field(0, Arg_11, 3) = (MR_Box) ((MR_Unsigned) (D_16));
    }
    hlds__hlds_goal__rename_arg_list_4_p_0(HeadVar__1_1, HeadVar__2_2, Args0_10, &Args_12);
    {
      MR_Word base;
      base = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
      *HeadVar__4_4 = base;
      MR_hl_field(1, base, 0) = ((MR_Box) (Arg_11));
      MR_hl_field(1, base, 1) = ((MR_Box) (Args_12));
    }
  }
}

void MR_CALL 
hlds__hlds_goal__rename_vars_in_goal_info_4_p_0(
  MR_Word Must_5,
  MR_Word Subn_6,
  MR_Word STATE_VARIABLE_GoalInfo_0_70,
  MR_Word * STATE_VARIABLE_GoalInfo_71)
{
  MR_Word InstMapDelta0_10 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_70, (MR_Integer) 1))));
  MR_Word NonLocals0_11 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_70, (MR_Integer) 2))));
  MR_Word Features_12 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_70, (MR_Integer) 3))));
  MR_Word GoalPath_13 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_70, (MR_Integer) 4))));
  MR_Word CodeGenInfo0_14 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_70, (MR_Integer) 5))));
  MR_Word ExtraInfo0_15 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_70, (MR_Integer) 6))));
  MR_Word NonLocals_16;
  MR_Word InstMapDelta_17;
  MR_Word CodeGenInfo_18;
  MR_Word Context_21;
  MR_Word RevGoalPath_22;
  MR_Word HO_Values_23;
  MR_Word GoalMode0_24;
  MR_Word MaybeCTGC0_25;
  MR_Word MaybeRBMM0_26;
  MR_Word MaybeMCI0_27;
  MR_Word GoalMode_29;
  MR_Word MaybeCTGC_30;
  MR_Word MaybeRBMM_42;
  MR_Word MaybeMCI_55;
  MR_Word MaybeDPInfo_68;
  MR_Word ExtraInfo_69;
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_70, (MR_Integer) 0)));

  parse_tree__prog_rename__rename_vars_in_set_of_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, NonLocals0_11, &NonLocals_16);
  hlds__instmap__instmap_delta_apply_sub_4_p_0(Must_5, Subn_6, InstMapDelta0_10, &InstMapDelta_17);
  if ((CodeGenInfo0_14 == (MR_Word) ((MR_Unsigned) 0U)))
    CodeGenInfo_18 = (MR_Word) ((MR_Unsigned) 0U);
  else
  {
    MR_Word LldsInfo0_19 = ((MR_Word) ((MR_hl_field(1, CodeGenInfo0_14, (MR_Integer) 0))));
    MR_Word LldsInfo_20;

    hlds__hlds_llds__rename_vars_in_llds_code_gen_info_4_p_0(Must_5, Subn_6, LldsInfo0_19, &LldsInfo_20);
    {
      CodeGenInfo_18 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
      MR_hl_field(1, CodeGenInfo_18, 0) = ((MR_Box) (LldsInfo_20));
    }
  }
  Context_21 = ((MR_Word) ((MR_hl_field(0, ExtraInfo0_15, (MR_Integer) 0))));
  RevGoalPath_22 = ((MR_Word) ((MR_hl_field(0, ExtraInfo0_15, (MR_Integer) 1))));
  HO_Values_23 = ((MR_Word) ((MR_hl_field(0, ExtraInfo0_15, (MR_Integer) 2))));
  GoalMode0_24 = ((MR_Word) ((MR_hl_field(0, ExtraInfo0_15, (MR_Integer) 3))));
  MaybeCTGC0_25 = ((MR_Word) ((MR_hl_field(0, ExtraInfo0_15, (MR_Integer) 4))));
  MaybeRBMM0_26 = ((MR_Word) ((MR_hl_field(0, ExtraInfo0_15, (MR_Integer) 5))));
  MaybeMCI0_27 = ((MR_Word) ((MR_hl_field(0, ExtraInfo0_15, (MR_Integer) 6))));
  MaybeDPInfo_68 = ((MR_Word) ((MR_hl_field(0, ExtraInfo0_15, (MR_Integer) 7))));
  hlds__goal_mode__rename_vars_in_goal_mode_4_p_0(Must_5, Subn_6, GoalMode0_24, &GoalMode_29);
  if ((MaybeCTGC0_25 == (MR_Word) ((MR_Unsigned) 0U)))
    MaybeCTGC_30 = (MR_Word) ((MR_Unsigned) 0U);
  else
  {
    MR_Word CTGC0_31 = ((MR_Word) ((MR_hl_field(1, MaybeCTGC0_25, (MR_Integer) 0))));
    MR_Word ForwardUse0_32 = ((MR_Word) ((MR_hl_field(0, CTGC0_31, (MR_Integer) 0))));
    MR_Word BackwardUse0_33 = ((MR_Word) ((MR_hl_field(0, CTGC0_31, (MR_Integer) 1))));
    MR_Word ReuseDesc0_34 = ((MR_Word) ((MR_hl_field(0, CTGC0_31, (MR_Integer) 2))));
    MR_Word ForwardUse_35;
    MR_Word BackwardUse_36;
    MR_Word ReuseDesc_38;
    MR_Word CTGC_41;

    parse_tree__prog_rename__rename_vars_in_set_of_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, ForwardUse0_32, &ForwardUse_35);
    parse_tree__prog_rename__rename_vars_in_set_of_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, BackwardUse0_33, &BackwardUse_36);
    switch (MR_tag((MR_Word) ReuseDesc0_34)) {
      default: /*NOTREACHED*/ MR_assert(0);
      case (MR_Integer) 0:
        ReuseDesc_38 = ReuseDesc0_34;
        break;
      case (MR_Integer) 1:
        ReuseDesc_38 = ReuseDesc0_34;
        break;
      case (MR_Integer) 2:
        {
          MR_Word ShortReuseDesc0_39 = ((MR_Word) ((MR_hl_field(2, ReuseDesc0_34, (MR_Integer) 0))));
          MR_Word ShortReuseDesc_40;

          switch (MR_tag((MR_Word) ShortReuseDesc0_39)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              ShortReuseDesc_40 = ShortReuseDesc0_39;
              break;
            case (MR_Integer) 1:
              {
                MR_Word DeadVar0_78 = ((MR_Word) ((MR_hl_field(1, ShortReuseDesc0_39, (MR_Integer) 0))));
                MR_Word IsCond_79 = ((MR_Unsigned) ((MR_hl_field(1, ShortReuseDesc0_39, (MR_Integer) 1))) & (MR_Integer) 1);
                MR_Word ConsIds_80 = ((MR_Word) ((MR_hl_field(1, ShortReuseDesc0_39, (MR_Integer) 2))));
                MR_Word FieldNeedUpdates_81 = ((MR_Word) ((MR_hl_field(1, ShortReuseDesc0_39, (MR_Integer) 3))));
                MR_Word DeadVar_82;

                parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, DeadVar0_78, &DeadVar_82);
                {
                  ShortReuseDesc_40 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (4 * sizeof(MR_Word)), NULL, NULL));
                  MR_hl_field(1, ShortReuseDesc_40, 0) = ((MR_Box) (DeadVar_82));
                  MR_hl_field(1, ShortReuseDesc_40, 1) = (MR_Box) ((MR_Unsigned) (IsCond_79));
                  MR_hl_field(1, ShortReuseDesc_40, 2) = ((MR_Box) (ConsIds_80));
                  MR_hl_field(1, ShortReuseDesc_40, 3) = ((MR_Box) (FieldNeedUpdates_81));
                }
              }
              break;
            case (MR_Integer) 2:
              ShortReuseDesc_40 = ShortReuseDesc0_39;
              break;
          }
          {
            ReuseDesc_38 = (MR_Word) MR_mkword(2, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
            MR_hl_field(2, ReuseDesc_38, 0) = ((MR_Box) (ShortReuseDesc_40));
          }
        }
        break;
      case (MR_Integer) 3:
        {
          MR_Word ShortReuseDesc0_73 = ((MR_Word) ((MR_hl_field(3, ReuseDesc0_34, (MR_Integer) 0))));
          MR_Word ShortReuseDesc_74;

          switch (MR_tag((MR_Word) ShortReuseDesc0_73)) {
            default: /*NOTREACHED*/ MR_assert(0);
            case (MR_Integer) 0:
              ShortReuseDesc_74 = ShortReuseDesc0_73;
              break;
            case (MR_Integer) 1:
              {
                MR_Word DeadVar0_86 = ((MR_Word) ((MR_hl_field(1, ShortReuseDesc0_73, (MR_Integer) 0))));
                MR_Word IsCond_87 = ((MR_Unsigned) ((MR_hl_field(1, ShortReuseDesc0_73, (MR_Integer) 1))) & (MR_Integer) 1);
                MR_Word ConsIds_88 = ((MR_Word) ((MR_hl_field(1, ShortReuseDesc0_73, (MR_Integer) 2))));
                MR_Word FieldNeedUpdates_89 = ((MR_Word) ((MR_hl_field(1, ShortReuseDesc0_73, (MR_Integer) 3))));
                MR_Word DeadVar_90;

                parse_tree__prog_rename__rename_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, DeadVar0_86, &DeadVar_90);
                {
                  ShortReuseDesc_74 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (4 * sizeof(MR_Word)), NULL, NULL));
                  MR_hl_field(1, ShortReuseDesc_74, 0) = ((MR_Box) (DeadVar_90));
                  MR_hl_field(1, ShortReuseDesc_74, 1) = (MR_Box) ((MR_Unsigned) (IsCond_87));
                  MR_hl_field(1, ShortReuseDesc_74, 2) = ((MR_Box) (ConsIds_88));
                  MR_hl_field(1, ShortReuseDesc_74, 3) = ((MR_Box) (FieldNeedUpdates_89));
                }
              }
              break;
            case (MR_Integer) 2:
              ShortReuseDesc_74 = ShortReuseDesc0_73;
              break;
          }
          {
            ReuseDesc_38 = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
            MR_hl_field(3, ReuseDesc_38, 0) = ((MR_Box) (ShortReuseDesc_74));
          }
        }
        break;
    }
    {
      CTGC_41 = (MR_Word) MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, CTGC_41, 0) = ((MR_Box) (ForwardUse_35));
      MR_hl_field(0, CTGC_41, 1) = ((MR_Box) (BackwardUse_36));
      MR_hl_field(0, CTGC_41, 2) = ((MR_Box) (ReuseDesc_38));
    }
    {
      MaybeCTGC_30 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
      MR_hl_field(1, MaybeCTGC_30, 0) = ((MR_Box) (CTGC_41));
    }
  }
  if ((MaybeRBMM0_26 == (MR_Word) ((MR_Unsigned) 0U)))
    MaybeRBMM_42 = (MR_Word) ((MR_Unsigned) 0U);
  else
  {
    MR_Word RBMM0_43 = ((MR_Word) ((MR_hl_field(1, MaybeRBMM0_26, (MR_Integer) 0))));
    MR_Word Created0_44 = ((MR_Word) ((MR_hl_field(0, RBMM0_43, (MR_Integer) 0))));
    MR_Word Removed0_45 = ((MR_Word) ((MR_hl_field(0, RBMM0_43, (MR_Integer) 1))));
    MR_Word Carried0_46 = ((MR_Word) ((MR_hl_field(0, RBMM0_43, (MR_Integer) 2))));
    MR_Word Alloc0_47 = ((MR_Word) ((MR_hl_field(0, RBMM0_43, (MR_Integer) 3))));
    MR_Word NonAlloc0_48 = ((MR_Word) ((MR_hl_field(0, RBMM0_43, (MR_Integer) 4))));
    MR_Word Created_49;
    MR_Word Removed_50;
    MR_Word Carried_51;
    MR_Word Alloc_52;
    MR_Word NonAlloc_53;
    MR_Word RBMM_54;

    parse_tree__prog_rename__rename_vars_in_var_set_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Created0_44, &Created_49);
    parse_tree__prog_rename__rename_vars_in_var_set_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Removed0_45, &Removed_50);
    parse_tree__prog_rename__rename_vars_in_var_set_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Carried0_46, &Carried_51);
    parse_tree__prog_rename__rename_vars_in_var_set_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Alloc0_47, &Alloc_52);
    parse_tree__prog_rename__rename_vars_in_var_set_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, NonAlloc0_48, &NonAlloc_53);
    {
      RBMM_54 = (MR_Word) MR_new_object(MR_Word, (5 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, RBMM_54, 0) = ((MR_Box) (Created_49));
      MR_hl_field(0, RBMM_54, 1) = ((MR_Box) (Removed_50));
      MR_hl_field(0, RBMM_54, 2) = ((MR_Box) (Carried_51));
      MR_hl_field(0, RBMM_54, 3) = ((MR_Box) (Alloc_52));
      MR_hl_field(0, RBMM_54, 4) = ((MR_Box) (NonAlloc_53));
    }
    {
      MaybeRBMM_42 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
      MR_hl_field(1, MaybeRBMM_42, 0) = ((MR_Box) (RBMM_54));
    }
  }
  if ((MaybeMCI0_27 == (MR_Word) ((MR_Unsigned) 0U)))
    MaybeMCI_55 = (MR_Word) ((MR_Unsigned) 0U);
  else
  {
    MR_Word MCI0_56 = ((MR_Word) ((MR_hl_field(1, MaybeMCI0_27, (MR_Integer) 0))));
    MR_Word Occurring0_57 = ((MR_Word) ((MR_hl_field(0, MCI0_56, (MR_Integer) 0))));
    MR_Word Producing0_58 = ((MR_Word) ((MR_hl_field(0, MCI0_56, (MR_Integer) 1))));
    MR_Word Consuming0_59 = ((MR_Word) ((MR_hl_field(0, MCI0_56, (MR_Integer) 2))));
    MR_Word MakeVisible0_60 = ((MR_Word) ((MR_hl_field(0, MCI0_56, (MR_Integer) 3))));
    MR_Word NeedVisible0_61 = ((MR_Word) ((MR_hl_field(0, MCI0_56, (MR_Integer) 4))));
    MR_Word Occurring_62;
    MR_Word Producing_63;
    MR_Word Consuming_64;
    MR_Word MakeVisible_65;
    MR_Word NeedVisible_66;
    MR_Word MCI_67;

    parse_tree__prog_rename__rename_vars_in_set_of_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Occurring0_57, &Occurring_62);
    parse_tree__prog_rename__rename_vars_in_set_of_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Producing0_58, &Producing_63);
    parse_tree__prog_rename__rename_vars_in_set_of_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, Consuming0_59, &Consuming_64);
    parse_tree__prog_rename__rename_vars_in_set_of_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, MakeVisible0_60, &MakeVisible_65);
    parse_tree__prog_rename__rename_vars_in_set_of_var_4_p_2((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), Must_5, Subn_6, NeedVisible0_61, &NeedVisible_66);
    {
      MCI_67 = (MR_Word) MR_new_object(MR_Word, (5 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, MCI_67, 0) = ((MR_Box) (Occurring_62));
      MR_hl_field(0, MCI_67, 1) = ((MR_Box) (Producing_63));
      MR_hl_field(0, MCI_67, 2) = ((MR_Box) (Consuming_64));
      MR_hl_field(0, MCI_67, 3) = ((MR_Box) (MakeVisible_65));
      MR_hl_field(0, MCI_67, 4) = ((MR_Box) (NeedVisible_66));
    }
    {
      MaybeMCI_55 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
      MR_hl_field(1, MaybeMCI_55, 0) = ((MR_Box) (MCI_67));
    }
  }
  {
    ExtraInfo_69 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, ExtraInfo_69, 0) = ((MR_Box) (Context_21));
    MR_hl_field(0, ExtraInfo_69, 1) = ((MR_Box) (RevGoalPath_22));
    MR_hl_field(0, ExtraInfo_69, 2) = ((MR_Box) (HO_Values_23));
    MR_hl_field(0, ExtraInfo_69, 3) = ((MR_Box) (GoalMode_29));
    MR_hl_field(0, ExtraInfo_69, 4) = ((MR_Box) (MaybeCTGC_30));
    MR_hl_field(0, ExtraInfo_69, 5) = ((MR_Box) (MaybeRBMM_42));
    MR_hl_field(0, ExtraInfo_69, 6) = ((MR_Box) (MaybeMCI_55));
    MR_hl_field(0, ExtraInfo_69, 7) = ((MR_Box) (MaybeDPInfo_68));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_71 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, base, 1) = ((MR_Box) (InstMapDelta_17));
    MR_hl_field(0, base, 2) = ((MR_Box) (NonLocals_16));
    MR_hl_field(0, base, 3) = ((MR_Box) (Features_12));
    MR_hl_field(0, base, 4) = ((MR_Box) (GoalPath_13));
    MR_hl_field(0, base, 5) = ((MR_Box) (CodeGenInfo_18));
    MR_hl_field(0, base, 6) = ((MR_Box) (ExtraInfo_69));
  }
}

MR_bool MR_CALL 
hlds__hlds_goal__goal_has_feature_2_p_0(
  MR_Word HeadVar__1_1,
  MR_Word Feature_5)
{
  MR_bool succeeded;
  MR_Word GoalInfo_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));
  MR_Word Features_6 = ((MR_Word) ((MR_hl_field(0, GoalInfo_4, (MR_Integer) 3))));

  succeeded = mercury__set__member_2_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_feature_0), ((MR_Box) (Feature_5)), Features_6);
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal__goal_remove_feature_3_p_0(
  MR_Word OldFeature_4,
  MR_Word Goal0_5,
  MR_Word * Goal_6)
{
  MR_Word GoalExpr_7 = ((MR_Word) ((MR_hl_field(0, Goal0_5, (MR_Integer) 0))));
  MR_Word GoalInfo0_8 = ((MR_Word) ((MR_hl_field(0, Goal0_5, (MR_Integer) 1))));
  MR_Word GoalInfo_9;

  hlds__hlds_goal__goal_info_remove_feature_3_p_0(OldFeature_4, GoalInfo0_8, &GoalInfo_9);
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
    *Goal_6 = base;
    MR_hl_field(0, base, 0) = ((MR_Box) (GoalExpr_7));
    MR_hl_field(0, base, 1) = ((MR_Box) (GoalInfo_9));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_add_features_3_p_0(
  MR_Word NewFeatures_4,
  MR_Word Goal0_5,
  MR_Word * Goal_6)
{
  MR_Word GoalExpr_7 = ((MR_Word) ((MR_hl_field(0, Goal0_5, (MR_Integer) 0))));
  MR_Word GoalInfo0_8 = ((MR_Word) ((MR_hl_field(0, Goal0_5, (MR_Integer) 1))));
  MR_Word GoalInfo_9;
  MR_Word Features0_10 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 3))));
  MR_Word Features_11;
  MR_Word Var_22;
  MR_Word Var_23;
  MR_Word Var_25;
  MR_Word Var_26;
  MR_Word Var_27;
  MR_Unsigned packed_word_1;

  mercury__set__insert_list_3_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_feature_0), NewFeatures_4, Features0_10, &Features_11);
  packed_word_1 = (MR_Unsigned) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 0)));
  Var_22 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 1))));
  Var_23 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 2))));
  Var_25 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 4))));
  Var_26 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 5))));
  Var_27 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 6))));
  {
    GoalInfo_9 = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, GoalInfo_9, 0) = (MR_Box) (packed_word_1);
    MR_hl_field(0, GoalInfo_9, 1) = ((MR_Box) (Var_22));
    MR_hl_field(0, GoalInfo_9, 2) = ((MR_Box) (Var_23));
    MR_hl_field(0, GoalInfo_9, 3) = ((MR_Box) (Features_11));
    MR_hl_field(0, GoalInfo_9, 4) = ((MR_Box) (Var_25));
    MR_hl_field(0, GoalInfo_9, 5) = ((MR_Box) (Var_26));
    MR_hl_field(0, GoalInfo_9, 6) = ((MR_Box) (Var_27));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
    *Goal_6 = base;
    MR_hl_field(0, base, 0) = ((MR_Box) (GoalExpr_7));
    MR_hl_field(0, base, 1) = ((MR_Box) (GoalInfo_9));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_add_feature_3_p_0(
  MR_Word NewFeature_4,
  MR_Word Goal0_5,
  MR_Word * Goal_6)
{
  MR_Word GoalExpr_7 = ((MR_Word) ((MR_hl_field(0, Goal0_5, (MR_Integer) 0))));
  MR_Word GoalInfo0_8 = ((MR_Word) ((MR_hl_field(0, Goal0_5, (MR_Integer) 1))));
  MR_Word GoalInfo_9;
  MR_Word Features0_10 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 3))));
  MR_Word Features_11;
  MR_Word Var_22;
  MR_Word Var_23;
  MR_Word Var_25;
  MR_Word Var_26;
  MR_Word Var_27;
  MR_Unsigned packed_word_1;

  mercury__set__insert_3_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_feature_0), ((MR_Box) (NewFeature_4)), Features0_10, &Features_11);
  packed_word_1 = (MR_Unsigned) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 0)));
  Var_22 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 1))));
  Var_23 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 2))));
  Var_25 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 4))));
  Var_26 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 5))));
  Var_27 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 6))));
  {
    GoalInfo_9 = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, GoalInfo_9, 0) = (MR_Box) (packed_word_1);
    MR_hl_field(0, GoalInfo_9, 1) = ((MR_Box) (Var_22));
    MR_hl_field(0, GoalInfo_9, 2) = ((MR_Box) (Var_23));
    MR_hl_field(0, GoalInfo_9, 3) = ((MR_Box) (Features_11));
    MR_hl_field(0, GoalInfo_9, 4) = ((MR_Box) (Var_25));
    MR_hl_field(0, GoalInfo_9, 5) = ((MR_Box) (Var_26));
    MR_hl_field(0, GoalInfo_9, 6) = ((MR_Box) (Var_27));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
    *Goal_6 = base;
    MR_hl_field(0, base, 0) = ((MR_Box) (GoalExpr_7));
    MR_hl_field(0, base, 1) = ((MR_Box) (GoalInfo_9));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_set_context_3_p_0(
  MR_Word Context_4,
  MR_Word Goal0_5,
  MR_Word * Goal_6)
{
  MR_Word GoalExpr_7 = ((MR_Word) ((MR_hl_field(0, Goal0_5, (MR_Integer) 0))));
  MR_Word GoalInfo0_8 = ((MR_Word) ((MR_hl_field(0, Goal0_5, (MR_Integer) 1))));
  MR_Word GoalInfo_9;
  MR_Word Var_10 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 6))));
  MR_Word Var_11;
  MR_Word Var_14 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 1))));
  MR_Word Var_15 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 2))));
  MR_Word Var_16 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 3))));
  MR_Word Var_17 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 4))));
  MR_Word Var_18 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 5))));
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 0)));
  MR_Word Var_20 = ((MR_Word) ((MR_hl_field(0, Var_10, (MR_Integer) 1))));
  MR_Word Var_21 = ((MR_Word) ((MR_hl_field(0, Var_10, (MR_Integer) 2))));
  MR_Word Var_22 = ((MR_Word) ((MR_hl_field(0, Var_10, (MR_Integer) 3))));
  MR_Word Var_23 = ((MR_Word) ((MR_hl_field(0, Var_10, (MR_Integer) 4))));
  MR_Word Var_24 = ((MR_Word) ((MR_hl_field(0, Var_10, (MR_Integer) 5))));
  MR_Word Var_25 = ((MR_Word) ((MR_hl_field(0, Var_10, (MR_Integer) 6))));
  MR_Word Var_26 = ((MR_Word) ((MR_hl_field(0, Var_10, (MR_Integer) 7))));

  {
    Var_11 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_11, 0) = ((MR_Box) (Context_4));
    MR_hl_field(0, Var_11, 1) = ((MR_Box) (Var_20));
    MR_hl_field(0, Var_11, 2) = ((MR_Box) (Var_21));
    MR_hl_field(0, Var_11, 3) = ((MR_Box) (Var_22));
    MR_hl_field(0, Var_11, 4) = ((MR_Box) (Var_23));
    MR_hl_field(0, Var_11, 5) = ((MR_Box) (Var_24));
    MR_hl_field(0, Var_11, 6) = ((MR_Box) (Var_25));
    MR_hl_field(0, Var_11, 7) = ((MR_Box) (Var_26));
  }
  {
    GoalInfo_9 = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, GoalInfo_9, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, GoalInfo_9, 1) = ((MR_Box) (Var_14));
    MR_hl_field(0, GoalInfo_9, 2) = ((MR_Box) (Var_15));
    MR_hl_field(0, GoalInfo_9, 3) = ((MR_Box) (Var_16));
    MR_hl_field(0, GoalInfo_9, 4) = ((MR_Box) (Var_17));
    MR_hl_field(0, GoalInfo_9, 5) = ((MR_Box) (Var_18));
    MR_hl_field(0, GoalInfo_9, 6) = ((MR_Box) (Var_11));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
    *Goal_6 = base;
    MR_hl_field(0, base, 0) = ((MR_Box) (GoalExpr_7));
    MR_hl_field(0, base, 1) = ((MR_Box) (GoalInfo_9));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_mdprof_inst_3_p_0(
  MR_Word IsMDProfInst_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_10,
  MR_Word * STATE_VARIABLE_GoalInfo_11)
{
  MR_Word MaybeDPInfo0_6;
  MR_Word MaybeDPInfo_9;
  MR_Word Var_16 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 6))));
  MR_Word Var_19 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 1))));
  MR_Word Var_20 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 2))));
  MR_Word Var_21 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 3))));
  MR_Word Var_22 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 4))));
  MR_Word Var_23 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 5))));
  MR_Word Var_24 = ((MR_Word) ((MR_hl_field(0, Var_16, (MR_Integer) 0))));
  MR_Word Var_25 = ((MR_Word) ((MR_hl_field(0, Var_16, (MR_Integer) 1))));
  MR_Word Var_26 = ((MR_Word) ((MR_hl_field(0, Var_16, (MR_Integer) 2))));
  MR_Word Var_27 = ((MR_Word) ((MR_hl_field(0, Var_16, (MR_Integer) 3))));
  MR_Word Var_28 = ((MR_Word) ((MR_hl_field(0, Var_16, (MR_Integer) 4))));
  MR_Word Var_29 = ((MR_Word) ((MR_hl_field(0, Var_16, (MR_Integer) 5))));
  MR_Word Var_30 = ((MR_Word) ((MR_hl_field(0, Var_16, (MR_Integer) 6))));
  MR_Word Var_32;
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 0)));

  MaybeDPInfo0_6 = ((MR_Word) ((MR_hl_field(0, Var_16, (MR_Integer) 7))));
  if ((MaybeDPInfo0_6 == (MR_Word) ((MR_Unsigned) 0U)))
  {
    MR_Word Var_14;

    {
      Var_14 = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, Var_14, 0) = (MR_Box) ((MR_Unsigned) (IsMDProfInst_4));
      MR_hl_field(0, Var_14, 1) = ((MR_Box) ((MR_Unsigned) 0U));
    }
    {
      MaybeDPInfo_9 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
      MR_hl_field(1, MaybeDPInfo_9, 0) = ((MR_Box) (Var_14));
    }
  }
  else
  {
    MR_Word DPCoverageInfo_8;
    MR_Word Var_12 = ((MR_Word) ((MR_hl_field(1, MaybeDPInfo0_6, (MR_Integer) 0))));
    MR_Word Var_13;

    DPCoverageInfo_8 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 1))));
    {
      Var_13 = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, Var_13, 0) = (MR_Box) ((MR_Unsigned) (IsMDProfInst_4));
      MR_hl_field(0, Var_13, 1) = ((MR_Box) (DPCoverageInfo_8));
    }
    {
      MaybeDPInfo_9 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
      MR_hl_field(1, MaybeDPInfo_9, 0) = ((MR_Box) (Var_13));
    }
  }
  {
    Var_32 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_32, 0) = ((MR_Box) (Var_24));
    MR_hl_field(0, Var_32, 1) = ((MR_Box) (Var_25));
    MR_hl_field(0, Var_32, 2) = ((MR_Box) (Var_26));
    MR_hl_field(0, Var_32, 3) = ((MR_Box) (Var_27));
    MR_hl_field(0, Var_32, 4) = ((MR_Box) (Var_28));
    MR_hl_field(0, Var_32, 5) = ((MR_Box) (Var_29));
    MR_hl_field(0, Var_32, 6) = ((MR_Box) (Var_30));
    MR_hl_field(0, Var_32, 7) = ((MR_Box) (MaybeDPInfo_9));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_11 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_19));
    MR_hl_field(0, base, 2) = ((MR_Box) (Var_20));
    MR_hl_field(0, base, 3) = ((MR_Box) (Var_21));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_22));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_23));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_32));
  }
}

MR_bool MR_CALL 
hlds__hlds_goal__goal_info_has_feature_2_p_0(
  MR_Word GoalInfo_3,
  MR_Word Feature_4)
{
  MR_bool succeeded;
  MR_Word Features_5 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 3))));

  succeeded = mercury__set__member_2_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_feature_0), ((MR_Box) (Feature_4)), Features_5);
  return succeeded;
}

void MR_CALL 
hlds__hlds_goal__goal_info_remove_feature_3_p_0(
  MR_Word OldFeature_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_8,
  MR_Word * STATE_VARIABLE_GoalInfo_9)
{
  MR_bool succeeded;
  MR_Word Features0_6 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 3))));
  MR_Word Features_7;

  succeeded = mercury__set__remove_3_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_feature_0), ((MR_Box) (OldFeature_4)), Features0_6, &Features_7);
  if (succeeded)
  {
    MR_Word Var_20 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 1))));
    MR_Word Var_21 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 2))));
    MR_Word Var_23 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 4))));
    MR_Word Var_24 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 5))));
    MR_Word Var_25 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 6))));
    MR_Unsigned packed_word_1 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 0)));

    {
      MR_Word base;
      base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
      *STATE_VARIABLE_GoalInfo_9 = base;
      MR_hl_field(0, base, 0) = (MR_Box) (packed_word_1);
      MR_hl_field(0, base, 1) = ((MR_Box) (Var_20));
      MR_hl_field(0, base, 2) = ((MR_Box) (Var_21));
      MR_hl_field(0, base, 3) = ((MR_Box) (Features_7));
      MR_hl_field(0, base, 4) = ((MR_Box) (Var_23));
      MR_hl_field(0, base, 5) = ((MR_Box) (Var_24));
      MR_hl_field(0, base, 6) = ((MR_Box) (Var_25));
    }
  }
  else
    *STATE_VARIABLE_GoalInfo_9 = STATE_VARIABLE_GoalInfo_0_8;
}

void MR_CALL 
hlds__hlds_goal__goal_info_add_features_3_p_0(
  MR_Word NewFeatures_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_8,
  MR_Word * STATE_VARIABLE_GoalInfo_9)
{
  MR_Word Features0_6 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 3))));
  MR_Word Features_7;
  MR_Word Var_20;
  MR_Word Var_21;
  MR_Word Var_23;
  MR_Word Var_24;
  MR_Word Var_25;
  MR_Unsigned packed_word_1;

  mercury__set__insert_list_3_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_feature_0), NewFeatures_4, Features0_6, &Features_7);
  packed_word_1 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 0)));
  Var_20 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 1))));
  Var_21 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 2))));
  Var_23 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 4))));
  Var_24 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 5))));
  Var_25 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 6))));
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_9 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_1);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_20));
    MR_hl_field(0, base, 2) = ((MR_Box) (Var_21));
    MR_hl_field(0, base, 3) = ((MR_Box) (Features_7));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_23));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_24));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_25));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_add_feature_3_p_0(
  MR_Word NewFeature_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_8,
  MR_Word * STATE_VARIABLE_GoalInfo_9)
{
  MR_Word Features0_6 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 3))));
  MR_Word Features_7;
  MR_Word Var_20;
  MR_Word Var_21;
  MR_Word Var_23;
  MR_Word Var_24;
  MR_Word Var_25;
  MR_Unsigned packed_word_1;

  mercury__set__insert_3_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_feature_0), ((MR_Box) (NewFeature_4)), Features0_6, &Features_7);
  packed_word_1 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 0)));
  Var_20 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 1))));
  Var_21 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 2))));
  Var_23 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 4))));
  Var_24 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 5))));
  Var_25 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 6))));
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_9 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_1);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_20));
    MR_hl_field(0, base, 2) = ((MR_Box) (Var_21));
    MR_hl_field(0, base, 3) = ((MR_Box) (Features_7));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_23));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_24));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_25));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_get_goal_purity_3_p_0(
  MR_Word Goal_4,
  MR_Word * Purity_5,
  MR_Word * ContainsTraceGoal_6)
{
  MR_Word GoalInfo_8 = ((MR_Word) ((MR_hl_field(0, Goal_4, (MR_Integer) 1))));

  hlds__hlds_goal__goal_info_get_goal_purity_3_p_0(GoalInfo_8, Purity_5, ContainsTraceGoal_6);
}

void MR_CALL 
hlds__hlds_goal__goal_info_get_goal_purity_3_p_0(
  MR_Word GoalInfo_4,
  MR_Word * Purity_5,
  MR_Word * ContainsTraceGoal_6)
{
  MR_bool succeeded;
  MR_Word Features_15;

  *Purity_5 = ((MR_Unsigned) ((MR_hl_field(0, GoalInfo_4, (MR_Integer) 0))) & (MR_Integer) 3);
  Features_15 = ((MR_Word) ((MR_hl_field(0, GoalInfo_4, (MR_Integer) 3))));
  succeeded = mercury__set__member_2_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_feature_0), ((MR_Box) ((MR_Integer) 20)), Features_15);
  if (succeeded)
    *ContainsTraceGoal_6 = (MR_Integer) 0;
  else
    *ContainsTraceGoal_6 = (MR_Integer) 1;
}

void MR_CALL 
hlds__hlds_goal__goal_set_purity_3_p_0(
  MR_Word Purity_4,
  MR_Word Goal0_5,
  MR_Word * Goal_6)
{
  MR_bool succeeded;
  MR_Word GoalExpr_7 = ((MR_Word) ((MR_hl_field(0, Goal0_5, (MR_Integer) 0))));
  MR_Word GoalInfo0_8 = ((MR_Word) ((MR_hl_field(0, Goal0_5, (MR_Integer) 1))));
  MR_Word GoalInfo_9;
  MR_Word Var_25 = ((MR_Unsigned) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 0))) & (MR_Integer) 3);

  succeeded = (Purity_4 == Var_25);
  if (succeeded)
    GoalInfo_9 = GoalInfo0_8;
  else
  {
    MR_Word Var_17 = ((((MR_Unsigned) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 0))) >> 2)) & (MR_Integer) 7);
    MR_Word Var_19 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 1))));
    MR_Word Var_20 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 2))));
    MR_Word Var_21 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 3))));
    MR_Word Var_22 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 4))));
    MR_Word Var_23 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 5))));
    MR_Word Var_24 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 6))));

    {
      GoalInfo_9 = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, GoalInfo_9, 0) = (MR_Box) (((((MR_Unsigned) (Var_17) << 2)) | (MR_Unsigned) (Purity_4)));
      MR_hl_field(0, GoalInfo_9, 1) = ((MR_Box) (Var_19));
      MR_hl_field(0, GoalInfo_9, 2) = ((MR_Box) (Var_20));
      MR_hl_field(0, GoalInfo_9, 3) = ((MR_Box) (Var_21));
      MR_hl_field(0, GoalInfo_9, 4) = ((MR_Box) (Var_22));
      MR_hl_field(0, GoalInfo_9, 5) = ((MR_Box) (Var_23));
      MR_hl_field(0, GoalInfo_9, 6) = ((MR_Box) (Var_24));
    }
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
    *Goal_6 = base;
    MR_hl_field(0, base, 0) = ((MR_Box) (GoalExpr_7));
    MR_hl_field(0, base, 1) = ((MR_Box) (GoalInfo_9));
  }
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_get_purity_1_f_0(
  MR_Word HeadVar__1_1)
{
  MR_Word HeadVar__2_2;
  MR_Word GoalInfo_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));

  HeadVar__2_2 = ((MR_Unsigned) ((MR_hl_field(0, GoalInfo_4, (MR_Integer) 0))) & (MR_Integer) 3);
  return HeadVar__2_2;
}

void MR_CALL 
hlds__hlds_goal__goal_set_goal_id_3_p_0(
  MR_Word GoalId_4,
  MR_Word Goal0_5,
  MR_Word * Goal_6)
{
  MR_Word GoalExpr_7 = ((MR_Word) ((MR_hl_field(0, Goal0_5, (MR_Integer) 0))));
  MR_Word GoalInfo0_8 = ((MR_Word) ((MR_hl_field(0, Goal0_5, (MR_Integer) 1))));
  MR_Word GoalInfo_9;
  MR_Word Var_12 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 1))));
  MR_Word Var_13 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 2))));
  MR_Word Var_14 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 3))));
  MR_Word Var_16 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 5))));
  MR_Word Var_17 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 6))));
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 0)));

  {
    GoalInfo_9 = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, GoalInfo_9, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, GoalInfo_9, 1) = ((MR_Box) (Var_12));
    MR_hl_field(0, GoalInfo_9, 2) = ((MR_Box) (Var_13));
    MR_hl_field(0, GoalInfo_9, 3) = ((MR_Box) (Var_14));
    MR_hl_field(0, GoalInfo_9, 4) = ((MR_Box) (GoalId_4));
    MR_hl_field(0, GoalInfo_9, 5) = ((MR_Box) (Var_16));
    MR_hl_field(0, GoalInfo_9, 6) = ((MR_Box) (Var_17));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
    *Goal_6 = base;
    MR_hl_field(0, base, 0) = ((MR_Box) (GoalExpr_7));
    MR_hl_field(0, base, 1) = ((MR_Box) (GoalInfo_9));
  }
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_get_nonlocals_1_f_0(
  MR_Word HeadVar__1_1)
{
  MR_Word HeadVar__2_2;
  MR_Word GoalInfo_4 = ((MR_Word) ((MR_hl_field(0, HeadVar__1_1, (MR_Integer) 1))));

  HeadVar__2_2 = ((MR_Word) ((MR_hl_field(0, GoalInfo_4, (MR_Integer) 2))));
  return HeadVar__2_2;
}

MR_Word MR_CALL 
hlds__hlds_goal__worst_contains_trace_2_f_0(
  MR_Word HeadVar__1_1,
  MR_Word HeadVar__2_2)
{
  MR_Word HeadVar__3_3;

  switch (HeadVar__1_1) {
    default: /*NOTREACHED*/ MR_assert(0);
    case (MR_Integer) 1:
      switch (HeadVar__2_2) {
        default: /*NOTREACHED*/ MR_assert(0);
        case (MR_Integer) 1:
          HeadVar__3_3 = (MR_Integer) 1;
          break;
        case (MR_Integer) 0:
          HeadVar__3_3 = (MR_Integer) 0;
          break;
      }
      break;
    case (MR_Integer) 0:
      switch (HeadVar__2_2) {
        default: /*NOTREACHED*/ MR_assert(0);
        case (MR_Integer) 1:
          HeadVar__3_3 = (MR_Integer) 0;
          break;
        case (MR_Integer) 0:
          HeadVar__3_3 = (MR_Integer) 0;
          break;
      }
      break;
  }
  return HeadVar__3_3;
}

void MR_CALL 
hlds__hlds_goal__add_impurity_if_needed_3_p_0(
  MR_Word AddedImpurity_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_6,
  MR_Word * STATE_VARIABLE_GoalInfo_7)
{
  switch (AddedImpurity_4) {
    default: /*NOTREACHED*/ MR_assert(0);
    case (MR_Integer) 0:
      *STATE_VARIABLE_GoalInfo_7 = STATE_VARIABLE_GoalInfo_0_6;
      break;
    case (MR_Integer) 1:
      hlds__hlds_goal__make_impure_2_p_0(STATE_VARIABLE_GoalInfo_0_6, STATE_VARIABLE_GoalInfo_7);
      break;
  }
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_add_nonlocals_make_impure_2_f_0(
  MR_Word STATE_VARIABLE_GoalInfo_0_8,
  MR_Word NewNonLocals_5)
{
  MR_Word STATE_VARIABLE_GoalInfo_9;
  MR_Word NonLocals0_6 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 2))));
  MR_Word NonLocals_7;
  MR_Word STATE_VARIABLE_GoalInfo_10_10;
  MR_Word Var_21;
  MR_Word Var_23;
  MR_Word Var_24;
  MR_Word Var_25;
  MR_Word Var_26;
  MR_Unsigned packed_word_1;

  NonLocals_7 = parse_tree__set_of_var__union_2_f_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), NonLocals0_6, NewNonLocals_5);
  packed_word_1 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 0)));
  Var_21 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 1))));
  Var_23 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 3))));
  Var_24 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 4))));
  Var_25 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 5))));
  Var_26 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_8, (MR_Integer) 6))));
  {
    STATE_VARIABLE_GoalInfo_10_10 = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, STATE_VARIABLE_GoalInfo_10_10, 0) = (MR_Box) (packed_word_1);
    MR_hl_field(0, STATE_VARIABLE_GoalInfo_10_10, 1) = ((MR_Box) (Var_21));
    MR_hl_field(0, STATE_VARIABLE_GoalInfo_10_10, 2) = ((MR_Box) (NonLocals_7));
    MR_hl_field(0, STATE_VARIABLE_GoalInfo_10_10, 3) = ((MR_Box) (Var_23));
    MR_hl_field(0, STATE_VARIABLE_GoalInfo_10_10, 4) = ((MR_Box) (Var_24));
    MR_hl_field(0, STATE_VARIABLE_GoalInfo_10_10, 5) = ((MR_Box) (Var_25));
    MR_hl_field(0, STATE_VARIABLE_GoalInfo_10_10, 6) = ((MR_Box) (Var_26));
  }
  hlds__hlds_goal__make_impure_2_p_0(STATE_VARIABLE_GoalInfo_10_10, &STATE_VARIABLE_GoalInfo_9);
  return STATE_VARIABLE_GoalInfo_9;
}

void MR_CALL 
hlds__hlds_goal__make_impure_2_p_0(
  MR_Word STATE_VARIABLE_GoalInfo_0_5,
  MR_Word * STATE_VARIABLE_GoalInfo_6)
{
  MR_bool succeeded;
  MR_Word Purity_4 = ((MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_5, (MR_Integer) 0))) & (MR_Integer) 3);

  switch (Purity_4) {
    default: /*NOTREACHED*/ MR_assert(0);
    case (MR_Integer) 2:
      *STATE_VARIABLE_GoalInfo_6 = STATE_VARIABLE_GoalInfo_0_5;
      break;
    case (MR_Integer) 0:
    case (MR_Integer) 1:
      {
        MR_Word STATE_VARIABLE_GoalInfo_8_8;
        MR_Word Features0_33;
        MR_Word Features_34;
        MR_Word Var_32 = ((MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_5, (MR_Integer) 0))) & (MR_Integer) 3);
        MR_Word Var_45;
        MR_Word Var_46;
        MR_Word Var_48;
        MR_Word Var_49;
        MR_Word Var_50;
        MR_Unsigned packed_word_4;

        succeeded = ((MR_Integer) 2 == Var_32);
        if (succeeded)
          STATE_VARIABLE_GoalInfo_8_8 = STATE_VARIABLE_GoalInfo_0_5;
        else
        {
          MR_Word Var_24 = ((((MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_5, (MR_Integer) 0))) >> 2)) & (MR_Integer) 7);
          MR_Word Var_26 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_5, (MR_Integer) 1))));
          MR_Word Var_27 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_5, (MR_Integer) 2))));
          MR_Word Var_28 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_5, (MR_Integer) 3))));
          MR_Word Var_29 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_5, (MR_Integer) 4))));
          MR_Word Var_30 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_5, (MR_Integer) 5))));
          MR_Word Var_31 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_5, (MR_Integer) 6))));

          {
            STATE_VARIABLE_GoalInfo_8_8 = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
            MR_hl_field(0, STATE_VARIABLE_GoalInfo_8_8, 0) = (MR_Box) (((((MR_Unsigned) (Var_24) << 2)) | (MR_Unsigned) ((MR_Integer) 2)));
            MR_hl_field(0, STATE_VARIABLE_GoalInfo_8_8, 1) = ((MR_Box) (Var_26));
            MR_hl_field(0, STATE_VARIABLE_GoalInfo_8_8, 2) = ((MR_Box) (Var_27));
            MR_hl_field(0, STATE_VARIABLE_GoalInfo_8_8, 3) = ((MR_Box) (Var_28));
            MR_hl_field(0, STATE_VARIABLE_GoalInfo_8_8, 4) = ((MR_Box) (Var_29));
            MR_hl_field(0, STATE_VARIABLE_GoalInfo_8_8, 5) = ((MR_Box) (Var_30));
            MR_hl_field(0, STATE_VARIABLE_GoalInfo_8_8, 6) = ((MR_Box) (Var_31));
          }
        }
        Features0_33 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_8_8, (MR_Integer) 3))));
        mercury__set__insert_3_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_feature_0), ((MR_Box) ((MR_Integer) 2)), Features0_33, &Features_34);
        packed_word_4 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_8_8, (MR_Integer) 0)));
        Var_45 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_8_8, (MR_Integer) 1))));
        Var_46 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_8_8, (MR_Integer) 2))));
        Var_48 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_8_8, (MR_Integer) 4))));
        Var_49 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_8_8, (MR_Integer) 5))));
        Var_50 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_8_8, (MR_Integer) 6))));
        {
          MR_Word base;
          base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
          *STATE_VARIABLE_GoalInfo_6 = base;
          MR_hl_field(0, base, 0) = (MR_Box) (packed_word_4);
          MR_hl_field(0, base, 1) = ((MR_Box) (Var_45));
          MR_hl_field(0, base, 2) = ((MR_Box) (Var_46));
          MR_hl_field(0, base, 3) = ((MR_Box) (Features_34));
          MR_hl_field(0, base, 4) = ((MR_Box) (Var_48));
          MR_hl_field(0, base, 5) = ((MR_Box) (Var_49));
          MR_hl_field(0, base, 6) = ((MR_Box) (Var_50));
        }
      }
      break;
  }
}

MR_Word MR_CALL 
hlds__hlds_goal__f_110_101_101_100_95_118_105_115_105_98_108_101_95_118_97_114_115_32_58_61_2_f_0(
  MR_Word GoalInfo0_4,
  MR_Word NeedVisibleVars_5)
{
  MR_Word GoalInfo_6;

  hlds__hlds_goal__goal_info_set_need_visible_vars_3_p_0(NeedVisibleVars_5, GoalInfo0_4, &GoalInfo_6);
  return GoalInfo_6;
}

MR_Word MR_CALL 
hlds__hlds_goal__need_visible_vars_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word NeedVisibleVars_4;
  MR_Word MMCI_5;
  MR_Word Var_7 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  MMCI_5 = ((MR_Word) ((MR_hl_field(0, Var_7, (MR_Integer) 6))));
  if ((MMCI_5 == (MR_Word) ((MR_Unsigned) 0U)))
    NeedVisibleVars_4 = parse_tree__set_of_var__init_0_f_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0));
  else
  {
    MR_Word MCI_6 = ((MR_Word) ((MR_hl_field(1, MMCI_5, (MR_Integer) 0))));

    NeedVisibleVars_4 = ((MR_Word) ((MR_hl_field(0, MCI_6, (MR_Integer) 4))));
  }
  return NeedVisibleVars_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__f_109_97_107_101_95_118_105_115_105_98_108_101_95_118_97_114_115_32_58_61_2_f_0(
  MR_Word GoalInfo0_4,
  MR_Word MakeVisibleVars_5)
{
  MR_Word GoalInfo_6;

  hlds__hlds_goal__goal_info_set_make_visible_vars_3_p_0(MakeVisibleVars_5, GoalInfo0_4, &GoalInfo_6);
  return GoalInfo_6;
}

MR_Word MR_CALL 
hlds__hlds_goal__make_visible_vars_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word MakeVisibleVars_4;
  MR_Word MMCI_5;
  MR_Word Var_7 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  MMCI_5 = ((MR_Word) ((MR_hl_field(0, Var_7, (MR_Integer) 6))));
  if ((MMCI_5 == (MR_Word) ((MR_Unsigned) 0U)))
    MakeVisibleVars_4 = parse_tree__set_of_var__init_0_f_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0));
  else
  {
    MR_Word MCI_6 = ((MR_Word) ((MR_hl_field(1, MMCI_5, (MR_Integer) 0))));

    MakeVisibleVars_4 = ((MR_Word) ((MR_hl_field(0, MCI_6, (MR_Integer) 3))));
  }
  return MakeVisibleVars_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__f_99_111_110_115_117_109_105_110_103_95_118_97_114_115_32_58_61_2_f_0(
  MR_Word GoalInfo0_4,
  MR_Word ConsumingVars_5)
{
  MR_Word GoalInfo_6;

  hlds__hlds_goal__goal_info_set_consuming_vars_3_p_0(ConsumingVars_5, GoalInfo0_4, &GoalInfo_6);
  return GoalInfo_6;
}

MR_Word MR_CALL 
hlds__hlds_goal__consuming_vars_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word ConsumingVars_4;
  MR_Word MMCI_5;
  MR_Word Var_7 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  MMCI_5 = ((MR_Word) ((MR_hl_field(0, Var_7, (MR_Integer) 6))));
  if ((MMCI_5 == (MR_Word) ((MR_Unsigned) 0U)))
    ConsumingVars_4 = parse_tree__set_of_var__init_0_f_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0));
  else
  {
    MR_Word MCI_6 = ((MR_Word) ((MR_hl_field(1, MMCI_5, (MR_Integer) 0))));

    ConsumingVars_4 = ((MR_Word) ((MR_hl_field(0, MCI_6, (MR_Integer) 2))));
  }
  return ConsumingVars_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__f_112_114_111_100_117_99_105_110_103_95_118_97_114_115_32_58_61_2_f_0(
  MR_Word GoalInfo0_4,
  MR_Word ProducingVars_5)
{
  MR_Word GoalInfo_6;

  hlds__hlds_goal__goal_info_set_producing_vars_3_p_0(ProducingVars_5, GoalInfo0_4, &GoalInfo_6);
  return GoalInfo_6;
}

MR_Word MR_CALL 
hlds__hlds_goal__producing_vars_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word ProducingVars_4;
  MR_Word MMCI_5;
  MR_Word Var_7 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  MMCI_5 = ((MR_Word) ((MR_hl_field(0, Var_7, (MR_Integer) 6))));
  if ((MMCI_5 == (MR_Word) ((MR_Unsigned) 0U)))
    ProducingVars_4 = parse_tree__set_of_var__init_0_f_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0));
  else
  {
    MR_Word MCI_6 = ((MR_Word) ((MR_hl_field(1, MMCI_5, (MR_Integer) 0))));

    ProducingVars_4 = ((MR_Word) ((MR_hl_field(0, MCI_6, (MR_Integer) 1))));
  }
  return ProducingVars_4;
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_need_visible_vars_3_p_0(
  MR_Word NeedVisibleVars_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_13,
  MR_Word * STATE_VARIABLE_GoalInfo_14)
{
  MR_Word MMCI0_6;
  MR_Word MCI_8;
  MR_Word Var_15 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 6))));
  MR_Word Var_17;
  MR_Word Var_19;
  MR_Word Var_22 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 1))));
  MR_Word Var_23 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 2))));
  MR_Word Var_24 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 3))));
  MR_Word Var_25 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 4))));
  MR_Word Var_26 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 5))));
  MR_Word Var_27 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 0))));
  MR_Word Var_28 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 1))));
  MR_Word Var_29 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 2))));
  MR_Word Var_30 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 3))));
  MR_Word Var_31 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 4))));
  MR_Word Var_32 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 5))));
  MR_Word Var_33;
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 0)));

  MMCI0_6 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 6))));
  Var_33 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 7))));
  if ((MMCI0_6 == (MR_Word) ((MR_Unsigned) 0U)))
  {
    MR_Word OccurringVars_9;
    MR_Word ProducingVars_10;
    MR_Word ConsumingVars_11;
    MR_Word MakeVisibleVars_12;

    parse_tree__set_of_var__init_1_p_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), &OccurringVars_9);
    parse_tree__set_of_var__init_1_p_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), &ProducingVars_10);
    parse_tree__set_of_var__init_1_p_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), &ConsumingVars_11);
    parse_tree__set_of_var__init_1_p_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), &MakeVisibleVars_12);
    {
      MCI_8 = (MR_Word) MR_new_object(MR_Word, (5 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, MCI_8, 0) = ((MR_Box) (OccurringVars_9));
      MR_hl_field(0, MCI_8, 1) = ((MR_Box) (ProducingVars_10));
      MR_hl_field(0, MCI_8, 2) = ((MR_Box) (ConsumingVars_11));
      MR_hl_field(0, MCI_8, 3) = ((MR_Box) (MakeVisibleVars_12));
      MR_hl_field(0, MCI_8, 4) = ((MR_Box) (NeedVisibleVars_4));
    }
  }
  else
  {
    MR_Word MCI0_7 = ((MR_Word) ((MR_hl_field(1, MMCI0_6, (MR_Integer) 0))));
    MR_Word Var_34 = ((MR_Word) ((MR_hl_field(0, MCI0_7, (MR_Integer) 0))));
    MR_Word Var_35 = ((MR_Word) ((MR_hl_field(0, MCI0_7, (MR_Integer) 1))));
    MR_Word Var_36 = ((MR_Word) ((MR_hl_field(0, MCI0_7, (MR_Integer) 2))));
    MR_Word Var_37 = ((MR_Word) ((MR_hl_field(0, MCI0_7, (MR_Integer) 3))));

    {
      MCI_8 = (MR_Word) MR_new_object(MR_Word, (5 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, MCI_8, 0) = ((MR_Box) (Var_34));
      MR_hl_field(0, MCI_8, 1) = ((MR_Box) (Var_35));
      MR_hl_field(0, MCI_8, 2) = ((MR_Box) (Var_36));
      MR_hl_field(0, MCI_8, 3) = ((MR_Box) (Var_37));
      MR_hl_field(0, MCI_8, 4) = ((MR_Box) (NeedVisibleVars_4));
    }
  }
  {
    Var_17 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
    MR_hl_field(1, Var_17, 0) = ((MR_Box) (MCI_8));
  }
  {
    Var_19 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_19, 0) = ((MR_Box) (Var_27));
    MR_hl_field(0, Var_19, 1) = ((MR_Box) (Var_28));
    MR_hl_field(0, Var_19, 2) = ((MR_Box) (Var_29));
    MR_hl_field(0, Var_19, 3) = ((MR_Box) (Var_30));
    MR_hl_field(0, Var_19, 4) = ((MR_Box) (Var_31));
    MR_hl_field(0, Var_19, 5) = ((MR_Box) (Var_32));
    MR_hl_field(0, Var_19, 6) = ((MR_Box) (Var_17));
    MR_hl_field(0, Var_19, 7) = ((MR_Box) (Var_33));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_14 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_22));
    MR_hl_field(0, base, 2) = ((MR_Box) (Var_23));
    MR_hl_field(0, base, 3) = ((MR_Box) (Var_24));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_25));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_26));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_19));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_make_visible_vars_3_p_0(
  MR_Word MakeVisibleVars_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_13,
  MR_Word * STATE_VARIABLE_GoalInfo_14)
{
  MR_Word MMCI0_6;
  MR_Word MCI_8;
  MR_Word Var_15 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 6))));
  MR_Word Var_17;
  MR_Word Var_19;
  MR_Word Var_22 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 1))));
  MR_Word Var_23 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 2))));
  MR_Word Var_24 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 3))));
  MR_Word Var_25 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 4))));
  MR_Word Var_26 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 5))));
  MR_Word Var_27 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 0))));
  MR_Word Var_28 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 1))));
  MR_Word Var_29 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 2))));
  MR_Word Var_30 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 3))));
  MR_Word Var_31 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 4))));
  MR_Word Var_32 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 5))));
  MR_Word Var_33;
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 0)));

  MMCI0_6 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 6))));
  Var_33 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 7))));
  if ((MMCI0_6 == (MR_Word) ((MR_Unsigned) 0U)))
  {
    MR_Word OccurringVars_9;
    MR_Word ProducingVars_10;
    MR_Word ConsumingVars_11;
    MR_Word NeedVisibleVars_12;

    parse_tree__set_of_var__init_1_p_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), &OccurringVars_9);
    parse_tree__set_of_var__init_1_p_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), &ProducingVars_10);
    parse_tree__set_of_var__init_1_p_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), &ConsumingVars_11);
    parse_tree__set_of_var__init_1_p_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), &NeedVisibleVars_12);
    {
      MCI_8 = (MR_Word) MR_new_object(MR_Word, (5 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, MCI_8, 0) = ((MR_Box) (OccurringVars_9));
      MR_hl_field(0, MCI_8, 1) = ((MR_Box) (ProducingVars_10));
      MR_hl_field(0, MCI_8, 2) = ((MR_Box) (ConsumingVars_11));
      MR_hl_field(0, MCI_8, 3) = ((MR_Box) (MakeVisibleVars_4));
      MR_hl_field(0, MCI_8, 4) = ((MR_Box) (NeedVisibleVars_12));
    }
  }
  else
  {
    MR_Word MCI0_7 = ((MR_Word) ((MR_hl_field(1, MMCI0_6, (MR_Integer) 0))));
    MR_Word Var_34 = ((MR_Word) ((MR_hl_field(0, MCI0_7, (MR_Integer) 0))));
    MR_Word Var_35 = ((MR_Word) ((MR_hl_field(0, MCI0_7, (MR_Integer) 1))));
    MR_Word Var_36 = ((MR_Word) ((MR_hl_field(0, MCI0_7, (MR_Integer) 2))));
    MR_Word Var_38 = ((MR_Word) ((MR_hl_field(0, MCI0_7, (MR_Integer) 4))));

    {
      MCI_8 = (MR_Word) MR_new_object(MR_Word, (5 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, MCI_8, 0) = ((MR_Box) (Var_34));
      MR_hl_field(0, MCI_8, 1) = ((MR_Box) (Var_35));
      MR_hl_field(0, MCI_8, 2) = ((MR_Box) (Var_36));
      MR_hl_field(0, MCI_8, 3) = ((MR_Box) (MakeVisibleVars_4));
      MR_hl_field(0, MCI_8, 4) = ((MR_Box) (Var_38));
    }
  }
  {
    Var_17 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
    MR_hl_field(1, Var_17, 0) = ((MR_Box) (MCI_8));
  }
  {
    Var_19 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_19, 0) = ((MR_Box) (Var_27));
    MR_hl_field(0, Var_19, 1) = ((MR_Box) (Var_28));
    MR_hl_field(0, Var_19, 2) = ((MR_Box) (Var_29));
    MR_hl_field(0, Var_19, 3) = ((MR_Box) (Var_30));
    MR_hl_field(0, Var_19, 4) = ((MR_Box) (Var_31));
    MR_hl_field(0, Var_19, 5) = ((MR_Box) (Var_32));
    MR_hl_field(0, Var_19, 6) = ((MR_Box) (Var_17));
    MR_hl_field(0, Var_19, 7) = ((MR_Box) (Var_33));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_14 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_22));
    MR_hl_field(0, base, 2) = ((MR_Box) (Var_23));
    MR_hl_field(0, base, 3) = ((MR_Box) (Var_24));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_25));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_26));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_19));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_consuming_vars_3_p_0(
  MR_Word ConsumingVars_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_13,
  MR_Word * STATE_VARIABLE_GoalInfo_14)
{
  MR_Word MMCI0_6;
  MR_Word MCI_8;
  MR_Word Var_15 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 6))));
  MR_Word Var_17;
  MR_Word Var_19;
  MR_Word Var_22 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 1))));
  MR_Word Var_23 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 2))));
  MR_Word Var_24 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 3))));
  MR_Word Var_25 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 4))));
  MR_Word Var_26 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 5))));
  MR_Word Var_27 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 0))));
  MR_Word Var_28 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 1))));
  MR_Word Var_29 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 2))));
  MR_Word Var_30 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 3))));
  MR_Word Var_31 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 4))));
  MR_Word Var_32 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 5))));
  MR_Word Var_33;
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 0)));

  MMCI0_6 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 6))));
  Var_33 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 7))));
  if ((MMCI0_6 == (MR_Word) ((MR_Unsigned) 0U)))
  {
    MR_Word OccurringVars_9;
    MR_Word ProducingVars_10;
    MR_Word MakeVisibleVars_11;
    MR_Word NeedVisibleVars_12;

    parse_tree__set_of_var__init_1_p_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), &OccurringVars_9);
    parse_tree__set_of_var__init_1_p_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), &ProducingVars_10);
    parse_tree__set_of_var__init_1_p_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), &MakeVisibleVars_11);
    parse_tree__set_of_var__init_1_p_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), &NeedVisibleVars_12);
    {
      MCI_8 = (MR_Word) MR_new_object(MR_Word, (5 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, MCI_8, 0) = ((MR_Box) (OccurringVars_9));
      MR_hl_field(0, MCI_8, 1) = ((MR_Box) (ProducingVars_10));
      MR_hl_field(0, MCI_8, 2) = ((MR_Box) (ConsumingVars_4));
      MR_hl_field(0, MCI_8, 3) = ((MR_Box) (MakeVisibleVars_11));
      MR_hl_field(0, MCI_8, 4) = ((MR_Box) (NeedVisibleVars_12));
    }
  }
  else
  {
    MR_Word MCI0_7 = ((MR_Word) ((MR_hl_field(1, MMCI0_6, (MR_Integer) 0))));
    MR_Word Var_34 = ((MR_Word) ((MR_hl_field(0, MCI0_7, (MR_Integer) 0))));
    MR_Word Var_35 = ((MR_Word) ((MR_hl_field(0, MCI0_7, (MR_Integer) 1))));
    MR_Word Var_37 = ((MR_Word) ((MR_hl_field(0, MCI0_7, (MR_Integer) 3))));
    MR_Word Var_38 = ((MR_Word) ((MR_hl_field(0, MCI0_7, (MR_Integer) 4))));

    {
      MCI_8 = (MR_Word) MR_new_object(MR_Word, (5 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, MCI_8, 0) = ((MR_Box) (Var_34));
      MR_hl_field(0, MCI_8, 1) = ((MR_Box) (Var_35));
      MR_hl_field(0, MCI_8, 2) = ((MR_Box) (ConsumingVars_4));
      MR_hl_field(0, MCI_8, 3) = ((MR_Box) (Var_37));
      MR_hl_field(0, MCI_8, 4) = ((MR_Box) (Var_38));
    }
  }
  {
    Var_17 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
    MR_hl_field(1, Var_17, 0) = ((MR_Box) (MCI_8));
  }
  {
    Var_19 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_19, 0) = ((MR_Box) (Var_27));
    MR_hl_field(0, Var_19, 1) = ((MR_Box) (Var_28));
    MR_hl_field(0, Var_19, 2) = ((MR_Box) (Var_29));
    MR_hl_field(0, Var_19, 3) = ((MR_Box) (Var_30));
    MR_hl_field(0, Var_19, 4) = ((MR_Box) (Var_31));
    MR_hl_field(0, Var_19, 5) = ((MR_Box) (Var_32));
    MR_hl_field(0, Var_19, 6) = ((MR_Box) (Var_17));
    MR_hl_field(0, Var_19, 7) = ((MR_Box) (Var_33));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_14 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_22));
    MR_hl_field(0, base, 2) = ((MR_Box) (Var_23));
    MR_hl_field(0, base, 3) = ((MR_Box) (Var_24));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_25));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_26));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_19));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_producing_vars_3_p_0(
  MR_Word ProducingVars_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_13,
  MR_Word * STATE_VARIABLE_GoalInfo_14)
{
  MR_Word MMCI0_6;
  MR_Word MCI_8;
  MR_Word Var_15 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 6))));
  MR_Word Var_17;
  MR_Word Var_19;
  MR_Word Var_22 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 1))));
  MR_Word Var_23 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 2))));
  MR_Word Var_24 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 3))));
  MR_Word Var_25 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 4))));
  MR_Word Var_26 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 5))));
  MR_Word Var_27 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 0))));
  MR_Word Var_28 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 1))));
  MR_Word Var_29 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 2))));
  MR_Word Var_30 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 3))));
  MR_Word Var_31 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 4))));
  MR_Word Var_32 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 5))));
  MR_Word Var_33;
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 0)));

  MMCI0_6 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 6))));
  Var_33 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 7))));
  if ((MMCI0_6 == (MR_Word) ((MR_Unsigned) 0U)))
  {
    MR_Word OccurringVars_9;
    MR_Word ConsumingVars_10;
    MR_Word MakeVisibleVars_11;
    MR_Word NeedVisibleVars_12;

    parse_tree__set_of_var__init_1_p_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), &OccurringVars_9);
    parse_tree__set_of_var__init_1_p_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), &ConsumingVars_10);
    parse_tree__set_of_var__init_1_p_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), &MakeVisibleVars_11);
    parse_tree__set_of_var__init_1_p_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), &NeedVisibleVars_12);
    {
      MCI_8 = (MR_Word) MR_new_object(MR_Word, (5 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, MCI_8, 0) = ((MR_Box) (OccurringVars_9));
      MR_hl_field(0, MCI_8, 1) = ((MR_Box) (ProducingVars_4));
      MR_hl_field(0, MCI_8, 2) = ((MR_Box) (ConsumingVars_10));
      MR_hl_field(0, MCI_8, 3) = ((MR_Box) (MakeVisibleVars_11));
      MR_hl_field(0, MCI_8, 4) = ((MR_Box) (NeedVisibleVars_12));
    }
  }
  else
  {
    MR_Word MCI0_7 = ((MR_Word) ((MR_hl_field(1, MMCI0_6, (MR_Integer) 0))));
    MR_Word Var_34 = ((MR_Word) ((MR_hl_field(0, MCI0_7, (MR_Integer) 0))));
    MR_Word Var_36 = ((MR_Word) ((MR_hl_field(0, MCI0_7, (MR_Integer) 2))));
    MR_Word Var_37 = ((MR_Word) ((MR_hl_field(0, MCI0_7, (MR_Integer) 3))));
    MR_Word Var_38 = ((MR_Word) ((MR_hl_field(0, MCI0_7, (MR_Integer) 4))));

    {
      MCI_8 = (MR_Word) MR_new_object(MR_Word, (5 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, MCI_8, 0) = ((MR_Box) (Var_34));
      MR_hl_field(0, MCI_8, 1) = ((MR_Box) (ProducingVars_4));
      MR_hl_field(0, MCI_8, 2) = ((MR_Box) (Var_36));
      MR_hl_field(0, MCI_8, 3) = ((MR_Box) (Var_37));
      MR_hl_field(0, MCI_8, 4) = ((MR_Box) (Var_38));
    }
  }
  {
    Var_17 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
    MR_hl_field(1, Var_17, 0) = ((MR_Box) (MCI_8));
  }
  {
    Var_19 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_19, 0) = ((MR_Box) (Var_27));
    MR_hl_field(0, Var_19, 1) = ((MR_Box) (Var_28));
    MR_hl_field(0, Var_19, 2) = ((MR_Box) (Var_29));
    MR_hl_field(0, Var_19, 3) = ((MR_Box) (Var_30));
    MR_hl_field(0, Var_19, 4) = ((MR_Box) (Var_31));
    MR_hl_field(0, Var_19, 5) = ((MR_Box) (Var_32));
    MR_hl_field(0, Var_19, 6) = ((MR_Box) (Var_17));
    MR_hl_field(0, Var_19, 7) = ((MR_Box) (Var_33));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_14 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_22));
    MR_hl_field(0, base, 2) = ((MR_Box) (Var_23));
    MR_hl_field(0, base, 3) = ((MR_Box) (Var_24));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_25));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_26));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_19));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_occurring_vars_3_p_0(
  MR_Word OccurringVars_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_13,
  MR_Word * STATE_VARIABLE_GoalInfo_14)
{
  MR_Word MMCI0_6;
  MR_Word MCI_8;
  MR_Word Var_15 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 6))));
  MR_Word Var_17;
  MR_Word Var_19;
  MR_Word Var_22 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 1))));
  MR_Word Var_23 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 2))));
  MR_Word Var_24 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 3))));
  MR_Word Var_25 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 4))));
  MR_Word Var_26 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 5))));
  MR_Word Var_27 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 0))));
  MR_Word Var_28 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 1))));
  MR_Word Var_29 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 2))));
  MR_Word Var_30 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 3))));
  MR_Word Var_31 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 4))));
  MR_Word Var_32 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 5))));
  MR_Word Var_33;
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_13, (MR_Integer) 0)));

  MMCI0_6 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 6))));
  Var_33 = ((MR_Word) ((MR_hl_field(0, Var_15, (MR_Integer) 7))));
  if ((MMCI0_6 == (MR_Word) ((MR_Unsigned) 0U)))
  {
    MR_Word ProducingVars_9;
    MR_Word ConsumingVars_10;
    MR_Word MakeVisibleVars_11;
    MR_Word NeedVisibleVars_12;

    parse_tree__set_of_var__init_1_p_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), &ProducingVars_9);
    parse_tree__set_of_var__init_1_p_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), &ConsumingVars_10);
    parse_tree__set_of_var__init_1_p_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), &MakeVisibleVars_11);
    parse_tree__set_of_var__init_1_p_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0), &NeedVisibleVars_12);
    {
      MCI_8 = (MR_Word) MR_new_object(MR_Word, (5 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, MCI_8, 0) = ((MR_Box) (OccurringVars_4));
      MR_hl_field(0, MCI_8, 1) = ((MR_Box) (ProducingVars_9));
      MR_hl_field(0, MCI_8, 2) = ((MR_Box) (ConsumingVars_10));
      MR_hl_field(0, MCI_8, 3) = ((MR_Box) (MakeVisibleVars_11));
      MR_hl_field(0, MCI_8, 4) = ((MR_Box) (NeedVisibleVars_12));
    }
  }
  else
  {
    MR_Word MCI0_7 = ((MR_Word) ((MR_hl_field(1, MMCI0_6, (MR_Integer) 0))));
    MR_Word Var_35 = ((MR_Word) ((MR_hl_field(0, MCI0_7, (MR_Integer) 1))));
    MR_Word Var_36 = ((MR_Word) ((MR_hl_field(0, MCI0_7, (MR_Integer) 2))));
    MR_Word Var_37 = ((MR_Word) ((MR_hl_field(0, MCI0_7, (MR_Integer) 3))));
    MR_Word Var_38 = ((MR_Word) ((MR_hl_field(0, MCI0_7, (MR_Integer) 4))));

    {
      MCI_8 = (MR_Word) MR_new_object(MR_Word, (5 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, MCI_8, 0) = ((MR_Box) (OccurringVars_4));
      MR_hl_field(0, MCI_8, 1) = ((MR_Box) (Var_35));
      MR_hl_field(0, MCI_8, 2) = ((MR_Box) (Var_36));
      MR_hl_field(0, MCI_8, 3) = ((MR_Box) (Var_37));
      MR_hl_field(0, MCI_8, 4) = ((MR_Box) (Var_38));
    }
  }
  {
    Var_17 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
    MR_hl_field(1, Var_17, 0) = ((MR_Box) (MCI_8));
  }
  {
    Var_19 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_19, 0) = ((MR_Box) (Var_27));
    MR_hl_field(0, Var_19, 1) = ((MR_Box) (Var_28));
    MR_hl_field(0, Var_19, 2) = ((MR_Box) (Var_29));
    MR_hl_field(0, Var_19, 3) = ((MR_Box) (Var_30));
    MR_hl_field(0, Var_19, 4) = ((MR_Box) (Var_31));
    MR_hl_field(0, Var_19, 5) = ((MR_Box) (Var_32));
    MR_hl_field(0, Var_19, 6) = ((MR_Box) (Var_17));
    MR_hl_field(0, Var_19, 7) = ((MR_Box) (Var_33));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_14 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_22));
    MR_hl_field(0, base, 2) = ((MR_Box) (Var_23));
    MR_hl_field(0, base, 3) = ((MR_Box) (Var_24));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_25));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_26));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_19));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_get_need_visible_vars_2_p_0(
  MR_Word GoalInfo_3,
  MR_Word * NeedVisibleVars_4)
{
  MR_Word MMCI_5;
  MR_Word Var_7 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  MMCI_5 = ((MR_Word) ((MR_hl_field(0, Var_7, (MR_Integer) 6))));
  if ((MMCI_5 == (MR_Word) ((MR_Unsigned) 0U)))
    *NeedVisibleVars_4 = parse_tree__set_of_var__init_0_f_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0));
  else
  {
    MR_Word MCI_6 = ((MR_Word) ((MR_hl_field(1, MMCI_5, (MR_Integer) 0))));

    *NeedVisibleVars_4 = ((MR_Word) ((MR_hl_field(0, MCI_6, (MR_Integer) 4))));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_get_make_visible_vars_2_p_0(
  MR_Word GoalInfo_3,
  MR_Word * MakeVisibleVars_4)
{
  MR_Word MMCI_5;
  MR_Word Var_7 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  MMCI_5 = ((MR_Word) ((MR_hl_field(0, Var_7, (MR_Integer) 6))));
  if ((MMCI_5 == (MR_Word) ((MR_Unsigned) 0U)))
    *MakeVisibleVars_4 = parse_tree__set_of_var__init_0_f_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0));
  else
  {
    MR_Word MCI_6 = ((MR_Word) ((MR_hl_field(1, MMCI_5, (MR_Integer) 0))));

    *MakeVisibleVars_4 = ((MR_Word) ((MR_hl_field(0, MCI_6, (MR_Integer) 3))));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_get_consuming_vars_2_p_0(
  MR_Word GoalInfo_3,
  MR_Word * ConsumingVars_4)
{
  MR_Word MMCI_5;
  MR_Word Var_7 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  MMCI_5 = ((MR_Word) ((MR_hl_field(0, Var_7, (MR_Integer) 6))));
  if ((MMCI_5 == (MR_Word) ((MR_Unsigned) 0U)))
    *ConsumingVars_4 = parse_tree__set_of_var__init_0_f_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0));
  else
  {
    MR_Word MCI_6 = ((MR_Word) ((MR_hl_field(1, MMCI_5, (MR_Integer) 0))));

    *ConsumingVars_4 = ((MR_Word) ((MR_hl_field(0, MCI_6, (MR_Integer) 2))));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_get_producing_vars_2_p_0(
  MR_Word GoalInfo_3,
  MR_Word * ProducingVars_4)
{
  MR_Word MMCI_5;
  MR_Word Var_7 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  MMCI_5 = ((MR_Word) ((MR_hl_field(0, Var_7, (MR_Integer) 6))));
  if ((MMCI_5 == (MR_Word) ((MR_Unsigned) 0U)))
    *ProducingVars_4 = parse_tree__set_of_var__init_0_f_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0));
  else
  {
    MR_Word MCI_6 = ((MR_Word) ((MR_hl_field(1, MMCI_5, (MR_Integer) 0))));

    *ProducingVars_4 = ((MR_Word) ((MR_hl_field(0, MCI_6, (MR_Integer) 1))));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_get_occurring_vars_2_p_0(
  MR_Word GoalInfo_3,
  MR_Word * OccurringVars_4)
{
  MR_Word MMCI_5;
  MR_Word Var_7 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  MMCI_5 = ((MR_Word) ((MR_hl_field(0, Var_7, (MR_Integer) 6))));
  if ((MMCI_5 == (MR_Word) ((MR_Unsigned) 0U)))
    *OccurringVars_4 = parse_tree__set_of_var__init_0_f_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0));
  else
  {
    MR_Word MCI_6 = ((MR_Word) ((MR_hl_field(1, MMCI_5, (MR_Integer) 0))));

    *OccurringVars_4 = ((MR_Word) ((MR_hl_field(0, MCI_6, (MR_Integer) 0))));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_reuse_3_p_0(
  MR_Word Reuse_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_10,
  MR_Word * STATE_VARIABLE_GoalInfo_11)
{
  MR_Word MaybeCTGC0_6;
  MR_Word CTGC0_7;
  MR_Word CTGC_8;
  MR_Word MaybeCTGC_9;
  MR_Word Var_12 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 6))));
  MR_Word Var_15;
  MR_Word Var_18 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 1))));
  MR_Word Var_19 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 2))));
  MR_Word Var_20 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 3))));
  MR_Word Var_21 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 4))));
  MR_Word Var_22 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 5))));
  MR_Word Var_23 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 0))));
  MR_Word Var_24 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 1))));
  MR_Word Var_25 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 2))));
  MR_Word Var_26 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 3))));
  MR_Word Var_27;
  MR_Word Var_28;
  MR_Word Var_29;
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 0)));
  MR_Word Var_30;
  MR_Word Var_31;

  MaybeCTGC0_6 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 4))));
  Var_27 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 5))));
  Var_28 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 6))));
  Var_29 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 7))));
  if ((MaybeCTGC0_6 == (MR_Word) ((MR_Unsigned) 0U)))
  {
    MR_Word Var_56;
    MR_Word Var_57;

    Var_56 = parse_tree__set_of_var__init_0_f_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0));
    Var_57 = parse_tree__set_of_var__init_0_f_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0));
    {
      CTGC0_7 = (MR_Word) MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, CTGC0_7, 0) = ((MR_Box) (Var_56));
      MR_hl_field(0, CTGC0_7, 1) = ((MR_Box) (Var_57));
      MR_hl_field(0, CTGC0_7, 2) = ((MR_Box) ((MR_Unsigned) 0U));
    }
  }
  else
    CTGC0_7 = ((MR_Word) ((MR_hl_field(1, MaybeCTGC0_6, (MR_Integer) 0))));
  Var_30 = ((MR_Word) ((MR_hl_field(0, CTGC0_7, (MR_Integer) 0))));
  Var_31 = ((MR_Word) ((MR_hl_field(0, CTGC0_7, (MR_Integer) 1))));
  {
    CTGC_8 = (MR_Word) MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, CTGC_8, 0) = ((MR_Box) (Var_30));
    MR_hl_field(0, CTGC_8, 1) = ((MR_Box) (Var_31));
    MR_hl_field(0, CTGC_8, 2) = ((MR_Box) (Reuse_4));
  }
  {
    MaybeCTGC_9 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
    MR_hl_field(1, MaybeCTGC_9, 0) = ((MR_Box) (CTGC_8));
  }
  {
    Var_15 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_15, 0) = ((MR_Box) (Var_23));
    MR_hl_field(0, Var_15, 1) = ((MR_Box) (Var_24));
    MR_hl_field(0, Var_15, 2) = ((MR_Box) (Var_25));
    MR_hl_field(0, Var_15, 3) = ((MR_Box) (Var_26));
    MR_hl_field(0, Var_15, 4) = ((MR_Box) (MaybeCTGC_9));
    MR_hl_field(0, Var_15, 5) = ((MR_Box) (Var_27));
    MR_hl_field(0, Var_15, 6) = ((MR_Box) (Var_28));
    MR_hl_field(0, Var_15, 7) = ((MR_Box) (Var_29));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_11 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_18));
    MR_hl_field(0, base, 2) = ((MR_Box) (Var_19));
    MR_hl_field(0, base, 3) = ((MR_Box) (Var_20));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_21));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_22));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_15));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_lbu_3_p_0(
  MR_Word LBU_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_10,
  MR_Word * STATE_VARIABLE_GoalInfo_11)
{
  MR_Word MaybeCTGC0_6;
  MR_Word CTGC0_7;
  MR_Word CTGC_8;
  MR_Word MaybeCTGC_9;
  MR_Word Var_12 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 6))));
  MR_Word Var_15;
  MR_Word Var_18 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 1))));
  MR_Word Var_19 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 2))));
  MR_Word Var_20 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 3))));
  MR_Word Var_21 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 4))));
  MR_Word Var_22 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 5))));
  MR_Word Var_23 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 0))));
  MR_Word Var_24 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 1))));
  MR_Word Var_25 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 2))));
  MR_Word Var_26 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 3))));
  MR_Word Var_27;
  MR_Word Var_28;
  MR_Word Var_29;
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 0)));
  MR_Word Var_30;
  MR_Word Var_32;

  MaybeCTGC0_6 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 4))));
  Var_27 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 5))));
  Var_28 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 6))));
  Var_29 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 7))));
  if ((MaybeCTGC0_6 == (MR_Word) ((MR_Unsigned) 0U)))
  {
    MR_Word Var_56;
    MR_Word Var_57;

    Var_56 = parse_tree__set_of_var__init_0_f_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0));
    Var_57 = parse_tree__set_of_var__init_0_f_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0));
    {
      CTGC0_7 = (MR_Word) MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, CTGC0_7, 0) = ((MR_Box) (Var_56));
      MR_hl_field(0, CTGC0_7, 1) = ((MR_Box) (Var_57));
      MR_hl_field(0, CTGC0_7, 2) = ((MR_Box) ((MR_Unsigned) 0U));
    }
  }
  else
    CTGC0_7 = ((MR_Word) ((MR_hl_field(1, MaybeCTGC0_6, (MR_Integer) 0))));
  Var_30 = ((MR_Word) ((MR_hl_field(0, CTGC0_7, (MR_Integer) 0))));
  Var_32 = ((MR_Word) ((MR_hl_field(0, CTGC0_7, (MR_Integer) 2))));
  {
    CTGC_8 = (MR_Word) MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, CTGC_8, 0) = ((MR_Box) (Var_30));
    MR_hl_field(0, CTGC_8, 1) = ((MR_Box) (LBU_4));
    MR_hl_field(0, CTGC_8, 2) = ((MR_Box) (Var_32));
  }
  {
    MaybeCTGC_9 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
    MR_hl_field(1, MaybeCTGC_9, 0) = ((MR_Box) (CTGC_8));
  }
  {
    Var_15 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_15, 0) = ((MR_Box) (Var_23));
    MR_hl_field(0, Var_15, 1) = ((MR_Box) (Var_24));
    MR_hl_field(0, Var_15, 2) = ((MR_Box) (Var_25));
    MR_hl_field(0, Var_15, 3) = ((MR_Box) (Var_26));
    MR_hl_field(0, Var_15, 4) = ((MR_Box) (MaybeCTGC_9));
    MR_hl_field(0, Var_15, 5) = ((MR_Box) (Var_27));
    MR_hl_field(0, Var_15, 6) = ((MR_Box) (Var_28));
    MR_hl_field(0, Var_15, 7) = ((MR_Box) (Var_29));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_11 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_18));
    MR_hl_field(0, base, 2) = ((MR_Box) (Var_19));
    MR_hl_field(0, base, 3) = ((MR_Box) (Var_20));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_21));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_22));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_15));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_lfu_3_p_0(
  MR_Word LFU_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_10,
  MR_Word * STATE_VARIABLE_GoalInfo_11)
{
  MR_Word MaybeCTGC0_6;
  MR_Word CTGC0_7;
  MR_Word CTGC_8;
  MR_Word MaybeCTGC_9;
  MR_Word Var_12 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 6))));
  MR_Word Var_15;
  MR_Word Var_18 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 1))));
  MR_Word Var_19 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 2))));
  MR_Word Var_20 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 3))));
  MR_Word Var_21 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 4))));
  MR_Word Var_22 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 5))));
  MR_Word Var_23 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 0))));
  MR_Word Var_24 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 1))));
  MR_Word Var_25 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 2))));
  MR_Word Var_26 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 3))));
  MR_Word Var_27;
  MR_Word Var_28;
  MR_Word Var_29;
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_10, (MR_Integer) 0)));
  MR_Word Var_31;
  MR_Word Var_32;

  MaybeCTGC0_6 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 4))));
  Var_27 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 5))));
  Var_28 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 6))));
  Var_29 = ((MR_Word) ((MR_hl_field(0, Var_12, (MR_Integer) 7))));
  if ((MaybeCTGC0_6 == (MR_Word) ((MR_Unsigned) 0U)))
  {
    MR_Word Var_56;
    MR_Word Var_57;

    Var_56 = parse_tree__set_of_var__init_0_f_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0));
    Var_57 = parse_tree__set_of_var__init_0_f_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0));
    {
      CTGC0_7 = (MR_Word) MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, CTGC0_7, 0) = ((MR_Box) (Var_56));
      MR_hl_field(0, CTGC0_7, 1) = ((MR_Box) (Var_57));
      MR_hl_field(0, CTGC0_7, 2) = ((MR_Box) ((MR_Unsigned) 0U));
    }
  }
  else
    CTGC0_7 = ((MR_Word) ((MR_hl_field(1, MaybeCTGC0_6, (MR_Integer) 0))));
  Var_31 = ((MR_Word) ((MR_hl_field(0, CTGC0_7, (MR_Integer) 1))));
  Var_32 = ((MR_Word) ((MR_hl_field(0, CTGC0_7, (MR_Integer) 2))));
  {
    CTGC_8 = (MR_Word) MR_new_object(MR_Word, (3 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, CTGC_8, 0) = ((MR_Box) (LFU_4));
    MR_hl_field(0, CTGC_8, 1) = ((MR_Box) (Var_31));
    MR_hl_field(0, CTGC_8, 2) = ((MR_Box) (Var_32));
  }
  {
    MaybeCTGC_9 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
    MR_hl_field(1, MaybeCTGC_9, 0) = ((MR_Box) (CTGC_8));
  }
  {
    Var_15 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_15, 0) = ((MR_Box) (Var_23));
    MR_hl_field(0, Var_15, 1) = ((MR_Box) (Var_24));
    MR_hl_field(0, Var_15, 2) = ((MR_Box) (Var_25));
    MR_hl_field(0, Var_15, 3) = ((MR_Box) (Var_26));
    MR_hl_field(0, Var_15, 4) = ((MR_Box) (MaybeCTGC_9));
    MR_hl_field(0, Var_15, 5) = ((MR_Box) (Var_27));
    MR_hl_field(0, Var_15, 6) = ((MR_Box) (Var_28));
    MR_hl_field(0, Var_15, 7) = ((MR_Box) (Var_29));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_11 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_18));
    MR_hl_field(0, base, 2) = ((MR_Box) (Var_19));
    MR_hl_field(0, base, 3) = ((MR_Box) (Var_20));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_21));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_22));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_15));
  }
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_reuse_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word Reuse_4;
  MR_Word MaybeCTGC_8;
  MR_Word Var_10 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  MaybeCTGC_8 = ((MR_Word) ((MR_hl_field(0, Var_10, (MR_Integer) 4))));
  if ((MaybeCTGC_8 == (MR_Word) ((MR_Unsigned) 0U)))
    mercury__require__unexpected_2_p_0((MR_String) "function \140hlds.hlds_goal.goal_info_get_reuse\'/1", (MR_String) "Requesting reuse information while CTGC field not set.");
  else
  {
    MR_Word CTGC_9 = ((MR_Word) ((MR_hl_field(1, MaybeCTGC_8, (MR_Integer) 0))));

    Reuse_4 = ((MR_Word) ((MR_hl_field(0, CTGC_9, (MR_Integer) 2))));
  }
  return Reuse_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_lbu_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word LBU_4;
  MR_Word MaybeCTGC_8;
  MR_Word Var_10 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  MaybeCTGC_8 = ((MR_Word) ((MR_hl_field(0, Var_10, (MR_Integer) 4))));
  if ((MaybeCTGC_8 == (MR_Word) ((MR_Unsigned) 0U)))
    mercury__require__unexpected_2_p_0((MR_String) "function \140hlds.hlds_goal.goal_info_get_lbu\'/1", (MR_String) "Requesting LBU information while CTGC field not set.");
  else
  {
    MR_Word CTGC_9 = ((MR_Word) ((MR_hl_field(1, MaybeCTGC_8, (MR_Integer) 0))));

    LBU_4 = ((MR_Word) ((MR_hl_field(0, CTGC_9, (MR_Integer) 1))));
  }
  return LBU_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_lfu_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word LFU_4;
  MR_Word MaybeCTGC_8;
  MR_Word Var_10 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  MaybeCTGC_8 = ((MR_Word) ((MR_hl_field(0, Var_10, (MR_Integer) 4))));
  if ((MaybeCTGC_8 == (MR_Word) ((MR_Unsigned) 0U)))
    mercury__require__unexpected_2_p_0((MR_String) "function \140hlds.hlds_goal.goal_info_get_lfu\'/1", (MR_String) "Requesting LFU information while CTGC field not set.");
  else
  {
    MR_Word CTGC_9 = ((MR_Word) ((MR_hl_field(1, MaybeCTGC_8, (MR_Integer) 0))));

    LFU_4 = ((MR_Word) ((MR_hl_field(0, CTGC_9, (MR_Integer) 0))));
  }
  return LFU_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_maybe_reuse_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word MaybeReuse_4;
  MR_Word MaybeCTGC_5;
  MR_Word Var_7 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  MaybeCTGC_5 = ((MR_Word) ((MR_hl_field(0, Var_7, (MR_Integer) 4))));
  if ((MaybeCTGC_5 == (MR_Word) ((MR_Unsigned) 0U)))
    MaybeReuse_4 = (MR_Word) ((MR_Unsigned) 0U);
  else
  {
    MR_Word CTGC_6 = ((MR_Word) ((MR_hl_field(1, MaybeCTGC_5, (MR_Integer) 0))));
    MR_Word Var_8 = ((MR_Word) ((MR_hl_field(0, CTGC_6, (MR_Integer) 2))));

    {
      MaybeReuse_4 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
      MR_hl_field(1, MaybeReuse_4, 0) = ((MR_Box) (Var_8));
    }
  }
  return MaybeReuse_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_maybe_lbu_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word MaybeLBU_4;
  MR_Word MaybeCTGC_5;
  MR_Word Var_7 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  MaybeCTGC_5 = ((MR_Word) ((MR_hl_field(0, Var_7, (MR_Integer) 4))));
  if ((MaybeCTGC_5 == (MR_Word) ((MR_Unsigned) 0U)))
    MaybeLBU_4 = (MR_Word) ((MR_Unsigned) 0U);
  else
  {
    MR_Word CTGC_6 = ((MR_Word) ((MR_hl_field(1, MaybeCTGC_5, (MR_Integer) 0))));
    MR_Word Var_8 = ((MR_Word) ((MR_hl_field(0, CTGC_6, (MR_Integer) 1))));

    {
      MaybeLBU_4 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
      MR_hl_field(1, MaybeLBU_4, 0) = ((MR_Box) (Var_8));
    }
  }
  return MaybeLBU_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_maybe_lfu_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word MaybeLFU_4;
  MR_Word MaybeCTGC_5;
  MR_Word Var_7 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  MaybeCTGC_5 = ((MR_Word) ((MR_hl_field(0, Var_7, (MR_Integer) 4))));
  if ((MaybeCTGC_5 == (MR_Word) ((MR_Unsigned) 0U)))
    MaybeLFU_4 = (MR_Word) ((MR_Unsigned) 0U);
  else
  {
    MR_Word CTGC_6 = ((MR_Word) ((MR_hl_field(1, MaybeCTGC_5, (MR_Integer) 0))));
    MR_Word Var_8 = ((MR_Word) ((MR_hl_field(0, CTGC_6, (MR_Integer) 0))));

    {
      MaybeLFU_4 = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
      MR_hl_field(1, MaybeLFU_4, 0) = ((MR_Box) (Var_8));
    }
  }
  return MaybeLFU_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_rbmm_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word RBMM_4;
  MR_Word MaybeRBMM_5;
  MR_Word Var_8 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  MaybeRBMM_5 = ((MR_Word) ((MR_hl_field(0, Var_8, (MR_Integer) 5))));
  if ((MaybeRBMM_5 == (MR_Word) ((MR_Unsigned) 0U)))
    mercury__require__unexpected_2_p_0((MR_String) "function \140hlds.hlds_goal.goal_info_get_rbmm\'/1", (MR_String) "Requesting unavailable RBMM information.");
  else
    RBMM_4 = ((MR_Word) ((MR_hl_field(1, MaybeRBMM_5, (MR_Integer) 0))));
  return RBMM_4;
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_code_gen_nonlocals_3_p_0(
  MR_Word NonLocals_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_6,
  MR_Word * STATE_VARIABLE_GoalInfo_7)
{
  MR_Word Var_10 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 1))));
  MR_Word Var_12 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 3))));
  MR_Word Var_13 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 4))));
  MR_Word Var_14 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 5))));
  MR_Word Var_15 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 6))));
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 0)));

  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_7 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_10));
    MR_hl_field(0, base, 2) = ((MR_Box) (NonLocals_4));
    MR_hl_field(0, base, 3) = ((MR_Box) (Var_12));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_13));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_14));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_15));
  }
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_code_gen_nonlocals_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word HeadVar__2_2 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 2))));

  return HeadVar__2_2;
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_maybe_dp_info_3_p_0(
  MR_Word X_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_6,
  MR_Word * STATE_VARIABLE_GoalInfo_7)
{
  MR_Word Var_9 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 6))));
  MR_Word Var_10;
  MR_Word Var_13 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 1))));
  MR_Word Var_14 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 2))));
  MR_Word Var_15 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 3))));
  MR_Word Var_16 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 4))));
  MR_Word Var_17 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 5))));
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 0)));
  MR_Word Var_18 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 0))));
  MR_Word Var_19 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 1))));
  MR_Word Var_20 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 2))));
  MR_Word Var_21 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 3))));
  MR_Word Var_22 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 4))));
  MR_Word Var_23 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 5))));
  MR_Word Var_24 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 6))));

  {
    Var_10 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_10, 0) = ((MR_Box) (Var_18));
    MR_hl_field(0, Var_10, 1) = ((MR_Box) (Var_19));
    MR_hl_field(0, Var_10, 2) = ((MR_Box) (Var_20));
    MR_hl_field(0, Var_10, 3) = ((MR_Box) (Var_21));
    MR_hl_field(0, Var_10, 4) = ((MR_Box) (Var_22));
    MR_hl_field(0, Var_10, 5) = ((MR_Box) (Var_23));
    MR_hl_field(0, Var_10, 6) = ((MR_Box) (Var_24));
    MR_hl_field(0, Var_10, 7) = ((MR_Box) (X_4));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_7 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_13));
    MR_hl_field(0, base, 2) = ((MR_Box) (Var_14));
    MR_hl_field(0, base, 3) = ((MR_Box) (Var_15));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_16));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_17));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_10));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_maybe_mode_constr_3_p_0(
  MR_Word X_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_6,
  MR_Word * STATE_VARIABLE_GoalInfo_7)
{
  MR_Word Var_9 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 6))));
  MR_Word Var_10;
  MR_Word Var_13 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 1))));
  MR_Word Var_14 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 2))));
  MR_Word Var_15 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 3))));
  MR_Word Var_16 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 4))));
  MR_Word Var_17 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 5))));
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 0)));
  MR_Word Var_18 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 0))));
  MR_Word Var_19 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 1))));
  MR_Word Var_20 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 2))));
  MR_Word Var_21 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 3))));
  MR_Word Var_22 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 4))));
  MR_Word Var_23 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 5))));
  MR_Word Var_25 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 7))));

  {
    Var_10 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_10, 0) = ((MR_Box) (Var_18));
    MR_hl_field(0, Var_10, 1) = ((MR_Box) (Var_19));
    MR_hl_field(0, Var_10, 2) = ((MR_Box) (Var_20));
    MR_hl_field(0, Var_10, 3) = ((MR_Box) (Var_21));
    MR_hl_field(0, Var_10, 4) = ((MR_Box) (Var_22));
    MR_hl_field(0, Var_10, 5) = ((MR_Box) (Var_23));
    MR_hl_field(0, Var_10, 6) = ((MR_Box) (X_4));
    MR_hl_field(0, Var_10, 7) = ((MR_Box) (Var_25));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_7 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_13));
    MR_hl_field(0, base, 2) = ((MR_Box) (Var_14));
    MR_hl_field(0, base, 3) = ((MR_Box) (Var_15));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_16));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_17));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_10));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_maybe_rbmm_3_p_0(
  MR_Word X_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_6,
  MR_Word * STATE_VARIABLE_GoalInfo_7)
{
  MR_Word Var_9 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 6))));
  MR_Word Var_10;
  MR_Word Var_13 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 1))));
  MR_Word Var_14 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 2))));
  MR_Word Var_15 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 3))));
  MR_Word Var_16 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 4))));
  MR_Word Var_17 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 5))));
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 0)));
  MR_Word Var_18 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 0))));
  MR_Word Var_19 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 1))));
  MR_Word Var_20 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 2))));
  MR_Word Var_21 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 3))));
  MR_Word Var_22 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 4))));
  MR_Word Var_24 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 6))));
  MR_Word Var_25 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 7))));

  {
    Var_10 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_10, 0) = ((MR_Box) (Var_18));
    MR_hl_field(0, Var_10, 1) = ((MR_Box) (Var_19));
    MR_hl_field(0, Var_10, 2) = ((MR_Box) (Var_20));
    MR_hl_field(0, Var_10, 3) = ((MR_Box) (Var_21));
    MR_hl_field(0, Var_10, 4) = ((MR_Box) (Var_22));
    MR_hl_field(0, Var_10, 5) = ((MR_Box) (X_4));
    MR_hl_field(0, Var_10, 6) = ((MR_Box) (Var_24));
    MR_hl_field(0, Var_10, 7) = ((MR_Box) (Var_25));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_7 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_13));
    MR_hl_field(0, base, 2) = ((MR_Box) (Var_14));
    MR_hl_field(0, base, 3) = ((MR_Box) (Var_15));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_16));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_17));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_10));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_maybe_ctgc_3_p_0(
  MR_Word X_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_6,
  MR_Word * STATE_VARIABLE_GoalInfo_7)
{
  MR_Word Var_9 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 6))));
  MR_Word Var_10;
  MR_Word Var_13 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 1))));
  MR_Word Var_14 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 2))));
  MR_Word Var_15 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 3))));
  MR_Word Var_16 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 4))));
  MR_Word Var_17 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 5))));
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 0)));
  MR_Word Var_18 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 0))));
  MR_Word Var_19 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 1))));
  MR_Word Var_20 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 2))));
  MR_Word Var_21 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 3))));
  MR_Word Var_23 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 5))));
  MR_Word Var_24 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 6))));
  MR_Word Var_25 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 7))));

  {
    Var_10 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_10, 0) = ((MR_Box) (Var_18));
    MR_hl_field(0, Var_10, 1) = ((MR_Box) (Var_19));
    MR_hl_field(0, Var_10, 2) = ((MR_Box) (Var_20));
    MR_hl_field(0, Var_10, 3) = ((MR_Box) (Var_21));
    MR_hl_field(0, Var_10, 4) = ((MR_Box) (X_4));
    MR_hl_field(0, Var_10, 5) = ((MR_Box) (Var_23));
    MR_hl_field(0, Var_10, 6) = ((MR_Box) (Var_24));
    MR_hl_field(0, Var_10, 7) = ((MR_Box) (Var_25));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_7 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_13));
    MR_hl_field(0, base, 2) = ((MR_Box) (Var_14));
    MR_hl_field(0, base, 3) = ((MR_Box) (Var_15));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_16));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_17));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_10));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_goal_mode_3_p_0(
  MR_Word X_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_6,
  MR_Word * STATE_VARIABLE_GoalInfo_7)
{
  MR_Word Var_9 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 6))));
  MR_Word Var_10;
  MR_Word Var_13 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 1))));
  MR_Word Var_14 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 2))));
  MR_Word Var_15 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 3))));
  MR_Word Var_16 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 4))));
  MR_Word Var_17 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 5))));
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 0)));
  MR_Word Var_18 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 0))));
  MR_Word Var_19 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 1))));
  MR_Word Var_20 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 2))));
  MR_Word Var_22 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 4))));
  MR_Word Var_23 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 5))));
  MR_Word Var_24 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 6))));
  MR_Word Var_25 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 7))));

  {
    Var_10 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_10, 0) = ((MR_Box) (Var_18));
    MR_hl_field(0, Var_10, 1) = ((MR_Box) (Var_19));
    MR_hl_field(0, Var_10, 2) = ((MR_Box) (Var_20));
    MR_hl_field(0, Var_10, 3) = ((MR_Box) (X_4));
    MR_hl_field(0, Var_10, 4) = ((MR_Box) (Var_22));
    MR_hl_field(0, Var_10, 5) = ((MR_Box) (Var_23));
    MR_hl_field(0, Var_10, 6) = ((MR_Box) (Var_24));
    MR_hl_field(0, Var_10, 7) = ((MR_Box) (Var_25));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_7 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_13));
    MR_hl_field(0, base, 2) = ((MR_Box) (Var_14));
    MR_hl_field(0, base, 3) = ((MR_Box) (Var_15));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_16));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_17));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_10));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_higher_order_value_map_3_p_0(
  MR_Word X_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_7,
  MR_Word * STATE_VARIABLE_GoalInfo_8)
{
  MR_bool succeeded;
  MR_Word Map0_6;
  MR_Word Var_9 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_7, (MR_Integer) 6))));

  Map0_6 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 2))));
  succeeded = (((MR_Word) X_4) == ((MR_Word) Map0_6));
  if (succeeded)
    *STATE_VARIABLE_GoalInfo_8 = STATE_VARIABLE_GoalInfo_0_7;
  else
  {
    MR_Word Var_11 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_7, (MR_Integer) 6))));
    MR_Word Var_12;
    MR_Word Var_29 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_7, (MR_Integer) 1))));
    MR_Word Var_30 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_7, (MR_Integer) 2))));
    MR_Word Var_31 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_7, (MR_Integer) 3))));
    MR_Word Var_32 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_7, (MR_Integer) 4))));
    MR_Word Var_33 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_7, (MR_Integer) 5))));
    MR_Unsigned packed_word_1 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_7, (MR_Integer) 0)));
    MR_Word Var_34 = ((MR_Word) ((MR_hl_field(0, Var_11, (MR_Integer) 0))));
    MR_Word Var_35 = ((MR_Word) ((MR_hl_field(0, Var_11, (MR_Integer) 1))));
    MR_Word Var_37 = ((MR_Word) ((MR_hl_field(0, Var_11, (MR_Integer) 3))));
    MR_Word Var_38 = ((MR_Word) ((MR_hl_field(0, Var_11, (MR_Integer) 4))));
    MR_Word Var_39 = ((MR_Word) ((MR_hl_field(0, Var_11, (MR_Integer) 5))));
    MR_Word Var_40 = ((MR_Word) ((MR_hl_field(0, Var_11, (MR_Integer) 6))));
    MR_Word Var_41 = ((MR_Word) ((MR_hl_field(0, Var_11, (MR_Integer) 7))));

    {
      Var_12 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, Var_12, 0) = ((MR_Box) (Var_34));
      MR_hl_field(0, Var_12, 1) = ((MR_Box) (Var_35));
      MR_hl_field(0, Var_12, 2) = ((MR_Box) (X_4));
      MR_hl_field(0, Var_12, 3) = ((MR_Box) (Var_37));
      MR_hl_field(0, Var_12, 4) = ((MR_Box) (Var_38));
      MR_hl_field(0, Var_12, 5) = ((MR_Box) (Var_39));
      MR_hl_field(0, Var_12, 6) = ((MR_Box) (Var_40));
      MR_hl_field(0, Var_12, 7) = ((MR_Box) (Var_41));
    }
    {
      MR_Word base;
      base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
      *STATE_VARIABLE_GoalInfo_8 = base;
      MR_hl_field(0, base, 0) = (MR_Box) (packed_word_1);
      MR_hl_field(0, base, 1) = ((MR_Box) (Var_29));
      MR_hl_field(0, base, 2) = ((MR_Box) (Var_30));
      MR_hl_field(0, base, 3) = ((MR_Box) (Var_31));
      MR_hl_field(0, base, 4) = ((MR_Box) (Var_32));
      MR_hl_field(0, base, 5) = ((MR_Box) (Var_33));
      MR_hl_field(0, base, 6) = ((MR_Box) (Var_12));
    }
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_reverse_goal_path_3_p_0(
  MR_Word X_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_6,
  MR_Word * STATE_VARIABLE_GoalInfo_7)
{
  MR_Word Var_9 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 6))));
  MR_Word Var_10;
  MR_Word Var_13 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 1))));
  MR_Word Var_14 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 2))));
  MR_Word Var_15 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 3))));
  MR_Word Var_16 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 4))));
  MR_Word Var_17 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 5))));
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 0)));
  MR_Word Var_18 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 0))));
  MR_Word Var_20 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 2))));
  MR_Word Var_21 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 3))));
  MR_Word Var_22 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 4))));
  MR_Word Var_23 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 5))));
  MR_Word Var_24 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 6))));
  MR_Word Var_25 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 7))));

  {
    Var_10 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_10, 0) = ((MR_Box) (Var_18));
    MR_hl_field(0, Var_10, 1) = ((MR_Box) (X_4));
    MR_hl_field(0, Var_10, 2) = ((MR_Box) (Var_20));
    MR_hl_field(0, Var_10, 3) = ((MR_Box) (Var_21));
    MR_hl_field(0, Var_10, 4) = ((MR_Box) (Var_22));
    MR_hl_field(0, Var_10, 5) = ((MR_Box) (Var_23));
    MR_hl_field(0, Var_10, 6) = ((MR_Box) (Var_24));
    MR_hl_field(0, Var_10, 7) = ((MR_Box) (Var_25));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_7 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_13));
    MR_hl_field(0, base, 2) = ((MR_Box) (Var_14));
    MR_hl_field(0, base, 3) = ((MR_Box) (Var_15));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_16));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_17));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_10));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_context_3_p_0(
  MR_Word X_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_6,
  MR_Word * STATE_VARIABLE_GoalInfo_7)
{
  MR_Word Var_9 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 6))));
  MR_Word Var_10;
  MR_Word Var_13 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 1))));
  MR_Word Var_14 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 2))));
  MR_Word Var_15 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 3))));
  MR_Word Var_16 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 4))));
  MR_Word Var_17 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 5))));
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 0)));
  MR_Word Var_19 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 1))));
  MR_Word Var_20 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 2))));
  MR_Word Var_21 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 3))));
  MR_Word Var_22 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 4))));
  MR_Word Var_23 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 5))));
  MR_Word Var_24 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 6))));
  MR_Word Var_25 = ((MR_Word) ((MR_hl_field(0, Var_9, (MR_Integer) 7))));

  {
    Var_10 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_10, 0) = ((MR_Box) (X_4));
    MR_hl_field(0, Var_10, 1) = ((MR_Box) (Var_19));
    MR_hl_field(0, Var_10, 2) = ((MR_Box) (Var_20));
    MR_hl_field(0, Var_10, 3) = ((MR_Box) (Var_21));
    MR_hl_field(0, Var_10, 4) = ((MR_Box) (Var_22));
    MR_hl_field(0, Var_10, 5) = ((MR_Box) (Var_23));
    MR_hl_field(0, Var_10, 6) = ((MR_Box) (Var_24));
    MR_hl_field(0, Var_10, 7) = ((MR_Box) (Var_25));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_7 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_13));
    MR_hl_field(0, base, 2) = ((MR_Box) (Var_14));
    MR_hl_field(0, base, 3) = ((MR_Box) (Var_15));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_16));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_17));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_10));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_code_gen_info_3_p_0(
  MR_Word X_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_6,
  MR_Word * STATE_VARIABLE_GoalInfo_7)
{
  MR_Word Var_10 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 1))));
  MR_Word Var_11 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 2))));
  MR_Word Var_12 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 3))));
  MR_Word Var_13 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 4))));
  MR_Word Var_15 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 6))));
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 0)));

  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_7 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_10));
    MR_hl_field(0, base, 2) = ((MR_Box) (Var_11));
    MR_hl_field(0, base, 3) = ((MR_Box) (Var_12));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_13));
    MR_hl_field(0, base, 5) = ((MR_Box) (X_4));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_15));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_goal_id_3_p_0(
  MR_Word X_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_6,
  MR_Word * STATE_VARIABLE_GoalInfo_7)
{
  MR_Word Var_10 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 1))));
  MR_Word Var_11 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 2))));
  MR_Word Var_12 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 3))));
  MR_Word Var_14 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 5))));
  MR_Word Var_15 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 6))));
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 0)));

  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_7 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_10));
    MR_hl_field(0, base, 2) = ((MR_Box) (Var_11));
    MR_hl_field(0, base, 3) = ((MR_Box) (Var_12));
    MR_hl_field(0, base, 4) = ((MR_Box) (X_4));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_14));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_15));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_features_3_p_0(
  MR_Word X_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_6,
  MR_Word * STATE_VARIABLE_GoalInfo_7)
{
  MR_Word Var_10 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 1))));
  MR_Word Var_11 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 2))));
  MR_Word Var_13 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 4))));
  MR_Word Var_14 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 5))));
  MR_Word Var_15 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 6))));
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 0)));

  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_7 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_10));
    MR_hl_field(0, base, 2) = ((MR_Box) (Var_11));
    MR_hl_field(0, base, 3) = ((MR_Box) (X_4));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_13));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_14));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_15));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_nonlocals_3_p_0(
  MR_Word X_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_6,
  MR_Word * STATE_VARIABLE_GoalInfo_7)
{
  MR_Word Var_10 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 1))));
  MR_Word Var_12 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 3))));
  MR_Word Var_13 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 4))));
  MR_Word Var_14 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 5))));
  MR_Word Var_15 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 6))));
  MR_Unsigned packed_word_0 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 0)));

  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_7 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (packed_word_0);
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_10));
    MR_hl_field(0, base, 2) = ((MR_Box) (X_4));
    MR_hl_field(0, base, 3) = ((MR_Box) (Var_12));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_13));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_14));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_15));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_instmap_delta_3_p_0(
  MR_Word X_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_6,
  MR_Word * STATE_VARIABLE_GoalInfo_7)
{
  MR_bool succeeded;
  MR_Word Var_8 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 1))));

  succeeded = (((MR_Word) X_4) == ((MR_Word) Var_8));
  if (succeeded)
    *STATE_VARIABLE_GoalInfo_7 = STATE_VARIABLE_GoalInfo_0_6;
  else
  {
    MR_Word Var_19 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 2))));
    MR_Word Var_20 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 3))));
    MR_Word Var_21 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 4))));
    MR_Word Var_22 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 5))));
    MR_Word Var_23 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 6))));
    MR_Unsigned packed_word_1 = (MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 0)));

    {
      MR_Word base;
      base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
      *STATE_VARIABLE_GoalInfo_7 = base;
      MR_hl_field(0, base, 0) = (MR_Box) (packed_word_1);
      MR_hl_field(0, base, 1) = ((MR_Box) (X_4));
      MR_hl_field(0, base, 2) = ((MR_Box) (Var_19));
      MR_hl_field(0, base, 3) = ((MR_Box) (Var_20));
      MR_hl_field(0, base, 4) = ((MR_Box) (Var_21));
      MR_hl_field(0, base, 5) = ((MR_Box) (Var_22));
      MR_hl_field(0, base, 6) = ((MR_Box) (Var_23));
    }
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_purity_3_p_0(
  MR_Word X_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_6,
  MR_Word * STATE_VARIABLE_GoalInfo_7)
{
  MR_bool succeeded;
  MR_Word Var_23 = ((MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 0))) & (MR_Integer) 3);

  succeeded = (X_4 == Var_23);
  if (succeeded)
    *STATE_VARIABLE_GoalInfo_7 = STATE_VARIABLE_GoalInfo_0_6;
  else
  {
    MR_Word Var_15 = ((((MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 0))) >> 2)) & (MR_Integer) 7);
    MR_Word Var_17 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 1))));
    MR_Word Var_18 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 2))));
    MR_Word Var_19 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 3))));
    MR_Word Var_20 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 4))));
    MR_Word Var_21 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 5))));
    MR_Word Var_22 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 6))));

    {
      MR_Word base;
      base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
      *STATE_VARIABLE_GoalInfo_7 = base;
      MR_hl_field(0, base, 0) = (MR_Box) (((((MR_Unsigned) (Var_15) << 2)) | (MR_Unsigned) (X_4)));
      MR_hl_field(0, base, 1) = ((MR_Box) (Var_17));
      MR_hl_field(0, base, 2) = ((MR_Box) (Var_18));
      MR_hl_field(0, base, 3) = ((MR_Box) (Var_19));
      MR_hl_field(0, base, 4) = ((MR_Box) (Var_20));
      MR_hl_field(0, base, 5) = ((MR_Box) (Var_21));
      MR_hl_field(0, base, 6) = ((MR_Box) (Var_22));
    }
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_set_determinism_3_p_0(
  MR_Word X_4,
  MR_Word STATE_VARIABLE_GoalInfo_0_6,
  MR_Word * STATE_VARIABLE_GoalInfo_7)
{
  MR_Word Var_9 = ((MR_Unsigned) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 0))) & (MR_Integer) 3);
  MR_Word Var_10 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 1))));
  MR_Word Var_11 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 2))));
  MR_Word Var_12 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 3))));
  MR_Word Var_13 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 4))));
  MR_Word Var_14 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 5))));
  MR_Word Var_15 = ((MR_Word) ((MR_hl_field(0, STATE_VARIABLE_GoalInfo_0_6, (MR_Integer) 6))));

  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *STATE_VARIABLE_GoalInfo_7 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (((((MR_Unsigned) (X_4) << 2)) | (MR_Unsigned) (Var_9)));
    MR_hl_field(0, base, 1) = ((MR_Box) (Var_10));
    MR_hl_field(0, base, 2) = ((MR_Box) (Var_11));
    MR_hl_field(0, base, 3) = ((MR_Box) (Var_12));
    MR_hl_field(0, base, 4) = ((MR_Box) (Var_13));
    MR_hl_field(0, base, 5) = ((MR_Box) (Var_14));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_15));
  }
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_maybe_dp_info_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word X_4;
  MR_Word Var_5 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  X_4 = ((MR_Word) ((MR_hl_field(0, Var_5, (MR_Integer) 7))));
  return X_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_maybe_mode_constr_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word X_4;
  MR_Word Var_5 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  X_4 = ((MR_Word) ((MR_hl_field(0, Var_5, (MR_Integer) 6))));
  return X_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_maybe_rbmm_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word X_4;
  MR_Word Var_5 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  X_4 = ((MR_Word) ((MR_hl_field(0, Var_5, (MR_Integer) 5))));
  return X_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_maybe_ctgc_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word X_4;
  MR_Word Var_5 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  X_4 = ((MR_Word) ((MR_hl_field(0, Var_5, (MR_Integer) 4))));
  return X_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_goal_mode_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word X_4;
  MR_Word Var_5 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  X_4 = ((MR_Word) ((MR_hl_field(0, Var_5, (MR_Integer) 3))));
  return X_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_higher_order_value_map_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word X_4;
  MR_Word Var_5 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  X_4 = ((MR_Word) ((MR_hl_field(0, Var_5, (MR_Integer) 2))));
  return X_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_reverse_goal_path_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word X_4;
  MR_Word Var_5 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  X_4 = ((MR_Word) ((MR_hl_field(0, Var_5, (MR_Integer) 1))));
  return X_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_context_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word X_4;
  MR_Word Var_5 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 6))));

  X_4 = ((MR_Word) ((MR_hl_field(0, Var_5, (MR_Integer) 0))));
  return X_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_code_gen_info_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word X_4 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 5))));

  return X_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_goal_id_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word X_4 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 4))));

  return X_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_features_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word X_4 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 3))));

  return X_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_nonlocals_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word X_4 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 2))));

  return X_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_instmap_delta_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word X_4 = ((MR_Word) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 1))));

  return X_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_purity_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word X_4 = ((MR_Unsigned) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 0))) & (MR_Integer) 3);

  return X_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__goal_info_get_determinism_1_f_0(
  MR_Word GoalInfo_3)
{
  MR_Word X_4 = ((((MR_Unsigned) ((MR_hl_field(0, GoalInfo_3, (MR_Integer) 0))) >> 2)) & (MR_Integer) 7);

  return X_4;
}

MR_Word MR_CALL 
hlds__hlds_goal__impure_unreachable_init_goal_info_2_f_0(
  MR_Word NonLocals_4,
  MR_Word Determinism_5)
{
  MR_Word GoalInfo_6;
  MR_Word InstMapDelta_7;
  MR_Word GoalInfo0_8;
  MR_Word Features0_11;
  MR_Word Features_12;
  MR_Word Var_23;
  MR_Word Var_24;
  MR_Word Var_26;
  MR_Word Var_27;
  MR_Word Var_28;
  MR_Unsigned packed_word_1;

  hlds__instmap__instmap_delta_init_unreachable_1_p_0(&InstMapDelta_7);
  hlds__hlds_goal__goal_info_init_5_p_0(NonLocals_4, InstMapDelta_7, Determinism_5, (MR_Integer) 2, &GoalInfo0_8);
  Features0_11 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 3))));
  mercury__set__insert_3_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_feature_0), ((MR_Box) ((MR_Integer) 2)), Features0_11, &Features_12);
  packed_word_1 = (MR_Unsigned) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 0)));
  Var_23 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 1))));
  Var_24 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 2))));
  Var_26 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 4))));
  Var_27 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 5))));
  Var_28 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_8, (MR_Integer) 6))));
  {
    GoalInfo_6 = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, GoalInfo_6, 0) = (MR_Box) (packed_word_1);
    MR_hl_field(0, GoalInfo_6, 1) = ((MR_Box) (Var_23));
    MR_hl_field(0, GoalInfo_6, 2) = ((MR_Box) (Var_24));
    MR_hl_field(0, GoalInfo_6, 3) = ((MR_Box) (Features_12));
    MR_hl_field(0, GoalInfo_6, 4) = ((MR_Box) (Var_26));
    MR_hl_field(0, GoalInfo_6, 5) = ((MR_Box) (Var_27));
    MR_hl_field(0, GoalInfo_6, 6) = ((MR_Box) (Var_28));
  }
  return GoalInfo_6;
}

MR_Word MR_CALL 
hlds__hlds_goal__impure_reachable_init_goal_info_2_f_0(
  MR_Word NonLocals_4,
  MR_Word Determinism_5)
{
  MR_Word GoalInfo_6;
  MR_Word InstMapDelta_7;

  hlds__instmap__instmap_delta_init_reachable_1_p_0(&InstMapDelta_7);
  hlds__hlds_goal__goal_info_init_5_p_0(NonLocals_4, InstMapDelta_7, Determinism_5, (MR_Integer) 2, &GoalInfo_6);
  return GoalInfo_6;
}

MR_Word MR_CALL 
hlds__hlds_goal__impure_init_goal_info_3_f_0(
  MR_Word NonLocals_5,
  MR_Word InstMapDelta_6,
  MR_Word Determinism_7)
{
  MR_Word GoalInfo_8;
  MR_Word GoalInfo0_9;
  MR_Word Features0_12;
  MR_Word Features_13;
  MR_Word Var_24;
  MR_Word Var_25;
  MR_Word Var_27;
  MR_Word Var_28;
  MR_Word Var_29;
  MR_Unsigned packed_word_1;

  hlds__hlds_goal__goal_info_init_5_p_0(NonLocals_5, InstMapDelta_6, Determinism_7, (MR_Integer) 2, &GoalInfo0_9);
  Features0_12 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_9, (MR_Integer) 3))));
  mercury__set__insert_3_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_feature_0), ((MR_Box) ((MR_Integer) 2)), Features0_12, &Features_13);
  packed_word_1 = (MR_Unsigned) ((MR_hl_field(0, GoalInfo0_9, (MR_Integer) 0)));
  Var_24 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_9, (MR_Integer) 1))));
  Var_25 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_9, (MR_Integer) 2))));
  Var_27 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_9, (MR_Integer) 4))));
  Var_28 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_9, (MR_Integer) 5))));
  Var_29 = ((MR_Word) ((MR_hl_field(0, GoalInfo0_9, (MR_Integer) 6))));
  {
    GoalInfo_8 = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, GoalInfo_8, 0) = (MR_Box) (packed_word_1);
    MR_hl_field(0, GoalInfo_8, 1) = ((MR_Box) (Var_24));
    MR_hl_field(0, GoalInfo_8, 2) = ((MR_Box) (Var_25));
    MR_hl_field(0, GoalInfo_8, 3) = ((MR_Box) (Features_13));
    MR_hl_field(0, GoalInfo_8, 4) = ((MR_Box) (Var_27));
    MR_hl_field(0, GoalInfo_8, 5) = ((MR_Box) (Var_28));
    MR_hl_field(0, GoalInfo_8, 6) = ((MR_Box) (Var_29));
  }
  return GoalInfo_8;
}

void MR_CALL 
hlds__hlds_goal__goal_info_init_context_purity_3_p_0(
  MR_Word Context_4,
  MR_Word Purity_5,
  MR_Word * GoalInfo_6)
{
  MR_Word InstMapDelta_8;
  MR_Word NonLocals_9;
  MR_Word Features_10;
  MR_Word Var_14;
  MR_Word HO_Values_17;
  MR_Word Var_19;

  hlds__instmap__instmap_delta_init_unreachable_1_p_0(&InstMapDelta_8);
  NonLocals_9 = parse_tree__set_of_var__init_0_f_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0));
  mercury__set__init_1_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_feature_0), &Features_10);
  HO_Values_17 = mercury__map__init_0_f_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), (MR_Word) (&hlds__hlds_goal_scalar_common_1[1]));
  Var_19 = hlds__goal_mode__make_dummy_goal_mode_0_f_0();
  {
    Var_14 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_14, 0) = ((MR_Box) (Context_4));
    MR_hl_field(0, Var_14, 1) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, Var_14, 2) = ((MR_Box) (HO_Values_17));
    MR_hl_field(0, Var_14, 3) = ((MR_Box) (Var_19));
    MR_hl_field(0, Var_14, 4) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, Var_14, 5) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, Var_14, 6) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, Var_14, 7) = ((MR_Box) ((MR_Unsigned) 0U));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *GoalInfo_6 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (((((MR_Unsigned) ((MR_Integer) 6) << 2)) | (MR_Unsigned) (Purity_5)));
    MR_hl_field(0, base, 1) = ((MR_Box) (InstMapDelta_8));
    MR_hl_field(0, base, 2) = ((MR_Box) (NonLocals_9));
    MR_hl_field(0, base, 3) = ((MR_Box) (Features_10));
    MR_hl_field(0, base, 4) = ((MR_Box) (((MR_Box) ((MR_Integer) -1))));
    MR_hl_field(0, base, 5) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_14));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_init_6_p_0(
  MR_Word NonLocals_7,
  MR_Word InstMapDelta_8,
  MR_Word Detism_9,
  MR_Word Purity_10,
  MR_Word Context_11,
  MR_Word * GoalInfo_12)
{
  MR_Word Features_13;
  MR_Word Var_17;
  MR_Word HO_Values_19;
  MR_Word Var_21;

  mercury__set__init_1_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_feature_0), &Features_13);
  HO_Values_19 = mercury__map__init_0_f_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), (MR_Word) (&hlds__hlds_goal_scalar_common_1[1]));
  Var_21 = hlds__goal_mode__make_dummy_goal_mode_0_f_0();
  {
    Var_17 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_17, 0) = ((MR_Box) (Context_11));
    MR_hl_field(0, Var_17, 1) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, Var_17, 2) = ((MR_Box) (HO_Values_19));
    MR_hl_field(0, Var_17, 3) = ((MR_Box) (Var_21));
    MR_hl_field(0, Var_17, 4) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, Var_17, 5) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, Var_17, 6) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, Var_17, 7) = ((MR_Box) ((MR_Unsigned) 0U));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *GoalInfo_12 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (((((MR_Unsigned) (Detism_9) << 2)) | (MR_Unsigned) (Purity_10)));
    MR_hl_field(0, base, 1) = ((MR_Box) (InstMapDelta_8));
    MR_hl_field(0, base, 2) = ((MR_Box) (NonLocals_7));
    MR_hl_field(0, base, 3) = ((MR_Box) (Features_13));
    MR_hl_field(0, base, 4) = ((MR_Box) (((MR_Box) ((MR_Integer) -1))));
    MR_hl_field(0, base, 5) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_17));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_init_5_p_0(
  MR_Word NonLocals_6,
  MR_Word InstMapDelta_7,
  MR_Word Detism_8,
  MR_Word Purity_9,
  MR_Word * GoalInfo_10)
{
  MR_Word Features_11;
  MR_Word Var_15;
  MR_Word Var_16;
  MR_Word HO_Values_18;
  MR_Word Var_20;

  mercury__set__init_1_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_feature_0), &Features_11);
  Var_16 = mercury__term_context__dummy_context_0_f_0();
  HO_Values_18 = mercury__map__init_0_f_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), (MR_Word) (&hlds__hlds_goal_scalar_common_1[1]));
  Var_20 = hlds__goal_mode__make_dummy_goal_mode_0_f_0();
  {
    Var_15 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_15, 0) = ((MR_Box) (Var_16));
    MR_hl_field(0, Var_15, 1) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, Var_15, 2) = ((MR_Box) (HO_Values_18));
    MR_hl_field(0, Var_15, 3) = ((MR_Box) (Var_20));
    MR_hl_field(0, Var_15, 4) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, Var_15, 5) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, Var_15, 6) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, Var_15, 7) = ((MR_Box) ((MR_Unsigned) 0U));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *GoalInfo_10 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (((((MR_Unsigned) (Detism_8) << 2)) | (MR_Unsigned) (Purity_9)));
    MR_hl_field(0, base, 1) = ((MR_Box) (InstMapDelta_7));
    MR_hl_field(0, base, 2) = ((MR_Box) (NonLocals_6));
    MR_hl_field(0, base, 3) = ((MR_Box) (Features_11));
    MR_hl_field(0, base, 4) = ((MR_Box) (((MR_Box) ((MR_Integer) -1))));
    MR_hl_field(0, base, 5) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_15));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_init_2_p_0(
  MR_Word Context_3,
  MR_Word * GoalInfo_4)
{
  MR_Word InstMapDelta_6;
  MR_Word NonLocals_7;
  MR_Word Features_8;
  MR_Word Var_13;
  MR_Word HO_Values_16;
  MR_Word Var_18;

  hlds__instmap__instmap_delta_init_unreachable_1_p_0(&InstMapDelta_6);
  NonLocals_7 = parse_tree__set_of_var__init_0_f_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0));
  mercury__set__init_1_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_feature_0), &Features_8);
  HO_Values_16 = mercury__map__init_0_f_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), (MR_Word) (&hlds__hlds_goal_scalar_common_1[1]));
  Var_18 = hlds__goal_mode__make_dummy_goal_mode_0_f_0();
  {
    Var_13 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_13, 0) = ((MR_Box) (Context_3));
    MR_hl_field(0, Var_13, 1) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, Var_13, 2) = ((MR_Box) (HO_Values_16));
    MR_hl_field(0, Var_13, 3) = ((MR_Box) (Var_18));
    MR_hl_field(0, Var_13, 4) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, Var_13, 5) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, Var_13, 6) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, Var_13, 7) = ((MR_Box) ((MR_Unsigned) 0U));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *GoalInfo_4 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (((((MR_Unsigned) ((MR_Integer) 6) << 2)) | (MR_Unsigned) ((MR_Integer) 0)));
    MR_hl_field(0, base, 1) = ((MR_Box) (InstMapDelta_6));
    MR_hl_field(0, base, 2) = ((MR_Box) (NonLocals_7));
    MR_hl_field(0, base, 3) = ((MR_Box) (Features_8));
    MR_hl_field(0, base, 4) = ((MR_Box) (((MR_Box) ((MR_Integer) -1))));
    MR_hl_field(0, base, 5) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_13));
  }
}

void MR_CALL 
hlds__hlds_goal__goal_info_init_1_p_0(
  MR_Word * GoalInfo_2)
{
  MR_Word InstMapDelta_4;
  MR_Word NonLocals_5;
  MR_Word Features_6;
  MR_Word Var_11;
  MR_Word Var_12;
  MR_Word HO_Values_15;
  MR_Word Var_17;

  hlds__instmap__instmap_delta_init_unreachable_1_p_0(&InstMapDelta_4);
  NonLocals_5 = parse_tree__set_of_var__init_0_f_0((MR_Word) (&parse_tree__prog_data__parse_tree__prog_data__type_ctor_info_prog_var_type_0));
  mercury__set__init_1_p_0((MR_Word) (&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_feature_0), &Features_6);
  Var_12 = mercury__term_context__dummy_context_0_f_0();
  HO_Values_15 = mercury__map__init_0_f_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]), (MR_Word) (&hlds__hlds_goal_scalar_common_1[1]));
  Var_17 = hlds__goal_mode__make_dummy_goal_mode_0_f_0();
  {
    Var_11 = (MR_Word) MR_new_object(MR_Word, (8 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, Var_11, 0) = ((MR_Box) (Var_12));
    MR_hl_field(0, Var_11, 1) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, Var_11, 2) = ((MR_Box) (HO_Values_15));
    MR_hl_field(0, Var_11, 3) = ((MR_Box) (Var_17));
    MR_hl_field(0, Var_11, 4) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, Var_11, 5) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, Var_11, 6) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, Var_11, 7) = ((MR_Box) ((MR_Unsigned) 0U));
  }
  {
    MR_Word base;
    base = (MR_Word) MR_new_object(MR_Word, (7 * sizeof(MR_Word)), NULL, NULL);
    *GoalInfo_2 = base;
    MR_hl_field(0, base, 0) = (MR_Box) (((((MR_Unsigned) ((MR_Integer) 6) << 2)) | (MR_Unsigned) ((MR_Integer) 0)));
    MR_hl_field(0, base, 1) = ((MR_Box) (InstMapDelta_4));
    MR_hl_field(0, base, 2) = ((MR_Box) (NonLocals_5));
    MR_hl_field(0, base, 3) = ((MR_Box) (Features_6));
    MR_hl_field(0, base, 4) = ((MR_Box) (((MR_Box) ((MR_Integer) -1))));
    MR_hl_field(0, base, 5) = ((MR_Box) ((MR_Unsigned) 0U));
    MR_hl_field(0, base, 6) = ((MR_Box) (Var_11));
  }
}

MR_Word MR_CALL 
hlds__hlds_goal__rbmm_info_init_0_f_0(void)
{
  MR_Word HeadVar__1_1;
  MR_Word Var_2;
  MR_Word Var_3;
  MR_Word Var_4;
  MR_Word Var_5;
  MR_Word Var_6;

  Var_2 = mercury__set__init_0_f_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]));
  Var_3 = mercury__set__init_0_f_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]));
  Var_4 = mercury__set__init_0_f_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]));
  Var_5 = mercury__set__init_0_f_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]));
  Var_6 = mercury__set__init_0_f_0((MR_Word) (&hlds__hlds_goal_scalar_common_1[0]));
  {
    HeadVar__1_1 = (MR_Word) MR_new_object(MR_Word, (5 * sizeof(MR_Word)), NULL, NULL);
    MR_hl_field(0, HeadVar__1_1, 0) = ((MR_Box) (Var_2));
    MR_hl_field(0, HeadVar__1_1, 1) = ((MR_Box) (Var_3));
    MR_hl_field(0, HeadVar__1_1, 2) = ((MR_Box) (Var_4));
    MR_hl_field(0, HeadVar__1_1, 3) = ((MR_Box) (Var_5));
    MR_hl_field(0, HeadVar__1_1, 4) = ((MR_Box) (Var_6));
  }
  return HeadVar__1_1;
}

MR_Word MR_CALL 
hlds__hlds_goal__generic_call_pred_or_func_1_f_0(
  MR_Word GenericCall_3)
{
  MR_Word PredOrFunc_4;

  switch (MR_tag((MR_Word) GenericCall_3)) {
    default: /*NOTREACHED*/ MR_assert(0);
    case (MR_Integer) 0:
      PredOrFunc_4 = ((MR_Unsigned) ((MR_hl_field(0, GenericCall_3, (MR_Integer) 1))) & (MR_Integer) 1);
      break;
    case (MR_Integer) 1:
      {
        MR_Word PFSymNameArity_11 = ((MR_Word) ((MR_hl_field(1, GenericCall_3, (MR_Integer) 3))));

        PredOrFunc_4 = ((MR_Unsigned) ((MR_hl_field(0, PFSymNameArity_11, (MR_Integer) 0))) & (MR_Integer) 1);
      }
      break;
    case (MR_Integer) 2:
    case (MR_Integer) 3:
      PredOrFunc_4 = (MR_Integer) 0;
      break;
  }
  return PredOrFunc_4;
}

void MR_CALL 
hlds__hlds_goal__generic_call_to_id_2_p_0(
  MR_Word GenericCall_3,
  MR_Word * GenericCallId_4)
{
  switch (MR_tag((MR_Word) GenericCall_3)) {
    default: /*NOTREACHED*/ MR_assert(0);
    case (MR_Integer) 0:
      {
        MR_Word PredFormArity_8 = ((MR_Word) ((MR_hl_field(0, GenericCall_3, (MR_Integer) 2))));
        MR_Unsigned packed_word_1 = (MR_Unsigned) ((MR_hl_field(0, GenericCall_3, (MR_Integer) 1)));

        {
          MR_Word base;
          base = (MR_Word) MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL);
          *GenericCallId_4 = base;
          MR_hl_field(0, base, 0) = (MR_Box) (packed_word_1);
          MR_hl_field(0, base, 1) = ((MR_Box) (PredFormArity_8));
        }
      }
      break;
    case (MR_Integer) 1:
      {
        MR_Word ClassId_11 = ((MR_Word) ((MR_hl_field(1, GenericCall_3, (MR_Integer) 2))));
        MR_Word MethodId_12 = ((MR_Word) ((MR_hl_field(1, GenericCall_3, (MR_Integer) 3))));

        {
          MR_Word base;
          base = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
          *GenericCallId_4 = base;
          MR_hl_field(1, base, 0) = ((MR_Box) (ClassId_11));
          MR_hl_field(1, base, 1) = ((MR_Box) (MethodId_12));
        }
      }
      break;
    case (MR_Integer) 2:
      {
        MR_String EventName_13 = ((MR_String) ((MR_hl_field(2, GenericCall_3, (MR_Integer) 0))));

        {
          MR_Word base;
          base = (MR_Word) MR_mkword(2, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
          *GenericCallId_4 = base;
          MR_hl_field(2, base, 0) = ((MR_Box) (EventName_13));
        }
      }
      break;
    case (MR_Integer) 3:
      {
        MR_Word CastType_14 = ((MR_Unsigned) ((MR_hl_field(3, GenericCall_3, (MR_Integer) 0))) & (MR_Integer) 7);

        {
          MR_Word base;
          base = (MR_Word) MR_mkword(3, MR_new_object(MR_Word, (1 * sizeof(MR_Word)), NULL, NULL));
          *GenericCallId_4 = base;
          MR_hl_field(3, base, 0) = (MR_Box) ((MR_Unsigned) (CastType_14));
        }
      }
      break;
  }
}

void MR_CALL 
hlds__hlds_goal__make_foreign_args_4_p_0(
  MR_Word Vars_5,
  MR_Word NamesModesBoxes_6,
  MR_Word Types_7,
  MR_Word * Args_8)
{
  MR_bool succeeded = (Vars_5 != (MR_Word) ((MR_Unsigned) 0U));
  MR_Word Var_9;
  MR_Word VarsTail_10;
  MR_Word NameModeBox_11;
  MR_Word NamesModesBoxesTail_12;
  MR_Word Type_13;
  MR_Word TypesTail_14;

  if (succeeded)
  {
    Var_9 = ((MR_Word) ((MR_hl_field(1, Vars_5, (MR_Integer) 0))));
    VarsTail_10 = ((MR_Word) ((MR_hl_field(1, Vars_5, (MR_Integer) 1))));
    succeeded = (NamesModesBoxes_6 != (MR_Word) ((MR_Unsigned) 0U));
    if (succeeded)
    {
      NameModeBox_11 = ((MR_Word) ((MR_hl_field(1, NamesModesBoxes_6, (MR_Integer) 0))));
      NamesModesBoxesTail_12 = ((MR_Word) ((MR_hl_field(1, NamesModesBoxes_6, (MR_Integer) 1))));
      succeeded = (Types_7 != (MR_Word) ((MR_Unsigned) 0U));
      if (succeeded)
      {
        Type_13 = ((MR_Word) ((MR_hl_field(1, Types_7, (MR_Integer) 0))));
        TypesTail_14 = ((MR_Word) ((MR_hl_field(1, Types_7, (MR_Integer) 1))));
      }
    }
  }
  if (succeeded)
  {
    MR_Word ArgsTail_15;
    MR_Word MaybeNameMode_16;
    MR_Word Box_17;
    MR_Word Arg_18;

    hlds__hlds_goal__make_foreign_args_4_p_0(VarsTail_10, NamesModesBoxesTail_12, TypesTail_14, &ArgsTail_15);
    MaybeNameMode_16 = ((MR_Word) ((MR_hl_field(0, NameModeBox_11, (MR_Integer) 0))));
    Box_17 = ((MR_Unsigned) ((MR_hl_field(0, NameModeBox_11, (MR_Integer) 1))) & (MR_Integer) 1);
    {
      Arg_18 = (MR_Word) MR_new_object(MR_Word, (4 * sizeof(MR_Word)), NULL, NULL);
      MR_hl_field(0, Arg_18, 0) = ((MR_Box) (Var_9));
      MR_hl_field(0, Arg_18, 1) = ((MR_Box) (MaybeNameMode_16));
      MR_hl_field(0, Arg_18, 2) = ((MR_Box) (Type_13));
      MR_hl_field(0, Arg_18, 3) = (MR_Box) ((MR_Unsigned) (Box_17));
    }
    {
      MR_Word base;
      base = (MR_Word) MR_mkword(1, MR_new_object(MR_Word, (2 * sizeof(MR_Word)), NULL, NULL));
      *Args_8 = base;
      MR_hl_field(1, base, 0) = ((MR_Box) (Arg_18));
      MR_hl_field(1, base, 1) = ((MR_Box) (ArgsTail_15));
    }
  }
  else
  {
    succeeded = (Vars_5 == (MR_Word) ((MR_Unsigned) 0U));
    if (succeeded)
    {
      succeeded = (NamesModesBoxes_6 == (MR_Word) ((MR_Unsigned) 0U));
      if (succeeded)
        succeeded = (Types_7 == (MR_Word) ((MR_Unsigned) 0U));
    }
    if (succeeded)
      *Args_8 = (MR_Word) ((MR_Unsigned) 0U);
    else
      {
        mercury__require__unexpected_2_p_0((MR_String) "predicate \140hlds.hlds_goal.make_foreign_args\'/4", (MR_String) "unmatched lists");
        return;
      }
  }
}

MR_Word MR_CALL 
hlds__hlds_goal__foreign_arg_box_1_f_0(
  MR_Word Arg_3)
{
  MR_Word HeadVar__2_2 = ((MR_Unsigned) ((MR_hl_field(0, Arg_3, (MR_Integer) 3))) & (MR_Integer) 1);

  return HeadVar__2_2;
}

MR_Word MR_CALL 
hlds__hlds_goal__foreign_arg_type_1_f_0(
  MR_Word Arg_3)
{
  MR_Word HeadVar__2_2 = ((MR_Word) ((MR_hl_field(0, Arg_3, (MR_Integer) 2))));

  return HeadVar__2_2;
}

MR_Word MR_CALL 
hlds__hlds_goal__foreign_arg_maybe_name_mode_1_f_0(
  MR_Word Arg_3)
{
  MR_Word HeadVar__2_2 = ((MR_Word) ((MR_hl_field(0, Arg_3, (MR_Integer) 1))));

  return HeadVar__2_2;
}

MR_Word MR_CALL 
hlds__hlds_goal__foreign_arg_var_1_f_0(
  MR_Word Arg_3)
{
  MR_Word HeadVar__2_2 = ((MR_Word) ((MR_hl_field(0, Arg_3, (MR_Integer) 0))));

  return HeadVar__2_2;
}

MR_Word MR_CALL 
hlds__hlds_goal__get_hlds_goal_info_1_f_0(
  MR_Word Goal_3)
{
  MR_Word HeadVar__2_2 = ((MR_Word) ((MR_hl_field(0, Goal_3, (MR_Integer) 1))));

  return HeadVar__2_2;
}

MR_Word MR_CALL 
hlds__hlds_goal__get_hlds_goal_expr_1_f_0(
  MR_Word Goal_3)
{
  MR_Word HeadVar__2_2 = ((MR_Word) ((MR_hl_field(0, Goal_3, (MR_Integer) 0))));

  return HeadVar__2_2;
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____atomic_goal_type_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____atomic_goal_type_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____atomic_goal_type_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____atomic_goal_type_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____atomic_interface_vars_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____atomic_interface_vars_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____atomic_interface_vars_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____atomic_interface_vars_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____builtin_state_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____builtin_state_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____builtin_state_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____builtin_state_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____call_unify_context_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____call_unify_context_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____call_unify_context_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____call_unify_context_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____can_cgc_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____can_cgc_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____can_cgc_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____can_cgc_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____case_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____case_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____case_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____case_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____case_id_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____case_id_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____case_id_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____case_id_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____cast_kind_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____cast_kind_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____cast_kind_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____cast_kind_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____catch_part_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____catch_part_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____catch_part_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____catch_part_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____cell_is_unique_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____cell_is_unique_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____cell_is_unique_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____cell_is_unique_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____cell_to_reuse_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____cell_to_reuse_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____cell_to_reuse_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____cell_to_reuse_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____conj_type_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____conj_type_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____conj_type_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____conj_type_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____construct_sub_info_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____construct_sub_info_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____construct_sub_info_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____construct_sub_info_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____contains_trace_goal_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____contains_trace_goal_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____contains_trace_goal_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____contains_trace_goal_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____ctgc_goal_info_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____ctgc_goal_info_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____ctgc_goal_info_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____ctgc_goal_info_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____dp_coverage_goal_info_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____dp_coverage_goal_info_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____dp_coverage_goal_info_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____dp_coverage_goal_info_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____dp_goal_info_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____dp_goal_info_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____dp_goal_info_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____dp_goal_info_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____force_pruning_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____force_pruning_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____force_pruning_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____force_pruning_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____foreign_arg_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____foreign_arg_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____foreign_arg_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____foreign_arg_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____from_ground_term_kind_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____from_ground_term_kind_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____from_ground_term_kind_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____from_ground_term_kind_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____generic_call_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____generic_call_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____generic_call_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____generic_call_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____goal_feature_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____goal_feature_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____goal_feature_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____goal_feature_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____goal_is_mdprof_inst_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____goal_is_mdprof_inst_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____goal_is_mdprof_inst_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____goal_is_mdprof_inst_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____goal_trivial_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____goal_trivial_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____goal_trivial_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____goal_trivial_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____higher_order_value_map_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____higher_order_value_map_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____higher_order_value_map_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____higher_order_value_map_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____hlds_goal_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____hlds_goal_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____hlds_goal_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____hlds_goal_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____hlds_goal_code_gen_info_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____hlds_goal_code_gen_info_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____hlds_goal_code_gen_info_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____hlds_goal_code_gen_info_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____hlds_goal_expr_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____hlds_goal_expr_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____hlds_goal_expr_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____hlds_goal_expr_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____hlds_goal_extra_info_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____hlds_goal_extra_info_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____hlds_goal_extra_info_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____hlds_goal_extra_info_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____hlds_goal_info_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____hlds_goal_info_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____hlds_goal_info_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____hlds_goal_info_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____hlds_goals_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____hlds_goals_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____hlds_goals_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____hlds_goals_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____how_to_construct_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____how_to_construct_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____how_to_construct_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____how_to_construct_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____incremental_rename_map_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____incremental_rename_map_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____incremental_rename_map_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____incremental_rename_map_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____is_conditional_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____is_conditional_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____is_conditional_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____is_conditional_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____is_exist_constr_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____is_exist_constr_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____is_exist_constr_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____is_exist_constr_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____is_first_disjunct_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____is_first_disjunct_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____is_first_disjunct_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____is_first_disjunct_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____lc_use_parent_stack_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____lc_use_parent_stack_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____lc_use_parent_stack_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____lc_use_parent_stack_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____missed_message_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____missed_message_0_0(((MR_String) (wrapper_arg_1)), ((MR_String) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____missed_message_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____missed_message_0_0(&conv0_HeadVar__1_1, ((MR_String) (wrapper_arg_2)), ((MR_String) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____mode_constr_goal_info_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____mode_constr_goal_info_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____mode_constr_goal_info_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____mode_constr_goal_info_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____needs_update_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____needs_update_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____needs_update_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____needs_update_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____port_counts_give_coverage_after_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____port_counts_give_coverage_after_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____port_counts_give_coverage_after_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____port_counts_give_coverage_after_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____promise_solutions_kind_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____promise_solutions_kind_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____promise_solutions_kind_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____promise_solutions_kind_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____quant_creator_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____quant_creator_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____quant_creator_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____quant_creator_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____rbmm_goal_info_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____rbmm_goal_info_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____rbmm_goal_info_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____rbmm_goal_info_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____removable_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____removable_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____removable_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____removable_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____reuse_description_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____reuse_description_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____reuse_description_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____reuse_description_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____scope_reason_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____scope_reason_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____scope_reason_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____scope_reason_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____short_reuse_description_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____short_reuse_description_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____short_reuse_description_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____short_reuse_description_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____shorthand_goal_expr_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____shorthand_goal_expr_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____shorthand_goal_expr_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____shorthand_goal_expr_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____static_how_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____static_how_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____static_how_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____static_how_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____tagged_case_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____tagged_case_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____tagged_case_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____tagged_case_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____term_size_value_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____term_size_value_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____term_size_value_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____term_size_value_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____trace_mutable_var_hlds_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____trace_mutable_var_hlds_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____trace_mutable_var_hlds_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____trace_mutable_var_hlds_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____try_io_state_vars_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____try_io_state_vars_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____try_io_state_vars_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____try_io_state_vars_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____unification_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____unification_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____unification_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____unification_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____unify_context_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____unify_context_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____unify_context_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____unify_context_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____unify_main_context_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____unify_main_context_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____unify_main_context_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____unify_main_context_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____unify_mode_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____unify_mode_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____unify_mode_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____unify_mode_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____unify_rhs_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____unify_rhs_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____unify_rhs_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____unify_rhs_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____unify_sub_context_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____unify_sub_context_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____unify_sub_context_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____unify_sub_context_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

static MR_bool MR_CALL 
hlds__hlds_goal____Unify____unify_sub_contexts_0_0_10001(
  MR_Box wrapper_arg_1,
  MR_Box wrapper_arg_2)
{
  MR_bool succeeded;

  succeeded = hlds__hlds_goal____Unify____unify_sub_contexts_0_0(((MR_Word) (wrapper_arg_1)), ((MR_Word) (wrapper_arg_2)));
  return succeeded;
}

static void MR_CALL 
hlds__hlds_goal____Compare____unify_sub_contexts_0_0_10001(
  MR_Box * wrapper_arg_1,
  MR_Box wrapper_arg_2,
  MR_Box wrapper_arg_3)
{
  MR_Word conv0_HeadVar__1_1;

  hlds__hlds_goal____Compare____unify_sub_contexts_0_0(&conv0_HeadVar__1_1, ((MR_Word) (wrapper_arg_2)), ((MR_Word) (wrapper_arg_3)));
  *wrapper_arg_1 = ((MR_Box) (conv0_HeadVar__1_1));
}

void mercury__hlds__hlds_goal__init(void)
{
}

void mercury__hlds__hlds_goal__init_type_tables(void)
{
	static MR_bool initialised = MR_FALSE;
	if (initialised) return;
	initialised = MR_TRUE;

	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_atomic_goal_type_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_atomic_interface_vars_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_builtin_state_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_call_unify_context_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_can_cgc_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_case_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_case_id_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_cast_kind_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_catch_part_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_cell_is_unique_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_cell_to_reuse_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_conj_type_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_construct_sub_info_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_contains_trace_goal_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_ctgc_goal_info_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_dp_coverage_goal_info_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_dp_goal_info_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_force_pruning_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_foreign_arg_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_from_ground_term_kind_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_generic_call_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_feature_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_is_mdprof_inst_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_goal_trivial_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_higher_order_value_map_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_code_gen_info_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_expr_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_extra_info_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goal_info_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_hlds_goals_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_how_to_construct_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_incremental_rename_map_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_is_conditional_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_is_exist_constr_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_is_first_disjunct_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_lc_use_parent_stack_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_missed_message_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_mode_constr_goal_info_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_needs_update_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_port_counts_give_coverage_after_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_promise_solutions_kind_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_quant_creator_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_rbmm_goal_info_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_removable_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_reuse_description_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_scope_reason_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_short_reuse_description_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_shorthand_goal_expr_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_static_how_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_tagged_case_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_term_size_value_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_trace_mutable_var_hlds_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_try_io_state_vars_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unification_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_context_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_main_context_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_mode_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_rhs_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_sub_context_0);
	MR_register_type_ctor_info(&hlds__hlds_goal__hlds__hlds_goal__type_ctor_info_unify_sub_contexts_0);
}

void mercury__hlds__hlds_goal__init_debugger(void)
{
	MR_fatal_error("debugger initialization in MLDS grade");
}

// Ensure everything is compiled with the same grade.
const char *mercury__hlds__hlds_goal__grade_check(void)
{
    return &MR_GRADE_VAR;
}

// :- end_module hlds.hlds_goal.
