/* Compiler: ECL 26.3.27                                                      */
/* Source: /build/ecl/src/ecl-26.3.27/src/cmp/cmpenv-var.lsp                  */
#include <ecl/ecl-cmp.h>
#include "cmp/cmpenv-var.eclh"
/* function definition for DECLARE-SPECIAL                                    */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L3254declare_special(cl_narg narg, cl_object v1name, ...)
{
 cl_object T0;
 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);
 if (ecl_unlikely(narg<1)) FEwrong_num_arguments(VV[1]);
 if (ecl_unlikely(narg>2)) FEwrong_num_arguments(VV[1]);
 {
  cl_object v2env;
  va_list args; va_start(args,v1name);
  {
   int i = 1;
   if (i >= narg) {
    v2env = ecl_cmp_symbol_value(cl_env_copy,VV[0]);
   } else {
    i++;
    v2env = va_arg(args,cl_object);
   }
  }
  va_end(args);
  if (Null((cl_env_copy->function=ecl_fdefinition(VV[2]))->cfun.entry(2, v1name, v2env) /*  CMP-ENV-SEARCH-SYMBOL-MACRO */)){
   goto L2;
  }
  (cl_env_copy->function=ecl_fdefinition(VV[3]))->cfun.entry(2, VV[4], v1name) /*  CMPERR */;
L2:;
  T0 = (cl_env_copy->function=ecl_fdefinition(VV[6]))->cfun.entry(5, v1name, VV[7], ECL_NIL, VV[8], ECL_SYM("SPECIAL",792)) /*  MAKE-GLOBAL-VAR */;
  value0 = (cl_env_copy->function=ecl_fdefinition(VV[5]))->cfun.entry(3, T0, v2env, ECL_NIL) /*  CMP-ENV-REGISTER-VAR */;
  return value0;
 }
}
/* function definition for CHECK-GLOBAL                                       */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L3255check_global(cl_object v1name)
{
 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;
  cl_object v3;
  cl_object v4;
  v2 = ecl_cmp_symbol_value(cl_env_copy,VV[11]);
  v3 = v1name;
  v4 = v2;
  value0 = ecl_memql(v3,v4);
  cl_env_copy->nvalues = 1;
  return value0;
 }
}
static cl_object L3255check_global_va(cl_narg narg, cl_object v5name, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[10]);
 {
  return L3255check_global(v5name);
 }
}
/* function definition for REGISTER-GLOBAL                                    */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L3256si__register_global(cl_object v1name)
{
 cl_object T0;
 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:;
 T0 = cl_adjoin(2, v1name, ecl_cmp_symbol_value(cl_env_copy,VV[11]));
 ecl_cmp_setq(cl_env_copy,VV[11],T0);
 value0 = ECL_NIL;
 cl_env_copy->nvalues = 0;
 return value0;
}
static cl_object L3256si__register_global_va(cl_narg narg, cl_object v2name, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[13]);
 {
  return L3256si__register_global(v2name);
 }
}
/* function definition for SPECIAL-VARIABLE-P                                 */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L3257special_variable_p(cl_object v1name)
{
 cl_object T0;
 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:;
 value0 = si_specialp(v1name);
 if (value0!=ECL_NIL) {
  goto L3;
 }
 value0 = L3255check_global(v1name);
 if (value0!=ECL_NIL) {
  goto L3;
 }
 {
  cl_object v2v;
  v2v = (cl_env_copy->function=ecl_fdefinition(VV[16]))->cfun.entry(2, v1name, ecl_cmp_symbol_value(cl_env_copy,VV[17])) /*  CMP-ENV-SEARCH-VAR */;
  if (Null(v2v)){
   goto L8;
  }
  T0 = (cl_env_copy->function=ecl_fdefinition(VV[18]))->cfun.entry(1, v2v) /*  VAR-KIND */;
  value0 = ecl_make_bool((T0)==(ECL_SYM("SPECIAL",792)));
  cl_env_copy->nvalues = 1;
  return value0;
L8:;
  value0 = ECL_NIL;
  cl_env_copy->nvalues = 1;
  return value0;
 }
L3:;
 cl_env_copy->nvalues = 1;
 return value0;
}
static cl_object L3257special_variable_p_va(cl_narg narg, cl_object v3name, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[15]);
 {
  return L3257special_variable_p(v3name);
 }
}
/* function definition for CONSTANT-VARIABLE-P                                */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L3258constant_variable_p(cl_object v1name)
{
 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:;
 value0 = si_constp(v1name);
 return value0;
}
static cl_object L3258constant_variable_p_va(cl_narg narg, cl_object v2name, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[20]);
 {
  return L3258constant_variable_p(v2name);
 }
}
/* function definition for LOCAL-VARIABLE-P                                   */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L3259local_variable_p(cl_narg narg, cl_object v1name, ...)
{
 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);
 if (ecl_unlikely(narg<1)) FEwrong_num_arguments(VV[22]);
 if (ecl_unlikely(narg>2)) FEwrong_num_arguments(VV[22]);
 {
  cl_object v2env;
  va_list args; va_start(args,v1name);
  {
   int i = 1;
   if (i >= narg) {
    v2env = ecl_cmp_symbol_value(cl_env_copy,VV[0]);
   } else {
    i++;
    v2env = va_arg(args,cl_object);
   }
  }
  va_end(args);
  {
   cl_object v3record;
   v3record = (cl_env_copy->function=ecl_fdefinition(VV[16]))->cfun.entry(2, v1name, v2env) /*  CMP-ENV-SEARCH-VAR */;
   if (Null(v3record)){
    goto L4;
   }
   value0 = (cl_env_copy->function=ecl_fdefinition(VV[23]))->cfun.entry(1, v3record) /*  VAR-P */;
   return value0;
L4:;
   value0 = ECL_NIL;
   cl_env_copy->nvalues = 1;
   return value0;
  }
 }
}
/* function definition for SYMBOL-MACRO-P                                     */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L3260symbol_macro_p(cl_narg narg, cl_object v1name, ...)
{
 cl_object T0;
 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);
 if (ecl_unlikely(narg<1)) FEwrong_num_arguments(VV[25]);
 if (ecl_unlikely(narg>2)) FEwrong_num_arguments(VV[25]);
 {
  cl_object v2env;
  va_list args; va_start(args,v1name);
  {
   int i = 1;
   if (i >= narg) {
    v2env = ecl_cmp_symbol_value(cl_env_copy,VV[0]);
   } else {
    i++;
    v2env = va_arg(args,cl_object);
   }
  }
  va_end(args);
  {
   cl_object v3record;
   v3record = (cl_env_copy->function=ecl_fdefinition(VV[16]))->cfun.entry(2, v1name, v2env) /*  CMP-ENV-SEARCH-VAR */;
   if (Null(v3record)){
    goto L4;
   }
   T0 = (cl_env_copy->function=ecl_fdefinition(VV[23]))->cfun.entry(1, v3record) /*  VAR-P */;
   value0 = Null(T0)?ECL_T:ECL_NIL;
   cl_env_copy->nvalues = 1;
   return value0;
L4:;
   value0 = ECL_NIL;
   cl_env_copy->nvalues = 1;
   return value0;
  }
 }
}
/* function definition for READ-ONLY-VARIABLE-P                               */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L3261read_only_variable_p(cl_object v1name, cl_object v2other_decls)
{
 cl_object T0;
 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 = v2other_decls;
  goto L5;
L4:;
  {
   cl_object v4i;
   v4i = ecl_car(v3);
   T0 = ecl_car(v4i);
   if (!((T0)==(VV[28]))){
    goto L9;
   }
   {
    cl_object v5;
    cl_object v6;
    cl_object v7;
    v5 = ecl_cdr(v4i);
    v6 = v1name;
    v7 = v5;
    if (Null(ecl_memql(v6,v7))){
     goto L9;
    }
   }
   value0 = ECL_T;
   cl_env_copy->nvalues = 1;
   return value0;
L9:;
  }
  v3 = ecl_cdr(v3);
L5:;
  if (Null(v3)){
   goto L17;
  }
  goto L4;
L17:;
  value0 = ECL_NIL;
  cl_env_copy->nvalues = 1;
  return value0;
 }
}
static cl_object L3261read_only_variable_p_va(cl_narg narg, cl_object v4name, cl_object v5other_decls, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[27]);
 {
  return L3261read_only_variable_p(v4name, v5other_decls);
 }
}
/* function definition for VARIABLE-TYPE-IN-ENV                               */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L3262variable_type_in_env(cl_narg narg, cl_object v1name, ...)
{
 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);
 if (ecl_unlikely(narg<1)) FEwrong_num_arguments(VV[30]);
 if (ecl_unlikely(narg>2)) FEwrong_num_arguments(VV[30]);
 {
  cl_object v2env;
  va_list args; va_start(args,v1name);
  {
   int i = 1;
   if (i >= narg) {
    v2env = ecl_cmp_symbol_value(cl_env_copy,VV[0]);
   } else {
    i++;
    v2env = va_arg(args,cl_object);
   }
  }
  va_end(args);
  {
   cl_object v3var;
   v3var = (cl_env_copy->function=ecl_fdefinition(VV[16]))->cfun.entry(2, v1name, v2env) /*  CMP-ENV-SEARCH-VAR */;
   if (Null((cl_env_copy->function=ecl_fdefinition(VV[23]))->cfun.entry(1, v3var) /*  VAR-P */)){
    goto L3;
   }
   value0 = (cl_env_copy->function=ecl_fdefinition(VV[31]))->cfun.entry(1, v3var) /*  VAR-TYPE */;
   return value0;
L3:;
   {
    cl_object v4;
    v4 = si_get_sysprop(v1name, VV[32]);
    if (Null(v4)){
     goto L6;
    }
    value0 = v4;
    cl_env_copy->nvalues = 1;
    return value0;
L6:;
    value0 = ECL_T;
    cl_env_copy->nvalues = 1;
    return value0;
   }
  }
 }
}
#include "cmp/cmpenv-var.data"
#ifdef __cplusplus
extern "C"
#endif

ECL_DLLEXPORT void _ecl2kkk1ZBlDoYj9_osP0M881(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-VAR.LSP.NEWEST",-1);
 return;}
 #ifdef ECL_DYNAMIC_VV
 VV = Cblock->cblock.data;
 #endif
 Cblock->cblock.data_text = (const cl_object *)"@EcLtAg:_ecl2kkk1ZBlDoYj9_osP0M881@";
 VVtemp = Cblock->cblock.temp_data;
 ECL_DEFINE_SETF_FUNCTIONS
/* MAKE-LOAD-FORMs                                                            */
/* TOP-LEVEL-FORMs                                                            */
  si_select_package(_ecl_static_0);
  ecl_cmp_defun(VV[34]);                          /*  DECLARE-SPECIAL         */
  ecl_cmp_defun(VV[35]);                          /*  CHECK-GLOBAL            */
  ecl_cmp_defun(VV[36]);                          /*  REGISTER-GLOBAL         */
  ecl_cmp_defun(VV[37]);                          /*  SPECIAL-VARIABLE-P      */
  ecl_cmp_defun(VV[38]);                          /*  CONSTANT-VARIABLE-P     */
  ecl_cmp_defun(VV[39]);                          /*  LOCAL-VARIABLE-P        */
  ecl_cmp_defun(VV[40]);                          /*  SYMBOL-MACRO-P          */
  ecl_cmp_defun(VV[41]);                          /*  READ-ONLY-VARIABLE-P    */
  ecl_cmp_defun(VV[42]);                          /*  VARIABLE-TYPE-IN-ENV    */
}
