/*
 * This file was generated automatically by ExtUtils::ParseXS version 2.21 from the
 * contents of ListUtil.xs. Do not edit this file, edit ListUtil.xs instead.
 *
 *	ANY CHANGES MADE HERE WILL BE LOST! 
 *
 */

#line 1 "ListUtil.xs"
/* Copyright (c) 1997-2000 Graham Barr <gbarr@pobox.com>. All rights reserved.
 * This program is free software; you can redistribute it and/or
 * modify it under the same terms as Perl itself.
 */

#include <EXTERN.h>
#include <perl.h>
#include <XSUB.h>

#ifndef PERL_VERSION
#    include <patchlevel.h>
#    if !(defined(PERL_VERSION) || (SUBVERSION > 0 && defined(PATCHLEVEL)))
#        include <could_not_find_Perl_patchlevel.h>
#    endif
#    define PERL_REVISION	5
#    define PERL_VERSION	PATCHLEVEL
#    define PERL_SUBVERSION	SUBVERSION
#endif

#if PERL_VERSION >= 6
#  include "multicall.h"
#endif

#ifndef aTHX
#  define aTHX
#  define pTHX
#endif
/* Some platforms have strict exports. And before 5.7.3 cxinc (or Perl_cxinc)
   was not exported. Therefore platforms like win32, VMS etc have problems
   so we redefine it here -- GMB
*/
#if PERL_VERSION < 7
/* Not in 5.6.1. */
#  define SvUOK(sv)           SvIOK_UV(sv)
#  ifdef cxinc
#    undef cxinc
#  endif
#  define cxinc() my_cxinc(aTHX)
static I32
my_cxinc(pTHX)
{
    cxstack_max = cxstack_max * 3 / 2;
    Renew(cxstack, cxstack_max + 1, struct context);      /* XXX should fix CXINC macro */
    return cxstack_ix + 1;
}
#endif

#if PERL_VERSION < 6
#    define NV double
#endif

#ifdef SVf_IVisUV
#  define slu_sv_value(sv) (SvIOK(sv)) ? (SvIOK_UV(sv)) ? (NV)(SvUVX(sv)) : (NV)(SvIVX(sv)) : (SvNV(sv))
#else
#  define slu_sv_value(sv) (SvIOK(sv)) ? (NV)(SvIVX(sv)) : (SvNV(sv))
#endif

#ifndef Drand01
#    define Drand01()		((rand() & 0x7FFF) / (double) ((unsigned long)1 << 15))
#endif

#if PERL_VERSION < 5
#  ifndef gv_stashpvn
#    define gv_stashpvn(n,l,c) gv_stashpv(n,c)
#  endif
#  ifndef SvTAINTED

static bool
sv_tainted(SV *sv)
{
    if (SvTYPE(sv) >= SVt_PVMG && SvMAGIC(sv)) {
	MAGIC *mg = mg_find(sv, 't');
	if (mg && ((mg->mg_len & 1) || (mg->mg_len & 2) && mg->mg_obj == sv))
	    return TRUE;
    }
    return FALSE;
}

#    define SvTAINTED_on(sv) sv_magic((sv), Nullsv, 't', Nullch, 0)
#    define SvTAINTED(sv) (SvMAGICAL(sv) && sv_tainted(sv))
#  endif
#  define PL_defgv defgv
#  define PL_op op
#  define PL_curpad curpad
#  define CALLRUNOPS runops
#  define PL_curpm curpm
#  define PL_sv_undef sv_undef
#  define PERL_CONTEXT struct context
#endif
#if (PERL_VERSION < 5) || (PERL_VERSION == 5 && PERL_SUBVERSION <50)
#  ifndef PL_tainting
#    define PL_tainting tainting
#  endif
#  ifndef PL_stack_base
#    define PL_stack_base stack_base
#  endif
#  ifndef PL_stack_sp
#    define PL_stack_sp stack_sp
#  endif
#  ifndef PL_ppaddr
#    define PL_ppaddr ppaddr
#  endif
#endif

#ifndef PTR2UV
#  define PTR2UV(ptr) (UV)(ptr)
#endif

#ifndef SvUV_set
#  define SvUV_set(sv, val) (((XPVUV*)SvANY(sv))->xuv_uv = (val))
#endif

#ifndef PERL_UNUSED_DECL
#  ifdef HASATTRIBUTE
#    if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
#      define PERL_UNUSED_DECL
#    else
#      define PERL_UNUSED_DECL __attribute__((unused))
#    endif
#  else
#    define PERL_UNUSED_DECL
#  endif
#endif

#ifndef dNOOP
#define dNOOP extern int Perl___notused PERL_UNUSED_DECL
#endif

#ifndef dVAR
#define dVAR dNOOP
#endif

#ifndef GvSVn
#  define GvSVn GvSV
#endif

#line 147 "ListUtil.c"
#ifndef PERL_UNUSED_VAR
#  define PERL_UNUSED_VAR(var) if (0) var = var
#endif

#ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
#define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)

/* prototype to pass -Wmissing-prototypes */
STATIC void
S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params);

STATIC void
S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params)
{
    const GV *const gv = CvGV(cv);

    PERL_ARGS_ASSERT_CROAK_XS_USAGE;

    if (gv) {
        const char *const gvname = GvNAME(gv);
        const HV *const stash = GvSTASH(gv);
        const char *const hvname = stash ? HvNAME(stash) : NULL;

        if (hvname)
            Perl_croak(aTHX_ "Usage: %s::%s(%s)", hvname, gvname, params);
        else
            Perl_croak(aTHX_ "Usage: %s(%s)", gvname, params);
    } else {
        /* Pants. I don't think that it should be possible to get here. */
        Perl_croak(aTHX_ "Usage: CODE(0x%"UVxf")(%s)", PTR2UV(cv), params);
    }
}
#undef  PERL_ARGS_ASSERT_CROAK_XS_USAGE

#ifdef PERL_IMPLICIT_CONTEXT
#define croak_xs_usage(a,b)	S_croak_xs_usage(aTHX_ a,b)
#else
#define croak_xs_usage		S_croak_xs_usage
#endif

#endif

/* NOTE: the prototype of newXSproto() is different in versions of perls,
 * so we define a portable version of newXSproto()
 */
#ifdef newXS_flags
#define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0)
#else
#define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
#endif /* !defined(newXS_flags) */

#line 199 "ListUtil.c"

XS(XS_List__Util_min); /* prototype to pass -Wmissing-prototypes */
XS(XS_List__Util_min)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
    dXSI32;
    PERL_UNUSED_VAR(cv); /* -W */
    {
#line 146 "ListUtil.xs"
{
    int index;
    NV retval;
    SV *retsv;
    int magic;
    if(!items) {
	XSRETURN_UNDEF;
    }
    retsv = ST(0);
    magic = SvAMAGIC(retsv);
    if (!magic) {
      retval = slu_sv_value(retsv);
    }
    for(index = 1 ; index < items ; index++) {
	SV *stacksv = ST(index);
        SV *tmpsv;
        if ((magic || SvAMAGIC(stacksv)) && (tmpsv = amagic_call(retsv, stacksv, gt_amg, 0))) {
             if (SvTRUE(tmpsv) ? !ix : ix) {
                  retsv = stacksv;
                  magic = SvAMAGIC(retsv);
                  if (!magic) {
                      retval = slu_sv_value(retsv);
                  }
             }
        }
        else {
            NV val = slu_sv_value(stacksv);
            if (magic) {
                retval = slu_sv_value(retsv);
                magic = 0;
            }
            if(val < retval ? !ix : ix) {
                retsv = stacksv;
                retval = val;
            }
        }
    }
    ST(0) = retsv;
    XSRETURN(1);
}
#line 253 "ListUtil.c"
    }
    XSRETURN(1);
}


XS(XS_List__Util_sum); /* prototype to pass -Wmissing-prototypes */
XS(XS_List__Util_sum)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
    PERL_UNUSED_VAR(cv); /* -W */
    {
#line 193 "ListUtil.xs"
{
    SV *sv;
    SV *retsv = NULL;
    int index;
    NV retval = 0;
    if(!items) {
	XSRETURN_UNDEF;
    }
    sv = ST(0);
    if (SvAMAGIC(sv)) {
        retsv = sv_newmortal();
        sv_setsv(retsv, sv);
    }
    else {
        retval = slu_sv_value(sv);
    }
    for(index = 1 ; index < items ; index++) {
	sv = ST(index);
        if (retsv || SvAMAGIC(sv)) {
            if (!retsv) {
                retsv = sv_newmortal();
                sv_setnv(retsv,retval);
            }
            if (!amagic_call(retsv, sv, add_amg, AMGf_assign)) {
                sv_setnv(retsv, SvNV(retsv) + SvNV(sv));
            }
        }
        else {
          retval += slu_sv_value(sv);
        }
    }
    if (!retsv) {
        retsv = sv_newmortal();
        sv_setnv(retsv,retval);
    }
    ST(0) = retsv;
    XSRETURN(1);
}
#line 308 "ListUtil.c"
    }
    XSRETURN(1);
}


XS(XS_List__Util_minstr); /* prototype to pass -Wmissing-prototypes */
XS(XS_List__Util_minstr)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
    dXSI32;
    PERL_UNUSED_VAR(cv); /* -W */
    {
#line 240 "ListUtil.xs"
{
    SV *left;
    int index;
    if(!items) {
	XSRETURN_UNDEF;
    }
    /*
      sv_cmp & sv_cmp_locale return 1,0,-1 for gt,eq,lt
      so we set ix to the value we are looking for
      xsubpp does not allow -ve values, so we start with 0,2 and subtract 1
    */
    ix -= 1;
    left = ST(0);
#ifdef OPpLOCALE
    if(MAXARG & OPpLOCALE) {
	for(index = 1 ; index < items ; index++) {
	    SV *right = ST(index);
	    if(sv_cmp_locale(left, right) == ix)
		left = right;
	}
    }
    else {
#endif
	for(index = 1 ; index < items ; index++) {
	    SV *right = ST(index);
	    if(sv_cmp(left, right) == ix)
		left = right;
	}
#ifdef OPpLOCALE
    }
#endif
    ST(0) = left;
    XSRETURN(1);
}
#line 360 "ListUtil.c"
    }
    XSRETURN(1);
}

#ifdef dMULTICALL
#define XSubPPtmpAAAA 1


XS(XS_List__Util_reduce); /* prototype to pass -Wmissing-prototypes */
XS(XS_List__Util_reduce)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
    if (items < 1)
       croak_xs_usage(cv,  "block, ...");
    {
	SV *	block = ST(0);
#line 284 "ListUtil.xs"
{
    dVAR; dMULTICALL;
    SV *ret = sv_newmortal();
    int index;
    GV *agv,*bgv,*gv;
    HV *stash;
    I32 gimme = G_SCALAR;
    SV **args = &PL_stack_base[ax];
    CV *cv;

    if(items <= 1) {
	XSRETURN_UNDEF;
    }
    cv = sv_2cv(block, &stash, &gv, 0);
    if (cv == Nullcv) {
       croak("Not a subroutine reference");
    }
    PUSH_MULTICALL(cv);
    agv = gv_fetchpv("a", TRUE, SVt_PV);
    bgv = gv_fetchpv("b", TRUE, SVt_PV);
    SAVESPTR(GvSV(agv));
    SAVESPTR(GvSV(bgv));
    GvSV(agv) = ret;
    SvSetSV(ret, args[1]);
    for(index = 2 ; index < items ; index++) {
	GvSV(bgv) = args[index];
	MULTICALL;
	SvSetSV(ret, *PL_stack_sp);
    }
    POP_MULTICALL;
    ST(0) = ret;
    XSRETURN(1);
}
#line 415 "ListUtil.c"
    }
    XSRETURN(1);
}


XS(XS_List__Util_first); /* prototype to pass -Wmissing-prototypes */
XS(XS_List__Util_first)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
    if (items < 1)
       croak_xs_usage(cv,  "block, ...");
    {
	SV *	block = ST(0);
#line 323 "ListUtil.xs"
{
    dVAR; dMULTICALL;
    int index;
    GV *gv;
    HV *stash;
    I32 gimme = G_SCALAR;
    SV **args = &PL_stack_base[ax];
    CV *cv;

    if(items <= 1) {
	XSRETURN_UNDEF;
    }
    cv = sv_2cv(block, &stash, &gv, 0);
    if (cv == Nullcv) {
       croak("Not a subroutine reference");
    }
    PUSH_MULTICALL(cv);
    SAVESPTR(GvSV(PL_defgv));

    for(index = 1 ; index < items ; index++) {
	GvSV(PL_defgv) = args[index];
	MULTICALL;
	if (SvTRUE(*PL_stack_sp)) {
	  POP_MULTICALL;
	  ST(0) = ST(index);
	  XSRETURN(1);
	}
    }
    POP_MULTICALL;
    XSRETURN_UNDEF;
}
#line 465 "ListUtil.c"
    }
    XSRETURN(1);
}

#endif

XS(XS_List__Util_shuffle); /* prototype to pass -Wmissing-prototypes */
XS(XS_List__Util_shuffle)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
    PERL_UNUSED_VAR(cv); /* -W */
    {
#line 361 "ListUtil.xs"
{
    dVAR;
    int index;
#if (PERL_VERSION < 9)
    struct op dmy_op;
    struct op *old_op = PL_op;

    /* We call pp_rand here so that Drand01 get initialized if rand()
       or srand() has not already been called
    */
    memzero((char*)(&dmy_op), sizeof(struct op));
    /* we let pp_rand() borrow the TARG allocated for this XS sub */
    dmy_op.op_targ = PL_op->op_targ;
    PL_op = &dmy_op;
    (void)*(PL_ppaddr[OP_RAND])(aTHX);
    PL_op = old_op;
#else
    /* Initialize Drand01 if rand() or srand() has
       not already been called
    */
    if (!PL_srand_called) {
        (void)seedDrand01((Rand_seed_t)Perl_seed(aTHX));
        PL_srand_called = TRUE;
    }
#endif

    for (index = items ; index > 1 ; ) {
	int swap = (int)(Drand01() * (double)(index--));
	SV *tmp = ST(swap);
	ST(swap) = ST(index);
	ST(index) = tmp;
    }
    XSRETURN(items);
}
#line 517 "ListUtil.c"
    }
    XSRETURN(1);
}


XS(XS_Scalar__Util_dualvar); /* prototype to pass -Wmissing-prototypes */
XS(XS_Scalar__Util_dualvar)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
    if (items != 2)
       croak_xs_usage(cv,  "num, str");
    {
	SV *	num = ST(0);
	SV *	str = ST(1);
#line 405 "ListUtil.xs"
{
    STRLEN len;
    char *ptr = SvPV(str,len);
    ST(0) = sv_newmortal();
    (void)SvUPGRADE(ST(0),SVt_PVNV);
    sv_setpvn(ST(0),ptr,len);
    if (SvUTF8(str))
        SvUTF8_on(ST(0));
    if(SvNOK(num) || SvPOK(num) || SvMAGICAL(num)) {
	SvNV_set(ST(0), SvNV(num));
	SvNOK_on(ST(0));
    }
#ifdef SVf_IVisUV
    else if (SvUOK(num)) {
	SvUV_set(ST(0), SvUV(num));
	SvIOK_on(ST(0));
	SvIsUV_on(ST(0));
    }
#endif
    else {
	SvIV_set(ST(0), SvIV(num));
	SvIOK_on(ST(0));
    }
    if(PL_tainting && (SvTAINTED(num) || SvTAINTED(str)))
	SvTAINTED_on(ST(0));
    XSRETURN(1);
}
#line 564 "ListUtil.c"
    }
    XSRETURN(1);
}


XS(XS_Scalar__Util_blessed); /* prototype to pass -Wmissing-prototypes */
XS(XS_Scalar__Util_blessed)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
    if (items != 1)
       croak_xs_usage(cv,  "sv");
    {
	SV *	sv = ST(0);
	char *	RETVAL;
	dXSTARG;
#line 438 "ListUtil.xs"
{
    if (SvMAGICAL(sv))
	mg_get(sv);
    if(!sv_isobject(sv)) {
	XSRETURN_UNDEF;
    }
    RETVAL = (char*)sv_reftype(SvRV(sv),TRUE);
}
#line 593 "ListUtil.c"
	sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
    }
    XSRETURN(1);
}


XS(XS_Scalar__Util_reftype); /* prototype to pass -Wmissing-prototypes */
XS(XS_Scalar__Util_reftype)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
    if (items != 1)
       croak_xs_usage(cv,  "sv");
    {
	SV *	sv = ST(0);
	char *	RETVAL;
	dXSTARG;
#line 454 "ListUtil.xs"
{
    if (SvMAGICAL(sv))
	mg_get(sv);
    if(!SvROK(sv)) {
	XSRETURN_UNDEF;
    }
    RETVAL = (char*)sv_reftype(SvRV(sv),FALSE);
}
#line 623 "ListUtil.c"
	sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
    }
    XSRETURN(1);
}


XS(XS_Scalar__Util_refaddr); /* prototype to pass -Wmissing-prototypes */
XS(XS_Scalar__Util_refaddr)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
    if (items != 1)
       croak_xs_usage(cv,  "sv");
    {
	SV *	sv = ST(0);
	UV	RETVAL;
	dXSTARG;
#line 470 "ListUtil.xs"
{
    if (SvMAGICAL(sv))
	mg_get(sv);
    if(!SvROK(sv)) {
	XSRETURN_UNDEF;
    }
    RETVAL = PTR2UV(SvRV(sv));
}
#line 653 "ListUtil.c"
	XSprePUSH; PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS(XS_Scalar__Util_weaken); /* prototype to pass -Wmissing-prototypes */
XS(XS_Scalar__Util_weaken)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
    if (items != 1)
       croak_xs_usage(cv,  "sv");
    {
	SV *	sv = ST(0);
#line 486 "ListUtil.xs"
#ifdef SvWEAKREF
	sv_rvweaken(sv);
#else
	croak("weak references are not implemented in this release of perl");
#endif
#line 678 "ListUtil.c"
    }
    XSRETURN_EMPTY;
}


XS(XS_Scalar__Util_isweak); /* prototype to pass -Wmissing-prototypes */
XS(XS_Scalar__Util_isweak)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
    if (items != 1)
       croak_xs_usage(cv,  "sv");
    {
	SV *	sv = ST(0);
#line 497 "ListUtil.xs"
#ifdef SvWEAKREF
	ST(0) = boolSV(SvROK(sv) && SvWEAKREF(sv));
	XSRETURN(1);
#else
	croak("weak references are not implemented in this release of perl");
#endif
#line 703 "ListUtil.c"
    }
    XSRETURN(1);
}


XS(XS_Scalar__Util_readonly); /* prototype to pass -Wmissing-prototypes */
XS(XS_Scalar__Util_readonly)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
    if (items != 1)
       croak_xs_usage(cv,  "sv");
    {
	SV *	sv = ST(0);
	int	RETVAL;
	dXSTARG;
#line 509 "ListUtil.xs"
  RETVAL = SvREADONLY(sv);
#line 725 "ListUtil.c"
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS(XS_Scalar__Util_tainted); /* prototype to pass -Wmissing-prototypes */
XS(XS_Scalar__Util_tainted)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
    if (items != 1)
       croak_xs_usage(cv,  "sv");
    {
	SV *	sv = ST(0);
	int	RETVAL;
	dXSTARG;
#line 518 "ListUtil.xs"
  RETVAL = SvTAINTED(sv);
#line 748 "ListUtil.c"
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS(XS_Scalar__Util_isvstring); /* prototype to pass -Wmissing-prototypes */
XS(XS_Scalar__Util_isvstring)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
    if (items != 1)
       croak_xs_usage(cv,  "sv");
    {
	SV *	sv = ST(0);
#line 527 "ListUtil.xs"
#ifdef SvVOK
  ST(0) = boolSV(SvVOK(sv));
  XSRETURN(1);
#else
	croak("vstrings are not implemented in this release of perl");
#endif
#line 774 "ListUtil.c"
    }
    XSRETURN(1);
}


XS(XS_Scalar__Util_looks_like_number); /* prototype to pass -Wmissing-prototypes */
XS(XS_Scalar__Util_looks_like_number)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
    if (items != 1)
       croak_xs_usage(cv,  "sv");
    {
	SV *	sv = ST(0);
	int	RETVAL;
	dXSTARG;
#line 539 "ListUtil.xs"
  SV *tempsv;
  if (SvAMAGIC(sv) && (tempsv = AMG_CALLun(sv, numer))) {
    sv = tempsv;
  }
  else if (SvMAGICAL(sv)) {
      SvGETMAGIC(sv);
  }
#if (PERL_VERSION < 8) || (PERL_VERSION == 8 && PERL_SUBVERSION <5)
  if (SvPOK(sv) || SvPOKp(sv)) {
    RETVAL = looks_like_number(sv);
  }
  else {
    RETVAL = SvFLAGS(sv) & (SVf_NOK|SVp_NOK|SVf_IOK|SVp_IOK);
  }
#else
  RETVAL = looks_like_number(sv);
#endif
#line 812 "ListUtil.c"
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS(XS_Scalar__Util_set_prototype); /* prototype to pass -Wmissing-prototypes */
XS(XS_Scalar__Util_set_prototype)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
    if (items != 2)
       croak_xs_usage(cv,  "subref, proto");
    {
	SV *	subref = ST(0);
	SV *	proto = ST(1);
#line 565 "ListUtil.xs"
{
    if (SvROK(subref)) {
	SV *sv = SvRV(subref);
	if (SvTYPE(sv) != SVt_PVCV) {
	    /* not a subroutine reference */
	    croak("set_prototype: not a subroutine reference");
	}
	if (SvPOK(proto)) {
	    /* set the prototype */
	    STRLEN len;
	    char *ptr = SvPV(proto, len);
	    sv_setpvn(sv, ptr, len);
	}
	else {
	    /* delete the prototype */
	    SvPOK_off(sv);
	}
    }
    else {
	croak("set_prototype: not a reference");
    }
    XSRETURN(1);
}
#line 856 "ListUtil.c"
    }
    XSRETURN_EMPTY;
}

#ifdef __cplusplus
extern "C"
#endif
XS(boot_List__Util); /* prototype to pass -Wmissing-prototypes */
XS(boot_List__Util)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
#if (PERL_REVISION == 5 && PERL_VERSION < 9)
    char* file = __FILE__;
#else
    const char* file = __FILE__;
#endif

    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
    XS_VERSION_BOOTCHECK ;

    {
        CV * cv ;

        cv = newXSproto_portable("List::Util::max", XS_List__Util_min, file, "@");
        XSANY.any_i32 = 1 ;
        cv = newXSproto_portable("List::Util::min", XS_List__Util_min, file, "@");
        XSANY.any_i32 = 0 ;
        (void)newXSproto_portable("List::Util::sum", XS_List__Util_sum, file, "@");
        cv = newXSproto_portable("List::Util::minstr", XS_List__Util_minstr, file, "@");
        XSANY.any_i32 = 2 ;
        cv = newXSproto_portable("List::Util::maxstr", XS_List__Util_minstr, file, "@");
        XSANY.any_i32 = 0 ;
#if XSubPPtmpAAAA
        (void)newXSproto_portable("List::Util::reduce", XS_List__Util_reduce, file, "&@");
        (void)newXSproto_portable("List::Util::first", XS_List__Util_first, file, "&@");
#endif
        (void)newXSproto_portable("List::Util::shuffle", XS_List__Util_shuffle, file, "@");
        (void)newXSproto_portable("Scalar::Util::dualvar", XS_Scalar__Util_dualvar, file, "$$");
        (void)newXSproto_portable("Scalar::Util::blessed", XS_Scalar__Util_blessed, file, "$");
        (void)newXSproto_portable("Scalar::Util::reftype", XS_Scalar__Util_reftype, file, "$");
        (void)newXSproto_portable("Scalar::Util::refaddr", XS_Scalar__Util_refaddr, file, "$");
        (void)newXSproto_portable("Scalar::Util::weaken", XS_Scalar__Util_weaken, file, "$");
        (void)newXSproto_portable("Scalar::Util::isweak", XS_Scalar__Util_isweak, file, "$");
        (void)newXSproto_portable("Scalar::Util::readonly", XS_Scalar__Util_readonly, file, "$");
        (void)newXSproto_portable("Scalar::Util::tainted", XS_Scalar__Util_tainted, file, "$");
        (void)newXSproto_portable("Scalar::Util::isvstring", XS_Scalar__Util_isvstring, file, "$");
        (void)newXSproto_portable("Scalar::Util::looks_like_number", XS_Scalar__Util_looks_like_number, file, "$");
        (void)newXSproto_portable("Scalar::Util::set_prototype", XS_Scalar__Util_set_prototype, file, "&$");
    }

    /* Initialisation Section */

#if XSubPPtmpAAAA
#endif
#line 590 "ListUtil.xs"
{
    HV *lu_stash = gv_stashpvn("List::Util", 10, TRUE);
    GV *rmcgv = *(GV**)hv_fetch(lu_stash, "REAL_MULTICALL", 14, TRUE);
    SV *rmcsv;
#if !defined(SvWEAKREF) || !defined(SvVOK)
    HV *su_stash = gv_stashpvn("Scalar::Util", 12, TRUE);
    GV *vargv = *(GV**)hv_fetch(su_stash, "EXPORT_FAIL", 11, TRUE);
    AV *varav;
    if (SvTYPE(vargv) != SVt_PVGV)
	gv_init(vargv, su_stash, "Scalar::Util", 12, TRUE);
    varav = GvAVn(vargv);
#endif
    if (SvTYPE(rmcgv) != SVt_PVGV)
	gv_init(rmcgv, lu_stash, "List::Util", 12, TRUE);
    rmcsv = GvSVn(rmcgv);
#ifndef SvWEAKREF
    av_push(varav, newSVpv("weaken",6));
    av_push(varav, newSVpv("isweak",6));
#endif
#ifndef SvVOK
    av_push(varav, newSVpv("isvstring",9));
#endif
#ifdef REAL_MULTICALL
    sv_setsv(rmcsv, &PL_sv_yes);
#else
    sv_setsv(rmcsv, &PL_sv_no);
#endif
}

#line 946 "ListUtil.c"

    /* End of Initialisation Section */

#if (PERL_REVISION == 5 && PERL_VERSION >= 9)
  if (PL_unitcheckav)
       call_list(PL_scopestack_ix, PL_unitcheckav);
#endif
    XSRETURN_YES;
}

