/* Compiler: ECL 26.3.27                                                      */
/* Source: /build/ecl/src/ecl-26.3.27/src/cmp/cmpstructures.lsp               */
#include <ecl/ecl-cmp.h>
#include "cmp/cmpstructures.eclh"
/* function definition for GET-SLOT-TYPE                                      */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L4086get_slot_type(cl_object v1name, cl_object v2index)
{
 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:;
 T0 = si_get_sysprop(v1name, ECL_SYM("STRUCTURE-SLOT-DESCRIPTIONS",1180));
 T1 = ecl_nth(ecl_to_size(v2index),T0);
 value0 = ecl_caddr(T1);
 if (value0!=ECL_NIL) {
  goto L3;
 }
 value0 = ECL_T;
 cl_env_copy->nvalues = 1;
 return value0;
L3:;
 cl_env_copy->nvalues = 1;
 return value0;
}
static cl_object L4086get_slot_type_va(cl_narg narg, cl_object v3name, cl_object v4index, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[0]);
 {
  return L4086get_slot_type(v3name, v4index);
 }
}
/* function definition for MAYBE-OPTIMIZE-STRUCTURE-ACCESS                    */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L4087maybe_optimize_structure_access(cl_object v1fname, cl_object v2args)
{
 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 v3slot_description;
  v3slot_description = si_get_sysprop(v1fname, VV[3]);
  if (Null(v3slot_description)){
   goto L3;
  }
  if (Null((cl_env_copy->function=ecl_fdefinition(VV[4]))->cfun.entry(1, v1fname) /*  INLINE-POSSIBLE */)){
   goto L3;
  }
  if (Null((cl_env_copy->function=ecl_fdefinition(VV[5]))->cfun.entry(0) /*  POLICY-INLINE-SLOT-ACCESS-P */)){
   goto L3;
  }
  {
   cl_object v4structure_type;
   cl_object v5slot_index;
   v4structure_type = ECL_NIL;
   v5slot_index = ECL_NIL;
   if (!(ECL_CONSP(v3slot_description))){
    goto L12;
   }
   v4structure_type = ecl_car(v3slot_description);
   v5slot_index = ecl_cdr(v3slot_description);
   if (Null(v5slot_index)){
    goto L12;
   }
   if (ECL_FIXNUMP(v5slot_index)) {
    goto L9;
   }
   goto L10;
L12:;
   goto L10;
L10:;
   (cl_env_copy->function=ecl_fdefinition(VV[6]))->cfun.entry(3, VV[7], v1fname, v5slot_index) /*  CMPWARN */;
   value0 = ECL_NIL;
   cl_env_copy->nvalues = 1;
   return value0;
L9:;
   {
    cl_fixnum v6;
    v6 = ecl_length(v2args);
    if ((v6)==((cl_fixnum)(1))) {
     goto L19;
    }
   }
   (cl_env_copy->function=ecl_fdefinition(VV[6]))->cfun.entry(2, VV[8], v1fname) /*  CMPWARN */;
   value0 = ECL_NIL;
   cl_env_copy->nvalues = 1;
   return value0;
L19:;
   v2args = ecl_car(v2args);
   if (!((v4structure_type)==(ECL_SYM("LIST",483)))){
    goto L24;
   }
   value0 = cl_list(3, ECL_SYM("ELT",329), v2args, v5slot_index);
   return value0;
L24:;
   if (!((v4structure_type)==(ECL_SYM("VECTOR",902)))){
    goto L26;
   }
   value0 = cl_list(3, ECL_SYM("SVREF",841), v2args, v5slot_index);
   return value0;
L26:;
   if (!(ECL_CONSP(v4structure_type))){
    goto L28;
   }
   T0 = cl_list(3, ECL_SYM("THE",859), v4structure_type, v2args);
   value0 = cl_list(3, ECL_SYM("AREF",94), T0, v5slot_index);
   return value0;
L28:;
   T0 = cl_list(2, ECL_SYM("QUOTE",682), v4structure_type);
   value0 = cl_list(3, v2args, T0, v5slot_index);
   return value0;
  }
L3:;
  value0 = ECL_NIL;
  cl_env_copy->nvalues = 1;
  return value0;
 }
}
static cl_object L4087maybe_optimize_structure_access_va(cl_narg narg, cl_object v6fname, cl_object v7args, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[2]);
 {
  return L4087maybe_optimize_structure_access(v6fname, v7args);
 }
}
/* local function LAMBDA9                                                     */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC4088__lambda9(cl_object v1, cl_object v2env)
{
 cl_object T0, T1, T2, T3;
 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;
  cl_object v4object;
  cl_object v5structure_name;
  cl_object v6index;
  T0 = ecl_car(v1);
  if (!((T0)==(ECL_SYM("FUNCALL",396)))){
   goto L3;
  }
  T0 = ecl_caadr(v1);
  if (!((T0)==(ECL_SYM("FUNCTION",398)))){
   goto L3;
  }
  v3 = ecl_cddr(v1);
  goto L2;
L3:;
  v3 = ecl_cdr(v1);
L2:;
  if (!(v3==ECL_NIL)){
   goto L7;
  }
  si_dm_too_few_arguments(v1);
L7:;
  {
   cl_object v7;
   v7 = ecl_car(v3);
   v3 = ecl_cdr(v3);
   v4object = v7;
  }
  if (!(v3==ECL_NIL)){
   goto L13;
  }
  si_dm_too_few_arguments(v1);
L13:;
  {
   cl_object v7;
   v7 = ecl_car(v3);
   v3 = ecl_cdr(v3);
   v5structure_name = v7;
  }
  if (!(v3==ECL_NIL)){
   goto L19;
  }
  si_dm_too_few_arguments(v1);
L19:;
  {
   cl_object v7;
   v7 = ecl_car(v3);
   v3 = ecl_cdr(v3);
   v6index = v7;
  }
  if (Null(v3)){
   goto L24;
  }
  si_dm_too_many_arguments(v1);
L24:;
  if (Null((cl_env_copy->function=ecl_fdefinition(VV[13]))->cfun.entry(1, v2env) /*  POLICY-INLINE-SLOT-ACCESS */)){
   goto L26;
  }
  if (Null(cl_constantp(2, v5structure_name, v2env))){
   goto L26;
  }
  if (Null(cl_constantp(2, v6index, v2env))){
   goto L26;
  }
  {
   cl_object v7index;
   cl_object v8aux;
   cl_object v9form;
   v7index = (cl_env_copy->function=ecl_fdefinition(ECL_SYM("CONSTANT-FORM-VALUE",2161)))->cfun.entry(2, v6index, v2env) /*  CONSTANT-FORM-VALUE */;
   v8aux = cl_gensym(0);
   T0 = cl_list(2, v8aux, v7index);
   v9form = cl_listX(3, ECL_SYM("C-INLINE",2106), T0, VV[14]);
   if ((cl_env_copy->function=ecl_fdefinition(VV[15]))->cfun.entry(1, v2env) /*  POLICY-ASSUME-NO-ERRORS */!=ECL_NIL) {
    goto L33;
   }
   {
    cl_object v10structure_name;
    v10structure_name = (cl_env_copy->function=ecl_fdefinition(ECL_SYM("CONSTANT-FORM-VALUE",2161)))->cfun.entry(2, v5structure_name, v2env) /*  CONSTANT-FORM-VALUE */;
    T0 = cl_list(2, v10structure_name, v9form);
    T1 = cl_list(3, v8aux, v10structure_name, v7index);
    T2 = cl_listX(3, ECL_SYM("C-INLINE",2106), T1, VV[16]);
    T3 = cl_list(2, ECL_T, T2);
    v9form = cl_list(4, ECL_SYM("COMPILER-TYPECASE",1887), v8aux, T0, T3);
   }
L33:;
   T0 = cl_list(2, v8aux, v4object);
   T1 = ecl_list1(T0);
   T2 = cl_list(2, VV[17], v8aux);
   T3 = cl_list(2, ECL_SYM("DECLARE",276), T2);
   value0 = cl_list(4, ECL_SYM("LET",479), T1, T3, v9form);
   return value0;
  }
L26:;
  value0 = v1;
  cl_env_copy->nvalues = 1;
  return value0;
 }
}
static cl_object LC4088__lambda9_va(cl_narg narg, cl_object v10, cl_object v11env, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[11]);
 {
  return LC4088__lambda9(v10, v11env);
 }
}
/* local function LAMBDA19                                                    */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC4089__lambda19(cl_object v1, cl_object v2env)
{
 cl_object T0, T1, T2, T3, T4;
 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;
  cl_object v4object;
  cl_object v5structure_name;
  cl_object v6index;
  cl_object v7value;
  T0 = ecl_car(v1);
  if (!((T0)==(ECL_SYM("FUNCALL",396)))){
   goto L3;
  }
  T0 = ecl_caadr(v1);
  if (!((T0)==(ECL_SYM("FUNCTION",398)))){
   goto L3;
  }
  v3 = ecl_cddr(v1);
  goto L2;
L3:;
  v3 = ecl_cdr(v1);
L2:;
  if (!(v3==ECL_NIL)){
   goto L7;
  }
  si_dm_too_few_arguments(v1);
L7:;
  {
   cl_object v8;
   v8 = ecl_car(v3);
   v3 = ecl_cdr(v3);
   v4object = v8;
  }
  if (!(v3==ECL_NIL)){
   goto L13;
  }
  si_dm_too_few_arguments(v1);
L13:;
  {
   cl_object v8;
   v8 = ecl_car(v3);
   v3 = ecl_cdr(v3);
   v5structure_name = v8;
  }
  if (!(v3==ECL_NIL)){
   goto L19;
  }
  si_dm_too_few_arguments(v1);
L19:;
  {
   cl_object v8;
   v8 = ecl_car(v3);
   v3 = ecl_cdr(v3);
   v6index = v8;
  }
  if (!(v3==ECL_NIL)){
   goto L25;
  }
  si_dm_too_few_arguments(v1);
L25:;
  {
   cl_object v8;
   v8 = ecl_car(v3);
   v3 = ecl_cdr(v3);
   v7value = v8;
  }
  if (Null(v3)){
   goto L30;
  }
  si_dm_too_many_arguments(v1);
L30:;
  if (Null((cl_env_copy->function=ecl_fdefinition(VV[13]))->cfun.entry(1, v2env) /*  POLICY-INLINE-SLOT-ACCESS */)){
   goto L32;
  }
  if (Null(cl_constantp(2, v5structure_name, v2env))){
   goto L32;
  }
  if (Null(cl_constantp(2, v6index, v2env))){
   goto L32;
  }
  {
   cl_object v8index;
   cl_object v9aux;
   cl_object v10form;
   v8index = (cl_env_copy->function=ecl_fdefinition(ECL_SYM("CONSTANT-FORM-VALUE",2161)))->cfun.entry(2, v6index, v2env) /*  CONSTANT-FORM-VALUE */;
   v9aux = cl_gensym(0);
   T0 = cl_list(3, v9aux, v8index, v7value);
   v10form = cl_listX(3, ECL_SYM("C-INLINE",2106), T0, VV[19]);
   if ((cl_env_copy->function=ecl_fdefinition(VV[15]))->cfun.entry(1, v2env) /*  POLICY-ASSUME-NO-ERRORS */!=ECL_NIL) {
    goto L39;
   }
   {
    cl_object v11structure_name;
    v11structure_name = (cl_env_copy->function=ecl_fdefinition(ECL_SYM("CONSTANT-FORM-VALUE",2161)))->cfun.entry(2, v5structure_name, v2env) /*  CONSTANT-FORM-VALUE */;
    T0 = cl_list(2, v11structure_name, v10form);
    T1 = cl_list(2, ECL_SYM("QUOTE",682), v11structure_name);
    T2 = cl_list(4, v9aux, T1, v8index, v7value);
    T3 = cl_listX(3, ECL_SYM("C-INLINE",2106), T2, VV[20]);
    T4 = cl_list(2, ECL_T, T3);
    v10form = cl_list(4, ECL_SYM("COMPILER-TYPECASE",1887), v9aux, T0, T4);
   }
L39:;
   T0 = cl_list(2, v9aux, v4object);
   T1 = ecl_list1(T0);
   T2 = cl_list(2, VV[17], v9aux);
   T3 = cl_list(2, ECL_SYM("DECLARE",276), T2);
   value0 = cl_list(4, ECL_SYM("LET",479), T1, T3, v10form);
   return value0;
  }
L32:;
  value0 = v1;
  cl_env_copy->nvalues = 1;
  return value0;
 }
}
static cl_object LC4089__lambda19_va(cl_narg narg, cl_object v11, cl_object v12env, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[18]);
 {
  return LC4089__lambda19(v11, v12env);
 }
}
#include "cmp/cmpstructures.data"
#ifdef __cplusplus
extern "C"
#endif

ECL_DLLEXPORT void _eclrdsc1m2bDUor9_GBg0M881(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;CMPSTRUCTURES.LSP.NEWEST",-1);
 return;}
 #ifdef ECL_DYNAMIC_VV
 VV = Cblock->cblock.data;
 #endif
 Cblock->cblock.data_text = (const cl_object *)"@EcLtAg:_eclrdsc1m2bDUor9_GBg0M881@";
 VVtemp = Cblock->cblock.temp_data;
 ECL_DEFINE_SETF_FUNCTIONS
 {
  cl_object T0;
  cl_object volatile env0 = ECL_NIL;
/* MAKE-LOAD-FORMs                                                            */
/* TOP-LEVEL-FORMs                                                            */
  si_select_package(VVtemp[0]);
  ecl_cmp_defun(VV[21]);                          /*  GET-SLOT-TYPE           */
  ecl_cmp_defun(VV[22]);                          /*  MAYBE-OPTIMIZE-STRUCTURE-ACCESS */
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC4088__lambda9_va,ECL_NIL,Cblock,2);
   T0 = v1;
  }
  si_put_sysprop(ECL_SYM("STRUCTURE-REF",1178), ECL_SYM("COMPILER-MACRO",240), T0);
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC4089__lambda19_va,ECL_NIL,Cblock,2);
   T0 = v1;
  }
  si_put_sysprop(ECL_SYM("STRUCTURE-SET",1179), ECL_SYM("COMPILER-MACRO",240), T0);
 }
}
