/*
**
** The C code is generated by ATS/Anairiats
** The compilation time is: 2020-11-6:  1h:10m
**
*/

/* include some .h files */
#ifndef _ATS_HEADER_NONE
#include "ats_config.h"
#include "ats_basics.h"
#include "ats_types.h"
#include "ats_exception.h"
#include "ats_memory.h"
#endif /* _ATS_HEADER_NONE */

/* include some .cats files */
#ifndef _ATS_PRELUDE_NONE
#include "prelude/CATS/basics.cats"
#include "prelude/CATS/bool.cats"
#include "prelude/CATS/char.cats"
#include "prelude/CATS/byte.cats"
#include "prelude/CATS/float.cats"
#include "prelude/CATS/integer.cats"
#include "prelude/CATS/integer_ptr.cats"
#include "prelude/CATS/integer_fixed.cats"
#include "prelude/CATS/sizetype.cats"
#include "prelude/CATS/pointer.cats"
#include "prelude/CATS/reference.cats"
#include "prelude/CATS/string.cats"
#include "prelude/CATS/lazy.cats"
#include "prelude/CATS/lazy_vt.cats"
#include "prelude/CATS/printf.cats"
#include "prelude/CATS/list.cats"
#include "prelude/CATS/option.cats"
#include "prelude/CATS/array.cats"
#include "prelude/CATS/matrix.cats"
#endif /* _ATS_PRELUDE_NONE */
/* prologues from statically loaded files */

#include "pats_location.cats"

#include "pats_location.cats"

#include "pats_location.cats"

#include "pats_location.cats"

#include "pats_location.cats"

#include "pats_location.cats"

#include "pats_lexbuf.cats"

#include "pats_location.cats"

#include "pats_location.cats"

#include "pats_location.cats"

#include "pats_location.cats"

#include "pats_location.cats"

#include "pats_lexbuf.cats"

#include "pats_location.cats"

#include "pats_location.cats"

#include "pats_location.cats"

#include "pats_location.cats"

#include "pats_location.cats"

#include "pats_lexbuf.cats"

#include "pats_location.cats"

#include "pats_location.cats"

#include "pats_location.cats"

#include "pats_location.cats"

#include "pats_location.cats"

#include "pats_lexbuf.cats"

#include "pats_location.cats"

#include "pats_location.cats"
/* external codes at top */
/* type definitions */
typedef
struct {
ats_ptr_type atslab_3 ;
ats_ptr_type atslab_4 ;
} anairiats_rec_0 ;

typedef struct {
ats_ptr_type atslab_0 ;
ats_ptr_type atslab_1 ;
} anairiats_sum_1 ;

typedef
struct {
ats_ptr_type atslab_s2exp_srt ;
ats_ptr_type atslab_s2exp_node ;
} anairiats_rec_2 ;

typedef struct {
int tag ;
ats_ptr_type atslab_0 ;
ats_ptr_type atslab_1 ;
ats_ptr_type atslab_2 ;
} anairiats_sum_3 ;

typedef struct {
int tag ;
ats_ptr_type atslab_0 ;
ats_int_type atslab_1 ;
ats_int_type atslab_2 ;
} anairiats_sum_4 ;

typedef struct {
int tag ;
ats_ptr_type atslab_0 ;
ats_int_type atslab_1 ;
ats_ptr_type atslab_2 ;
} anairiats_sum_5 ;

/* external typedefs */
/* external dynamic constructor declarations */
ATSextern_val(ats_sum_type, ATS_2d0_2e2_2e12_2prelude_2basics_sta_2esats__list_vt_cons_0) ;
ATSextern_val(ats_sum_type, ATS_2d0_2e2_2e12_2prelude_2basics_sta_2esats__list_vt_nil_1) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__STAERR_funclo_equal_2) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__STAERR_clokind_equal_3) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__STAERR_linearity_equal_4) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__STAERR_pfarity_equal_5) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__STAERR_s2eff_subeq_6) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__STAERR_boxity_equal_7) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__STAERR_tyreckind_equal_8) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__STAERR_s2exp_equal_11) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__STAERR_s2exp_tyleq_12) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__STAERR_s2Var_s2exp_solve_13) ;

/* external dynamic constant declarations */
ATSextern_fun(ats_void_type, atspre_vbox_make_view_ptr) (ats_ptr_type) ;
ATSextern_fun(ats_void_type, atspre_prerr_newline) () ;
ATSextern_fun(ats_int_type, atspre_add_int_int) (ats_int_type, ats_int_type) ;
ATSextern_fun(ats_bool_type, atspre_lt_int_int) (ats_int_type, ats_int_type) ;
ATSextern_fun(ats_bool_type, atspre_lte_int_int) (ats_int_type, ats_int_type) ;
ATSextern_fun(ats_bool_type, atspre_gt_int_int) (ats_int_type, ats_int_type) ;
ATSextern_fun(ats_void_type, atspre_prerr_int) (ats_int_type) ;
ATSextern_fun(ats_int_type, atspre_isucc) (ats_int_type) ;
ATSextern_fun(ats_int_type, atspre_iadd) (ats_int_type, ats_int_type) ;
ATSextern_fun(ats_int_type, atspre_isub) (ats_int_type, ats_int_type) ;
ATSextern_fun(ats_int_type, atspre_idiv) (ats_int_type, ats_int_type) ;
ATSextern_fun(ats_bool_type, atspre_ilt) (ats_int_type, ats_int_type) ;
ATSextern_fun(ats_bool_type, atspre_igt) (ats_int_type, ats_int_type) ;
ATSextern_fun(ats_bool_type, atspre_igte) (ats_int_type, ats_int_type) ;
ATSextern_fun(ats_size_type, atspre_size1_of_int1) (ats_int_type) ;
ATSextern_fun(ats_size_type, atspre_add_size1_int1) (ats_size_type, ats_int_type) ;
ATSextern_fun(ats_size_type, atspre_sub_size1_int1) (ats_size_type, ats_int_type) ;
ATSextern_fun(ats_size_type, atspre_mul2_size1_size1) (ats_size_type, ats_size_type) ;
ATSextern_fun(ats_bool_type, atspre_lt_size1_size1) (ats_size_type, ats_size_type) ;
ATSextern_fun(ats_bool_type, atspre_gt_size1_int1) (ats_size_type, ats_int_type) ;
ATSextern_fun(ats_bool_type, atspre_neq_size1_size1) (ats_size_type, ats_size_type) ;
ATSextern_fun(ats_ptr_type, atspre_ptr_alloc_tsz) (ats_size_type) ;
ATSextern_fun(ats_void_type, atspre_ptr_zero_tsz) (ats_ref_type, ats_size_type) ;
ATSextern_fun(ats_ptr_type, atspre_ref_make_elt_tsz) (ats_ref_type, ats_size_type) ;
ATSextern_fun(ats_void_type, atspre_prerr_string) (ats_ptr_type) ;
ATSextern_fun(ats_ptr_type, ListSubscriptException_make) () ;
ATSextern_fun(ats_ptr_type, atspre_array_ptr_alloc_tsz) (ats_size_type, ats_size_type) ;
ATSextern_fun(ats_void_type, atspre_array_ptr_free) (ats_ptr_type) ;
ATSextern_fun(ats_void_type, atspre_array_ptr_initialize_funenv_tsz) (ats_ref_type, ats_size_type, ats_ptr_type, ats_size_type, ats_ptr_type) ;
ATSextern_fun(ats_void_type, atspre_array_ptr_initialize_cloenv_tsz) (ats_ref_type, ats_size_type, ats_ref_type, ats_size_type, ats_ptr_type) ;
ATSextern_fun(ats_ptr_type, atspre_array_ptr_split_tsz) (ats_ptr_type, ats_size_type, ats_size_type) ;
ATSextern_fun(ats_ptr_type, atspre_array_ptr_takeout_tsz) (ats_ptr_type, ats_size_type, ats_size_type) ;
ATSextern_fun(anairiats_rec_0, atspre_array_ptr_takeout2_tsz) (ats_ptr_type, ats_size_type, ats_size_type, ats_size_type) ;
ATSextern_fun(ats_void_type, atspre_array_ptr_foreach_funenv_tsz) (ats_ref_type, ats_ptr_type, ats_size_type, ats_size_type, ats_ptr_type) ;
ATSextern_fun(ats_void_type, atspre_array_ptr_iforeach_funenv_tsz) (ats_ref_type, ats_ptr_type, ats_size_type, ats_size_type, ats_ptr_type) ;
ATSextern_fun(ats_ptr_type, atspre_array2_ptr_takeout_tsz) (ats_ptr_type, ats_size_type, ats_size_type, ats_size_type) ;
ATSextern_fun(ats_void_type, atslib_qsort) (ats_ref_type, ats_size_type, ats_size_type, ats_ptr_type) ;
ATSextern_fun(ats_void_type, _2tmp_2ATS_2dPostiats_2src_2pats_basics_2esats__prerr_funclo) (ats_ptr_type) ;
ATSextern_fun(ats_void_type, _2tmp_2ATS_2dPostiats_2src_2pats_location_2esats__prerr_location) (ats_ptr_type) ;
ATSextern_fun(ats_void_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__prerr_s2rt) (ats_ptr_type) ;
ATSextern_fun(ats_void_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__prerr_tyreckind) (ats_ptr_type) ;
ATSextern_fun(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__s2Var_get_srt) (ats_ptr_type) ;
ATSextern_fun(ats_void_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__prerr_s2eff) (ats_ptr_type) ;
ATSextern_fun(ats_void_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__pprerr_s2exp) (ats_ptr_type) ;
ATSextern_fun(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__the_staerrlst_get) (ats_ref_type) ;

/* external dynamic terminating constant declarations */
#ifdef _ATS_PROOFCHECK
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2SATS_2list_2esats__list_length_is_nonnegative_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2SATS_2list_vt_2esats__list_vt_length_is_nonnegative_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2SATS_2array_2esats__array_v_takeout2_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_vt_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_vt_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_vt_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_vt_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_vt_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2list_vt_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2array_2edats____copy_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2array_2edats____free_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2array_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2prelude_2DATS_2array_2edats____assert_prfck () ;
#endif /* _ATS_PROOFCHECK */

/* assuming abstract types */
/* sum constructor declarations */
/* exn constructor declarations */
/* global dynamic (non-functional) constant declarations */
/* internal function declarations */
static
ats_void_type prerr_FILENAME_02083_ () ;
static
ats_ptr_type ref_01088_ats_int_type (ats_int_type arg0) ;
static
ats_ptr_type ref_01088_ats_ptr_type (ats_ptr_type arg0) ;
static
ats_void_type loop_5 (ats_ptr_type arg0) ;
static
ats_void_type list_vt_free_01499_ats_ptr_type (ats_ptr_type arg0) ;
static
ats_ptr_type revapp_10 (ats_ptr_type arg0, ats_ptr_type arg1) ;
static
ats_ptr_type list_vt_reverse_append_01507_ats_ptr_type (ats_ptr_type arg0, ats_ptr_type arg1) ;
static
ats_ptr_type list_vt_reverse_01506_ats_ptr_type (ats_ptr_type arg0) ;
static
ats_void_type prerr_error3_loc_02089_ (ats_ptr_type arg0) ;
static
ats_void_type prerr_staerr_funclo_equal_11 (ats_ptr_type arg0, ats_ptr_type arg1, ats_ptr_type arg2) ;
static
ats_void_type prerr_staerr_clokind_equal_13 (ats_ptr_type arg0, ats_int_type arg1, ats_int_type arg2) ;
static
ats_void_type prerr_staerr_linearity_equal_14 (ats_ptr_type arg0, ats_int_type arg1, ats_int_type arg2) ;
static
ats_void_type prerr_staerr_pfarity_equal_15 (ats_ptr_type arg0, ats_int_type arg1, ats_int_type arg2) ;
static
ats_void_type prerr_staerr_s2eff_subeq_16 (ats_ptr_type arg0, ats_ptr_type arg1, ats_ptr_type arg2) ;
static
ats_void_type prerr_staerr_boxity_equal_17 (ats_ptr_type arg0, ats_int_type arg1, ats_ptr_type arg2) ;
static
ats_void_type prerr_staerr_tyreckind_equal_18 (ats_ptr_type arg0, ats_ptr_type arg1, ats_ptr_type arg2) ;
static
ats_void_type prerr_staerr_s2exp_equal_19 (ats_ptr_type arg0, ats_ptr_type arg1, ats_ptr_type arg2) ;
static
ats_void_type prerr_staerr_s2exp_tyleq_20 (ats_ptr_type arg0, ats_ptr_type arg1, ats_ptr_type arg2) ;
static
ats_void_type prerr_staerr_s2Var_s2exp_solve_21 (ats_ptr_type arg0, ats_ptr_type arg1, ats_ptr_type arg2) ;
static
ats_void_type loop_23 (ats_ptr_type arg0) ;

/* partial value template declarations */
/* static temporary variable declarations */
ATSstatic (ats_ptr_type, statmp1) ;
ATSstatic (ats_ptr_type, statmp4) ;
ATSstatic (ats_ptr_type, statmp7) ;

/* external value variable declarations */

/* function implementations */

/*
// /tmp/ATS-Postiats/src/pats_staexp2_error.dats: 1608(line=47, offs=28) -- 1639(line=47, offs=59)
*/
ATSstaticdec()
ats_void_type
prerr_FILENAME_02083_ () {
/* local vardec */
// ATSlocal_void (tmp0) ;

__ats_lab_prerr_FILENAME_02083_:
/* tmp0 = */ atspre_prerr_string (ATSstrcst("pats_staexp2_error")) ;
return /* (tmp0) */ ;
} /* end of [prerr_FILENAME_02083_] */

/*
// /nix/store/rfja8ixrs5wb4kj3kiwlch1apnh7qgvy-ats-0.2.12/lib/ats-anairiats-0.2.12/prelude/DATS/reference.dats: 1828(line=57, offs=18) -- 1902(line=59, offs=4)
*/
ATSstaticdec()
ats_ptr_type
ref_01088_ats_int_type (ats_int_type arg0) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp2) ;
ATSlocal (ats_int_type, tmp3) ;

__ats_lab_ref_01088_ats_int_type:
/* ats_int_type tmp3 ; */
tmp3 = arg0 ;
tmp2 = atspre_ref_make_elt_tsz ((&tmp3), sizeof(ats_int_type)) ;
return (tmp2) ;
} /* end of [ref_01088_ats_int_type] */

/*
// /nix/store/rfja8ixrs5wb4kj3kiwlch1apnh7qgvy-ats-0.2.12/lib/ats-anairiats-0.2.12/prelude/DATS/reference.dats: 1828(line=57, offs=18) -- 1902(line=59, offs=4)
*/
ATSstaticdec()
ats_ptr_type
ref_01088_ats_ptr_type (ats_ptr_type arg0) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp5) ;
ATSlocal (ats_ptr_type, tmp6) ;

__ats_lab_ref_01088_ats_ptr_type:
/* ats_ptr_type tmp6 ; */
tmp6 = arg0 ;
tmp5 = atspre_ref_make_elt_tsz ((&tmp6), sizeof(ats_ptr_type)) ;
return (tmp5) ;
} /* end of [ref_01088_ats_ptr_type] */

/*
// /nix/store/rfja8ixrs5wb4kj3kiwlch1apnh7qgvy-ats-0.2.12/lib/ats-anairiats-0.2.12/prelude/DATS/list_vt.dats: 4893(line=177, offs=7) -- 5015(line=178, offs=73)
*/
ATSstaticdec()
ats_void_type
loop_5 (ats_ptr_type arg0) {
/* local vardec */
// ATSlocal_void (tmp12) ;
ATSlocal (ats_ptr_type, tmp13) ;

__ats_lab_loop_5:
do {
/* branch: __ats_lab_0 */
__ats_lab_0_0:
if (arg0 == (ats_sum_ptr_type)0) { goto __ats_lab_1_0 ; }
__ats_lab_0_1:
tmp13 = ats_caselptrlab_mac(anairiats_sum_1, arg0, atslab_1) ;
ATS_FREE(arg0) ;
arg0 = tmp13 ;
goto __ats_lab_loop_5 ; // tail call
break ;

/* branch: __ats_lab_1 */
__ats_lab_1_0:
// if (arg0 != (ats_sum_ptr_type)0) { ats_deadcode_failure_handle () ; }
__ats_lab_1_1:
break ;
} while (0) ;
return /* (tmp12) */ ;
} /* end of [loop_5] */

/*
// /nix/store/rfja8ixrs5wb4kj3kiwlch1apnh7qgvy-ats-0.2.12/lib/ats-anairiats-0.2.12/prelude/DATS/list_vt.dats: 4875(line=176, offs=14) -- 5054(line=182, offs=4)
*/
ATSstaticdec()
ats_void_type
list_vt_free_01499_ats_ptr_type (ats_ptr_type arg0) {
/* local vardec */
// ATSlocal_void (tmp11) ;

__ats_lab_list_vt_free_01499_ats_ptr_type:
/* tmp11 = */ loop_5 (arg0) ;
return /* (tmp11) */ ;
} /* end of [list_vt_free_01499_ats_ptr_type] */

/*
// /tmp/ATS-Postiats/src/pats_staexp2_error.dats: 2070(line=74, offs=3) -- 2279(line=81, offs=2)
*/
ATSglobaldec()
ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__the_staerrlst_clear () {
/* local vardec */
// ATSlocal_void (tmp8) ;
ATSlocal (ats_ptr_type, tmp9) ;
// ATSlocal_void (tmp10) ;
ATSlocal (ats_ptr_type, tmp14) ;
ATSlocal (ats_ptr_type, tmp15) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__the_staerrlst_clear:
ats_ptrget_mac(ats_int_type, statmp1) = 0 ;
tmp9 = ats_selsin_mac(ats_castfn_mac(ats_ptr_type, statmp4), atslab_1) ;
tmp14 = ats_ptrget_mac(ats_ptr_type, tmp9) ;
/* tmp10 = */ list_vt_free_01499_ats_ptr_type (tmp14) ;
tmp15 = (ats_sum_ptr_type)0 ;
ats_ptrget_mac(ats_ptr_type, tmp9) = tmp15 ;
return /* (tmp8) */ ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__the_staerrlst_clear] */

/*
// /tmp/ATS-Postiats/src/pats_staexp2_error.dats: 2343(line=85, offs=3) -- 2649(line=96, offs=2)
*/
ATSglobaldec()
ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__the_staerrlst_add (ats_ptr_type arg0) {
/* local vardec */
// ATSlocal_void (tmp16) ;
ATSlocal (ats_ptr_type, tmp17) ;
ATSlocal (ats_int_type, tmp18) ;
ATSlocal (ats_int_type, tmp19) ;
ATSlocal (ats_bool_type, tmp20) ;
ATSlocal (ats_ptr_type, tmp21) ;
ATSlocal (ats_ptr_type, tmp22) ;
ATSlocal (ats_ptr_type, tmp23) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__the_staerrlst_add:
tmp17 = ats_selsin_mac(ats_castfn_mac(ats_ptr_type, statmp1), atslab_1) ;
tmp18 = ats_ptrget_mac(ats_int_type, tmp17) ;
tmp19 = atspre_add_int_int (tmp18, 1) ;
ats_ptrget_mac(ats_int_type, tmp17) = tmp19 ;
tmp20 = atspre_lt_int_int (tmp18, 100) ;
if (tmp20) {
tmp21 = ats_selsin_mac(ats_castfn_mac(ats_ptr_type, statmp4), atslab_1) ;
tmp23 = ats_ptrget_mac(ats_ptr_type, tmp21) ;
tmp22 = ATS_MALLOC(sizeof(anairiats_sum_1)) ;
ats_selptrset_mac(anairiats_sum_1, tmp22, atslab_0, arg0) ;
ats_selptrset_mac(anairiats_sum_1, tmp22, atslab_1, tmp23) ;
ats_ptrget_mac(ats_ptr_type, tmp21) = tmp22 ;
} else {
/* empty */
} /* end of [if] */
return /* (tmp16) */ ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__the_staerrlst_add] */

/*
// /nix/store/rfja8ixrs5wb4kj3kiwlch1apnh7qgvy-ats-0.2.12/lib/ats-anairiats-0.2.12/prelude/DATS/list_vt.dats: 7889(line=308, offs=7) -- 8174(line=317, offs=28)
*/
ATSstaticdec()
ats_ptr_type
revapp_10 (ats_ptr_type arg0, ats_ptr_type arg1) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp31) ;
ATSlocal (ats_ptr_type, tmp32) ;
ATSlocal (ats_ptr_type, tmp33) ;
ATSlocal (ats_ptr_type, tmp34) ;

__ats_lab_revapp_10:
do {
/* branch: __ats_lab_2 */
__ats_lab_2_0:
if (arg0 == (ats_sum_ptr_type)0) { goto __ats_lab_3_0 ; }
__ats_lab_2_1:
tmp32 = &ats_caselptrlab_mac(anairiats_sum_1, arg0, atslab_1) ;
tmp33 = ats_ptrget_mac(ats_ptr_type, tmp32) ;
ats_ptrget_mac(ats_ptr_type, tmp32) = arg1 ;
tmp34 = arg0 ;
arg0 = tmp33 ;
arg1 = tmp34 ;
goto __ats_lab_revapp_10 ; // tail call
break ;

/* branch: __ats_lab_3 */
__ats_lab_3_0:
// if (arg0 != (ats_sum_ptr_type)0) { ats_deadcode_failure_handle () ; }
__ats_lab_3_1:
tmp31 = arg1 ;
break ;
} while (0) ;
return (tmp31) ;
} /* end of [revapp_10] */

/*
// /nix/store/rfja8ixrs5wb4kj3kiwlch1apnh7qgvy-ats-0.2.12/lib/ats-anairiats-0.2.12/prelude/DATS/list_vt.dats: 7770(line=303, offs=24) -- 8220(line=321, offs=4)
*/
ATSstaticdec()
ats_ptr_type
list_vt_reverse_append_01507_ats_ptr_type (ats_ptr_type arg0, ats_ptr_type arg1) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp30) ;

__ats_lab_list_vt_reverse_append_01507_ats_ptr_type:
tmp30 = revapp_10 (arg0, arg1) ;
return (tmp30) ;
} /* end of [list_vt_reverse_append_01507_ats_ptr_type] */

/*
// /nix/store/rfja8ixrs5wb4kj3kiwlch1apnh7qgvy-ats-0.2.12/lib/ats-anairiats-0.2.12/prelude/DATS/list_vt.dats: 7652(line=298, offs=17) -- 7704(line=299, offs=46)
*/
ATSstaticdec()
ats_ptr_type
list_vt_reverse_01506_ats_ptr_type (ats_ptr_type arg0) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp29) ;
ATSlocal (ats_ptr_type, tmp35) ;

__ats_lab_list_vt_reverse_01506_ats_ptr_type:
tmp35 = (ats_sum_ptr_type)0 ;
tmp29 = list_vt_reverse_append_01507_ats_ptr_type (arg0, tmp35) ;
return (tmp29) ;
} /* end of [list_vt_reverse_01506_ats_ptr_type] */

/*
// /tmp/ATS-Postiats/src/pats_staexp2_error.dats: 2711(line=100, offs=3) -- 2918(line=107, offs=2)
*/
ATSglobaldec()
ats_ptr_type
_2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__the_staerrlst_get (ats_ref_type arg0) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp24) ;
ATSlocal (ats_int_type, tmp25) ;
ATSlocal (ats_ptr_type, tmp26) ;
ATSlocal (ats_ptr_type, tmp27) ;
ATSlocal (ats_ptr_type, tmp28) ;
ATSlocal (ats_ptr_type, tmp36) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__the_staerrlst_get:
tmp25 = ats_ptrget_mac(ats_int_type, statmp1) ;
ats_ptrget_mac(ats_int_type, arg0) = tmp25 ;
ats_ptrget_mac(ats_int_type, statmp1) = 0 ;
tmp26 = ats_selsin_mac(ats_castfn_mac(ats_ptr_type, statmp4), atslab_1) ;
tmp27 = ats_ptrget_mac(ats_ptr_type, tmp26) ;
tmp28 = list_vt_reverse_01506_ats_ptr_type (tmp27) ;
tmp36 = (ats_sum_ptr_type)0 ;
ats_ptrget_mac(ats_ptr_type, tmp26) = tmp36 ;
tmp24 = tmp28 ;
return (tmp24) ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__the_staerrlst_get] */

/*
// /tmp/ATS-Postiats/src/pats_errmsg.dats: 2341(line=88, offs=17) -- 2399(line=91, offs=2)
*/
ATSstaticdec()
ats_void_type
prerr_error3_loc_02089_ (ats_ptr_type arg0) {
/* local vardec */
// ATSlocal_void (tmp39) ;
// ATSlocal_void (tmp40) ;

__ats_lab_prerr_error3_loc_02089_:
/* tmp40 = */ _2tmp_2ATS_2dPostiats_2src_2pats_location_2esats__prerr_location (arg0) ;
/* tmp39 = */ atspre_prerr_string (ATSstrcst(": error(3)")) ;
return /* (tmp39) */ ;
} /* end of [prerr_error3_loc_02089_] */

/*
// /tmp/ATS-Postiats/src/pats_staexp2_error.dats: 3004(line=115, offs=4) -- 3312(line=122, offs=4)
*/
ATSstaticdec()
ats_void_type
prerr_staerr_funclo_equal_11 (ats_ptr_type arg0, ats_ptr_type arg1, ats_ptr_type arg2) {
/* local vardec */
// ATSlocal_void (tmp37) ;
// ATSlocal_void (tmp38) ;
// ATSlocal_void (tmp41) ;
// ATSlocal_void (tmp42) ;
// ATSlocal_void (tmp43) ;
// ATSlocal_void (tmp44) ;
// ATSlocal_void (tmp45) ;
// ATSlocal_void (tmp46) ;

__ats_lab_prerr_staerr_funclo_equal_11:
/* tmp38 = */ prerr_error3_loc_02089_ (arg0) ;
/* tmp41 = */ atspre_prerr_string (ATSstrcst(": function/closure mismatch:\n")) ;
/* tmp42 = */ atspre_prerr_string (ATSstrcst("The actual funclo kind is: ")) ;
/* tmp43 = */ _2tmp_2ATS_2dPostiats_2src_2pats_basics_2esats__prerr_funclo (arg1) ;
/* tmp44 = */ atspre_prerr_newline () ;
/* tmp45 = */ atspre_prerr_string (ATSstrcst("The needed funclo kind is: ")) ;
/* tmp46 = */ _2tmp_2ATS_2dPostiats_2src_2pats_basics_2esats__prerr_funclo (arg2) ;
/* tmp37 = */ atspre_prerr_newline () ;
return /* (tmp37) */ ;
} /* end of [prerr_staerr_funclo_equal_11] */

/*
// /tmp/ATS-Postiats/src/pats_staexp2_error.dats: 3355(line=124, offs=4) -- 3649(line=131, offs=4)
*/
ATSstaticdec()
ats_void_type
prerr_staerr_clokind_equal_13 (ats_ptr_type arg0, ats_int_type arg1, ats_int_type arg2) {
/* local vardec */
// ATSlocal_void (tmp47) ;
// ATSlocal_void (tmp48) ;
// ATSlocal_void (tmp49) ;
// ATSlocal_void (tmp50) ;
// ATSlocal_void (tmp51) ;
// ATSlocal_void (tmp52) ;
// ATSlocal_void (tmp53) ;
// ATSlocal_void (tmp54) ;

__ats_lab_prerr_staerr_clokind_equal_13:
/* tmp48 = */ prerr_error3_loc_02089_ (arg0) ;
/* tmp49 = */ atspre_prerr_string (ATSstrcst(": closure mismatch:\n")) ;
/* tmp50 = */ atspre_prerr_string (ATSstrcst("The actual closure kind is: ")) ;
/* tmp51 = */ atspre_prerr_int (arg1) ;
/* tmp52 = */ atspre_prerr_newline () ;
/* tmp53 = */ atspre_prerr_string (ATSstrcst("The needed closure kind is: ")) ;
/* tmp54 = */ atspre_prerr_int (arg2) ;
/* tmp47 = */ atspre_prerr_newline () ;
return /* (tmp47) */ ;
} /* end of [prerr_staerr_clokind_equal_13] */

/*
// /tmp/ATS-Postiats/src/pats_staexp2_error.dats: 3693(line=133, offs=4) -- 4090(line=144, offs=4)
*/
ATSstaticdec()
ats_void_type
prerr_staerr_linearity_equal_14 (ats_ptr_type arg0, ats_int_type arg1, ats_int_type arg2) {
/* local vardec */
// ATSlocal_void (tmp55) ;
// ATSlocal_void (tmp56) ;
// ATSlocal_void (tmp57) ;
// ATSlocal_void (tmp58) ;
// ATSlocal_void (tmp59) ;
ATSlocal (ats_ptr_type, tmp60) ;
ATSlocal (ats_bool_type, tmp61) ;
// ATSlocal_void (tmp62) ;
// ATSlocal_void (tmp63) ;
// ATSlocal_void (tmp64) ;
ATSlocal (ats_ptr_type, tmp65) ;
ATSlocal (ats_bool_type, tmp66) ;

__ats_lab_prerr_staerr_linearity_equal_14:
/* tmp56 = */ prerr_error3_loc_02089_ (arg0) ;
/* tmp57 = */ atspre_prerr_string (ATSstrcst(": linearity mismatch:\n")) ;
/* tmp58 = */ atspre_prerr_string (ATSstrcst("The actual linearity is: ")) ;
tmp61 = atspre_gt_int_int (arg1, 0) ;
if (tmp61) {
tmp60 = ATSstrcst("linear") ;
} else {
tmp60 = ATSstrcst("nonlinear") ;
} /* end of [if] */
/* tmp59 = */ atspre_prerr_string (tmp60) ;
/* tmp62 = */ atspre_prerr_newline () ;
/* tmp63 = */ atspre_prerr_string (ATSstrcst("The needed linearity is: ")) ;
tmp66 = atspre_gt_int_int (arg2, 0) ;
if (tmp66) {
tmp65 = ATSstrcst("linear") ;
} else {
tmp65 = ATSstrcst("nonlinear") ;
} /* end of [if] */
/* tmp64 = */ atspre_prerr_string (tmp65) ;
/* tmp55 = */ atspre_prerr_newline () ;
return /* (tmp55) */ ;
} /* end of [prerr_staerr_linearity_equal_14] */

/*
// /tmp/ATS-Postiats/src/pats_staexp2_error.dats: 4136(line=146, offs=4) -- 4432(line=153, offs=4)
*/
ATSstaticdec()
ats_void_type
prerr_staerr_pfarity_equal_15 (ats_ptr_type arg0, ats_int_type arg1, ats_int_type arg2) {
/* local vardec */
// ATSlocal_void (tmp67) ;
// ATSlocal_void (tmp68) ;
// ATSlocal_void (tmp69) ;
// ATSlocal_void (tmp70) ;
// ATSlocal_void (tmp71) ;
// ATSlocal_void (tmp72) ;
// ATSlocal_void (tmp73) ;
// ATSlocal_void (tmp74) ;

__ats_lab_prerr_staerr_pfarity_equal_15:
/* tmp68 = */ prerr_error3_loc_02089_ (arg0) ;
/* tmp69 = */ atspre_prerr_string (ATSstrcst(": proof arity mismatch:\n")) ;
/* tmp70 = */ atspre_prerr_string (ATSstrcst("The actual proof arity is: ")) ;
/* tmp71 = */ atspre_prerr_int (arg1) ;
/* tmp72 = */ atspre_prerr_newline () ;
/* tmp73 = */ atspre_prerr_string (ATSstrcst("The needed proof arity is: ")) ;
/* tmp74 = */ atspre_prerr_int (arg2) ;
/* tmp67 = */ atspre_prerr_newline () ;
return /* (tmp67) */ ;
} /* end of [prerr_staerr_pfarity_equal_15] */

/*
// /tmp/ATS-Postiats/src/pats_staexp2_error.dats: 4497(line=157, offs=4) -- 4812(line=164, offs=4)
*/
ATSstaticdec()
ats_void_type
prerr_staerr_s2eff_subeq_16 (ats_ptr_type arg0, ats_ptr_type arg1, ats_ptr_type arg2) {
/* local vardec */
// ATSlocal_void (tmp75) ;
// ATSlocal_void (tmp76) ;
// ATSlocal_void (tmp77) ;
// ATSlocal_void (tmp78) ;
// ATSlocal_void (tmp79) ;
// ATSlocal_void (tmp80) ;
// ATSlocal_void (tmp81) ;
// ATSlocal_void (tmp82) ;

__ats_lab_prerr_staerr_s2eff_subeq_16:
/* tmp76 = */ prerr_error3_loc_02089_ (arg0) ;
/* tmp77 = */ atspre_prerr_string (ATSstrcst(": maybe incurring disallowed effects:\n")) ;
/* tmp78 = */ atspre_prerr_string (ATSstrcst("The actual effects are: ")) ;
/* tmp79 = */ _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__prerr_s2eff (arg1) ;
/* tmp80 = */ atspre_prerr_newline () ;
/* tmp81 = */ atspre_prerr_string (ATSstrcst("The allowed effects are: ")) ;
/* tmp82 = */ _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__prerr_s2eff (arg2) ;
/* tmp75 = */ atspre_prerr_newline () ;
return /* (tmp75) */ ;
} /* end of [prerr_staerr_s2eff_subeq_16] */

/*
// /tmp/ATS-Postiats/src/pats_staexp2_error.dats: 4875(line=168, offs=4) -- 5080(line=178, offs=4)
*/
ATSstaticdec()
ats_void_type
prerr_staerr_boxity_equal_17 (ats_ptr_type arg0, ats_int_type arg1, ats_ptr_type arg2) {
/* local vardec */
// ATSlocal_void (tmp83) ;
// ATSlocal_void (tmp84) ;
// ATSlocal_void (tmp85) ;

__ats_lab_prerr_staerr_boxity_equal_17:
/* tmp84 = */ prerr_error3_loc_02089_ (arg0) ;
/* tmp85 = */ atspre_prerr_string (ATSstrcst(": boxity mismatch")) ;
/* tmp83 = */ atspre_prerr_newline () ;
return /* (tmp83) */ ;
} /* end of [prerr_staerr_boxity_equal_17] */

/*
// /tmp/ATS-Postiats/src/pats_staexp2_error.dats: 5123(line=180, offs=4) -- 5428(line=193, offs=4)
*/
ATSstaticdec()
ats_void_type
prerr_staerr_tyreckind_equal_18 (ats_ptr_type arg0, ats_ptr_type arg1, ats_ptr_type arg2) {
/* local vardec */
// ATSlocal_void (tmp86) ;
// ATSlocal_void (tmp87) ;
// ATSlocal_void (tmp88) ;
// ATSlocal_void (tmp89) ;
// ATSlocal_void (tmp90) ;
// ATSlocal_void (tmp91) ;

__ats_lab_prerr_staerr_tyreckind_equal_18:
/* tmp87 = */ prerr_error3_loc_02089_ (arg0) ;
/* tmp88 = */ atspre_prerr_string (ATSstrcst(": tyreckind mismatch: ")) ;
/* tmp89 = */ _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__prerr_tyreckind (arg1) ;
/* tmp90 = */ atspre_prerr_string (ATSstrcst(" <> ")) ;
/* tmp91 = */ _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__prerr_tyreckind (arg2) ;
/* tmp86 = */ atspre_prerr_newline () ;
return /* (tmp86) */ ;
} /* end of [prerr_staerr_tyreckind_equal_18] */

/*
// /tmp/ATS-Postiats/src/pats_staexp2_error.dats: 5492(line=197, offs=4) -- 5798(line=204, offs=4)
*/
ATSstaticdec()
ats_void_type
prerr_staerr_s2exp_equal_19 (ats_ptr_type arg0, ats_ptr_type arg1, ats_ptr_type arg2) {
/* local vardec */
// ATSlocal_void (tmp92) ;
// ATSlocal_void (tmp93) ;
// ATSlocal_void (tmp94) ;
// ATSlocal_void (tmp95) ;
// ATSlocal_void (tmp96) ;
// ATSlocal_void (tmp97) ;
// ATSlocal_void (tmp98) ;
// ATSlocal_void (tmp99) ;

__ats_lab_prerr_staerr_s2exp_equal_19:
/* tmp93 = */ prerr_error3_loc_02089_ (arg0) ;
/* tmp94 = */ atspre_prerr_string (ATSstrcst(": mismatch of static terms (equal):\n")) ;
/* tmp95 = */ atspre_prerr_string (ATSstrcst("The actual term is: ")) ;
/* tmp96 = */ _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__pprerr_s2exp (arg1) ;
/* tmp97 = */ atspre_prerr_newline () ;
/* tmp98 = */ atspre_prerr_string (ATSstrcst("The needed term is: ")) ;
/* tmp99 = */ _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__pprerr_s2exp (arg2) ;
/* tmp92 = */ atspre_prerr_newline () ;
return /* (tmp92) */ ;
} /* end of [prerr_staerr_s2exp_equal_19] */

/*
// /tmp/ATS-Postiats/src/pats_staexp2_error.dats: 5840(line=206, offs=4) -- 6146(line=213, offs=4)
*/
ATSstaticdec()
ats_void_type
prerr_staerr_s2exp_tyleq_20 (ats_ptr_type arg0, ats_ptr_type arg1, ats_ptr_type arg2) {
/* local vardec */
// ATSlocal_void (tmp100) ;
// ATSlocal_void (tmp101) ;
// ATSlocal_void (tmp102) ;
// ATSlocal_void (tmp103) ;
// ATSlocal_void (tmp104) ;
// ATSlocal_void (tmp105) ;
// ATSlocal_void (tmp106) ;
// ATSlocal_void (tmp107) ;

__ats_lab_prerr_staerr_s2exp_tyleq_20:
/* tmp101 = */ prerr_error3_loc_02089_ (arg0) ;
/* tmp102 = */ atspre_prerr_string (ATSstrcst(": mismatch of static terms (tyleq):\n")) ;
/* tmp103 = */ atspre_prerr_string (ATSstrcst("The actual term is: ")) ;
/* tmp104 = */ _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__pprerr_s2exp (arg1) ;
/* tmp105 = */ atspre_prerr_newline () ;
/* tmp106 = */ atspre_prerr_string (ATSstrcst("The needed term is: ")) ;
/* tmp107 = */ _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__pprerr_s2exp (arg2) ;
/* tmp100 = */ atspre_prerr_newline () ;
return /* (tmp100) */ ;
} /* end of [prerr_staerr_s2exp_tyleq_20] */

/*
// /tmp/ATS-Postiats/src/pats_staexp2_error.dats: 6188(line=215, offs=4) -- 6754(line=233, offs=4)
*/
ATSstaticdec()
ats_void_type
prerr_staerr_s2Var_s2exp_solve_21 (ats_ptr_type arg0, ats_ptr_type arg1, ats_ptr_type arg2) {
/* local vardec */
// ATSlocal_void (tmp108) ;
ATSlocal (ats_ptr_type, tmp109) ;
ATSlocal (ats_ptr_type, tmp110) ;
// ATSlocal_void (tmp111) ;
// ATSlocal_void (tmp112) ;
// ATSlocal_void (tmp113) ;
// ATSlocal_void (tmp114) ;
// ATSlocal_void (tmp115) ;
// ATSlocal_void (tmp116) ;
// ATSlocal_void (tmp117) ;

__ats_lab_prerr_staerr_s2Var_s2exp_solve_21:
tmp109 = _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__s2Var_get_srt (arg1) ;
tmp110 = ats_selbox_mac(ats_castptr_mac(anairiats_rec_2, arg2), atslab_s2exp_srt) ;
/* tmp111 = */ prerr_error3_loc_02089_ (arg0) ;
/* tmp112 = */ atspre_prerr_string (ATSstrcst(": mismatch of sorts in unification:\n")) ;
/* tmp113 = */ atspre_prerr_string (ATSstrcst("The sort of variable is: ")) ;
/* tmp114 = */ _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__prerr_s2rt (tmp109) ;
/* tmp115 = */ atspre_prerr_newline () ;
/* tmp116 = */ atspre_prerr_string (ATSstrcst("The sort of solution is: ")) ;
/* tmp117 = */ _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__prerr_s2rt (tmp110) ;
/* tmp108 = */ atspre_prerr_newline () ;
return /* (tmp108) */ ;
} /* end of [prerr_staerr_s2Var_s2exp_solve_21] */

/*
// /tmp/ATS-Postiats/src/pats_staexp2_error.dats: 6866(line=240, offs=5) -- 8073(line=272, offs=4)
*/
ATSstaticdec()
ats_void_type
loop_23 (ats_ptr_type arg0) {
/* local vardec */
// ATSlocal_void (tmp119) ;
ATSlocal (ats_ptr_type, tmp120) ;
ATSlocal (ats_ptr_type, tmp121) ;
// ATSlocal_void (tmp122) ;
ATSlocal (ats_ptr_type, tmp123) ;
ATSlocal (ats_ptr_type, tmp124) ;
ATSlocal (ats_ptr_type, tmp125) ;
ATSlocal (ats_ptr_type, tmp126) ;
ATSlocal (ats_int_type, tmp127) ;
ATSlocal (ats_int_type, tmp128) ;
ATSlocal (ats_ptr_type, tmp129) ;
ATSlocal (ats_int_type, tmp130) ;
ATSlocal (ats_int_type, tmp131) ;
ATSlocal (ats_ptr_type, tmp132) ;
ATSlocal (ats_int_type, tmp133) ;
ATSlocal (ats_int_type, tmp134) ;
ATSlocal (ats_ptr_type, tmp135) ;
ATSlocal (ats_ptr_type, tmp136) ;
ATSlocal (ats_ptr_type, tmp137) ;
ATSlocal (ats_ptr_type, tmp138) ;
ATSlocal (ats_int_type, tmp139) ;
ATSlocal (ats_ptr_type, tmp140) ;
ATSlocal (ats_ptr_type, tmp141) ;
ATSlocal (ats_ptr_type, tmp142) ;
ATSlocal (ats_ptr_type, tmp143) ;
ATSlocal (ats_ptr_type, tmp144) ;
ATSlocal (ats_ptr_type, tmp145) ;
ATSlocal (ats_ptr_type, tmp146) ;
ATSlocal (ats_ptr_type, tmp147) ;
ATSlocal (ats_ptr_type, tmp148) ;
ATSlocal (ats_ptr_type, tmp149) ;
ATSlocal (ats_ptr_type, tmp150) ;
ATSlocal (ats_ptr_type, tmp151) ;
ATSlocal (ats_ptr_type, tmp152) ;

__ats_lab_loop_23:
do {
/* branch: __ats_lab_4 */
__ats_lab_4_0:
if (arg0 == (ats_sum_ptr_type)0) { goto __ats_lab_16_0 ; }
__ats_lab_4_1:
tmp120 = ats_caselptrlab_mac(anairiats_sum_1, arg0, atslab_0) ;
tmp121 = ats_caselptrlab_mac(anairiats_sum_1, arg0, atslab_1) ;
ATS_FREE(arg0) ;
do {
/* branch: __ats_lab_5 */
__ats_lab_5_0:
if (((ats_sum_ptr_type)tmp120)->tag != 2) { goto __ats_lab_6_0 ; }
__ats_lab_5_1:
tmp123 = ats_caselptrlab_mac(anairiats_sum_3, tmp120, atslab_0) ;
tmp124 = ats_caselptrlab_mac(anairiats_sum_3, tmp120, atslab_1) ;
tmp125 = ats_caselptrlab_mac(anairiats_sum_3, tmp120, atslab_2) ;
/* tmp122 = */ prerr_staerr_funclo_equal_11 (tmp123, tmp124, tmp125) ;
break ;

/* branch: __ats_lab_6 */
__ats_lab_6_0:
if (((ats_sum_ptr_type)tmp120)->tag != 3) { goto __ats_lab_7_0 ; }
__ats_lab_6_1:
tmp126 = ats_caselptrlab_mac(anairiats_sum_4, tmp120, atslab_0) ;
tmp127 = ats_caselptrlab_mac(anairiats_sum_4, tmp120, atslab_1) ;
tmp128 = ats_caselptrlab_mac(anairiats_sum_4, tmp120, atslab_2) ;
/* tmp122 = */ prerr_staerr_clokind_equal_13 (tmp126, tmp127, tmp128) ;
break ;

/* branch: __ats_lab_7 */
__ats_lab_7_0:
if (((ats_sum_ptr_type)tmp120)->tag != 4) { goto __ats_lab_8_0 ; }
__ats_lab_7_1:
tmp129 = ats_caselptrlab_mac(anairiats_sum_4, tmp120, atslab_0) ;
tmp130 = ats_caselptrlab_mac(anairiats_sum_4, tmp120, atslab_1) ;
tmp131 = ats_caselptrlab_mac(anairiats_sum_4, tmp120, atslab_2) ;
/* tmp122 = */ prerr_staerr_linearity_equal_14 (tmp129, tmp130, tmp131) ;
break ;

/* branch: __ats_lab_8 */
__ats_lab_8_0:
if (((ats_sum_ptr_type)tmp120)->tag != 5) { goto __ats_lab_9_0 ; }
__ats_lab_8_1:
tmp132 = ats_caselptrlab_mac(anairiats_sum_4, tmp120, atslab_0) ;
tmp133 = ats_caselptrlab_mac(anairiats_sum_4, tmp120, atslab_1) ;
tmp134 = ats_caselptrlab_mac(anairiats_sum_4, tmp120, atslab_2) ;
/* tmp122 = */ prerr_staerr_pfarity_equal_15 (tmp132, tmp133, tmp134) ;
break ;

/* branch: __ats_lab_9 */
__ats_lab_9_0:
if (((ats_sum_ptr_type)tmp120)->tag != 6) { goto __ats_lab_10_0 ; }
__ats_lab_9_1:
tmp135 = ats_caselptrlab_mac(anairiats_sum_3, tmp120, atslab_0) ;
tmp136 = ats_caselptrlab_mac(anairiats_sum_3, tmp120, atslab_1) ;
tmp137 = ats_caselptrlab_mac(anairiats_sum_3, tmp120, atslab_2) ;
/* tmp122 = */ prerr_staerr_s2eff_subeq_16 (tmp135, tmp136, tmp137) ;
break ;

/* branch: __ats_lab_10 */
__ats_lab_10_0:
if (((ats_sum_ptr_type)tmp120)->tag != 7) { goto __ats_lab_11_0 ; }
__ats_lab_10_1:
tmp138 = ats_caselptrlab_mac(anairiats_sum_5, tmp120, atslab_0) ;
tmp139 = ats_caselptrlab_mac(anairiats_sum_5, tmp120, atslab_1) ;
tmp140 = ats_caselptrlab_mac(anairiats_sum_5, tmp120, atslab_2) ;
/* tmp122 = */ prerr_staerr_boxity_equal_17 (tmp138, tmp139, tmp140) ;
break ;

/* branch: __ats_lab_11 */
__ats_lab_11_0:
if (((ats_sum_ptr_type)tmp120)->tag != 8) { goto __ats_lab_12_0 ; }
__ats_lab_11_1:
tmp141 = ats_caselptrlab_mac(anairiats_sum_3, tmp120, atslab_0) ;
tmp142 = ats_caselptrlab_mac(anairiats_sum_3, tmp120, atslab_1) ;
tmp143 = ats_caselptrlab_mac(anairiats_sum_3, tmp120, atslab_2) ;
/* tmp122 = */ prerr_staerr_tyreckind_equal_18 (tmp141, tmp142, tmp143) ;
break ;

/* branch: __ats_lab_12 */
__ats_lab_12_0:
if (((ats_sum_ptr_type)tmp120)->tag != 11) { goto __ats_lab_13_0 ; }
__ats_lab_12_1:
tmp144 = ats_caselptrlab_mac(anairiats_sum_3, tmp120, atslab_0) ;
tmp145 = ats_caselptrlab_mac(anairiats_sum_3, tmp120, atslab_1) ;
tmp146 = ats_caselptrlab_mac(anairiats_sum_3, tmp120, atslab_2) ;
/* tmp122 = */ prerr_staerr_s2exp_equal_19 (tmp144, tmp145, tmp146) ;
break ;

/* branch: __ats_lab_13 */
__ats_lab_13_0:
if (((ats_sum_ptr_type)tmp120)->tag != 12) { goto __ats_lab_14_0 ; }
__ats_lab_13_1:
tmp147 = ats_caselptrlab_mac(anairiats_sum_3, tmp120, atslab_0) ;
tmp148 = ats_caselptrlab_mac(anairiats_sum_3, tmp120, atslab_1) ;
tmp149 = ats_caselptrlab_mac(anairiats_sum_3, tmp120, atslab_2) ;
/* tmp122 = */ prerr_staerr_s2exp_tyleq_20 (tmp147, tmp148, tmp149) ;
break ;

/* branch: __ats_lab_14 */
__ats_lab_14_0:
if (((ats_sum_ptr_type)tmp120)->tag != 13) { goto __ats_lab_15_0 ; }
__ats_lab_14_1:
tmp150 = ats_caselptrlab_mac(anairiats_sum_3, tmp120, atslab_0) ;
tmp151 = ats_caselptrlab_mac(anairiats_sum_3, tmp120, atslab_1) ;
tmp152 = ats_caselptrlab_mac(anairiats_sum_3, tmp120, atslab_2) ;
/* tmp122 = */ prerr_staerr_s2Var_s2exp_solve_21 (tmp150, tmp151, tmp152) ;
break ;

/* branch: __ats_lab_15 */
__ats_lab_15_0:
__ats_lab_15_1:
break ;
} while (0) ;
arg0 = tmp121 ;
goto __ats_lab_loop_23 ; // tail call
break ;

/* branch: __ats_lab_16 */
__ats_lab_16_0:
// if (arg0 != (ats_sum_ptr_type)0) { ats_deadcode_failure_handle () ; }
__ats_lab_16_1:
break ;
} while (0) ;
return /* (tmp119) */ ;
} /* end of [loop_23] */

/*
// /tmp/ATS-Postiats/src/pats_staexp2_error.dats: 6850(line=238, offs=21) -- 8157(line=279, offs=4)
*/
ATSglobaldec()
ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__prerr_the_staerrlst () {
/* local vardec */
// ATSlocal_void (tmp118) ;
ATSlocal (ats_int_type, tmp153) ;
ATSlocal (ats_ptr_type, tmp154) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__prerr_the_staerrlst:
/* ats_int_type tmp153 ; */
tmp154 = _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__the_staerrlst_get ((&tmp153)) ;
/* tmp118 = */ loop_23 (tmp154) ;
return /* (tmp118) */ ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__prerr_the_staerrlst] */

/* static load function */

// extern ats_void_type _2tmp_2ATS_2dPostiats_2src_2pats_atspre_2edats__staload (void) ;
extern ats_void_type _2tmp_2ATS_2dPostiats_2src_2pats_basics_2esats__staload (void) ;
extern ats_void_type _2tmp_2ATS_2dPostiats_2src_2pats_errmsg_2esats__staload (void) ;
extern ats_void_type _2tmp_2ATS_2dPostiats_2src_2pats_errmsg_2edats__staload (void) ;
extern ats_void_type _2tmp_2ATS_2dPostiats_2src_2pats_location_2esats__staload (void) ;
extern ats_void_type _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__staload (void) ;
extern ats_void_type _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__staload (void) ;

ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2edats__staload () {
static int _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2edats__staload_flag = 0 ;
if (_2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2edats__staload_flag) return ;
_2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2edats__staload_flag = 1 ;

// _2tmp_2ATS_2dPostiats_2src_2pats_atspre_2edats__staload () ;
_2tmp_2ATS_2dPostiats_2src_2pats_basics_2esats__staload () ;
_2tmp_2ATS_2dPostiats_2src_2pats_errmsg_2esats__staload () ;
_2tmp_2ATS_2dPostiats_2src_2pats_errmsg_2edats__staload () ;
_2tmp_2ATS_2dPostiats_2src_2pats_location_2esats__staload () ;
_2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__staload () ;
_2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__staload () ;

return ;
} /* staload function */

/* dynamic load function */

// dynload flag declaration
extern ats_int_type _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2edats__dynload_flag ;

ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2edats__dynload () {
_2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2edats__dynload_flag = 1 ;
_2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2edats__staload () ;

#ifdef _ATS_PROOFCHECK
ATS_2d0_2e2_2e12_2prelude_2SATS_2list_2esats__list_length_is_nonnegative_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2SATS_2list_vt_2esats__list_vt_length_is_nonnegative_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2SATS_2array_2esats__array_v_takeout2_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_vt_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_vt_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_vt_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_vt_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_vt_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2list_vt_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2array_2edats____copy_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2array_2edats____free_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2array_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2prelude_2DATS_2array_2edats____assert_prfck () ;
#endif /* _ATS_PROOFCHECK */

/* marking static variables for GC */
ATS_GC_MARKROOT(&statmp1, sizeof(ats_ptr_type)) ;
ATS_GC_MARKROOT(&statmp4, sizeof(ats_ptr_type)) ;
ATS_GC_MARKROOT(&statmp7, sizeof(ats_ptr_type)) ;

/* marking external values for GC */

/* code for dynamic loading */
statmp1 = ref_01088_ats_int_type (0) ;
statmp7 = (ats_sum_ptr_type)0 ;
statmp4 = ref_01088_ats_ptr_type (statmp7) ;
return ;
} /* end of [dynload function] */

/* external codes at mid */
/* external codes at bot */

/* ****** ****** */

/* end of [pats_staexp2_error_dats.c] */
