/* Compiler: ECL 26.3.27                                                      */
/* Source: /build/ecl/src/ecl-26.3.27/src/clos/dispatch.lsp                   */
#include <ecl/ecl-cmp.h>
#include "clos/dispatch.eclh"
/* function definition for GENERIC-COMPUTE-APPLICABLE-METHOD                  */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L1436generic_compute_applicable_method(cl_object v1gf, cl_object v2args)
{
 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;                                   /*  METHOD-LIST             */
  cl_object v4;                                   /*  OK                      */
  {
   cl_object v5;
   v5 = (ECL_SYM("CLASS-OF",939)->symbol.gfdef);
   {
    cl_object v6;
    cl_object v7;
    cl_object v8;
    {
     cl_object v9;
     v9 = v2args;
     if (ecl_unlikely(!ECL_LISTP(v9))) FEtype_error_list(v9);
     value0 = ECL_NIL;
     cl_env_copy->nvalues = 0;
     v6 = v9;
    }
    v7 = ECL_NIL;
    v8 = v6;
    {
     cl_object v9;
     cl_object v10;
     v9 = ecl_list1(ECL_NIL);
     v10 = v9;
L12:;
     if (!(ecl_endp(v8))){
      goto L14;
     }
     goto L13;
L14:;
     v7 = ECL_CONS_CAR(v8);
     {
      cl_object v11;
      v11 = ECL_CONS_CDR(v8);
      if (ecl_unlikely(!ECL_LISTP(v11))) FEtype_error_list(v11);
      value0 = ECL_NIL;
      cl_env_copy->nvalues = 0;
      v8 = v11;
     }
     {
      cl_object v11;
      v11 = v10;
      if (ecl_unlikely(ECL_ATOM(v11))) FEtype_error_cons(v11);
      value0 = ECL_NIL;
      cl_env_copy->nvalues = 0;
      T1 = v11;
     }
     T2 = ecl_function_dispatch(cl_env_copy,v5)(1, v7);
     v10 = ecl_list1(T2);
     (ECL_CONS_CDR(T1)=v10,T1);
     goto L12;
L13:;
     T0 = ecl_cdr(v9);
     goto L3;
    }
   }
  }
L3:;
  value0 = (cl_env_copy->function=(ECL_SYM("COMPUTE-APPLICABLE-METHODS-USING-CLASSES",1571)->symbol.gfdef))->cfun.entry(2, v1gf, T0) /*  COMPUTE-APPLICABLE-METHODS-USING-CLASSES */;
  {
   const int v5 = cl_env_copy->nvalues;
   v3 = value0;
   cl_object v6;
   v6 = (v5<=1)? ECL_NIL : cl_env_copy->values[1];
   v4 = v6;
  }
  if (v4!=ECL_NIL) {
   goto L30;
  }
  v3 = (cl_env_copy->function=(ECL_SYM("COMPUTE-APPLICABLE-METHODS",940)->symbol.gfdef))->cfun.entry(2, v1gf, v2args) /*  COMPUTE-APPLICABLE-METHODS */;
L30:;
  if (Null(v3)){
   goto L34;
  }
  {
   cl_object v5combin;
   v5combin = (cl_env_copy->function=(ECL_SYM("GENERIC-FUNCTION-METHOD-COMBINATION",1599)->symbol.gfdef))->cfun.entry(1, v1gf) /*  GENERIC-FUNCTION-METHOD-COMBINATION */;
   value0 = clos_compute_effective_method_function(v1gf, v5combin, v3);
   return value0;
  }
L34:;
  value0 = ECL_NIL;
  cl_env_copy->nvalues = 1;
  return value0;
 }
}
/* function definition for RESTRICTED-COMPUTE-APPLICABLE-METHOD               */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L1453restricted_compute_applicable_method(cl_object v1gf, cl_object v2args)
{
 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 v3method_list;
  v3method_list = clos_std_compute_applicable_methods(v1gf, v2args);
  if (Null(v3method_list)){
   goto L4;
  }
  {
   cl_object v4combin;
   v4combin = ecl_instance_ref((v1gf),((cl_fixnum)(2)));
   value0 = clos_compute_effective_method_function(v1gf, v4combin, v3method_list);
   return value0;
  }
L4:;
  value0 = ECL_NIL;
  cl_env_copy->nvalues = 1;
  return value0;
 }
}
/* function definition for COMPUTE-APPLICABLE-METHOD                          */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L1454compute_applicable_method(cl_object v1gf, cl_object v2args)
{
 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 = cl_class_of(v1gf);
 T1 = cl_slot_value(T0, ECL_SYM("NAME",1611));
 if (!((T1)==(ECL_SYM("STANDARD-GENERIC-FUNCTION",978)))){
  goto L2;
 }
 value0 = L1453restricted_compute_applicable_method(v1gf, v2args);
 return value0;
L2:;
 value0 = L1436generic_compute_applicable_method(v1gf, v2args);
 return value0;
}
/* function definition for UNOPTIMIZED-DISCRIMINATOR                          */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L1456unoptimized_discriminator(cl_object v1gf)
{
 cl_object env0 = ECL_NIL;
 cl_object CLV0;
 const cl_env_ptr cl_env_copy = ecl_process_env();
 cl_object value0;
 ecl_cs_check(cl_env_copy,value0);
 env0 = ECL_NIL;
 CLV0 = env0 = CONS(v1gf,env0);                   /*  GF                      */
 {
  cl_object v2;
  v2 = ecl_make_cclosure_va((cl_objectfn)LC1455__lambda29,env0,Cblock,0);
  value0 = v2;
  cl_env_copy->nvalues = 1;
  return value0;
 }
}
static cl_object L1456unoptimized_discriminator_va(cl_narg narg, cl_object v3gf, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[12]);
 {
  return L1456unoptimized_discriminator(v3gf);
 }
}
/* local function GENERIC-FUNCTION-METHOD-COMBINATION                         */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC1450generic_function_method_combination(cl_object v1object)
{
 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 = ecl_instance_ref((v1object),((cl_fixnum)(2)));
 cl_env_copy->nvalues = 1;
 return value0;
}
static cl_object LC1450generic_function_method_combination_va(cl_narg narg, cl_object v2object, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(ECL_SYM("GENERIC-FUNCTION-METHOD-COMBINATION",1599));
 {
  return LC1450generic_function_method_combination(v2object);
 }
}
/* closure LAMBDA29                                                           */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC1455__lambda29(cl_narg narg, ...)
{
 cl_object T0;
 cl_object CLV0;
 const cl_env_ptr cl_env_copy = ecl_process_env();
 cl_object env0 = cl_env_copy->function->cclosure.env;
 cl_object value0;
 ecl_cs_check(cl_env_copy,value0);
 /* Scanning closure data ... */
 CLV0 = env0;                                     /*  GF                      */
 { /* ... closure scanning finished */
 {
  cl_object v1args;
  ecl_va_list args; ecl_va_start(args,narg,narg,0);
  v1args = cl_grab_rest_args(args);
  ecl_va_end(args);
  {
   cl_object v2fn;
   v2fn = L1454compute_applicable_method(ECL_CONS_CAR(CLV0), v1args);
   if (Null(v2fn)){
    goto L2;
   }
   value0 = ecl_function_dispatch(cl_env_copy,v2fn)(2, v1args, ECL_NIL);
   return value0;
L2:;
   T0 = (ECL_SYM("NO-APPLICABLE-METHOD",963)->symbol.gfdef);
   value0 = cl_apply(3, T0, ECL_CONS_CAR(CLV0), v1args);
   return value0;
  }
 }
 }
}
#include "clos/dispatch.data"
#ifdef __cplusplus
extern "C"
#endif

ECL_DLLEXPORT void _eclTLW9mAbG9tRj9_2i10M881(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:CLOS;DISPATCH.LSP.NEWEST",-1);
 return;}
 #ifdef ECL_DYNAMIC_VV
 VV = Cblock->cblock.data;
 #endif
 Cblock->cblock.data_text = (const cl_object *)"@EcLtAg:_eclTLW9mAbG9tRj9_2i10M881@";
 VVtemp = Cblock->cblock.temp_data;
 ECL_DEFINE_SETF_FUNCTIONS
/* MAKE-LOAD-FORMs                                                            */
/* TOP-LEVEL-FORMs                                                            */
  si_select_package(_ecl_static_0);
  (void)0; /* No entry created for GENERIC-COMPUTE-APPLICABLE-METHOD */
  (void)0; /* No entry created for RESTRICTED-COMPUTE-APPLICABLE-METHOD */
  (void)0; /* No entry created for COMPUTE-APPLICABLE-METHOD */
  ecl_cmp_defun(VV[15]);                          /*  UNOPTIMIZED-DISCRIMINATOR */
}
