/* Compiler: ECL 26.3.27                                                      */
/* Source: /build/ecl/src/ecl-26.3.27/src/cmp/cmpopt-clos.lsp                 */
#include <ecl/ecl-cmp.h>
#include "cmp/cmpopt-clos.eclh"
/* function definition for CLOS-COMPILER-MACRO-EXPAND                         */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L4032clos_compiler_macro_expand(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:;
 if (Null(si_valid_function_name_p(v1fname))){
  goto L2;
 }
 if (Null(cl_fboundp(v1fname))){
  goto L2;
 }
 {
  cl_object v3function;
  v3function = cl_fdefinition(v1fname);
  if (Null(si_of_class_p(2, v3function, ECL_SYM("GENERIC-FUNCTION",949)))){
   goto L6;
  }
  T0 = CONS(v1fname,v2args);
  value0 = (cl_env_copy->function=ecl_fdefinition(VV[1]))->cfun.entry(2, v3function, T0) /*  GENERIC-FUNCTION-MACRO-EXPAND */;
  return value0;
L6:;
  value0 = ECL_NIL;
  cl_env_copy->nvalues = 1;
  return value0;
 }
L2:;
 value0 = ECL_NIL;
 cl_env_copy->nvalues = 1;
 return value0;
}
static cl_object L4032clos_compiler_macro_expand_va(cl_narg narg, cl_object v4fname, cl_object v5args, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[0]);
 {
  return L4032clos_compiler_macro_expand(v4fname, v5args);
 }
}
/* local function GENERIC-FUNCTION-MACRO-EXPAND                               */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC4033generic_function_macro_expand(cl_object v1g, cl_object v2whole)
{
 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 v3output;
  cl_object v4success;
  v3output = L4036optimizable_slot_accessor(v1g, v2whole);
  if (Null(v3output)){
   goto L5;
  }
  v4success = ECL_T;
  goto L3;
L5:;
  v4success = ECL_NIL;
  goto L3;
L3:;
  cl_env_copy->nvalues = 2;
  cl_env_copy->values[1] = v4success;
  cl_env_copy->values[0] = v3output;
  return cl_env_copy->values[0];
 }
}
static cl_object LC4033generic_function_macro_expand_va(cl_narg narg, cl_object v5g, cl_object v6whole, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[1]);
 {
  return LC4033generic_function_macro_expand(v5g, v6whole);
 }
}
/* function definition for OPTIMIZABLE-SLOT-READER                            */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L4034optimizable_slot_reader(cl_object v1method, cl_object v2whole)
{
 cl_object T0, T1, T2, T3, T4, T5, T6;
 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:;
 if (Null(si_of_class_p(2, v1method, ECL_SYM("STANDARD-READER-METHOD",1640)))){
  goto L2;
 }
 {
  cl_object v3class;
  T0 = (cl_env_copy->function=(ECL_SYM("METHOD-SPECIALIZERS",1610)->symbol.gfdef))->cfun.entry(1, v1method) /*  METHOD-SPECIALIZERS */;
  v3class = ecl_car(T0);
  if (Null((cl_env_copy->function=(VV[6]->symbol.gfdef))->cfun.entry(1, v3class) /*  CLASS-SEALEDP */)){
   goto L5;
  }
  {
   cl_object v4slotd;
   cl_object v5location;
   v4slotd = (cl_env_copy->function=(ECL_SYM("ACCESSOR-METHOD-SLOT-DEFINITION",1558)->symbol.gfdef))->cfun.entry(1, v1method) /*  ACCESSOR-METHOD-SLOT-DEFINITION */;
   v5location = (cl_env_copy->function=(ECL_SYM("SLOT-DEFINITION-LOCATION",1623)->symbol.gfdef))->cfun.entry(1, v4slotd) /*  SLOT-DEFINITION-LOCATION */;
   {
    cl_object v6object;
    v6object = cl_gentemp(0);
    T0 = (cl_env_copy->function=(ECL_SYM("SLOT-DEFINITION-NAME",1624)->symbol.gfdef))->cfun.entry(1, v4slotd) /*  SLOT-DEFINITION-NAME */;
    T1 = (cl_env_copy->function=(ECL_SYM("CLASS-NAME",938)->symbol.gfdef))->cfun.entry(1, v3class) /*  CLASS-NAME */;
    (cl_env_copy->function=ecl_fdefinition(VV[7]))->cfun.entry(3, VV[8], T0, T1) /*  CMPNOTE */;
    T0 = ecl_cadr(v2whole);
    T1 = cl_list(2, v6object, T0);
    T2 = ecl_list1(T1);
    T3 = cl_list(2, ECL_SYM("QUOTE",682), v3class);
    T4 = cl_list(3, VV[9], v6object, T3);
    T5 = cl_list(3, ECL_SYM("INSTANCE-REF",1196), v6object, v5location);
    T6 = cl_list(3, ECL_SYM("LOCALLY",492), VV[10], T5);
    value0 = cl_list(4, ECL_SYM("LET",479), T2, T4, T6);
    return value0;
   }
  }
L5:;
  value0 = ECL_NIL;
  cl_env_copy->nvalues = 1;
  return value0;
 }
L2:;
 value0 = ECL_NIL;
 cl_env_copy->nvalues = 1;
 return value0;
}
/* function definition for OPTIMIZABLE-SLOT-WRITER                            */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L4035optimizable_slot_writer(cl_object v1method, cl_object v2whole)
{
 cl_object T0, T1, T2, T3, T4, T5, T6, T7, T8;
 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:;
 if (Null(si_of_class_p(2, v1method, ECL_SYM("STANDARD-WRITER-METHOD",1642)))){
  goto L2;
 }
 {
  cl_object v3class;
  T0 = (cl_env_copy->function=(ECL_SYM("METHOD-SPECIALIZERS",1610)->symbol.gfdef))->cfun.entry(1, v1method) /*  METHOD-SPECIALIZERS */;
  v3class = ecl_cadr(T0);
  if (Null((cl_env_copy->function=(VV[6]->symbol.gfdef))->cfun.entry(1, v3class) /*  CLASS-SEALEDP */)){
   goto L5;
  }
  {
   cl_object v4slotd;
   cl_object v5location;
   v4slotd = (cl_env_copy->function=(ECL_SYM("ACCESSOR-METHOD-SLOT-DEFINITION",1558)->symbol.gfdef))->cfun.entry(1, v1method) /*  ACCESSOR-METHOD-SLOT-DEFINITION */;
   v5location = (cl_env_copy->function=(ECL_SYM("SLOT-DEFINITION-LOCATION",1623)->symbol.gfdef))->cfun.entry(1, v4slotd) /*  SLOT-DEFINITION-LOCATION */;
   {
    cl_object v6object;
    cl_object v7value;
    v6object = cl_gentemp(0);
    v7value = cl_gentemp(0);
    T0 = (cl_env_copy->function=(ECL_SYM("SLOT-DEFINITION-NAME",1624)->symbol.gfdef))->cfun.entry(1, v4slotd) /*  SLOT-DEFINITION-NAME */;
    T1 = (cl_env_copy->function=(ECL_SYM("CLASS-NAME",938)->symbol.gfdef))->cfun.entry(1, v3class) /*  CLASS-NAME */;
    (cl_env_copy->function=ecl_fdefinition(VV[7]))->cfun.entry(3, VV[12], T0, T1) /*  CMPNOTE */;
    T0 = ecl_cadr(v2whole);
    T1 = cl_list(2, v7value, T0);
    T2 = ecl_caddr(v2whole);
    T3 = cl_list(2, v6object, T2);
    T4 = cl_list(2, T1, T3);
    T5 = cl_list(2, ECL_SYM("QUOTE",682), v3class);
    T6 = cl_list(3, VV[9], v6object, T5);
    T7 = cl_list(4, ECL_SYM("INSTANCE-SET",1197), v6object, v5location, v7value);
    T8 = cl_list(3, ECL_SYM("LOCALLY",492), VV[10], T7);
    value0 = cl_list(4, ECL_SYM("LET",479), T4, T6, T8);
    return value0;
   }
  }
L5:;
  value0 = ECL_NIL;
  cl_env_copy->nvalues = 1;
  return value0;
 }
L2:;
 value0 = ECL_NIL;
 cl_env_copy->nvalues = 1;
 return value0;
}
/* function definition for OPTIMIZABLE-SLOT-ACCESSOR                          */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L4036optimizable_slot_accessor(cl_object v1g, cl_object v2whole)
{
 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:;
 if (Null((cl_env_copy->function=ecl_fdefinition(VV[13]))->cfun.entry(0) /*  POLICY-INLINE-SLOT-ACCESS */)){
  goto L3;
 }
 {
  cl_object v3methods;
  v3methods = (cl_env_copy->function=(ECL_SYM("GENERIC-FUNCTION-METHODS",1600)->symbol.gfdef))->cfun.entry(1, v1g) /*  GENERIC-FUNCTION-METHODS */;
  if (Null(v3methods)){
   goto L7;
  }
  T0 = ecl_cdr(v3methods);
  if (!(T0==ECL_NIL)){
   goto L7;
  }
  {
   cl_object v4principal;
   v4principal = ecl_car(v3methods);
   value0 = L4034optimizable_slot_reader(v4principal, v2whole);
   if (value0!=ECL_NIL) {
    goto L12;
   }
   value0 = L4035optimizable_slot_writer(v4principal, v2whole);
   return value0;
L12:;
   cl_env_copy->nvalues = 1;
   return value0;
  }
L7:;
  value0 = ECL_NIL;
  cl_env_copy->nvalues = 1;
  return value0;
 }
L3:;
 value0 = ECL_NIL;
 cl_env_copy->nvalues = 1;
 return value0;
}
#include "cmp/cmpopt-clos.data"
#ifdef __cplusplus
extern "C"
#endif

ECL_DLLEXPORT void _ecl1iWnMcWIL1Si9_iKf0M881(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;CMPOPT-CLOS.LSP.NEWEST",-1);
 return;}
 #ifdef ECL_DYNAMIC_VV
 VV = Cblock->cblock.data;
 #endif
 Cblock->cblock.data_text = (const cl_object *)"@EcLtAg:_ecl1iWnMcWIL1Si9_iKf0M881@";
 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[14]);                          /*  CLOS-COMPILER-MACRO-EXPAND */
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC4033generic_function_macro_expand_va,ECL_NIL,Cblock,2);
   T0 = v1;
  }
  clos_install_method(5, VV[1], ECL_NIL, VVtemp[1], VVtemp[2], T0);
  (void)0; /* No entry created for OPTIMIZABLE-SLOT-READER */
  (void)0; /* No entry created for OPTIMIZABLE-SLOT-WRITER */
  (void)0; /* No entry created for OPTIMIZABLE-SLOT-ACCESSOR */
 }
}
