/* File: benchmarksmodule.c
 * This file is auto-generated with f2py (version:1.24.2).
 * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition,
 * written by Pearu Peterson <pearu@cens.ioc.ee>.
 * Generation date: Mon Feb  6 11:33:16 2023
 * Do not edit this file directly unless you know what you are doing!!!
 */

#ifdef __cplusplus
extern "C" {
#endif

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */

/* Unconditionally included */
#include <Python.h>
#include <numpy/npy_os.h>

/*********************** See f2py2e/cfuncs.py: includes ***********************/
#include "fortranobject.h"
#include <string.h>
#include <math.h>

/**************** See f2py2e/rules.py: mod_rules['modulebody'] ****************/
static PyObject *benchmarks_error;
static PyObject *benchmarks_module;

/*********************** See f2py2e/cfuncs.py: typedefs ***********************/
typedef char * string;
typedef char character;

/****************** See f2py2e/cfuncs.py: typedefs_generated ******************/
/*need_typedefs_generated*/

/********************** See f2py2e/cfuncs.py: cppmacros **********************/
\
#define FAILNULL(p) do {                                            \
    if ((p) == NULL) {                                              \
        PyErr_SetString(PyExc_MemoryError, "NULL pointer found");   \
        goto capi_fail;                                             \
    }                                                               \
} while (0)

#define STRINGMALLOC(str,len)\
    if ((str = (string)malloc(len+1)) == NULL) {\
        PyErr_SetString(PyExc_MemoryError, "out of memory");\
        goto capi_fail;\
    } else {\
        (str)[len] = '\0';\
    }

#if defined(PREPEND_FORTRAN)
#if defined(NO_APPEND_FORTRAN)
#if defined(UPPERCASE_FORTRAN)
#define F_FUNC(f,F) _##F
#else
#define F_FUNC(f,F) _##f
#endif
#else
#if defined(UPPERCASE_FORTRAN)
#define F_FUNC(f,F) _##F##_
#else
#define F_FUNC(f,F) _##f##_
#endif
#endif
#else
#if defined(NO_APPEND_FORTRAN)
#if defined(UPPERCASE_FORTRAN)
#define F_FUNC(f,F) F
#else
#define F_FUNC(f,F) f
#endif
#else
#if defined(UPPERCASE_FORTRAN)
#define F_FUNC(f,F) F##_
#else
#define F_FUNC(f,F) f##_
#endif
#endif
#endif
#if defined(UNDERSCORE_G77)
#define F_FUNC_US(f,F) F_FUNC(f##_,F##_)
#else
#define F_FUNC_US(f,F) F_FUNC(f,F)
#endif

/* See fortranobject.h for definitions. The macros here are provided for BC. */
#define rank f2py_rank
#define shape f2py_shape
#define fshape f2py_shape
#define len f2py_len
#define flen f2py_flen
#define slen f2py_slen
#define size f2py_size

#define STRINGFREE(str) do {if (!(str == NULL)) free(str);} while (0)

/*
STRINGPADN replaces null values with padding values from the right.

`to` must have size of at least N bytes.

If the `to[N-1]` has null value, then replace it and all the
preceding, nulls with the given padding.

STRINGPADN(to, N, PADDING, NULLVALUE) is an inverse operation.
*/
#define STRINGPADN(to, N, NULLVALUE, PADDING)                   \
    do {                                                        \
        int _m = (N);                                           \
        char *_to = (to);                                       \
        for (_m -= 1; _m >= 0 && _to[_m] == NULLVALUE; _m--) {  \
             _to[_m] = PADDING;                                 \
        }                                                       \
    } while (0)

#define CHECKSCALAR(check,tcheck,name,show,var)\
    if (!(check)) {\
        char errstring[256];\
        sprintf(errstring, "%s: "show, "("tcheck") failed for "name, var);\
        PyErr_SetString(benchmarks_error,errstring);\
        /*goto capi_fail;*/\
    } else 
#ifdef DEBUGCFUNCS
#define CFUNCSMESS(mess) fprintf(stderr,"debug-capi:"mess);
#define CFUNCSMESSPY(mess,obj) CFUNCSMESS(mess) \
    PyObject_Print((PyObject *)obj,stderr,Py_PRINT_RAW);\
    fprintf(stderr,"\n");
#else
#define CFUNCSMESS(mess)
#define CFUNCSMESSPY(mess,obj)
#endif

#ifndef max
#define max(a,b) ((a > b) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) ((a < b) ? (a) : (b))
#endif
#ifndef MAX
#define MAX(a,b) ((a > b) ? (a) : (b))
#endif
#ifndef MIN
#define MIN(a,b) ((a < b) ? (a) : (b))
#endif

/*
STRINGCOPYN copies N bytes.

`to` and `from` buffers must have sizes of at least N bytes.
*/
#define STRINGCOPYN(to,from,N)                                  \
    do {                                                        \
        int _m = (N);                                           \
        char *_to = (to);                                       \
        char *_from = (from);                                   \
        FAILNULL(_to); FAILNULL(_from);                         \
        (void)strncpy(_to, _from, _m);             \
    } while (0)


/************************ See f2py2e/cfuncs.py: cfuncs ************************/
static int
character_from_pyobj(character* v, PyObject *obj, const char *errmess) {
    if (PyBytes_Check(obj)) {
        /* empty bytes has trailing null, so dereferencing is always safe */
        *v = PyBytes_AS_STRING(obj)[0];
        return 1;
    } else if (PyUnicode_Check(obj)) {
        PyObject* tmp = PyUnicode_AsASCIIString(obj);
        if (tmp != NULL) {
            *v = PyBytes_AS_STRING(tmp)[0];
            Py_DECREF(tmp);
            return 1;
        }
    } else if (PyArray_Check(obj)) {
        PyArrayObject* arr = (PyArrayObject*)obj;
        if (F2PY_ARRAY_IS_CHARACTER_COMPATIBLE(arr)) {
            *v = PyArray_BYTES(arr)[0];
            return 1;
        } else if (F2PY_IS_UNICODE_ARRAY(arr)) {
            // TODO: update when numpy will support 1-byte and
            // 2-byte unicode dtypes
            PyObject* tmp = PyUnicode_FromKindAndData(
                              PyUnicode_4BYTE_KIND,
                              PyArray_BYTES(arr),
                              (PyArray_NBYTES(arr)>0?1:0));
            if (tmp != NULL) {
                if (character_from_pyobj(v, tmp, errmess)) {
                    Py_DECREF(tmp);
                    return 1;
                }
                Py_DECREF(tmp);
            }
        }
    } else if (PySequence_Check(obj)) {
        PyObject* tmp = PySequence_GetItem(obj,0);
        if (tmp != NULL) {
            if (character_from_pyobj(v, tmp, errmess)) {
                Py_DECREF(tmp);
                return 1;
            }
            Py_DECREF(tmp);
        }
    }
    {
        char mess[F2PY_MESSAGE_BUFFER_SIZE];
        strcpy(mess, errmess);
        PyObject* err = PyErr_Occurred();
        if (err == NULL) {
            err = PyExc_TypeError;
        }
        sprintf(mess + strlen(mess),
                " -- expected str|bytes|sequence-of-str-or-bytes, got ");
        f2py_describe(obj, mess + strlen(mess));
        PyErr_SetString(err, mess);
    }
    return 0;
}

static int
int_from_pyobj(int* v, PyObject *obj, const char *errmess)
{
    PyObject* tmp = NULL;

    if (PyLong_Check(obj)) {
        *v = Npy__PyLong_AsInt(obj);
        return !(*v == -1 && PyErr_Occurred());
    }

    tmp = PyNumber_Long(obj);
    if (tmp) {
        *v = Npy__PyLong_AsInt(tmp);
        Py_DECREF(tmp);
        return !(*v == -1 && PyErr_Occurred());
    }

    if (PyComplex_Check(obj)) {
        PyErr_Clear();
        tmp = PyObject_GetAttrString(obj,"real");
    }
    else if (PyBytes_Check(obj) || PyUnicode_Check(obj)) {
        /*pass*/;
    }
    else if (PySequence_Check(obj)) {
        PyErr_Clear();
        tmp = PySequence_GetItem(obj, 0);
    }

    if (tmp) {
        if (int_from_pyobj(v, tmp, errmess)) {
            Py_DECREF(tmp);
            return 1;
        }
        Py_DECREF(tmp);
    }

    {
        PyObject* err = PyErr_Occurred();
        if (err == NULL) {
            err = benchmarks_error;
        }
        PyErr_SetString(err, errmess);
    }
    return 0;
}

/*
  Create a new string buffer `str` of at most length `len` from a
  Python string-like object `obj`.

  The string buffer has given size (len) or the size of inistr when len==-1.

  The string buffer is padded with blanks: in Fortran, trailing blanks
  are insignificant contrary to C nulls.
 */
static int
string_from_pyobj(string *str, int *len, const string inistr, PyObject *obj,
                  const char *errmess)
{
    PyObject *tmp = NULL;
    string buf = NULL;
    npy_intp n = -1;
#ifdef DEBUGCFUNCS
fprintf(stderr,"string_from_pyobj(str='%s',len=%d,inistr='%s',obj=%p)\n",
               (char*)str, *len, (char *)inistr, obj);
#endif
    if (obj == Py_None) {
        n = strlen(inistr);
        buf = inistr;
    }
    else if (PyArray_Check(obj)) {
        PyArrayObject *arr = (PyArrayObject *)obj;
        if (!ISCONTIGUOUS(arr)) {
            PyErr_SetString(PyExc_ValueError,
                            "array object is non-contiguous.");
            goto capi_fail;
        }
        n = PyArray_NBYTES(arr);
        buf = PyArray_DATA(arr);
        n = strnlen(buf, n);
    }
    else {
        if (PyBytes_Check(obj)) {
            tmp = obj;
            Py_INCREF(tmp);
        }
        else if (PyUnicode_Check(obj)) {
            tmp = PyUnicode_AsASCIIString(obj);
        }
        else {
            PyObject *tmp2;
            tmp2 = PyObject_Str(obj);
            if (tmp2) {
                tmp = PyUnicode_AsASCIIString(tmp2);
                Py_DECREF(tmp2);
            }
            else {
                tmp = NULL;
            }
        }
        if (tmp == NULL) goto capi_fail;
        n = PyBytes_GET_SIZE(tmp);
        buf = PyBytes_AS_STRING(tmp);
    }
    if (*len == -1) {
        /* TODO: change the type of `len` so that we can remove this */
        if (n > NPY_MAX_INT) {
            PyErr_SetString(PyExc_OverflowError,
                            "object too large for a 32-bit int");
            goto capi_fail;
        }
        *len = n;
    }
    else if (*len < n) {
        /* discard the last (len-n) bytes of input buf */
        n = *len;
    }
    if (n < 0 || *len < 0 || buf == NULL) {
        goto capi_fail;
    }
    STRINGMALLOC(*str, *len);  // *str is allocated with size (*len + 1)
    if (n < *len) {
        /*
          Pad fixed-width string with nulls. The caller will replace
          nulls with blanks when the corresponding argument is not
          intent(c).
        */
        memset(*str + n, '\0', *len - n);
    }
    STRINGCOPYN(*str, buf, n);
    Py_XDECREF(tmp);
    return 1;
capi_fail:
    Py_XDECREF(tmp);
    {
        PyObject* err = PyErr_Occurred();
        if (err == NULL) {
            err = benchmarks_error;
        }
        PyErr_SetString(err, errmess);
    }
    return 0;
}


/********************* See f2py2e/cfuncs.py: userincludes *********************/
/*need_userincludes*/

/********************* See f2py2e/capi_rules.py: usercode *********************/


/* See f2py2e/rules.py */
extern void F_FUNC(bb03ad,BB03AD)(character*,int*,double*,int*,int*,int*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,string,double*,int*,int*,size_t);
extern void F_FUNC(bb04ad,BB04AD)(character*,int*,double*,int*,int*,int*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,string,double*,int*,int*,size_t);
/*eof externroutines*/

/******************** See f2py2e/capi_rules.py: usercode1 ********************/


/******************* See f2py2e/cb_rules.py: buildcallback *******************/
/*need_callbacks*/

/*********************** See f2py2e/rules.py: buildapi ***********************/

/*********************************** bb03ad ***********************************/
static char doc_f2py_rout_benchmarks_bb03ad[] = "\
e,a,y,x = bb03ad(def,nr,dpar,ipar,vec,n,m,e,a,y,b,x,u,dwork,[lde,lda,ldy,ldb,ldx,ldu,note,ldwork,info,overwrite_e,overwrite_a,overwrite_y,overwrite_x])\n\nWrapper for ``bb03ad``.\
\n\nParameters\n----------\n"
"def : input bytes\n"
"nr : input rank-1 array('i') with bounds (*)\n"
"dpar : input rank-1 array('d') with bounds (*)\n"
"ipar : input rank-1 array('i') with bounds (*)\n"
"vec : input rank-1 array('i') with bounds (8)\n"
"n : input int\n"
"m : input int\n"
"e : input rank-2 array('d') with bounds (lde,*)\n"
"a : input rank-2 array('d') with bounds (lda,*)\n"
"y : input rank-2 array('d') with bounds (ldy,*)\n"
"b : input rank-2 array('d') with bounds (ldb,*)\n"
"x : input rank-2 array('d') with bounds (ldx,*)\n"
"u : input rank-2 array('d') with bounds (ldu,*)\n"
"dwork : input rank-1 array('d') with bounds (ldwork)\n"
"\nOther Parameters\n----------------\n"
"overwrite_e : input int, optional\n    Default: 0\n"
"lde : input int, optional\n    Default: shape(e,0)\n"
"overwrite_a : input int, optional\n    Default: 0\n"
"lda : input int, optional\n    Default: shape(a,0)\n"
"overwrite_y : input int, optional\n    Default: 0\n"
"ldy : input int, optional\n    Default: shape(y,0)\n"
"ldb : input int, optional\n    Default: shape(b,0)\n"
"overwrite_x : input int, optional\n    Default: 0\n"
"ldx : input int, optional\n    Default: shape(x,0)\n"
"ldu : input int, optional\n    Default: shape(u,0)\n"
"note : input string(len=70)\n"
"ldwork : input int, optional\n    Default: len(dwork)\n"
"info : input int\n"
"\nReturns\n-------\n"
"e : rank-2 array('d') with bounds (lde,*)\n"
"a : rank-2 array('d') with bounds (lda,*)\n"
"y : rank-2 array('d') with bounds (ldy,*)\n"
"x : rank-2 array('d') with bounds (ldx,*)";
/* extern void F_FUNC(bb03ad,BB03AD)(character*,int*,double*,int*,int*,int*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,string,double*,int*,int*,size_t); */
static PyObject *f2py_rout_benchmarks_bb03ad(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(character*,int*,double*,int*,int*,int*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,string,double*,int*,int*,size_t)) {
    PyObject * volatile capi_buildvalue = NULL;
    volatile int f2py_success = 1;
/*decl*/

    character def = 0;
    PyObject *def_capi = Py_None;
    int *nr = NULL;
    npy_intp nr_Dims[1] = {-1};
    const int nr_Rank = 1;
    PyArrayObject *capi_nr_as_array = NULL;
    int capi_nr_intent = 0;
    PyObject *nr_capi = Py_None;
    double *dpar = NULL;
    npy_intp dpar_Dims[1] = {-1};
    const int dpar_Rank = 1;
    PyArrayObject *capi_dpar_as_array = NULL;
    int capi_dpar_intent = 0;
    PyObject *dpar_capi = Py_None;
    int *ipar = NULL;
    npy_intp ipar_Dims[1] = {-1};
    const int ipar_Rank = 1;
    PyArrayObject *capi_ipar_as_array = NULL;
    int capi_ipar_intent = 0;
    PyObject *ipar_capi = Py_None;
    int *vec = NULL;
    npy_intp vec_Dims[1] = {-1};
    const int vec_Rank = 1;
    PyArrayObject *capi_vec_as_array = NULL;
    int capi_vec_intent = 0;
    PyObject *vec_capi = Py_None;
    int n = 0;
    PyObject *n_capi = Py_None;
    int m = 0;
    PyObject *m_capi = Py_None;
    double *e = NULL;
    npy_intp e_Dims[2] = {-1, -1};
    const int e_Rank = 2;
    PyArrayObject *capi_e_as_array = NULL;
    int capi_e_intent = 0;
    int capi_overwrite_e = 0;
    PyObject *e_capi = Py_None;
    int lde = 0;
    PyObject *lde_capi = Py_None;
    double *a = NULL;
    npy_intp a_Dims[2] = {-1, -1};
    const int a_Rank = 2;
    PyArrayObject *capi_a_as_array = NULL;
    int capi_a_intent = 0;
    int capi_overwrite_a = 0;
    PyObject *a_capi = Py_None;
    int lda = 0;
    PyObject *lda_capi = Py_None;
    double *y = NULL;
    npy_intp y_Dims[2] = {-1, -1};
    const int y_Rank = 2;
    PyArrayObject *capi_y_as_array = NULL;
    int capi_y_intent = 0;
    int capi_overwrite_y = 0;
    PyObject *y_capi = Py_None;
    int ldy = 0;
    PyObject *ldy_capi = Py_None;
    double *b = NULL;
    npy_intp b_Dims[2] = {-1, -1};
    const int b_Rank = 2;
    PyArrayObject *capi_b_as_array = NULL;
    int capi_b_intent = 0;
    PyObject *b_capi = Py_None;
    int ldb = 0;
    PyObject *ldb_capi = Py_None;
    double *x = NULL;
    npy_intp x_Dims[2] = {-1, -1};
    const int x_Rank = 2;
    PyArrayObject *capi_x_as_array = NULL;
    int capi_x_intent = 0;
    int capi_overwrite_x = 0;
    PyObject *x_capi = Py_None;
    int ldx = 0;
    PyObject *ldx_capi = Py_None;
    double *u = NULL;
    npy_intp u_Dims[2] = {-1, -1};
    const int u_Rank = 2;
    PyArrayObject *capi_u_as_array = NULL;
    int capi_u_intent = 0;
    PyObject *u_capi = Py_None;
    int ldu = 0;
    PyObject *ldu_capi = Py_None;
    string note = NULL;
    int slen(note);
    PyObject *note_capi = Py_None;
    double *dwork = NULL;
    npy_intp dwork_Dims[1] = {-1};
    const int dwork_Rank = 1;
    PyArrayObject *capi_dwork_as_array = NULL;
    int capi_dwork_intent = 0;
    PyObject *dwork_capi = Py_None;
    int ldwork = 0;
    PyObject *ldwork_capi = Py_None;
    int info = 0;
    PyObject *info_capi = Py_None;
    static char *capi_kwlist[] = {"def","nr","dpar","ipar","vec","n","m","e","a","y","b","x","u","dwork","lde","lda","ldy","ldb","ldx","ldu","note","ldwork","info","overwrite_e","overwrite_a","overwrite_y","overwrite_x",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
    if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
        "OOOOOOOOOOOOOO|OOOOOOOOOiiii:benchmarks.bb03ad",\
        capi_kwlist,&def_capi,&nr_capi,&dpar_capi,&ipar_capi,&vec_capi,&n_capi,&m_capi,&e_capi,&a_capi,&y_capi,&b_capi,&x_capi,&u_capi,&dwork_capi,&lde_capi,&lda_capi,&ldy_capi,&ldb_capi,&ldx_capi,&ldu_capi,&note_capi,&ldwork_capi,&info_capi,&capi_overwrite_e,&capi_overwrite_a,&capi_overwrite_y,&capi_overwrite_x))
        return NULL;
/*frompyobj*/
    /* Processing variable def */
        f2py_success = character_from_pyobj(&def,def_capi,"benchmarks.bb03ad() 1st argument (def) can't be converted to character");
    if (f2py_success) {
    /* Processing variable nr */
    ;
    capi_nr_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "benchmarks.benchmarks.bb03ad: failed to create array from the 2nd argument `nr`";
    capi_nr_as_array = ndarray_from_pyobj(  NPY_INT,1,nr_Dims,nr_Rank,  capi_nr_intent,nr_capi,capi_errmess);
    if (capi_nr_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = benchmarks_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        nr = (int *)(PyArray_DATA(capi_nr_as_array));

    /* Processing variable dpar */
    ;
    capi_dpar_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "benchmarks.benchmarks.bb03ad: failed to create array from the 3rd argument `dpar`";
    capi_dpar_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,dpar_Dims,dpar_Rank,  capi_dpar_intent,dpar_capi,capi_errmess);
    if (capi_dpar_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = benchmarks_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        dpar = (double *)(PyArray_DATA(capi_dpar_as_array));

    /* Processing variable ipar */
    ;
    capi_ipar_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "benchmarks.benchmarks.bb03ad: failed to create array from the 4th argument `ipar`";
    capi_ipar_as_array = ndarray_from_pyobj(  NPY_INT,1,ipar_Dims,ipar_Rank,  capi_ipar_intent,ipar_capi,capi_errmess);
    if (capi_ipar_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = benchmarks_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        ipar = (int *)(PyArray_DATA(capi_ipar_as_array));

    /* Processing variable vec */
    vec_Dims[0]=8;
    capi_vec_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "benchmarks.benchmarks.bb03ad: failed to create array from the 5th argument `vec`";
    capi_vec_as_array = ndarray_from_pyobj(  NPY_INT,1,vec_Dims,vec_Rank,  capi_vec_intent,vec_capi,capi_errmess);
    if (capi_vec_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = benchmarks_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        vec = (int *)(PyArray_DATA(capi_vec_as_array));

    /* Processing variable n */
        f2py_success = int_from_pyobj(&n,n_capi,"benchmarks.bb03ad() 6th argument (n) can't be converted to int");
    if (f2py_success) {
    /* Processing variable m */
        f2py_success = int_from_pyobj(&m,m_capi,"benchmarks.bb03ad() 7th argument (m) can't be converted to int");
    if (f2py_success) {
    /* Processing variable e */
    capi_e_intent |= (capi_overwrite_e?0:F2PY_INTENT_COPY);
    ;
    capi_e_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    const char * capi_errmess = "benchmarks.benchmarks.bb03ad: failed to create array from the 8th argument `e`";
    capi_e_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,e_Dims,e_Rank,  capi_e_intent,e_capi,capi_errmess);
    if (capi_e_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = benchmarks_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        e = (double *)(PyArray_DATA(capi_e_as_array));

    /* Processing variable a */
    capi_a_intent |= (capi_overwrite_a?0:F2PY_INTENT_COPY);
    ;
    capi_a_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    const char * capi_errmess = "benchmarks.benchmarks.bb03ad: failed to create array from the 9th argument `a`";
    capi_a_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,a_Dims,a_Rank,  capi_a_intent,a_capi,capi_errmess);
    if (capi_a_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = benchmarks_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        a = (double *)(PyArray_DATA(capi_a_as_array));

    /* Processing variable y */
    capi_y_intent |= (capi_overwrite_y?0:F2PY_INTENT_COPY);
    ;
    capi_y_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    const char * capi_errmess = "benchmarks.benchmarks.bb03ad: failed to create array from the 10th argument `y`";
    capi_y_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,y_Dims,y_Rank,  capi_y_intent,y_capi,capi_errmess);
    if (capi_y_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = benchmarks_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        y = (double *)(PyArray_DATA(capi_y_as_array));

    /* Processing variable b */
    ;
    capi_b_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "benchmarks.benchmarks.bb03ad: failed to create array from the 11st argument `b`";
    capi_b_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,b_Dims,b_Rank,  capi_b_intent,b_capi,capi_errmess);
    if (capi_b_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = benchmarks_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        b = (double *)(PyArray_DATA(capi_b_as_array));

    /* Processing variable x */
    capi_x_intent |= (capi_overwrite_x?0:F2PY_INTENT_COPY);
    ;
    capi_x_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    const char * capi_errmess = "benchmarks.benchmarks.bb03ad: failed to create array from the 12nd argument `x`";
    capi_x_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,x_Dims,x_Rank,  capi_x_intent,x_capi,capi_errmess);
    if (capi_x_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = benchmarks_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        x = (double *)(PyArray_DATA(capi_x_as_array));

    /* Processing variable u */
    ;
    capi_u_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "benchmarks.benchmarks.bb03ad: failed to create array from the 13rd argument `u`";
    capi_u_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,u_Dims,u_Rank,  capi_u_intent,u_capi,capi_errmess);
    if (capi_u_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = benchmarks_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        u = (double *)(PyArray_DATA(capi_u_as_array));

    /* Processing variable note */
    slen(note) = 70;
    f2py_success = string_from_pyobj(&note,&slen(note),"",note_capi,"string_from_pyobj failed in converting 7th keyword`note' of benchmarks.bb03ad to C string");
    if (f2py_success) {
        STRINGPADN(note, slen(note), '\0', ' ');
    /* Processing variable dwork */
    ;
    capi_dwork_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "benchmarks.benchmarks.bb03ad: failed to create array from the 14th argument `dwork`";
    capi_dwork_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,dwork_Dims,dwork_Rank,  capi_dwork_intent,dwork_capi,capi_errmess);
    if (capi_dwork_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = benchmarks_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        dwork = (double *)(PyArray_DATA(capi_dwork_as_array));

    /* Processing variable info */
    if (info_capi != Py_None)
        f2py_success = int_from_pyobj(&info,info_capi,"benchmarks.bb03ad() 9th keyword (info) can't be converted to int");
    if (f2py_success) {
    /* Processing variable lde */
    if (lde_capi == Py_None) lde = shape(e,0); else
        f2py_success = int_from_pyobj(&lde,lde_capi,"benchmarks.bb03ad() 1st keyword (lde) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(e,0)==lde,"shape(e,0)==lde","1st keyword lde","bb03ad:lde=%d",lde) {
    /* Processing variable lda */
    if (lda_capi == Py_None) lda = shape(a,0); else
        f2py_success = int_from_pyobj(&lda,lda_capi,"benchmarks.bb03ad() 2nd keyword (lda) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(a,0)==lda,"shape(a,0)==lda","2nd keyword lda","bb03ad:lda=%d",lda) {
    /* Processing variable ldy */
    if (ldy_capi == Py_None) ldy = shape(y,0); else
        f2py_success = int_from_pyobj(&ldy,ldy_capi,"benchmarks.bb03ad() 3rd keyword (ldy) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(y,0)==ldy,"shape(y,0)==ldy","3rd keyword ldy","bb03ad:ldy=%d",ldy) {
    /* Processing variable ldb */
    if (ldb_capi == Py_None) ldb = shape(b,0); else
        f2py_success = int_from_pyobj(&ldb,ldb_capi,"benchmarks.bb03ad() 4th keyword (ldb) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(b,0)==ldb,"shape(b,0)==ldb","4th keyword ldb","bb03ad:ldb=%d",ldb) {
    /* Processing variable ldx */
    if (ldx_capi == Py_None) ldx = shape(x,0); else
        f2py_success = int_from_pyobj(&ldx,ldx_capi,"benchmarks.bb03ad() 5th keyword (ldx) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(x,0)==ldx,"shape(x,0)==ldx","5th keyword ldx","bb03ad:ldx=%d",ldx) {
    /* Processing variable ldu */
    if (ldu_capi == Py_None) ldu = shape(u,0); else
        f2py_success = int_from_pyobj(&ldu,ldu_capi,"benchmarks.bb03ad() 6th keyword (ldu) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(u,0)==ldu,"shape(u,0)==ldu","6th keyword ldu","bb03ad:ldu=%d",ldu) {
    /* Processing variable ldwork */
    if (ldwork_capi == Py_None) ldwork = len(dwork); else
        f2py_success = int_from_pyobj(&ldwork,ldwork_capi,"benchmarks.bb03ad() 8th keyword (ldwork) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(len(dwork)>=ldwork,"len(dwork)>=ldwork","8th keyword ldwork","bb03ad:ldwork=%d",ldwork) {
/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
                (*f2py_func)(&def,nr,dpar,ipar,vec,&n,&m,e,&lde,a,&lda,y,&ldy,b,&ldb,x,&ldx,u,&ldu,note,dwork,&ldwork,&info,slen(note));
if (PyErr_Occurred())
  f2py_success = 0;
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_call_clock();
#endif
/*end of callfortranroutine*/
        if (f2py_success) {
/*pyobjfrom*/
/*end of pyobjfrom*/
        CFUNCSMESS("Building return value.\n");
        capi_buildvalue = Py_BuildValue("NNNN",capi_e_as_array,capi_a_as_array,capi_y_as_array,capi_x_as_array);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
        } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
    } /*CHECKSCALAR(len(dwork)>=ldwork)*/
    } /*if (f2py_success) of ldwork*/
    /* End of cleaning variable ldwork */
    } /*CHECKSCALAR(shape(u,0)==ldu)*/
    } /*if (f2py_success) of ldu*/
    /* End of cleaning variable ldu */
    } /*CHECKSCALAR(shape(x,0)==ldx)*/
    } /*if (f2py_success) of ldx*/
    /* End of cleaning variable ldx */
    } /*CHECKSCALAR(shape(b,0)==ldb)*/
    } /*if (f2py_success) of ldb*/
    /* End of cleaning variable ldb */
    } /*CHECKSCALAR(shape(y,0)==ldy)*/
    } /*if (f2py_success) of ldy*/
    /* End of cleaning variable ldy */
    } /*CHECKSCALAR(shape(a,0)==lda)*/
    } /*if (f2py_success) of lda*/
    /* End of cleaning variable lda */
    } /*CHECKSCALAR(shape(e,0)==lde)*/
    } /*if (f2py_success) of lde*/
    /* End of cleaning variable lde */
    } /*if (f2py_success) of info*/
    /* End of cleaning variable info */
    if((PyObject *)capi_dwork_as_array!=dwork_capi) {
        Py_XDECREF(capi_dwork_as_array); }
    }  /* if (capi_dwork_as_array == NULL) ... else of dwork */
    /* End of cleaning variable dwork */
        STRINGFREE(note);
    }  /*if (f2py_success) of note*/
    /* End of cleaning variable note */
    if((PyObject *)capi_u_as_array!=u_capi) {
        Py_XDECREF(capi_u_as_array); }
    }  /* if (capi_u_as_array == NULL) ... else of u */
    /* End of cleaning variable u */
    }  /* if (capi_x_as_array == NULL) ... else of x */
    /* End of cleaning variable x */
    if((PyObject *)capi_b_as_array!=b_capi) {
        Py_XDECREF(capi_b_as_array); }
    }  /* if (capi_b_as_array == NULL) ... else of b */
    /* End of cleaning variable b */
    }  /* if (capi_y_as_array == NULL) ... else of y */
    /* End of cleaning variable y */
    }  /* if (capi_a_as_array == NULL) ... else of a */
    /* End of cleaning variable a */
    }  /* if (capi_e_as_array == NULL) ... else of e */
    /* End of cleaning variable e */
    } /*if (f2py_success) of m*/
    /* End of cleaning variable m */
    } /*if (f2py_success) of n*/
    /* End of cleaning variable n */
    if((PyObject *)capi_vec_as_array!=vec_capi) {
        Py_XDECREF(capi_vec_as_array); }
    }  /* if (capi_vec_as_array == NULL) ... else of vec */
    /* End of cleaning variable vec */
    if((PyObject *)capi_ipar_as_array!=ipar_capi) {
        Py_XDECREF(capi_ipar_as_array); }
    }  /* if (capi_ipar_as_array == NULL) ... else of ipar */
    /* End of cleaning variable ipar */
    if((PyObject *)capi_dpar_as_array!=dpar_capi) {
        Py_XDECREF(capi_dpar_as_array); }
    }  /* if (capi_dpar_as_array == NULL) ... else of dpar */
    /* End of cleaning variable dpar */
    if((PyObject *)capi_nr_as_array!=nr_capi) {
        Py_XDECREF(capi_nr_as_array); }
    }  /* if (capi_nr_as_array == NULL) ... else of nr */
    /* End of cleaning variable nr */
    } /*if (f2py_success) of def*/
    /* End of cleaning variable def */
/*end of cleanupfrompyobj*/
    if (capi_buildvalue == NULL) {
/*routdebugfailure*/
    } else {
/*routdebugleave*/
    }
    CFUNCSMESS("Freeing memory.\n");
/*freemem*/
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_clock();
#endif
    return capi_buildvalue;
}
/******************************* end of bb03ad *******************************/

/*********************************** bb04ad ***********************************/
static char doc_f2py_rout_benchmarks_bb04ad[] = "\
e,a,y,x = bb04ad(def,nr,dpar,ipar,vec,n,m,e,a,y,b,x,u,dwork,[lde,lda,ldy,ldb,ldx,ldu,note,ldwork,info,overwrite_e,overwrite_a,overwrite_y,overwrite_x])\n\nWrapper for ``bb04ad``.\
\n\nParameters\n----------\n"
"def : input bytes\n"
"nr : input rank-1 array('i') with bounds (*)\n"
"dpar : input rank-1 array('d') with bounds (*)\n"
"ipar : input rank-1 array('i') with bounds (*)\n"
"vec : input rank-1 array('i') with bounds (8)\n"
"n : input int\n"
"m : input int\n"
"e : input rank-2 array('d') with bounds (lde,*)\n"
"a : input rank-2 array('d') with bounds (lda,*)\n"
"y : input rank-2 array('d') with bounds (ldy,*)\n"
"b : input rank-2 array('d') with bounds (ldb,*)\n"
"x : input rank-2 array('d') with bounds (ldx,*)\n"
"u : input rank-2 array('d') with bounds (ldu,*)\n"
"dwork : input rank-1 array('d') with bounds (ldwork)\n"
"\nOther Parameters\n----------------\n"
"overwrite_e : input int, optional\n    Default: 0\n"
"lde : input int, optional\n    Default: shape(e,0)\n"
"overwrite_a : input int, optional\n    Default: 0\n"
"lda : input int, optional\n    Default: shape(a,0)\n"
"overwrite_y : input int, optional\n    Default: 0\n"
"ldy : input int, optional\n    Default: shape(y,0)\n"
"ldb : input int, optional\n    Default: shape(b,0)\n"
"overwrite_x : input int, optional\n    Default: 0\n"
"ldx : input int, optional\n    Default: shape(x,0)\n"
"ldu : input int, optional\n    Default: shape(u,0)\n"
"note : input string(len=70)\n"
"ldwork : input int, optional\n    Default: len(dwork)\n"
"info : input int\n"
"\nReturns\n-------\n"
"e : rank-2 array('d') with bounds (lde,*)\n"
"a : rank-2 array('d') with bounds (lda,*)\n"
"y : rank-2 array('d') with bounds (ldy,*)\n"
"x : rank-2 array('d') with bounds (ldx,*)";
/* extern void F_FUNC(bb04ad,BB04AD)(character*,int*,double*,int*,int*,int*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,string,double*,int*,int*,size_t); */
static PyObject *f2py_rout_benchmarks_bb04ad(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(character*,int*,double*,int*,int*,int*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,string,double*,int*,int*,size_t)) {
    PyObject * volatile capi_buildvalue = NULL;
    volatile int f2py_success = 1;
/*decl*/

    character def = 0;
    PyObject *def_capi = Py_None;
    int *nr = NULL;
    npy_intp nr_Dims[1] = {-1};
    const int nr_Rank = 1;
    PyArrayObject *capi_nr_as_array = NULL;
    int capi_nr_intent = 0;
    PyObject *nr_capi = Py_None;
    double *dpar = NULL;
    npy_intp dpar_Dims[1] = {-1};
    const int dpar_Rank = 1;
    PyArrayObject *capi_dpar_as_array = NULL;
    int capi_dpar_intent = 0;
    PyObject *dpar_capi = Py_None;
    int *ipar = NULL;
    npy_intp ipar_Dims[1] = {-1};
    const int ipar_Rank = 1;
    PyArrayObject *capi_ipar_as_array = NULL;
    int capi_ipar_intent = 0;
    PyObject *ipar_capi = Py_None;
    int *vec = NULL;
    npy_intp vec_Dims[1] = {-1};
    const int vec_Rank = 1;
    PyArrayObject *capi_vec_as_array = NULL;
    int capi_vec_intent = 0;
    PyObject *vec_capi = Py_None;
    int n = 0;
    PyObject *n_capi = Py_None;
    int m = 0;
    PyObject *m_capi = Py_None;
    double *e = NULL;
    npy_intp e_Dims[2] = {-1, -1};
    const int e_Rank = 2;
    PyArrayObject *capi_e_as_array = NULL;
    int capi_e_intent = 0;
    int capi_overwrite_e = 0;
    PyObject *e_capi = Py_None;
    int lde = 0;
    PyObject *lde_capi = Py_None;
    double *a = NULL;
    npy_intp a_Dims[2] = {-1, -1};
    const int a_Rank = 2;
    PyArrayObject *capi_a_as_array = NULL;
    int capi_a_intent = 0;
    int capi_overwrite_a = 0;
    PyObject *a_capi = Py_None;
    int lda = 0;
    PyObject *lda_capi = Py_None;
    double *y = NULL;
    npy_intp y_Dims[2] = {-1, -1};
    const int y_Rank = 2;
    PyArrayObject *capi_y_as_array = NULL;
    int capi_y_intent = 0;
    int capi_overwrite_y = 0;
    PyObject *y_capi = Py_None;
    int ldy = 0;
    PyObject *ldy_capi = Py_None;
    double *b = NULL;
    npy_intp b_Dims[2] = {-1, -1};
    const int b_Rank = 2;
    PyArrayObject *capi_b_as_array = NULL;
    int capi_b_intent = 0;
    PyObject *b_capi = Py_None;
    int ldb = 0;
    PyObject *ldb_capi = Py_None;
    double *x = NULL;
    npy_intp x_Dims[2] = {-1, -1};
    const int x_Rank = 2;
    PyArrayObject *capi_x_as_array = NULL;
    int capi_x_intent = 0;
    int capi_overwrite_x = 0;
    PyObject *x_capi = Py_None;
    int ldx = 0;
    PyObject *ldx_capi = Py_None;
    double *u = NULL;
    npy_intp u_Dims[2] = {-1, -1};
    const int u_Rank = 2;
    PyArrayObject *capi_u_as_array = NULL;
    int capi_u_intent = 0;
    PyObject *u_capi = Py_None;
    int ldu = 0;
    PyObject *ldu_capi = Py_None;
    string note = NULL;
    int slen(note);
    PyObject *note_capi = Py_None;
    double *dwork = NULL;
    npy_intp dwork_Dims[1] = {-1};
    const int dwork_Rank = 1;
    PyArrayObject *capi_dwork_as_array = NULL;
    int capi_dwork_intent = 0;
    PyObject *dwork_capi = Py_None;
    int ldwork = 0;
    PyObject *ldwork_capi = Py_None;
    int info = 0;
    PyObject *info_capi = Py_None;
    static char *capi_kwlist[] = {"def","nr","dpar","ipar","vec","n","m","e","a","y","b","x","u","dwork","lde","lda","ldy","ldb","ldx","ldu","note","ldwork","info","overwrite_e","overwrite_a","overwrite_y","overwrite_x",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
    if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
        "OOOOOOOOOOOOOO|OOOOOOOOOiiii:benchmarks.bb04ad",\
        capi_kwlist,&def_capi,&nr_capi,&dpar_capi,&ipar_capi,&vec_capi,&n_capi,&m_capi,&e_capi,&a_capi,&y_capi,&b_capi,&x_capi,&u_capi,&dwork_capi,&lde_capi,&lda_capi,&ldy_capi,&ldb_capi,&ldx_capi,&ldu_capi,&note_capi,&ldwork_capi,&info_capi,&capi_overwrite_e,&capi_overwrite_a,&capi_overwrite_y,&capi_overwrite_x))
        return NULL;
/*frompyobj*/
    /* Processing variable def */
        f2py_success = character_from_pyobj(&def,def_capi,"benchmarks.bb04ad() 1st argument (def) can't be converted to character");
    if (f2py_success) {
    /* Processing variable nr */
    ;
    capi_nr_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "benchmarks.benchmarks.bb04ad: failed to create array from the 2nd argument `nr`";
    capi_nr_as_array = ndarray_from_pyobj(  NPY_INT,1,nr_Dims,nr_Rank,  capi_nr_intent,nr_capi,capi_errmess);
    if (capi_nr_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = benchmarks_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        nr = (int *)(PyArray_DATA(capi_nr_as_array));

    /* Processing variable dpar */
    ;
    capi_dpar_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "benchmarks.benchmarks.bb04ad: failed to create array from the 3rd argument `dpar`";
    capi_dpar_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,dpar_Dims,dpar_Rank,  capi_dpar_intent,dpar_capi,capi_errmess);
    if (capi_dpar_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = benchmarks_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        dpar = (double *)(PyArray_DATA(capi_dpar_as_array));

    /* Processing variable ipar */
    ;
    capi_ipar_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "benchmarks.benchmarks.bb04ad: failed to create array from the 4th argument `ipar`";
    capi_ipar_as_array = ndarray_from_pyobj(  NPY_INT,1,ipar_Dims,ipar_Rank,  capi_ipar_intent,ipar_capi,capi_errmess);
    if (capi_ipar_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = benchmarks_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        ipar = (int *)(PyArray_DATA(capi_ipar_as_array));

    /* Processing variable vec */
    vec_Dims[0]=8;
    capi_vec_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "benchmarks.benchmarks.bb04ad: failed to create array from the 5th argument `vec`";
    capi_vec_as_array = ndarray_from_pyobj(  NPY_INT,1,vec_Dims,vec_Rank,  capi_vec_intent,vec_capi,capi_errmess);
    if (capi_vec_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = benchmarks_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        vec = (int *)(PyArray_DATA(capi_vec_as_array));

    /* Processing variable n */
        f2py_success = int_from_pyobj(&n,n_capi,"benchmarks.bb04ad() 6th argument (n) can't be converted to int");
    if (f2py_success) {
    /* Processing variable m */
        f2py_success = int_from_pyobj(&m,m_capi,"benchmarks.bb04ad() 7th argument (m) can't be converted to int");
    if (f2py_success) {
    /* Processing variable e */
    capi_e_intent |= (capi_overwrite_e?0:F2PY_INTENT_COPY);
    ;
    capi_e_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    const char * capi_errmess = "benchmarks.benchmarks.bb04ad: failed to create array from the 8th argument `e`";
    capi_e_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,e_Dims,e_Rank,  capi_e_intent,e_capi,capi_errmess);
    if (capi_e_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = benchmarks_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        e = (double *)(PyArray_DATA(capi_e_as_array));

    /* Processing variable a */
    capi_a_intent |= (capi_overwrite_a?0:F2PY_INTENT_COPY);
    ;
    capi_a_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    const char * capi_errmess = "benchmarks.benchmarks.bb04ad: failed to create array from the 9th argument `a`";
    capi_a_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,a_Dims,a_Rank,  capi_a_intent,a_capi,capi_errmess);
    if (capi_a_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = benchmarks_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        a = (double *)(PyArray_DATA(capi_a_as_array));

    /* Processing variable y */
    capi_y_intent |= (capi_overwrite_y?0:F2PY_INTENT_COPY);
    ;
    capi_y_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    const char * capi_errmess = "benchmarks.benchmarks.bb04ad: failed to create array from the 10th argument `y`";
    capi_y_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,y_Dims,y_Rank,  capi_y_intent,y_capi,capi_errmess);
    if (capi_y_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = benchmarks_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        y = (double *)(PyArray_DATA(capi_y_as_array));

    /* Processing variable b */
    ;
    capi_b_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "benchmarks.benchmarks.bb04ad: failed to create array from the 11st argument `b`";
    capi_b_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,b_Dims,b_Rank,  capi_b_intent,b_capi,capi_errmess);
    if (capi_b_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = benchmarks_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        b = (double *)(PyArray_DATA(capi_b_as_array));

    /* Processing variable x */
    capi_x_intent |= (capi_overwrite_x?0:F2PY_INTENT_COPY);
    ;
    capi_x_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    const char * capi_errmess = "benchmarks.benchmarks.bb04ad: failed to create array from the 12nd argument `x`";
    capi_x_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,x_Dims,x_Rank,  capi_x_intent,x_capi,capi_errmess);
    if (capi_x_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = benchmarks_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        x = (double *)(PyArray_DATA(capi_x_as_array));

    /* Processing variable u */
    ;
    capi_u_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "benchmarks.benchmarks.bb04ad: failed to create array from the 13rd argument `u`";
    capi_u_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,u_Dims,u_Rank,  capi_u_intent,u_capi,capi_errmess);
    if (capi_u_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = benchmarks_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        u = (double *)(PyArray_DATA(capi_u_as_array));

    /* Processing variable note */
    slen(note) = 70;
    f2py_success = string_from_pyobj(&note,&slen(note),"",note_capi,"string_from_pyobj failed in converting 7th keyword`note' of benchmarks.bb04ad to C string");
    if (f2py_success) {
        STRINGPADN(note, slen(note), '\0', ' ');
    /* Processing variable dwork */
    ;
    capi_dwork_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "benchmarks.benchmarks.bb04ad: failed to create array from the 14th argument `dwork`";
    capi_dwork_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,dwork_Dims,dwork_Rank,  capi_dwork_intent,dwork_capi,capi_errmess);
    if (capi_dwork_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = benchmarks_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        dwork = (double *)(PyArray_DATA(capi_dwork_as_array));

    /* Processing variable info */
    if (info_capi != Py_None)
        f2py_success = int_from_pyobj(&info,info_capi,"benchmarks.bb04ad() 9th keyword (info) can't be converted to int");
    if (f2py_success) {
    /* Processing variable lde */
    if (lde_capi == Py_None) lde = shape(e,0); else
        f2py_success = int_from_pyobj(&lde,lde_capi,"benchmarks.bb04ad() 1st keyword (lde) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(e,0)==lde,"shape(e,0)==lde","1st keyword lde","bb04ad:lde=%d",lde) {
    /* Processing variable lda */
    if (lda_capi == Py_None) lda = shape(a,0); else
        f2py_success = int_from_pyobj(&lda,lda_capi,"benchmarks.bb04ad() 2nd keyword (lda) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(a,0)==lda,"shape(a,0)==lda","2nd keyword lda","bb04ad:lda=%d",lda) {
    /* Processing variable ldy */
    if (ldy_capi == Py_None) ldy = shape(y,0); else
        f2py_success = int_from_pyobj(&ldy,ldy_capi,"benchmarks.bb04ad() 3rd keyword (ldy) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(y,0)==ldy,"shape(y,0)==ldy","3rd keyword ldy","bb04ad:ldy=%d",ldy) {
    /* Processing variable ldb */
    if (ldb_capi == Py_None) ldb = shape(b,0); else
        f2py_success = int_from_pyobj(&ldb,ldb_capi,"benchmarks.bb04ad() 4th keyword (ldb) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(b,0)==ldb,"shape(b,0)==ldb","4th keyword ldb","bb04ad:ldb=%d",ldb) {
    /* Processing variable ldx */
    if (ldx_capi == Py_None) ldx = shape(x,0); else
        f2py_success = int_from_pyobj(&ldx,ldx_capi,"benchmarks.bb04ad() 5th keyword (ldx) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(x,0)==ldx,"shape(x,0)==ldx","5th keyword ldx","bb04ad:ldx=%d",ldx) {
    /* Processing variable ldu */
    if (ldu_capi == Py_None) ldu = shape(u,0); else
        f2py_success = int_from_pyobj(&ldu,ldu_capi,"benchmarks.bb04ad() 6th keyword (ldu) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(u,0)==ldu,"shape(u,0)==ldu","6th keyword ldu","bb04ad:ldu=%d",ldu) {
    /* Processing variable ldwork */
    if (ldwork_capi == Py_None) ldwork = len(dwork); else
        f2py_success = int_from_pyobj(&ldwork,ldwork_capi,"benchmarks.bb04ad() 8th keyword (ldwork) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(len(dwork)>=ldwork,"len(dwork)>=ldwork","8th keyword ldwork","bb04ad:ldwork=%d",ldwork) {
/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
                (*f2py_func)(&def,nr,dpar,ipar,vec,&n,&m,e,&lde,a,&lda,y,&ldy,b,&ldb,x,&ldx,u,&ldu,note,dwork,&ldwork,&info,slen(note));
if (PyErr_Occurred())
  f2py_success = 0;
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_call_clock();
#endif
/*end of callfortranroutine*/
        if (f2py_success) {
/*pyobjfrom*/
/*end of pyobjfrom*/
        CFUNCSMESS("Building return value.\n");
        capi_buildvalue = Py_BuildValue("NNNN",capi_e_as_array,capi_a_as_array,capi_y_as_array,capi_x_as_array);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
        } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
    } /*CHECKSCALAR(len(dwork)>=ldwork)*/
    } /*if (f2py_success) of ldwork*/
    /* End of cleaning variable ldwork */
    } /*CHECKSCALAR(shape(u,0)==ldu)*/
    } /*if (f2py_success) of ldu*/
    /* End of cleaning variable ldu */
    } /*CHECKSCALAR(shape(x,0)==ldx)*/
    } /*if (f2py_success) of ldx*/
    /* End of cleaning variable ldx */
    } /*CHECKSCALAR(shape(b,0)==ldb)*/
    } /*if (f2py_success) of ldb*/
    /* End of cleaning variable ldb */
    } /*CHECKSCALAR(shape(y,0)==ldy)*/
    } /*if (f2py_success) of ldy*/
    /* End of cleaning variable ldy */
    } /*CHECKSCALAR(shape(a,0)==lda)*/
    } /*if (f2py_success) of lda*/
    /* End of cleaning variable lda */
    } /*CHECKSCALAR(shape(e,0)==lde)*/
    } /*if (f2py_success) of lde*/
    /* End of cleaning variable lde */
    } /*if (f2py_success) of info*/
    /* End of cleaning variable info */
    if((PyObject *)capi_dwork_as_array!=dwork_capi) {
        Py_XDECREF(capi_dwork_as_array); }
    }  /* if (capi_dwork_as_array == NULL) ... else of dwork */
    /* End of cleaning variable dwork */
        STRINGFREE(note);
    }  /*if (f2py_success) of note*/
    /* End of cleaning variable note */
    if((PyObject *)capi_u_as_array!=u_capi) {
        Py_XDECREF(capi_u_as_array); }
    }  /* if (capi_u_as_array == NULL) ... else of u */
    /* End of cleaning variable u */
    }  /* if (capi_x_as_array == NULL) ... else of x */
    /* End of cleaning variable x */
    if((PyObject *)capi_b_as_array!=b_capi) {
        Py_XDECREF(capi_b_as_array); }
    }  /* if (capi_b_as_array == NULL) ... else of b */
    /* End of cleaning variable b */
    }  /* if (capi_y_as_array == NULL) ... else of y */
    /* End of cleaning variable y */
    }  /* if (capi_a_as_array == NULL) ... else of a */
    /* End of cleaning variable a */
    }  /* if (capi_e_as_array == NULL) ... else of e */
    /* End of cleaning variable e */
    } /*if (f2py_success) of m*/
    /* End of cleaning variable m */
    } /*if (f2py_success) of n*/
    /* End of cleaning variable n */
    if((PyObject *)capi_vec_as_array!=vec_capi) {
        Py_XDECREF(capi_vec_as_array); }
    }  /* if (capi_vec_as_array == NULL) ... else of vec */
    /* End of cleaning variable vec */
    if((PyObject *)capi_ipar_as_array!=ipar_capi) {
        Py_XDECREF(capi_ipar_as_array); }
    }  /* if (capi_ipar_as_array == NULL) ... else of ipar */
    /* End of cleaning variable ipar */
    if((PyObject *)capi_dpar_as_array!=dpar_capi) {
        Py_XDECREF(capi_dpar_as_array); }
    }  /* if (capi_dpar_as_array == NULL) ... else of dpar */
    /* End of cleaning variable dpar */
    if((PyObject *)capi_nr_as_array!=nr_capi) {
        Py_XDECREF(capi_nr_as_array); }
    }  /* if (capi_nr_as_array == NULL) ... else of nr */
    /* End of cleaning variable nr */
    } /*if (f2py_success) of def*/
    /* End of cleaning variable def */
/*end of cleanupfrompyobj*/
    if (capi_buildvalue == NULL) {
/*routdebugfailure*/
    } else {
/*routdebugleave*/
    }
    CFUNCSMESS("Freeing memory.\n");
/*freemem*/
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_clock();
#endif
    return capi_buildvalue;
}
/******************************* end of bb04ad *******************************/
/*eof body*/

/******************* See f2py2e/f90mod_rules.py: buildhooks *******************/
/*need_f90modhooks*/

/************** See f2py2e/rules.py: module_rules['modulebody'] **************/

/******************* See f2py2e/common_rules.py: buildhooks *******************/

/*need_commonhooks*/

/**************************** See f2py2e/rules.py ****************************/

static FortranDataDef f2py_routine_defs[] = {
    {"bb03ad",-1,{{-1}},0,0,(char *)  F_FUNC(bb03ad,BB03AD),  (f2py_init_func)f2py_rout_benchmarks_bb03ad,doc_f2py_rout_benchmarks_bb03ad},
    {"bb04ad",-1,{{-1}},0,0,(char *)  F_FUNC(bb04ad,BB04AD),  (f2py_init_func)f2py_rout_benchmarks_bb04ad,doc_f2py_rout_benchmarks_bb04ad},

/*eof routine_defs*/
    {NULL}
};

static PyMethodDef f2py_module_methods[] = {

    {NULL,NULL}
};

static struct PyModuleDef moduledef = {
    PyModuleDef_HEAD_INIT,
    "benchmarks",
    NULL,
    -1,
    f2py_module_methods,
    NULL,
    NULL,
    NULL,
    NULL
};

PyMODINIT_FUNC PyInit_benchmarks(void) {
    int i;
    PyObject *m,*d, *s, *tmp;
    m = benchmarks_module = PyModule_Create(&moduledef);
    Py_SET_TYPE(&PyFortran_Type, &PyType_Type);
    import_array();
    if (PyErr_Occurred())
        {PyErr_SetString(PyExc_ImportError, "can't initialize module benchmarks (failed to import numpy)"); return m;}
    d = PyModule_GetDict(m);
    s = PyUnicode_FromString("1.24.2");
    PyDict_SetItemString(d, "__version__", s);
    Py_DECREF(s);
    s = PyUnicode_FromString(
        "This module 'benchmarks' is auto-generated with f2py (version:1.24.2).\nFunctions:\n"
"    e,a,y,x = bb03ad(def,nr,dpar,ipar,vec,n,m,e,a,y,b,x,u,dwork,lde=shape(e,0),lda=shape(a,0),ldy=shape(y,0),ldb=shape(b,0),ldx=shape(x,0),ldu=shape(u,0),note='',ldwork=len(dwork),info=,overwrite_e=0,overwrite_a=0,overwrite_y=0,overwrite_x=0)\n"
"    e,a,y,x = bb04ad(def,nr,dpar,ipar,vec,n,m,e,a,y,b,x,u,dwork,lde=shape(e,0),lda=shape(a,0),ldy=shape(y,0),ldb=shape(b,0),ldx=shape(x,0),ldu=shape(u,0),note='',ldwork=len(dwork),info=,overwrite_e=0,overwrite_a=0,overwrite_y=0,overwrite_x=0)\n"
".");
    PyDict_SetItemString(d, "__doc__", s);
    Py_DECREF(s);
    s = PyUnicode_FromString("1.24.2");
    PyDict_SetItemString(d, "__f2py_numpy_version__", s);
    Py_DECREF(s);
    benchmarks_error = PyErr_NewException ("benchmarks.error", NULL, NULL);
    /*
     * Store the error object inside the dict, so that it could get deallocated.
     * (in practice, this is a module, so it likely will not and cannot.)
     */
    PyDict_SetItemString(d, "_benchmarks_error", benchmarks_error);
    Py_DECREF(benchmarks_error);
    for(i=0;f2py_routine_defs[i].name!=NULL;i++) {
        tmp = PyFortranObject_NewAsAttr(&f2py_routine_defs[i]);
        PyDict_SetItemString(d, f2py_routine_defs[i].name, tmp);
        Py_DECREF(tmp);
    }


/*eof initf2pywraphooks*/
/*eof initf90modhooks*/

/*eof initcommonhooks*/


#ifdef F2PY_REPORT_ATEXIT
    if (! PyErr_Occurred())
        on_exit(f2py_report_on_exit,(void*)"benchmarks");
#endif
    return m;
}
#ifdef __cplusplus
}
#endif
