/* Compiler: ECL 26.3.27                                                      */
/* Source: /build/ecl/src/ecl-26.3.27/contrib/quicklisp/ecl-quicklisp.lisp    */
#include <ecl/ecl-cmp.h>
#include "ext/ecl-quicklisp.eclh"
/* function definition for SAFE-DOWNLOAD                                      */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5479safe_download(cl_object volatile v1url, cl_object volatile v2filename)
{
 cl_object T0, T1, T2, T3;
 cl_object volatile env0 = ECL_NIL;
 cl_object volatile CLV0, CLV1;
 const cl_env_ptr cl_env_copy = ecl_process_env();
 cl_object volatile value0;
 ecl_cs_check(cl_env_copy,value0);
L1:;
 cl_ensure_directories_exist(1, v2filename);
 {
  volatile cl_object env1 = env0;
  env1 = ECL_NIL;
  CLV0 = env1 = CONS(ECL_NIL,env1);
  {
   volatile cl_object env2 = env1;
   CLV1 = env2 = CONS(ECL_NEW_FRAME_ID(cl_env_copy),env2); /*  TAGBODY        */
   {
    ecl_frs_push(cl_env_copy,ECL_CONS_CAR(CLV1));
    if (__ecl_frs_push_result!=0) {
    if (cl_env_copy->values[0]==ecl_make_int8_t(0)) {
     goto L4;
    }
    ecl_internal_error("GO found an inexistent tag");
    } else {
    {
     cl_object v3;
     v3 = ecl_make_cclosure_va((cl_objectfn)LC5478__lambda4,env2,Cblock,1);
     T0 = v3;
    }
    T1 = CONS(VV[7],T0);
    T2 = ecl_list1(T1);
    T3 = CONS(T2,ecl_cmp_symbol_value(cl_env_copy,ECL_SYM("*HANDLER-CLUSTERS*",6)));
    ecl_bds_bind(cl_env_copy,ECL_SYM("*HANDLER-CLUSTERS*",6),T3); /*  *HANDLER-CLUSTERS* */
    (cl_env_copy->function=ecl_fdefinition(VV[9]))->cfun.entry(2, v1url, v2filename) /*  DOWNLOAD-URL-TO-FILE */;
    ecl_frs_pop_n(cl_env_copy, 1);
    ecl_bds_unwind1(cl_env_copy);
    goto L3;
L4:;
    cl_format(2, ECL_T, VV[10]);
    si_quit(1, ecl_make_int8_t(1));
    ecl_frs_pop_n(cl_env_copy, 1);
    goto L3;
    }
   }
  }
 }
L3:;
 value0 = v2filename;
 cl_env_copy->nvalues = 1;
 return value0;
}
static cl_object L5479safe_download_va(cl_narg narg, cl_object v3url, cl_object v4filename, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[5]);
 {
  return L5479safe_download(v3url, v4filename);
 }
}
/* function definition for INSTALL-QUICKLISP                                  */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5480install_quicklisp(cl_object v1target_directory)
{
 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 v2file;
  v2file = cl_merge_pathnames(2, VV[13], v1target_directory);
  cl_ensure_directories_exist(1, v2file);
  (cl_env_copy->function=ecl_fdefinition(VV[9]))->cfun.entry(2, ecl_cmp_symbol_value(cl_env_copy,VV[2]), v2file) /*  DOWNLOAD-URL-TO-FILE */;
  cl_load(1, v2file);
  T0 = cl_truename(v1target_directory);
  T1 = cl_namestring(T0);
  T2 = cl_format(3, ECL_NIL, VV[14], T1);
  T3 = cl_read_from_string(1, T2);
  value0 = cl_eval(T3);
  return value0;
 }
}
static cl_object L5480install_quicklisp_va(cl_narg narg, cl_object v3target_directory, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[12]);
 {
  return L5480install_quicklisp(v3target_directory);
 }
}
/* closure LAMBDA10                                                           */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5481__lambda10(cl_narg narg, cl_object v1si__temp, ...)
{
 cl_object CLV0, CLV1;
 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 ... */
 CLV1 = env0;                                     /*  TAGBODY                 */
 CLV0 = _ecl_cdr(CLV1);
 { /* ... closure scanning finished */
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[17]);
 {
L1:;
  ECL_CONS_CAR(CLV0) = v1si__temp;
  cl_go(ECL_CONS_CAR(CLV1),ecl_make_fixnum(0));
 }
 }
}
/* closure LAMBDA4                                                            */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5478__lambda4(cl_narg narg, cl_object v1si__temp, ...)
{
 cl_object CLV0, CLV1;
 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 ... */
 CLV1 = env0;                                     /*  TAGBODY                 */
 CLV0 = _ecl_cdr(CLV1);
 { /* ... closure scanning finished */
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[8]);
 {
L1:;
  ECL_CONS_CAR(CLV0) = v1si__temp;
  cl_go(ECL_CONS_CAR(CLV1),ecl_make_fixnum(0));
 }
 }
}
#include "ext/ecl-quicklisp.data"
#ifdef __cplusplus
extern "C"
#endif

ECL_DLLEXPORT void _ecloDJKBvySQGSo9_C9c1M881(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("EXT:QUICKLISP;ECL-QUICKLISP.LISP.NEWEST",-1);
 return;}
 #ifdef ECL_DYNAMIC_VV
 VV = Cblock->cblock.data;
 #endif
 Cblock->cblock.data_text = (const cl_object *)"@EcLtAg:_ecloDJKBvySQGSo9_C9c1M881@";
 VVtemp = Cblock->cblock.temp_data;
 ECL_DEFINE_SETF_FUNCTIONS
 {
  cl_object T0, T1, T2, T3;
  cl_object volatile env0 = ECL_NIL;
  cl_object volatile CLV0, CLV1;
/* MAKE-LOAD-FORMs                                                            */
/* TOP-LEVEL-FORMs                                                            */
  (cl_env_copy->function=(VV[0]->symbol.gfdef))->cfun.entry(12, _ecl_static_0, ECL_NIL, ECL_NIL, ECL_NIL, VVtemp[0], ECL_NIL, ECL_NIL, ECL_NIL, ECL_NIL, ECL_NIL, ECL_NIL, ECL_NIL) /*  DODEFPACKAGE */;
  si_select_package(_ecl_static_0);
  cl_require(1, VV[1]);
  si_Xmake_special(VV[2]);
  T0 = VVtemp[1];
  ecl_cmp_setq(cl_env_copy,VV[2],T0);
  si_Xmake_special(VV[3]);
  T0 = cl_translate_logical_pathname(1, VVtemp[2]);
  ecl_cmp_setq(cl_env_copy,VV[3],T0);
  si_Xmake_special(VV[4]);
  T0 = VVtemp[3];
  ecl_cmp_setq(cl_env_copy,VV[4],T0);
  ecl_cmp_defun(VV[19]);                          /*  SAFE-DOWNLOAD           */
  ecl_cmp_defun(VV[20]);                          /*  INSTALL-QUICKLISP       */
  {
   volatile cl_object env1 = env0;
   env1 = ECL_NIL;
   CLV0 = env1 = CONS(ECL_NIL,env1);
   {
    volatile cl_object env2 = env1;
    CLV1 = env2 = CONS(ECL_NEW_FRAME_ID(cl_env_copy),env2); /*  TAGBODY       */
    {
     ecl_frs_push(cl_env_copy,ECL_CONS_CAR(CLV1));
     if (__ecl_frs_push_result!=0) {
     if (cl_env_copy->values[0]==ecl_make_int8_t(0)) {
      goto L29;
     }
     ecl_internal_error("GO found an inexistent tag");
     } else {
     {
      cl_object v1;
      v1 = ecl_make_cclosure_va((cl_objectfn)LC5481__lambda10,env2,Cblock,1);
      T0 = v1;
     }
     T1 = CONS(ECL_SYM("ERROR",339),T0);
     T2 = ecl_list1(T1);
     T3 = CONS(T2,ecl_cmp_symbol_value(cl_env_copy,ECL_SYM("*HANDLER-CLUSTERS*",6)));
     ecl_bds_bind(cl_env_copy,ECL_SYM("*HANDLER-CLUSTERS*",6),T3); /*  *HANDLER-CLUSTERS* */
     if (cl_probe_file(ecl_cmp_symbol_value(cl_env_copy,VV[4]))!=ECL_NIL) {
      goto L32;
     }
     L5480install_quicklisp(ecl_cmp_symbol_value(cl_env_copy,VV[3]));
L32:;
     if (cl_find_package(VVtemp[4])!=ECL_NIL) {
      goto L34;
     }
     cl_load(1, ecl_cmp_symbol_value(cl_env_copy,VV[4]));
L34:;
     T0 = cl_read_from_string(1, VVtemp[5]);
     cl_eval(T0);
     ecl_frs_pop_n(cl_env_copy, 1);
     ecl_bds_unwind1(cl_env_copy);
     goto L28;
L29:;
     {
      cl_object v1c;
      v1c = ECL_CONS_CAR(CLV0);
      cl_format(3, ECL_T, VVtemp[6], v1c);
      ecl_frs_pop_n(cl_env_copy, 1);
      goto L28;
     }
     }
    }
   }
  }
L28:;
  cl_provide(VV[18]);
 }
}
