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

/* 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_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"

#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"

#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"

#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_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_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_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"

#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_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_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_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_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"

#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_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_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"

#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_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_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_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"

#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_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_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_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"

#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_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"

#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_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_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"

#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_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_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"

#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_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_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_rec_1 ;

typedef struct {
int tag ;
ats_ptr_type atslab_0 ;
ats_ptr_type atslab_1 ;
} anairiats_sum_2 ;

typedef struct {
ats_ptr_type atslab_0 ;
ats_ptr_type atslab_1 ;
ats_ptr_type atslab_2 ;
ats_ptr_type atslab_3 ;
} anairiats_sum_3 ;

typedef struct {
ats_ptr_type atslab_0 ;
} anairiats_sum_4 ;

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

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

typedef
struct {
ats_ptr_type atslab_d3exp_loc ;
ats_ptr_type atslab_d3exp_type ;
ats_ptr_type atslab_d3exp_node ;
} anairiats_rec_7 ;

typedef struct {
int tag ;
ats_ptr_type atslab_0 ;
} anairiats_sum_8 ;

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

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

typedef struct {
int tag ;
ats_ptr_type atslab_0 ;
ats_int_type atslab_1 ;
ats_ptr_type atslab_2 ;
ats_int_type atslab_3 ;
ats_ptr_type atslab_4 ;
ats_ptr_type atslab_5 ;
} anairiats_sum_11 ;

typedef struct {
ats_int_type atslab_0 ;
} anairiats_sum_12 ;

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

typedef struct {
int tag ;
ats_int_type atslab_0 ;
ats_ptr_type atslab_1 ;
} anairiats_sum_14 ;

/* external typedefs */
/* external dynamic constructor declarations */
ATSextern_val(ats_sum_type, ATS_2d0_2e2_2e12_2prelude_2basics_sta_2esats__list_cons_0) ;
ATSextern_val(ats_sum_type, ATS_2d0_2e2_2e12_2prelude_2basics_sta_2esats__list_nil_1) ;
ATSextern_val(ats_sum_type, ATS_2d0_2e2_2e12_2prelude_2basics_sta_2esats__None_0) ;
ATSextern_val(ats_sum_type, ATS_2d0_2e2_2e12_2prelude_2basics_sta_2esats__Some_1) ;
ATSextern_val(ats_sum_type, ATS_2d0_2e2_2e12_2prelude_2basics_sta_2esats__None_vt_0) ;
ATSextern_val(ats_sum_type, ATS_2d0_2e2_2e12_2prelude_2basics_sta_2esats__Some_vt_1) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_basics_2esats__FUNCLOfun_0) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_basics_2esats__FUNCLOclo_1) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__WTHS2EXPLSTnil_0) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__WTHS2EXPLSTcons_none_1) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__WTHS2EXPLSTcons_invar_2) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__WTHS2EXPLSTcons_trans_3) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__S2Efun_19) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__S2Erefarg_29) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_dynexp3_2esats__D3Evar_1) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_dynexp3_2esats__D3Eviewat_39) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_dynexp3_2esats__D3Esel_var_41) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_dynexp3_2esats__D3Esel_ptr_42) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__T3E_pfobj_search_none_54) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__T3E_d3lval_fun_72) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__T3E_d3lval_funarg_73) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__T3E_d3lval_refval_74) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__T3E_d3lval_linpatcon_75) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__T3E_d3exp_funclo_topized_76) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__T3E_s2addr_exch_type_oldnew_78) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__T3E_d3lval_exch_type_linold_79) ;
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_trans3_env_2esats__PFOBJ_0) ;

/* external dynamic constant declarations */
ATSextern_fun(ats_void_type, atspre_assert_errmsg) (ats_bool_type, ats_ptr_type) ;
ATSextern_fun(ats_void_type, atspre_vbox_make_view_ptr) (ats_ptr_type) ;
ATSextern_fun(ats_void_type, atspre_prerr_newline) () ;
ATSextern_fun(ats_ptr_type, atspre_string_append) (ats_ptr_type, ats_ptr_type) ;
ATSextern_fun(ats_int_type, atspre_add_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_bool_type, atspre_gte_int_int) (ats_int_type, ats_int_type) ;
ATSextern_fun(ats_bool_type, atspre_eq_int_int) (ats_int_type, 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_location_2esats__prerr_location) (ats_ptr_type) ;
ATSextern_val(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__s2rt_vtype) ;
ATSextern_fun(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__s2exp_fun_srt) (ats_ptr_type, ats_ptr_type, ats_int_type, ats_ptr_type, ats_int_type, ats_ptr_type, ats_ptr_type) ;
ATSextern_fun(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__s2exp_t0ype_err) () ;
ATSextern_fun(ats_void_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__prerr_s2exp) (ats_ptr_type) ;
ATSextern_fun(ats_bool_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__s2exp_is_lin) (ats_ptr_type) ;
ATSextern_fun(ats_bool_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__s2exp_is_nonlin) (ats_ptr_type) ;
ATSextern_fun(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_util_2esats__s2ctxt_hrepl) (ats_ptr_type, ats_ptr_type) ;
ATSextern_fun(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_util_2esats__s2exp_hrepl) (ats_ptr_type, ats_ptr_type) ;
ATSextern_fun(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_util_2esats__s2exp_hnfize) (ats_ptr_type) ;
ATSextern_fun(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_util_2esats__s2exp2hnf) (ats_ptr_type) ;
ATSextern_fun(ats_void_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__prerr_the_staerrlst) () ;
ATSextern_fun(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_stacst2_2esats__un_s2exp_ptr_addr_type) (ats_ptr_type) ;
ATSextern_fun(ats_void_type, _2tmp_2ATS_2dPostiats_2src_2pats_dynexp2_2esats__prerr_d2var) (ats_ptr_type) ;
ATSextern_fun(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_dynexp2_2esats__d2var_get_addr) (ats_ptr_type) ;
ATSextern_fun(ats_void_type, _2tmp_2ATS_2dPostiats_2src_2pats_dynexp2_2esats__d2var_set_type) (ats_ptr_type, ats_ptr_type) ;
ATSextern_fun(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_dynexp2_2esats__d2var_exch_type) (ats_ptr_type, ats_ptr_type) ;
ATSextern_fun(ats_bool_type, _2tmp_2ATS_2dPostiats_2src_2pats_dynexp2_2esats__d2var_is_linear) (ats_ptr_type) ;
ATSextern_fun(ats_bool_type, _2tmp_2ATS_2dPostiats_2src_2pats_dynexp2_2esats__d2var_is_mutabl) (ats_ptr_type) ;
ATSextern_fun(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_dynexp3_2esats__p3at_get_type_left) (ats_ptr_type) ;
ATSextern_fun(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_dynexp3_2esats__d3exp_get_type) (ats_ptr_type) ;
ATSextern_fun(ats_void_type, patsopt_d3exp_set_type) (ats_ptr_type, ats_ptr_type) ;
ATSextern_fun(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_dynexp3_2esats__d3exp_refarg) (ats_ptr_type, ats_ptr_type, ats_int_type, ats_int_type, ats_ptr_type) ;
ATSextern_fun(ats_int_type, _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_solve_2esats__s2exp_tyleq_solve) (ats_ptr_type, ats_ptr_type, ats_ptr_type) ;
ATSextern_fun(ats_void_type, _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__the_trans3errlst_add) (ats_ptr_type) ;
ATSextern_fun(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d2var_get_type_some) (ats_ptr_type, ats_ptr_type) ;
ATSextern_fun(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__s2exp_get_dlablst_context) (ats_ptr_type, ats_ptr_type, ats_ptr_type, ats_ref_type) ;
ATSextern_fun(anairiats_rec_1, _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__s2exp_get_dlablst_context_check) (ats_ptr_type, ats_ptr_type, ats_ptr_type, ats_ref_type) ;
ATSextern_fun(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__s2addr_exch_type) (ats_ptr_type, ats_ptr_type, ats_ptr_type, ats_ptr_type) ;
ATSextern_fun(ats_void_type, _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__s2addr_set_viewat) (ats_ptr_type, ats_ptr_type, ats_ptr_type, ats_ptr_type) ;
ATSextern_fun(ats_void_type, _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3lval_set_type_err) (ats_int_type, ats_ptr_type, ats_ptr_type, ats_ref_type) ;
ATSextern_fun(ats_void_type, _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3lval_set_pat_type_left) (ats_ptr_type, ats_ptr_type) ;
ATSextern_fun(ats_int_type, _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3lval_arg_set_type) (ats_int_type, ats_ptr_type, ats_ptr_type) ;
ATSextern_fun(ats_void_type, _2tmp_2ATS_2dPostiats_2src_2pats_trans3_env_2esats__trans3_env_add_proplst_vt) (ats_ptr_type, ats_ptr_type) ;
ATSextern_fun(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_trans3_env_2esats__s2hnf_opnexi_and_add) (ats_ptr_type, ats_ptr_type) ;
ATSextern_fun(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_trans3_env_2esats__pfobj_search_atview) (ats_ptr_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_void_type prerr_error3_loc_02089_ (ats_ptr_type arg0) ;
static
ats_void_type auxerr_pfobj_1 (ats_ptr_type arg0, ats_ptr_type arg1) ;
static
ats_ptr_type auxmain_3 (ats_ptr_type arg0, ats_ptr_type arg1, ats_ptr_type arg2, ats_ptr_type arg3) ;
static
ats_void_type auxerr_linold_5 (ats_ptr_type arg0, ats_ptr_type arg1, ats_ptr_type arg2, ats_ptr_type arg3) ;
static
ats_void_type d2var_refval_check_6 (ats_ptr_type arg0, ats_ptr_type arg1, ats_int_type arg2) ;
static
ats_void_type prerr_interror_loc_02085_ (ats_ptr_type arg0) ;
static
ats_void_type loop_10 (ats_ptr_type arg0, ats_ptr_type arg1) ;
static
ats_void_type auxerr_12 (ats_ptr_type arg0) ;
static
ats_bool_type s2exp_fun_is_freeptr_14 (ats_ptr_type arg0) ;
static
ats_void_type auxerr_15 (ats_ptr_type arg0) ;
static
ats_ptr_type auxres_16 (ats_ptr_type arg0) ;
static
ats_ptr_type auxlst1_18 (ats_ptr_type arg0, ats_ptr_type arg1, ats_ptr_type arg2) ;
static
ats_ptr_type auxlst2_19 (ats_ptr_type arg0, ats_ptr_type arg1, ats_ptr_type arg2) ;

/* partial value template declarations */
/* static temporary variable declarations */
/* external value variable declarations */

/* function implementations */

/*
// /tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 1767(line=58, offs=18) -- 1799(line=58, offs=50)
*/
ATSstaticdec()
ats_void_type
prerr_FILENAME_02083_ () {
/* local vardec */
// ATSlocal_void (tmp0) ;

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

/*
// /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 (tmp3) ;
// ATSlocal_void (tmp4) ;

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

/*
// /tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 2291(line=93, offs=1) -- 2699(line=106, offs=4)
*/
ATSstaticdec()
ats_void_type
auxerr_pfobj_1 (ats_ptr_type arg0, ats_ptr_type arg1) {
/* local vardec */
// ATSlocal_void (tmp1) ;
// ATSlocal_void (tmp2) ;
// ATSlocal_void (tmp5) ;
// ATSlocal_void (tmp6) ;
// ATSlocal_void (tmp7) ;
// ATSlocal_void (tmp8) ;
// ATSlocal_void (tmp9) ;
// ATSlocal_void (tmp10) ;
ATSlocal (ats_ptr_type, tmp11) ;

__ats_lab_auxerr_pfobj_1:
/* tmp2 = */ prerr_error3_loc_02089_ (arg0) ;
/* tmp5 = */ atspre_prerr_string (ATSstrcst(": type-restoration cannot be performed")) ;
/* tmp6 = */ atspre_prerr_newline () ;
/* tmp7 = */ atspre_prerr_string (ATSstrcst(": the proof search for view located at [")) ;
/* tmp8 = */ _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__prerr_s2exp (arg1) ;
/* tmp9 = */ atspre_prerr_string (ATSstrcst("] failed to turn up a result.")) ;
/* tmp10 = */ atspre_prerr_newline () ;
tmp11 = ATS_MALLOC(sizeof(anairiats_sum_2)) ;
((ats_sum_ptr_type)tmp11)->tag = 54 ;
ats_selptrset_mac(anairiats_sum_2, tmp11, atslab_0, arg0) ;
ats_selptrset_mac(anairiats_sum_2, tmp11, atslab_1, arg1) ;
/* tmp1 = */ _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__the_trans3errlst_add (tmp11) ;
return /* (tmp1) */ ;
} /* end of [auxerr_pfobj_1] */

/*
// /tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 2730(line=108, offs=5) -- 3862(line=154, offs=4)
*/
ATSstaticdec()
ats_ptr_type
auxmain_3 (ats_ptr_type arg0, ats_ptr_type arg1, ats_ptr_type arg2, ats_ptr_type arg3) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp12) ;
ATSlocal (ats_ptr_type, tmp13) ;
ATSlocal (ats_ptr_type, tmp14) ;
ATSlocal (ats_ptr_type, tmp15) ;
ATSlocal (ats_ptr_type, tmp16) ;
ATSlocal (anairiats_rec_1, tmp17) ;
ATSlocal (ats_ptr_type, tmp18) ;
// ATSlocal_void (tmp19) ;
ATSlocal (ats_ptr_type, tmp20) ;
ATSlocal (ats_ptr_type, tmp21) ;
ATSlocal (ats_ptr_type, tmp22) ;
ATSlocal (ats_ptr_type, tmp23) ;
// ATSlocal_void (tmp24) ;
ATSlocal (ats_ptr_type, tmp25) ;
ATSlocal (ats_int_type, tmp26) ;
// ATSlocal_void (tmp27) ;
ATSlocal (ats_bool_type, tmp28) ;
// ATSlocal_void (tmp29) ;
// ATSlocal_void (tmp30) ;
// ATSlocal_void (tmp31) ;
// ATSlocal_void (tmp32) ;
ATSlocal (ats_ptr_type, tmp33) ;

__ats_lab_auxmain_3:
// 
tmp13 = ats_caselptrlab_mac(anairiats_sum_3, arg1, atslab_0) ;
tmp14 = ats_caselptrlab_mac(anairiats_sum_3, arg1, atslab_1) ;
tmp15 = ats_caselptrlab_mac(anairiats_sum_3, arg1, atslab_2) ;
ATS_FREE(arg1) ;
/* ats_ptr_type tmp16 ; */
tmp16 = (ats_sum_ptr_type)0 ;
tmp17 = _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__s2exp_get_dlablst_context_check (arg0, tmp15, arg2, (&tmp16)) ;
tmp18 = ats_select_mac(tmp17, atslab_0) ;
tmp20 = ats_select_mac(tmp17, atslab_1) ;
/* tmp19 = */ _2tmp_2ATS_2dPostiats_2src_2pats_trans3_env_2esats__trans3_env_add_proplst_vt (arg0, tmp20) ;
do {
/* branch: __ats_lab_0 */
__ats_lab_0_0:
if (tmp16 == (ats_sum_ptr_type)0) { goto __ats_lab_1_0 ; }
__ats_lab_0_1:
tmp21 = ats_caselptrlab_mac(anairiats_sum_4, tmp16, atslab_0) ;
tmp22 = _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_util_2esats__s2ctxt_hrepl (tmp21, arg3) ;
tmp23 = _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_util_2esats__s2exp_hrepl (tmp14, tmp22) ;
tmp25 = ATS_MALLOC(sizeof(anairiats_sum_4)) ;
ats_selptrset_mac(anairiats_sum_4, tmp25, atslab_0, tmp23) ;
/* tmp24 = */ _2tmp_2ATS_2dPostiats_2src_2pats_dynexp2_2esats__d2var_set_type (tmp13, tmp25) ;
tmp12 = tmp18 ;
break ;

/* branch: __ats_lab_1 */
__ats_lab_1_0:
// if (tmp16 != (ats_sum_ptr_type)0) { ats_deadcode_failure_handle () ; }
__ats_lab_1_1:
tmp26 = _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_solve_2esats__s2exp_tyleq_solve (arg0, arg3, tmp18) ;
tmp28 = atspre_gt_int_int (tmp26, 0) ;
if (tmp28) {
/* tmp29 = */ prerr_error3_loc_02089_ (arg0) ;
/* tmp30 = */ atspre_prerr_string (ATSstrcst(": mismatch of bef/aft types of call-by-reference: ")) ;
/* tmp31 = */ atspre_prerr_newline () ;
/* tmp32 = */ _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__prerr_the_staerrlst () ;
tmp33 = ATS_MALLOC(sizeof(anairiats_sum_5)) ;
((ats_sum_ptr_type)tmp33)->tag = 78 ;
ats_selptrset_mac(anairiats_sum_5, tmp33, atslab_0, arg0) ;
ats_selptrset_mac(anairiats_sum_5, tmp33, atslab_1, tmp15) ;
ats_selptrset_mac(anairiats_sum_5, tmp33, atslab_2, arg2) ;
ats_selptrset_mac(anairiats_sum_5, tmp33, atslab_3, arg3) ;
/* tmp27 = */ _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__the_trans3errlst_add (tmp33) ;
} else {
/* empty */
} /* end of [if] */
tmp12 = tmp18 ;
break ;
} while (0) ;
return (tmp12) ;
} /* end of [auxmain_3] */

/*
// /tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 3935(line=160, offs=1) -- 4205(line=173, offs=4)
*/
ATSglobaldec()
ats_ptr_type
_2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__s2addr_exch_type (ats_ptr_type arg0, ats_ptr_type arg1, ats_ptr_type arg2, ats_ptr_type arg3) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp34) ;
ATSlocal (ats_ptr_type, tmp35) ;
ATSlocal (ats_ptr_type, tmp36) ;
// ATSlocal_void (tmp37) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__s2addr_exch_type:
tmp35 = _2tmp_2ATS_2dPostiats_2src_2pats_trans3_env_2esats__pfobj_search_atview (arg1) ;
do {
/* branch: __ats_lab_2 */
__ats_lab_2_0:
if (tmp35 == (ats_sum_ptr_type)0) { goto __ats_lab_3_0 ; }
__ats_lab_2_1:
tmp36 = ats_caselptrlab_mac(anairiats_sum_4, tmp35, atslab_0) ;
ATS_FREE(tmp35) ;
tmp34 = auxmain_3 (arg0, tmp36, arg2, arg3) ;
break ;

/* branch: __ats_lab_3 */
__ats_lab_3_0:
// if (tmp35 != (ats_sum_ptr_type)0) { ats_deadcode_failure_handle () ; }
__ats_lab_3_1:
/* tmp37 = */ auxerr_pfobj_1 (arg0, arg1) ;
tmp34 = _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__s2exp_t0ype_err () ;
break ;
} while (0) ;
return (tmp34) ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__s2addr_exch_type] */

/*
// /tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 4291(line=182, offs=1) -- 4656(line=193, offs=4)
*/
ATSstaticdec()
ats_void_type
auxerr_linold_5 (ats_ptr_type arg0, ats_ptr_type arg1, ats_ptr_type arg2, ats_ptr_type arg3) {
/* local vardec */
// ATSlocal_void (tmp38) ;
// ATSlocal_void (tmp39) ;
// ATSlocal_void (tmp40) ;
// ATSlocal_void (tmp41) ;
// ATSlocal_void (tmp42) ;
// ATSlocal_void (tmp43) ;
// ATSlocal_void (tmp44) ;
ATSlocal (ats_ptr_type, tmp45) ;

__ats_lab_auxerr_linold_5:
/* tmp39 = */ prerr_error3_loc_02089_ (arg0) ;
/* tmp40 = */ atspre_prerr_string (ATSstrcst(": a linear component of the following type is abandoned: ")) ;
/* tmp41 = */ atspre_prerr_string (ATSstrcst("[")) ;
/* tmp42 = */ _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__prerr_s2exp (arg3) ;
/* tmp43 = */ atspre_prerr_string (ATSstrcst("].")) ;
/* tmp44 = */ atspre_prerr_newline () ;
tmp45 = ATS_MALLOC(sizeof(anairiats_sum_6)) ;
((ats_sum_ptr_type)tmp45)->tag = 79 ;
ats_selptrset_mac(anairiats_sum_6, tmp45, atslab_0, arg0) ;
ats_selptrset_mac(anairiats_sum_6, tmp45, atslab_1, arg1) ;
ats_selptrset_mac(anairiats_sum_6, tmp45, atslab_2, arg2) ;
/* tmp38 = */ _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__the_trans3errlst_add (tmp45) ;
return /* (tmp38) */ ;
} /* end of [auxerr_linold_5] */

/*
// /tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 4688(line=196, offs=1) -- 5084(line=208, offs=6)
*/
ATSstaticdec()
ats_void_type
d2var_refval_check_6 (ats_ptr_type arg0, ats_ptr_type arg1, ats_int_type arg2) {
/* local vardec */
// ATSlocal_void (tmp46) ;
ATSlocal (ats_bool_type, tmp47) ;
// ATSlocal_void (tmp48) ;
// ATSlocal_void (tmp49) ;
// ATSlocal_void (tmp50) ;
// ATSlocal_void (tmp51) ;
// ATSlocal_void (tmp52) ;
ATSlocal (ats_ptr_type, tmp53) ;

__ats_lab_d2var_refval_check_6:
tmp47 = atspre_gt_int_int (arg2, 0) ;
if (tmp47) {
/* tmp48 = */ prerr_error3_loc_02089_ (arg0) ;
/* tmp49 = */ atspre_prerr_string (ATSstrcst(": the dynamic variable [")) ;
/* tmp50 = */ _2tmp_2ATS_2dPostiats_2src_2pats_dynexp2_2esats__prerr_d2var (arg1) ;
/* tmp51 = */ atspre_prerr_string (ATSstrcst("] is required to be mutable in order to support call-by-reference.")) ;
/* tmp52 = */ atspre_prerr_newline () ;
tmp53 = ATS_MALLOC(sizeof(anairiats_sum_2)) ;
((ats_sum_ptr_type)tmp53)->tag = 74 ;
ats_selptrset_mac(anairiats_sum_2, tmp53, atslab_0, arg0) ;
ats_selptrset_mac(anairiats_sum_2, tmp53, atslab_1, arg1) ;
/* tmp46 = */ _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__the_trans3errlst_add (tmp53) ;
} else {
/* empty */
} /* end of [if] */
return /* (tmp46) */ ;
} /* end of [d2var_refval_check_6] */

/*
// /tmp/ATS-Postiats/src/pats_errmsg.dats: 1766(line=59, offs=19) -- 1906(line=65, offs=2)
*/
ATSstaticdec()
ats_void_type
prerr_interror_loc_02085_ (ats_ptr_type arg0) {
/* local vardec */
// ATSlocal_void (tmp92) ;
// ATSlocal_void (tmp93) ;
// ATSlocal_void (tmp94) ;
// ATSlocal_void (tmp95) ;

__ats_lab_prerr_interror_loc_02085_:
/* tmp93 = */ _2tmp_2ATS_2dPostiats_2src_2pats_location_2esats__prerr_location (arg0) ;
/* tmp94 = */ atspre_prerr_string (ATSstrcst(": INTERROR(")) ;
/* tmp95 = */ prerr_FILENAME_02083_ () ;
/* tmp92 = */ atspre_prerr_string (ATSstrcst(")")) ;
return /* (tmp92) */ ;
} /* end of [prerr_interror_loc_02085_] */

/*
// /tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 5186(line=215, offs=1) -- 8790(line=348, offs=4)
*/
ATSglobaldec()
ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3lval_set_type_err (ats_int_type arg0, ats_ptr_type arg1, ats_ptr_type arg2, ats_ref_type arg3) {
/* local vardec */
// ATSlocal_void (tmp54) ;
ATSlocal (ats_ptr_type, tmp55) ;
ATSlocal (ats_ptr_type, tmp56) ;
ATSlocal (ats_ptr_type, tmp57) ;
ATSlocal (ats_bool_type, tmp58) ;
ATSlocal (ats_ptr_type, tmp59) ;
ATSlocal (ats_ptr_type, tmp60) ;
ATSlocal (ats_ptr_type, tmp61) ;
ATSlocal (ats_ptr_type, tmp62) ;
ATSlocal (ats_ptr_type, tmp63) ;
ATSlocal (ats_bool_type, tmp64) ;
// ATSlocal_void (tmp65) ;
ATSlocal (ats_ptr_type, tmp66) ;
ATSlocal (ats_ptr_type, tmp67) ;
// ATSlocal_void (tmp68) ;
ATSlocal (ats_ptr_type, tmp69) ;
ATSlocal (ats_bool_type, tmp70) ;
ATSlocal (ats_ptr_type, tmp71) ;
ATSlocal (ats_ptr_type, tmp72) ;
ATSlocal (ats_ptr_type, tmp73) ;
ATSlocal (ats_bool_type, tmp74) ;
ATSlocal (ats_ptr_type, tmp75) ;
ATSlocal (ats_ptr_type, tmp76) ;
ATSlocal (ats_ptr_type, tmp77) ;
ATSlocal (ats_ptr_type, tmp78) ;
ATSlocal (ats_ptr_type, tmp79) ;
ATSlocal (ats_bool_type, tmp80) ;
// ATSlocal_void (tmp81) ;
ATSlocal (ats_ptr_type, tmp82) ;
ATSlocal (ats_ptr_type, tmp83) ;
ATSlocal (ats_ptr_type, tmp84) ;
ATSlocal (ats_ptr_type, tmp85) ;
ATSlocal (ats_bool_type, tmp86) ;
// ATSlocal_void (tmp87) ;
ATSlocal (ats_ptr_type, tmp88) ;
ATSlocal (ats_ptr_type, tmp89) ;
ATSlocal (ats_ptr_type, tmp90) ;
// ATSlocal_void (tmp91) ;
// ATSlocal_void (tmp96) ;
// ATSlocal_void (tmp97) ;
ATSlocal (ats_ptr_type, tmp98) ;
ATSlocal (ats_ptr_type, tmp99) ;
ATSlocal (ats_ptr_type, tmp100) ;
ATSlocal (ats_ptr_type, tmp101) ;
ATSlocal (ats_ptr_type, tmp102) ;
ATSlocal (ats_ptr_type, tmp103) ;
ATSlocal (ats_ptr_type, tmp104) ;
ATSlocal (ats_ptr_type, tmp105) ;
ATSlocal (ats_ptr_type, tmp106) ;
ATSlocal (ats_ptr_type, tmp107) ;
ATSlocal (ats_ptr_type, tmp108) ;
ATSlocal (ats_ptr_type, tmp109) ;
ATSlocal (ats_ptr_type, tmp110) ;
ATSlocal (ats_ptr_type, tmp111) ;
ATSlocal (ats_int_type, tmp112) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3lval_set_type_err:
tmp55 = ats_selbox_mac(ats_castptr_mac(anairiats_rec_7, arg1), atslab_d3exp_loc) ;
tmp56 = ats_selbox_mac(ats_castptr_mac(anairiats_rec_7, arg1), atslab_d3exp_node) ;
do {
/* branch: __ats_lab_4 */
__ats_lab_4_0:
if (((ats_sum_ptr_type)tmp56)->tag != 1) { goto __ats_lab_5_0 ; }
__ats_lab_4_1:
tmp57 = ats_caselptrlab_mac(anairiats_sum_8, tmp56, atslab_0) ;
tmp58 = _2tmp_2ATS_2dPostiats_2src_2pats_dynexp2_2esats__d2var_is_mutabl (tmp57) ;
if (!tmp58) { goto __ats_lab_5_1 ; }
tmp59 = _2tmp_2ATS_2dPostiats_2src_2pats_dynexp2_2esats__d2var_get_addr (tmp57) ;
if (tmp59 == (ats_sum_ptr_type)0) { ats_caseof_failure_handle ("/tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 5498(line=236, offs=9) -- 5531(line=236, offs=42)") ; }
tmp60 = ats_caselptrlab_mac(anairiats_sum_4, tmp59, atslab_0) ;
tmp61 = (ats_sum_ptr_type)0 ;
tmp62 = _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__s2addr_exch_type (tmp55, tmp60, tmp61, arg2) ;
break ;

/* branch: __ats_lab_5 */
__ats_lab_5_0:
if (((ats_sum_ptr_type)tmp56)->tag != 1) { goto __ats_lab_8_0 ; }
__ats_lab_5_1:
tmp63 = ats_caselptrlab_mac(anairiats_sum_8, tmp56, atslab_0) ;
tmp64 = _2tmp_2ATS_2dPostiats_2src_2pats_dynexp2_2esats__d2var_is_linear (tmp63) ;
if (!tmp64) { goto __ats_lab_18_1 ; }
/* tmp65 = */ d2var_refval_check_6 (tmp55, tmp63, arg0) ;
tmp67 = ATS_MALLOC(sizeof(anairiats_sum_4)) ;
ats_selptrset_mac(anairiats_sum_4, tmp67, atslab_0, arg2) ;
tmp66 = _2tmp_2ATS_2dPostiats_2src_2pats_dynexp2_2esats__d2var_exch_type (tmp63, tmp67) ;
/* tmp68 = */ patsopt_d3exp_set_type (arg1, arg2) ;
do {
/* branch: __ats_lab_6 */
__ats_lab_6_0:
if (tmp66 == (ats_sum_ptr_type)0) { goto __ats_lab_7_0 ; }
__ats_lab_6_1:
tmp69 = ats_caselptrlab_mac(anairiats_sum_4, tmp66, atslab_0) ;
tmp70 = _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__s2exp_is_lin (tmp69) ;
if (tmp70) {
tmp71 = (ats_sum_ptr_type)0 ;
/* tmp54 = */ auxerr_linold_5 (tmp55, arg1, tmp71, tmp69) ;
} else {
/* empty */
} /* end of [if] */
break ;

/* branch: __ats_lab_7 */
__ats_lab_7_0:
// if (tmp66 != (ats_sum_ptr_type)0) { ats_deadcode_failure_handle () ; }
__ats_lab_7_1:
break ;
} while (0) ;
break ;

/* branch: __ats_lab_8 */
__ats_lab_8_0:
if (((ats_sum_ptr_type)tmp56)->tag != 41) { goto __ats_lab_9_0 ; }
__ats_lab_8_1:
tmp72 = ats_caselptrlab_mac(anairiats_sum_6, tmp56, atslab_0) ;
tmp73 = ats_caselptrlab_mac(anairiats_sum_6, tmp56, atslab_2) ;
tmp74 = _2tmp_2ATS_2dPostiats_2src_2pats_dynexp2_2esats__d2var_is_mutabl (tmp72) ;
if (!tmp74) { goto __ats_lab_9_1 ; }
tmp75 = _2tmp_2ATS_2dPostiats_2src_2pats_dynexp2_2esats__d2var_get_addr (tmp72) ;
if (tmp75 == (ats_sum_ptr_type)0) { ats_caseof_failure_handle ("/tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 6439(line=271, offs=9) -- 6472(line=271, offs=42)") ; }
tmp76 = ats_caselptrlab_mac(anairiats_sum_4, tmp75, atslab_0) ;
tmp77 = _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__s2addr_exch_type (tmp55, tmp76, tmp73, arg2) ;
break ;

/* branch: __ats_lab_9 */
__ats_lab_9_0:
if (((ats_sum_ptr_type)tmp56)->tag != 41) { goto __ats_lab_12_0 ; }
__ats_lab_9_1:
tmp78 = ats_caselptrlab_mac(anairiats_sum_6, tmp56, atslab_0) ;
tmp79 = ats_caselptrlab_mac(anairiats_sum_6, tmp56, atslab_2) ;
tmp80 = _2tmp_2ATS_2dPostiats_2src_2pats_dynexp2_2esats__d2var_is_linear (tmp78) ;
if (!tmp80) { goto __ats_lab_18_1 ; }
/* tmp81 = */ d2var_refval_check_6 (tmp55, tmp78, arg0) ;
tmp82 = _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d2var_get_type_some (tmp55, tmp78) ;
/* ats_ptr_type tmp83 ; */
tmp83 = (ats_sum_ptr_type)0 ;
tmp84 = _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__s2exp_get_dlablst_context (tmp55, tmp82, tmp79, (&tmp83)) ;
tmp85 = _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_util_2esats__s2exp_hnfize (tmp84) ;
tmp86 = _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__s2exp_is_lin (tmp85) ;
if (tmp86) {
/* tmp87 = */ auxerr_linold_5 (tmp55, arg1, tmp79, tmp85) ;
} else {
/* empty */
} /* end of [if] */
do {
/* branch: __ats_lab_10 */
__ats_lab_10_0:
if (tmp83 == (ats_sum_ptr_type)0) { goto __ats_lab_11_0 ; }
__ats_lab_10_1:
tmp88 = ats_caselptrlab_mac(anairiats_sum_4, tmp83, atslab_0) ;
tmp89 = _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_util_2esats__s2ctxt_hrepl (tmp88, arg2) ;
tmp90 = ATS_MALLOC(sizeof(anairiats_sum_4)) ;
ats_selptrset_mac(anairiats_sum_4, tmp90, atslab_0, tmp89) ;
/* tmp54 = */ _2tmp_2ATS_2dPostiats_2src_2pats_dynexp2_2esats__d2var_set_type (tmp78, tmp90) ;
break ;

/* branch: __ats_lab_11 */
__ats_lab_11_0:
// if (tmp83 != (ats_sum_ptr_type)0) { ats_deadcode_failure_handle () ; }
__ats_lab_11_1:
/* tmp91 = */ prerr_interror_loc_02085_ (tmp55) ;
/* tmp96 = */ atspre_prerr_string (ATSstrcst(": type-restoration for the left-value failed.")) ;
/* tmp97 = */ atspre_prerr_newline () ;
tmp98 = atspre_string_append ("/tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 7438(line=301, offs=18) -- 7454(line=301, offs=34)", ATSstrcst("\n")) ;
/* tmp54 = */ atspre_assert_errmsg (ats_false_bool, tmp98) ;
break ;
} while (0) ;
break ;

/* branch: __ats_lab_12 */
__ats_lab_12_0:
if (((ats_sum_ptr_type)tmp56)->tag != 42) { goto __ats_lab_15_0 ; }
__ats_lab_12_1:
tmp99 = ats_caselptrlab_mac(anairiats_sum_6, tmp56, atslab_0) ;
tmp100 = ats_caselptrlab_mac(anairiats_sum_6, tmp56, atslab_2) ;
tmp101 = _2tmp_2ATS_2dPostiats_2src_2pats_dynexp3_2esats__d3exp_get_type (tmp99) ;
tmp102 = _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_util_2esats__s2exp2hnf (tmp101) ;
tmp103 = _2tmp_2ATS_2dPostiats_2src_2pats_stacst2_2esats__un_s2exp_ptr_addr_type (tmp102) ;
do {
/* branch: __ats_lab_13 */
__ats_lab_13_0:
if (tmp103 == (ats_sum_ptr_type)0) { goto __ats_lab_14_0 ; }
__ats_lab_13_1:
tmp104 = ats_caselptrlab_mac(anairiats_sum_4, tmp103, atslab_0) ;
ATS_FREE(tmp103) ;
tmp105 = _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__s2addr_exch_type (tmp55, tmp104, tmp100, arg2) ;
break ;

/* branch: __ats_lab_14 */
__ats_lab_14_0:
// if (tmp103 != (ats_sum_ptr_type)0) { ats_deadcode_failure_handle () ; }
__ats_lab_14_1:
break ;
} while (0) ;
break ;

/* branch: __ats_lab_15 */
__ats_lab_15_0:
if (((ats_sum_ptr_type)tmp56)->tag != 39) { goto __ats_lab_18_0 ; }
__ats_lab_15_1:
tmp106 = ats_caselptrlab_mac(anairiats_sum_2, tmp56, atslab_0) ;
tmp107 = ats_caselptrlab_mac(anairiats_sum_2, tmp56, atslab_1) ;
tmp108 = _2tmp_2ATS_2dPostiats_2src_2pats_dynexp3_2esats__d3exp_get_type (tmp106) ;
tmp109 = _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_util_2esats__s2exp2hnf (tmp108) ;
tmp110 = _2tmp_2ATS_2dPostiats_2src_2pats_stacst2_2esats__un_s2exp_ptr_addr_type (tmp109) ;
do {
/* branch: __ats_lab_16 */
__ats_lab_16_0:
if (tmp110 == (ats_sum_ptr_type)0) { goto __ats_lab_17_0 ; }
__ats_lab_16_1:
tmp111 = ats_caselptrlab_mac(anairiats_sum_4, tmp110, atslab_0) ;
ATS_FREE(tmp110) ;
/* tmp54 = */ _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__s2addr_set_viewat (tmp55, tmp111, tmp107, arg2) ;
break ;

/* branch: __ats_lab_17 */
__ats_lab_17_0:
// if (tmp110 != (ats_sum_ptr_type)0) { ats_deadcode_failure_handle () ; }
__ats_lab_17_1:
break ;
} while (0) ;
break ;

/* branch: __ats_lab_18 */
__ats_lab_18_0:
__ats_lab_18_1:
tmp112 = atspre_add_int_int (ats_ptrget_mac(ats_int_type, arg3), 1) ;
ats_ptrget_mac(ats_int_type, arg3) = tmp112 ;
break ;
} while (0) ;
return /* (tmp54) */ ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3lval_set_type_err] */

/*
// /tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 8905(line=356, offs=3) -- 9453(line=378, offs=4)
*/
ATSglobaldec()
ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3lval_set_pat_type_left (ats_ptr_type arg0, ats_ptr_type arg1) {
/* local vardec */
// ATSlocal_void (tmp113) ;
ATSlocal (ats_ptr_type, tmp114) ;
ATSlocal (ats_ptr_type, tmp115) ;
ATSlocal (ats_int_type, tmp116) ;
// ATSlocal_void (tmp117) ;
ATSlocal (ats_bool_type, tmp118) ;
ATSlocal (ats_ptr_type, tmp119) ;
// ATSlocal_void (tmp120) ;
// ATSlocal_void (tmp121) ;
// ATSlocal_void (tmp122) ;
ATSlocal (ats_ptr_type, tmp123) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3lval_set_pat_type_left:
tmp114 = _2tmp_2ATS_2dPostiats_2src_2pats_dynexp3_2esats__p3at_get_type_left (arg1) ;
do {
/* branch: __ats_lab_19 */
__ats_lab_19_0:
if (tmp114 == (ats_sum_ptr_type)0) { goto __ats_lab_20_0 ; }
__ats_lab_19_1:
tmp115 = ats_caselptrlab_mac(anairiats_sum_4, tmp114, atslab_0) ;
/* ats_int_type tmp116 ; */
tmp116 = 0 ;
/* tmp117 = */ _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3lval_set_type_err (0, arg0, tmp115, (&tmp116)) ;
tmp118 = atspre_gt_int_int (tmp116, 0) ;
if (tmp118) {
tmp119 = ats_selbox_mac(ats_castptr_mac(anairiats_rec_7, arg0), atslab_d3exp_loc) ;
/* tmp120 = */ prerr_error3_loc_02089_ (tmp119) ;
/* tmp121 = */ atspre_prerr_string (ATSstrcst(": the dynamic expression should be a left-value but it is not.")) ;
/* tmp122 = */ atspre_prerr_newline () ;
tmp123 = ATS_MALLOC(sizeof(anairiats_sum_2)) ;
((ats_sum_ptr_type)tmp123)->tag = 75 ;
ats_selptrset_mac(anairiats_sum_2, tmp123, atslab_0, arg0) ;
ats_selptrset_mac(anairiats_sum_2, tmp123, atslab_1, tmp115) ;
/* tmp113 = */ _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__the_trans3errlst_add (tmp123) ;
} else {
/* empty */
} /* end of [if] */
break ;

/* branch: __ats_lab_20 */
__ats_lab_20_0:
// if (tmp114 != (ats_sum_ptr_type)0) { ats_deadcode_failure_handle () ; }
__ats_lab_20_1:
break ;
} while (0) ;
return /* (tmp113) */ ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3lval_set_pat_type_left] */

/*
// /tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 9524(line=384, offs=5) -- 9892(line=404, offs=4)
*/
ATSstaticdec()
ats_void_type
loop_10 (ats_ptr_type arg0, ats_ptr_type arg1) {
/* local vardec */
// ATSlocal_void (tmp124) ;
ATSlocal (ats_ptr_type, tmp125) ;
ATSlocal (ats_ptr_type, tmp126) ;
ATSlocal (ats_ptr_type, tmp127) ;
ATSlocal (ats_ptr_type, tmp128) ;
// ATSlocal_void (tmp129) ;

__ats_lab_loop_10:
do {
/* branch: __ats_lab_21 */
__ats_lab_21_0:
if (arg0 == (ats_sum_ptr_type)0) { goto __ats_lab_24_0 ; }
__ats_lab_21_1:
tmp125 = ats_caselptrlab_mac(anairiats_sum_9, arg0, atslab_0) ;
tmp126 = ats_caselptrlab_mac(anairiats_sum_9, arg0, atslab_1) ;
do {
/* branch: __ats_lab_22 */
__ats_lab_22_0:
if (arg1 == (ats_sum_ptr_type)0) { goto __ats_lab_23_0 ; }
__ats_lab_22_1:
tmp127 = ats_caselptrlab_mac(anairiats_sum_9, arg1, atslab_0) ;
tmp128 = ats_caselptrlab_mac(anairiats_sum_9, arg1, atslab_1) ;
/* tmp129 = */ _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3lval_set_pat_type_left (tmp125, tmp127) ;
arg0 = tmp126 ;
arg1 = tmp128 ;
goto __ats_lab_loop_10 ; // tail call
break ;

/* branch: __ats_lab_23 */
__ats_lab_23_0:
// if (arg1 != (ats_sum_ptr_type)0) { ats_deadcode_failure_handle () ; }
__ats_lab_23_1:
break ;
} while (0) ;
break ;

/* branch: __ats_lab_24 */
__ats_lab_24_0:
// if (arg0 != (ats_sum_ptr_type)0) { ats_deadcode_failure_handle () ; }
__ats_lab_24_1:
break ;
} while (0) ;
return /* (tmp124) */ ;
} /* end of [loop_10] */

/*
// /tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 9973(line=409, offs=29) -- 10005(line=409, offs=61)
*/
ATSglobaldec()
ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3lvalist_set_pat_type_left (ats_ptr_type arg0, ats_ptr_type arg1) {
/* local vardec */
// ATSlocal_void (tmp130) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3lvalist_set_pat_type_left:
/* tmp130 = */ loop_10 (arg0, arg1) ;
return /* (tmp130) */ ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3lvalist_set_pat_type_left] */

/*
// /tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 10064(line=418, offs=1) -- 10388(line=437, offs=4)
*/
ATSstaticdec()
ats_void_type
auxerr_12 (ats_ptr_type arg0) {
/* local vardec */
// ATSlocal_void (tmp131) ;
ATSlocal (ats_ptr_type, tmp132) ;
// ATSlocal_void (tmp133) ;
// ATSlocal_void (tmp134) ;
// ATSlocal_void (tmp135) ;
ATSlocal (ats_ptr_type, tmp136) ;

__ats_lab_auxerr_12:
tmp132 = ats_selbox_mac(ats_castptr_mac(anairiats_rec_7, arg0), atslab_d3exp_loc) ;
/* tmp133 = */ prerr_error3_loc_02089_ (tmp132) ;
/* tmp134 = */ atspre_prerr_string (ATSstrcst(": the function argument needs to be a left-value.")) ;
/* tmp135 = */ atspre_prerr_newline () ;
tmp136 = ATS_MALLOC(sizeof(anairiats_sum_8)) ;
((ats_sum_ptr_type)tmp136)->tag = 73 ;
ats_selptrset_mac(anairiats_sum_8, tmp136, atslab_0, arg0) ;
/* tmp131 = */ _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__the_trans3errlst_add (tmp136) ;
return /* (tmp131) */ ;
} /* end of [auxerr_12] */

/*
// /tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 10462(line=443, offs=3) -- 11301(line=474, offs=4)
*/
ATSglobaldec()
ats_int_type
_2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3lval_arg_set_type (ats_int_type arg0, ats_ptr_type arg1, ats_ptr_type arg2) {
/* local vardec */
ATSlocal (ats_int_type, tmp137) ;
ATSlocal (ats_int_type, tmp138) ;
ATSlocal (ats_int_type, tmp139) ;
// ATSlocal_void (tmp140) ;
// ATSlocal_void (tmp141) ;
ATSlocal (ats_bool_type, tmp142) ;
ATSlocal (ats_bool_type, tmp143) ;
ATSlocal (ats_bool_type, tmp144) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3lval_arg_set_type:
/* ats_int_type tmp138 ; */
tmp138 = 0 ;
/* ats_int_type tmp139 ; */
tmp139 = 0 ;
/* tmp140 = */ _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3lval_set_type_err (arg0, arg1, arg2, (&tmp138)) ;
tmp142 = atspre_gt_int_int (tmp138, 0) ;
if (tmp142) {
do {
/* branch: __ats_lab_25 */
__ats_lab_25_0:
__ats_lab_25_1:
tmp143 = atspre_gt_int_int (arg0, 0) ;
if (!tmp143) { goto __ats_lab_26_1 ; }
/* tmp141 = */ auxerr_12 (arg1) ;
break ;

/* branch: __ats_lab_26 */
__ats_lab_26_0:
__ats_lab_26_1:
tmp144 = _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__s2exp_is_nonlin (arg2) ;
if (!tmp144) { goto __ats_lab_27_1 ; }
break ;

/* branch: __ats_lab_27 */
__ats_lab_27_0:
__ats_lab_27_1:
/* tmp141 = */ auxerr_12 (arg1) ;
break ;
} while (0) ;
} else {
/* empty */
} /* end of [if] */
tmp137 = tmp139 ;
return (tmp137) ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3lval_arg_set_type] */

/*
// /tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 11386(line=481, offs=1) -- 11774(line=500, offs=4)
*/
ATSstaticdec()
ats_bool_type
s2exp_fun_is_freeptr_14 (ats_ptr_type arg0) {
/* local vardec */
ATSlocal (ats_bool_type, tmp145) ;
ATSlocal (ats_ptr_type, tmp146) ;
ATSlocal (ats_ptr_type, tmp147) ;
ATSlocal (ats_int_type, tmp148) ;
ATSlocal (ats_int_type, tmp149) ;
ATSlocal (ats_bool_type, tmp150) ;
ATSlocal (ats_bool_type, tmp151) ;

__ats_lab_s2exp_fun_is_freeptr_14:
tmp146 = ats_selbox_mac(ats_castptr_mac(anairiats_rec_10, arg0), atslab_s2exp_node) ;
do {
/* branch: __ats_lab_28 */
__ats_lab_28_0:
if (((ats_sum_ptr_type)tmp146)->tag != 19) { goto __ats_lab_31_0 ; }
__ats_lab_28_1:
tmp147 = ats_caselptrlab_mac(anairiats_sum_11, tmp146, atslab_0) ;
tmp148 = ats_caselptrlab_mac(anairiats_sum_11, tmp146, atslab_1) ;
do {
/* branch: __ats_lab_29 */
__ats_lab_29_0:
if (tmp147 == (ats_sum_ptr_type)0) { goto __ats_lab_30_0 ; }
__ats_lab_29_1:
tmp149 = ats_caselptrlab_mac(anairiats_sum_12, tmp147, atslab_0) ;
tmp150 = atspre_gt_int_int (tmp149, 0) ;
if (tmp150) {
tmp151 = atspre_lte_int_int (tmp148, 0) ;
if (tmp151) {
tmp145 = ats_true_bool ;
} else {
tmp145 = ats_false_bool ;
} /* end of [if] */
} else {
tmp145 = ats_false_bool ;
} /* end of [if] */
break ;

/* branch: __ats_lab_30 */
__ats_lab_30_0:
__ats_lab_30_1:
tmp145 = ats_false_bool ;
break ;
} while (0) ;
break ;

/* branch: __ats_lab_31 */
__ats_lab_31_0:
__ats_lab_31_1:
tmp145 = ats_false_bool ;
break ;
} while (0) ;
return (tmp145) ;
} /* end of [s2exp_fun_is_freeptr_14] */

/*
// /tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 11841(line=507, offs=1) -- 12090(line=517, offs=4)
*/
ATSstaticdec()
ats_void_type
auxerr_15 (ats_ptr_type arg0) {
/* local vardec */
// ATSlocal_void (tmp152) ;
ATSlocal (ats_ptr_type, tmp153) ;
// ATSlocal_void (tmp154) ;
// ATSlocal_void (tmp155) ;
// ATSlocal_void (tmp156) ;
ATSlocal (ats_ptr_type, tmp157) ;

__ats_lab_auxerr_15:
tmp153 = ats_selbox_mac(ats_castptr_mac(anairiats_rec_7, arg0), atslab_d3exp_loc) ;
/* tmp154 = */ prerr_error3_loc_02089_ (tmp153) ;
/* tmp155 = */ atspre_prerr_string (ATSstrcst(": the function itself needs to be a left-value.")) ;
/* tmp156 = */ atspre_prerr_newline () ;
tmp157 = ATS_MALLOC(sizeof(anairiats_sum_8)) ;
((ats_sum_ptr_type)tmp157)->tag = 72 ;
ats_selptrset_mac(anairiats_sum_8, tmp157, atslab_0, arg0) ;
/* tmp152 = */ _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__the_trans3errlst_add (tmp157) ;
return /* (tmp152) */ ;
} /* end of [auxerr_15] */

/*
// /tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 12110(line=520, offs=1) -- 13420(line=578, offs=4)
*/
ATSstaticdec()
ats_ptr_type
auxres_16 (ats_ptr_type arg0) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp158) ;
ATSlocal (ats_ptr_type, tmp159) ;
ATSlocal (ats_ptr_type, tmp160) ;
ATSlocal (ats_ptr_type, tmp161) ;
ATSlocal (ats_ptr_type, tmp162) ;
ATSlocal (ats_ptr_type, tmp163) ;
ATSlocal (ats_int_type, tmp164) ;
ATSlocal (ats_ptr_type, tmp165) ;
ATSlocal (ats_int_type, tmp166) ;
ATSlocal (ats_ptr_type, tmp167) ;
ATSlocal (ats_ptr_type, tmp168) ;
ATSlocal (ats_ptr_type, tmp169) ;
ATSlocal (ats_bool_type, tmp170) ;
ATSlocal (ats_bool_type, tmp171) ;
// ATSlocal_void (tmp172) ;
// ATSlocal_void (tmp173) ;
// ATSlocal_void (tmp174) ;
// ATSlocal_void (tmp175) ;
ATSlocal (ats_ptr_type, tmp176) ;
ATSlocal (ats_int_type, tmp177) ;
ATSlocal (ats_int_type, tmp178) ;
ATSlocal (ats_bool_type, tmp179) ;
ATSlocal (ats_int_type, tmp180) ;
ATSlocal (ats_int_type, tmp181) ;
// ATSlocal_void (tmp182) ;
// ATSlocal_void (tmp183) ;
ATSlocal (ats_bool_type, tmp184) ;
ATSlocal (ats_bool_type, tmp185) ;
ATSlocal (ats_bool_type, tmp186) ;

__ats_lab_auxres_16:
tmp159 = ats_selbox_mac(ats_castptr_mac(anairiats_rec_7, arg0), atslab_d3exp_loc) ;
tmp160 = _2tmp_2ATS_2dPostiats_2src_2pats_dynexp3_2esats__d3exp_get_type (arg0) ;
tmp161 = _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_util_2esats__s2exp_hnfize (tmp160) ;
tmp162 = ats_selbox_mac(ats_castptr_mac(anairiats_rec_10, tmp161), atslab_s2exp_node) ;
if (((ats_sum_ptr_type)tmp162)->tag != 19) { ats_caseof_failure_handle ("/tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 12250(line=529, offs=5) -- 12320(line=532, offs=21)") ; }
tmp163 = ats_caselptrlab_mac(anairiats_sum_11, tmp162, atslab_0) ;
tmp164 = ats_caselptrlab_mac(anairiats_sum_11, tmp162, atslab_1) ;
tmp165 = ats_caselptrlab_mac(anairiats_sum_11, tmp162, atslab_2) ;
tmp166 = ats_caselptrlab_mac(anairiats_sum_11, tmp162, atslab_3) ;
tmp167 = ats_caselptrlab_mac(anairiats_sum_11, tmp162, atslab_4) ;
tmp168 = ats_caselptrlab_mac(anairiats_sum_11, tmp162, atslab_5) ;
do {
/* branch: __ats_lab_32 */
__ats_lab_32_0:
__ats_lab_32_1:
tmp170 = atspre_eq_int_int (tmp164, 0) ;
if (!tmp170) { goto __ats_lab_33_1 ; }
tmp169 = tmp161 ;
break ;

/* branch: __ats_lab_33 */
__ats_lab_33_0:
__ats_lab_33_1:
tmp171 = atspre_eq_int_int (tmp164, 1) ;
if (!tmp171) { goto __ats_lab_34_1 ; }
tmp169 = _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__s2exp_fun_srt (_2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__s2rt_vtype, tmp163, -1, tmp165, tmp166, tmp167, tmp168) ;
break ;

/* branch: __ats_lab_34 */
__ats_lab_34_0:
__ats_lab_34_1:
/* tmp172 = */ prerr_error3_loc_02089_ (tmp159) ;
/* tmp173 = */ atspre_prerr_string (ATSstrcst(": a linear function cannot be applied repeatedly.")) ;
/* tmp174 = */ atspre_prerr_newline () ;
tmp176 = ATS_MALLOC(sizeof(anairiats_sum_8)) ;
((ats_sum_ptr_type)tmp176)->tag = 76 ;
ats_selptrset_mac(anairiats_sum_8, tmp176, atslab_0, arg0) ;
/* tmp175 = */ _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__the_trans3errlst_add (tmp176) ;
tmp169 = tmp161 ;
break ;
} while (0) ;
do {
/* branch: __ats_lab_35 */
__ats_lab_35_0:
if (tmp163 == (ats_sum_ptr_type)0) { goto __ats_lab_36_0 ; }
__ats_lab_35_1:
tmp178 = ats_caselptrlab_mac(anairiats_sum_12, tmp163, atslab_0) ;
tmp179 = atspre_eq_int_int (tmp178, 0) ;
if (tmp179) {
tmp177 = 1 ;
} else {
tmp177 = 0 ;
} /* end of [if] */
break ;

/* branch: __ats_lab_36 */
__ats_lab_36_0:
// if (tmp163 != (ats_sum_ptr_type)0) { ats_deadcode_failure_handle () ; }
__ats_lab_36_1:
tmp177 = 0 ;
break ;
} while (0) ;
/* ats_int_type tmp180 ; */
tmp180 = 0 ;
/* ats_int_type tmp181 ; */
tmp181 = 0 ;
/* tmp182 = */ _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3lval_set_type_err (tmp177, arg0, tmp169, (&tmp180)) ;
tmp184 = atspre_gt_int_int (tmp180, 0) ;
if (tmp184) {
do {
/* branch: __ats_lab_37 */
__ats_lab_37_0:
__ats_lab_37_1:
tmp185 = atspre_gt_int_int (tmp177, 0) ;
if (!tmp185) { goto __ats_lab_38_1 ; }
/* tmp183 = */ auxerr_15 (arg0) ;
break ;

/* branch: __ats_lab_38 */
__ats_lab_38_0:
__ats_lab_38_1:
tmp186 = s2exp_fun_is_freeptr_14 (tmp169) ;
if (!tmp186) { goto __ats_lab_39_1 ; }
tmp181 = 1 ;
break ;

/* branch: __ats_lab_39 */
__ats_lab_39_0:
__ats_lab_39_1:
break ;
} while (0) ;
} else {
/* empty */
} /* end of [if] */
tmp158 = _2tmp_2ATS_2dPostiats_2src_2pats_dynexp3_2esats__d3exp_refarg (tmp159, tmp169, tmp177, tmp181, arg0) ;
return (tmp158) ;
} /* end of [auxres_16] */

/*
// /tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 13547(line=586, offs=3) -- 13761(line=599, offs=4)
*/
ATSglobaldec()
ats_ptr_type
_2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3exp_fun_restore (ats_ptr_type arg0, ats_ptr_type arg1) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp187) ;
ATSlocal (ats_int_type, tmp188) ;
ATSlocal (ats_bool_type, tmp189) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3exp_fun_restore:
do {
/* branch: __ats_lab_40 */
__ats_lab_40_0:
if (arg0 == (ats_sum_ptr_type)0) { goto __ats_lab_41_0 ; }
__ats_lab_40_1:
tmp188 = ats_caselptrlab_mac(anairiats_sum_12, arg0, atslab_0) ;
tmp189 = atspre_gte_int_int (tmp188, 0) ;
if (tmp189) {
tmp187 = auxres_16 (arg1) ;
} else {
tmp187 = arg1 ;
} /* end of [if] */
break ;

/* branch: __ats_lab_41 */
__ats_lab_41_0:
// if (arg0 != (ats_sum_ptr_type)0) { ats_deadcode_failure_handle () ; }
__ats_lab_41_1:
tmp187 = arg1 ;
break ;
} while (0) ;
return (tmp187) ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3exp_fun_restore] */

/*
// /tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 13848(line=608, offs=1) -- 14032(line=616, offs=53)
*/
ATSstaticdec()
ats_ptr_type
auxlst1_18 (ats_ptr_type arg0, ats_ptr_type arg1, ats_ptr_type arg2) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp190) ;

__ats_lab_auxlst1_18:
do {
/* branch: __ats_lab_42 */
__ats_lab_42_0:
if (arg0 != (ats_sum_ptr_type)0) { goto __ats_lab_43_0 ; }
__ats_lab_42_1:
tmp190 = (ats_sum_ptr_type)0 ;
break ;

/* branch: __ats_lab_43 */
__ats_lab_43_0:
if (arg0 == (ats_sum_ptr_type)0) { ats_caseof_failure_handle ("/tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 13936(line=614, offs=3) -- 14032(line=616, offs=53)") ; }
__ats_lab_43_1:
tmp190 = auxlst2_19 (arg0, arg1, arg2) ;
break ;
} while (0) ;
return (tmp190) ;
} /* end of [auxlst1_18] */

/*
// /tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 14058(line=620, offs=1) -- 15770(line=678, offs=4)
*/
ATSstaticdec()
ats_ptr_type
auxlst2_19 (ats_ptr_type arg0, ats_ptr_type arg1, ats_ptr_type arg2) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp191) ;
ATSlocal (ats_ptr_type, tmp192) ;
ATSlocal (ats_ptr_type, tmp193) ;
ATSlocal (ats_ptr_type, tmp194) ;
ATSlocal (ats_ptr_type, tmp195) ;
ATSlocal (ats_ptr_type, tmp196) ;
ATSlocal (ats_ptr_type, tmp197) ;
ATSlocal (ats_ptr_type, tmp198) ;
ATSlocal (ats_int_type, tmp199) ;
ATSlocal (ats_ptr_type, tmp200) ;
ATSlocal (ats_int_type, tmp201) ;
ATSlocal (ats_ptr_type, tmp202) ;
ATSlocal (ats_ptr_type, tmp203) ;
ATSlocal (ats_int_type, tmp204) ;
ATSlocal (ats_ptr_type, tmp205) ;
ATSlocal (ats_ptr_type, tmp206) ;
ATSlocal (ats_ptr_type, tmp207) ;
ATSlocal (ats_ptr_type, tmp208) ;
ATSlocal (ats_ptr_type, tmp209) ;
ATSlocal (ats_ptr_type, tmp210) ;
ATSlocal (ats_ptr_type, tmp211) ;
ATSlocal (ats_ptr_type, tmp212) ;
ATSlocal (ats_int_type, tmp213) ;
ATSlocal (ats_ptr_type, tmp214) ;
ATSlocal (ats_ptr_type, tmp215) ;
ATSlocal (ats_ptr_type, tmp216) ;
ATSlocal (ats_ptr_type, tmp217) ;
ATSlocal (ats_ptr_type, tmp218) ;
ATSlocal (ats_ptr_type, tmp219) ;
ATSlocal (ats_ptr_type, tmp220) ;

__ats_lab_auxlst2_19:
do {
/* branch: __ats_lab_44 */
__ats_lab_44_0:
if (((ats_sum_ptr_type)arg2)->tag != 0) { goto __ats_lab_45_0 ; }
__ats_lab_44_1:
tmp191 = (ats_sum_ptr_type)0 ;
break ;

/* branch: __ats_lab_45 */
__ats_lab_45_0:
if (((ats_sum_ptr_type)arg2)->tag != 2) { goto __ats_lab_46_0 ; }
__ats_lab_45_1:
tmp192 = ats_caselptrlab_mac(anairiats_sum_13, arg2, atslab_2) ;
if (arg0 == (ats_sum_ptr_type)0) { ats_caseof_failure_handle ("/tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 14283(line=635, offs=9) -- 14311(line=635, offs=37)") ; }
tmp193 = ats_caselptrlab_mac(anairiats_sum_9, arg0, atslab_0) ;
tmp194 = ats_caselptrlab_mac(anairiats_sum_9, arg0, atslab_1) ;
if (arg1 == (ats_sum_ptr_type)0) { ats_caseof_failure_handle ("/tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 14320(line=636, offs=9) -- 14360(line=636, offs=49)") ; }
tmp195 = ats_caselptrlab_mac(anairiats_sum_9, arg1, atslab_0) ;
tmp196 = ats_caselptrlab_mac(anairiats_sum_9, arg1, atslab_1) ;
tmp197 = ats_selbox_mac(ats_castptr_mac(anairiats_rec_7, tmp193), atslab_d3exp_loc) ;
tmp198 = ats_selbox_mac(ats_castptr_mac(anairiats_rec_10, tmp195), atslab_s2exp_node) ;
if (((ats_sum_ptr_type)tmp198)->tag != 29) { ats_caseof_failure_handle ("/tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 14397(line=638, offs=9) -- 14444(line=638, offs=56)") ; }
tmp199 = ats_caselptrlab_mac(anairiats_sum_14, tmp198, atslab_0) ;
tmp200 = ats_caselptrlab_mac(anairiats_sum_14, tmp198, atslab_1) ;
tmp201 = _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3lval_arg_set_type (tmp199, tmp193, tmp200) ;
tmp202 = _2tmp_2ATS_2dPostiats_2src_2pats_dynexp3_2esats__d3exp_refarg (tmp197, tmp200, tmp199, tmp201, tmp193) ;
tmp203 = auxlst1_18 (tmp194, tmp196, tmp192) ;
tmp191 = ATS_MALLOC(sizeof(anairiats_sum_9)) ;
ats_selptrset_mac(anairiats_sum_9, tmp191, atslab_0, tmp202) ;
ats_selptrset_mac(anairiats_sum_9, tmp191, atslab_1, tmp203) ;
break ;

/* branch: __ats_lab_46 */
__ats_lab_46_0:
if (((ats_sum_ptr_type)arg2)->tag != 3) { goto __ats_lab_47_0 ; }
__ats_lab_46_1:
tmp204 = ats_caselptrlab_mac(anairiats_sum_13, arg2, atslab_0) ;
tmp205 = ats_caselptrlab_mac(anairiats_sum_13, arg2, atslab_1) ;
tmp206 = ats_caselptrlab_mac(anairiats_sum_13, arg2, atslab_2) ;
if (arg0 == (ats_sum_ptr_type)0) { ats_caseof_failure_handle ("/tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 14788(line=649, offs=9) -- 14816(line=649, offs=37)") ; }
tmp207 = ats_caselptrlab_mac(anairiats_sum_9, arg0, atslab_0) ;
tmp208 = ats_caselptrlab_mac(anairiats_sum_9, arg0, atslab_1) ;
if (arg1 == (ats_sum_ptr_type)0) { ats_caseof_failure_handle ("/tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 14825(line=650, offs=9) -- 14865(line=650, offs=49)") ; }
tmp209 = ats_caselptrlab_mac(anairiats_sum_9, arg1, atslab_1) ;
tmp210 = ats_selbox_mac(ats_castptr_mac(anairiats_rec_7, tmp207), atslab_d3exp_loc) ;
tmp211 = _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_util_2esats__s2exp2hnf (tmp205) ;
tmp212 = _2tmp_2ATS_2dPostiats_2src_2pats_trans3_env_2esats__s2hnf_opnexi_and_add (tmp210, tmp211) ;
tmp213 = _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3lval_arg_set_type (tmp204, tmp207, tmp212) ;
tmp214 = _2tmp_2ATS_2dPostiats_2src_2pats_dynexp3_2esats__d3exp_refarg (tmp210, tmp212, tmp204, tmp213, tmp207) ;
tmp215 = auxlst1_18 (tmp208, tmp209, tmp206) ;
tmp191 = ATS_MALLOC(sizeof(anairiats_sum_9)) ;
ats_selptrset_mac(anairiats_sum_9, tmp191, atslab_0, tmp214) ;
ats_selptrset_mac(anairiats_sum_9, tmp191, atslab_1, tmp215) ;
break ;

/* branch: __ats_lab_47 */
__ats_lab_47_0:
// if (((ats_sum_ptr_type)arg2)->tag != 1) { ats_deadcode_failure_handle () ; }
__ats_lab_47_1:
tmp216 = ats_caselptrlab_mac(anairiats_sum_8, arg2, atslab_0) ;
if (arg0 == (ats_sum_ptr_type)0) { ats_caseof_failure_handle ("/tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 15567(line=671, offs=9) -- 15595(line=671, offs=37)") ; }
tmp217 = ats_caselptrlab_mac(anairiats_sum_9, arg0, atslab_0) ;
tmp218 = ats_caselptrlab_mac(anairiats_sum_9, arg0, atslab_1) ;
if (arg1 == (ats_sum_ptr_type)0) { ats_caseof_failure_handle ("/tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 15604(line=672, offs=9) -- 15644(line=672, offs=49)") ; }
tmp219 = ats_caselptrlab_mac(anairiats_sum_9, arg1, atslab_1) ;
tmp220 = auxlst1_18 (tmp218, tmp219, tmp216) ;
tmp191 = ATS_MALLOC(sizeof(anairiats_sum_9)) ;
ats_selptrset_mac(anairiats_sum_9, tmp191, atslab_0, tmp217) ;
ats_selptrset_mac(anairiats_sum_9, tmp191, atslab_1, tmp220) ;
break ;
} while (0) ;
return (tmp191) ;
} /* end of [auxlst2_19] */

/*
// /tmp/ATS-Postiats/src/pats_trans3_lvalres.dats: 15864(line=684, offs=3) -- 15917(line=684, offs=56)
*/
ATSglobaldec()
ats_ptr_type
_2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3explst_arg_restore (ats_ptr_type arg0, ats_ptr_type arg1, ats_ptr_type arg2) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp221) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3explst_arg_restore:
tmp221 = auxlst1_18 (arg0, arg1, arg2) ;
return (tmp221) ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__d3explst_arg_restore] */

/* static load function */

// extern ats_void_type _2tmp_2ATS_2dPostiats_2src_2pats_atspre_2edats__staload (void) ;
// extern ats_void_type ATS_2d0_2e2_2e12_2prelude_2SATS_2unsafe_2esats__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_syntax_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_util_2esats__staload (void) ;
extern ats_void_type _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__staload (void) ;
extern ats_void_type _2tmp_2ATS_2dPostiats_2src_2pats_stacst2_2esats__staload (void) ;
extern ats_void_type _2tmp_2ATS_2dPostiats_2src_2pats_dynexp2_2esats__staload (void) ;
extern ats_void_type _2tmp_2ATS_2dPostiats_2src_2pats_dynexp3_2esats__staload (void) ;
extern ats_void_type _2tmp_2ATS_2dPostiats_2src_2pats_staexp2_solve_2esats__staload (void) ;
extern ats_void_type _2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__staload (void) ;
extern ats_void_type _2tmp_2ATS_2dPostiats_2src_2pats_trans3_env_2esats__staload (void) ;

ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_trans3_lvalres_2edats__staload () {
static int _2tmp_2ATS_2dPostiats_2src_2pats_trans3_lvalres_2edats__staload_flag = 0 ;
if (_2tmp_2ATS_2dPostiats_2src_2pats_trans3_lvalres_2edats__staload_flag) return ;
_2tmp_2ATS_2dPostiats_2src_2pats_trans3_lvalres_2edats__staload_flag = 1 ;

// _2tmp_2ATS_2dPostiats_2src_2pats_atspre_2edats__staload () ;
// ATS_2d0_2e2_2e12_2prelude_2SATS_2unsafe_2esats__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_syntax_2esats__staload () ;
_2tmp_2ATS_2dPostiats_2src_2pats_staexp2_2esats__staload () ;
_2tmp_2ATS_2dPostiats_2src_2pats_staexp2_util_2esats__staload () ;
_2tmp_2ATS_2dPostiats_2src_2pats_staexp2_error_2esats__staload () ;
_2tmp_2ATS_2dPostiats_2src_2pats_stacst2_2esats__staload () ;
_2tmp_2ATS_2dPostiats_2src_2pats_dynexp2_2esats__staload () ;
_2tmp_2ATS_2dPostiats_2src_2pats_dynexp3_2esats__staload () ;
_2tmp_2ATS_2dPostiats_2src_2pats_staexp2_solve_2esats__staload () ;
_2tmp_2ATS_2dPostiats_2src_2pats_trans3_2esats__staload () ;
_2tmp_2ATS_2dPostiats_2src_2pats_trans3_env_2esats__staload () ;

return ;
} /* staload function */

/* dynamic load function */

// dynload flag declaration
extern ats_int_type _2tmp_2ATS_2dPostiats_2src_2pats_trans3_lvalres_2edats__dynload_flag ;

ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_trans3_lvalres_2edats__dynload () {
_2tmp_2ATS_2dPostiats_2src_2pats_trans3_lvalres_2edats__dynload_flag = 1 ;
_2tmp_2ATS_2dPostiats_2src_2pats_trans3_lvalres_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 */

/* marking external values for GC */

/* code for dynamic loading */
return ;
} /* end of [dynload function] */

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

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

/* end of [pats_trans3_lvalres_dats.c] */
