/*
**
** The C code is generated by ATS/Anairiats
** The compilation time is: 2019-12-18:  5h:30m
**
*/

/* 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/integer.cats"
#include "prelude/CATS/sizetype.cats"
#include "prelude/CATS/integer_ptr.cats"
#include "prelude/CATS/integer_fixed.cats"
#include "prelude/CATS/pointer.cats"
#include "prelude/CATS/bool.cats"
#include "prelude/CATS/char.cats"
#include "prelude/CATS/byte.cats"
#include "prelude/CATS/float.cats"
#include "prelude/CATS/string.cats"
#include "prelude/CATS/reference.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 "libats/ngc/CATS/deque_arr.cats"
/* external codes at top */
/* type definitions */
/* external typedefs */
/* external dynamic constructor declarations */
/* external dynamic constant declarations */
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_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_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_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_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, 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) ;

/* external dynamic terminating constant declarations */
#ifdef _ATS_PROOFCHECK
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 () ;
#endif /* _ATS_PROOFCHECK */

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

/* sum constructor declarations */
/* exn constructor declarations */
/* global dynamic (non-functional) constant declarations */
/* internal function declarations */

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

/* function implementations */

/*
// /home/ats-lang-anairiats-0.2.12/libats/ngc/DATS/deque_arr.dats: 4831(line=185, offs=21) -- 4842(line=185, offs=32)
*/
ATSglobaldec()
ats_size_type
ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_cap (ats_ref_type arg0) {
/* local vardec */
ATSlocal (ats_size_type, tmp0) ;

__ats_lab_ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_cap:
tmp0 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), cap) ;
return (tmp0) ;
} /* end of [ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_cap] */

/*
// /home/ats-lang-anairiats-0.2.12/libats/ngc/DATS/deque_arr.dats: 4864(line=186, offs=22) -- 4876(line=186, offs=34)
*/
ATSglobaldec()
ats_size_type
ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_size (ats_ref_type arg0) {
/* local vardec */
ATSlocal (ats_size_type, tmp1) ;

__ats_lab_ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_size:
tmp1 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), nitm) ;
return (tmp1) ;
} /* end of [ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_size] */

/*
// /home/ats-lang-anairiats-0.2.12/libats/ngc/DATS/deque_arr.dats: 4903(line=189, offs=16) -- 4967(line=191, offs=4)
*/
ATSglobaldec()
ats_bool_type
ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_is_empty (ats_ref_type arg0) {
/* local vardec */
ATSlocal (ats_bool_type, tmp2) ;
ATSlocal (ats_size_type, tmp3) ;

__ats_lab_ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_is_empty:
tmp3 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), nitm) ;
tmp2 = atspre_eq_size1_int1 (tmp3, 0) ;
return (tmp2) ;
} /* end of [ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_is_empty] */

/*
// /home/ats-lang-anairiats-0.2.12/libats/ngc/DATS/deque_arr.dats: 5024(line=194, offs=19) -- 5088(line=196, offs=4)
*/
ATSglobaldec()
ats_bool_type
ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_isnot_empty (ats_ref_type arg0) {
/* local vardec */
ATSlocal (ats_bool_type, tmp4) ;
ATSlocal (ats_size_type, tmp5) ;

__ats_lab_ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_isnot_empty:
tmp5 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), nitm) ;
tmp4 = atspre_gt_size1_int1 (tmp5, 0) ;
return (tmp4) ;
} /* end of [ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_isnot_empty] */

/*
// /home/ats-lang-anairiats-0.2.12/libats/ngc/DATS/deque_arr.dats: 5144(line=199, offs=15) -- 5212(line=201, offs=4)
*/
ATSglobaldec()
ats_bool_type
ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_is_full (ats_ref_type arg0) {
/* local vardec */
ATSlocal (ats_bool_type, tmp6) ;
ATSlocal (ats_size_type, tmp7) ;
ATSlocal (ats_size_type, tmp8) ;

__ats_lab_ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_is_full:
tmp7 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), cap) ;
tmp8 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), nitm) ;
tmp6 = atspre_eq_size1_size1 (tmp7, tmp8) ;
return (tmp6) ;
} /* end of [ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_is_full] */

/*
// /home/ats-lang-anairiats-0.2.12/libats/ngc/DATS/deque_arr.dats: 5267(line=204, offs=18) -- 5335(line=206, offs=4)
*/
ATSglobaldec()
ats_bool_type
ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_isnot_full (ats_ref_type arg0) {
/* local vardec */
ATSlocal (ats_bool_type, tmp9) ;
ATSlocal (ats_size_type, tmp10) ;
ATSlocal (ats_size_type, tmp11) ;

__ats_lab_ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_isnot_full:
tmp10 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), cap) ;
tmp11 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), nitm) ;
tmp9 = atspre_gt_size1_size1 (tmp10, tmp11) ;
return (tmp9) ;
} /* end of [ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_isnot_full] */

/*
// /home/ats-lang-anairiats-0.2.12/libats/ngc/DATS/deque_arr.dats: 5706(line=224, offs=11) -- 6239(line=240, offs=2)
*/
ATSglobaldec()
ats_void_type
atslib_ngc_deque_arr_deque_initialize_tsz (ats_ref_type arg0, ats_size_type arg1, ats_ptr_type arg2, ats_size_type arg3) {
/* local vardec */
// ATSlocal_void (tmp12) ;
ATSlocal (ats_size_type, tmp13) ;
ATSlocal (ats_size_type, tmp14) ;
ATSlocal (ats_size_type, tmp15) ;
ATSlocal (ats_ptr_type, tmp16) ;

__ats_lab_atslib_ngc_deque_arr_deque_initialize_tsz:
ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), cap) = arg1 ;
tmp13 = atspre_size1_of_int1 (0) ;
ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), nitm) = tmp13 ;
tmp14 = atspre_mul2_size1_size1 (arg1, arg3) ;
tmp15 = ats_selsin_mac(tmp14, atslab_1) ;
ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), qarr_lft) = arg2 ;
tmp16 = atspre_padd_size (arg2, tmp15) ;
ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), qarr_rgt) = tmp16 ;
ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), qarr_beg) = arg2 ;
ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), qarr_end) = arg2 ;
return /* (tmp12) */ ;
} /* end of [atslib_ngc_deque_arr_deque_initialize_tsz] */

/*
// /home/ats-lang-anairiats-0.2.12/libats/ngc/DATS/deque_arr.dats: 6446(line=250, offs=13) -- 6785(line=263, offs=4)
*/
ATSglobaldec()
ats_ptr_type
atslib_ngc_deque_arr_deque_uninitialize (ats_ref_type arg0) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp17) ;

__ats_lab_atslib_ngc_deque_arr_deque_uninitialize:
tmp17 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), qarr_lft) ;
return (tmp17) ;
} /* end of [atslib_ngc_deque_arr_deque_uninitialize] */

/*
// /home/ats-lang-anairiats-0.2.12/libats/ngc/DATS/deque_arr.dats: 6860(line=267, offs=11) -- 7156(line=279, offs=4)
*/
ATSglobaldec()
ats_ptr_type
ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_uninitialize_vt (ats_ref_type arg0) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp18) ;

__ats_lab_ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_uninitialize_vt:
tmp18 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), qarr_lft) ;
return (tmp18) ;
} /* end of [ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_uninitialize_vt] */

/*
// /home/ats-lang-anairiats-0.2.12/libats/ngc/DATS/deque_arr.dats: 12533(line=483, offs=13) -- 12981(line=501, offs=2)
*/
ATSglobaldec()
ats_void_type
ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_clear_all (ats_ref_type arg0) {
/* local vardec */
// ATSlocal_void (tmp19) ;
ATSlocal (ats_size_type, tmp20) ;
ATSlocal (ats_ptr_type, tmp21) ;

__ats_lab_ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_clear_all:
tmp20 = atspre_size1_of_int1 (0) ;
ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), nitm) = tmp20 ;
tmp21 = ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), qarr_lft) ;
ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), qarr_beg) = tmp21 ;
ats_select_mac(ats_ptrget_mac(atslib_ngc_deque_arr_DEQUE, arg0), qarr_end) = tmp21 ;
return /* (tmp19) */ ;
} /* end of [ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__deque_clear_all] */

/* static load function */

// extern ats_void_type ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__staload (void) ;

ats_void_type
ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__staload () {
static int ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__staload_flag = 0 ;
if (ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__staload_flag) return ;
ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__staload_flag = 1 ;

// ATS_2d0_2e2_2e12_2libats_2ngc_2SATS_2deque_arr_2esats__staload () ;

return ;
} /* staload function */

/* dynamic load function */

// dynload flag declaration
// extern ats_int_type ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__dynload_flag ;

ats_void_type
ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__dynload () {
// ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__dynload_flag = 1 ;
ATS_2d0_2e2_2e12_2libats_2ngc_2DATS_2deque_arr_2edats__staload () ;

#ifdef _ATS_PROOFCHECK
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 () ;
#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 [ngc_DATS_deque_arr_dats.c] */
