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

/* 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_lexbuf.cats"

#include "pats_location.cats"

#include "libats/ngc/CATS/deque_arr.cats"

#include "libats/ngc/CATS/deque_arr.cats"

#include "pats_location.cats"

#include "pats_lexbuf.cats"

#include "pats_location.cats"

#include "pats_tokbuf.cats"

#include "pats_lexbuf.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_token_loc ;
ats_ptr_type atslab_token_node ;
} anairiats_rec_1 ;

/* external typedefs */
/* external dynamic constructor declarations */
ATSextern_val(ats_sum_type, _2tmp_2ATS_2dPostiats_2src_2pats_lexing_2esats__T_EOF_178) ;

/* external dynamic constant declarations */
ATSextern_fun(ats_void_type, atspre_vbox_make_view_ptr) (ats_ptr_type) ;
ATSextern_fun(ats_bool_type, atspre_lte_int_int) (ats_int_type, ats_int_type) ;
ATSextern_fun(ats_uint_type, atspre_add_uint_uint) (ats_uint_type, ats_uint_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_add_size1_size1) (ats_size_type, ats_size_type) ;
ATSextern_fun(ats_size_type, atspre_sub_size1_int1) (ats_size_type, ats_int_type) ;
ATSextern_fun(ats_size_type, atspre_sub_size1_size1) (ats_size_type, ats_size_type) ;
ATSextern_fun(ats_size_type, atspre_mul_size1_size1) (ats_size_type, ats_size_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_gt_size1_size1) (ats_size_type, ats_size_type) ;
ATSextern_fun(ats_bool_type, atspre_eq_size1_int1) (ats_size_type, ats_int_type) ;
ATSextern_fun(ats_bool_type, atspre_eq_size1_size1) (ats_size_type, ats_size_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_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_lexbuf_2esats__lexbuf_initize_filp) (ats_ref_type, ats_ptr_type) ;
ATSextern_fun(ats_void_type, _2tmp_2ATS_2dPostiats_2src_2pats_lexbuf_2esats__lexbuf_initize_getc) (ats_ref_type, ats_clo_ptr_type) ;
ATSextern_fun(ats_void_type, _2tmp_2ATS_2dPostiats_2src_2pats_lexbuf_2esats__lexbuf_initize_string) (ats_ref_type, ats_ptr_type) ;
ATSextern_fun(ats_void_type, _2tmp_2ATS_2dPostiats_2src_2pats_lexbuf_2esats__lexbuf_uninitize) (ats_ref_type) ;
ATSextern_fun(ats_size_type, ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_cap) (ats_ref_type) ;
ATSextern_fun(ats_size_type, ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_size) (ats_ref_type) ;
ATSextern_fun(ats_void_type, atslib_ngc_deque_arr_deque_initialize_tsz) (ats_ref_type, ats_size_type, ats_ptr_type, ats_size_type) ;
ATSextern_fun(ats_ptr_type, atslib_ngc_deque_arr_deque_uninitialize) (ats_ref_type) ;
ATSextern_fun(ats_ptr_type, atslib_ngc_deque_arr_deque_takeout_tsz) (ats_ref_type, ats_size_type, ats_size_type) ;
ATSextern_fun(ats_void_type, atslib_ngc_deque_arr_deque_insert_end_many_tsz) (ats_ref_type, ats_size_type, ats_ref_type, ats_size_type) ;
ATSextern_fun(ats_void_type, atslib_ngc_deque_arr_deque_remove_beg_many_tsz) (ats_ref_type, ats_size_type, ats_ref_type, ats_size_type) ;
ATSextern_fun(ats_void_type, ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_clear_all) (ats_ref_type) ;
ATSextern_fun(ats_void_type, atslib_ngc_deque_arr_deque_copyout_tsz) (ats_ref_type, ats_size_type, ats_size_type, ats_ref_type, ats_size_type) ;
ATSextern_fun(ats_ptr_type, atslib_ngc_deque_arr_deque_update_capacity_tsz) (ats_ref_type, ats_size_type, ats_ptr_type, ats_size_type) ;
ATSextern_fun(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_lexing_2esats__lexing_next_token_ncmnt) (ats_ref_type) ;
ATSextern_fun(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_get_token) (ats_ref_type) ;
ATSextern_fun(ats_ptr_type, _2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_getinc_token) (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 () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__lemma_deque_param_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__DEQUEarr_v_encode_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__DEQUEarr_v_decode_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__DEQUEarr_v_clear_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__DEQUEarr_insert_beg_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__DEQUEarr_insert_end_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__DEQUEarr_remove_beg_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__DEQUEarr_remove_end_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats____assert_prfck () ;
extern
ats_void_type ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats____assert_prfck () ;
extern
ats_void_type _2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2edats__tokbuf0_trans_prfck () ;
extern
ats_void_type _2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2edats__tokbuf0_trans_prfck () ;
extern
ats_void_type _2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2edats__tokbuf0_trans_prfck () ;
extern
ats_void_type _2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2edats__tokbuf0_trans_prfck () ;
extern
ats_void_type _2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2edats__tokbuf0_untrans_prfck () ;
#endif /* _ATS_PROOFCHECK */

/* assuming abstract types */
int _2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__sasp__tokbuf_vt0ype = 0 ;

/* sum constructor declarations */
/* exn constructor declarations */
/* global dynamic (non-functional) constant declarations */
/* internal function declarations */
static
ats_ptr_type array_ptr_alloc_01563_ats_ptr_type (ats_size_type arg0) ;
static
ats_void_type deque_initialize_02071_ats_ptr_type (ats_ref_type arg0, ats_size_type arg1, ats_ptr_type arg2) ;
static
ats_void_type deque_clear_beg_02086_ats_ptr_type (ats_ref_type arg0, ats_size_type arg1) ;
static
ats_ptr_type deque_get_elt_at_02076_ats_ptr_type (ats_ref_type arg0, ats_size_type arg1) ;
static
ats_ptr_type DEQUEptrnxt_02098_ats_ptr_type (ats_ref_type arg0, ats_ptr_type arg1) ;
static
ats_void_type deque_insert_end_02079_ats_ptr_type (ats_ref_type arg0, ats_ptr_type arg1) ;
static
ats_ptr_type deque_update_capacity_02091_ats_ptr_type (ats_ref_type arg0, ats_size_type arg1, ats_ptr_type arg2) ;
static
ats_ptr_type DEQUEptrprv_02096_ats_ptr_type (ats_ref_type arg0, ats_ptr_type arg1) ;
static
ats_void_type deque_insert_beg_02078_ats_ptr_type (ats_ref_type arg0, ats_ptr_type arg1) ;

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

/* function implementations */

/*
// /nix/store/rfja8ixrs5wb4kj3kiwlch1apnh7qgvy-ats-0.2.12/lib/ats-anairiats-0.2.12/prelude/DATS/array.dats: 23852(line=868, offs=17) -- 23896(line=868, offs=61)
*/
ATSstaticdec()
ats_ptr_type
array_ptr_alloc_01563_ats_ptr_type (ats_size_type arg0) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp2) ;

__ats_lab_array_ptr_alloc_01563_ats_ptr_type:
tmp2 = atspre_array_ptr_alloc_tsz (arg0, sizeof(ats_ptr_type)) ;
return (tmp2) ;
} /* end of [array_ptr_alloc_01563_ats_ptr_type] */

/*
// /nix/store/rfja8ixrs5wb4kj3kiwlch1apnh7qgvy-ats-0.2.12/lib/ats-anairiats-0.2.12/libats/ngc/DATS/deque_arr.dats: 5421(line=211, offs=22) -- 5522(line=214, offs=69)
*/
ATSstaticdec()
ats_void_type
deque_initialize_02071_ats_ptr_type (ats_ref_type arg0, ats_size_type arg1, ats_ptr_type arg2) {
/* local vardec */
// ATSlocal_void (tmp5) ;

__ats_lab_deque_initialize_02071_ats_ptr_type:
/* tmp5 = */ atslib_ngc_deque_arr_deque_initialize_tsz (arg0, arg1, arg2, sizeof(ats_ptr_type)) ;
return /* (tmp5) */ ;
} /* end of [deque_initialize_02071_ats_ptr_type] */

/*
// /tmp/ATS-Postiats/src/pats_tokbuf.dats: 2454(line=103, offs=3) -- 2806(line=125, offs=2)
*/
ATSglobaldec()
ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_initize_filp (ats_ref_type arg0, ats_ptr_type arg1) {
/* local vardec */
// ATSlocal_void (tmp0) ;
ATSlocal (ats_ptr_type, tmp1) ;
ATSlocal (ats_ptr_type, tmp3) ;
// ATSlocal_void (tmp4) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_initize_filp:
tmp1 = array_ptr_alloc_01563_ats_ptr_type (1024) ;
tmp3 = ats_selsin_mac(tmp1, atslab_2) ;
/* tmp4 = */ deque_initialize_02071_ats_ptr_type (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), tbuf), 1024, tmp3) ;
ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), ntok) = 0u ;
/* tmp0 = */ _2tmp_2ATS_2dPostiats_2src_2pats_lexbuf_2esats__lexbuf_initize_filp (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), lexbuf), arg1) ;
return /* (tmp0) */ ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_initize_filp] */

/*
// /tmp/ATS-Postiats/src/pats_tokbuf.dats: 2893(line=131, offs=3) -- 3233(line=153, offs=2)
*/
ATSglobaldec()
ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_initize_getc (ats_ref_type arg0, ats_clo_ptr_type arg1) {
/* local vardec */
// ATSlocal_void (tmp6) ;
ATSlocal (ats_ptr_type, tmp7) ;
ATSlocal (ats_ptr_type, tmp8) ;
// ATSlocal_void (tmp9) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_initize_getc:
tmp7 = array_ptr_alloc_01563_ats_ptr_type (1024) ;
tmp8 = ats_selsin_mac(tmp7, atslab_2) ;
/* tmp9 = */ deque_initialize_02071_ats_ptr_type (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), tbuf), 1024, tmp8) ;
ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), ntok) = 0u ;
/* tmp6 = */ _2tmp_2ATS_2dPostiats_2src_2pats_lexbuf_2esats__lexbuf_initize_getc (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), lexbuf), arg1) ;
return /* (tmp6) */ ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_initize_getc] */

/*
// /tmp/ATS-Postiats/src/pats_tokbuf.dats: 3322(line=159, offs=3) -- 3662(line=181, offs=2)
*/
ATSglobaldec()
ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_initize_string (ats_ref_type arg0, ats_ptr_type arg1) {
/* local vardec */
// ATSlocal_void (tmp10) ;
ATSlocal (ats_ptr_type, tmp11) ;
ATSlocal (ats_ptr_type, tmp12) ;
// ATSlocal_void (tmp13) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_initize_string:
tmp11 = array_ptr_alloc_01563_ats_ptr_type (1024) ;
tmp12 = ats_selsin_mac(tmp11, atslab_2) ;
/* tmp13 = */ deque_initialize_02071_ats_ptr_type (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), tbuf), 1024, tmp12) ;
ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), ntok) = 0u ;
/* tmp10 = */ _2tmp_2ATS_2dPostiats_2src_2pats_lexbuf_2esats__lexbuf_initize_string (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), lexbuf), arg1) ;
return /* (tmp10) */ ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_initize_string] */

/*
// /tmp/ATS-Postiats/src/pats_tokbuf.dats: 3753(line=187, offs=3) -- 4063(line=208, offs=2)
*/
ATSglobaldec()
ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_initize_lexbuf (ats_ref_type arg0, ats_ref_type arg1) {
/* local vardec */
// ATSlocal_void (tmp14) ;
ATSlocal (ats_ptr_type, tmp15) ;
ATSlocal (ats_ptr_type, tmp16) ;
// ATSlocal_void (tmp17) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_initize_lexbuf:
tmp15 = array_ptr_alloc_01563_ats_ptr_type (1024) ;
tmp16 = ats_selsin_mac(tmp15, atslab_2) ;
/* tmp17 = */ deque_initialize_02071_ats_ptr_type (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), tbuf), 1024, tmp16) ;
ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), ntok) = 0u ;
ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), lexbuf) = ats_ptrget_mac(pats_lexbuf_struct, arg1) ;
return /* (tmp14) */ ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_initize_lexbuf] */

/*
// /tmp/ATS-Postiats/src/pats_tokbuf.dats: 4149(line=214, offs=3) -- 4424(line=227, offs=2)
*/
ATSglobaldec()
ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_uninitize (ats_ref_type arg0) {
/* local vardec */
// ATSlocal_void (tmp18) ;
ATSlocal (ats_ptr_type, tmp19) ;
ATSlocal (ats_ptr_type, tmp20) ;
// ATSlocal_void (tmp21) ;
// ATSlocal_void (tmp22) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_uninitize:
tmp19 = atslib_ngc_deque_arr_deque_uninitialize (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), tbuf)) ;
tmp20 = ats_selsin_mac(tmp19, atslab_2) ;
/* tmp21 = */ atspre_array_ptr_free (tmp20) ;
/* tmp22 = */ _2tmp_2ATS_2dPostiats_2src_2pats_lexbuf_2esats__lexbuf_uninitize (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), lexbuf)) ;
return /* (tmp18) */ ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_uninitize] */

/*
// /tmp/ATS-Postiats/src/pats_tokbuf.dats: 4502(line=232, offs=17) -- 4518(line=232, offs=33)
*/
ATSglobaldec()
ats_uint_type
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_get_ntok (ats_ref_type arg0) {
/* local vardec */
ATSlocal (ats_uint_type, tmp23) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_get_ntok:
tmp23 = ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), ntok) ;
return (tmp23) ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_get_ntok] */

/*
// /tmp/ATS-Postiats/src/pats_tokbuf.dats: 4545(line=234, offs=17) -- 4569(line=234, offs=41)
*/
ATSglobaldec()
ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_set_ntok (ats_ref_type arg0, ats_uint_type arg1) {
/* local vardec */
// ATSlocal_void (tmp24) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_set_ntok:
ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), ntok) = arg1 ;
return /* (tmp24) */ ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_set_ntok] */

/*
// /tmp/ATS-Postiats/src/pats_tokbuf.dats: 4616(line=239, offs=15) -- 4649(line=239, offs=48)
*/
ATSglobaldec()
ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_incby1 (ats_ref_type arg0) {
/* local vardec */
// ATSlocal_void (tmp25) ;
ATSlocal (ats_uint_type, tmp26) ;
ATSlocal (ats_uint_type, tmp27) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_incby1:
tmp27 = ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), ntok) ;
tmp26 = atspre_add_uint_uint (tmp27, 1u) ;
ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), ntok) = tmp26 ;
return /* (tmp25) */ ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_incby1] */

/*
// /tmp/ATS-Postiats/src/pats_tokbuf.dats: 4679(line=241, offs=20) -- 4714(line=241, offs=55)
*/
ATSglobaldec()
ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_incby_count (ats_ref_type arg0, ats_uint_type arg1) {
/* local vardec */
// ATSlocal_void (tmp28) ;
ATSlocal (ats_uint_type, tmp29) ;
ATSlocal (ats_uint_type, tmp30) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_incby_count:
tmp30 = ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), ntok) ;
tmp29 = atspre_add_uint_uint (tmp30, arg1) ;
ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), ntok) = tmp29 ;
return /* (tmp28) */ ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_incby_count] */

/*
// /nix/store/rfja8ixrs5wb4kj3kiwlch1apnh7qgvy-ats-0.2.12/lib/ats-anairiats-0.2.12/libats/ngc/DATS/deque_arr.dats: 10929(line=427, offs=15) -- 11658(line=451, offs=2)
*/
ATSstaticdec()
ats_void_type
deque_clear_beg_02086_ats_ptr_type (ats_ref_type arg0, ats_size_type arg1) {
/* local vardec */
// ATSlocal_void (tmp35) ;
ATSlocal (ats_size_type, tmp36) ;
ATSlocal (ats_ptr_type, tmp37) ;
ATSlocal (ats_ptr_type, tmp38) ;
ATSlocal (ats_ptr_type, tmp39) ;
ATSlocal (ats_size_type, tmp40) ;
ATSlocal (ats_bool_type, tmp42) ;
ATSlocal (ats_ptr_type, tmp43) ;
ATSlocal (ats_ptr_type, tmp44) ;
ATSlocal (ats_ptrdiff_type, tmp45) ;
ATSlocal (ats_ptr_type, tmp46) ;
ATSlocal (ats_size_type, tmp47) ;

__ats_lab_deque_clear_beg_02086_ats_ptr_type:
tmp36 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), nitm) ;
tmp37 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), qarr_rgt) ;
tmp38 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), qarr_beg) ;
/* ats_ptr_type tmp39 ; */
tmp40 = atspre_mul_size1_size1 (arg1, sizeof(ats_ptr_type)) ;
tmp39 = atspre_padd_size (tmp38, tmp40) ;
tmp42 = atspre_pgte (tmp39, tmp37) ;
if (tmp42) {
tmp44 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), qarr_lft) ;
tmp45 = atspre_pdiff (tmp39, tmp37) ;
tmp43 = atspre_padd_size (tmp44, ats_castfn_mac(ats_size_type, tmp45)) ;
tmp39 = tmp43 ;
} else {
/* empty */
} /* end of [if] */
tmp46 = ats_castfn_mac(ats_ptr_type, tmp39) ;
tmp47 = atspre_sub_size1_size1 (tmp36, arg1) ;
ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), nitm) = tmp47 ;
ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), qarr_beg) = tmp46 ;
return /* (tmp35) */ ;
} /* end of [deque_clear_beg_02086_ats_ptr_type] */

/*
// /tmp/ATS-Postiats/src/pats_tokbuf.dats: 4760(line=246, offs=14) -- 5182(line=266, offs=4)
*/
ATSglobaldec()
ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_reset (ats_ref_type arg0) {
/* local vardec */
// ATSlocal_void (tmp31) ;
ATSlocal (ats_uint_type, tmp32) ;
ATSlocal (ats_size_type, tmp33) ;
ATSlocal (ats_bool_type, tmp34) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_reset:
tmp32 = ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), ntok) ;
ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), ntok) = 0u ;
tmp33 = ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_size (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), tbuf)) ;
tmp34 = atspre_lt_size1_size1 (ats_castfn_mac(ats_size_type, tmp32), tmp33) ;
if (tmp34) {
/* tmp31 = */ deque_clear_beg_02086_ats_ptr_type (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), tbuf), ats_castfn_mac(ats_size_type, tmp32)) ;
} else {
/* tmp31 = */ ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_clear_all (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), tbuf)) ;
} /* end of [if] */
return /* (tmp31) */ ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_reset] */

/*
// /nix/store/rfja8ixrs5wb4kj3kiwlch1apnh7qgvy-ats-0.2.12/lib/ats-anairiats-0.2.12/libats/ngc/DATS/deque_arr.dats: 7245(line=285, offs=3) -- 7378(line=291, offs=2)
*/
ATSstaticdec()
ats_ptr_type
deque_get_elt_at_02076_ats_ptr_type (ats_ref_type arg0, ats_size_type arg1) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp52) ;
ATSlocal (ats_ptr_type, tmp53) ;
ATSlocal (ats_ptr_type, tmp54) ;

__ats_lab_deque_get_elt_at_02076_ats_ptr_type:
tmp53 = atslib_ngc_deque_arr_deque_takeout_tsz (arg0, arg1, sizeof(ats_ptr_type)) ;
tmp54 = ats_selsin_mac(tmp53, atslab_2) ;
tmp52 = ats_ptrget_mac(ats_ptr_type, tmp54) ;
return (tmp52) ;
} /* end of [deque_get_elt_at_02076_ats_ptr_type] */

/*
// /nix/store/rfja8ixrs5wb4kj3kiwlch1apnh7qgvy-ats-0.2.12/lib/ats-anairiats-0.2.12/libats/ngc/DATS/deque_arr.dats: 4302(line=161, offs=29) -- 4599(line=171, offs=4)
*/
ATSstaticdec()
ats_ptr_type
DEQUEptrnxt_02098_ats_ptr_type (ats_ref_type arg0, ats_ptr_type arg1) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp62) ;
ATSlocal (ats_ptr_type, tmp63) ;
ATSlocal (ats_bool_type, tmp65) ;
ATSlocal (ats_ptr_type, tmp66) ;
ATSlocal (ats_ptr_type, tmp67) ;

__ats_lab_DEQUEptrnxt_02098_ats_ptr_type:
/* ats_ptr_type tmp63 ; */
tmp63 = atspre_padd_size (arg1, sizeof(ats_ptr_type)) ;
tmp66 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), qarr_rgt) ;
tmp65 = atspre_pgte (tmp63, tmp66) ;
if (tmp65) {
tmp67 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), qarr_lft) ;
tmp63 = tmp67 ;
} else {
/* empty */
} /* end of [if] */
tmp62 = tmp63 ;
return (tmp62) ;
} /* end of [DEQUEptrnxt_02098_ats_ptr_type] */

/*
// /nix/store/rfja8ixrs5wb4kj3kiwlch1apnh7qgvy-ats-0.2.12/lib/ats-anairiats-0.2.12/libats/ngc/DATS/deque_arr.dats: 8755(line=344, offs=18) -- 9091(line=357, offs=4)
*/
ATSstaticdec()
ats_void_type
deque_insert_end_02079_ats_ptr_type (ats_ref_type arg0, ats_ptr_type arg1) {
/* local vardec */
// ATSlocal_void (tmp59) ;
ATSlocal (ats_ptr_type, tmp60) ;
ATSlocal (ats_ptr_type, tmp61) ;
ATSlocal (ats_ptr_type, tmp68) ;
ATSlocal (ats_size_type, tmp69) ;
ATSlocal (ats_size_type, tmp70) ;

__ats_lab_deque_insert_end_02079_ats_ptr_type:
tmp60 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), qarr_end) ;
tmp61 = DEQUEptrnxt_02098_ats_ptr_type (arg0, tmp60) ;
tmp68 = ats_selsin_mac(tmp61, atslab_1) ;
ats_ptrget_mac(ats_ptr_type, tmp60) = arg1 ;
tmp70 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), nitm) ;
tmp69 = atspre_add_size1_int1 (tmp70, 1) ;
ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), nitm) = tmp69 ;
ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), qarr_end) = tmp68 ;
return /* (tmp59) */ ;
} /* end of [deque_insert_end_02079_ats_ptr_type] */

/*
// /nix/store/rfja8ixrs5wb4kj3kiwlch1apnh7qgvy-ats-0.2.12/lib/ats-anairiats-0.2.12/libats/ngc/DATS/deque_arr.dats: 13207(line=513, offs=23) -- 13311(line=516, offs=71)
*/
ATSstaticdec()
ats_ptr_type
deque_update_capacity_02091_ats_ptr_type (ats_ref_type arg0, ats_size_type arg1, ats_ptr_type arg2) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp75) ;

__ats_lab_deque_update_capacity_02091_ats_ptr_type:
tmp75 = atslib_ngc_deque_arr_deque_update_capacity_tsz (arg0, arg1, arg2, sizeof(ats_ptr_type)) ;
return (tmp75) ;
} /* end of [deque_update_capacity_02091_ats_ptr_type] */

/*
// /tmp/ATS-Postiats/src/pats_tokbuf.dats: 5259(line=272, offs=3) -- 6083(line=310, offs=4)
*/
ATSglobaldec()
ats_ptr_type
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_get_token (ats_ref_type arg0) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp48) ;
ATSlocal (ats_uint_type, tmp49) ;
ATSlocal (ats_size_type, tmp50) ;
ATSlocal (ats_bool_type, tmp51) ;
ATSlocal (ats_ptr_type, tmp55) ;
ATSlocal (ats_size_type, tmp56) ;
// ATSlocal_void (tmp57) ;
ATSlocal (ats_bool_type, tmp58) ;
ATSlocal (ats_size_type, tmp71) ;
ATSlocal (ats_ptr_type, tmp72) ;
ATSlocal (ats_ptr_type, tmp73) ;
ATSlocal (ats_ptr_type, tmp74) ;
ATSlocal (ats_ptr_type, tmp76) ;
// ATSlocal_void (tmp77) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_get_token:
tmp49 = ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), ntok) ;
tmp50 = ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_size (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), tbuf)) ;
tmp51 = atspre_lt_size1_size1 (ats_castfn_mac(ats_size_type, tmp49), tmp50) ;
if (tmp51) {
tmp48 = deque_get_elt_at_02076_ats_ptr_type (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), tbuf), ats_castfn_mac(ats_size_type, tmp49)) ;
} else {
tmp55 = _2tmp_2ATS_2dPostiats_2src_2pats_lexing_2esats__lexing_next_token_ncmnt (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), lexbuf)) ;
tmp56 = ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_cap (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), tbuf)) ;
tmp58 = atspre_gt_size1_size1 (tmp56, tmp50) ;
if (tmp58) {
/* tmp57 = */ deque_insert_end_02079_ats_ptr_type (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), tbuf), tmp55) ;
} else {
tmp71 = atspre_add_size1_size1 (tmp56, tmp56) ;
tmp72 = array_ptr_alloc_01563_ats_ptr_type (tmp71) ;
tmp73 = ats_selsin_mac(tmp72, atslab_2) ;
tmp74 = deque_update_capacity_02091_ats_ptr_type (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), tbuf), tmp71, tmp73) ;
tmp76 = ats_selsin_mac(tmp74, atslab_2) ;
/* tmp77 = */ atspre_array_ptr_free (tmp76) ;
/* tmp57 = */ deque_insert_end_02079_ats_ptr_type (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), tbuf), tmp55) ;
} /* end of [if] */
tmp48 = tmp55 ;
} /* end of [if] */
return (tmp48) ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_get_token] */

/*
// /tmp/ATS-Postiats/src/pats_tokbuf.dats: 6167(line=316, offs=3) -- 6268(line=320, offs=2)
*/
ATSglobaldec()
ats_ptr_type
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_getinc_token (ats_ref_type arg0) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp78) ;
ATSlocal (ats_ptr_type, tmp79) ;
ATSlocal (ats_uint_type, tmp80) ;
ATSlocal (ats_uint_type, tmp81) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_getinc_token:
tmp79 = _2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_get_token (arg0) ;
tmp81 = ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), ntok) ;
tmp80 = atspre_add_uint_uint (tmp81, 1u) ;
ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), ntok) = tmp80 ;
tmp78 = tmp79 ;
return (tmp78) ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_getinc_token] */

/*
// /tmp/ATS-Postiats/src/pats_tokbuf.dats: 6357(line=326, offs=3) -- 6548(line=333, offs=4)
*/
ATSglobaldec()
ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_discard_all (ats_ref_type arg0) {
/* local vardec */
// ATSlocal_void (tmp82) ;
ATSlocal (ats_ptr_type, tmp83) ;
ATSlocal (ats_ptr_type, tmp85) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_discard_all:
/* loop initialization */
/* empty */
ats_loop_beg_mac(__ats_lab_0)
/* empty */
if (!ats_true_bool) break ;
tmp83 = _2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_getinc_token (arg0) ;
tmp85 = ats_selbox_mac(ats_castptr_mac(anairiats_rec_1, tmp83), atslab_token_node) ;
do {
/* branch: __ats_lab_2 */
__ats_lab_2_0:
if (((ats_sum_ptr_type)tmp85)->tag != 178) { goto __ats_lab_3_0 ; }
__ats_lab_2_1:
goto __ats_lab_1 ;
break ;

/* branch: __ats_lab_3 */
__ats_lab_3_0:
__ats_lab_3_1:
goto __ats_lab_0 ;
break ;
} while (0) ;
ats_loop_end_mac(__ats_lab_0, __ats_lab_1)
return /* (tmp82) */ ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_discard_all] */

/*
// /nix/store/rfja8ixrs5wb4kj3kiwlch1apnh7qgvy-ats-0.2.12/lib/ats-anairiats-0.2.12/libats/ngc/DATS/deque_arr.dats: 3559(line=132, offs=29) -- 3846(line=142, offs=4)
*/
ATSstaticdec()
ats_ptr_type
DEQUEptrprv_02096_ats_ptr_type (ats_ref_type arg0, ats_ptr_type arg1) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp93) ;
ATSlocal (ats_ptr_type, tmp94) ;
ATSlocal (ats_bool_type, tmp96) ;
ATSlocal (ats_ptr_type, tmp97) ;
ATSlocal (ats_ptr_type, tmp98) ;
ATSlocal (ats_ptr_type, tmp99) ;

__ats_lab_DEQUEptrprv_02096_ats_ptr_type:
/* ats_ptr_type tmp94 ; */
tmp94 = arg1 ;
tmp97 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), qarr_lft) ;
tmp96 = atspre_plte (tmp94, tmp97) ;
if (tmp96) {
tmp98 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), qarr_rgt) ;
tmp94 = tmp98 ;
} else {
/* empty */
} /* end of [if] */
/* ats_ptr_type tmp99 ; */
tmp99 = atspre_psub_size (tmp94, sizeof(ats_ptr_type)) ;
tmp93 = tmp99 ;
return (tmp93) ;
} /* end of [DEQUEptrprv_02096_ats_ptr_type] */

/*
// /nix/store/rfja8ixrs5wb4kj3kiwlch1apnh7qgvy-ats-0.2.12/lib/ats-anairiats-0.2.12/libats/ngc/DATS/deque_arr.dats: 8011(line=317, offs=18) -- 8338(line=328, offs=2)
*/
ATSstaticdec()
ats_void_type
deque_insert_beg_02078_ats_ptr_type (ats_ref_type arg0, ats_ptr_type arg1) {
/* local vardec */
// ATSlocal_void (tmp90) ;
ATSlocal (ats_ptr_type, tmp91) ;
ATSlocal (ats_ptr_type, tmp92) ;
ATSlocal (ats_ptr_type, tmp100) ;
ATSlocal (ats_size_type, tmp101) ;
ATSlocal (ats_size_type, tmp102) ;

__ats_lab_deque_insert_beg_02078_ats_ptr_type:
tmp91 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), qarr_beg) ;
tmp92 = DEQUEptrprv_02096_ats_ptr_type (arg0, tmp91) ;
tmp100 = ats_selsin_mac(tmp92, atslab_1) ;
ats_ptrget_mac(ats_ptr_type, tmp100) = arg1 ;
tmp102 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), nitm) ;
tmp101 = atspre_add_size1_int1 (tmp102, 1) ;
ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), nitm) = tmp101 ;
ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), qarr_beg) = tmp100 ;
return /* (tmp90) */ ;
} /* end of [deque_insert_beg_02078_ats_ptr_type] */

/*
// /tmp/ATS-Postiats/src/pats_tokbuf.dats: 6633(line=339, offs=3) -- 7219(line=366, offs=4)
*/
ATSglobaldec()
ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_unget_token (ats_ref_type arg0, ats_ptr_type arg1) {
/* local vardec */
// ATSlocal_void (tmp86) ;
ATSlocal (ats_size_type, tmp87) ;
ATSlocal (ats_size_type, tmp88) ;
ATSlocal (ats_bool_type, tmp89) ;
ATSlocal (ats_size_type, tmp103) ;
ATSlocal (ats_ptr_type, tmp104) ;
ATSlocal (ats_ptr_type, tmp105) ;
ATSlocal (ats_ptr_type, tmp106) ;
ATSlocal (ats_ptr_type, tmp107) ;
// ATSlocal_void (tmp108) ;

__ats_lab__2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_unget_token:
tmp87 = ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_size (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), tbuf)) ;
tmp88 = ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_cap (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), tbuf)) ;
tmp89 = atspre_gt_size1_size1 (tmp88, tmp87) ;
if (tmp89) {
/* tmp86 = */ deque_insert_beg_02078_ats_ptr_type (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), tbuf), arg1) ;
} else {
tmp103 = atspre_add_size1_size1 (tmp88, tmp88) ;
tmp104 = array_ptr_alloc_01563_ats_ptr_type (tmp103) ;
tmp105 = ats_selsin_mac(tmp104, atslab_2) ;
tmp106 = deque_update_capacity_02091_ats_ptr_type (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), tbuf), tmp103, tmp105) ;
tmp107 = ats_selsin_mac(tmp106, atslab_2) ;
/* tmp108 = */ atspre_array_ptr_free (tmp107) ;
/* tmp86 = */ deque_insert_beg_02078_ats_ptr_type (&ats_select_mac(ats_ptrget_mac(pats_tokbuf_struct, arg0), tbuf), arg1) ;
} /* end of [if] */
return /* (tmp86) */ ;
} /* end of [_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__tokbuf_unget_token] */

/* 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_lexbuf_2esats__staload (void) ;
// extern ats_void_type ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__staload (void) ;
extern ats_void_type ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__staload (void) ;
extern ats_void_type _2tmp_2ATS_2dPostiats_2src_2pats_lexing_2esats__staload (void) ;
extern ats_void_type _2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__staload (void) ;

ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2edats__staload () {
static int _2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2edats__staload_flag = 0 ;
if (_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2edats__staload_flag) return ;
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2edats__staload_flag = 1 ;

// _2tmp_2ATS_2dPostiats_2src_2pats_atspre_2edats__staload () ;
_2tmp_2ATS_2dPostiats_2src_2pats_lexbuf_2esats__staload () ;
// ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__staload () ;
ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__staload () ;
_2tmp_2ATS_2dPostiats_2src_2pats_lexing_2esats__staload () ;
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2esats__staload () ;

return ;
} /* staload function */

/* dynamic load function */

// dynload flag declaration
extern ats_int_type _2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2edats__dynload_flag ;

ats_void_type
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2edats__dynload () {
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2edats__dynload_flag = 1 ;
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_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 () ;
ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__lemma_deque_param_prfck () ;
ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__DEQUEarr_v_encode_prfck () ;
ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__DEQUEarr_v_decode_prfck () ;
ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__DEQUEarr_v_clear_prfck () ;
ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__DEQUEarr_insert_beg_prfck () ;
ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__DEQUEarr_insert_end_prfck () ;
ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__DEQUEarr_remove_beg_prfck () ;
ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__DEQUEarr_remove_end_prfck () ;
ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats____assert_prfck () ;
ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats____assert_prfck () ;
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2edats__tokbuf0_trans_prfck () ;
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2edats__tokbuf0_trans_prfck () ;
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2edats__tokbuf0_trans_prfck () ;
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2edats__tokbuf0_trans_prfck () ;
_2tmp_2ATS_2dPostiats_2src_2pats_tokbuf_2edats__tokbuf0_untrans_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_tokbuf_dats.c] */
