/* Compiler: ECL 26.3.27                                                      */
/* Source: /build/ecl/src/ecl-26.3.27/contrib/sockets/sockets.lisp            */
#include <ecl/ecl-cmp.h>
#include "ext/sockets.eclh"
/* function definition for FF-SOCKET                                          */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5314ff_socket(cl_object v1, cl_object v2, cl_object v3)
{
 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:;
 {
  int v4;
  ecl_disable_interrupts();v4=socket(ecl_to_int(v1),ecl_to_int(v2),ecl_to_int(v3));ecl_enable_interrupts();
  value0 = ecl_make_int(v4);
  cl_env_copy->nvalues = 1;
  return value0;
 }
}
static cl_object L5314ff_socket_va(cl_narg narg, cl_object v4, cl_object v5, cl_object v6, ...)
{
 if (ecl_unlikely(narg!=3)) FEwrong_num_arguments(VV[6]);
 {
  return L5314ff_socket(v4, v5, v6);
 }
}
/* function definition for FF-LISTEN                                          */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5315ff_listen(cl_object v1, cl_object v2)
{
 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:;
 {
  int v3;
  ecl_disable_interrupts();v3=listen(ecl_to_int(v1),ecl_to_int(v2));ecl_enable_interrupts();
  value0 = ecl_make_int(v3);
  cl_env_copy->nvalues = 1;
  return value0;
 }
}
static cl_object L5315ff_listen_va(cl_narg narg, cl_object v3, cl_object v4, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[8]);
 {
  return L5315ff_listen(v3, v4);
 }
}
/* function definition for FF-CLOSE                                           */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5316ff_close(cl_object v1)
{
 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:;
 {
  int v2;
  ecl_disable_interrupts();v2=close(ecl_to_int(v1));ecl_enable_interrupts();
  value0 = ecl_make_int(v2);
  cl_env_copy->nvalues = 1;
  return value0;
 }
}
static cl_object L5316ff_close_va(cl_narg narg, cl_object v2, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[10]);
 {
  return L5316ff_close(v2);
 }
}
/* function definition for SPLIT                                              */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5318split(cl_narg narg, cl_object v1string, ...)
{
 cl_object T0, T1;
 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);
 if (ecl_unlikely(narg<1)) FEwrong_num_arguments(VV[13]);
 if (ecl_unlikely(narg>3)) FEwrong_num_arguments(VV[13]);
 {
  cl_object v2max;
  va_list args; va_start(args,v1string);
  {
   int i = 1;
   if (i >= narg) {
    v2max = ECL_NIL;
   } else {
    i++;
    v2max = va_arg(args,cl_object);
   }
   if (i >= narg) {
    env0 = ECL_NIL;
    CLV0 = env0 = CONS(VV[12],env0);              /*  WS                      */
   } else {
    i++;
    env0 = ECL_NIL;
    CLV0 = env0 = CONS(va_arg(args,cl_object),env0); /*  WS                   */
   }
  }
  va_end(args);
  {
   cl_object v3;
   v3 = ecl_make_cclosure_va((cl_objectfn)LC5317is_ws,env0,Cblock,1);
   {
    cl_object v4start;
    v4start = ECL_NIL;
    {
     cl_object v5index;
     v5index = ECL_NIL;
     {
      cl_fixnum v6word_count;
      v6word_count = (cl_fixnum)(0);
      {
       cl_object v7;
       cl_object v8;
       v7 = ecl_list1(ECL_NIL);
       v8 = v7;
       v4start = cl_position_if_not(2, v3, v1string);
L7:;
       if (Null(v4start)){
        goto L14;
       }
       if (Null(v2max)){
        goto L16;
       }
       T0 = ecl_make_integer((v6word_count)+1);
       if (!(ecl_number_equalp(T0,v2max))){
        goto L16;
       }
       v5index = ECL_NIL;
       goto L12;
L16:;
       v5index = cl_position_if(4, v3, v1string, ECL_SYM("START",1347), v4start);
       goto L12;
L14:;
       v5index = ECL_NIL;
       goto L12;
L12:;
       if (v4start!=ECL_NIL) {
        goto L19;
       }
       goto L8;
L19:;
       {
        cl_object v9;
        v9 = v8;
        if (ecl_unlikely(ECL_ATOM(v9))) FEtype_error_cons(v9);
        value0 = ECL_NIL;
        cl_env_copy->nvalues = 0;
        T0 = v9;
       }
       T1 = cl_subseq(3, v1string, v4start, v5index);
       v8 = ecl_list1(T1);
       (ECL_CONS_CDR(T0)=v8,T0);
       {
        cl_object v9;
        v9 = ecl_make_integer((v6word_count)+1);
        {
         bool v10;
         v10 = ECL_FIXNUMP(v9);
         if (ecl_unlikely(!(v10)))
         FEwrong_type_argument(ECL_SYM("FIXNUM",374),v9);
         value0 = ECL_NIL;
         cl_env_copy->nvalues = 0;
        }
        v6word_count = ecl_fixnum(v9);
       }
       if (v5index!=ECL_NIL) {
        goto L30;
       }
       goto L8;
L30:;
       v4start = cl_position_if_not(4, v3, v1string, ECL_SYM("START",1347), v5index);
       goto L7;
L8:;
       value0 = ecl_cdr(v7);
       cl_env_copy->nvalues = 1;
       return value0;
      }
     }
    }
   }
  }
 }
}
/* local function HOST-ENT-ADDRESS                                            */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5319host_ent_address(cl_object v1host_ent)
{
 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_env_copy->function=ecl_fdefinition(VV[29]))->cfun.entry(1, v1host_ent) /*  HOST-ENT-ADDRESSES */;
 value0 = ecl_car(T0);
 cl_env_copy->nvalues = 1;
 return value0;
}
static cl_object LC5319host_ent_address_va(cl_narg narg, cl_object v2host_ent, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[26]);
 {
  return LC5319host_ent_address(v2host_ent);
 }
}
/* function definition for GET-HOST-BY-NAME                                   */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5320get_host_by_name(cl_object v1host_name)
{
 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 v2;                                   /*  ERRNO                   */
  cl_object v3;                                   /*  CANONICAL-NAME          */
  cl_object v4;                                   /*  ADDRESSES               */
  cl_object v5;                                   /*  ALIASES                 */
  {
   cl_object v6;
   v6 = si_copy_to_simple_base_string(v1host_name);
   T0 = (ECL_SYM("EQUALP",338)->symbol.gfdef);
   {
    int v7;
    cl_object v8;
    cl_object v9;
    cl_object v10;
    
{
    struct addrinfo hints;
    struct addrinfo *result;
    cl_object host_name = ECL_NIL;
    cl_object aliases = ECL_NIL;
    cl_object addresses = ECL_NIL;
    int err;

    memset(&hints, 0, sizeof(hints));
    hints.ai_family = AF_INET;                     /* IPv4 */
    hints.ai_socktype = 0;                         /* Any type */
    hints.ai_protocol = 0;                         /* Any protocol */
    hints.ai_flags = (AI_CANONNAME);               /* Get cannonname */
    hints.ai_addr = NULL;
    hints.ai_next = NULL;

    ecl_disable_interrupts();
    err = getaddrinfo(ecl_base_string_pointer_safe(v6), NULL, &hints, &result);
    ecl_enable_interrupts();

    if (err == 0) {
        struct addrinfo *rp;

        for (rp = result; rp != NULL; rp = rp->ai_next) {
            if ( (rp == result) && (rp->ai_canonname != 0) ) {  /* first one may hold cannonname */
                host_name = ecl_make_simple_base_string( rp->ai_canonname, -1 );
            }
            struct sockaddr_in *ipv4 = (struct sockaddr_in *)rp->ai_addr;
            uint32_t ip = ntohl( ipv4->sin_addr.s_addr );
            cl_object vector = cl_make_array(1,ecl_make_fixnum(4));
            ecl_aset(vector,0, ecl_make_fixnum( ip>>24 ));
            ecl_aset(vector,1, ecl_make_fixnum( (ip>>16) & 0xFF));
            ecl_aset(vector,2, ecl_make_fixnum( (ip>>8) & 0xFF));
            ecl_aset(vector,3, ecl_make_fixnum( ip & 0xFF ));
            addresses = cl_adjoin(4, vector, addresses, ECL_SYM("TEST",1353), T0);
            if ( rp->ai_canonname != 0 ) {
                cl_object alias = ecl_make_simple_base_string( rp->ai_canonname, -1 );
                aliases = CONS(alias, aliases);
            }
        }
        freeaddrinfo(result);
    }
    v7= err;
    v8= host_name;
    v9= addresses;
    v10= aliases;
}
    cl_env_copy->values[0] = ecl_make_int(v7);
    cl_env_copy->values[1] = v8;
    cl_env_copy->values[2] = v9;
    cl_env_copy->values[3] = v10;cl_env_copy->nvalues = 4;
    value0 = cl_env_copy->values[0];
   }
  }
  {
   v2 = value0;
   v3 = cl_env_copy->values[1];
   v4 = cl_env_copy->values[2];
   v5 = cl_env_copy->values[3];
  }
  if (!((ecl_fixnum(v2))==((cl_fixnum)(0)))){
   goto L5;
  }
  value0 = v3;
  if (value0!=ECL_NIL) {
   goto L9;
  }
  T0 = v1host_name;
  goto L7;
L9:;
  T0 = value0;
  goto L7;
L7:;
  value0 = (cl_env_copy->function=(ECL_SYM("MAKE-INSTANCE",953)->symbol.gfdef))->cfun.entry(9, VV[25], ECL_SYM("NAME",1309), T0, VV[31], v5, ECL_SYM("TYPE",1356), ecl_cmp_symbol_value(cl_env_copy,VV[1]), VV[32], v4) /*  MAKE-INSTANCE */;
  return value0;
L5:;
  value0 = L5359name_service_error(2, VV[34], v2);
  return value0;
 }
}
static cl_object L5320get_host_by_name_va(cl_narg narg, cl_object v2host_name, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[30]);
 {
  return L5320get_host_by_name(v2host_name);
 }
}
/* function definition for GET-HOST-BY-ADDRESS                                */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5321get_host_by_address(cl_object v1address)
{
 cl_object T0, T1, T2, T3, T4, T5;
 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:;
 goto L4;
L3:;
 si_assert_failure(1, VV[37]);
L4:;
 if (!(ECL_VECTORP(v1address))){
  goto L10;
 }
 {
  cl_fixnum v2;
  v2 = ecl_length(v1address);
  if ((v2)==((cl_fixnum)(4))) {
   goto L7;
  }
  goto L8;
 }
L10:;
 goto L8;
L8:;
 goto L3;
L7:;
 {
  cl_object v2;                                   /*  ERRNO                   */
  cl_object v3;                                   /*  NAME                    */
  {
   cl_object v4;
   v4 = v1address;
   T1 = v4;
   if (ecl_unlikely(((cl_fixnum)(0))>=(v4)->vector.dim))
           FEwrong_index(ECL_NIL,v4,-1,ecl_make_fixnum((cl_fixnum)(0)),(v4)->vector.dim);
   value0 = ECL_NIL;
   cl_env_copy->nvalues = 0;
   T2 = ecl_make_int8_t(0);
   T0 = ecl_aref_unsafe(T1,ecl_fixnum(T2));
  }
  {
   cl_object v4;
   v4 = v1address;
   T2 = v4;
   if (ecl_unlikely(((cl_fixnum)(1))>=(v4)->vector.dim))
           FEwrong_index(ECL_NIL,v4,-1,ecl_make_fixnum((cl_fixnum)(1)),(v4)->vector.dim);
   value0 = ECL_NIL;
   cl_env_copy->nvalues = 0;
   T3 = ecl_make_int8_t(1);
   T1 = ecl_aref_unsafe(T2,ecl_fixnum(T3));
  }
  {
   cl_object v4;
   v4 = v1address;
   T3 = v4;
   if (ecl_unlikely(((cl_fixnum)(2))>=(v4)->vector.dim))
           FEwrong_index(ECL_NIL,v4,-1,ecl_make_fixnum((cl_fixnum)(2)),(v4)->vector.dim);
   value0 = ECL_NIL;
   cl_env_copy->nvalues = 0;
   T4 = ecl_make_int8_t(2);
   T2 = ecl_aref_unsafe(T3,ecl_fixnum(T4));
  }
  {
   cl_object v4;
   v4 = v1address;
   T4 = v4;
   if (ecl_unlikely(((cl_fixnum)(3))>=(v4)->vector.dim))
           FEwrong_index(ECL_NIL,v4,-1,ecl_make_fixnum((cl_fixnum)(3)),(v4)->vector.dim);
   value0 = ECL_NIL;
   cl_env_copy->nvalues = 0;
   T5 = ecl_make_int8_t(3);
   T3 = ecl_aref_unsafe(T4,ecl_fixnum(T5));
  }
  {
   int v4;
   cl_object v5;
   
{
    struct sockaddr_in addr;
    socklen_t addr_len = (socklen_t)sizeof(struct sockaddr_in);
    char host[NI_MAXHOST];
    int err;

    fill_inet_sockaddr(&addr, 0, ecl_to_int(T0), ecl_to_int(T1), ecl_to_int(T2), ecl_to_int(T3));

    ecl_disable_interrupts();
    err = getnameinfo((struct sockaddr *) &addr, addr_len, host, NI_MAXHOST, NULL, 0, NI_NAMEREQD);
    ecl_enable_interrupts();

    v4= err;
    v5= err ? ECL_NIL : ecl_make_simple_base_string(host,-1);
}
   cl_env_copy->values[0] = ecl_make_int(v4);
   cl_env_copy->values[1] = v5;cl_env_copy->nvalues = 2;
   value0 = cl_env_copy->values[0];
  }
  {
   v2 = value0;
   v3 = cl_env_copy->values[1];
  }
  if (!((ecl_fixnum(v2))==((cl_fixnum)(0)))){
   goto L37;
  }
  T0 = ecl_cmp_symbol_value(cl_env_copy,VV[1]);
  T1 = ecl_list1(v1address);
  value0 = (cl_env_copy->function=(ECL_SYM("MAKE-INSTANCE",953)->symbol.gfdef))->cfun.entry(9, VV[25], ECL_SYM("NAME",1309), v3, VV[31], ECL_NIL, ECL_SYM("TYPE",1356), T0, VV[32], T1) /*  MAKE-INSTANCE */;
  return value0;
L37:;
  value0 = L5359name_service_error(2, VV[40], v2);
  return value0;
 }
}
static cl_object L5321get_host_by_address_va(cl_narg narg, cl_object v2address, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[36]);
 {
  return L5321get_host_by_address(v2address);
 }
}
/* local function LAMBDA52                                                    */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5322__lambda52()
{
 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 = cl_error(1, VV[44]);
 return value0;
}
static cl_object LC5322__lambda52_va(cl_narg narg, ...)
{
 if (ecl_unlikely(narg!=0)) FEwrong_num_arguments(VV[43]);
 {
  return LC5322__lambda52();
 }
}
/* local function PRINT-OBJECT                                                */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5324print_object(cl_object v1object, cl_object v2stream)
{
 cl_object env0 = ECL_NIL;
 cl_object CLV0, CLV1;
 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(v1object,env0);               /*  OBJECT                  */
 CLV1 = env0 = CONS(v2stream,env0);               /*  STREAM                  */
 {
  cl_object v3;
  v3 = ecl_make_cclosure_va((cl_objectfn)LC5323si___print_unreadable_object_body_,env0,Cblock,0);
  value0 = si_print_unreadable_object_function(ECL_CONS_CAR(CLV0), ECL_CONS_CAR(CLV1), ECL_T, ECL_T, v3);
  return value0;
 }
}
static cl_object LC5324print_object_va(cl_narg narg, cl_object v4object, cl_object v5stream, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(ECL_SYM("PRINT-OBJECT",965));
 {
  return LC5324print_object(v4object, v5stream);
 }
}
/* local function SHARED-INITIALIZE                                           */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5325shared_initialize(cl_narg narg, cl_object v1socket, cl_object v2slot_names, ...)
{
 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);
 if (ecl_unlikely(narg<2)) FEwrong_num_arguments(ECL_SYM("SHARED-INITIALIZE",969));
 {
  cl_object v3protocol;
  cl_object v4type;
  ecl_va_list args; ecl_va_start(args,v2slot_names,narg,2);
  {
   cl_object keyvars[4];
   cl_parse_key(args,2,LC5325shared_initializekeys,keyvars,NULL,TRUE);
   ecl_va_end(args);
   v3protocol = keyvars[0];
   v4type = keyvars[1];
  }
  {
   cl_object v5proto_num;
   cl_object v6fd;
   if (Null(v3protocol)){
    goto L2;
   }
   if (Null(cl_keywordp(v3protocol))){
    goto L2;
   }
   T0 = ecl_symbol_name(v3protocol);
   T1 = cl_string_downcase(1, T0);
   v5proto_num = L5332get_protocol_by_name(T1);
   goto L1;
L2:;
   if (Null(v3protocol)){
    goto L5;
   }
   v5proto_num = v3protocol;
   goto L1;
L5:;
   v5proto_num = ecl_make_int8_t(0);
L1:;
   if (Null(cl_slot_boundp(v1socket, VV[46]))){
    goto L12;
   }
   value0 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
   goto L10;
L12:;
   value0 = ECL_NIL;
   goto L10;
L10:;
   if (value0!=ECL_NIL) {
    goto L9;
   }
   T0 = (cl_env_copy->function=ecl_fdefinition(VV[51]))->cfun.entry(1, v1socket) /*  SOCKET-FAMILY */;
   {
    cl_object v7;
    value0 = v4type;
    if (value0!=ECL_NIL) {
     goto L17;
    }
    v7 = (cl_env_copy->function=ecl_fdefinition(VV[52]))->cfun.entry(1, v1socket) /*  SOCKET-TYPE */;
    goto L15;
L17:;
    v7 = value0;
    goto L15;
L15:;
    if (!((v7)==(VV[54]))){
     goto L19;
    }
    T1 = ecl_make_int(SOCK_DGRAM);
    goto L14;
L19:;
    if (!((v7)==(ECL_SYM("STREAM",1350)))){
     goto L22;
    }
    T1 = ecl_make_int(SOCK_STREAM);
    goto L14;
L22:;
    T1 = si_ecase_error(v7, VV[56]);
   }
L14:;
   v6fd = L5314ff_socket(T0, T1, v5proto_num);
   goto L7;
L9:;
   v6fd = value0;
   goto L7;
L7:;
   if (!(ecl_number_equalp(v6fd,ecl_make_int8_t(-1)))){
    goto L25;
   }
   L5358socket_error(VV[58]);
L25:;
   (cl_env_copy->function=ECL_CONS_CAR(VV[290]))->cfun.entry(3, v6fd, v1socket, VV[46]) /*  (SETF SLOT-VALUE) */;
   value0 = (cl_env_copy->function=ECL_CONS_CAR(VV[290]))->cfun.entry(3, v5proto_num, v1socket, VV[60]) /*  (SETF SLOT-VALUE) */;
   return value0;
  }
 }
}
/* local function SOCKET-LISTEN                                               */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5326socket_listen(cl_object v1socket, cl_object v2backlog)
{
 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 v3r;
  T0 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
  v3r = L5315ff_listen(T0, v2backlog);
  if (!(ecl_number_equalp(v3r,ecl_make_int8_t(-1)))){
   goto L3;
  }
  value0 = L5358socket_error(VV[74]);
  return value0;
L3:;
  value0 = ECL_NIL;
  cl_env_copy->nvalues = 1;
  return value0;
 }
}
static cl_object LC5326socket_listen_va(cl_narg narg, cl_object v4socket, cl_object v5backlog, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[67]);
 {
  return LC5326socket_listen(v4socket, v5backlog);
 }
}
/* local function SOCKET-CLOSE-LOW-LEVEL                                      */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5327socket_close_low_level(cl_object v1socket)
{
 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_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
 value0 = L5316ff_close(T0);
 return value0;
}
static cl_object LC5327socket_close_low_level_va(cl_narg narg, cl_object v2socket, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[73]);
 {
  return LC5327socket_close_low_level(v2socket);
 }
}
/* local function SOCKET-CLOSE                                                */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5328socket_close(cl_narg narg, cl_object v1socket, ...)
{
 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[70]);
 {
  cl_object v2abort;
  ecl_va_list args; ecl_va_start(args,v1socket,narg,1);
  {
   cl_object keyvars[2];
   cl_parse_key(args,1,LC5328socket_closekeys,keyvars,NULL,TRUE);
   ecl_va_end(args);
   v2abort = keyvars[0];
  }
  {
   cl_object v3fd;
   v3fd = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
   if ((v3fd)==(ecl_make_int8_t(-1))) {
    goto L2;
   }
   if (Null(cl_slot_boundp(v1socket, ECL_SYM("STREAM",802)))){
    goto L5;
   }
   {
    cl_object v4stream;
    v4stream = cl_slot_value(v1socket, ECL_SYM("STREAM",802));
    T0 = cl_two_way_stream_input_stream(v4stream);
    cl_close(3, T0, ECL_SYM("ABORT",1225), v2abort);
    T0 = cl_two_way_stream_output_stream(v4stream);
    cl_close(3, T0, ECL_SYM("ABORT",1225), v2abort);
   }
   cl_slot_makunbound(v1socket, ECL_SYM("STREAM",802));
   goto L4;
L5:;
   T0 = (cl_env_copy->function=ecl_fdefinition(VV[73]))->cfun.entry(1, v1socket) /*  SOCKET-CLOSE-LOW-LEVEL */;
   if (!(ecl_number_equalp(T0,ecl_make_int8_t(-1)))){
    goto L4;
   }
   L5358socket_error(VV[75]);
L4:;
   value0 = (cl_env_copy->function=ECL_CONS_CAR(VV[290]))->cfun.entry(3, ecl_make_int8_t(-1), v1socket, VV[46]) /*  (SETF SLOT-VALUE) */;
   return value0;
L2:;
   value0 = ECL_NIL;
   cl_env_copy->nvalues = 1;
   return value0;
  }
 }
}
/* local function SOCKET-RECEIVE                                              */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5329socket_receive(cl_narg narg, cl_object v1socket, cl_object v2buffer, cl_object v3length, ...)
{
 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<3)) FEwrong_num_arguments(VV[68]);
 {
  cl_object v4oob;
  cl_object v5peek;
  cl_object v6waitall;
  cl_object v7element_type;
  ecl_va_list args; ecl_va_start(args,v3length,narg,3);
  {
   cl_object keyvars[8];
   cl_parse_key(args,4,LC5329socket_receivekeys,keyvars,NULL,TRUE);
   ecl_va_end(args);
   v4oob = keyvars[0];
   v5peek = keyvars[1];
   v6waitall = keyvars[2];
   if (Null(keyvars[7])) {
    v7element_type = ECL_SYM("BYTE8",1368);
   } else {
    v7element_type = keyvars[3];
   }
  }
  if (v2buffer!=ECL_NIL) {
   goto L2;
  }
  if (v3length!=ECL_NIL) {
   goto L2;
  }
  cl_error(1, VV[76]);
L2:;
  {
   cl_object v8;
   cl_object v9;
   cl_object v10;
   cl_object v11;
   cl_object v12buffer;
   cl_object v13length;
   cl_object v14fd;
   cl_object v15trunc;
   value0 = v2buffer;
   if (value0!=ECL_NIL) {
    goto L7;
   }
   v8 = si_make_pure_array(v7element_type, v3length, ECL_NIL, ECL_NIL, ECL_NIL, ecl_make_int8_t(0));
   goto L5;
L7:;
   v8 = value0;
   goto L5;
L5:;
   value0 = v3length;
   if (value0!=ECL_NIL) {
    goto L11;
   }
   v9 = ecl_make_fixnum(ecl_length(v2buffer));
   goto L9;
L11:;
   v9 = value0;
   goto L9;
L9:;
   v10 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
   T0 = (cl_env_copy->function=ecl_fdefinition(VV[52]))->cfun.entry(1, v1socket) /*  SOCKET-TYPE */;
   if (!((T0)==(VV[54]))){
    goto L15;
   }
   v11 = ECL_T;
   goto L14;
L15:;
   v11 = ECL_NIL;
L14:;
   v12buffer = v8;
   v13length = v9;
   v14fd = v10;
   v15trunc = v11;
   {
    cl_object v16;                                /*  LEN-RECV                */
    cl_object v17;                                /*  ERRNO                   */
    cl_object v18;                                /*  VECTOR                  */
    cl_object v19;                                /*  PORT                    */
    {
     long v20;
     int v21;
     cl_object v22;
     int v23;
     
{
        int flags = ( (v4oob)!=ECL_NIL ? MSG_OOB : 0 )  |
                    ( (v5peek)!=ECL_NIL ? MSG_PEEK : 0 ) |
                    ( (v6waitall)!=ECL_NIL ? MSG_WAITALL : 0 ) |
                    ( (v15trunc)!=ECL_NIL ? MSG_TRUNC : 0 );
        cl_type type = ecl_t_of(v12buffer);
        ssize_t len;
        struct sockaddr_in sender;
        socklen_t addr_len = (socklen_t)sizeof(struct sockaddr_in);

        ecl_disable_interrupts();
        len = recvfrom(ecl_to_int(v14fd), wincoerce(char*, safe_buffer_pointer(v12buffer, ecl_to_int(v13length))),
                       ecl_to_int(v13length), flags, (struct sockaddr *)&sender, &addr_len);
        ecl_enable_interrupts();
        if (len >= 0) {
               if (type == t_vector) { v12buffer->vector.fillp = len; }
               else if (type == t_base_string) { v12buffer->base_string.fillp = len; }
        }
        v20= len;
        v21= errno;
        v22= ECL_NIL;
        v23= 0;

        if (len >= 0) {
                uint32_t ip = ntohl(sender.sin_addr.s_addr);
                uint16_t port = ntohs(sender.sin_port);
                cl_object vector = cl_make_array(1,ecl_make_fixnum(4));

                ecl_aset(vector,0, ecl_make_fixnum( ip>>24 ));
                ecl_aset(vector,1, ecl_make_fixnum( (ip>>16) & 0xFF));
                ecl_aset(vector,2, ecl_make_fixnum( (ip>>8) & 0xFF));
                ecl_aset(vector,3, ecl_make_fixnum( ip & 0xFF ));

                v22= vector;
                v23= port;
        }
}

     cl_env_copy->values[0] = ecl_make_long(v20);
     cl_env_copy->values[1] = ecl_make_int(v21);
     cl_env_copy->values[2] = v22;
     cl_env_copy->values[3] = ecl_make_int(v23);cl_env_copy->nvalues = 4;
     value0 = cl_env_copy->values[0];
    }
    {
     v16 = value0;
     v17 = cl_env_copy->values[1];
     v18 = cl_env_copy->values[2];
     v19 = cl_env_copy->values[3];
    }
    if (!(ecl_number_equalp(v16,ecl_make_int8_t(-1)))){
     goto L22;
    }
    {
     cl_object v20;
     cl_object v21;
     cl_object v22;
     v20 = cl_list(2, ecl_cmp_symbol_value(cl_env_copy,VV[4]), ecl_cmp_symbol_value(cl_env_copy,VV[5]));
     v21 = v17;
     v22 = v20;
     if (Null(ecl_memql(v21,v22))){
      goto L22;
     }
    }
    value0 = ECL_NIL;
    cl_env_copy->nvalues = 1;
    return value0;
L22:;
    if (!(ecl_number_equalp(v16,ecl_make_int8_t(-1)))){
     goto L28;
    }
    value0 = L5358socket_error(VV[77]);
    return value0;
L28:;
    cl_env_copy->nvalues = 4;
    cl_env_copy->values[3] = v19;
    cl_env_copy->values[2] = v18;
    cl_env_copy->values[1] = v16;
    cl_env_copy->values[0] = v12buffer;
    return cl_env_copy->values[0];
   }
  }
 }
}
/* local function LAMBDA142                                                   */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5331__lambda142()
{
 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 v1;
  v1 = ecl_make_cfun_va((cl_objectfn)LC5330__lambda144_va,ECL_NIL,Cblock,2);
  value0 = v1;
  cl_env_copy->nvalues = 1;
  return value0;
 }
}
static cl_object LC5331__lambda142_va(cl_narg narg, ...)
{
 if (ecl_unlikely(narg!=0)) FEwrong_num_arguments(VV[79]);
 {
  return LC5331__lambda142();
 }
}
/* function definition for GET-PROTOCOL-BY-NAME                               */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5332get_protocol_by_name(cl_object v1string_or_symbol)
{
 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 v2string;
  cl_fixnum v3proto_num;
  v2string = cl_string(v1string_or_symbol);
  {
   cl_object v4;
   v4 = si_copy_to_simple_base_string(v2string);
   {
    int v5;
    {
                                 struct protoent *pe;
                                 pe = getprotobyname(ecl_base_string_pointer_safe(v4));
                                 v5= pe ? pe->p_proto : -1;
                               }
               
    v3proto_num = (cl_fixnum)(v5);
   }
  }
  if (!((v3proto_num)==((cl_fixnum)(-1)))){
   goto L5;
  }
  value0 = cl_error(3, VV[78], ECL_SYM("NAME",1309), v2string);
  return value0;
L5:;
  value0 = ecl_make_fixnum(v3proto_num);
  cl_env_copy->nvalues = 1;
  return value0;
 }
}
static cl_object L5332get_protocol_by_name_va(cl_narg narg, cl_object v4string_or_symbol, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[49]);
 {
  return L5332get_protocol_by_name(v4string_or_symbol);
 }
}
/* function definition for MAKE-INET-ADDRESS                                  */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5333make_inet_address(cl_object v1dotted_quads)
{
 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 = (ECL_SYM("PARSE-INTEGER",630)->symbol.gfdef);
 T1 = L5318split(3, v1dotted_quads, ECL_NIL, VV[85]);
 value0 = cl_map(3, ECL_SYM("VECTOR",902), T0, T1);
 return value0;
}
static cl_object L5333make_inet_address_va(cl_narg narg, cl_object v2dotted_quads, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[84]);
 {
  return L5333make_inet_address(v2dotted_quads);
 }
}
/* local function LAMBDA149                                                   */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5334__lambda149()
{
 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_cmp_symbol_value(cl_env_copy,VV[1]);
 cl_env_copy->nvalues = 1;
 return value0;
}
static cl_object LC5334__lambda149_va(cl_narg narg, ...)
{
 if (ecl_unlikely(narg!=0)) FEwrong_num_arguments(VV[88]);
 {
  return LC5334__lambda149();
 }
}
/* function definition for MAKE-INET-SOCKET                                   */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5335make_inet_socket(cl_object v1type, cl_object v2protocol)
{
 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 = (cl_env_copy->function=(ECL_SYM("MAKE-INSTANCE",953)->symbol.gfdef))->cfun.entry(5, VV[87], ECL_SYM("TYPE",1356), v1type, VV[90], v2protocol) /*  MAKE-INSTANCE */;
 return value0;
}
static cl_object L5335make_inet_socket_va(cl_narg narg, cl_object v3type, cl_object v4protocol, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[89]);
 {
  return L5335make_inet_socket(v3type, v4protocol);
 }
}
/* local function SOCKET-BIND                                                 */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5336socket_bind(cl_narg narg, cl_object v1socket, ...)
{
 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);
 if (ecl_unlikely(narg<1)) FEwrong_num_arguments(VV[61]);
 {
  cl_object v2address;
  ecl_va_list args; ecl_va_start(args,v1socket,narg,1);
  v2address = cl_grab_rest_args(args);
  ecl_va_end(args);
  goto L3;
L2:;
  {
   cl_object v3;
   T0 = ecl_list1(v2address);
   v3 = si_assert_failure(4, VV[92], VV[93], T0, VV[94]);
   v2address = v3;
  }
L3:;
  {
   cl_fixnum v3;
   v3 = ecl_length(v2address);
   if (((cl_fixnum)(2))==(v3)) {
    goto L9;
   }
  }
  goto L2;
L9:;
  {
   cl_object v3;
   cl_object v4;
   cl_object v5port;
   v3 = ecl_car(v2address);
   v4 = ecl_cadr(v2address);
   v5port = v4;
   {
    cl_object v6;
    v6 = v3;
    T2 = v6;
    if (ecl_unlikely(((cl_fixnum)(0))>=(v6)->vector.dim))
           FEwrong_index(ECL_NIL,v6,-1,ecl_make_fixnum((cl_fixnum)(0)),(v6)->vector.dim);
    value0 = ECL_NIL;
    cl_env_copy->nvalues = 0;
    T3 = ecl_make_int8_t(0);
    T1 = ecl_aref_unsafe(T2,ecl_fixnum(T3));
   }
   {
    cl_object v6;
    v6 = v3;
    T3 = v6;
    if (ecl_unlikely(((cl_fixnum)(1))>=(v6)->vector.dim))
           FEwrong_index(ECL_NIL,v6,-1,ecl_make_fixnum((cl_fixnum)(1)),(v6)->vector.dim);
    value0 = ECL_NIL;
    cl_env_copy->nvalues = 0;
    T4 = ecl_make_int8_t(1);
    T2 = ecl_aref_unsafe(T3,ecl_fixnum(T4));
   }
   {
    cl_object v6;
    v6 = v3;
    T4 = v6;
    if (ecl_unlikely(((cl_fixnum)(2))>=(v6)->vector.dim))
           FEwrong_index(ECL_NIL,v6,-1,ecl_make_fixnum((cl_fixnum)(2)),(v6)->vector.dim);
    value0 = ECL_NIL;
    cl_env_copy->nvalues = 0;
    T5 = ecl_make_int8_t(2);
    T3 = ecl_aref_unsafe(T4,ecl_fixnum(T5));
   }
   {
    cl_object v6;
    v6 = v3;
    T5 = v6;
    if (ecl_unlikely(((cl_fixnum)(3))>=(v6)->vector.dim))
           FEwrong_index(ECL_NIL,v6,-1,ecl_make_fixnum((cl_fixnum)(3)),(v6)->vector.dim);
    value0 = ECL_NIL;
    cl_env_copy->nvalues = 0;
    T6 = ecl_make_int8_t(3);
    T4 = ecl_aref_unsafe(T5,ecl_fixnum(T6));
   }
   T5 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
   {
    int v6;
    
{
        struct sockaddr_in sockaddr;
        int output;
        ecl_disable_interrupts();
        fill_inet_sockaddr(&sockaddr, ecl_to_int(v5port), ecl_to_int(T1), ecl_to_int(T2), ecl_to_int(T3), ecl_to_int(T4));
        output = bind(ecl_to_int(T5),(struct sockaddr*)&sockaddr, sizeof(struct sockaddr_in));
        ecl_enable_interrupts();
        v6= output;
}
    T0 = ecl_make_int(v6);
   }
   if (!(((cl_fixnum)(-1))==(ecl_fixnum(T0)))){
    goto L14;
   }
   value0 = L5358socket_error(VV[95]);
   return value0;
L14:;
   value0 = ECL_NIL;
   cl_env_copy->nvalues = 1;
   return value0;
  }
 }
}
/* local function SOCKET-ACCEPT                                               */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5337socket_accept(cl_object v1socket)
{
 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 v2sfd;
  v2sfd = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
  {
   cl_object v3;                                  /*  FD                      */
   cl_object v4;                                  /*  VECTOR                  */
   cl_object v5;                                  /*  PORT                    */
   {
    int v6;
    cl_object v7;
    int v8;
    {
        struct sockaddr_in sockaddr;
        socklen_t addr_len = (socklen_t)sizeof(struct sockaddr_in);
        int new_fd;

        ecl_disable_interrupts();
        new_fd = accept(ecl_to_int(v2sfd), (struct sockaddr*)&sockaddr, &addr_len);
        ecl_enable_interrupts();

        v6= new_fd;
        v7= ECL_NIL;
        v8= 0;
        if (new_fd != -1) {
                uint32_t ip = ntohl(sockaddr.sin_addr.s_addr);
                uint16_t port = ntohs(sockaddr.sin_port);
                cl_object vector = cl_make_array(1,ecl_make_fixnum(4));

                ecl_aset(vector,0, ecl_make_fixnum( ip>>24 ));
                ecl_aset(vector,1, ecl_make_fixnum( (ip>>16) & 0xFF));
                ecl_aset(vector,2, ecl_make_fixnum( (ip>>8) & 0xFF));
                ecl_aset(vector,3, ecl_make_fixnum( ip & 0xFF ));

                v7= vector;
                v8= port;
        }
}
    cl_env_copy->values[0] = ecl_make_int(v6);
    cl_env_copy->values[1] = v7;
    cl_env_copy->values[2] = ecl_make_int(v8);cl_env_copy->nvalues = 3;
    value0 = cl_env_copy->values[0];
   }
   {
    v3 = value0;
    v4 = cl_env_copy->values[1];
    v5 = cl_env_copy->values[2];
   }
   if (!((ecl_fixnum(v3))==((cl_fixnum)(-1)))){
    goto L4;
   }
   value0 = L5358socket_error(VV[96]);
   return value0;
L4:;
   T0 = cl_class_of(v1socket);
   T1 = (cl_env_copy->function=ecl_fdefinition(VV[52]))->cfun.entry(1, v1socket) /*  SOCKET-TYPE */;
   T2 = (cl_env_copy->function=ecl_fdefinition(VV[97]))->cfun.entry(1, v1socket) /*  SOCKET-PROTOCOL */;
   T3 = (cl_env_copy->function=(ECL_SYM("MAKE-INSTANCE",953)->symbol.gfdef))->cfun.entry(7, T0, ECL_SYM("TYPE",1356), T1, VV[90], T2, VV[98], v3) /*  MAKE-INSTANCE */;
   cl_env_copy->nvalues = 3;
   cl_env_copy->values[2] = v5;
   cl_env_copy->values[1] = v4;
   cl_env_copy->values[0] = T3;
   return cl_env_copy->values[0];
  }
 }
}
static cl_object LC5337socket_accept_va(cl_narg narg, cl_object v3socket, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[62]);
 {
  return LC5337socket_accept(v3socket);
 }
}
/* local function SOCKET-CONNECT                                              */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5338socket_connect(cl_narg narg, cl_object v1socket, ...)
{
 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);
 if (ecl_unlikely(narg<1)) FEwrong_num_arguments(VV[64]);
 {
  cl_object v2address;
  ecl_va_list args; ecl_va_start(args,v1socket,narg,1);
  v2address = cl_grab_rest_args(args);
  ecl_va_end(args);
  {
   cl_object v3;
   cl_object v4;
   cl_object v5port;
   v3 = ecl_car(v2address);
   v4 = ecl_cadr(v2address);
   v5port = v4;
   {
    cl_object v6;
    v6 = v3;
    T2 = v6;
    if (ecl_unlikely(((cl_fixnum)(0))>=(v6)->vector.dim))
           FEwrong_index(ECL_NIL,v6,-1,ecl_make_fixnum((cl_fixnum)(0)),(v6)->vector.dim);
    value0 = ECL_NIL;
    cl_env_copy->nvalues = 0;
    T3 = ecl_make_int8_t(0);
    T1 = ecl_aref_unsafe(T2,ecl_fixnum(T3));
   }
   {
    cl_object v6;
    v6 = v3;
    T3 = v6;
    if (ecl_unlikely(((cl_fixnum)(1))>=(v6)->vector.dim))
           FEwrong_index(ECL_NIL,v6,-1,ecl_make_fixnum((cl_fixnum)(1)),(v6)->vector.dim);
    value0 = ECL_NIL;
    cl_env_copy->nvalues = 0;
    T4 = ecl_make_int8_t(1);
    T2 = ecl_aref_unsafe(T3,ecl_fixnum(T4));
   }
   {
    cl_object v6;
    v6 = v3;
    T4 = v6;
    if (ecl_unlikely(((cl_fixnum)(2))>=(v6)->vector.dim))
           FEwrong_index(ECL_NIL,v6,-1,ecl_make_fixnum((cl_fixnum)(2)),(v6)->vector.dim);
    value0 = ECL_NIL;
    cl_env_copy->nvalues = 0;
    T5 = ecl_make_int8_t(2);
    T3 = ecl_aref_unsafe(T4,ecl_fixnum(T5));
   }
   {
    cl_object v6;
    v6 = v3;
    T5 = v6;
    if (ecl_unlikely(((cl_fixnum)(3))>=(v6)->vector.dim))
           FEwrong_index(ECL_NIL,v6,-1,ecl_make_fixnum((cl_fixnum)(3)),(v6)->vector.dim);
    value0 = ECL_NIL;
    cl_env_copy->nvalues = 0;
    T6 = ecl_make_int8_t(3);
    T4 = ecl_aref_unsafe(T5,ecl_fixnum(T6));
   }
   T5 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
   {
    int v6;
    
{
        struct sockaddr_in sockaddr;
        int output;

        ecl_disable_interrupts();
        fill_inet_sockaddr(&sockaddr, ecl_to_int(v5port), ecl_to_int(T1), ecl_to_int(T2), ecl_to_int(T3), ecl_to_int(T4));
        output = connect(ecl_to_int(T5),(struct sockaddr*)&sockaddr, sizeof(struct sockaddr_in));
        ecl_enable_interrupts();

        v6= output;
}
    T0 = ecl_make_int(v6);
   }
   if (!(((cl_fixnum)(-1))==(ecl_fixnum(T0)))){
    goto L4;
   }
   value0 = L5358socket_error(VV[99]);
   return value0;
L4:;
   value0 = ECL_NIL;
   cl_env_copy->nvalues = 1;
   return value0;
  }
 }
}
/* local function SOCKET-PEERNAME                                             */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5339socket_peername(cl_object v1socket)
{
 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 v2vector;
  cl_object v3fd;
  cl_fixnum v4port;
  v2vector = si_make_vector(ECL_T, ecl_make_int8_t(4), ECL_NIL, ECL_NIL, ECL_NIL, ecl_make_int8_t(0));
  v3fd = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
  {
   int v5;
   {
        struct sockaddr_in name;
        socklen_t len = sizeof(struct sockaddr_in);
        int ret;

        ecl_disable_interrupts();
        ret = getpeername(ecl_to_int(v3fd),(struct sockaddr*)&name,&len);
        ecl_enable_interrupts();

        if (ret == 0) {
                uint32_t ip = ntohl(name.sin_addr.s_addr);
                uint16_t port = ntohs(name.sin_port);

                ecl_aset(v2vector,0, ecl_make_fixnum( ip>>24 ));
                ecl_aset(v2vector,1, ecl_make_fixnum( (ip>>16) & 0xFF));
                ecl_aset(v2vector,2, ecl_make_fixnum( (ip>>8) & 0xFF));
                ecl_aset(v2vector,3, ecl_make_fixnum( ip & 0xFF ));

                v5= port;
         } else {
                v5= -1;
         }
}
   v4port = (cl_fixnum)(v5);
  }
  if (!((v4port)>=((cl_fixnum)(0)))){
   goto L5;
  }
  cl_env_copy->nvalues = 2;
  cl_env_copy->values[1] = ecl_make_fixnum(v4port);
  cl_env_copy->values[0] = v2vector;
  return cl_env_copy->values[0];
L5:;
  value0 = L5358socket_error(VV[100]);
  return value0;
 }
}
static cl_object LC5339socket_peername_va(cl_narg narg, cl_object v5socket, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[65]);
 {
  return LC5339socket_peername(v5socket);
 }
}
/* local function SOCKET-NAME                                                 */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5340socket_name(cl_object v1socket)
{
 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 v2vector;
  cl_object v3fd;
  cl_fixnum v4port;
  v2vector = si_make_vector(ECL_T, ecl_make_int8_t(4), ECL_NIL, ECL_NIL, ECL_NIL, ecl_make_int8_t(0));
  v3fd = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
  {
   int v5;
   {
        struct sockaddr_in name;
        socklen_t len = sizeof(struct sockaddr_in);
        int ret;

        ecl_disable_interrupts();
        ret = getsockname(ecl_to_int(v3fd),(struct sockaddr*)&name,&len);
        ecl_enable_interrupts();

        if (ret == 0) {
                uint32_t ip = ntohl(name.sin_addr.s_addr);
                uint16_t port = ntohs(name.sin_port);

                ecl_aset(v2vector,0, ecl_make_fixnum( ip>>24 ));
                ecl_aset(v2vector,1, ecl_make_fixnum( (ip>>16) & 0xFF));
                ecl_aset(v2vector,2, ecl_make_fixnum( (ip>>8) & 0xFF));
                ecl_aset(v2vector,3, ecl_make_fixnum( ip & 0xFF ));

                v5= port;
         } else {
                v5= -1;
         }
}
   v4port = (cl_fixnum)(v5);
  }
  if (!((v4port)>=((cl_fixnum)(0)))){
   goto L5;
  }
  cl_env_copy->nvalues = 2;
  cl_env_copy->values[1] = ecl_make_fixnum(v4port);
  cl_env_copy->values[0] = v2vector;
  return cl_env_copy->values[0];
L5:;
  value0 = L5358socket_error(VV[101]);
  return value0;
 }
}
static cl_object LC5340socket_name_va(cl_narg narg, cl_object v5socket, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[66]);
 {
  return LC5340socket_name(v5socket);
 }
}
/* local function SOCKET-SEND                                                 */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5341socket_send(cl_narg narg, cl_object v1socket, cl_object v2buffer, cl_object v3length, ...)
{
 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);
 if (ecl_unlikely(narg<3)) FEwrong_num_arguments(VV[69]);
 {
  cl_object v4address;
  cl_object v5external_format;
  cl_object v6oob;
  cl_object v7eor;
  cl_object v8dontroute;
  cl_object v9dontwait;
  cl_object v10nosignal;
  cl_object v11confirm;
  cl_object v12more;
  ecl_va_list args; ecl_va_start(args,v3length,narg,3);
  {
   cl_object keyvars[18];
   cl_parse_key(args,9,LC5341socket_sendkeys,keyvars,NULL,TRUE);
   ecl_va_end(args);
   v4address = keyvars[0];
   v5external_format = keyvars[1];
   v6oob = keyvars[2];
   v7eor = keyvars[3];
   v8dontroute = keyvars[4];
   v9dontwait = keyvars[5];
   v10nosignal = keyvars[6];
   v11confirm = keyvars[7];
   v12more = keyvars[8];
  }
  goto L3;
L2:;
  si_assert_failure(1, VV[102]);
L3:;
  if (ECL_STRINGP(v2buffer)) {
   goto L6;
  }
  if (ECL_VECTORP(v2buffer)) {
   goto L6;
  }
  goto L2;
L6:;
  {
   cl_object v13;
   cl_object v14;
   cl_object v15length;
   cl_object v16fd;
   value0 = v3length;
   if (value0!=ECL_NIL) {
    goto L11;
   }
   v13 = ecl_make_fixnum(ecl_length(v2buffer));
   goto L9;
L11:;
   v13 = value0;
   goto L9;
L9:;
   v14 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
   v15length = v13;
   v16fd = v14;
   {
    long v17len_sent;
    if (Null(v4address)){
     goto L17;
    }
    goto L21;
L20:;
    si_assert_failure(1, VV[92]);
L21:;
    {
     cl_fixnum v18;
     v18 = ecl_length(v4address);
     if (((cl_fixnum)(2))==(v18)) {
      goto L24;
     }
    }
    goto L20;
L24:;
    T0 = ecl_cadr(v4address);
    {
     cl_object v18;
     v18 = ecl_car(v4address);
     T2 = v18;
     if (ecl_unlikely(((cl_fixnum)(0))>=(v18)->vector.dim))
           FEwrong_index(ECL_NIL,v18,-1,ecl_make_fixnum((cl_fixnum)(0)),(v18)->vector.dim);
     value0 = ECL_NIL;
     cl_env_copy->nvalues = 0;
     T3 = ecl_make_int8_t(0);
     T1 = ecl_aref_unsafe(T2,ecl_fixnum(T3));
    }
    {
     cl_object v18;
     v18 = ecl_car(v4address);
     T3 = v18;
     if (ecl_unlikely(((cl_fixnum)(1))>=(v18)->vector.dim))
           FEwrong_index(ECL_NIL,v18,-1,ecl_make_fixnum((cl_fixnum)(1)),(v18)->vector.dim);
     value0 = ECL_NIL;
     cl_env_copy->nvalues = 0;
     T4 = ecl_make_int8_t(1);
     T2 = ecl_aref_unsafe(T3,ecl_fixnum(T4));
    }
    {
     cl_object v18;
     v18 = ecl_car(v4address);
     T4 = v18;
     if (ecl_unlikely(((cl_fixnum)(2))>=(v18)->vector.dim))
           FEwrong_index(ECL_NIL,v18,-1,ecl_make_fixnum((cl_fixnum)(2)),(v18)->vector.dim);
     value0 = ECL_NIL;
     cl_env_copy->nvalues = 0;
     T5 = ecl_make_int8_t(2);
     T3 = ecl_aref_unsafe(T4,ecl_fixnum(T5));
    }
    {
     cl_object v18;
     v18 = ecl_car(v4address);
     T5 = v18;
     if (ecl_unlikely(((cl_fixnum)(3))>=(v18)->vector.dim))
           FEwrong_index(ECL_NIL,v18,-1,ecl_make_fixnum((cl_fixnum)(3)),(v18)->vector.dim);
     value0 = ECL_NIL;
     cl_env_copy->nvalues = 0;
     T6 = ecl_make_int8_t(3);
     T4 = ecl_aref_unsafe(T5,ecl_fixnum(T6));
    }
    {
     long v18;
     
{
        int sock = ecl_to_int(v16fd);
        int length = ecl_to_int(v15length);
        void *buffer = safe_buffer_pointer(v2buffer, length);
        int flags = ( (v6oob)!=ECL_NIL ? MSG_OOB : 0 )  |
                    ( (v7eor)!=ECL_NIL ? MSG_EOR : 0 ) |
                    ( (v8dontroute)!=ECL_NIL ? MSG_DONTROUTE : 0 ) |
                    ( (v9dontwait)!=ECL_NIL ? MSG_DONTWAIT : 0 ) |
                    ( (v10nosignal)!=ECL_NIL ? MSG_NOSIGNAL : 0 ) |
                    ( (v11confirm)!=ECL_NIL ? MSG_CONFIRM : 0 );
        cl_type type = ecl_t_of(v2buffer);
        struct sockaddr_in sockaddr;
        ssize_t len;

        ecl_disable_interrupts();
        fill_inet_sockaddr(&sockaddr, ecl_to_int(T0), ecl_to_int(T1), ecl_to_int(T2), ecl_to_int(T3), ecl_to_int(T4));
#if (MSG_NOSIGNAL == 0) && defined(SO_NOSIGPIPE)
        {
                int sockopt = (v10nosignal)!=ECL_NIL;
                setsockopt(ecl_to_int(v16fd),SOL_SOCKET,SO_NOSIGPIPE,
                           wincoerce(char *,&sockopt),
                           sizeof(int));
        }
#endif
        len = sendto(sock, wincoerce(char *,buffer),
                     length, flags,(struct sockaddr*)&sockaddr, 
                     sizeof(struct sockaddr_in));
        ecl_enable_interrupts();
        v18= len;
}

     v17len_sent = v18;
     goto L16;
    }
L17:;
    {
     long v18;
     
{
        int sock = ecl_to_int(v16fd);
        int length = ecl_to_int(v15length);
        void *buffer = safe_buffer_pointer(v2buffer, length);
        int flags = ( (v6oob)!=ECL_NIL ? MSG_OOB : 0 )  |
                    ( (v7eor)!=ECL_NIL ? MSG_EOR : 0 ) |
                    ( (v8dontroute)!=ECL_NIL ? MSG_DONTROUTE : 0 ) |
                    ( (v9dontwait)!=ECL_NIL ? MSG_DONTWAIT : 0 ) |
                    ( (v10nosignal)!=ECL_NIL ? MSG_NOSIGNAL : 0 ) |
                    ( (v11confirm)!=ECL_NIL ? MSG_CONFIRM : 0 );
        cl_type type = ecl_t_of(v2buffer);
        ssize_t len;
        ecl_disable_interrupts();
#if (MSG_NOSIGNAL == 0) && defined(SO_NOSIGPIPE)
        {
                int sockopt = (v10nosignal)!=ECL_NIL;
                setsockopt(ecl_to_int(v16fd),SOL_SOCKET,SO_NOSIGPIPE,
                           wincoerce(char *,&sockopt),
                           sizeof(int));
        }
#endif
        len = send(sock, wincoerce(char *, buffer), length, flags);
        ecl_enable_interrupts();
        v18= len;
}

     v17len_sent = v18;
    }
L16:;
    if (!(ecl_number_equalp(ecl_make_long(v17len_sent),ecl_make_int8_t(-1)))){
     goto L50;
    }
    value0 = L5358socket_error(VV[103]);
    return value0;
L50:;
    value0 = ecl_make_long(v17len_sent);
    cl_env_copy->nvalues = 1;
    return value0;
   }
  }
 }
}
/* local function LAMBDA205                                                   */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5342__lambda205()
{
 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_cmp_symbol_value(cl_env_copy,VV[3]);
 cl_env_copy->nvalues = 1;
 return value0;
}
static cl_object LC5342__lambda205_va(cl_narg narg, ...)
{
 if (ecl_unlikely(narg!=0)) FEwrong_num_arguments(VV[105]);
 {
  return LC5342__lambda205();
 }
}
/* local function SOCKET-BIND                                                 */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5343socket_bind(cl_narg narg, cl_object v1socket, ...)
{
 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[61]);
 {
  cl_object v2address;
  ecl_va_list args; ecl_va_start(args,v1socket,narg,1);
  v2address = cl_grab_rest_args(args);
  ecl_va_end(args);
  goto L3;
L2:;
  {
   cl_object v3;
   T0 = ecl_list1(v2address);
   v3 = si_assert_failure(4, VV[106], VV[93], T0, VV[107]);
   v2address = v3;
  }
L3:;
  {
   cl_fixnum v3;
   v3 = ecl_length(v2address);
   if (((cl_fixnum)(1))==(v3)) {
    goto L9;
   }
  }
  goto L2;
L9:;
  {
   cl_object v3;
   cl_object v4;
   cl_object v5;
   cl_object v6fd;
   cl_object v7family;
   v3 = ecl_car(v2address);
   v4 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
   v5 = (cl_env_copy->function=ecl_fdefinition(VV[51]))->cfun.entry(1, v1socket) /*  SOCKET-FAMILY */;
   v6fd = v4;
   v7family = v5;
   {
    cl_object v8;
    v8 = si_copy_to_simple_base_string(v3);
    {
     int v9;
     
{
        struct sockaddr_un sockaddr;
        size_t size;
        int output;
#ifdef BSD
        sockaddr.sun_len = sizeof(struct sockaddr_un);
#endif
        sockaddr.sun_family = ecl_to_int(v7family);
        strncpy(sockaddr.sun_path,ecl_base_string_pointer_safe(v8),sizeof(sockaddr.sun_path));
        sockaddr.sun_path[sizeof(sockaddr.sun_path)-1] = 0;

        ecl_disable_interrupts();
        output = bind(ecl_to_int(v6fd),(struct sockaddr*)&sockaddr, sizeof(struct sockaddr_un));
        ecl_enable_interrupts();

        v9= output;
}
     T0 = ecl_make_int(v9);
    }
   }
   if (!(((cl_fixnum)(-1))==(ecl_fixnum(T0)))){
    goto L16;
   }
   value0 = L5358socket_error(VV[95]);
   return value0;
L16:;
   value0 = ECL_NIL;
   cl_env_copy->nvalues = 1;
   return value0;
  }
 }
}
/* local function SOCKET-ACCEPT                                               */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5344socket_accept(cl_object v1socket)
{
 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 v2;                                   /*  FD                      */
  cl_object v3;                                   /*  NAME                    */
  T0 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
  {
   int v4;
   cl_object v5;
   {
        struct sockaddr_un sockaddr;
        socklen_t addr_len = (socklen_t)sizeof(struct sockaddr_un);
        int new_fd;
        ecl_disable_interrupts();
        new_fd = accept(ecl_to_int(T0), (struct sockaddr *)&sockaddr, &addr_len);
        ecl_enable_interrupts();
        v4= new_fd;
        v5= (new_fd == -1) ? ECL_NIL : ecl_make_simple_base_string(sockaddr.sun_path,-1);
}
   cl_env_copy->values[0] = ecl_make_int(v4);
   cl_env_copy->values[1] = v5;cl_env_copy->nvalues = 2;
   value0 = cl_env_copy->values[0];
  }
  {
   v2 = value0;
   v3 = cl_env_copy->values[1];
  }
  if (!((ecl_fixnum(v2))==((cl_fixnum)(-1)))){
   goto L3;
  }
  value0 = L5358socket_error(VV[96]);
  return value0;
L3:;
  T0 = cl_class_of(v1socket);
  T1 = (cl_env_copy->function=ecl_fdefinition(VV[52]))->cfun.entry(1, v1socket) /*  SOCKET-TYPE */;
  T2 = (cl_env_copy->function=ecl_fdefinition(VV[97]))->cfun.entry(1, v1socket) /*  SOCKET-PROTOCOL */;
  T3 = (cl_env_copy->function=(ECL_SYM("MAKE-INSTANCE",953)->symbol.gfdef))->cfun.entry(7, T0, ECL_SYM("TYPE",1356), T1, VV[90], T2, VV[98], v2) /*  MAKE-INSTANCE */;
  cl_env_copy->nvalues = 2;
  cl_env_copy->values[1] = v3;
  cl_env_copy->values[0] = T3;
  return cl_env_copy->values[0];
 }
}
static cl_object LC5344socket_accept_va(cl_narg narg, cl_object v2socket, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[62]);
 {
  return LC5344socket_accept(v2socket);
 }
}
/* local function SOCKET-CONNECT                                              */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5345socket_connect(cl_narg narg, cl_object v1socket, ...)
{
 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[64]);
 {
  cl_object v2address;
  ecl_va_list args; ecl_va_start(args,v1socket,narg,1);
  v2address = cl_grab_rest_args(args);
  ecl_va_end(args);
  goto L3;
L2:;
  {
   cl_object v3;
   T0 = ecl_list1(v2address);
   v3 = si_assert_failure(4, VV[106], VV[93], T0, VV[108]);
   v2address = v3;
  }
L3:;
  {
   cl_fixnum v3;
   v3 = ecl_length(v2address);
   if (((cl_fixnum)(1))==(v3)) {
    goto L9;
   }
  }
  goto L2;
L9:;
  {
   cl_object v3;
   cl_object v4;
   cl_object v5;
   cl_object v6fd;
   cl_object v7family;
   v3 = ecl_car(v2address);
   v4 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
   v5 = (cl_env_copy->function=ecl_fdefinition(VV[51]))->cfun.entry(1, v1socket) /*  SOCKET-FAMILY */;
   v6fd = v4;
   v7family = v5;
   {
    cl_object v8;
    v8 = si_copy_to_simple_base_string(v3);
    {
     int v9;
     
{
        struct sockaddr_un sockaddr;
        int output;
#ifdef BSD
        sockaddr.sun_len = sizeof(struct sockaddr_un);
#endif
        sockaddr.sun_family = ecl_to_int(v7family);
        strncpy(sockaddr.sun_path,ecl_base_string_pointer_safe(v8),sizeof(sockaddr.sun_path));
        sockaddr.sun_path[sizeof(sockaddr.sun_path)-1] = 0;

        ecl_disable_interrupts();
        output = connect(ecl_to_int(v6fd),(struct sockaddr*)&sockaddr, sizeof(struct sockaddr_un));
        ecl_enable_interrupts();

        v9= output;
}
     T0 = ecl_make_int(v9);
    }
   }
   if (!(((cl_fixnum)(-1))==(ecl_fixnum(T0)))){
    goto L16;
   }
   value0 = L5358socket_error(VV[99]);
   return value0;
L16:;
   value0 = ECL_NIL;
   cl_env_copy->nvalues = 1;
   return value0;
  }
 }
}
/* local function SOCKET-PEERNAME                                             */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5346socket_peername(cl_object v1socket)
{
 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 v2fd;
  cl_object v3peer;
  v2fd = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
  {
   cl_object v4;
   
{
        struct sockaddr_un name;
        socklen_t len = sizeof(struct sockaddr_un);
        int ret;

        ecl_disable_interrupts();
        ret = getpeername(ecl_to_int(v2fd),(struct sockaddr*)&name,&len);
        ecl_enable_interrupts();

        if (ret == 0) {
                v4= ecl_make_simple_base_string(name.sun_path,-1);
        } else {
                v4= ECL_NIL;
        }
}
   v3peer = v4;
  }
  if (Null(v3peer)){
   goto L4;
  }
  value0 = v3peer;
  cl_env_copy->nvalues = 1;
  return value0;
L4:;
  value0 = L5358socket_error(VV[100]);
  return value0;
 }
}
static cl_object LC5346socket_peername_va(cl_narg narg, cl_object v4socket, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[65]);
 {
  return LC5346socket_peername(v4socket);
 }
}
/* local function NON-BLOCKING-MODE                                           */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5347non_blocking_mode(cl_object v1socket)
{
 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 v2fd;
  v2fd = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
  T0 = ecl_make_int(fcntl(ecl_to_int(v2fd),F_GETFL,NULL)&O_NONBLOCK);
  {
   bool v3;
   v3 = (ecl_fixnum(T0))==0;
   value0 = (v3)?ECL_NIL:ECL_T;
   cl_env_copy->nvalues = 1;
   return value0;
  }
 }
}
static cl_object LC5347non_blocking_mode_va(cl_narg narg, cl_object v3socket, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[72]);
 {
  return LC5347non_blocking_mode(v3socket);
 }
}
/* local function NON-BLOCKING-MODE                                           */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5348non_blocking_mode(cl_object v1non_blocking_p, cl_object v2socket)
{
 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;
  int8_t v4;
  cl_object v5fd;
  cl_object v6nblock;
  v3 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v2socket) /*  SOCKET-FILE-DESCRIPTOR */;
  if (Null(v1non_blocking_p)){
   goto L4;
  }
  v4 = 1;
  goto L3;
L4:;
  v4 = 0;
L3:;
  v5fd = v3;
  v6nblock = ecl_make_int8_t(v4);
  {
   int v7;
   
{
        int oldflags = fcntl(ecl_to_int(v5fd),F_GETFL,NULL);
        int newflags = (oldflags & ~O_NONBLOCK) |
                       (ecl_to_int(v6nblock) ? O_NONBLOCK : 0);
        ecl_disable_interrupts();
        v7= fcntl(ecl_to_int(v5fd),F_SETFL,newflags);
        ecl_enable_interrupts();
}
   T0 = ecl_make_int(v7);
  }
  if (!(((cl_fixnum)(-1))==(ecl_fixnum(T0)))){
   goto L8;
  }
  value0 = L5358socket_error(VV[109]);
  return value0;
L8:;
  value0 = v1non_blocking_p;
  cl_env_copy->nvalues = 1;
  return value0;
 }
}
static cl_object LC5348non_blocking_mode_va(cl_narg narg, cl_object v7non_blocking_p, cl_object v8socket, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[72]);
 {
  return LC5348non_blocking_mode(v7non_blocking_p, v8socket);
 }
}
/* function definition for DUP                                                */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5349dup(cl_object v1fd)
{
 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_make_int(dup(ecl_to_int(v1fd)));
 cl_env_copy->nvalues = 1;
 return value0;
}
static cl_object L5349dup_va(cl_narg narg, cl_object v2fd, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[110]);
 {
  return L5349dup(v2fd);
 }
}
/* function definition for AUTO-CLOSE-TWO-WAY-STREAM                          */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5350auto_close_two_way_stream(cl_object v1stream)
{
 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:;
 (v1stream)->stream.flags |= ECL_STREAM_CLOSE_COMPONENTS;
 value0 = ECL_NIL;
 cl_env_copy->nvalues = 0;
 return value0;
}
/* function definition for SOCKET-MAKE-STREAM-INNER                           */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5351socket_make_stream_inner(cl_object v1fd, cl_object v2input, cl_object v3output, cl_object v4buffering, cl_object v5element_type, cl_object v6external_format)
{
 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(v2input)){
  goto L2;
 }
 if (Null(v3output)){
  goto L2;
 }
 {
  cl_object v7in;
  cl_object v8out;
  cl_object v9stream;
  T0 = L5349dup(v1fd);
  v7in = L5351socket_make_stream_inner(T0, ECL_T, ECL_NIL, v4buffering, v5element_type, v6external_format);
  v8out = L5351socket_make_stream_inner(v1fd, ECL_NIL, ECL_T, v4buffering, v5element_type, v6external_format);
  v9stream = cl_make_two_way_stream(v7in, v8out);
  L5350auto_close_two_way_stream(v9stream);
  value0 = v9stream;
  cl_env_copy->nvalues = 1;
  return value0;
 }
L2:;
 if (Null(v2input)){
  goto L9;
 }
 value0 = (cl_env_copy->function=ecl_fdefinition(ECL_SYM("MAKE-STREAM-FROM-FD",1082)))->cfun.entry(8, v1fd, ECL_SYM("INPUT",1289), VV[114], v4buffering, ECL_SYM("ELEMENT-TYPE",1255), v5element_type, ECL_SYM("EXTERNAL-FORMAT",1267), v6external_format) /*  MAKE-STREAM-FROM-FD */;
 return value0;
L9:;
 if (Null(v3output)){
  goto L11;
 }
 value0 = (cl_env_copy->function=ecl_fdefinition(ECL_SYM("MAKE-STREAM-FROM-FD",1082)))->cfun.entry(8, v1fd, ECL_SYM("OUTPUT",1319), VV[114], v4buffering, ECL_SYM("ELEMENT-TYPE",1255), v5element_type, ECL_SYM("EXTERNAL-FORMAT",1267), v6external_format) /*  MAKE-STREAM-FROM-FD */;
 return value0;
L11:;
 value0 = cl_error(1, VV[115]);
 return value0;
}
static cl_object L5351socket_make_stream_inner_va(cl_narg narg, cl_object v10fd, cl_object v11input, cl_object v12output, cl_object v13buffering, cl_object v14element_type, cl_object v15external_format, ...)
{
 if (ecl_unlikely(narg!=6)) FEwrong_num_arguments(VV[113]);
 {
  return L5351socket_make_stream_inner(v10fd, v11input, v12output, v13buffering, v14element_type, v15external_format);
 }
}
/* local function SOCKET-MAKE-STREAM                                          */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5352socket_make_stream(cl_narg narg, cl_object v1socket, ...)
{
 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[71]);
 {
  cl_object v2input;
  cl_object v3input_p;
  cl_object v4output;
  cl_object v5output_p;
  cl_object v6buffering;
  cl_object v7element_type;
  cl_object v8external_format;
  ecl_va_list args; ecl_va_start(args,v1socket,narg,1);
  {
   cl_object keyvars[10];
   cl_parse_key(args,5,LC5352socket_make_streamkeys,keyvars,NULL,TRUE);
   ecl_va_end(args);
   v2input = keyvars[0];
   v3input_p = keyvars[5];
   v4output = keyvars[1];
   v5output_p = keyvars[6];
   if (Null(keyvars[7])) {
    v6buffering = ECL_SYM("FULL",1678);
   } else {
    v6buffering = keyvars[2];
   }
   if (Null(keyvars[8])) {
    v7element_type = ECL_SYM("BASE-CHAR",122);
   } else {
    v7element_type = keyvars[3];
   }
   if (Null(keyvars[9])) {
    v8external_format = ECL_SYM("DEFAULT",1246);
   } else {
    v8external_format = keyvars[4];
   }
  }
  {
   cl_object v9stream;
   if (Null(cl_slot_boundp(v1socket, ECL_SYM("STREAM",802)))){
    goto L6;
   }
   v9stream = cl_slot_value(v1socket, ECL_SYM("STREAM",802));
   goto L4;
L6:;
   v9stream = ECL_NIL;
   goto L4;
L4:;
   if (v9stream!=ECL_NIL) {
    goto L8;
   }
   if (v3input_p!=ECL_NIL) {
    goto L10;
   }
   if (v5output_p!=ECL_NIL) {
    goto L10;
   }
   v2input = ECL_T;
   v4output = ECL_T;
L10:;
   T0 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
   v9stream = L5351socket_make_stream_inner(T0, v2input, v4output, v6buffering, v7element_type, v8external_format);
   (cl_env_copy->function=ECL_CONS_CAR(VV[290]))->cfun.entry(3, v9stream, v1socket, ECL_SYM("STREAM",802)) /*  (SETF SLOT-VALUE) */;
L8:;
   value0 = v9stream;
   cl_env_copy->nvalues = 1;
   return value0;
  }
 }
}
/* local function STREAM-FD                                                   */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5353ext__stream_fd(cl_object v1socket)
{
 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 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
 return value0;
}
static cl_object LC5353ext__stream_fd_va(cl_narg narg, cl_object v2socket, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[117]);
 {
  return LC5353ext__stream_fd(v2socket);
 }
}
/* local function LAMBDA256                                                   */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5355__lambda256()
{
 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 v1;
  v1 = ecl_make_cfun_va((cl_objectfn)LC5354__lambda258_va,ECL_NIL,Cblock,2);
  value0 = v1;
  cl_env_copy->nvalues = 1;
  return value0;
 }
}
static cl_object LC5355__lambda256_va(cl_narg narg, ...)
{
 if (ecl_unlikely(narg!=0)) FEwrong_num_arguments(VV[118]);
 {
  return LC5355__lambda256();
 }
}
/* local function DEFINE-SOCKET-CONDITION                                     */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5356define_socket_condition(cl_object v1, cl_object v2)
{
 cl_object T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11;
 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 v4symbol;
  cl_object v5name;
  v3 = ecl_cdr(v1);
  if (!(v3==ECL_NIL)){
   goto L4;
  }
  si_dm_too_few_arguments(v1);
L4:;
  {
   cl_object v6;
   v6 = ecl_car(v3);
   v3 = ecl_cdr(v3);
   v4symbol = v6;
  }
  if (!(v3==ECL_NIL)){
   goto L10;
  }
  si_dm_too_few_arguments(v1);
L10:;
  {
   cl_object v6;
   v6 = ecl_car(v3);
   v3 = ecl_cdr(v3);
   v5name = v6;
  }
  if (Null(v3)){
   goto L15;
  }
  si_dm_too_many_arguments(v1);
L15:;
  T0 = ecl_symbol_name(v4symbol);
  T1 = cl_list(2, VV[2], T0);
  T2 = cl_list(3, ECL_SYM("DEFCONSTANT",279), v4symbol, T1);
  T3 = cl_list(2, ECL_SYM("QUOTE",682), v4symbol);
  T4 = cl_list(5, ECL_SYM("SYMBOL",843), ECL_SYM("READER",1010), VV[123], ECL_SYM("INITFORM",1000), T3);
  T5 = ecl_list1(T4);
  T6 = cl_list(4, ECL_SYM("DEFINE-CONDITION",280), v5name, VV[127], T5);
  T7 = cl_list(2, ECL_SYM("QUOTE",682), v5name);
  T8 = cl_list(2, ECL_SYM("EXPORT",346), T7);
  T9 = cl_list(2, ECL_SYM("QUOTE",682), v5name);
  T10 = cl_list(3, ECL_SYM("CONS",253), v4symbol, T9);
  T11 = cl_list(3, ECL_SYM("PUSH",680), T10, VV[128]);
  value0 = cl_list(6, ECL_SYM("LET",479), ECL_NIL, T2, T6, T8, T11);
  return value0;
 }
}
static cl_object LC5356define_socket_condition_va(cl_narg narg, cl_object v6, cl_object v7, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[125]);
 {
  return LC5356define_socket_condition(v6, v7);
 }
}
/* function definition for CONDITION-FOR-ERRNO                                */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5357condition_for_errno(cl_object v1err)
{
 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 v2;
  cl_object v3;
  cl_object v4;
  cl_object v5;
  v2 = ecl_cmp_symbol_value(cl_env_copy,VV[128]);
  v3 = (ECL_SYM("EQL",336)->symbol.gfdef);
  v4 = v1err;
  v5 = v2;
  T0 = ecl_assql(v4,v5);
 }
 value0 = ecl_cdr(T0);
 if (value0!=ECL_NIL) {
  goto L3;
 }
 value0 = VV[57];
 cl_env_copy->nvalues = 1;
 return value0;
L3:;
 cl_env_copy->nvalues = 1;
 return value0;
}
static cl_object L5357condition_for_errno_va(cl_narg narg, cl_object v2err, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[157]);
 {
  return L5357condition_for_errno(v2err);
 }
}
/* function definition for SOCKET-ERROR                                       */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5358socket_error(cl_object v1where)
{
 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_fixnum v2errno;
  cl_object v3condition;
  v2errno = (cl_fixnum)(errno);
  v3condition = L5357condition_for_errno(ecl_make_fixnum(v2errno));
  value0 = cl_error(5, v3condition, VV[159], ecl_make_fixnum(v2errno), VV[160], v1where);
  return value0;
 }
}
static cl_object L5358socket_error_va(cl_narg narg, cl_object v4where, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[57]);
 {
  return L5358socket_error(v4where);
 }
}
/* function definition for NAME-SERVICE-ERROR                                 */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5359name_service_error(cl_narg narg, cl_object v1where, ...)
{
 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[33]);
 if (ecl_unlikely(narg>2)) FEwrong_num_arguments(VV[33]);
 {
  cl_object v2errno;
  va_list args; va_start(args,v1where);
  {
   int i = 1;
   if (i >= narg) {
    v2errno = ECL_NIL;
   } else {
    i++;
    v2errno = va_arg(args,cl_object);
   }
  }
  va_end(args);
  T0 = ecl_make_int(EAI_SYSTEM);
  if (!(ecl_number_equalp(v2errno,T0))){
   goto L2;
  }
  value0 = L5358socket_error(v1where);
  return value0;
L2:;
  {
   cl_object v3condition;
   v3condition = L5363condition_for_name_service_errno(v2errno);
   value0 = cl_error(5, v3condition, VV[159], v2errno, VV[160], v1where);
   return value0;
  }
 }
}
/* local function LAMBDA296                                                   */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5361__lambda296()
{
 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 v1;
  v1 = ecl_make_cfun_va((cl_objectfn)LC5360__lambda298_va,ECL_NIL,Cblock,2);
  value0 = v1;
  cl_env_copy->nvalues = 1;
  return value0;
 }
}
static cl_object LC5361__lambda296_va(cl_narg narg, ...)
{
 if (ecl_unlikely(narg!=0)) FEwrong_num_arguments(VV[164]);
 {
  return LC5361__lambda296();
 }
}
/* local function DEFINE-NAME-SERVICE-CONDITION                               */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5362define_name_service_condition(cl_object v1, cl_object v2)
{
 cl_object T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11;
 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 v4symbol;
  cl_object v5name;
  v3 = ecl_cdr(v1);
  if (!(v3==ECL_NIL)){
   goto L4;
  }
  si_dm_too_few_arguments(v1);
L4:;
  {
   cl_object v6;
   v6 = ecl_car(v3);
   v3 = ecl_cdr(v3);
   v4symbol = v6;
  }
  if (!(v3==ECL_NIL)){
   goto L10;
  }
  si_dm_too_few_arguments(v1);
L10:;
  {
   cl_object v6;
   v6 = ecl_car(v3);
   v3 = ecl_cdr(v3);
   v5name = v6;
  }
  if (Null(v3)){
   goto L15;
  }
  si_dm_too_many_arguments(v1);
L15:;
  T0 = ecl_symbol_name(v4symbol);
  T1 = cl_list(2, VV[2], T0);
  T2 = cl_list(3, ECL_SYM("DEFCONSTANT",279), v4symbol, T1);
  T3 = cl_list(2, ECL_SYM("QUOTE",682), v4symbol);
  T4 = cl_list(5, ECL_SYM("SYMBOL",843), ECL_SYM("READER",1010), VV[169], ECL_SYM("INITFORM",1000), T3);
  T5 = ecl_list1(T4);
  T6 = cl_list(4, ECL_SYM("DEFINE-CONDITION",280), v5name, VV[172], T5);
  T7 = cl_list(2, ECL_SYM("QUOTE",682), v5name);
  T8 = cl_list(3, ECL_SYM("CONS",253), v4symbol, T7);
  T9 = cl_list(3, ECL_SYM("PUSH",680), T8, VV[173]);
  T10 = cl_list(2, ECL_SYM("QUOTE",682), v4symbol);
  T11 = cl_list(2, ECL_SYM("EXPORT",346), T10);
  value0 = cl_list(6, ECL_SYM("LET",479), ECL_NIL, T2, T6, T9, T11);
  return value0;
 }
}
static cl_object LC5362define_name_service_condition_va(cl_narg narg, cl_object v6, cl_object v7, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[171]);
 {
  return LC5362define_name_service_condition(v6, v7);
 }
}
/* function definition for CONDITION-FOR-NAME-SERVICE-ERRNO                   */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5363condition_for_name_service_errno(cl_object v1err)
{
 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 v2;
  cl_object v3;
  cl_object v4;
  cl_object v5;
  v2 = ecl_cmp_symbol_value(cl_env_copy,VV[173]);
  v3 = (ECL_SYM("EQL",336)->symbol.gfdef);
  v4 = v1err;
  v5 = v2;
  T0 = ecl_assql(v4,v5);
 }
 value0 = ecl_cdr(T0);
 if (value0!=ECL_NIL) {
  goto L3;
 }
 value0 = VV[181];
 cl_env_copy->nvalues = 1;
 return value0;
L3:;
 cl_env_copy->nvalues = 1;
 return value0;
}
static cl_object L5363condition_for_name_service_errno_va(cl_narg narg, cl_object v2err, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[162]);
 {
  return L5363condition_for_name_service_errno(v2err);
 }
}
/* function definition for GET-NAME-SERVICE-ERROR-MESSAGE                     */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5364get_name_service_error_message(cl_object v1num)
{
 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_cstring_to_base_string_or_nil(gai_strerror(ecl_to_int(v1num)));
 cl_env_copy->nvalues = 1;
 return value0;
}
static cl_object L5364get_name_service_error_message_va(cl_narg narg, cl_object v2num, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[170]);
 {
  return L5364get_name_service_error_message(v2num);
 }
}
/* function definition for GET-SOCKOPT-INT                                    */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5365get_sockopt_int(cl_object v1fd, cl_object v2level, cl_object v3const)
{
 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 v4ret;
  {
   cl_object v5;
   {
        int sockopt, ret;
        socklen_t socklen = sizeof(int);

        ecl_disable_interrupts();
        ret = getsockopt(ecl_to_int(v1fd),ecl_to_int(v2level),ecl_to_int(v3const),wincoerce(char*,&sockopt),&socklen);
        ecl_enable_interrupts();

        v5= (ret == 0) ? ecl_make_integer(sockopt) : ECL_NIL;
}
   v4ret = v5;
  }
  if (Null(v4ret)){
   goto L3;
  }
  value0 = v4ret;
  cl_env_copy->nvalues = 1;
  return value0;
L3:;
  T0 = ecl_cstring_to_base_string_or_nil(strerror(errno));
  value0 = cl_error(2, VV[185], T0);
  return value0;
 }
}
static cl_object L5365get_sockopt_int_va(cl_narg narg, cl_object v5fd, cl_object v6level, cl_object v7const, ...)
{
 if (ecl_unlikely(narg!=3)) FEwrong_num_arguments(VV[184]);
 {
  return L5365get_sockopt_int(v5fd, v6level, v7const);
 }
}
/* function definition for GET-SOCKOPT-BOOL                                   */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5366get_sockopt_bool(cl_object v1fd, cl_object v2level, cl_object v3const)
{
 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 v4ret;
  {
   cl_object v5;
   {
        int sockopt, ret;
        socklen_t socklen = sizeof(int);

        ecl_disable_interrupts();
        ret = getsockopt(ecl_to_int(v1fd),ecl_to_int(v2level),ecl_to_int(v3const),wincoerce(char*,&sockopt),&socklen);
        ecl_enable_interrupts();

        v5= (ret == 0) ? ecl_make_integer(sockopt) : ECL_NIL;
}
   v4ret = v5;
  }
  if (Null(v4ret)){
   goto L3;
  }
  value0 = ecl_make_bool(!ecl_number_equalp(v4ret,ecl_make_int8_t(0)));
  cl_env_copy->nvalues = 1;
  return value0;
L3:;
  T0 = ecl_cstring_to_base_string_or_nil(strerror(errno));
  value0 = cl_error(2, VV[185], T0);
  return value0;
 }
}
static cl_object L5366get_sockopt_bool_va(cl_narg narg, cl_object v5fd, cl_object v6level, cl_object v7const, ...)
{
 if (ecl_unlikely(narg!=3)) FEwrong_num_arguments(VV[187]);
 {
  return L5366get_sockopt_bool(v5fd, v6level, v7const);
 }
}
/* function definition for GET-SOCKOPT-TIMEVAL                                */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5367get_sockopt_timeval(cl_object v1fd, cl_object v2level, cl_object v3const)
{
 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 v4ret;
  {
   cl_object v5;
   {
        struct timeval tv;
        socklen_t socklen = sizeof(struct timeval);
        int ret;

        ecl_disable_interrupts();
        ret = getsockopt(ecl_to_int(v1fd),ecl_to_int(v2level),ecl_to_int(v3const),wincoerce(char*,&tv),&socklen);
        ecl_enable_interrupts();

        v5= (ret == 0) ? ecl_make_double_float((double)tv.tv_sec
                                        + ((double)tv.tv_usec) / 1000000.0) : ECL_NIL;
}
   v4ret = v5;
  }
  if (Null(v4ret)){
   goto L3;
  }
  value0 = v4ret;
  cl_env_copy->nvalues = 1;
  return value0;
L3:;
  T0 = ecl_cstring_to_base_string_or_nil(strerror(errno));
  value0 = cl_error(2, VV[185], T0);
  return value0;
 }
}
static cl_object L5367get_sockopt_timeval_va(cl_narg narg, cl_object v5fd, cl_object v6level, cl_object v7const, ...)
{
 if (ecl_unlikely(narg!=3)) FEwrong_num_arguments(VV[189]);
 {
  return L5367get_sockopt_timeval(v5fd, v6level, v7const);
 }
}
/* function definition for GET-SOCKOPT-LINGER                                 */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5368get_sockopt_linger(cl_object v1fd, cl_object v2level, cl_object v3const)
{
 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 v4ret;
  {
   cl_object v5;
   {
        struct linger sockopt;
        socklen_t socklen = sizeof(struct linger);
        int ret;

        ecl_disable_interrupts();
        ret = getsockopt(ecl_to_int(v1fd),ecl_to_int(v2level),ecl_to_int(v3const),wincoerce(char*,&sockopt),&socklen);
        ecl_enable_interrupts();

        v5= (ret == 0) ? ecl_make_integer((sockopt.l_onoff != 0) ? sockopt.l_linger : 0) : ECL_NIL;
}
   v4ret = v5;
  }
  if (Null(v4ret)){
   goto L3;
  }
  value0 = v4ret;
  cl_env_copy->nvalues = 1;
  return value0;
L3:;
  T0 = ecl_cstring_to_base_string_or_nil(strerror(errno));
  value0 = cl_error(2, VV[185], T0);
  return value0;
 }
}
static cl_object L5368get_sockopt_linger_va(cl_narg narg, cl_object v5fd, cl_object v6level, cl_object v7const, ...)
{
 if (ecl_unlikely(narg!=3)) FEwrong_num_arguments(VV[191]);
 {
  return L5368get_sockopt_linger(v5fd, v6level, v7const);
 }
}
/* function definition for SET-SOCKOPT-INT                                    */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5369set_sockopt_int(cl_object v1fd, cl_object v2level, cl_object v3const, cl_object v4value)
{
 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 v5ret;
  {
   cl_object v6;
   {
        int sockopt = ecl_to_int(v4value);
        int ret;

        ecl_disable_interrupts();
        ret = setsockopt(ecl_to_int(v1fd),ecl_to_int(v2level),ecl_to_int(v3const),wincoerce(char *,&sockopt),sizeof(int));
        ecl_enable_interrupts();

        v6= (ret == 0) ? ECL_T : ECL_NIL;
}
   v5ret = v6;
  }
  if (Null(v5ret)){
   goto L3;
  }
  value0 = v4value;
  cl_env_copy->nvalues = 1;
  return value0;
L3:;
  T0 = ecl_cstring_to_base_string_or_nil(strerror(errno));
  value0 = cl_error(2, VV[185], T0);
  return value0;
 }
}
static cl_object L5369set_sockopt_int_va(cl_narg narg, cl_object v6fd, cl_object v7level, cl_object v8const, cl_object v9value, ...)
{
 if (ecl_unlikely(narg!=4)) FEwrong_num_arguments(VV[193]);
 {
  return L5369set_sockopt_int(v6fd, v7level, v8const, v9value);
 }
}
/* function definition for SET-SOCKOPT-BOOL                                   */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5370set_sockopt_bool(cl_object v1fd, cl_object v2level, cl_object v3const, cl_object v4value)
{
 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 v5ret;
  {
   cl_object v6;
   {
        int sockopt = (v4value == ECL_NIL) ? 0 : 1;
        int ret;

        ecl_disable_interrupts();
        ret = setsockopt(ecl_to_int(v1fd),ecl_to_int(v2level),ecl_to_int(v3const),wincoerce(char *,&sockopt),sizeof(int));
        ecl_enable_interrupts();

        v6= (ret == 0) ? ECL_T : ECL_NIL;
}
   v5ret = v6;
  }
  if (Null(v5ret)){
   goto L3;
  }
  value0 = v4value;
  cl_env_copy->nvalues = 1;
  return value0;
L3:;
  T0 = ecl_cstring_to_base_string_or_nil(strerror(errno));
  value0 = cl_error(2, VV[185], T0);
  return value0;
 }
}
static cl_object L5370set_sockopt_bool_va(cl_narg narg, cl_object v6fd, cl_object v7level, cl_object v8const, cl_object v9value, ...)
{
 if (ecl_unlikely(narg!=4)) FEwrong_num_arguments(VV[195]);
 {
  return L5370set_sockopt_bool(v6fd, v7level, v8const, v9value);
 }
}
/* function definition for SET-SOCKOPT-TIMEVAL                                */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5371set_sockopt_timeval(cl_object v1fd, cl_object v2level, cl_object v3const, cl_object v4value)
{
 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 v5ret;
  {
   cl_object v6;
   {
        struct timeval tv;
        double tmp = ecl_to_double(v4value);
        int ret;

        ecl_disable_interrupts();
        tv.tv_sec = (int)tmp;
        tv.tv_usec = (int)((tmp-floor(tmp))*1000000.0);
        ret = setsockopt(ecl_to_int(v1fd),ecl_to_int(v2level),ecl_to_int(v3const),&tv,sizeof(struct timeval));
        ecl_enable_interrupts();

        v6= (ret == 0) ? ECL_T : ECL_NIL;
}
   v5ret = v6;
  }
  if (Null(v5ret)){
   goto L3;
  }
  value0 = v4value;
  cl_env_copy->nvalues = 1;
  return value0;
L3:;
  T0 = ecl_cstring_to_base_string_or_nil(strerror(errno));
  value0 = cl_error(2, VV[185], T0);
  return value0;
 }
}
static cl_object L5371set_sockopt_timeval_va(cl_narg narg, cl_object v6fd, cl_object v7level, cl_object v8const, cl_object v9value, ...)
{
 if (ecl_unlikely(narg!=4)) FEwrong_num_arguments(VV[197]);
 {
  return L5371set_sockopt_timeval(v6fd, v7level, v8const, v9value);
 }
}
/* function definition for SET-SOCKOPT-LINGER                                 */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5372set_sockopt_linger(cl_object v1fd, cl_object v2level, cl_object v3const, cl_object v4value)
{
 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 v5ret;
  {
   cl_object v6;
   {
        struct linger sockopt = {0, 0};
        int value = ecl_to_int(v4value);
        int ret;

        if (value > 0) {
                sockopt.l_onoff = 1;
                sockopt.l_linger = value;
        }

        ecl_disable_interrupts();
        ret = setsockopt(ecl_to_int(v1fd),ecl_to_int(v2level),ecl_to_int(v3const),wincoerce(char *,&sockopt),
                         sizeof(struct linger));
        ecl_enable_interrupts();

        v6= (ret == 0) ? ECL_T : ECL_NIL;
}
   v5ret = v6;
  }
  if (Null(v5ret)){
   goto L3;
  }
  value0 = v4value;
  cl_env_copy->nvalues = 1;
  return value0;
L3:;
  T0 = ecl_cstring_to_base_string_or_nil(strerror(errno));
  value0 = cl_error(2, VV[185], T0);
  return value0;
 }
}
static cl_object L5372set_sockopt_linger_va(cl_narg narg, cl_object v6fd, cl_object v7level, cl_object v8const, cl_object v9value, ...)
{
 if (ecl_unlikely(narg!=4)) FEwrong_num_arguments(VV[199]);
 {
  return L5372set_sockopt_linger(v6fd, v7level, v8const, v9value);
 }
}
/* local function DEFINE-SOCKOPT                                              */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5373define_sockopt(cl_object v1, cl_object v2)
{
 cl_object T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15;
 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 v4name;
  cl_object v5c_level;
  cl_object v6c_const;
  cl_object v7type;
  cl_object v8read_only;
  v3 = ecl_cdr(v1);
  if (!(v3==ECL_NIL)){
   goto L4;
  }
  si_dm_too_few_arguments(v1);
L4:;
  {
   cl_object v9;
   v9 = ecl_car(v3);
   v3 = ecl_cdr(v3);
   v4name = v9;
  }
  if (!(v3==ECL_NIL)){
   goto L10;
  }
  si_dm_too_few_arguments(v1);
L10:;
  {
   cl_object v9;
   v9 = ecl_car(v3);
   v3 = ecl_cdr(v3);
   v5c_level = v9;
  }
  if (!(v3==ECL_NIL)){
   goto L16;
  }
  si_dm_too_few_arguments(v1);
L16:;
  {
   cl_object v9;
   v9 = ecl_car(v3);
   v3 = ecl_cdr(v3);
   v6c_const = v9;
  }
  if (!(v3==ECL_NIL)){
   goto L22;
  }
  si_dm_too_few_arguments(v1);
L22:;
  {
   cl_object v9;
   v9 = ecl_car(v3);
   v3 = ecl_cdr(v3);
   v7type = v9;
  }
  if (Null(v3)){
   goto L28;
  }
  {
   cl_object v9;
   v9 = ecl_car(v3);
   v3 = ecl_cdr(v3);
   v8read_only = v9;
   goto L27;
  }
L28:;
  v8read_only = ECL_NIL;
L27:;
  if (Null(v3)){
   goto L33;
  }
  si_dm_too_many_arguments(v1);
L33:;
  T0 = cl_list(2, ECL_SYM("QUOTE",682), v4name);
  T1 = cl_list(2, ECL_SYM("EXPORT",346), T0);
  T2 = cl_format(3, ECL_NIL, VV[202], v7type);
  T3 = cl_intern(1, T2);
  T4 = cl_list(2, VV[2], v5c_level);
  T5 = cl_list(2, VV[2], v6c_const);
  T6 = cl_list(4, T3, VV[203], T4, T5);
  T7 = cl_list(4, ECL_SYM("DEFUN",291), v4name, VV[63], T6);
  if (v8read_only!=ECL_NIL) {
   goto L36;
  }
  T9 = cl_list(2, ECL_SYM("SETF",753), v4name);
  T10 = cl_format(3, ECL_NIL, VV[205], v7type);
  T11 = cl_intern(1, T10);
  T12 = cl_list(2, VV[2], v5c_level);
  T13 = cl_list(2, VV[2], v6c_const);
  T14 = cl_list(5, T11, VV[203], T12, T13, VV[206]);
  T15 = cl_list(4, ECL_SYM("DEFUN",291), T9, VV[204], T14);
  T8 = ecl_list1(T15);
  goto L35;
L36:;
  T8 = ECL_NIL;
L35:;
  value0 = cl_listX(4, ECL_SYM("PROGN",674), T1, T7, T8);
  return value0;
 }
}
static cl_object LC5373define_sockopt_va(cl_narg narg, cl_object v9, cl_object v10, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[201]);
 {
  return LC5373define_sockopt(v9, v10);
 }
}
/* function definition for SOCKOPT-TYPE                                       */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5374sockopt_type(cl_object v1socket)
{
 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:;
 T0 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
 T1 = ecl_make_int(SOL_SOCKET);
 T2 = ecl_make_int(SO_TYPE);
 value0 = L5365get_sockopt_int(T0, T1, T2);
 return value0;
}
static cl_object L5374sockopt_type_va(cl_narg narg, cl_object v2socket, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[208]);
 {
  return L5374sockopt_type(v2socket);
 }
}
/* function definition for SOCKOPT-RECEIVE-BUFFER                             */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5375sockopt_receive_buffer(cl_object v1socket)
{
 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:;
 T0 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
 T1 = ecl_make_int(SOL_SOCKET);
 T2 = ecl_make_int(SO_RCVBUF);
 value0 = L5365get_sockopt_int(T0, T1, T2);
 return value0;
}
static cl_object L5375sockopt_receive_buffer_va(cl_narg narg, cl_object v2socket, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[210]);
 {
  return L5375sockopt_receive_buffer(v2socket);
 }
}
/* function definition for (SETF SOCKOPT-RECEIVE-BUFFER)                      */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5376_setf_sockopt_receive_buffer_(cl_object v1value, cl_object v2socket)
{
 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:;
 T0 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v2socket) /*  SOCKET-FILE-DESCRIPTOR */;
 T1 = ecl_make_int(SOL_SOCKET);
 T2 = ecl_make_int(SO_RCVBUF);
 value0 = L5369set_sockopt_int(T0, T1, T2, v1value);
 return value0;
}
static cl_object L5376_setf_sockopt_receive_buffer__va(cl_narg narg, cl_object v3value, cl_object v4socket, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[212]);
 {
  return L5376_setf_sockopt_receive_buffer_(v3value, v4socket);
 }
}
/* function definition for SOCKOPT-RECEIVE-TIMEOUT                            */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5377sockopt_receive_timeout(cl_object v1socket)
{
 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:;
 T0 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
 T1 = ecl_make_int(SOL_SOCKET);
 T2 = ecl_make_int(SO_RCVTIMEO);
 value0 = L5367get_sockopt_timeval(T0, T1, T2);
 return value0;
}
static cl_object L5377sockopt_receive_timeout_va(cl_narg narg, cl_object v2socket, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[214]);
 {
  return L5377sockopt_receive_timeout(v2socket);
 }
}
/* function definition for (SETF SOCKOPT-RECEIVE-TIMEOUT)                     */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5378_setf_sockopt_receive_timeout_(cl_object v1value, cl_object v2socket)
{
 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:;
 T0 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v2socket) /*  SOCKET-FILE-DESCRIPTOR */;
 T1 = ecl_make_int(SOL_SOCKET);
 T2 = ecl_make_int(SO_RCVTIMEO);
 value0 = L5371set_sockopt_timeval(T0, T1, T2, v1value);
 return value0;
}
static cl_object L5378_setf_sockopt_receive_timeout__va(cl_narg narg, cl_object v3value, cl_object v4socket, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[216]);
 {
  return L5378_setf_sockopt_receive_timeout_(v3value, v4socket);
 }
}
/* function definition for SOCKOPT-SEND-TIMEOUT                               */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5379sockopt_send_timeout(cl_object v1socket)
{
 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:;
 T0 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
 T1 = ecl_make_int(SOL_SOCKET);
 T2 = ecl_make_int(SO_SNDTIMEO);
 value0 = L5367get_sockopt_timeval(T0, T1, T2);
 return value0;
}
static cl_object L5379sockopt_send_timeout_va(cl_narg narg, cl_object v2socket, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[218]);
 {
  return L5379sockopt_send_timeout(v2socket);
 }
}
/* function definition for (SETF SOCKOPT-SEND-TIMEOUT)                        */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5380_setf_sockopt_send_timeout_(cl_object v1value, cl_object v2socket)
{
 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:;
 T0 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v2socket) /*  SOCKET-FILE-DESCRIPTOR */;
 T1 = ecl_make_int(SOL_SOCKET);
 T2 = ecl_make_int(SO_SNDTIMEO);
 value0 = L5371set_sockopt_timeval(T0, T1, T2, v1value);
 return value0;
}
static cl_object L5380_setf_sockopt_send_timeout__va(cl_narg narg, cl_object v3value, cl_object v4socket, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[220]);
 {
  return L5380_setf_sockopt_send_timeout_(v3value, v4socket);
 }
}
/* function definition for SOCKOPT-REUSE-ADDRESS                              */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5381sockopt_reuse_address(cl_object v1socket)
{
 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:;
 T0 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
 T1 = ecl_make_int(SOL_SOCKET);
 T2 = ecl_make_int(SO_REUSEADDR);
 value0 = L5366get_sockopt_bool(T0, T1, T2);
 return value0;
}
static cl_object L5381sockopt_reuse_address_va(cl_narg narg, cl_object v2socket, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[222]);
 {
  return L5381sockopt_reuse_address(v2socket);
 }
}
/* function definition for (SETF SOCKOPT-REUSE-ADDRESS)                       */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5382_setf_sockopt_reuse_address_(cl_object v1value, cl_object v2socket)
{
 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:;
 T0 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v2socket) /*  SOCKET-FILE-DESCRIPTOR */;
 T1 = ecl_make_int(SOL_SOCKET);
 T2 = ecl_make_int(SO_REUSEADDR);
 value0 = L5370set_sockopt_bool(T0, T1, T2, v1value);
 return value0;
}
static cl_object L5382_setf_sockopt_reuse_address__va(cl_narg narg, cl_object v3value, cl_object v4socket, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[224]);
 {
  return L5382_setf_sockopt_reuse_address_(v3value, v4socket);
 }
}
/* function definition for SOCKOPT-KEEP-ALIVE                                 */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5383sockopt_keep_alive(cl_object v1socket)
{
 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:;
 T0 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
 T1 = ecl_make_int(SOL_SOCKET);
 T2 = ecl_make_int(SO_KEEPALIVE);
 value0 = L5366get_sockopt_bool(T0, T1, T2);
 return value0;
}
static cl_object L5383sockopt_keep_alive_va(cl_narg narg, cl_object v2socket, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[226]);
 {
  return L5383sockopt_keep_alive(v2socket);
 }
}
/* function definition for (SETF SOCKOPT-KEEP-ALIVE)                          */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5384_setf_sockopt_keep_alive_(cl_object v1value, cl_object v2socket)
{
 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:;
 T0 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v2socket) /*  SOCKET-FILE-DESCRIPTOR */;
 T1 = ecl_make_int(SOL_SOCKET);
 T2 = ecl_make_int(SO_KEEPALIVE);
 value0 = L5370set_sockopt_bool(T0, T1, T2, v1value);
 return value0;
}
static cl_object L5384_setf_sockopt_keep_alive__va(cl_narg narg, cl_object v3value, cl_object v4socket, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[228]);
 {
  return L5384_setf_sockopt_keep_alive_(v3value, v4socket);
 }
}
/* function definition for SOCKOPT-DONT-ROUTE                                 */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5385sockopt_dont_route(cl_object v1socket)
{
 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:;
 T0 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
 T1 = ecl_make_int(SOL_SOCKET);
 T2 = ecl_make_int(SO_DONTROUTE);
 value0 = L5366get_sockopt_bool(T0, T1, T2);
 return value0;
}
static cl_object L5385sockopt_dont_route_va(cl_narg narg, cl_object v2socket, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[230]);
 {
  return L5385sockopt_dont_route(v2socket);
 }
}
/* function definition for (SETF SOCKOPT-DONT-ROUTE)                          */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5386_setf_sockopt_dont_route_(cl_object v1value, cl_object v2socket)
{
 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:;
 T0 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v2socket) /*  SOCKET-FILE-DESCRIPTOR */;
 T1 = ecl_make_int(SOL_SOCKET);
 T2 = ecl_make_int(SO_DONTROUTE);
 value0 = L5370set_sockopt_bool(T0, T1, T2, v1value);
 return value0;
}
static cl_object L5386_setf_sockopt_dont_route__va(cl_narg narg, cl_object v3value, cl_object v4socket, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[232]);
 {
  return L5386_setf_sockopt_dont_route_(v3value, v4socket);
 }
}
/* function definition for SOCKOPT-LINGER                                     */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5387sockopt_linger(cl_object v1socket)
{
 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:;
 T0 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
 T1 = ecl_make_int(SOL_SOCKET);
 T2 = ecl_make_int(SO_LINGER);
 value0 = L5368get_sockopt_linger(T0, T1, T2);
 return value0;
}
static cl_object L5387sockopt_linger_va(cl_narg narg, cl_object v2socket, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[234]);
 {
  return L5387sockopt_linger(v2socket);
 }
}
/* function definition for (SETF SOCKOPT-LINGER)                              */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5388_setf_sockopt_linger_(cl_object v1value, cl_object v2socket)
{
 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:;
 T0 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v2socket) /*  SOCKET-FILE-DESCRIPTOR */;
 T1 = ecl_make_int(SOL_SOCKET);
 T2 = ecl_make_int(SO_LINGER);
 value0 = L5372set_sockopt_linger(T0, T1, T2, v1value);
 return value0;
}
static cl_object L5388_setf_sockopt_linger__va(cl_narg narg, cl_object v3value, cl_object v4socket, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[236]);
 {
  return L5388_setf_sockopt_linger_(v3value, v4socket);
 }
}
/* function definition for SOCKOPT-TCP-NODELAY                                */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5389sockopt_tcp_nodelay(cl_object v1socket)
{
 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:;
 T0 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v1socket) /*  SOCKET-FILE-DESCRIPTOR */;
 T1 = ecl_make_int(IPPROTO_TCP);
 T2 = ecl_make_int(TCP_NODELAY);
 value0 = L5366get_sockopt_bool(T0, T1, T2);
 return value0;
}
static cl_object L5389sockopt_tcp_nodelay_va(cl_narg narg, cl_object v2socket, ...)
{
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[238]);
 {
  return L5389sockopt_tcp_nodelay(v2socket);
 }
}
/* function definition for (SETF SOCKOPT-TCP-NODELAY)                         */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object L5390_setf_sockopt_tcp_nodelay_(cl_object v1value, cl_object v2socket)
{
 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:;
 T0 = (cl_env_copy->function=ecl_fdefinition(VV[50]))->cfun.entry(1, v2socket) /*  SOCKET-FILE-DESCRIPTOR */;
 T1 = ecl_make_int(IPPROTO_TCP);
 T2 = ecl_make_int(TCP_NODELAY);
 value0 = L5370set_sockopt_bool(T0, T1, T2, v1value);
 return value0;
}
static cl_object L5390_setf_sockopt_tcp_nodelay__va(cl_narg narg, cl_object v3value, cl_object v4socket, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[240]);
 {
  return L5390_setf_sockopt_tcp_nodelay_(v3value, v4socket);
 }
}
/* closure IS-WS                                                              */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5317is_ws(cl_narg narg, cl_object v1char, ...)
{
 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;                                     /*  WS                      */
 { /* ... closure scanning finished */
 if (ecl_unlikely(narg!=1)) FEwrong_num_arguments(VV[14]);
 {
L1:;
  {
   cl_object v2;
   v2 = si_make_seq_iterator(2, ECL_CONS_CAR(CLV0), ecl_make_int8_t(0));
L3:;
   if (v2!=ECL_NIL) {
    goto L5;
   }
   value0 = ECL_NIL;
   cl_env_copy->nvalues = 1;
   return value0;
L5:;
   {
    cl_object v3;
    v3 = si_seq_iterator_ref(ECL_CONS_CAR(CLV0), v2);
    if (!(ecl_eql(v1char,v3))){
     goto L7;
    }
    value0 = v3;
    cl_env_copy->nvalues = 1;
    return value0;
   }
L7:;
   v2 = si_seq_iterator_next(ECL_CONS_CAR(CLV0), v2);
   goto L3;
  }
 }
 }
}
/* closure .PRINT-UNREADABLE-OBJECT-BODY.                                     */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5323si___print_unreadable_object_body_(cl_narg narg, ...)
{
 cl_object T0;
 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;                                     /*  STREAM                  */
 CLV0 = _ecl_cdr(CLV1);
 { /* ... closure scanning finished */
 if (ecl_unlikely(narg!=0)) FEwrong_num_arguments(VV[45]);
 {
L1:;
  if (Null(cl_slot_boundp(ECL_CONS_CAR(CLV0), VV[46]))){
   goto L2;
  }
  ecl_princ(VV[47],ECL_CONS_CAR(CLV1));
  T0 = cl_slot_value(ECL_CONS_CAR(CLV0), VV[46]);
  value0 = ecl_princ(T0,ECL_CONS_CAR(CLV1));
  cl_env_copy->nvalues = 1;
  return value0;
L2:;
  value0 = ecl_princ(VV[48],ECL_NIL);
  cl_env_copy->nvalues = 1;
  return value0;
 }
 }
}
/* local function LAMBDA144                                                   */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5330__lambda144(cl_object v1condition, cl_object v2stream)
{
 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_env_copy->function=ecl_fdefinition(VV[82]))->cfun.entry(1, v1condition) /*  UNKNOWN-PROTOCOL-NAME */;
 T1 = cl_prin1_to_string(T0);
 value0 = cl_format(3, v2stream, VV[81], T1);
 return value0;
}
static cl_object LC5330__lambda144_va(cl_narg narg, cl_object v3condition, cl_object v4stream, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[80]);
 {
  return LC5330__lambda144(v3condition, v4stream);
 }
}
/* local function LAMBDA258                                                   */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5354__lambda258(cl_object v1c, cl_object v2s)
{
 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 v3num;
  v3num = (cl_env_copy->function=ecl_fdefinition(VV[120]))->cfun.entry(1, v1c) /*  SOCKET-ERROR-ERRNO */;
  T0 = (cl_env_copy->function=ecl_fdefinition(VV[122]))->cfun.entry(1, v1c) /*  SOCKET-ERROR-SYSCALL */;
  value0 = (cl_env_copy->function=ecl_fdefinition(VV[123]))->cfun.entry(1, v1c) /*  SOCKET-ERROR-SYMBOL */;
  if (value0!=ECL_NIL) {
   goto L5;
  }
  T1 = (cl_env_copy->function=ecl_fdefinition(VV[120]))->cfun.entry(1, v1c) /*  SOCKET-ERROR-ERRNO */;
  goto L3;
L5:;
  T1 = value0;
  goto L3;
L3:;
  T2 = ecl_cstring_to_base_string_or_nil(strerror(ecl_to_int(v3num)));
  value0 = cl_format(5, v2s, VV[121], T0, T1, T2);
  return value0;
 }
}
static cl_object LC5354__lambda258_va(cl_narg narg, cl_object v4c, cl_object v5s, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[119]);
 {
  return LC5354__lambda258(v4c, v5s);
 }
}
/* local function LAMBDA298                                                   */
/* optimize speed 1, debug 1, space 1, safety 2                               */
static cl_object LC5360__lambda298(cl_object v1c, cl_object v2s)
{
 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 v3num;
  v3num = (cl_env_copy->function=ecl_fdefinition(VV[166]))->cfun.entry(1, v1c) /*  NAME-SERVICE-ERROR-ERRNO */;
  T0 = (cl_env_copy->function=ecl_fdefinition(VV[168]))->cfun.entry(1, v1c) /*  NAME-SERVICE-ERROR-SYSCALL */;
  value0 = (cl_env_copy->function=ecl_fdefinition(VV[169]))->cfun.entry(1, v1c) /*  NAME-SERVICE-ERROR-SYMBOL */;
  if (value0!=ECL_NIL) {
   goto L5;
  }
  T1 = (cl_env_copy->function=ecl_fdefinition(VV[166]))->cfun.entry(1, v1c) /*  NAME-SERVICE-ERROR-ERRNO */;
  goto L3;
L5:;
  T1 = value0;
  goto L3;
L3:;
  T2 = L5364get_name_service_error_message(v3num);
  value0 = cl_format(5, v2s, VV[167], T0, T1, T2);
  return value0;
 }
}
static cl_object LC5360__lambda298_va(cl_narg narg, cl_object v4c, cl_object v5s, ...)
{
 if (ecl_unlikely(narg!=2)) FEwrong_num_arguments(VV[165]);
 {
  return LC5360__lambda298(v4c, v5s);
 }
}
#include "ext/sockets.data"
#ifdef __cplusplus
extern "C"
#endif

ECL_DLLEXPORT void _eclekPx67Hqtmli9_1tT1M881(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:SOCKETS;SOCKETS.LISP.NEWEST",-1);
 return;}
 #ifdef ECL_DYNAMIC_VV
 VV = Cblock->cblock.data;
 #endif
 Cblock->cblock.data_text = (const cl_object *)"@EcLtAg:_eclekPx67Hqtmli9_1tT1M881@";
 VVtemp = Cblock->cblock.temp_data;
 ECL_DEFINE_SETF_FUNCTIONS
 {
  cl_object T0, T1, T2, T3;
  cl_object volatile env0 = ECL_NIL;
/* MAKE-LOAD-FORMs                                                            */
/* TOP-LEVEL-FORMs                                                            */
  (cl_env_copy->function=(VV[0]->symbol.gfdef))->cfun.entry(12, VVtemp[0], ECL_NIL, ECL_NIL, ECL_NIL, VVtemp[1], ECL_NIL, ECL_NIL, ECL_NIL, VVtemp[2], ECL_NIL, ECL_NIL, ECL_NIL) /*  DODEFPACKAGE */;
  si_select_package(VVtemp[0]);
  T0 = ecl_make_int(AF_INET);
  si_Xmake_constant(VV[1], T0);
  T0 = ecl_make_int(AF_LOCAL);
  si_Xmake_constant(VV[3], T0);
  T0 = ecl_make_int(EAGAIN);
  si_Xmake_constant(VV[4], T0);
  T0 = ecl_make_int(EINTR);
  si_Xmake_constant(VV[5], T0);
  ecl_cmp_defun(VV[244]);                         /*  FF-SOCKET               */
  ecl_cmp_defun(VV[245]);                         /*  FF-LISTEN               */
  ecl_cmp_defun(VV[246]);                         /*  FF-CLOSE                */
  ecl_cmp_defun(VV[247]);                         /*  SPLIT                   */
  T0 = cl_list(2, ECL_SYM("DOCUMENTATION",1253), VVtemp[4]);
  clos_load_defclass(VV[25], ECL_NIL, VVtemp[3], T0);
  (cl_env_copy->function=(ECL_SYM("ENSURE-GENERIC-FUNCTION",946)->symbol.gfdef))->cfun.entry(7, VV[26], VV[27], ECL_T, ECL_SYM("LAMBDA-LIST",1002), VVtemp[5], ECL_SYM("DOCUMENTATION",1253), VVtemp[4]) /*  ENSURE-GENERIC-FUNCTION */;
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5319host_ent_address_va,ECL_NIL,Cblock,1);
   T0 = v1;
  }
  clos_install_method(5, VV[26], ECL_NIL, VVtemp[5], VVtemp[5], T0);
  ecl_cmp_defun(VV[248]);                         /*  GET-HOST-BY-NAME        */
  ecl_cmp_defun(VV[249]);                         /*  GET-HOST-BY-ADDRESS     */
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5322__lambda52_va,ECL_NIL,Cblock,0);
   T0 = v1;
  }
  T1 = cl_listX(3, ECL_SYM("INITFUNCTION",1001), T0, VVtemp[7]);
  T2 = cl_list(5, VVtemp[6], T1, VVtemp[8], VVtemp[9], VVtemp[10]);
  T3 = cl_list(2, ECL_SYM("DOCUMENTATION",1253), VVtemp[11]);
  clos_load_defclass(VV[42], ECL_NIL, T2, T3);
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5324print_object_va,ECL_NIL,Cblock,2);
   T0 = v1;
  }
  clos_install_method(5, ECL_SYM("PRINT-OBJECT",965), ECL_NIL, VVtemp[12], VVtemp[13], T0);
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5325shared_initialize,ECL_NIL,Cblock,2);
   T0 = v1;
  }
  clos_install_method(5, ECL_SYM("SHARED-INITIALIZE",969), VVtemp[14], VVtemp[12], VVtemp[15], T0);
  (cl_env_copy->function=(ECL_SYM("ENSURE-GENERIC-FUNCTION",946)->symbol.gfdef))->cfun.entry(7, VV[61], VV[27], ECL_T, ECL_SYM("LAMBDA-LIST",1002), VVtemp[16], ECL_SYM("DOCUMENTATION",1253), VVtemp[17]) /*  ENSURE-GENERIC-FUNCTION */;
  (cl_env_copy->function=(ECL_SYM("ENSURE-GENERIC-FUNCTION",946)->symbol.gfdef))->cfun.entry(7, VV[62], VV[27], ECL_T, ECL_SYM("LAMBDA-LIST",1002), VV[63], ECL_SYM("DOCUMENTATION",1253), VVtemp[18]) /*  ENSURE-GENERIC-FUNCTION */;
  (cl_env_copy->function=(ECL_SYM("ENSURE-GENERIC-FUNCTION",946)->symbol.gfdef))->cfun.entry(7, VV[64], VV[27], ECL_T, ECL_SYM("LAMBDA-LIST",1002), VVtemp[16], ECL_SYM("DOCUMENTATION",1253), VVtemp[19]) /*  ENSURE-GENERIC-FUNCTION */;
  (cl_env_copy->function=(ECL_SYM("ENSURE-GENERIC-FUNCTION",946)->symbol.gfdef))->cfun.entry(7, VV[65], VV[27], ECL_T, ECL_SYM("LAMBDA-LIST",1002), VV[63], ECL_SYM("DOCUMENTATION",1253), VVtemp[20]) /*  ENSURE-GENERIC-FUNCTION */;
  (cl_env_copy->function=(ECL_SYM("ENSURE-GENERIC-FUNCTION",946)->symbol.gfdef))->cfun.entry(7, VV[66], VV[27], ECL_T, ECL_SYM("LAMBDA-LIST",1002), VV[63], ECL_SYM("DOCUMENTATION",1253), VVtemp[21]) /*  ENSURE-GENERIC-FUNCTION */;
  (cl_env_copy->function=(ECL_SYM("ENSURE-GENERIC-FUNCTION",946)->symbol.gfdef))->cfun.entry(7, VV[67], VV[27], ECL_T, ECL_SYM("LAMBDA-LIST",1002), VVtemp[22], ECL_SYM("DOCUMENTATION",1253), VVtemp[23]) /*  ENSURE-GENERIC-FUNCTION */;
  (cl_env_copy->function=(ECL_SYM("ENSURE-GENERIC-FUNCTION",946)->symbol.gfdef))->cfun.entry(7, VV[68], VV[27], ECL_T, ECL_SYM("LAMBDA-LIST",1002), VVtemp[24], ECL_SYM("DOCUMENTATION",1253), VVtemp[25]) /*  ENSURE-GENERIC-FUNCTION */;
  (cl_env_copy->function=(ECL_SYM("ENSURE-GENERIC-FUNCTION",946)->symbol.gfdef))->cfun.entry(7, VV[69], VV[27], ECL_T, ECL_SYM("LAMBDA-LIST",1002), VVtemp[26], ECL_SYM("DOCUMENTATION",1253), VVtemp[27]) /*  ENSURE-GENERIC-FUNCTION */;
  (cl_env_copy->function=(ECL_SYM("ENSURE-GENERIC-FUNCTION",946)->symbol.gfdef))->cfun.entry(7, VV[70], VV[27], ECL_T, ECL_SYM("LAMBDA-LIST",1002), VVtemp[28], ECL_SYM("DOCUMENTATION",1253), VVtemp[29]) /*  ENSURE-GENERIC-FUNCTION */;
  (cl_env_copy->function=(ECL_SYM("ENSURE-GENERIC-FUNCTION",946)->symbol.gfdef))->cfun.entry(7, VV[71], VV[27], ECL_T, ECL_SYM("LAMBDA-LIST",1002), VVtemp[30], ECL_SYM("DOCUMENTATION",1253), VVtemp[31]) /*  ENSURE-GENERIC-FUNCTION */;
  (cl_env_copy->function=(ECL_SYM("ENSURE-GENERIC-FUNCTION",946)->symbol.gfdef))->cfun.entry(7, VV[72], VV[27], ECL_T, ECL_SYM("LAMBDA-LIST",1002), VV[63], ECL_SYM("DOCUMENTATION",1253), VVtemp[32]) /*  ENSURE-GENERIC-FUNCTION */;
  (cl_env_copy->function=(ECL_SYM("ENSURE-GENERIC-FUNCTION",946)->symbol.gfdef))->cfun.entry(7, VVtemp[33], VV[27], ECL_T, ECL_SYM("LAMBDA-LIST",1002), VVtemp[34], ECL_SYM("DOCUMENTATION",1253), VVtemp[35]) /*  ENSURE-GENERIC-FUNCTION */;
  (cl_env_copy->function=(ECL_SYM("ENSURE-GENERIC-FUNCTION",946)->symbol.gfdef))->cfun.entry(7, VV[73], VV[27], ECL_T, ECL_SYM("LAMBDA-LIST",1002), VV[63], ECL_SYM("DOCUMENTATION",1253), VVtemp[36]) /*  ENSURE-GENERIC-FUNCTION */;
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5326socket_listen_va,ECL_NIL,Cblock,2);
   T0 = v1;
  }
  clos_install_method(5, VV[67], ECL_NIL, VVtemp[12], VVtemp[22], T0);
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5327socket_close_low_level_va,ECL_NIL,Cblock,1);
   T0 = v1;
  }
  clos_install_method(5, VV[73], ECL_NIL, VV[63], VV[63], T0);
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5328socket_close,ECL_NIL,Cblock,1);
   T0 = v1;
  }
  clos_install_method(5, VV[70], ECL_NIL, VV[63], VVtemp[28], T0);
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5329socket_receive,ECL_NIL,Cblock,3);
   T0 = v1;
  }
  clos_install_method(5, VV[68], ECL_NIL, VVtemp[37], VVtemp[38], T0);
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5331__lambda142_va,ECL_NIL,Cblock,0);
   T0 = v1;
  }
  T1 = cl_listX(3, ECL_SYM("INITFUNCTION",1001), T0, VVtemp[40]);
  T2 = cl_list(2, T1, VVtemp[41]);
  clos_load_defclass(VV[78], VVtemp[39], T2, ECL_NIL);
  ecl_cmp_defun(VV[250]);                         /*  GET-PROTOCOL-BY-NAME    */
  ecl_cmp_defun(VV[251]);                         /*  MAKE-INET-ADDRESS       */
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5334__lambda149_va,ECL_NIL,Cblock,0);
   T0 = v1;
  }
  T1 = cl_listX(3, ECL_SYM("INITFUNCTION",1001), T0, VVtemp[42]);
  T2 = ecl_list1(T1);
  T3 = cl_list(2, ECL_SYM("DOCUMENTATION",1253), VVtemp[43]);
  clos_load_defclass(VV[87], VV[63], T2, T3);
  ecl_cmp_defun(VV[252]);                         /*  MAKE-INET-SOCKET        */
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5336socket_bind,ECL_NIL,Cblock,1);
   T0 = v1;
  }
  clos_install_method(5, VV[61], ECL_NIL, VVtemp[44], VVtemp[16], T0);
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5337socket_accept_va,ECL_NIL,Cblock,1);
   T0 = v1;
  }
  clos_install_method(5, VV[62], ECL_NIL, VVtemp[44], VV[63], T0);
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5338socket_connect,ECL_NIL,Cblock,1);
   T0 = v1;
  }
  clos_install_method(5, VV[64], ECL_NIL, VVtemp[44], VVtemp[16], T0);
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5339socket_peername_va,ECL_NIL,Cblock,1);
   T0 = v1;
  }
  clos_install_method(5, VV[65], ECL_NIL, VVtemp[44], VV[63], T0);
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5340socket_name_va,ECL_NIL,Cblock,1);
   T0 = v1;
  }
  clos_install_method(5, VV[66], ECL_NIL, VVtemp[44], VV[63], T0);
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5341socket_send,ECL_NIL,Cblock,3);
   T0 = v1;
  }
  clos_install_method(5, VV[69], ECL_NIL, VVtemp[37], VVtemp[26], T0);
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5342__lambda205_va,ECL_NIL,Cblock,0);
   T0 = v1;
  }
  T1 = cl_listX(3, ECL_SYM("INITFUNCTION",1001), T0, VVtemp[45]);
  T2 = ecl_list1(T1);
  T3 = cl_list(2, ECL_SYM("DOCUMENTATION",1253), VVtemp[46]);
  clos_load_defclass(VV[104], VV[63], T2, T3);
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5343socket_bind,ECL_NIL,Cblock,1);
   T0 = v1;
  }
  clos_install_method(5, VV[61], ECL_NIL, VVtemp[47], VVtemp[16], T0);
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5344socket_accept_va,ECL_NIL,Cblock,1);
   T0 = v1;
  }
  clos_install_method(5, VV[62], ECL_NIL, VVtemp[47], VV[63], T0);
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5345socket_connect,ECL_NIL,Cblock,1);
   T0 = v1;
  }
  clos_install_method(5, VV[64], ECL_NIL, VVtemp[47], VVtemp[16], T0);
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5346socket_peername_va,ECL_NIL,Cblock,1);
   T0 = v1;
  }
  clos_install_method(5, VV[65], ECL_NIL, VVtemp[47], VV[63], T0);
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5347non_blocking_mode_va,ECL_NIL,Cblock,1);
   T0 = v1;
  }
  clos_install_method(5, VV[72], ECL_NIL, VV[63], VV[63], T0);
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5348non_blocking_mode_va,ECL_NIL,Cblock,2);
   T0 = v1;
  }
  clos_install_method(5, VVtemp[33], ECL_NIL, VVtemp[48], VVtemp[34], T0);
  ecl_cmp_defun(VV[253]);                         /*  DUP                     */
  (void)0; /* No entry created for AUTO-CLOSE-TWO-WAY-STREAM */
  ecl_cmp_defun(VV[254]);                         /*  SOCKET-MAKE-STREAM-INNER */
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5352socket_make_stream,ECL_NIL,Cblock,1);
   T0 = v1;
  }
  clos_install_method(5, VV[71], ECL_NIL, VV[63], VVtemp[49], T0);
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5353ext__stream_fd_va,ECL_NIL,Cblock,1);
   T0 = v1;
  }
  clos_install_method(5, VV[117], ECL_NIL, VV[63], VV[63], T0);
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5355__lambda256_va,ECL_NIL,Cblock,0);
   T0 = v1;
  }
  T1 = cl_listX(3, ECL_SYM("INITFUNCTION",1001), T0, VVtemp[50]);
  T2 = cl_list(4, T1, VVtemp[51], VVtemp[52], VVtemp[53]);
  T3 = cl_list(2, ECL_SYM("DOCUMENTATION",1253), VVtemp[54]);
  clos_load_defclass(VV[57], VVtemp[39], T2, T3);
  ecl_cmp_defmacro(VV[255]);                      /*  DEFINE-SOCKET-CONDITION */
  si_Xmake_special(VV[128]);
  T0 = ECL_NIL;
  ecl_cmp_setq(cl_env_copy,VV[128],T0);
  T0 = ecl_make_int(EADDRINUSE);
  si_Xmake_constant(VV[130], T0);
  clos_load_defclass(VV[131], VV[127], VVtemp[55], ECL_NIL);
  cl_export(1, VV[131]);
  T0 = CONS(ecl_cmp_symbol_value(cl_env_copy,VV[130]),VV[131]);
  T1 = CONS(T0,ecl_cmp_symbol_value(cl_env_copy,VV[128]));
  ecl_cmp_setq(cl_env_copy,VV[128],T1);
  T0 = ecl_make_int(EAGAIN);
  si_Xmake_constant(VV[132], T0);
  clos_load_defclass(VV[133], VV[127], VVtemp[56], ECL_NIL);
  cl_export(1, VV[133]);
  T0 = CONS(ecl_cmp_symbol_value(cl_env_copy,VV[132]),VV[133]);
  T1 = CONS(T0,ecl_cmp_symbol_value(cl_env_copy,VV[128]));
  ecl_cmp_setq(cl_env_copy,VV[128],T1);
  T0 = ecl_make_int(EBADF);
  si_Xmake_constant(VV[134], T0);
  clos_load_defclass(VV[135], VV[127], VVtemp[57], ECL_NIL);
  cl_export(1, VV[135]);
  T0 = CONS(ecl_cmp_symbol_value(cl_env_copy,VV[134]),VV[135]);
  T1 = CONS(T0,ecl_cmp_symbol_value(cl_env_copy,VV[128]));
  ecl_cmp_setq(cl_env_copy,VV[128],T1);
  T0 = ecl_make_int(ECONNREFUSED);
  si_Xmake_constant(VV[136], T0);
  clos_load_defclass(VV[137], VV[127], VVtemp[58], ECL_NIL);
  cl_export(1, VV[137]);
  T0 = CONS(ecl_cmp_symbol_value(cl_env_copy,VV[136]),VV[137]);
  T1 = CONS(T0,ecl_cmp_symbol_value(cl_env_copy,VV[128]));
  ecl_cmp_setq(cl_env_copy,VV[128],T1);
  T0 = ecl_make_int(ETIMEDOUT);
  si_Xmake_constant(VV[138], T0);
  clos_load_defclass(VV[139], VV[127], VVtemp[59], ECL_NIL);
  cl_export(1, VV[139]);
  T0 = CONS(ecl_cmp_symbol_value(cl_env_copy,VV[138]),VV[139]);
  T1 = CONS(T0,ecl_cmp_symbol_value(cl_env_copy,VV[128]));
  ecl_cmp_setq(cl_env_copy,VV[128],T1);
  T0 = ecl_make_int(EINTR);
  si_Xmake_constant(VV[140], T0);
  clos_load_defclass(VV[133], VV[127], VVtemp[60], ECL_NIL);
  cl_export(1, VV[133]);
  T0 = CONS(ecl_cmp_symbol_value(cl_env_copy,VV[140]),VV[133]);
  T1 = CONS(T0,ecl_cmp_symbol_value(cl_env_copy,VV[128]));
  ecl_cmp_setq(cl_env_copy,VV[128],T1);
  T0 = ecl_make_int(EINVAL);
  si_Xmake_constant(VV[141], T0);
  clos_load_defclass(VV[142], VV[127], VVtemp[61], ECL_NIL);
  cl_export(1, VV[142]);
  T0 = CONS(ecl_cmp_symbol_value(cl_env_copy,VV[141]),VV[142]);
  T1 = CONS(T0,ecl_cmp_symbol_value(cl_env_copy,VV[128]));
  ecl_cmp_setq(cl_env_copy,VV[128],T1);
  T0 = ecl_make_int(ENOBUFS);
  si_Xmake_constant(VV[143], T0);
  clos_load_defclass(VV[144], VV[127], VVtemp[62], ECL_NIL);
  cl_export(1, VV[144]);
  T0 = CONS(ecl_cmp_symbol_value(cl_env_copy,VV[143]),VV[144]);
  T1 = CONS(T0,ecl_cmp_symbol_value(cl_env_copy,VV[128]));
  ecl_cmp_setq(cl_env_copy,VV[128],T1);
  T0 = ecl_make_int(ENOMEM);
  si_Xmake_constant(VV[145], T0);
  clos_load_defclass(VV[146], VV[127], VVtemp[63], ECL_NIL);
  cl_export(1, VV[146]);
  T0 = CONS(ecl_cmp_symbol_value(cl_env_copy,VV[145]),VV[146]);
  T1 = CONS(T0,ecl_cmp_symbol_value(cl_env_copy,VV[128]));
  ecl_cmp_setq(cl_env_copy,VV[128],T1);
  T0 = ecl_make_int(EOPNOTSUPP);
  si_Xmake_constant(VV[147], T0);
  clos_load_defclass(VV[148], VV[127], VVtemp[64], ECL_NIL);
  cl_export(1, VV[148]);
  T0 = CONS(ecl_cmp_symbol_value(cl_env_copy,VV[147]),VV[148]);
  T1 = CONS(T0,ecl_cmp_symbol_value(cl_env_copy,VV[128]));
  ecl_cmp_setq(cl_env_copy,VV[128],T1);
  T0 = ecl_make_int(EPERM);
  si_Xmake_constant(VV[149], T0);
  clos_load_defclass(VV[150], VV[127], VVtemp[65], ECL_NIL);
  cl_export(1, VV[150]);
  T0 = CONS(ecl_cmp_symbol_value(cl_env_copy,VV[149]),VV[150]);
  T1 = CONS(T0,ecl_cmp_symbol_value(cl_env_copy,VV[128]));
  ecl_cmp_setq(cl_env_copy,VV[128],T1);
  T0 = ecl_make_int(EPROTONOSUPPORT);
  si_Xmake_constant(VV[151], T0);
  clos_load_defclass(VV[152], VV[127], VVtemp[66], ECL_NIL);
  cl_export(1, VV[152]);
  T0 = CONS(ecl_cmp_symbol_value(cl_env_copy,VV[151]),VV[152]);
  T1 = CONS(T0,ecl_cmp_symbol_value(cl_env_copy,VV[128]));
  ecl_cmp_setq(cl_env_copy,VV[128],T1);
  T0 = ecl_make_int(ESOCKTNOSUPPORT);
  si_Xmake_constant(VV[153], T0);
  clos_load_defclass(VV[154], VV[127], VVtemp[67], ECL_NIL);
  cl_export(1, VV[154]);
  T0 = CONS(ecl_cmp_symbol_value(cl_env_copy,VV[153]),VV[154]);
  T1 = CONS(T0,ecl_cmp_symbol_value(cl_env_copy,VV[128]));
  ecl_cmp_setq(cl_env_copy,VV[128],T1);
  T0 = ecl_make_int(ENETUNREACH);
  si_Xmake_constant(VV[155], T0);
  clos_load_defclass(VV[156], VV[127], VVtemp[68], ECL_NIL);
  cl_export(1, VV[156]);
  T0 = CONS(ecl_cmp_symbol_value(cl_env_copy,VV[155]),VV[156]);
  T1 = CONS(T0,ecl_cmp_symbol_value(cl_env_copy,VV[128]));
  ecl_cmp_setq(cl_env_copy,VV[128],T1);
  ecl_cmp_defun(VV[256]);                         /*  CONDITION-FOR-ERRNO     */
  ecl_cmp_defun(VV[257]);                         /*  SOCKET-ERROR            */
  ecl_cmp_defun(VV[258]);                         /*  NAME-SERVICE-ERROR      */
  {
   cl_object volatile v1;
   v1 = ecl_make_cfun_va((cl_objectfn)LC5361__lambda296_va,ECL_NIL,Cblock,0);
   T0 = v1;
  }
  T1 = cl_listX(3, ECL_SYM("INITFUNCTION",1001), T0, VVtemp[70]);
  T2 = cl_list(4, T1, VVtemp[71], VVtemp[72], VVtemp[73]);
  clos_load_defclass(VV[33], VVtemp[69], T2, ECL_NIL);
  ecl_cmp_defmacro(VV[259]);                      /*  DEFINE-NAME-SERVICE-CONDITION */
  si_Xmake_special(VV[173]);
  T0 = ECL_NIL;
  ecl_cmp_setq(cl_env_copy,VV[173],T0);
  T0 = ecl_make_int(EAI_NONAME);
  si_Xmake_constant(VV[175], T0);
  clos_load_defclass(VV[176], VV[172], VVtemp[74], ECL_NIL);
  T0 = CONS(ecl_cmp_symbol_value(cl_env_copy,VV[175]),VV[176]);
  T1 = CONS(T0,ecl_cmp_symbol_value(cl_env_copy,VV[173]));
  ecl_cmp_setq(cl_env_copy,VV[173],T1);
  cl_export(1, VV[175]);
  T0 = ecl_make_int(EAI_AGAIN);
  si_Xmake_constant(VV[177], T0);
  clos_load_defclass(VV[178], VV[172], VVtemp[75], ECL_NIL);
  T0 = CONS(ecl_cmp_symbol_value(cl_env_copy,VV[177]),VV[178]);
  T1 = CONS(T0,ecl_cmp_symbol_value(cl_env_copy,VV[173]));
  ecl_cmp_setq(cl_env_copy,VV[173],T1);
  cl_export(1, VV[177]);
  T0 = ecl_make_int(EAI_FAIL);
  si_Xmake_constant(VV[179], T0);
  clos_load_defclass(VV[180], VV[172], VVtemp[76], ECL_NIL);
  T0 = CONS(ecl_cmp_symbol_value(cl_env_copy,VV[179]),VV[180]);
  T1 = CONS(T0,ecl_cmp_symbol_value(cl_env_copy,VV[173]));
  ecl_cmp_setq(cl_env_copy,VV[173],T1);
  cl_export(1, VV[179]);
  ecl_cmp_defun(VV[260]);                         /*  CONDITION-FOR-NAME-SERVICE-ERRNO */
  ecl_cmp_defun(VV[261]);                         /*  GET-NAME-SERVICE-ERROR-MESSAGE */
  ecl_cmp_defun(VV[262]);                         /*  GET-SOCKOPT-INT         */
  ecl_cmp_defun(VV[263]);                         /*  GET-SOCKOPT-BOOL        */
  ecl_cmp_defun(VV[264]);                         /*  GET-SOCKOPT-TIMEVAL     */
  ecl_cmp_defun(VV[265]);                         /*  GET-SOCKOPT-LINGER      */
  ecl_cmp_defun(VV[266]);                         /*  SET-SOCKOPT-INT         */
  ecl_cmp_defun(VV[267]);                         /*  SET-SOCKOPT-BOOL        */
  ecl_cmp_defun(VV[268]);                         /*  SET-SOCKOPT-TIMEVAL     */
  ecl_cmp_defun(VV[269]);                         /*  SET-SOCKOPT-LINGER      */
  ecl_cmp_defmacro(VV[270]);                      /*  DEFINE-SOCKOPT          */
  cl_export(1, VV[208]);
  ecl_cmp_defun(VV[271]);                         /*  SOCKOPT-TYPE            */
  cl_export(1, VV[210]);
  ecl_cmp_defun(VV[272]);                         /*  SOCKOPT-RECEIVE-BUFFER  */
  ecl_cmp_defun(VV[273]);                         /*  (SETF SOCKOPT-RECEIVE-BUFFER) */
  cl_export(1, VV[214]);
  ecl_cmp_defun(VV[274]);                         /*  SOCKOPT-RECEIVE-TIMEOUT */
  ecl_cmp_defun(VV[275]);                         /*  (SETF SOCKOPT-RECEIVE-TIMEOUT) */
  cl_export(1, VV[218]);
  ecl_cmp_defun(VV[276]);                         /*  SOCKOPT-SEND-TIMEOUT    */
  ecl_cmp_defun(VV[277]);                         /*  (SETF SOCKOPT-SEND-TIMEOUT) */
  cl_export(1, VV[222]);
  ecl_cmp_defun(VV[278]);                         /*  SOCKOPT-REUSE-ADDRESS   */
  ecl_cmp_defun(VV[279]);                         /*  (SETF SOCKOPT-REUSE-ADDRESS) */
  cl_export(1, VV[226]);
  ecl_cmp_defun(VV[280]);                         /*  SOCKOPT-KEEP-ALIVE      */
  ecl_cmp_defun(VV[281]);                         /*  (SETF SOCKOPT-KEEP-ALIVE) */
  cl_export(1, VV[230]);
  ecl_cmp_defun(VV[282]);                         /*  SOCKOPT-DONT-ROUTE      */
  ecl_cmp_defun(VV[283]);                         /*  (SETF SOCKOPT-DONT-ROUTE) */
  cl_export(1, VV[234]);
  ecl_cmp_defun(VV[284]);                         /*  SOCKOPT-LINGER          */
  ecl_cmp_defun(VV[285]);                         /*  (SETF SOCKOPT-LINGER)   */
  cl_export(1, VV[238]);
  ecl_cmp_defun(VV[286]);                         /*  SOCKOPT-TCP-NODELAY     */
  ecl_cmp_defun(VV[287]);                         /*  (SETF SOCKOPT-TCP-NODELAY) */
  cl_provide(VV[242]);
  cl_provide(VV[243]);
 }
}
