/* Compiler: ECL 26.3.27                                                      */
/* Source: /build/ecl/src/ecl-26.3.27/src/cmp/cmpenv-declaim.lsp              */
#include <ecl/ecl-cmp.h>
#include "cmp/cmpenv-declaim.eclh"
/* function definition for PROCESS-DECLAIM-ARGS                               */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L3327process_declaim_args(cl_object v1args)
{
 cl_object T0, T1;
 cl_object env0 = ECL_NIL;
 const cl_env_ptr cl_env_copy = ecl_process_env();
 cl_object value0;
 ecl_cs_check(cl_env_copy,value0);
L1:;
 {
  cl_object v2;                                   /*  SPECIALS                */
  cl_object v3;                                   /*  TYPES                   */
  cl_object v4;                                   /*  IGNORED                 */
  cl_object v5;                                   /*  OTHERS                  */
  T0 = CONS(ECL_SYM("DECLARE",276),v1args);
  T1 = ecl_list1(T0);
  value0 = (cl_env_copy->function=ecl_fdefinition(VV[8]))->cfun.entry(2, T1, ECL_NIL) /*  C1BODY */;
  {
   const int v6 = cl_env_copy->nvalues;
   cl_object v7;
   v7 = (v6<=1)? ECL_NIL : cl_env_copy->values[1];
   v2 = v7;
   v7 = (v6<=2)? ECL_NIL : cl_env_copy->values[2];
   v3 = v7;
   v7 = (v6<=3)? ECL_NIL : cl_env_copy->values[3];
   v4 = v7;
   v7 = (v6<=4)? ECL_NIL : cl_env_copy->values[4];
   v5 = v7;
  }
  if (Null(v4)){
   goto L3;
  }
  (cl_env_copy->function=ecl_fdefinition(VV[9]))->cfun.entry(1, VV[10]) /*  CMPWARN-STYLE */;
L3:;
  T0 = ecl_fdefinition(VV[11]);
  T1 = LC3326add_variables(ecl_cmp_symbol_value(cl_env_copy,VV[13]), v3, v2);
  cl_reduce(4, T0, v5, VV[12], T1);
  T0 = ecl_fdefinition(VV[11]);
  T1 = LC3326add_variables(ecl_cmp_symbol_value(cl_env_copy,VV[14]), v3, v2);
  value0 = cl_reduce(4, T0, v5, VV[12], T1);
  return value0;
 }
}
static cl_object L3327process_declaim_args_va(cl_narg narg, cl_object v2args, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[0]);
 {
  return L3327process_declaim_args(v2args);
 }
}
/* local function DECLAIM                                                     */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC3328declaim(cl_object v1, cl_object v2)
{
 cl_object T0, T1, T2, T3, T4, T5, T6, T7, T8, T9;
 cl_object env0 = ECL_NIL;
 const cl_env_ptr cl_env_copy = ecl_process_env();
 cl_object value0;
 ecl_cs_check(cl_env_copy,value0);
L1:;
 {
  cl_object v3;
  v3 = ecl_cdr(v1);
  T0 = cl_list(2, ECL_SYM("QUOTE",682), v3);
  T1 = cl_list(2, VV[0], T0);
  T2 = cl_list(3, ECL_SYM("EVAL-WHEN",342), VV[17], T1);
  T3 = cl_list(2, ECL_SYM("QUOTE",682), v3);
  T4 = cl_list(3, ECL_SYM("MAPC",545), VV[18], T3);
  T5 = cl_list(3, ECL_SYM("EVAL-WHEN",342), VV[17], T4);
  T6 = cl_list(5, ECL_SYM("WITH-BACKEND",1874), ECL_SYM("C/C++",1876), T2, ECL_SYM("BYTECODES",1875), T5);
  T7 = cl_list(2, ECL_SYM("QUOTE",682), v3);
  T8 = cl_list(3, ECL_SYM("MAPC",545), VV[18], T7);
  T9 = cl_list(3, ECL_SYM("EVAL-WHEN",342), VV[19], T8);
  value0 = cl_list(4, ECL_SYM("LOCALLY",492), VV[16], T6, T9);
  return value0;
 }
}
static cl_object LC3328declaim_va(cl_narg narg, cl_object v4, cl_object v5, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[20]);
 {
  return LC3328declaim(v4, v5);
 }
}
/* local function C-DECLAIM                                                   */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC3329ext__c_declaim(cl_object v1, cl_object v2)
{
 cl_object T0, T1, T2;
 cl_object env0 = ECL_NIL;
 const cl_env_ptr cl_env_copy = ecl_process_env();
 cl_object value0;
 ecl_cs_check(cl_env_copy,value0);
L1:;
 {
  cl_object v3;
  v3 = ecl_cdr(v1);
  T0 = cl_list(2, ECL_SYM("QUOTE",682), v3);
  T1 = cl_list(2, VV[0], T0);
  T2 = cl_list(3, ECL_SYM("EVAL-WHEN",342), VV[17], T1);
  value0 = cl_list(3, ECL_SYM("WITH-BACKEND",1874), ECL_SYM("C/C++",1876), T2);
  return value0;
 }
}
static cl_object LC3329ext__c_declaim_va(cl_narg narg, cl_object v4, cl_object v5, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[21]);
 {
  return LC3329ext__c_declaim(v4, v5);
 }
}
/* local function ADD-VARIABLES                                               */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC3326add_variables(cl_object v1env, cl_object v2types, cl_object v3specials)
{
 cl_object env0 = ECL_NIL;
 const cl_env_ptr cl_env_copy = ecl_process_env();
 cl_object value0;
 ecl_cs_check(cl_env_copy,value0);
L1:;
 {
  cl_object v4;
  cl_object v5name;
  cl_object v6;
  {
   cl_object v7;
   v7 = v3specials;
   if (ecl_unlikely(!ECL_LISTP(v7))) FEtype_error_list(v7);
   value0 = ECL_NIL;
   cl_env_copy->nvalues = 0;
   v4 = v7;
  }
  v5name = ECL_NIL;
  v6 = v4;
L8:;
  if (!(ecl_endp(v6))){
   goto L10;
  }
  goto L9;
L10:;
  v5name = ECL_CONS_CAR(v6);
  {
   cl_object v7;
   v7 = ECL_CONS_CDR(v6);
   if (ecl_unlikely(!ECL_LISTP(v7))) FEtype_error_list(v7);
   value0 = ECL_NIL;
   cl_env_copy->nvalues = 0;
   v6 = v7;
  }
  {
   cl_object v7;
   cl_object v8;
   v7 = v5name;
   v8 = v2types;
   if (ecl_assql(v7,v8)!=ECL_NIL) {
    goto L18;
   }
  }
  {
   cl_object v7v;
   v7v = (cl_env_copy->function=ecl_fdefinition(VV[4]))->cfun.entry(3, v5name, VV[5], ECL_SYM("SPECIAL",792)) /*  MAKE-GLOBAL-VAR */;
   v1env = (cl_env_copy->function=ecl_fdefinition(VV[6]))->cfun.entry(3, v7v, v1env, ECL_NIL) /*  CMP-ENV-REGISTER-VAR */;
  }
L18:;
  goto L8;
L9:;
 }
 {
  cl_object v4;
  cl_object v5name;
  cl_object v6type;
  cl_object v7;
  {
   cl_object v8;
   v8 = v2types;
   if (ecl_unlikely(!ECL_LISTP(v8))) FEtype_error_list(v8);
   value0 = ECL_NIL;
   cl_env_copy->nvalues = 0;
   v4 = v8;
  }
  v5name = ECL_NIL;
  v6type = ECL_NIL;
  v7 = v4;
  {
   cl_object v8specialp;
   v8specialp = ECL_NIL;
   {
    cl_object v9kind;
    v9kind = ECL_NIL;
    {
     cl_object v10v;
     v10v = ECL_NIL;
L35:;
     if (!(ecl_endp(v7))){
      goto L37;
     }
     goto L36;
L37:;
     {
      cl_object v11;
      v11 = ECL_CONS_CAR(v7);
      v5name = ecl_car(v11);
      v11 = ecl_cdr(v11);
      v6type = v11;
     }
     {
      cl_object v11;
      v11 = ECL_CONS_CDR(v7);
      if (ecl_unlikely(!ECL_LISTP(v11))) FEtype_error_list(v11);
      value0 = ECL_NIL;
      cl_env_copy->nvalues = 0;
      v7 = v11;
     }
     value0 = si_specialp(v5name);
     if (value0!=ECL_NIL) {
      goto L53;
     }
     {
      cl_object v11;
      cl_object v12;
      v11 = v5name;
      v12 = v3specials;
      v8specialp = ecl_memql(v11,v12);
      goto L51;
     }
L53:;
     v8specialp = value0;
     goto L51;
L51:;
     if (Null(v8specialp)){
      goto L59;
     }
     v9kind = ECL_SYM("SPECIAL",792);
     goto L58;
L59:;
     v9kind = VV[7];
L58:;
     v10v = (cl_env_copy->function=ecl_fdefinition(VV[4]))->cfun.entry(5, v5name, ECL_SYM("TYPE",1356), v6type, VV[5], v9kind) /*  MAKE-GLOBAL-VAR */;
     v1env = (cl_env_copy->function=ecl_fdefinition(VV[6]))->cfun.entry(3, v10v, v1env, ECL_NIL) /*  CMP-ENV-REGISTER-VAR */;
     goto L35;
L36:;
    }
   }
  }
 }
 value0 = v1env;
 cl_env_copy->nvalues = 1;
 return value0;
}
static cl_object LC3326add_variables_va(cl_narg narg, cl_object v4env, cl_object v5types, cl_object v6specials, ...)
{
 if (ecl_unlikely(narg!=3)) FEwrong_num_arguments(VV[1]);
 {
  return LC3326add_variables(v4env, v5types, v6specials);
 }
}
#include "cmp/cmpenv-declaim.data"
#ifdef __cplusplus
extern "C"
#endif

ECL_DLLEXPORT void _eclrVc1hzg3m0Ul9_r0R0M881(cl_object flag)
{
 const cl_env_ptr cl_env_copy = ecl_process_env();
 cl_object value0;
 cl_object *VVtemp;
 if (flag != OBJNULL){
 Cblock = flag;
 #ifndef ECL_DYNAMIC_VV
 flag->cblock.data = VV;
 #endif
 flag->cblock.data_size = VM;
 flag->cblock.temp_data_size = VMtemp;
 flag->cblock.data_text = compiler_data_text;
 flag->cblock.cfuns_size = compiler_cfuns_size;
 flag->cblock.cfuns = compiler_cfuns;
 flag->cblock.source = ecl_make_constant_base_string("SRC:CMP;CMPENV-DECLAIM.LSP.NEWEST",-1);
 return;}
 #ifdef ECL_DYNAMIC_VV
 VV = Cblock->cblock.data;
 #endif
 Cblock->cblock.data_text = (const cl_object *)"@EcLtAg:_eclrVc1hzg3m0Ul9_r0R0M881@";
 VVtemp = Cblock->cblock.temp_data;
 ECL_DEFINE_SETF_FUNCTIONS
/* MAKE-LOAD-FORMs                                                            */
/* TOP-LEVEL-FORMs                                                            */
  si_select_package(VVtemp[0]);
  ecl_cmp_defun(VV[23]);                          /*  PROCESS-DECLAIM-ARGS    */
  ecl_cmp_defmacro(VV[24]);                       /*  DECLAIM                 */
  ecl_cmp_defmacro(VV[25]);                       /*  C-DECLAIM               */
}
