Generated by Cython 0.25.2

Yellow lines hint at Python interaction.
Click on a line that starts with a "`+`" to see the C code that Cython generated for it.

Raw output: stats.c

    +0001: # -*- coding: utf-8 -*-

      __pyx_t_33 = PyDict_New(); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 1, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_33);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_33) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;

     0002: # cython: profile=True

     0003: # cython: linetrace=False

     0004: # cython: binding=False

     0005: from __future__ import absolute_import, print_function, division

     0006:

     0007:

    +0008: import numpy as np

      __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     0009: cimport numpy as cnp

     0010: import cython

     0011: cimport cython

     0012: from libc.math cimport sqrt, fabs, fmin

     0013: from libc.stdlib cimport malloc, free

     0014: from libc.string cimport memset

     0015:

     0016:

     0017: ctypedef fused integer:

     0018:     cnp.int8_t

     0019:     cnp.int16_t

     0020:     cnp.int32_t

     0021:     cnp.int64_t

     0022:     cnp.uint8_t

     0023:     cnp.uint16_t

     0024:     cnp.uint32_t

     0025:     cnp.uint64_t

     0026:

     0027:

     0028: ctypedef fused floating:

     0029:     cnp.float32_t

     0030:     cnp.float64_t

     0031:

     0032:

     0033: # work around NAN undeclared in windows

     0034: cdef:

    +0035:     cnp.float32_t nan32 = np.nan

      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nan); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_3 == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_5allel_3opt_5stats_nan32 = __pyx_t_3;

    +0036:     cnp.float64_t nan64 = np.nan

      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_nan); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_5allel_3opt_5stats_nan64 = __pyx_t_4;

     0037:

     0038:

     0039: @cython.boundscheck(False)

     0040: @cython.wraparound(False)

     0041: @cython.cdivision(True)

    +0042: cpdef inline cnp.float32_t gn_corrcoef_int8(cnp.int8_t[:] gn0,

    static PyObject *__pyx_pw_5allel_3opt_5stats_1gn_corrcoef_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static CYTHON_INLINE __pyx_t_5numpy_float32_t __pyx_f_5allel_3opt_5stats_gn_corrcoef_int8(__Pyx_memviewslice __pyx_v_gn0, __Pyx_memviewslice __pyx_v_gn1, __Pyx_memviewslice __pyx_v_gn0_sq, __Pyx_memviewslice __pyx_v_gn1_sq, __pyx_t_5numpy_float32_t __pyx_v_fill, CYTHON_UNUSED int __pyx_skip_dispatch) {
      __pyx_t_5numpy_int8_t __pyx_v_x;
      __pyx_t_5numpy_int8_t __pyx_v_y;
      __pyx_t_5numpy_int8_t __pyx_v_xsq;
      __pyx_t_5numpy_int8_t __pyx_v_ysq;
      Py_ssize_t __pyx_v_i;
      int __pyx_v_n;
      __pyx_t_5numpy_float32_t __pyx_v_m0;
      __pyx_t_5numpy_float32_t __pyx_v_m1;
      __pyx_t_5numpy_float32_t __pyx_v_v0;
      __pyx_t_5numpy_float32_t __pyx_v_v1;
      __pyx_t_5numpy_float32_t __pyx_v_cov;
      __pyx_t_5numpy_float32_t __pyx_v_r;
      __pyx_t_5numpy_float32_t __pyx_r;
      __Pyx_TraceDeclarations
      __Pyx_TraceCall("gn_corrcoef_int8", __pyx_f[0], 42, 1, __PYX_ERR(0, 42, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_WriteUnraisable("allel.opt.stats.gn_corrcoef_int8", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_TraceReturn(Py_None, 1);
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_1gn_corrcoef_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_1gn_corrcoef_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_gn0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gn1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gn0_sq = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gn1_sq = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float32_t __pyx_v_fill;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("gn_corrcoef_int8 (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gn0,&__pyx_n_s_gn1,&__pyx_n_s_gn0_sq,&__pyx_n_s_gn1_sq,&__pyx_n_s_fill,0};
        PyObject* values[5] = {0,0,0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gn0)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gn1)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("gn_corrcoef_int8", 1, 5, 5, 1); __PYX_ERR(0, 42, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gn0_sq)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("gn_corrcoef_int8", 1, 5, 5, 2); __PYX_ERR(0, 42, __pyx_L3_error)
            }
            case  3:
            if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gn1_sq)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("gn_corrcoef_int8", 1, 5, 5, 3); __PYX_ERR(0, 42, __pyx_L3_error)
            }
            case  4:
            if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("gn_corrcoef_int8", 1, 5, 5, 4); __PYX_ERR(0, 42, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gn_corrcoef_int8") < 0)) __PYX_ERR(0, 42, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
          values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        }
        __pyx_v_gn0 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_gn0.memview)) __PYX_ERR(0, 42, __pyx_L3_error)
        __pyx_v_gn1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(values[1]); if (unlikely(!__pyx_v_gn1.memview)) __PYX_ERR(0, 43, __pyx_L3_error)
        __pyx_v_gn0_sq = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(values[2]); if (unlikely(!__pyx_v_gn0_sq.memview)) __PYX_ERR(0, 44, __pyx_L3_error)
        __pyx_v_gn1_sq = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(values[3]); if (unlikely(!__pyx_v_gn1_sq.memview)) __PYX_ERR(0, 45, __pyx_L3_error)
        __pyx_v_fill = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_fill == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("gn_corrcoef_int8", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 42, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.gn_corrcoef_int8", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_gn_corrcoef_int8(__pyx_self, __pyx_v_gn0, __pyx_v_gn1, __pyx_v_gn0_sq, __pyx_v_gn1_sq, __pyx_v_fill);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_gn_corrcoef_int8(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_gn0, __Pyx_memviewslice __pyx_v_gn1, __Pyx_memviewslice __pyx_v_gn0_sq, __Pyx_memviewslice __pyx_v_gn1_sq, __pyx_t_5numpy_float32_t __pyx_v_fill) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("gn_corrcoef_int8", 0);
      __Pyx_TraceCall("gn_corrcoef_int8 (wrapper)", __pyx_f[0], 42, 0, __PYX_ERR(0, 42, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_gn0.memview)) { __Pyx_RaiseUnboundLocalError("gn0"); __PYX_ERR(0, 42, __pyx_L1_error) }
      if (unlikely(!__pyx_v_gn1.memview)) { __Pyx_RaiseUnboundLocalError("gn1"); __PYX_ERR(0, 42, __pyx_L1_error) }
      if (unlikely(!__pyx_v_gn0_sq.memview)) { __Pyx_RaiseUnboundLocalError("gn0_sq"); __PYX_ERR(0, 42, __pyx_L1_error) }
      if (unlikely(!__pyx_v_gn1_sq.memview)) { __Pyx_RaiseUnboundLocalError("gn1_sq"); __PYX_ERR(0, 42, __pyx_L1_error) }
      __pyx_t_1 = PyFloat_FromDouble(__pyx_f_5allel_3opt_5stats_gn_corrcoef_int8(__pyx_v_gn0, __pyx_v_gn1, __pyx_v_gn0_sq, __pyx_v_gn1_sq, __pyx_v_fill, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.gn_corrcoef_int8", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_gn0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gn1, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gn0_sq, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gn1_sq, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     0043:                                             cnp.int8_t[:] gn1,

     0044:                                             cnp.int8_t[:] gn0_sq,

     0045:                                             cnp.int8_t[:] gn1_sq,

     0046:                                             cnp.float32_t fill) nogil:

     0047:     cdef:

     0048:         cnp.int8_t x, y, xsq, ysq

     0049:         Py_ssize_t i

     0050:         int n

     0051:         cnp.float32_t m0, m1, v0, v1, cov, r

     0052:

     0053:     # initialise variables

    +0054:     m0 = m1 = v0 = v1 = cov = n = 0

      __pyx_v_m0 = 0.0;
      __pyx_v_m1 = 0.0;
      __pyx_v_v0 = 0.0;
      __pyx_v_v1 = 0.0;
      __pyx_v_cov = 0.0;
      __pyx_v_n = 0;

     0055:

     0056:     # iterate over input vectors

    +0057:     for i in range(gn0.shape[0]):

      __pyx_t_1 = (__pyx_v_gn0.shape[0]);
      for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
        __pyx_v_i = __pyx_t_2;

    +0058:         x = gn0[i]

        __pyx_t_3 = __pyx_v_i;
        __pyx_v_x = (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_gn0.data + __pyx_t_3 * __pyx_v_gn0.strides[0]) )));

    +0059:         y = gn1[i]

        __pyx_t_4 = __pyx_v_i;
        __pyx_v_y = (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_gn1.data + __pyx_t_4 * __pyx_v_gn1.strides[0]) )));

     0060:         # consider negative values as missing

    +0061:         if x >= 0 and y >= 0:

        __pyx_t_6 = ((__pyx_v_x >= 0) != 0);
        if (__pyx_t_6) {
        } else {
          __pyx_t_5 = __pyx_t_6;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_6 = ((__pyx_v_y >= 0) != 0);
        __pyx_t_5 = __pyx_t_6;
        __pyx_L6_bool_binop_done:;
        if (__pyx_t_5) {
    /* … */
        }
      }

    +0062:             n += 1

          __pyx_v_n = (__pyx_v_n + 1);

    +0063:             m0 += x

          __pyx_v_m0 = (__pyx_v_m0 + __pyx_v_x);

    +0064:             m1 += y

          __pyx_v_m1 = (__pyx_v_m1 + __pyx_v_y);

    +0065:             xsq = gn0_sq[i]

          __pyx_t_7 = __pyx_v_i;
          __pyx_v_xsq = (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_gn0_sq.data + __pyx_t_7 * __pyx_v_gn0_sq.strides[0]) )));

    +0066:             ysq = gn1_sq[i]

          __pyx_t_8 = __pyx_v_i;
          __pyx_v_ysq = (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_gn1_sq.data + __pyx_t_8 * __pyx_v_gn1_sq.strides[0]) )));

    +0067:             v0 += xsq

          __pyx_v_v0 = (__pyx_v_v0 + __pyx_v_xsq);

    +0068:             v1 += ysq

          __pyx_v_v1 = (__pyx_v_v1 + __pyx_v_ysq);

    +0069:             cov += x * y

          __pyx_v_cov = (__pyx_v_cov + (__pyx_v_x * __pyx_v_y));

     0070:

     0071:     # compute mean, variance, covariance

    +0072:     m0 /= n

      __pyx_v_m0 = (__pyx_v_m0 / __pyx_v_n);

    +0073:     m1 /= n

      __pyx_v_m1 = (__pyx_v_m1 / __pyx_v_n);

    +0074:     v0 /= n

      __pyx_v_v0 = (__pyx_v_v0 / __pyx_v_n);

    +0075:     v1 /= n

      __pyx_v_v1 = (__pyx_v_v1 / __pyx_v_n);

    +0076:     cov /= n

      __pyx_v_cov = (__pyx_v_cov / __pyx_v_n);

    +0077:     cov -= m0 * m1

      __pyx_v_cov = (__pyx_v_cov - (__pyx_v_m0 * __pyx_v_m1));

    +0078:     v0 -= m0 * m0

      __pyx_v_v0 = (__pyx_v_v0 - (__pyx_v_m0 * __pyx_v_m0));

    +0079:     v1 -= m1 * m1

      __pyx_v_v1 = (__pyx_v_v1 - (__pyx_v_m1 * __pyx_v_m1));

     0080:

     0081:     # compute correlation coeficient

    +0082:     if v0 == 0 or v1 == 0:

      __pyx_t_6 = ((__pyx_v_v0 == 0.0) != 0);
      if (!__pyx_t_6) {
      } else {
        __pyx_t_5 = __pyx_t_6;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_6 = ((__pyx_v_v1 == 0.0) != 0);
      __pyx_t_5 = __pyx_t_6;
      __pyx_L9_bool_binop_done:;
      if (__pyx_t_5) {
    /* … */
        goto __pyx_L8;
      }

    +0083:         r = fill

        __pyx_v_r = __pyx_v_fill;

     0084:     else:

    +0085:         r = cov / sqrt(v0 * v1)

      /*else*/ {
        __pyx_v_r = (((double)__pyx_v_cov) / sqrt((__pyx_v_v0 * __pyx_v_v1)));
      }
      __pyx_L8:;

     0086:

    +0087:     return r

      __pyx_r = __pyx_v_r;
      goto __pyx_L0;

     0088:

     0089:

     0090: @cython.boundscheck(False)

     0091: @cython.wraparound(False)

    +0092: def gn_pairwise_corrcoef_int8(cnp.int8_t[:, :] gn not None,

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_3gn_pairwise_corrcoef_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_mdef_5allel_3opt_5stats_3gn_pairwise_corrcoef_int8 = {"gn_pairwise_corrcoef_int8", (PyCFunction)__pyx_pw_5allel_3opt_5stats_3gn_pairwise_corrcoef_int8, METH_VARARGS|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_5allel_3opt_5stats_3gn_pairwise_corrcoef_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_gn = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float32_t __pyx_v_fill;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("gn_pairwise_corrcoef_int8 (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gn,&__pyx_n_s_fill,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gn)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill);
              if (value) { values[1] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gn_pairwise_corrcoef_int8") < 0)) __PYX_ERR(0, 92, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_gn = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_gn.memview)) __PYX_ERR(0, 92, __pyx_L3_error)
        if (values[1]) {
          __pyx_v_fill = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_fill == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L3_error)
        } else {
          __pyx_v_fill = __pyx_k_;
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("gn_pairwise_corrcoef_int8", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 92, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.gn_pairwise_corrcoef_int8", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      if (unlikely(((PyObject *)__pyx_v_gn.memview) == Py_None)) {
        PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "gn"); __PYX_ERR(0, 92, __pyx_L1_error)
      }
      __pyx_r = __pyx_pf_5allel_3opt_5stats_2gn_pairwise_corrcoef_int8(__pyx_self, __pyx_v_gn, __pyx_v_fill);

      /* function exit code */
      goto __pyx_L0;
      __pyx_L1_error:;
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_2gn_pairwise_corrcoef_int8(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_gn, __pyx_t_5numpy_float32_t __pyx_v_fill) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_n;
      __pyx_t_5numpy_float32_t __pyx_v_r;
      __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gn_sq = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gn0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gn1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gn0_sq = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gn1_sq = { 0, 0, { 0 }, { 0 }, { 0 } };
      Py_ssize_t __pyx_v_n_pairs;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_TraceFrameInit(__pyx_codeobj__2)
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("gn_pairwise_corrcoef_int8", 0);
      __Pyx_TraceCall("gn_pairwise_corrcoef_int8", __pyx_f[0], 92, 0, __PYX_ERR(0, 92, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6);
      __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
      __Pyx_AddTraceback("allel.opt.stats.gn_pairwise_corrcoef_int8", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gn_sq, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gn0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gn1, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gn0_sq, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gn1_sq, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gn, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__106 = PyTuple_Pack(14, __pyx_n_s_gn, __pyx_n_s_fill, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_r, __pyx_n_s_out, __pyx_n_s_gn_sq, __pyx_n_s_gn0, __pyx_n_s_gn1, __pyx_n_s_gn0_sq, __pyx_n_s_gn1_sq, __pyx_n_s_n_pairs); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 92, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__106);
      __Pyx_GIVEREF(__pyx_tuple__106);
    /* … */
      __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5allel_3opt_5stats_3gn_pairwise_corrcoef_int8, NULL, __pyx_n_s_allel_opt_stats); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_gn_pairwise_corrcoef_int8, __pyx_t_1) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aliman_src_github_cggh_sci, __pyx_n_s_gn_pairwise_corrcoef_int8, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 92, __pyx_L1_error)

    +0093:                               cnp.float32_t fill=nan32):

      __pyx_k_ = __pyx_v_5allel_3opt_5stats_nan32;

     0094:     cdef:

     0095:         Py_ssize_t i, j, k, n

     0096:         cnp.float32_t r

     0097:         # correlation matrix in condensed form

     0098:         cnp.float32_t[:] out

     0099:         cnp.int8_t[:, :] gn_sq

     0100:         cnp.int8_t[:] gn0, gn1, gn0_sq, gn1_sq

     0101:

     0102:     # cache square calculation to improve performance

    +0103:     gn_sq = np.power(gn, 2)

      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_power); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_gn, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_int_2};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_int_2};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 103, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_2);
        __Pyx_INCREF(__pyx_int_2);
        __Pyx_GIVEREF(__pyx_int_2);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_int_2);
        __pyx_t_2 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(__pyx_t_1);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 103, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_gn_sq = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;

     0104:

     0105:     # setup output array

    +0106:     n = gn.shape[0]

      __pyx_v_n = (__pyx_v_gn.shape[0]);

     0107:     # number of distinct pairs

    +0108:     n_pairs = n * (n - 1) // 2

      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n * (__pyx_v_n - 1)), 2);

    +0109:     out = np.zeros(n_pairs, dtype=np.float32)

      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 109, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 109, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_out = __pyx_t_8;
      __pyx_t_8.memview = NULL;
      __pyx_t_8.data = NULL;

     0110:

     0111:     # iterate over distinct pairs

    +0112:     with nogil:

      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }

    +0113:         k = 0

            __pyx_v_k = 0;

    +0114:         for i in range(n):

            __pyx_t_9 = __pyx_v_n;
            for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
              __pyx_v_i = __pyx_t_10;

    +0115:             for j in range(i+1, n):

              __pyx_t_11 = __pyx_v_n;
              for (__pyx_t_12 = (__pyx_v_i + 1); __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
                __pyx_v_j = __pyx_t_12;

    +0116:                 gn0 = gn[i]

                __pyx_t_13.data = __pyx_v_gn.data;
                __pyx_t_13.memview = __pyx_v_gn.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_13, 0);
                {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_gn.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_gn.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 116, __pyx_L4_error)
        }
            __pyx_t_13.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_13.shape[0] = __pyx_v_gn.shape[1];
    __pyx_t_13.strides[0] = __pyx_v_gn.strides[1];
        __pyx_t_13.suboffsets[0] = -1;

    __PYX_XDEC_MEMVIEW(&__pyx_v_gn0, 0);
                __pyx_v_gn0 = __pyx_t_13;
                __pyx_t_13.memview = NULL;
                __pyx_t_13.data = NULL;

    +0117:                 gn1 = gn[j]

                __pyx_t_13.data = __pyx_v_gn.data;
                __pyx_t_13.memview = __pyx_v_gn.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_13, 0);
                {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_j;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_gn.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_gn.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 117, __pyx_L4_error)
        }
            __pyx_t_13.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_13.shape[0] = __pyx_v_gn.shape[1];
    __pyx_t_13.strides[0] = __pyx_v_gn.strides[1];
        __pyx_t_13.suboffsets[0] = -1;

    __PYX_XDEC_MEMVIEW(&__pyx_v_gn1, 0);
                __pyx_v_gn1 = __pyx_t_13;
                __pyx_t_13.memview = NULL;
                __pyx_t_13.data = NULL;

    +0118:                 gn0_sq = gn_sq[i]

                __pyx_t_13.data = __pyx_v_gn_sq.data;
                __pyx_t_13.memview = __pyx_v_gn_sq.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_13, 0);
                {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_gn_sq.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_gn_sq.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 118, __pyx_L4_error)
        }
            __pyx_t_13.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_13.shape[0] = __pyx_v_gn_sq.shape[1];
    __pyx_t_13.strides[0] = __pyx_v_gn_sq.strides[1];
        __pyx_t_13.suboffsets[0] = -1;

    __PYX_XDEC_MEMVIEW(&__pyx_v_gn0_sq, 0);
                __pyx_v_gn0_sq = __pyx_t_13;
                __pyx_t_13.memview = NULL;
                __pyx_t_13.data = NULL;

    +0119:                 gn1_sq = gn_sq[j]

                __pyx_t_13.data = __pyx_v_gn_sq.data;
                __pyx_t_13.memview = __pyx_v_gn_sq.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_13, 0);
                {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_j;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_gn_sq.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_gn_sq.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 119, __pyx_L4_error)
        }
            __pyx_t_13.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_13.shape[0] = __pyx_v_gn_sq.shape[1];
    __pyx_t_13.strides[0] = __pyx_v_gn_sq.strides[1];
        __pyx_t_13.suboffsets[0] = -1;

    __PYX_XDEC_MEMVIEW(&__pyx_v_gn1_sq, 0);
                __pyx_v_gn1_sq = __pyx_t_13;
                __pyx_t_13.memview = NULL;
                __pyx_t_13.data = NULL;

    +0120:                 r = gn_corrcoef_int8(gn0, gn1, gn0_sq, gn1_sq, fill)

                __pyx_v_r = __pyx_f_5allel_3opt_5stats_gn_corrcoef_int8(__pyx_v_gn0, __pyx_v_gn1, __pyx_v_gn0_sq, __pyx_v_gn1_sq, __pyx_v_fill, 0);

    +0121:                 out[k] = r

                __pyx_t_14 = __pyx_v_k;
                *((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_14 * __pyx_v_out.strides[0]) )) = __pyx_v_r;

    +0122:                 k += 1

                __pyx_v_k = (__pyx_v_k + 1);
              }
            }
          }

     0123:

    +0124:     return np.asarray(out)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_out, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float32_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;

     0125:

     0126:

     0127: @cython.boundscheck(False)

     0128: @cython.wraparound(False)

    +0129: def gn_pairwise2_corrcoef_int8(cnp.int8_t[:, :] gna not None,

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_5gn_pairwise2_corrcoef_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_mdef_5allel_3opt_5stats_5gn_pairwise2_corrcoef_int8 = {"gn_pairwise2_corrcoef_int8", (PyCFunction)__pyx_pw_5allel_3opt_5stats_5gn_pairwise2_corrcoef_int8, METH_VARARGS|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_5allel_3opt_5stats_5gn_pairwise2_corrcoef_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_gna = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gnb = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float32_t __pyx_v_fill;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("gn_pairwise2_corrcoef_int8 (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gna,&__pyx_n_s_gnb,&__pyx_n_s_fill,0};
        PyObject* values[3] = {0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gna)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gnb)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("gn_pairwise2_corrcoef_int8", 0, 2, 3, 1); __PYX_ERR(0, 129, __pyx_L3_error)
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill);
              if (value) { values[2] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gn_pairwise2_corrcoef_int8") < 0)) __PYX_ERR(0, 129, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_gna = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_gna.memview)) __PYX_ERR(0, 129, __pyx_L3_error)
        __pyx_v_gnb = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[1]); if (unlikely(!__pyx_v_gnb.memview)) __PYX_ERR(0, 130, __pyx_L3_error)
        if (values[2]) {
          __pyx_v_fill = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_fill == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L3_error)
        } else {
          __pyx_v_fill = __pyx_k__3;
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("gn_pairwise2_corrcoef_int8", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 129, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.gn_pairwise2_corrcoef_int8", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      if (unlikely(((PyObject *)__pyx_v_gna.memview) == Py_None)) {
        PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "gna"); __PYX_ERR(0, 129, __pyx_L1_error)
      }
      if (unlikely(((PyObject *)__pyx_v_gnb.memview) == Py_None)) {
        PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "gnb"); __PYX_ERR(0, 130, __pyx_L1_error)
      }
      __pyx_r = __pyx_pf_5allel_3opt_5stats_4gn_pairwise2_corrcoef_int8(__pyx_self, __pyx_v_gna, __pyx_v_gnb, __pyx_v_fill);

      /* function exit code */
      goto __pyx_L0;
      __pyx_L1_error:;
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_4gn_pairwise2_corrcoef_int8(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_gna, __Pyx_memviewslice __pyx_v_gnb, __pyx_t_5numpy_float32_t __pyx_v_fill) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_m;
      Py_ssize_t __pyx_v_n;
      __pyx_t_5numpy_float32_t __pyx_v_r;
      __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gna_sq = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gnb_sq = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gn0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gn1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gn0_sq = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gn1_sq = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_TraceFrameInit(__pyx_codeobj__4)
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("gn_pairwise2_corrcoef_int8", 0);
      __Pyx_TraceCall("gn_pairwise2_corrcoef_int8", __pyx_f[0], 129, 0, __PYX_ERR(0, 129, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6);
      __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
      __Pyx_AddTraceback("allel.opt.stats.gn_pairwise2_corrcoef_int8", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_out, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gna_sq, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gnb_sq, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gn0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gn1, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gn0_sq, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gn1_sq, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gna, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gnb, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__107 = PyTuple_Pack(16, __pyx_n_s_gna, __pyx_n_s_gnb, __pyx_n_s_fill, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_m, __pyx_n_s_n, __pyx_n_s_r, __pyx_n_s_out, __pyx_n_s_gna_sq, __pyx_n_s_gnb_sq, __pyx_n_s_gn0, __pyx_n_s_gn1, __pyx_n_s_gn0_sq, __pyx_n_s_gn1_sq); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 129, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__107);
      __Pyx_GIVEREF(__pyx_tuple__107);
    /* … */
      __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5allel_3opt_5stats_5gn_pairwise2_corrcoef_int8, NULL, __pyx_n_s_allel_opt_stats); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_gn_pairwise2_corrcoef_int8, __pyx_t_1) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(3, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aliman_src_github_cggh_sci, __pyx_n_s_gn_pairwise2_corrcoef_int8, 129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 129, __pyx_L1_error)

     0130:                                cnp.int8_t[:, :] gnb not None,

    +0131:                                cnp.float32_t fill=nan32):

      __pyx_k__3 = __pyx_v_5allel_3opt_5stats_nan32;

     0132:     cdef:

     0133:         Py_ssize_t i, j, k, m, n

     0134:         cnp.float32_t r

     0135:         # correlation matrix in condensed form

     0136:         cnp.float32_t[:, :] out

     0137:         cnp.int8_t[:, :] gna_sq, gnb_sq

     0138:         cnp.int8_t[:] gn0, gn1, gn0_sq, gn1_sq

     0139:

     0140:     # cache square calculation to improve performance

    +0141:     gna_sq = np.power(gna, 2)

      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_power); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_gna, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_int_2};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_int_2};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 141, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_2);
        __Pyx_INCREF(__pyx_int_2);
        __Pyx_GIVEREF(__pyx_int_2);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_int_2);
        __pyx_t_2 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(__pyx_t_1);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 141, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_gna_sq = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;

    +0142:     gnb_sq = np.power(gnb, 2)

      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_power); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_gnb, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, __pyx_int_2};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, __pyx_int_2};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (__pyx_t_2) {
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_t_3);
        __Pyx_INCREF(__pyx_int_2);
        __Pyx_GIVEREF(__pyx_int_2);
        PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_int_2);
        __pyx_t_3 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(__pyx_t_1);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 142, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_gnb_sq = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;

     0143:

     0144:     # setup output array

    +0145:     m = gna.shape[0]

      __pyx_v_m = (__pyx_v_gna.shape[0]);

    +0146:     n = gnb.shape[0]

      __pyx_v_n = (__pyx_v_gnb.shape[0]);

    +0147:     out = np.zeros((m, n), dtype=np.float32)

      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
      __pyx_t_1 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 147, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 147, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_out = __pyx_t_8;
      __pyx_t_8.memview = NULL;
      __pyx_t_8.data = NULL;

     0148:

     0149:     # iterate over distinct pairs

    +0150:     with nogil:

      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }

    +0151:         for i in range(m):

            __pyx_t_9 = __pyx_v_m;
            for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
              __pyx_v_i = __pyx_t_10;

    +0152:             for j in range(n):

              __pyx_t_11 = __pyx_v_n;
              for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
                __pyx_v_j = __pyx_t_12;

    +0153:                 gn0 = gna[i]

                __pyx_t_13.data = __pyx_v_gna.data;
                __pyx_t_13.memview = __pyx_v_gna.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_13, 0);
                {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_gna.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_gna.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 153, __pyx_L4_error)
        }
            __pyx_t_13.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_13.shape[0] = __pyx_v_gna.shape[1];
    __pyx_t_13.strides[0] = __pyx_v_gna.strides[1];
        __pyx_t_13.suboffsets[0] = -1;

    __PYX_XDEC_MEMVIEW(&__pyx_v_gn0, 0);
                __pyx_v_gn0 = __pyx_t_13;
                __pyx_t_13.memview = NULL;
                __pyx_t_13.data = NULL;

    +0154:                 gn1 = gnb[j]

                __pyx_t_13.data = __pyx_v_gnb.data;
                __pyx_t_13.memview = __pyx_v_gnb.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_13, 0);
                {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_j;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_gnb.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_gnb.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 154, __pyx_L4_error)
        }
            __pyx_t_13.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_13.shape[0] = __pyx_v_gnb.shape[1];
    __pyx_t_13.strides[0] = __pyx_v_gnb.strides[1];
        __pyx_t_13.suboffsets[0] = -1;

    __PYX_XDEC_MEMVIEW(&__pyx_v_gn1, 0);
                __pyx_v_gn1 = __pyx_t_13;
                __pyx_t_13.memview = NULL;
                __pyx_t_13.data = NULL;

    +0155:                 gn0_sq = gna_sq[i]

                __pyx_t_13.data = __pyx_v_gna_sq.data;
                __pyx_t_13.memview = __pyx_v_gna_sq.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_13, 0);
                {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_gna_sq.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_gna_sq.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 155, __pyx_L4_error)
        }
            __pyx_t_13.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_13.shape[0] = __pyx_v_gna_sq.shape[1];
    __pyx_t_13.strides[0] = __pyx_v_gna_sq.strides[1];
        __pyx_t_13.suboffsets[0] = -1;

    __PYX_XDEC_MEMVIEW(&__pyx_v_gn0_sq, 0);
                __pyx_v_gn0_sq = __pyx_t_13;
                __pyx_t_13.memview = NULL;
                __pyx_t_13.data = NULL;

    +0156:                 gn1_sq = gnb_sq[j]

                __pyx_t_13.data = __pyx_v_gnb_sq.data;
                __pyx_t_13.memview = __pyx_v_gnb_sq.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_13, 0);
                {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_j;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_gnb_sq.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_gnb_sq.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 156, __pyx_L4_error)
        }
            __pyx_t_13.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_13.shape[0] = __pyx_v_gnb_sq.shape[1];
    __pyx_t_13.strides[0] = __pyx_v_gnb_sq.strides[1];
        __pyx_t_13.suboffsets[0] = -1;

    __PYX_XDEC_MEMVIEW(&__pyx_v_gn1_sq, 0);
                __pyx_v_gn1_sq = __pyx_t_13;
                __pyx_t_13.memview = NULL;
                __pyx_t_13.data = NULL;

    +0157:                 r = gn_corrcoef_int8(gn0, gn1, gn0_sq, gn1_sq, fill)

                __pyx_v_r = __pyx_f_5allel_3opt_5stats_gn_corrcoef_int8(__pyx_v_gn0, __pyx_v_gn1, __pyx_v_gn0_sq, __pyx_v_gn1_sq, __pyx_v_fill, 0);

    +0158:                 out[i, j] = r

                __pyx_t_14 = __pyx_v_i;
                __pyx_t_15 = __pyx_v_j;
                *((__pyx_t_5numpy_float32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_14 * __pyx_v_out.strides[0]) ) + __pyx_t_15 * __pyx_v_out.strides[1]) )) = __pyx_v_r;
              }
            }
          }

     0159:

    +0160:     return np.asarray(out)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_out, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float32_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

     0161:

     0162:

     0163: @cython.boundscheck(False)

     0164: @cython.wraparound(False)

    +0165: def gn_locate_unlinked_int8(cnp.int8_t[:, :] gn not None,

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_7gn_locate_unlinked_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_mdef_5allel_3opt_5stats_7gn_locate_unlinked_int8 = {"gn_locate_unlinked_int8", (PyCFunction)__pyx_pw_5allel_3opt_5stats_7gn_locate_unlinked_int8, METH_VARARGS|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_5allel_3opt_5stats_7gn_locate_unlinked_int8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_gn = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_loc = { 0, 0, { 0 }, { 0 }, { 0 } };
      Py_ssize_t __pyx_v_size;
      Py_ssize_t __pyx_v_step;
      __pyx_t_5numpy_float32_t __pyx_v_threshold;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("gn_locate_unlinked_int8 (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gn,&__pyx_n_s_loc,&__pyx_n_s_size,&__pyx_n_s_step,&__pyx_n_s_threshold,0};
        PyObject* values[5] = {0,0,0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gn)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loc)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("gn_locate_unlinked_int8", 1, 5, 5, 1); __PYX_ERR(0, 165, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("gn_locate_unlinked_int8", 1, 5, 5, 2); __PYX_ERR(0, 165, __pyx_L3_error)
            }
            case  3:
            if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("gn_locate_unlinked_int8", 1, 5, 5, 3); __PYX_ERR(0, 165, __pyx_L3_error)
            }
            case  4:
            if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_threshold)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("gn_locate_unlinked_int8", 1, 5, 5, 4); __PYX_ERR(0, 165, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gn_locate_unlinked_int8") < 0)) __PYX_ERR(0, 165, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
          values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        }
        __pyx_v_gn = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_gn.memview)) __PYX_ERR(0, 165, __pyx_L3_error)
        __pyx_v_loc = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(values[1]); if (unlikely(!__pyx_v_loc.memview)) __PYX_ERR(0, 166, __pyx_L3_error)
        __pyx_v_size = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_size == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L3_error)
        __pyx_v_step = __Pyx_PyIndex_AsSsize_t(values[3]); if (unlikely((__pyx_v_step == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L3_error)
        __pyx_v_threshold = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_threshold == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("gn_locate_unlinked_int8", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 165, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.gn_locate_unlinked_int8", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      if (unlikely(((PyObject *)__pyx_v_gn.memview) == Py_None)) {
        PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "gn"); __PYX_ERR(0, 165, __pyx_L1_error)
      }
      if (unlikely(((PyObject *)__pyx_v_loc.memview) == Py_None)) {
        PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "loc"); __PYX_ERR(0, 166, __pyx_L1_error)
      }
      __pyx_r = __pyx_pf_5allel_3opt_5stats_6gn_locate_unlinked_int8(__pyx_self, __pyx_v_gn, __pyx_v_loc, __pyx_v_size, __pyx_v_step, __pyx_v_threshold);

      /* function exit code */
      goto __pyx_L0;
      __pyx_L1_error:;
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_6gn_locate_unlinked_int8(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_gn, __Pyx_memviewslice __pyx_v_loc, Py_ssize_t __pyx_v_size, Py_ssize_t __pyx_v_step, __pyx_t_5numpy_float32_t __pyx_v_threshold) {
      Py_ssize_t __pyx_v_window_start;
      Py_ssize_t __pyx_v_window_stop;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_n_variants;
      __pyx_t_5numpy_float32_t __pyx_v_r_squared;
      __Pyx_memviewslice __pyx_v_gn_sq = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gn0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gn1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gn0_sq = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gn1_sq = { 0, 0, { 0 }, { 0 }, { 0 } };
      int __pyx_v_overlap;
      int __pyx_v_last;
      __pyx_t_5numpy_float32_t __pyx_v_fill;
      Py_ssize_t __pyx_v_ii;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_TraceFrameInit(__pyx_codeobj__5)
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("gn_locate_unlinked_int8", 0);
      __Pyx_TraceCall("gn_locate_unlinked_int8", __pyx_f[0], 165, 0, __PYX_ERR(0, 165, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6);
      __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
      __Pyx_AddTraceback("allel.opt.stats.gn_locate_unlinked_int8", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_gn_sq, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gn0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gn1, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gn0_sq, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gn1_sq, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gn, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_loc, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__108 = PyTuple_Pack(20, __pyx_n_s_gn, __pyx_n_s_loc, __pyx_n_s_size, __pyx_n_s_step, __pyx_n_s_threshold, __pyx_n_s_window_start, __pyx_n_s_window_stop, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n_variants, __pyx_n_s_r_squared, __pyx_n_s_gn_sq, __pyx_n_s_gn0, __pyx_n_s_gn1, __pyx_n_s_gn0_sq, __pyx_n_s_gn1_sq, __pyx_n_s_overlap, __pyx_n_s_last, __pyx_n_s_fill, __pyx_n_s_ii); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__108);
      __Pyx_GIVEREF(__pyx_tuple__108);
    /* … */
      __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5allel_3opt_5stats_7gn_locate_unlinked_int8, NULL, __pyx_n_s_allel_opt_stats); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_gn_locate_unlinked_int8, __pyx_t_1) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(5, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aliman_src_github_cggh_sci, __pyx_n_s_gn_locate_unlinked_int8, 165, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 165, __pyx_L1_error)

     0166:                             cnp.uint8_t[:] loc not None,

     0167:                             Py_ssize_t size, Py_ssize_t step,

     0168:                             cnp.float32_t threshold):

     0169:     cdef:

     0170:         Py_ssize_t window_start, window_stop, i, j, n_variants

     0171:         cnp.float32_t r_squared

     0172:         cnp.int8_t[:, :] gn_sq

     0173:         cnp.int8_t[:] gn0, gn1, gn0_sq, gn1_sq

    +0174:         int overlap = size - step

      __pyx_v_overlap = (__pyx_v_size - __pyx_v_step);

     0175:         bint last

    +0176:         cnp.float32_t fill = nan32

      __pyx_v_fill = __pyx_v_5allel_3opt_5stats_nan32;

     0177:

     0178:     # cache square calculation to improve performance

    +0179:     gn_sq = np.power(gn, 2)

      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_power); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_gn, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_int_2};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_int_2};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_2);
        __Pyx_INCREF(__pyx_int_2);
        __Pyx_GIVEREF(__pyx_int_2);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_int_2);
        __pyx_t_2 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(__pyx_t_1);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 179, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_gn_sq = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;

     0180:

     0181:     # setup

    +0182:     n_variants = gn.shape[0]

      __pyx_v_n_variants = (__pyx_v_gn.shape[0]);

    +0183:     last = False

      __pyx_v_last = 0;

     0184:

    +0185:     for window_start in range(0, n_variants, step):

      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
        __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
      } else {
        __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 185, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      for (;;) {
        if (likely(!__pyx_t_9)) {
          if (likely(PyList_CheckExact(__pyx_t_6))) {
            if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 185, __pyx_L1_error)
            #else
            __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          } else {
            if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 185, __pyx_L1_error)
            #else
            __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          }
        } else {
          __pyx_t_3 = __pyx_t_9(__pyx_t_6);
          if (unlikely(!__pyx_t_3)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 185, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_3);
        }
        __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_window_start = __pyx_t_10;
    /* … */
      }
      __pyx_L4_break:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +0186:         with nogil:

        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            #endif
            /*try:*/ {
    /* … */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L9;
              }
              __pyx_L6_break: {
                #ifdef WITH_THREAD
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L4_break;
              }
              __pyx_L8_error: {
                #ifdef WITH_THREAD
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L1_error;
              }
              __pyx_L9:;
            }
        }

     0187:

     0188:             # determine end of current window

    +0189:             window_stop = window_start + size

              __pyx_v_window_stop = (__pyx_v_window_start + __pyx_v_size);

    +0190:             if window_stop > n_variants:

              __pyx_t_11 = ((__pyx_v_window_stop > __pyx_v_n_variants) != 0);
              if (__pyx_t_11) {
    /* … */
              }

    +0191:                 window_stop = n_variants

                __pyx_v_window_stop = __pyx_v_n_variants;

    +0192:                 last = True

                __pyx_v_last = 1;

     0193:

    +0194:             if window_start == 0:

              __pyx_t_11 = ((__pyx_v_window_start == 0) != 0);
              if (__pyx_t_11) {
    /* … */
                goto __pyx_L11;
              }

     0195:                 # first window

    +0196:                 for i in range(window_start, window_stop):

                __pyx_t_10 = __pyx_v_window_stop;
                for (__pyx_t_12 = __pyx_v_window_start; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
                  __pyx_v_i = __pyx_t_12;

     0197:                     # only go further if still unlinked

    +0198:                     if loc[i]:

                  __pyx_t_13 = __pyx_v_i;
                  __pyx_t_11 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_loc.data + __pyx_t_13 * __pyx_v_loc.strides[0]) ))) != 0);
                  if (__pyx_t_11) {
    /* … */
                  }
                }

    +0199:                         for j in range(i+1, window_stop):

                    __pyx_t_14 = __pyx_v_window_stop;
                    for (__pyx_t_15 = (__pyx_v_i + 1); __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
                      __pyx_v_j = __pyx_t_15;

     0200:                             # only go further if still unlinked

    +0201:                             if loc[j]:

                      __pyx_t_16 = __pyx_v_j;
                      __pyx_t_11 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_loc.data + __pyx_t_16 * __pyx_v_loc.strides[0]) ))) != 0);
                      if (__pyx_t_11) {
    /* … */
                      }
                    }

    +0202:                                 gn0 = gn[i]

                        __pyx_t_17.data = __pyx_v_gn.data;
                        __pyx_t_17.memview = __pyx_v_gn.memview;
                        __PYX_INC_MEMVIEW(&__pyx_t_17, 0);
                        {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_gn.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_gn.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 202, __pyx_L8_error)
        }
            __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_17.shape[0] = __pyx_v_gn.shape[1];
    __pyx_t_17.strides[0] = __pyx_v_gn.strides[1];
        __pyx_t_17.suboffsets[0] = -1;

    __PYX_XDEC_MEMVIEW(&__pyx_v_gn0, 0);
                        __pyx_v_gn0 = __pyx_t_17;
                        __pyx_t_17.memview = NULL;
                        __pyx_t_17.data = NULL;

    +0203:                                 gn1 = gn[j]

                        __pyx_t_17.data = __pyx_v_gn.data;
                        __pyx_t_17.memview = __pyx_v_gn.memview;
                        __PYX_INC_MEMVIEW(&__pyx_t_17, 0);
                        {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_j;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_gn.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_gn.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 203, __pyx_L8_error)
        }
            __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_17.shape[0] = __pyx_v_gn.shape[1];
    __pyx_t_17.strides[0] = __pyx_v_gn.strides[1];
        __pyx_t_17.suboffsets[0] = -1;

    __PYX_XDEC_MEMVIEW(&__pyx_v_gn1, 0);
                        __pyx_v_gn1 = __pyx_t_17;
                        __pyx_t_17.memview = NULL;
                        __pyx_t_17.data = NULL;

    +0204:                                 gn0_sq = gn_sq[i]

                        __pyx_t_17.data = __pyx_v_gn_sq.data;
                        __pyx_t_17.memview = __pyx_v_gn_sq.memview;
                        __PYX_INC_MEMVIEW(&__pyx_t_17, 0);
                        {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_gn_sq.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_gn_sq.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 204, __pyx_L8_error)
        }
            __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_17.shape[0] = __pyx_v_gn_sq.shape[1];
    __pyx_t_17.strides[0] = __pyx_v_gn_sq.strides[1];
        __pyx_t_17.suboffsets[0] = -1;

    __PYX_XDEC_MEMVIEW(&__pyx_v_gn0_sq, 0);
                        __pyx_v_gn0_sq = __pyx_t_17;
                        __pyx_t_17.memview = NULL;
                        __pyx_t_17.data = NULL;

    +0205:                                 gn1_sq = gn_sq[j]

                        __pyx_t_17.data = __pyx_v_gn_sq.data;
                        __pyx_t_17.memview = __pyx_v_gn_sq.memview;
                        __PYX_INC_MEMVIEW(&__pyx_t_17, 0);
                        {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_j;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_gn_sq.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_gn_sq.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 205, __pyx_L8_error)
        }
            __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_17.shape[0] = __pyx_v_gn_sq.shape[1];
    __pyx_t_17.strides[0] = __pyx_v_gn_sq.strides[1];
        __pyx_t_17.suboffsets[0] = -1;

    __PYX_XDEC_MEMVIEW(&__pyx_v_gn1_sq, 0);
                        __pyx_v_gn1_sq = __pyx_t_17;
                        __pyx_t_17.memview = NULL;
                        __pyx_t_17.data = NULL;

     0206:                                 r_squared = gn_corrcoef_int8(gn0, gn1, gn0_sq,

    +0207:                                                              gn1_sq, fill) ** 2

                        __pyx_v_r_squared = powf(__pyx_f_5allel_3opt_5stats_gn_corrcoef_int8(__pyx_v_gn0, __pyx_v_gn1, __pyx_v_gn0_sq, __pyx_v_gn1_sq, __pyx_v_fill, 0), 2.0);

    +0208:                                 if r_squared > threshold:

                        __pyx_t_11 = ((__pyx_v_r_squared > __pyx_v_threshold) != 0);
                        if (__pyx_t_11) {
    /* … */
                        }

    +0209:                                     loc[j] = 0

                          __pyx_t_18 = __pyx_v_j;
                          *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_loc.data + __pyx_t_18 * __pyx_v_loc.strides[0]) )) = 0;

     0210:

     0211:             else:

     0212:                 # subsequent windows

    +0213:                 for i in range(window_start, window_stop):

              /*else*/ {
                __pyx_t_10 = __pyx_v_window_stop;
                for (__pyx_t_12 = __pyx_v_window_start; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
                  __pyx_v_i = __pyx_t_12;

     0214:                     # only go further if still unlinked

    +0215:                     if loc[i]:

                  __pyx_t_19 = __pyx_v_i;
                  __pyx_t_11 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_loc.data + __pyx_t_19 * __pyx_v_loc.strides[0]) ))) != 0);
                  if (__pyx_t_11) {
    /* … */
                  }
                }
              }
              __pyx_L11:;

     0216:                         # don't recalculate anything from overlap with previous

     0217:                         # window

    +0218:                         ii = max(i+1, window_start+overlap)

                    __pyx_t_14 = (__pyx_v_window_start + __pyx_v_overlap);
                    __pyx_t_15 = (__pyx_v_i + 1);
                    if (((__pyx_t_14 > __pyx_t_15) != 0)) {
                      __pyx_t_20 = __pyx_t_14;
                    } else {
                      __pyx_t_20 = __pyx_t_15;
                    }
                    __pyx_v_ii = __pyx_t_20;

    +0219:                         if ii < window_stop:

                    __pyx_t_11 = ((__pyx_v_ii < __pyx_v_window_stop) != 0);
                    if (__pyx_t_11) {
    /* … */
                    }

    +0220:                             for j in range(ii, window_stop):

                      __pyx_t_20 = __pyx_v_window_stop;
                      for (__pyx_t_14 = __pyx_v_ii; __pyx_t_14 < __pyx_t_20; __pyx_t_14+=1) {
                        __pyx_v_j = __pyx_t_14;

     0221:                                 # only go further if still unlinked

    +0222:                                 if loc[j]:

                        __pyx_t_21 = __pyx_v_j;
                        __pyx_t_11 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_loc.data + __pyx_t_21 * __pyx_v_loc.strides[0]) ))) != 0);
                        if (__pyx_t_11) {
    /* … */
                        }
                      }

    +0223:                                     gn0 = gn[i]

                          __pyx_t_17.data = __pyx_v_gn.data;
                          __pyx_t_17.memview = __pyx_v_gn.memview;
                          __PYX_INC_MEMVIEW(&__pyx_t_17, 0);
                          {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_gn.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_gn.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 223, __pyx_L8_error)
        }
            __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_17.shape[0] = __pyx_v_gn.shape[1];
    __pyx_t_17.strides[0] = __pyx_v_gn.strides[1];
        __pyx_t_17.suboffsets[0] = -1;

    __PYX_XDEC_MEMVIEW(&__pyx_v_gn0, 0);
                          __pyx_v_gn0 = __pyx_t_17;
                          __pyx_t_17.memview = NULL;
                          __pyx_t_17.data = NULL;

    +0224:                                     gn1 = gn[j]

                          __pyx_t_17.data = __pyx_v_gn.data;
                          __pyx_t_17.memview = __pyx_v_gn.memview;
                          __PYX_INC_MEMVIEW(&__pyx_t_17, 0);
                          {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_j;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_gn.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_gn.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 224, __pyx_L8_error)
        }
            __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_17.shape[0] = __pyx_v_gn.shape[1];
    __pyx_t_17.strides[0] = __pyx_v_gn.strides[1];
        __pyx_t_17.suboffsets[0] = -1;

    __PYX_XDEC_MEMVIEW(&__pyx_v_gn1, 0);
                          __pyx_v_gn1 = __pyx_t_17;
                          __pyx_t_17.memview = NULL;
                          __pyx_t_17.data = NULL;

    +0225:                                     gn0_sq = gn_sq[i]

                          __pyx_t_17.data = __pyx_v_gn_sq.data;
                          __pyx_t_17.memview = __pyx_v_gn_sq.memview;
                          __PYX_INC_MEMVIEW(&__pyx_t_17, 0);
                          {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_gn_sq.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_gn_sq.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 225, __pyx_L8_error)
        }
            __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_17.shape[0] = __pyx_v_gn_sq.shape[1];
    __pyx_t_17.strides[0] = __pyx_v_gn_sq.strides[1];
        __pyx_t_17.suboffsets[0] = -1;

    __PYX_XDEC_MEMVIEW(&__pyx_v_gn0_sq, 0);
                          __pyx_v_gn0_sq = __pyx_t_17;
                          __pyx_t_17.memview = NULL;
                          __pyx_t_17.data = NULL;

    +0226:                                     gn1_sq = gn_sq[j]

                          __pyx_t_17.data = __pyx_v_gn_sq.data;
                          __pyx_t_17.memview = __pyx_v_gn_sq.memview;
                          __PYX_INC_MEMVIEW(&__pyx_t_17, 0);
                          {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_j;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_gn_sq.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_gn_sq.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 226, __pyx_L8_error)
        }
            __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_17.shape[0] = __pyx_v_gn_sq.shape[1];
    __pyx_t_17.strides[0] = __pyx_v_gn_sq.strides[1];
        __pyx_t_17.suboffsets[0] = -1;

    __PYX_XDEC_MEMVIEW(&__pyx_v_gn1_sq, 0);
                          __pyx_v_gn1_sq = __pyx_t_17;
                          __pyx_t_17.memview = NULL;
                          __pyx_t_17.data = NULL;

     0227:                                     r_squared = gn_corrcoef_int8(gn0, gn1,

     0228:                                                                  gn0_sq,

     0229:                                                                  gn1_sq,

    +0230:                                                                  fill) ** 2

                          __pyx_v_r_squared = powf(__pyx_f_5allel_3opt_5stats_gn_corrcoef_int8(__pyx_v_gn0, __pyx_v_gn1, __pyx_v_gn0_sq, __pyx_v_gn1_sq, __pyx_v_fill, 0), 2.0);

    +0231:                                     if r_squared > threshold:

                          __pyx_t_11 = ((__pyx_v_r_squared > __pyx_v_threshold) != 0);
                          if (__pyx_t_11) {
    /* … */
                          }

    +0232:                                         loc[j] = 0

                            __pyx_t_22 = __pyx_v_j;
                            *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_loc.data + __pyx_t_22 * __pyx_v_loc.strides[0]) )) = 0;

     0233:

    +0234:             if last:

              __pyx_t_11 = (__pyx_v_last != 0);
              if (__pyx_t_11) {
    /* … */
              }
            }

    +0235:                 break

                goto __pyx_L6_break;

     0236:

     0237:

     0238: @cython.boundscheck(False)

     0239: @cython.wraparound(False)

    +0240: cpdef Py_ssize_t shared_prefix_length(integer[:] a,

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_9shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_5allel_3opt_5stats_8shared_prefix_length[] = "Compute the length of the shared prefix between two arrays.";
    static PyMethodDef __pyx_mdef_5allel_3opt_5stats_9shared_prefix_length = {"shared_prefix_length", (PyCFunction)__pyx_pw_5allel_3opt_5stats_9shared_prefix_length, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_8shared_prefix_length};
    static PyObject *__pyx_pw_5allel_3opt_5stats_9shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_signatures = 0;
      PyObject *__pyx_v_args = 0;
      PyObject *__pyx_v_kwargs = 0;
      CYTHON_UNUSED PyObject *__pyx_v_defaults = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0};
        PyObject* values[4] = {0,0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 240, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 240, __pyx_L3_error)
            }
            case  3:
            if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 240, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 240, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        }
        __pyx_v_signatures = values[0];
        __pyx_v_args = values[1];
        __pyx_v_kwargs = values[2];
        __pyx_v_defaults = values[3];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 240, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_8shared_prefix_length(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_8shared_prefix_length(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
      PyObject *__pyx_v_dest_sig = NULL;
      PyTypeObject *__pyx_v_ndarray = 0;
      PyObject *__pyx_v_numpy = NULL;
      __Pyx_memviewslice __pyx_v_memslice;
      Py_ssize_t __pyx_v_itemsize;
      int __pyx_v_dtype_signed;
      char __pyx_v_kind;
      int __pyx_v____pyx_int32_t_is_signed;
      int __pyx_v____pyx_uint32_t_is_signed;
      int __pyx_v____pyx_uint16_t_is_signed;
      int __pyx_v____pyx_int16_t_is_signed;
      int __pyx_v____pyx_uint64_t_is_signed;
      int __pyx_v____pyx_uint8_t_is_signed;
      int __pyx_v____pyx_int64_t_is_signed;
      int __pyx_v____pyx_int8_t_is_signed;
      PyObject *__pyx_v_arg = NULL;
      PyObject *__pyx_v_dtype = NULL;
      PyObject *__pyx_v_arg_base = NULL;
      PyObject *__pyx_v_candidates = NULL;
      PyObject *__pyx_v_sig = NULL;
      int __pyx_v_match_found;
      PyObject *__pyx_v_src_type = NULL;
      PyObject *__pyx_v_dst_type = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("shared_prefix_length", 0);
      __Pyx_TraceCall("shared_prefix_length", __pyx_f[0], 240, 0, __PYX_ERR(0, 240, __pyx_L1_error));
      __Pyx_INCREF(__pyx_v_kwargs);
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
      __pyx_v_dest_sig = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_2 = (__pyx_v_kwargs == Py_None);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {
        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1);
        __pyx_t_1 = 0;
      }
      {
        /*try:*/ {
          __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_v_numpy = __pyx_t_1;
          __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 240, __pyx_L4_error)
          __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1);
          __pyx_t_1 = 0;
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L11_try_end;
        __pyx_L4_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
        if (__pyx_t_7) {
          __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 240, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_INCREF(Py_None);
          __Pyx_XDECREF_SET(__pyx_v_ndarray, ((PyTypeObject*)Py_None));
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L5_exception_handled;
        }
        goto __pyx_L6_except_error;
        __pyx_L6_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L1_error;
        __pyx_L5_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        __pyx_L11_try_end:;
      }
      __pyx_v_itemsize = -1L;
      __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1L) < 0);
      __pyx_v____pyx_uint32_t_is_signed = (((__pyx_t_5numpy_uint32_t)-1L) < 0);
      __pyx_v____pyx_uint16_t_is_signed = (((__pyx_t_5numpy_uint16_t)-1L) < 0);
      __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1L) < 0);
      __pyx_v____pyx_uint64_t_is_signed = (((__pyx_t_5numpy_uint64_t)-1L) < 0);
      __pyx_v____pyx_uint8_t_is_signed = (((__pyx_t_5numpy_uint8_t)-1L) < 0);
      __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1L) < 0);
      __pyx_v____pyx_int8_t_is_signed = (((__pyx_t_5numpy_int8_t)-1L) < 0);
      if (unlikely(__pyx_v_args == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 240, __pyx_L1_error)
      }
      __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 240, __pyx_L1_error)
      __pyx_t_3 = ((0 < __pyx_t_10) != 0);
      if (__pyx_t_3) {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 240, __pyx_L1_error)
        }
        __pyx_t_9 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      if (unlikely(__pyx_v_kwargs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 240, __pyx_L1_error)
      }
      __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_a, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {
        if (unlikely(__pyx_v_kwargs == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 240, __pyx_L1_error)
        }
        __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_a); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      /*else*/ {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(0, 240, __pyx_L1_error)
        }
        __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 240, __pyx_L1_error)
        __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 240, __pyx_L1_error)
      }
      __pyx_L14:;
      while (1) {
        __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None));
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {
          __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_dtype = __pyx_t_8;
            __pyx_t_8 = 0;
            goto __pyx_L18;
          }
          __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_arg_base = __pyx_t_8;
            __pyx_t_8 = 0;
            __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
            __pyx_t_2 = (__pyx_t_3 != 0);
            if (__pyx_t_2) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_v_dtype = __pyx_t_8;
              __pyx_t_8 = 0;
              goto __pyx_L19;
            }
            /*else*/ {
              __Pyx_INCREF(Py_None);
              __pyx_v_dtype = Py_None;
            }
            __pyx_L19:;
            goto __pyx_L18;
          }
          /*else*/ {
            __Pyx_INCREF(Py_None);
            __pyx_v_dtype = Py_None;
          }
          __pyx_L18:;
          __pyx_v_itemsize = -1L;
          __pyx_t_2 = (__pyx_v_dtype != Py_None);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_itemsize = __pyx_t_10;
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 240, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_kind = __pyx_t_11;
            __pyx_v_dtype_signed = (__pyx_v_kind == 'i');
            switch (__pyx_v_kind) {
              case 'i':
              case 'u':
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L22_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L26_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L30_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L34_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L38_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L42_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L46_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L50_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              break;
              case 'f':
              break;
              case 'c':
              break;
              case 'O':
              break;
              default: break;
            }
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L54_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L54_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L58_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L58_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L62_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L62_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L66_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L66_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L70_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L70_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L74_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L74_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L78_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L78_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L82_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L82_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
        goto __pyx_L16_break;
      }
      __pyx_L16_break:;
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_candidates = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_10 = 0;
      if (unlikely(__pyx_v_signatures == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 240, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8);
      __pyx_t_8 = __pyx_t_9;
      __pyx_t_9 = 0;
      while (1) {
        __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_13, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7);
        if (unlikely(__pyx_t_14 == 0)) break;
        if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_v_match_found = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /* … */
      __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__7);
      __Pyx_GIVEREF(__pyx_tuple__7);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
        __Pyx_INCREF(__pyx_v_dest_sig);
        __Pyx_GIVEREF(__pyx_v_dest_sig);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dest_sig);
        __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
          __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_15 = 0;
          __pyx_t_16 = NULL;
        } else {
          __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 240, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 240, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        for (;;) {
          if (likely(!__pyx_t_16)) {
            if (likely(PyList_CheckExact(__pyx_t_9))) {
              if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            } else {
              if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            }
          } else {
            __pyx_t_1 = __pyx_t_16(__pyx_t_9);
            if (unlikely(!__pyx_t_1)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 240, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_1);
          }
          if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
            PyObject* sequence = __pyx_t_1;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 240, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1);
            } else {
              __pyx_t_17 = PyList_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyList_GET_ITEM(sequence, 1);
            }
            __Pyx_INCREF(__pyx_t_17);
            __Pyx_INCREF(__pyx_t_18);
            #else
            __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 240, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 240, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_18);
            #endif
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 240, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
            index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_17);
            index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_18);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) __PYX_ERR(0, 240, __pyx_L1_error)
            __pyx_t_20 = NULL;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            goto __pyx_L90_unpacking_done;
            __pyx_L89_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __pyx_t_20 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 240, __pyx_L1_error)
            __pyx_L90_unpacking_done:;
          }
          __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17);
          __pyx_t_17 = 0;
          __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18);
          __pyx_t_18 = 0;
          __pyx_t_3 = (__pyx_v_dst_type != Py_None);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (__pyx_t_2) {
              __pyx_v_match_found = 1;
              goto __pyx_L92;
            }
            /*else*/ {
              __pyx_v_match_found = 0;
              goto __pyx_L88_break;
            }
            __pyx_L92:;
          }
        }
        __pyx_L88_break:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_2 = (__pyx_v_match_found != 0);
        if (__pyx_t_2) {
          __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 240, __pyx_L1_error)
        }
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
      __pyx_t_3 = ((!__pyx_t_2) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s__8); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__9);
      __Pyx_GIVEREF(__pyx_tuple__9);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 240, __pyx_L1_error)
      }
      __pyx_t_13 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 240, __pyx_L1_error)
      __pyx_t_3 = ((__pyx_t_13 > 1) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__10);
      __Pyx_GIVEREF(__pyx_tuple__10);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 240, __pyx_L1_error)
      }
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_signatures == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 240, __pyx_L1_error)
        }
        __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        goto __pyx_L0;
      }

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_dest_sig);
      __Pyx_XDECREF(__pyx_v_ndarray);
      __Pyx_XDECREF(__pyx_v_numpy);
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XDECREF(__pyx_v_dtype);
      __Pyx_XDECREF(__pyx_v_arg_base);
      __Pyx_XDECREF(__pyx_v_candidates);
      __Pyx_XDECREF(__pyx_v_sig);
      __Pyx_XDECREF(__pyx_v_src_type);
      __Pyx_XDECREF(__pyx_v_dst_type);
      __Pyx_XDECREF(__pyx_v_kwargs);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_39__pyx_fuse_0shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_9shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static Py_ssize_t __pyx_fuse_0__pyx_f_5allel_3opt_5stats_shared_prefix_length(__Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_b, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_r;
      __Pyx_TraceDeclarations
      __Pyx_TraceCall("__pyx_fuse_0shared_prefix_length", __pyx_f[0], 240, 1, __PYX_ERR(0, 240, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_WriteUnraisable("allel.opt.stats.shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_TraceReturn(Py_None, 1);
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_39__pyx_fuse_0shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_39__pyx_fuse_0shared_prefix_length = {"__pyx_fuse_0shared_prefix_length", (PyCFunction)__pyx_pw_5allel_3opt_5stats_39__pyx_fuse_0shared_prefix_length, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_8shared_prefix_length};
    static PyObject *__pyx_pw_5allel_3opt_5stats_39__pyx_fuse_0shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_b = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_0shared_prefix_length (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_0shared_prefix_length", 1, 2, 2, 1); __PYX_ERR(0, 240, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_0shared_prefix_length") < 0)) __PYX_ERR(0, 240, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_a.memview)) __PYX_ERR(0, 240, __pyx_L3_error)
        __pyx_v_b = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(values[1]); if (unlikely(!__pyx_v_b.memview)) __PYX_ERR(0, 241, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_0shared_prefix_length", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 240, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_0shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_38__pyx_fuse_0shared_prefix_length(__pyx_self, __pyx_v_a, __pyx_v_b);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_38__pyx_fuse_0shared_prefix_length(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_b) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_0shared_prefix_length", 0);
      __Pyx_TraceCall("__pyx_fuse_0shared_prefix_length (wrapper)", __pyx_f[0], 240, 0, __PYX_ERR(0, 240, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); __PYX_ERR(0, 240, __pyx_L1_error) }
      if (unlikely(!__pyx_v_b.memview)) { __Pyx_RaiseUnboundLocalError("b"); __PYX_ERR(0, 240, __pyx_L1_error) }
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_fuse_0__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_v_a, __pyx_v_b, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_0shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_b, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_41__pyx_fuse_1shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_9shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static Py_ssize_t __pyx_fuse_1__pyx_f_5allel_3opt_5stats_shared_prefix_length(__Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_b, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_r;
      __Pyx_TraceDeclarations
      __Pyx_TraceCall("__pyx_fuse_1shared_prefix_length", __pyx_f[0], 240, 1, __PYX_ERR(0, 240, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_WriteUnraisable("allel.opt.stats.shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_TraceReturn(Py_None, 1);
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_41__pyx_fuse_1shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_41__pyx_fuse_1shared_prefix_length = {"__pyx_fuse_1shared_prefix_length", (PyCFunction)__pyx_pw_5allel_3opt_5stats_41__pyx_fuse_1shared_prefix_length, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_8shared_prefix_length};
    static PyObject *__pyx_pw_5allel_3opt_5stats_41__pyx_fuse_1shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_b = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_1shared_prefix_length (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_1shared_prefix_length", 1, 2, 2, 1); __PYX_ERR(0, 240, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_1shared_prefix_length") < 0)) __PYX_ERR(0, 240, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_a.memview)) __PYX_ERR(0, 240, __pyx_L3_error)
        __pyx_v_b = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_b.memview)) __PYX_ERR(0, 241, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_1shared_prefix_length", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 240, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_1shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_40__pyx_fuse_1shared_prefix_length(__pyx_self, __pyx_v_a, __pyx_v_b);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_40__pyx_fuse_1shared_prefix_length(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_b) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_1shared_prefix_length", 0);
      __Pyx_TraceCall("__pyx_fuse_1shared_prefix_length (wrapper)", __pyx_f[0], 240, 0, __PYX_ERR(0, 240, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); __PYX_ERR(0, 240, __pyx_L1_error) }
      if (unlikely(!__pyx_v_b.memview)) { __Pyx_RaiseUnboundLocalError("b"); __PYX_ERR(0, 240, __pyx_L1_error) }
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_fuse_1__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_v_a, __pyx_v_b, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_1shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_b, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_43__pyx_fuse_2shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_9shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static Py_ssize_t __pyx_fuse_2__pyx_f_5allel_3opt_5stats_shared_prefix_length(__Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_b, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_r;
      __Pyx_TraceDeclarations
      __Pyx_TraceCall("__pyx_fuse_2shared_prefix_length", __pyx_f[0], 240, 1, __PYX_ERR(0, 240, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_WriteUnraisable("allel.opt.stats.shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_TraceReturn(Py_None, 1);
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_43__pyx_fuse_2shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_43__pyx_fuse_2shared_prefix_length = {"__pyx_fuse_2shared_prefix_length", (PyCFunction)__pyx_pw_5allel_3opt_5stats_43__pyx_fuse_2shared_prefix_length, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_8shared_prefix_length};
    static PyObject *__pyx_pw_5allel_3opt_5stats_43__pyx_fuse_2shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_b = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_2shared_prefix_length (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_2shared_prefix_length", 1, 2, 2, 1); __PYX_ERR(0, 240, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_2shared_prefix_length") < 0)) __PYX_ERR(0, 240, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_a.memview)) __PYX_ERR(0, 240, __pyx_L3_error)
        __pyx_v_b = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_b.memview)) __PYX_ERR(0, 241, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_2shared_prefix_length", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 240, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_2shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_42__pyx_fuse_2shared_prefix_length(__pyx_self, __pyx_v_a, __pyx_v_b);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_42__pyx_fuse_2shared_prefix_length(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_b) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_2shared_prefix_length", 0);
      __Pyx_TraceCall("__pyx_fuse_2shared_prefix_length (wrapper)", __pyx_f[0], 240, 0, __PYX_ERR(0, 240, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); __PYX_ERR(0, 240, __pyx_L1_error) }
      if (unlikely(!__pyx_v_b.memview)) { __Pyx_RaiseUnboundLocalError("b"); __PYX_ERR(0, 240, __pyx_L1_error) }
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_fuse_2__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_v_a, __pyx_v_b, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_2shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_b, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_45__pyx_fuse_3shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_9shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static Py_ssize_t __pyx_fuse_3__pyx_f_5allel_3opt_5stats_shared_prefix_length(__Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_b, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_r;
      __Pyx_TraceDeclarations
      __Pyx_TraceCall("__pyx_fuse_3shared_prefix_length", __pyx_f[0], 240, 1, __PYX_ERR(0, 240, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_WriteUnraisable("allel.opt.stats.shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_TraceReturn(Py_None, 1);
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_45__pyx_fuse_3shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_45__pyx_fuse_3shared_prefix_length = {"__pyx_fuse_3shared_prefix_length", (PyCFunction)__pyx_pw_5allel_3opt_5stats_45__pyx_fuse_3shared_prefix_length, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_8shared_prefix_length};
    static PyObject *__pyx_pw_5allel_3opt_5stats_45__pyx_fuse_3shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_b = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_3shared_prefix_length (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_3shared_prefix_length", 1, 2, 2, 1); __PYX_ERR(0, 240, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_3shared_prefix_length") < 0)) __PYX_ERR(0, 240, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_a.memview)) __PYX_ERR(0, 240, __pyx_L3_error)
        __pyx_v_b = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_b.memview)) __PYX_ERR(0, 241, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_3shared_prefix_length", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 240, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_3shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_44__pyx_fuse_3shared_prefix_length(__pyx_self, __pyx_v_a, __pyx_v_b);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_44__pyx_fuse_3shared_prefix_length(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_b) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_3shared_prefix_length", 0);
      __Pyx_TraceCall("__pyx_fuse_3shared_prefix_length (wrapper)", __pyx_f[0], 240, 0, __PYX_ERR(0, 240, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); __PYX_ERR(0, 240, __pyx_L1_error) }
      if (unlikely(!__pyx_v_b.memview)) { __Pyx_RaiseUnboundLocalError("b"); __PYX_ERR(0, 240, __pyx_L1_error) }
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_fuse_3__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_v_a, __pyx_v_b, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_3shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_b, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_47__pyx_fuse_4shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_9shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static Py_ssize_t __pyx_fuse_4__pyx_f_5allel_3opt_5stats_shared_prefix_length(__Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_b, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_r;
      __Pyx_TraceDeclarations
      __Pyx_TraceCall("__pyx_fuse_4shared_prefix_length", __pyx_f[0], 240, 1, __PYX_ERR(0, 240, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_WriteUnraisable("allel.opt.stats.shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_TraceReturn(Py_None, 1);
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_47__pyx_fuse_4shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_47__pyx_fuse_4shared_prefix_length = {"__pyx_fuse_4shared_prefix_length", (PyCFunction)__pyx_pw_5allel_3opt_5stats_47__pyx_fuse_4shared_prefix_length, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_8shared_prefix_length};
    static PyObject *__pyx_pw_5allel_3opt_5stats_47__pyx_fuse_4shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_b = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_4shared_prefix_length (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_4shared_prefix_length", 1, 2, 2, 1); __PYX_ERR(0, 240, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_4shared_prefix_length") < 0)) __PYX_ERR(0, 240, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_a.memview)) __PYX_ERR(0, 240, __pyx_L3_error)
        __pyx_v_b = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(values[1]); if (unlikely(!__pyx_v_b.memview)) __PYX_ERR(0, 241, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_4shared_prefix_length", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 240, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_4shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_46__pyx_fuse_4shared_prefix_length(__pyx_self, __pyx_v_a, __pyx_v_b);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_46__pyx_fuse_4shared_prefix_length(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_b) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_4shared_prefix_length", 0);
      __Pyx_TraceCall("__pyx_fuse_4shared_prefix_length (wrapper)", __pyx_f[0], 240, 0, __PYX_ERR(0, 240, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); __PYX_ERR(0, 240, __pyx_L1_error) }
      if (unlikely(!__pyx_v_b.memview)) { __Pyx_RaiseUnboundLocalError("b"); __PYX_ERR(0, 240, __pyx_L1_error) }
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_fuse_4__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_v_a, __pyx_v_b, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_4shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_b, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_49__pyx_fuse_5shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_9shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static Py_ssize_t __pyx_fuse_5__pyx_f_5allel_3opt_5stats_shared_prefix_length(__Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_b, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_r;
      __Pyx_TraceDeclarations
      __Pyx_TraceCall("__pyx_fuse_5shared_prefix_length", __pyx_f[0], 240, 1, __PYX_ERR(0, 240, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_WriteUnraisable("allel.opt.stats.shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_TraceReturn(Py_None, 1);
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_49__pyx_fuse_5shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_49__pyx_fuse_5shared_prefix_length = {"__pyx_fuse_5shared_prefix_length", (PyCFunction)__pyx_pw_5allel_3opt_5stats_49__pyx_fuse_5shared_prefix_length, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_8shared_prefix_length};
    static PyObject *__pyx_pw_5allel_3opt_5stats_49__pyx_fuse_5shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_b = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_5shared_prefix_length (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_5shared_prefix_length", 1, 2, 2, 1); __PYX_ERR(0, 240, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_5shared_prefix_length") < 0)) __PYX_ERR(0, 240, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(values[0]); if (unlikely(!__pyx_v_a.memview)) __PYX_ERR(0, 240, __pyx_L3_error)
        __pyx_v_b = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(values[1]); if (unlikely(!__pyx_v_b.memview)) __PYX_ERR(0, 241, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_5shared_prefix_length", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 240, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_5shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_48__pyx_fuse_5shared_prefix_length(__pyx_self, __pyx_v_a, __pyx_v_b);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_48__pyx_fuse_5shared_prefix_length(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_b) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_5shared_prefix_length", 0);
      __Pyx_TraceCall("__pyx_fuse_5shared_prefix_length (wrapper)", __pyx_f[0], 240, 0, __PYX_ERR(0, 240, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); __PYX_ERR(0, 240, __pyx_L1_error) }
      if (unlikely(!__pyx_v_b.memview)) { __Pyx_RaiseUnboundLocalError("b"); __PYX_ERR(0, 240, __pyx_L1_error) }
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_fuse_5__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_v_a, __pyx_v_b, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_5shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_b, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_51__pyx_fuse_6shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_9shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static Py_ssize_t __pyx_fuse_6__pyx_f_5allel_3opt_5stats_shared_prefix_length(__Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_b, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_r;
      __Pyx_TraceDeclarations
      __Pyx_TraceCall("__pyx_fuse_6shared_prefix_length", __pyx_f[0], 240, 1, __PYX_ERR(0, 240, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_WriteUnraisable("allel.opt.stats.shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_TraceReturn(Py_None, 1);
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_51__pyx_fuse_6shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_51__pyx_fuse_6shared_prefix_length = {"__pyx_fuse_6shared_prefix_length", (PyCFunction)__pyx_pw_5allel_3opt_5stats_51__pyx_fuse_6shared_prefix_length, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_8shared_prefix_length};
    static PyObject *__pyx_pw_5allel_3opt_5stats_51__pyx_fuse_6shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_b = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_6shared_prefix_length (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_6shared_prefix_length", 1, 2, 2, 1); __PYX_ERR(0, 240, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_6shared_prefix_length") < 0)) __PYX_ERR(0, 240, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[0]); if (unlikely(!__pyx_v_a.memview)) __PYX_ERR(0, 240, __pyx_L3_error)
        __pyx_v_b = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[1]); if (unlikely(!__pyx_v_b.memview)) __PYX_ERR(0, 241, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_6shared_prefix_length", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 240, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_6shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_50__pyx_fuse_6shared_prefix_length(__pyx_self, __pyx_v_a, __pyx_v_b);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_50__pyx_fuse_6shared_prefix_length(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_b) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_6shared_prefix_length", 0);
      __Pyx_TraceCall("__pyx_fuse_6shared_prefix_length (wrapper)", __pyx_f[0], 240, 0, __PYX_ERR(0, 240, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); __PYX_ERR(0, 240, __pyx_L1_error) }
      if (unlikely(!__pyx_v_b.memview)) { __Pyx_RaiseUnboundLocalError("b"); __PYX_ERR(0, 240, __pyx_L1_error) }
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_fuse_6__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_v_a, __pyx_v_b, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_6shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_b, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_53__pyx_fuse_7shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_9shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static Py_ssize_t __pyx_fuse_7__pyx_f_5allel_3opt_5stats_shared_prefix_length(__Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_b, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_r;
      __Pyx_TraceDeclarations
      __Pyx_TraceCall("__pyx_fuse_7shared_prefix_length", __pyx_f[0], 240, 1, __PYX_ERR(0, 240, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_WriteUnraisable("allel.opt.stats.shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_TraceReturn(Py_None, 1);
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_53__pyx_fuse_7shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_53__pyx_fuse_7shared_prefix_length = {"__pyx_fuse_7shared_prefix_length", (PyCFunction)__pyx_pw_5allel_3opt_5stats_53__pyx_fuse_7shared_prefix_length, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_8shared_prefix_length};
    static PyObject *__pyx_pw_5allel_3opt_5stats_53__pyx_fuse_7shared_prefix_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_b = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_7shared_prefix_length (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_7shared_prefix_length", 1, 2, 2, 1); __PYX_ERR(0, 240, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_7shared_prefix_length") < 0)) __PYX_ERR(0, 240, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(values[0]); if (unlikely(!__pyx_v_a.memview)) __PYX_ERR(0, 240, __pyx_L3_error)
        __pyx_v_b = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(values[1]); if (unlikely(!__pyx_v_b.memview)) __PYX_ERR(0, 241, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_7shared_prefix_length", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 240, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_7shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_52__pyx_fuse_7shared_prefix_length(__pyx_self, __pyx_v_a, __pyx_v_b);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_52__pyx_fuse_7shared_prefix_length(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_b) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_7shared_prefix_length", 0);
      __Pyx_TraceCall("__pyx_fuse_7shared_prefix_length (wrapper)", __pyx_f[0], 240, 0, __PYX_ERR(0, 240, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_a.memview)) { __Pyx_RaiseUnboundLocalError("a"); __PYX_ERR(0, 240, __pyx_L1_error) }
      if (unlikely(!__pyx_v_b.memview)) { __Pyx_RaiseUnboundLocalError("b"); __PYX_ERR(0, 240, __pyx_L1_error) }
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_fuse_7__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_v_a, __pyx_v_b, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_7shared_prefix_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_a, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_b, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
      __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__11);
      __Pyx_GIVEREF(__pyx_tuple__11);
    /* … */
      __pyx_tuple__109 = PyTuple_Pack(2, __pyx_n_s_a, __pyx_n_s_b); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__109);
      __Pyx_GIVEREF(__pyx_tuple__109);
    /* … */
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_39__pyx_fuse_0shared_prefix_length, 0, __pyx_n_s_pyx_fuse_0shared_prefix_length, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int8_t, __pyx_t_2) < 0) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_41__pyx_fuse_1shared_prefix_length, 0, __pyx_n_s_pyx_fuse_1shared_prefix_length, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int16_t, __pyx_t_2) < 0) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_43__pyx_fuse_2shared_prefix_length, 0, __pyx_n_s_pyx_fuse_2shared_prefix_length, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_45__pyx_fuse_3shared_prefix_length, 0, __pyx_n_s_pyx_fuse_3shared_prefix_length, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_47__pyx_fuse_4shared_prefix_length, 0, __pyx_n_s_pyx_fuse_4shared_prefix_length, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint8_t, __pyx_t_2) < 0) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_49__pyx_fuse_5shared_prefix_length, 0, __pyx_n_s_pyx_fuse_5shared_prefix_length, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint16_t, __pyx_t_2) < 0) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_51__pyx_fuse_6shared_prefix_length, 0, __pyx_n_s_pyx_fuse_6shared_prefix_length, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint32_t, __pyx_t_2) < 0) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_53__pyx_fuse_7shared_prefix_length, 0, __pyx_n_s_pyx_fuse_7shared_prefix_length, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_uint64_t, __pyx_t_2) < 0) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_mdef_5allel_3opt_5stats_9shared_prefix_length, 0, __pyx_n_s_shared_prefix_length, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
      ((__pyx_FusedFunctionObject *) __pyx_t_2)->__signatures__ = __pyx_t_1;
      __Pyx_GIVEREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_shared_prefix_length, __pyx_t_2) < 0) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aliman_src_github_cggh_sci, __pyx_n_s_pyx_fuse_0shared_prefix_length, 240, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(0, 240, __pyx_L1_error)

     0241:                                       integer[:] b) nogil:

     0242:     """Compute the length of the shared prefix between two arrays."""

     0243:

     0244:     cdef:

     0245:         Py_ssize_t i, n

     0246:

     0247:     # count up to the length of the shortest array

    +0248:     n = min(a.shape[0], b.shape[0])

      __pyx_t_1 = (__pyx_v_b.shape[0]);
      __pyx_t_2 = (__pyx_v_a.shape[0]);
      if (((__pyx_t_1 < __pyx_t_2) != 0)) {
        __pyx_t_3 = __pyx_t_1;
      } else {
        __pyx_t_3 = __pyx_t_2;
      }
      __pyx_v_n = __pyx_t_3;
    /* … */
      __pyx_t_1 = (__pyx_v_b.shape[0]);
      __pyx_t_2 = (__pyx_v_a.shape[0]);
      if (((__pyx_t_1 < __pyx_t_2) != 0)) {
        __pyx_t_3 = __pyx_t_1;
      } else {
        __pyx_t_3 = __pyx_t_2;
      }
      __pyx_v_n = __pyx_t_3;
    /* … */
      __pyx_t_1 = (__pyx_v_b.shape[0]);
      __pyx_t_2 = (__pyx_v_a.shape[0]);
      if (((__pyx_t_1 < __pyx_t_2) != 0)) {
        __pyx_t_3 = __pyx_t_1;
      } else {
        __pyx_t_3 = __pyx_t_2;
      }
      __pyx_v_n = __pyx_t_3;
    /* … */
      __pyx_t_1 = (__pyx_v_b.shape[0]);
      __pyx_t_2 = (__pyx_v_a.shape[0]);
      if (((__pyx_t_1 < __pyx_t_2) != 0)) {
        __pyx_t_3 = __pyx_t_1;
      } else {
        __pyx_t_3 = __pyx_t_2;
      }
      __pyx_v_n = __pyx_t_3;
    /* … */
      __pyx_t_1 = (__pyx_v_b.shape[0]);
      __pyx_t_2 = (__pyx_v_a.shape[0]);
      if (((__pyx_t_1 < __pyx_t_2) != 0)) {
        __pyx_t_3 = __pyx_t_1;
      } else {
        __pyx_t_3 = __pyx_t_2;
      }
      __pyx_v_n = __pyx_t_3;
    /* … */
      __pyx_t_1 = (__pyx_v_b.shape[0]);
      __pyx_t_2 = (__pyx_v_a.shape[0]);
      if (((__pyx_t_1 < __pyx_t_2) != 0)) {
        __pyx_t_3 = __pyx_t_1;
      } else {
        __pyx_t_3 = __pyx_t_2;
      }
      __pyx_v_n = __pyx_t_3;
    /* … */
      __pyx_t_1 = (__pyx_v_b.shape[0]);
      __pyx_t_2 = (__pyx_v_a.shape[0]);
      if (((__pyx_t_1 < __pyx_t_2) != 0)) {
        __pyx_t_3 = __pyx_t_1;
      } else {
        __pyx_t_3 = __pyx_t_2;
      }
      __pyx_v_n = __pyx_t_3;
    /* … */
      __pyx_t_1 = (__pyx_v_b.shape[0]);
      __pyx_t_2 = (__pyx_v_a.shape[0]);
      if (((__pyx_t_1 < __pyx_t_2) != 0)) {
        __pyx_t_3 = __pyx_t_1;
      } else {
        __pyx_t_3 = __pyx_t_2;
      }
      __pyx_v_n = __pyx_t_3;

     0249:

     0250:     # iterate until we find a difference

    +0251:     for i in range(n):

      __pyx_t_3 = __pyx_v_n;
      for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
        __pyx_v_i = __pyx_t_1;
    /* … */
      __pyx_t_3 = __pyx_v_n;
      for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
        __pyx_v_i = __pyx_t_1;
    /* … */
      __pyx_t_3 = __pyx_v_n;
      for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
        __pyx_v_i = __pyx_t_1;
    /* … */
      __pyx_t_3 = __pyx_v_n;
      for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
        __pyx_v_i = __pyx_t_1;
    /* … */
      __pyx_t_3 = __pyx_v_n;
      for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
        __pyx_v_i = __pyx_t_1;
    /* … */
      __pyx_t_3 = __pyx_v_n;
      for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
        __pyx_v_i = __pyx_t_1;
    /* … */
      __pyx_t_3 = __pyx_v_n;
      for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
        __pyx_v_i = __pyx_t_1;
    /* … */
      __pyx_t_3 = __pyx_v_n;
      for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
        __pyx_v_i = __pyx_t_1;

    +0252:         if a[i] != b[i]:

        __pyx_t_4 = __pyx_v_i;
        __pyx_t_5 = __pyx_v_i;
        __pyx_t_6 = (((*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_4 * __pyx_v_a.strides[0]) ))) != (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_b.data + __pyx_t_5 * __pyx_v_b.strides[0]) )))) != 0);
        if (__pyx_t_6) {
    /* … */
        }
      }
    /* … */
        __pyx_t_4 = __pyx_v_i;
        __pyx_t_5 = __pyx_v_i;
        __pyx_t_6 = (((*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_4 * __pyx_v_a.strides[0]) ))) != (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_b.data + __pyx_t_5 * __pyx_v_b.strides[0]) )))) != 0);
        if (__pyx_t_6) {
    /* … */
        }
      }
    /* … */
        __pyx_t_4 = __pyx_v_i;
        __pyx_t_5 = __pyx_v_i;
        __pyx_t_6 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_4 * __pyx_v_a.strides[0]) ))) != (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_b.data + __pyx_t_5 * __pyx_v_b.strides[0]) )))) != 0);
        if (__pyx_t_6) {
    /* … */
        }
      }
    /* … */
        __pyx_t_4 = __pyx_v_i;
        __pyx_t_5 = __pyx_v_i;
        __pyx_t_6 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_4 * __pyx_v_a.strides[0]) ))) != (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_b.data + __pyx_t_5 * __pyx_v_b.strides[0]) )))) != 0);
        if (__pyx_t_6) {
    /* … */
        }
      }
    /* … */
        __pyx_t_4 = __pyx_v_i;
        __pyx_t_5 = __pyx_v_i;
        __pyx_t_6 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_4 * __pyx_v_a.strides[0]) ))) != (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_b.data + __pyx_t_5 * __pyx_v_b.strides[0]) )))) != 0);
        if (__pyx_t_6) {
    /* … */
        }
      }
    /* … */
        __pyx_t_4 = __pyx_v_i;
        __pyx_t_5 = __pyx_v_i;
        __pyx_t_6 = (((*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_4 * __pyx_v_a.strides[0]) ))) != (*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_b.data + __pyx_t_5 * __pyx_v_b.strides[0]) )))) != 0);
        if (__pyx_t_6) {
    /* … */
        }
      }
    /* … */
        __pyx_t_4 = __pyx_v_i;
        __pyx_t_5 = __pyx_v_i;
        __pyx_t_6 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_4 * __pyx_v_a.strides[0]) ))) != (*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_b.data + __pyx_t_5 * __pyx_v_b.strides[0]) )))) != 0);
        if (__pyx_t_6) {
    /* … */
        }
      }
    /* … */
        __pyx_t_4 = __pyx_v_i;
        __pyx_t_5 = __pyx_v_i;
        __pyx_t_6 = (((*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_4 * __pyx_v_a.strides[0]) ))) != (*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_b.data + __pyx_t_5 * __pyx_v_b.strides[0]) )))) != 0);
        if (__pyx_t_6) {
    /* … */
        }
      }

    +0253:             return i

          __pyx_r = __pyx_v_i;
          goto __pyx_L0;
    /* … */
          __pyx_r = __pyx_v_i;
          goto __pyx_L0;
    /* … */
          __pyx_r = __pyx_v_i;
          goto __pyx_L0;
    /* … */
          __pyx_r = __pyx_v_i;
          goto __pyx_L0;
    /* … */
          __pyx_r = __pyx_v_i;
          goto __pyx_L0;
    /* … */
          __pyx_r = __pyx_v_i;
          goto __pyx_L0;
    /* … */
          __pyx_r = __pyx_v_i;
          goto __pyx_L0;
    /* … */
          __pyx_r = __pyx_v_i;
          goto __pyx_L0;

     0254:

     0255:     # arrays are equal up to shared length

    +0256:     return n

      __pyx_r = __pyx_v_n;
      goto __pyx_L0;
    /* … */
      __pyx_r = __pyx_v_n;
      goto __pyx_L0;
    /* … */
      __pyx_r = __pyx_v_n;
      goto __pyx_L0;
    /* … */
      __pyx_r = __pyx_v_n;
      goto __pyx_L0;
    /* … */
      __pyx_r = __pyx_v_n;
      goto __pyx_L0;
    /* … */
      __pyx_r = __pyx_v_n;
      goto __pyx_L0;
    /* … */
      __pyx_r = __pyx_v_n;
      goto __pyx_L0;
    /* … */
      __pyx_r = __pyx_v_n;
      goto __pyx_L0;

     0257:

     0258:

     0259: @cython.boundscheck(False)

     0260: @cython.wraparound(False)

    +0261: cpdef pairwise_shared_prefix_lengths(integer[:, :] h):

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_11pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_5allel_3opt_5stats_10pairwise_shared_prefix_lengths[] = "Compute the length of the shared prefix between all pairs of\n    columns in a 2-dimensional array.";
    static PyMethodDef __pyx_mdef_5allel_3opt_5stats_11pairwise_shared_prefix_lengths = {"pairwise_shared_prefix_lengths", (PyCFunction)__pyx_pw_5allel_3opt_5stats_11pairwise_shared_prefix_lengths, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_10pairwise_shared_prefix_lengths};
    static PyObject *__pyx_pw_5allel_3opt_5stats_11pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_signatures = 0;
      PyObject *__pyx_v_args = 0;
      PyObject *__pyx_v_kwargs = 0;
      CYTHON_UNUSED PyObject *__pyx_v_defaults = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0};
        PyObject* values[4] = {0,0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 261, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 261, __pyx_L3_error)
            }
            case  3:
            if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 261, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 261, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        }
        __pyx_v_signatures = values[0];
        __pyx_v_args = values[1];
        __pyx_v_kwargs = values[2];
        __pyx_v_defaults = values[3];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 261, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_10pairwise_shared_prefix_lengths(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_10pairwise_shared_prefix_lengths(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
      PyObject *__pyx_v_dest_sig = NULL;
      PyTypeObject *__pyx_v_ndarray = 0;
      PyObject *__pyx_v_numpy = NULL;
      __Pyx_memviewslice __pyx_v_memslice;
      Py_ssize_t __pyx_v_itemsize;
      int __pyx_v_dtype_signed;
      char __pyx_v_kind;
      int __pyx_v____pyx_int32_t_is_signed;
      int __pyx_v____pyx_uint32_t_is_signed;
      int __pyx_v____pyx_uint64_t_is_signed;
      int __pyx_v____pyx_uint16_t_is_signed;
      int __pyx_v____pyx_int16_t_is_signed;
      int __pyx_v____pyx_uint8_t_is_signed;
      int __pyx_v____pyx_int64_t_is_signed;
      int __pyx_v____pyx_int8_t_is_signed;
      PyObject *__pyx_v_arg = NULL;
      PyObject *__pyx_v_dtype = NULL;
      PyObject *__pyx_v_arg_base = NULL;
      PyObject *__pyx_v_candidates = NULL;
      PyObject *__pyx_v_sig = NULL;
      int __pyx_v_match_found;
      PyObject *__pyx_v_src_type = NULL;
      PyObject *__pyx_v_dst_type = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("pairwise_shared_prefix_lengths", 0);
      __Pyx_TraceCall("pairwise_shared_prefix_lengths", __pyx_f[0], 261, 0, __PYX_ERR(0, 261, __pyx_L1_error));
      __Pyx_INCREF(__pyx_v_kwargs);
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
      __pyx_v_dest_sig = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_2 = (__pyx_v_kwargs == Py_None);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {
        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1);
        __pyx_t_1 = 0;
      }
      {
        /*try:*/ {
          __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_v_numpy = __pyx_t_1;
          __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 261, __pyx_L4_error)
          __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1);
          __pyx_t_1 = 0;
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L11_try_end;
        __pyx_L4_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
        if (__pyx_t_7) {
          __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 261, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_INCREF(Py_None);
          __Pyx_XDECREF_SET(__pyx_v_ndarray, ((PyTypeObject*)Py_None));
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L5_exception_handled;
        }
        goto __pyx_L6_except_error;
        __pyx_L6_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L1_error;
        __pyx_L5_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        __pyx_L11_try_end:;
      }
      __pyx_v_itemsize = -1L;
      __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1L) < 0);
      __pyx_v____pyx_uint32_t_is_signed = (((__pyx_t_5numpy_uint32_t)-1L) < 0);
      __pyx_v____pyx_uint64_t_is_signed = (((__pyx_t_5numpy_uint64_t)-1L) < 0);
      __pyx_v____pyx_uint16_t_is_signed = (((__pyx_t_5numpy_uint16_t)-1L) < 0);
      __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1L) < 0);
      __pyx_v____pyx_uint8_t_is_signed = (((__pyx_t_5numpy_uint8_t)-1L) < 0);
      __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1L) < 0);
      __pyx_v____pyx_int8_t_is_signed = (((__pyx_t_5numpy_int8_t)-1L) < 0);
      if (unlikely(__pyx_v_args == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 261, __pyx_L1_error)
      }
      __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 261, __pyx_L1_error)
      __pyx_t_3 = ((0 < __pyx_t_10) != 0);
      if (__pyx_t_3) {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 261, __pyx_L1_error)
        }
        __pyx_t_9 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      if (unlikely(__pyx_v_kwargs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 261, __pyx_L1_error)
      }
      __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_h, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {
        if (unlikely(__pyx_v_kwargs == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 261, __pyx_L1_error)
        }
        __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_h); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      /*else*/ {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(0, 261, __pyx_L1_error)
        }
        __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 261, __pyx_L1_error)
        __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 261, __pyx_L1_error)
      }
      __pyx_L14:;
      while (1) {
        __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None));
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {
          __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_dtype = __pyx_t_8;
            __pyx_t_8 = 0;
            goto __pyx_L18;
          }
          __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_arg_base = __pyx_t_8;
            __pyx_t_8 = 0;
            __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
            __pyx_t_2 = (__pyx_t_3 != 0);
            if (__pyx_t_2) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_v_dtype = __pyx_t_8;
              __pyx_t_8 = 0;
              goto __pyx_L19;
            }
            /*else*/ {
              __Pyx_INCREF(Py_None);
              __pyx_v_dtype = Py_None;
            }
            __pyx_L19:;
            goto __pyx_L18;
          }
          /*else*/ {
            __Pyx_INCREF(Py_None);
            __pyx_v_dtype = Py_None;
          }
          __pyx_L18:;
          __pyx_v_itemsize = -1L;
          __pyx_t_2 = (__pyx_v_dtype != Py_None);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_itemsize = __pyx_t_10;
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 261, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_kind = __pyx_t_11;
            __pyx_v_dtype_signed = (__pyx_v_kind == 'i');
            switch (__pyx_v_kind) {
              case 'i':
              case 'u':
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L22_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L26_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L30_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L34_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L38_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L42_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L46_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L50_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              break;
              case 'f':
              break;
              case 'c':
              break;
              case 'O':
              break;
              default: break;
            }
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L54_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L54_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L58_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L58_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L62_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L62_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L66_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L66_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L70_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L70_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L74_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L74_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L78_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L78_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L82_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L82_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
        goto __pyx_L16_break;
      }
      __pyx_L16_break:;
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_candidates = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_10 = 0;
      if (unlikely(__pyx_v_signatures == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 261, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8);
      __pyx_t_8 = __pyx_t_9;
      __pyx_t_9 = 0;
      while (1) {
        __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_13, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7);
        if (unlikely(__pyx_t_14 == 0)) break;
        if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_v_match_found = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /* … */
      __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__12);
      __Pyx_GIVEREF(__pyx_tuple__12);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
        __Pyx_INCREF(__pyx_v_dest_sig);
        __Pyx_GIVEREF(__pyx_v_dest_sig);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dest_sig);
        __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
          __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_15 = 0;
          __pyx_t_16 = NULL;
        } else {
          __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 261, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 261, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        for (;;) {
          if (likely(!__pyx_t_16)) {
            if (likely(PyList_CheckExact(__pyx_t_9))) {
              if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            } else {
              if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            }
          } else {
            __pyx_t_1 = __pyx_t_16(__pyx_t_9);
            if (unlikely(!__pyx_t_1)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 261, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_1);
          }
          if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
            PyObject* sequence = __pyx_t_1;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 261, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1);
            } else {
              __pyx_t_17 = PyList_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyList_GET_ITEM(sequence, 1);
            }
            __Pyx_INCREF(__pyx_t_17);
            __Pyx_INCREF(__pyx_t_18);
            #else
            __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 261, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 261, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_18);
            #endif
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 261, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
            index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_17);
            index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_18);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
            __pyx_t_20 = NULL;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            goto __pyx_L90_unpacking_done;
            __pyx_L89_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __pyx_t_20 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 261, __pyx_L1_error)
            __pyx_L90_unpacking_done:;
          }
          __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17);
          __pyx_t_17 = 0;
          __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18);
          __pyx_t_18 = 0;
          __pyx_t_3 = (__pyx_v_dst_type != Py_None);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (__pyx_t_2) {
              __pyx_v_match_found = 1;
              goto __pyx_L92;
            }
            /*else*/ {
              __pyx_v_match_found = 0;
              goto __pyx_L88_break;
            }
            __pyx_L92:;
          }
        }
        __pyx_L88_break:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_2 = (__pyx_v_match_found != 0);
        if (__pyx_t_2) {
          __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 261, __pyx_L1_error)
        }
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
      __pyx_t_3 = ((!__pyx_t_2) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s__8); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__13);
      __Pyx_GIVEREF(__pyx_tuple__13);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 261, __pyx_L1_error)
      }
      __pyx_t_13 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 261, __pyx_L1_error)
      __pyx_t_3 = ((__pyx_t_13 > 1) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__14);
      __Pyx_GIVEREF(__pyx_tuple__14);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 261, __pyx_L1_error)
      }
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_signatures == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 261, __pyx_L1_error)
        }
        __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        goto __pyx_L0;
      }

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_dest_sig);
      __Pyx_XDECREF(__pyx_v_ndarray);
      __Pyx_XDECREF(__pyx_v_numpy);
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XDECREF(__pyx_v_dtype);
      __Pyx_XDECREF(__pyx_v_arg_base);
      __Pyx_XDECREF(__pyx_v_candidates);
      __Pyx_XDECREF(__pyx_v_sig);
      __Pyx_XDECREF(__pyx_v_src_type);
      __Pyx_XDECREF(__pyx_v_dst_type);
      __Pyx_XDECREF(__pyx_v_kwargs);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_57__pyx_fuse_0pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_11pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_0__pyx_f_5allel_3opt_5stats_pairwise_shared_prefix_lengths(__Pyx_memviewslice __pyx_v_h, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_n_pairs;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_0pairwise_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_0pairwise_shared_prefix_lengths", __pyx_f[0], 261, 0, __PYX_ERR(0, 261, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
      __Pyx_XDECREF(__pyx_t_13);
      __Pyx_AddTraceback("allel.opt.stats.pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_57__pyx_fuse_0pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_57__pyx_fuse_0pairwise_shared_prefix_lengths = {"__pyx_fuse_0pairwise_shared_prefix_lengths", (PyCFunction)__pyx_pw_5allel_3opt_5stats_57__pyx_fuse_0pairwise_shared_prefix_lengths, METH_O, __pyx_doc_5allel_3opt_5stats_10pairwise_shared_prefix_lengths};
    static PyObject *__pyx_pw_5allel_3opt_5stats_57__pyx_fuse_0pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_0pairwise_shared_prefix_lengths (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 261, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_0pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_56__pyx_fuse_0pairwise_shared_prefix_lengths(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_56__pyx_fuse_0pairwise_shared_prefix_lengths(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_0pairwise_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_0pairwise_shared_prefix_lengths (wrapper)", __pyx_f[0], 261, 0, __PYX_ERR(0, 261, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 261, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_0__pyx_f_5allel_3opt_5stats_pairwise_shared_prefix_lengths(__pyx_v_h, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_0pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_59__pyx_fuse_1pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_11pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_1__pyx_f_5allel_3opt_5stats_pairwise_shared_prefix_lengths(__Pyx_memviewslice __pyx_v_h, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_n_pairs;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_1pairwise_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_1pairwise_shared_prefix_lengths", __pyx_f[0], 261, 0, __PYX_ERR(0, 261, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
      __Pyx_XDECREF(__pyx_t_13);
      __Pyx_AddTraceback("allel.opt.stats.pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_59__pyx_fuse_1pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_59__pyx_fuse_1pairwise_shared_prefix_lengths = {"__pyx_fuse_1pairwise_shared_prefix_lengths", (PyCFunction)__pyx_pw_5allel_3opt_5stats_59__pyx_fuse_1pairwise_shared_prefix_lengths, METH_O, __pyx_doc_5allel_3opt_5stats_10pairwise_shared_prefix_lengths};
    static PyObject *__pyx_pw_5allel_3opt_5stats_59__pyx_fuse_1pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_1pairwise_shared_prefix_lengths (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 261, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_1pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_58__pyx_fuse_1pairwise_shared_prefix_lengths(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_58__pyx_fuse_1pairwise_shared_prefix_lengths(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_1pairwise_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_1pairwise_shared_prefix_lengths (wrapper)", __pyx_f[0], 261, 0, __PYX_ERR(0, 261, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 261, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_1__pyx_f_5allel_3opt_5stats_pairwise_shared_prefix_lengths(__pyx_v_h, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_1pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_61__pyx_fuse_2pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_11pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_2__pyx_f_5allel_3opt_5stats_pairwise_shared_prefix_lengths(__Pyx_memviewslice __pyx_v_h, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_n_pairs;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_2pairwise_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_2pairwise_shared_prefix_lengths", __pyx_f[0], 261, 0, __PYX_ERR(0, 261, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __Pyx_XDECREF(__pyx_t_12);
      __Pyx_AddTraceback("allel.opt.stats.pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_61__pyx_fuse_2pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_61__pyx_fuse_2pairwise_shared_prefix_lengths = {"__pyx_fuse_2pairwise_shared_prefix_lengths", (PyCFunction)__pyx_pw_5allel_3opt_5stats_61__pyx_fuse_2pairwise_shared_prefix_lengths, METH_O, __pyx_doc_5allel_3opt_5stats_10pairwise_shared_prefix_lengths};
    static PyObject *__pyx_pw_5allel_3opt_5stats_61__pyx_fuse_2pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_2pairwise_shared_prefix_lengths (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 261, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_2pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_60__pyx_fuse_2pairwise_shared_prefix_lengths(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_60__pyx_fuse_2pairwise_shared_prefix_lengths(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_2pairwise_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_2pairwise_shared_prefix_lengths (wrapper)", __pyx_f[0], 261, 0, __PYX_ERR(0, 261, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 261, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_2__pyx_f_5allel_3opt_5stats_pairwise_shared_prefix_lengths(__pyx_v_h, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_2pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_63__pyx_fuse_3pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_11pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_3__pyx_f_5allel_3opt_5stats_pairwise_shared_prefix_lengths(__Pyx_memviewslice __pyx_v_h, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_n_pairs;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_3pairwise_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_3pairwise_shared_prefix_lengths", __pyx_f[0], 261, 0, __PYX_ERR(0, 261, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
      __Pyx_XDECREF(__pyx_t_13);
      __Pyx_AddTraceback("allel.opt.stats.pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_63__pyx_fuse_3pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_63__pyx_fuse_3pairwise_shared_prefix_lengths = {"__pyx_fuse_3pairwise_shared_prefix_lengths", (PyCFunction)__pyx_pw_5allel_3opt_5stats_63__pyx_fuse_3pairwise_shared_prefix_lengths, METH_O, __pyx_doc_5allel_3opt_5stats_10pairwise_shared_prefix_lengths};
    static PyObject *__pyx_pw_5allel_3opt_5stats_63__pyx_fuse_3pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_3pairwise_shared_prefix_lengths (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 261, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_3pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_62__pyx_fuse_3pairwise_shared_prefix_lengths(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_62__pyx_fuse_3pairwise_shared_prefix_lengths(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_3pairwise_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_3pairwise_shared_prefix_lengths (wrapper)", __pyx_f[0], 261, 0, __PYX_ERR(0, 261, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 261, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_3__pyx_f_5allel_3opt_5stats_pairwise_shared_prefix_lengths(__pyx_v_h, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_3pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_65__pyx_fuse_4pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_11pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_4__pyx_f_5allel_3opt_5stats_pairwise_shared_prefix_lengths(__Pyx_memviewslice __pyx_v_h, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_n_pairs;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_4pairwise_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_4pairwise_shared_prefix_lengths", __pyx_f[0], 261, 0, __PYX_ERR(0, 261, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
      __Pyx_XDECREF(__pyx_t_13);
      __Pyx_AddTraceback("allel.opt.stats.pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_65__pyx_fuse_4pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_65__pyx_fuse_4pairwise_shared_prefix_lengths = {"__pyx_fuse_4pairwise_shared_prefix_lengths", (PyCFunction)__pyx_pw_5allel_3opt_5stats_65__pyx_fuse_4pairwise_shared_prefix_lengths, METH_O, __pyx_doc_5allel_3opt_5stats_10pairwise_shared_prefix_lengths};
    static PyObject *__pyx_pw_5allel_3opt_5stats_65__pyx_fuse_4pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_4pairwise_shared_prefix_lengths (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 261, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_4pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_64__pyx_fuse_4pairwise_shared_prefix_lengths(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_64__pyx_fuse_4pairwise_shared_prefix_lengths(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_4pairwise_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_4pairwise_shared_prefix_lengths (wrapper)", __pyx_f[0], 261, 0, __PYX_ERR(0, 261, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 261, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_4__pyx_f_5allel_3opt_5stats_pairwise_shared_prefix_lengths(__pyx_v_h, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_4pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_67__pyx_fuse_5pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_11pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_5__pyx_f_5allel_3opt_5stats_pairwise_shared_prefix_lengths(__Pyx_memviewslice __pyx_v_h, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_n_pairs;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_5pairwise_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_5pairwise_shared_prefix_lengths", __pyx_f[0], 261, 0, __PYX_ERR(0, 261, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
      __Pyx_XDECREF(__pyx_t_13);
      __Pyx_AddTraceback("allel.opt.stats.pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_67__pyx_fuse_5pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_67__pyx_fuse_5pairwise_shared_prefix_lengths = {"__pyx_fuse_5pairwise_shared_prefix_lengths", (PyCFunction)__pyx_pw_5allel_3opt_5stats_67__pyx_fuse_5pairwise_shared_prefix_lengths, METH_O, __pyx_doc_5allel_3opt_5stats_10pairwise_shared_prefix_lengths};
    static PyObject *__pyx_pw_5allel_3opt_5stats_67__pyx_fuse_5pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_5pairwise_shared_prefix_lengths (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint16_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 261, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_5pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_66__pyx_fuse_5pairwise_shared_prefix_lengths(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_66__pyx_fuse_5pairwise_shared_prefix_lengths(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_5pairwise_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_5pairwise_shared_prefix_lengths (wrapper)", __pyx_f[0], 261, 0, __PYX_ERR(0, 261, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 261, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_5__pyx_f_5allel_3opt_5stats_pairwise_shared_prefix_lengths(__pyx_v_h, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_5pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_69__pyx_fuse_6pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_11pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_6__pyx_f_5allel_3opt_5stats_pairwise_shared_prefix_lengths(__Pyx_memviewslice __pyx_v_h, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_n_pairs;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_6pairwise_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_6pairwise_shared_prefix_lengths", __pyx_f[0], 261, 0, __PYX_ERR(0, 261, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
      __Pyx_XDECREF(__pyx_t_13);
      __Pyx_AddTraceback("allel.opt.stats.pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_69__pyx_fuse_6pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_69__pyx_fuse_6pairwise_shared_prefix_lengths = {"__pyx_fuse_6pairwise_shared_prefix_lengths", (PyCFunction)__pyx_pw_5allel_3opt_5stats_69__pyx_fuse_6pairwise_shared_prefix_lengths, METH_O, __pyx_doc_5allel_3opt_5stats_10pairwise_shared_prefix_lengths};
    static PyObject *__pyx_pw_5allel_3opt_5stats_69__pyx_fuse_6pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_6pairwise_shared_prefix_lengths (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 261, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_6pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_68__pyx_fuse_6pairwise_shared_prefix_lengths(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_68__pyx_fuse_6pairwise_shared_prefix_lengths(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_6pairwise_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_6pairwise_shared_prefix_lengths (wrapper)", __pyx_f[0], 261, 0, __PYX_ERR(0, 261, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 261, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_6__pyx_f_5allel_3opt_5stats_pairwise_shared_prefix_lengths(__pyx_v_h, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_6pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_71__pyx_fuse_7pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_11pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_7__pyx_f_5allel_3opt_5stats_pairwise_shared_prefix_lengths(__Pyx_memviewslice __pyx_v_h, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_n_pairs;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_7pairwise_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_7pairwise_shared_prefix_lengths", __pyx_f[0], 261, 0, __PYX_ERR(0, 261, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
      __Pyx_XDECREF(__pyx_t_13);
      __Pyx_AddTraceback("allel.opt.stats.pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_71__pyx_fuse_7pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_71__pyx_fuse_7pairwise_shared_prefix_lengths = {"__pyx_fuse_7pairwise_shared_prefix_lengths", (PyCFunction)__pyx_pw_5allel_3opt_5stats_71__pyx_fuse_7pairwise_shared_prefix_lengths, METH_O, __pyx_doc_5allel_3opt_5stats_10pairwise_shared_prefix_lengths};
    static PyObject *__pyx_pw_5allel_3opt_5stats_71__pyx_fuse_7pairwise_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_7pairwise_shared_prefix_lengths (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint64_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 261, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_7pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_70__pyx_fuse_7pairwise_shared_prefix_lengths(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_70__pyx_fuse_7pairwise_shared_prefix_lengths(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_7pairwise_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_7pairwise_shared_prefix_lengths (wrapper)", __pyx_f[0], 261, 0, __PYX_ERR(0, 261, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 261, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_7__pyx_f_5allel_3opt_5stats_pairwise_shared_prefix_lengths(__pyx_v_h, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_7pairwise_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
      __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__15);
      __Pyx_GIVEREF(__pyx_tuple__15);
    /* … */
      __pyx_tuple__111 = PyTuple_Pack(2, __pyx_n_s_h, __pyx_n_s_h); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__111);
      __Pyx_GIVEREF(__pyx_tuple__111);
    /* … */
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_57__pyx_fuse_0pairwise_shared_prefix_lengths, 0, __pyx_n_s_pyx_fuse_0pairwise_shared_pref, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_int8_t, __pyx_t_6) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_59__pyx_fuse_1pairwise_shared_prefix_lengths, 0, __pyx_n_s_pyx_fuse_1pairwise_shared_pref, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_int16_t, __pyx_t_6) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_61__pyx_fuse_2pairwise_shared_prefix_lengths, 0, __pyx_n_s_pyx_fuse_2pairwise_shared_pref, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_int32_t, __pyx_t_6) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_63__pyx_fuse_3pairwise_shared_prefix_lengths, 0, __pyx_n_s_pyx_fuse_3pairwise_shared_pref, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_int64_t, __pyx_t_6) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_65__pyx_fuse_4pairwise_shared_prefix_lengths, 0, __pyx_n_s_pyx_fuse_4pairwise_shared_pref, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_uint8_t, __pyx_t_6) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_67__pyx_fuse_5pairwise_shared_prefix_lengths, 0, __pyx_n_s_pyx_fuse_5pairwise_shared_pref, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_uint16_t, __pyx_t_6) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_69__pyx_fuse_6pairwise_shared_prefix_lengths, 0, __pyx_n_s_pyx_fuse_6pairwise_shared_pref, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_uint32_t, __pyx_t_6) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_71__pyx_fuse_7pairwise_shared_prefix_lengths, 0, __pyx_n_s_pyx_fuse_7pairwise_shared_pref, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_uint64_t, __pyx_t_6) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __pyx_FusedFunction_NewEx(&__pyx_mdef_5allel_3opt_5stats_11pairwise_shared_prefix_lengths, 0, __pyx_n_s_pairwise_shared_prefix_lengths, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_empty_tuple);
      ((__pyx_FusedFunctionObject *) __pyx_t_6)->__signatures__ = __pyx_t_5;
      __Pyx_GIVEREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_pairwise_shared_prefix_lengths, __pyx_t_6) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aliman_src_github_cggh_sci, __pyx_n_s_pyx_fuse_0pairwise_shared_pref, 261, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 261, __pyx_L1_error)

     0262:     """Compute the length of the shared prefix between all pairs of

     0263:     columns in a 2-dimensional array."""

     0264:

     0265:     cdef:

     0266:         Py_ssize_t i, j, k, n, n_pairs

     0267:         cnp.int32_t[:] lengths

     0268:

     0269:     # initialise variables

    +0270:     n = h.shape[1]

      __pyx_v_n = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n = (__pyx_v_h.shape[1]);

    +0271:     n_pairs = (n * (n - 1)) // 2

      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n * (__pyx_v_n - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n * (__pyx_v_n - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n * (__pyx_v_n - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n * (__pyx_v_n - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n * (__pyx_v_n - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n * (__pyx_v_n - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n * (__pyx_v_n - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n * (__pyx_v_n - 1)), 2);

    +0272:     lengths = np.empty(n_pairs, dtype='i4')

      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

    +0273:     k = 0

      __pyx_v_k = 0;
    /* … */
      __pyx_v_k = 0;
    /* … */
      __pyx_v_k = 0;
    /* … */
      __pyx_v_k = 0;
    /* … */
      __pyx_v_k = 0;
    /* … */
      __pyx_v_k = 0;
    /* … */
      __pyx_v_k = 0;
    /* … */
      __pyx_v_k = 0;

     0274:

     0275:     # iterate over pairs

    +0276:     with nogil:

      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }

    +0277:         for i in range(n):

            __pyx_t_6 = __pyx_v_n;
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;
    /* … */
            __pyx_t_6 = __pyx_v_n;
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;
    /* … */
            __pyx_t_6 = __pyx_v_n;
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;
    /* … */
            __pyx_t_6 = __pyx_v_n;
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;
    /* … */
            __pyx_t_6 = __pyx_v_n;
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;
    /* … */
            __pyx_t_6 = __pyx_v_n;
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;
    /* … */
            __pyx_t_6 = __pyx_v_n;
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;
    /* … */
            __pyx_t_6 = __pyx_v_n;
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;

    +0278:             for j in range(i+1, n):

              __pyx_t_8 = __pyx_v_n;
              for (__pyx_t_9 = (__pyx_v_i + 1); __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
                __pyx_v_j = __pyx_t_9;
    /* … */
              __pyx_t_8 = __pyx_v_n;
              for (__pyx_t_9 = (__pyx_v_i + 1); __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
                __pyx_v_j = __pyx_t_9;
    /* … */
              __pyx_t_8 = __pyx_v_n;
              for (__pyx_t_9 = (__pyx_v_i + 1); __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
                __pyx_v_j = __pyx_t_9;
    /* … */
              __pyx_t_8 = __pyx_v_n;
              for (__pyx_t_9 = (__pyx_v_i + 1); __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
                __pyx_v_j = __pyx_t_9;
    /* … */
              __pyx_t_8 = __pyx_v_n;
              for (__pyx_t_9 = (__pyx_v_i + 1); __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
                __pyx_v_j = __pyx_t_9;
    /* … */
              __pyx_t_8 = __pyx_v_n;
              for (__pyx_t_9 = (__pyx_v_i + 1); __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
                __pyx_v_j = __pyx_t_9;
    /* … */
              __pyx_t_8 = __pyx_v_n;
              for (__pyx_t_9 = (__pyx_v_i + 1); __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
                __pyx_v_j = __pyx_t_9;
    /* … */
              __pyx_t_8 = __pyx_v_n;
              for (__pyx_t_9 = (__pyx_v_i + 1); __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
                __pyx_v_j = __pyx_t_9;

    +0279:                 lengths[k] = shared_prefix_length(h[:, i], h[:, j])

                __pyx_t_10.data = __pyx_v_h.data;
                __pyx_t_10.memview = __pyx_v_h.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
                __pyx_t_10.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_10.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_10.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 279, __pyx_L4_error)
        }
            __pyx_t_10.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_11.data = __pyx_v_h.data;
                __pyx_t_11.memview = __pyx_v_h.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_11, 0);
                __pyx_t_11.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_11.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_11.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_j;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 279, __pyx_L4_error)
        }
            __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_12 = __pyx_v_k;
                *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_12 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_0__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_10, __pyx_t_11, 0);
                __PYX_XDEC_MEMVIEW(&__pyx_t_10, 0);
                __pyx_t_10.memview = NULL;
                __pyx_t_10.data = NULL;
                __PYX_XDEC_MEMVIEW(&__pyx_t_11, 0);
                __pyx_t_11.memview = NULL;
                __pyx_t_11.data = NULL;
    /* … */
                __pyx_t_10.data = __pyx_v_h.data;
                __pyx_t_10.memview = __pyx_v_h.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
                __pyx_t_10.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_10.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_10.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 279, __pyx_L4_error)
        }
            __pyx_t_10.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_11.data = __pyx_v_h.data;
                __pyx_t_11.memview = __pyx_v_h.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_11, 0);
                __pyx_t_11.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_11.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_11.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_j;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 279, __pyx_L4_error)
        }
            __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_12 = __pyx_v_k;
                *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_12 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_1__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_10, __pyx_t_11, 0);
                __PYX_XDEC_MEMVIEW(&__pyx_t_10, 0);
                __pyx_t_10.memview = NULL;
                __pyx_t_10.data = NULL;
                __PYX_XDEC_MEMVIEW(&__pyx_t_11, 0);
                __pyx_t_11.memview = NULL;
                __pyx_t_11.data = NULL;
    /* … */
                __pyx_t_5.data = __pyx_v_h.data;
                __pyx_t_5.memview = __pyx_v_h.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_5.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_5.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_5.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 279, __pyx_L4_error)
        }
            __pyx_t_5.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_10.data = __pyx_v_h.data;
                __pyx_t_10.memview = __pyx_v_h.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
                __pyx_t_10.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_10.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_10.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_j;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 279, __pyx_L4_error)
        }
            __pyx_t_10.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_11 = __pyx_v_k;
                *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_11 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_2__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_5, __pyx_t_10, 0);
                __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_5.memview = NULL;
                __pyx_t_5.data = NULL;
                __PYX_XDEC_MEMVIEW(&__pyx_t_10, 0);
                __pyx_t_10.memview = NULL;
                __pyx_t_10.data = NULL;
    /* … */
                __pyx_t_10.data = __pyx_v_h.data;
                __pyx_t_10.memview = __pyx_v_h.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
                __pyx_t_10.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_10.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_10.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 279, __pyx_L4_error)
        }
            __pyx_t_10.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_11.data = __pyx_v_h.data;
                __pyx_t_11.memview = __pyx_v_h.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_11, 0);
                __pyx_t_11.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_11.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_11.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_j;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 279, __pyx_L4_error)
        }
            __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_12 = __pyx_v_k;
                *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_12 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_3__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_10, __pyx_t_11, 0);
                __PYX_XDEC_MEMVIEW(&__pyx_t_10, 0);
                __pyx_t_10.memview = NULL;
                __pyx_t_10.data = NULL;
                __PYX_XDEC_MEMVIEW(&__pyx_t_11, 0);
                __pyx_t_11.memview = NULL;
                __pyx_t_11.data = NULL;
    /* … */
                __pyx_t_10.data = __pyx_v_h.data;
                __pyx_t_10.memview = __pyx_v_h.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
                __pyx_t_10.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_10.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_10.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 279, __pyx_L4_error)
        }
            __pyx_t_10.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_11.data = __pyx_v_h.data;
                __pyx_t_11.memview = __pyx_v_h.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_11, 0);
                __pyx_t_11.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_11.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_11.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_j;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 279, __pyx_L4_error)
        }
            __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_12 = __pyx_v_k;
                *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_12 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_4__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_10, __pyx_t_11, 0);
                __PYX_XDEC_MEMVIEW(&__pyx_t_10, 0);
                __pyx_t_10.memview = NULL;
                __pyx_t_10.data = NULL;
                __PYX_XDEC_MEMVIEW(&__pyx_t_11, 0);
                __pyx_t_11.memview = NULL;
                __pyx_t_11.data = NULL;
    /* … */
                __pyx_t_10.data = __pyx_v_h.data;
                __pyx_t_10.memview = __pyx_v_h.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
                __pyx_t_10.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_10.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_10.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 279, __pyx_L4_error)
        }
            __pyx_t_10.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_11.data = __pyx_v_h.data;
                __pyx_t_11.memview = __pyx_v_h.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_11, 0);
                __pyx_t_11.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_11.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_11.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_j;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 279, __pyx_L4_error)
        }
            __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_12 = __pyx_v_k;
                *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_12 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_5__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_10, __pyx_t_11, 0);
                __PYX_XDEC_MEMVIEW(&__pyx_t_10, 0);
                __pyx_t_10.memview = NULL;
                __pyx_t_10.data = NULL;
                __PYX_XDEC_MEMVIEW(&__pyx_t_11, 0);
                __pyx_t_11.memview = NULL;
                __pyx_t_11.data = NULL;
    /* … */
                __pyx_t_10.data = __pyx_v_h.data;
                __pyx_t_10.memview = __pyx_v_h.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
                __pyx_t_10.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_10.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_10.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 279, __pyx_L4_error)
        }
            __pyx_t_10.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_11.data = __pyx_v_h.data;
                __pyx_t_11.memview = __pyx_v_h.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_11, 0);
                __pyx_t_11.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_11.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_11.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_j;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 279, __pyx_L4_error)
        }
            __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_12 = __pyx_v_k;
                *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_12 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_6__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_10, __pyx_t_11, 0);
                __PYX_XDEC_MEMVIEW(&__pyx_t_10, 0);
                __pyx_t_10.memview = NULL;
                __pyx_t_10.data = NULL;
                __PYX_XDEC_MEMVIEW(&__pyx_t_11, 0);
                __pyx_t_11.memview = NULL;
                __pyx_t_11.data = NULL;
    /* … */
                __pyx_t_10.data = __pyx_v_h.data;
                __pyx_t_10.memview = __pyx_v_h.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
                __pyx_t_10.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_10.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_10.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 279, __pyx_L4_error)
        }
            __pyx_t_10.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_11.data = __pyx_v_h.data;
                __pyx_t_11.memview = __pyx_v_h.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_11, 0);
                __pyx_t_11.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_11.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_11.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_j;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 279, __pyx_L4_error)
        }
            __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_12 = __pyx_v_k;
                *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_12 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_7__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_10, __pyx_t_11, 0);
                __PYX_XDEC_MEMVIEW(&__pyx_t_10, 0);
                __pyx_t_10.memview = NULL;
                __pyx_t_10.data = NULL;
                __PYX_XDEC_MEMVIEW(&__pyx_t_11, 0);
                __pyx_t_11.memview = NULL;
                __pyx_t_11.data = NULL;

    +0280:                 k += 1

                __pyx_v_k = (__pyx_v_k + 1);
              }
            }
          }
    /* … */
                __pyx_v_k = (__pyx_v_k + 1);
              }
            }
          }
    /* … */
                __pyx_v_k = (__pyx_v_k + 1);
              }
            }
          }
    /* … */
                __pyx_v_k = (__pyx_v_k + 1);
              }
            }
          }
    /* … */
                __pyx_v_k = (__pyx_v_k + 1);
              }
            }
          }
    /* … */
                __pyx_v_k = (__pyx_v_k + 1);
              }
            }
          }
    /* … */
                __pyx_v_k = (__pyx_v_k + 1);
              }
            }
          }
    /* … */
                __pyx_v_k = (__pyx_v_k + 1);
              }
            }
          }

     0281:

    +0282:     return np.asarray(lengths)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;

     0283:

     0284:

     0285: @cython.boundscheck(False)

     0286: @cython.wraparound(False)

    +0287: cpdef neighbour_shared_prefix_lengths(integer[:, :] h):

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_13neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_5allel_3opt_5stats_12neighbour_shared_prefix_lengths[] = "Compute the length of the shared prefix between neighbouring\n    columns in a 2-dimensional array.";
    static PyMethodDef __pyx_mdef_5allel_3opt_5stats_13neighbour_shared_prefix_lengths = {"neighbour_shared_prefix_lengths", (PyCFunction)__pyx_pw_5allel_3opt_5stats_13neighbour_shared_prefix_lengths, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_12neighbour_shared_prefix_lengths};
    static PyObject *__pyx_pw_5allel_3opt_5stats_13neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_signatures = 0;
      PyObject *__pyx_v_args = 0;
      PyObject *__pyx_v_kwargs = 0;
      CYTHON_UNUSED PyObject *__pyx_v_defaults = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0};
        PyObject* values[4] = {0,0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 287, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 287, __pyx_L3_error)
            }
            case  3:
            if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 287, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 287, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        }
        __pyx_v_signatures = values[0];
        __pyx_v_args = values[1];
        __pyx_v_kwargs = values[2];
        __pyx_v_defaults = values[3];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 287, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_12neighbour_shared_prefix_lengths(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_12neighbour_shared_prefix_lengths(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
      PyObject *__pyx_v_dest_sig = NULL;
      PyTypeObject *__pyx_v_ndarray = 0;
      PyObject *__pyx_v_numpy = NULL;
      __Pyx_memviewslice __pyx_v_memslice;
      Py_ssize_t __pyx_v_itemsize;
      int __pyx_v_dtype_signed;
      char __pyx_v_kind;
      int __pyx_v____pyx_int32_t_is_signed;
      int __pyx_v____pyx_uint32_t_is_signed;
      int __pyx_v____pyx_uint64_t_is_signed;
      int __pyx_v____pyx_uint16_t_is_signed;
      int __pyx_v____pyx_int16_t_is_signed;
      int __pyx_v____pyx_uint8_t_is_signed;
      int __pyx_v____pyx_int64_t_is_signed;
      int __pyx_v____pyx_int8_t_is_signed;
      PyObject *__pyx_v_arg = NULL;
      PyObject *__pyx_v_dtype = NULL;
      PyObject *__pyx_v_arg_base = NULL;
      PyObject *__pyx_v_candidates = NULL;
      PyObject *__pyx_v_sig = NULL;
      int __pyx_v_match_found;
      PyObject *__pyx_v_src_type = NULL;
      PyObject *__pyx_v_dst_type = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("neighbour_shared_prefix_lengths", 0);
      __Pyx_TraceCall("neighbour_shared_prefix_lengths", __pyx_f[0], 287, 0, __PYX_ERR(0, 287, __pyx_L1_error));
      __Pyx_INCREF(__pyx_v_kwargs);
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
      __pyx_v_dest_sig = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_2 = (__pyx_v_kwargs == Py_None);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {
        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1);
        __pyx_t_1 = 0;
      }
      {
        /*try:*/ {
          __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_v_numpy = __pyx_t_1;
          __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 287, __pyx_L4_error)
          __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1);
          __pyx_t_1 = 0;
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L11_try_end;
        __pyx_L4_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
        if (__pyx_t_7) {
          __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 287, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_INCREF(Py_None);
          __Pyx_XDECREF_SET(__pyx_v_ndarray, ((PyTypeObject*)Py_None));
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L5_exception_handled;
        }
        goto __pyx_L6_except_error;
        __pyx_L6_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L1_error;
        __pyx_L5_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        __pyx_L11_try_end:;
      }
      __pyx_v_itemsize = -1L;
      __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1L) < 0);
      __pyx_v____pyx_uint32_t_is_signed = (((__pyx_t_5numpy_uint32_t)-1L) < 0);
      __pyx_v____pyx_uint64_t_is_signed = (((__pyx_t_5numpy_uint64_t)-1L) < 0);
      __pyx_v____pyx_uint16_t_is_signed = (((__pyx_t_5numpy_uint16_t)-1L) < 0);
      __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1L) < 0);
      __pyx_v____pyx_uint8_t_is_signed = (((__pyx_t_5numpy_uint8_t)-1L) < 0);
      __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1L) < 0);
      __pyx_v____pyx_int8_t_is_signed = (((__pyx_t_5numpy_int8_t)-1L) < 0);
      if (unlikely(__pyx_v_args == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 287, __pyx_L1_error)
      }
      __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 287, __pyx_L1_error)
      __pyx_t_3 = ((0 < __pyx_t_10) != 0);
      if (__pyx_t_3) {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 287, __pyx_L1_error)
        }
        __pyx_t_9 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      if (unlikely(__pyx_v_kwargs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 287, __pyx_L1_error)
      }
      __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_h, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {
        if (unlikely(__pyx_v_kwargs == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 287, __pyx_L1_error)
        }
        __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_h); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      /*else*/ {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(0, 287, __pyx_L1_error)
        }
        __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 287, __pyx_L1_error)
        __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 287, __pyx_L1_error)
      }
      __pyx_L14:;
      while (1) {
        __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None));
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {
          __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_dtype = __pyx_t_8;
            __pyx_t_8 = 0;
            goto __pyx_L18;
          }
          __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_arg_base = __pyx_t_8;
            __pyx_t_8 = 0;
            __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
            __pyx_t_2 = (__pyx_t_3 != 0);
            if (__pyx_t_2) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_v_dtype = __pyx_t_8;
              __pyx_t_8 = 0;
              goto __pyx_L19;
            }
            /*else*/ {
              __Pyx_INCREF(Py_None);
              __pyx_v_dtype = Py_None;
            }
            __pyx_L19:;
            goto __pyx_L18;
          }
          /*else*/ {
            __Pyx_INCREF(Py_None);
            __pyx_v_dtype = Py_None;
          }
          __pyx_L18:;
          __pyx_v_itemsize = -1L;
          __pyx_t_2 = (__pyx_v_dtype != Py_None);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 287, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_itemsize = __pyx_t_10;
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 287, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_kind = __pyx_t_11;
            __pyx_v_dtype_signed = (__pyx_v_kind == 'i');
            switch (__pyx_v_kind) {
              case 'i':
              case 'u':
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 287, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L22_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 287, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L26_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 287, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L30_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 287, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L34_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 287, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L38_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 287, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L42_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 287, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L46_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 287, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L50_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              break;
              case 'f':
              break;
              case 'c':
              break;
              case 'O':
              break;
              default: break;
            }
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L54_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L54_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L58_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L58_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L62_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L62_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L66_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L66_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L70_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L70_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L74_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L74_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L78_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L78_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L82_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L82_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
        goto __pyx_L16_break;
      }
      __pyx_L16_break:;
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_candidates = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_10 = 0;
      if (unlikely(__pyx_v_signatures == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 287, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8);
      __pyx_t_8 = __pyx_t_9;
      __pyx_t_9 = 0;
      while (1) {
        __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_13, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7);
        if (unlikely(__pyx_t_14 == 0)) break;
        if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_v_match_found = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /* … */
      __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__16);
      __Pyx_GIVEREF(__pyx_tuple__16);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
        __Pyx_INCREF(__pyx_v_dest_sig);
        __Pyx_GIVEREF(__pyx_v_dest_sig);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dest_sig);
        __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
          __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_15 = 0;
          __pyx_t_16 = NULL;
        } else {
          __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 287, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 287, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        for (;;) {
          if (likely(!__pyx_t_16)) {
            if (likely(PyList_CheckExact(__pyx_t_9))) {
              if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            } else {
              if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            }
          } else {
            __pyx_t_1 = __pyx_t_16(__pyx_t_9);
            if (unlikely(!__pyx_t_1)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 287, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_1);
          }
          if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
            PyObject* sequence = __pyx_t_1;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 287, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1);
            } else {
              __pyx_t_17 = PyList_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyList_GET_ITEM(sequence, 1);
            }
            __Pyx_INCREF(__pyx_t_17);
            __Pyx_INCREF(__pyx_t_18);
            #else
            __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 287, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 287, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_18);
            #endif
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 287, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
            index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_17);
            index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_18);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
            __pyx_t_20 = NULL;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            goto __pyx_L90_unpacking_done;
            __pyx_L89_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __pyx_t_20 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 287, __pyx_L1_error)
            __pyx_L90_unpacking_done:;
          }
          __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17);
          __pyx_t_17 = 0;
          __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18);
          __pyx_t_18 = 0;
          __pyx_t_3 = (__pyx_v_dst_type != Py_None);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (__pyx_t_2) {
              __pyx_v_match_found = 1;
              goto __pyx_L92;
            }
            /*else*/ {
              __pyx_v_match_found = 0;
              goto __pyx_L88_break;
            }
            __pyx_L92:;
          }
        }
        __pyx_L88_break:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_2 = (__pyx_v_match_found != 0);
        if (__pyx_t_2) {
          __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 287, __pyx_L1_error)
        }
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
      __pyx_t_3 = ((!__pyx_t_2) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s__8); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__17);
      __Pyx_GIVEREF(__pyx_tuple__17);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 287, __pyx_L1_error)
      }
      __pyx_t_13 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 287, __pyx_L1_error)
      __pyx_t_3 = ((__pyx_t_13 > 1) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__18);
      __Pyx_GIVEREF(__pyx_tuple__18);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 287, __pyx_L1_error)
      }
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_signatures == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 287, __pyx_L1_error)
        }
        __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        goto __pyx_L0;
      }

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_dest_sig);
      __Pyx_XDECREF(__pyx_v_ndarray);
      __Pyx_XDECREF(__pyx_v_numpy);
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XDECREF(__pyx_v_dtype);
      __Pyx_XDECREF(__pyx_v_arg_base);
      __Pyx_XDECREF(__pyx_v_candidates);
      __Pyx_XDECREF(__pyx_v_sig);
      __Pyx_XDECREF(__pyx_v_src_type);
      __Pyx_XDECREF(__pyx_v_dst_type);
      __Pyx_XDECREF(__pyx_v_kwargs);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_75__pyx_fuse_0neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_13neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_0__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths(__Pyx_memviewslice __pyx_v_h, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_0neighbour_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_0neighbour_shared_prefix_lengths", __pyx_f[0], 287, 0, __PYX_ERR(0, 287, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_AddTraceback("allel.opt.stats.neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_75__pyx_fuse_0neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_75__pyx_fuse_0neighbour_shared_prefix_lengths = {"__pyx_fuse_0neighbour_shared_prefix_lengths", (PyCFunction)__pyx_pw_5allel_3opt_5stats_75__pyx_fuse_0neighbour_shared_prefix_lengths, METH_O, __pyx_doc_5allel_3opt_5stats_12neighbour_shared_prefix_lengths};
    static PyObject *__pyx_pw_5allel_3opt_5stats_75__pyx_fuse_0neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_0neighbour_shared_prefix_lengths (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 287, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_0neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_74__pyx_fuse_0neighbour_shared_prefix_lengths(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_74__pyx_fuse_0neighbour_shared_prefix_lengths(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_0neighbour_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_0neighbour_shared_prefix_lengths (wrapper)", __pyx_f[0], 287, 0, __PYX_ERR(0, 287, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 287, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_0__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths(__pyx_v_h, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_0neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_77__pyx_fuse_1neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_13neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_1__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths(__Pyx_memviewslice __pyx_v_h, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_1neighbour_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_1neighbour_shared_prefix_lengths", __pyx_f[0], 287, 0, __PYX_ERR(0, 287, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_AddTraceback("allel.opt.stats.neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_77__pyx_fuse_1neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_77__pyx_fuse_1neighbour_shared_prefix_lengths = {"__pyx_fuse_1neighbour_shared_prefix_lengths", (PyCFunction)__pyx_pw_5allel_3opt_5stats_77__pyx_fuse_1neighbour_shared_prefix_lengths, METH_O, __pyx_doc_5allel_3opt_5stats_12neighbour_shared_prefix_lengths};
    static PyObject *__pyx_pw_5allel_3opt_5stats_77__pyx_fuse_1neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_1neighbour_shared_prefix_lengths (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 287, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_1neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_76__pyx_fuse_1neighbour_shared_prefix_lengths(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_76__pyx_fuse_1neighbour_shared_prefix_lengths(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_1neighbour_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_1neighbour_shared_prefix_lengths (wrapper)", __pyx_f[0], 287, 0, __PYX_ERR(0, 287, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 287, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_1__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths(__pyx_v_h, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_1neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_79__pyx_fuse_2neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_13neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_2__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths(__Pyx_memviewslice __pyx_v_h, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_2neighbour_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_2neighbour_shared_prefix_lengths", __pyx_f[0], 287, 0, __PYX_ERR(0, 287, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __Pyx_XDECREF(__pyx_t_10);
      __Pyx_AddTraceback("allel.opt.stats.neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_79__pyx_fuse_2neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_79__pyx_fuse_2neighbour_shared_prefix_lengths = {"__pyx_fuse_2neighbour_shared_prefix_lengths", (PyCFunction)__pyx_pw_5allel_3opt_5stats_79__pyx_fuse_2neighbour_shared_prefix_lengths, METH_O, __pyx_doc_5allel_3opt_5stats_12neighbour_shared_prefix_lengths};
    static PyObject *__pyx_pw_5allel_3opt_5stats_79__pyx_fuse_2neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_2neighbour_shared_prefix_lengths (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 287, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_2neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_78__pyx_fuse_2neighbour_shared_prefix_lengths(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_78__pyx_fuse_2neighbour_shared_prefix_lengths(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_2neighbour_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_2neighbour_shared_prefix_lengths (wrapper)", __pyx_f[0], 287, 0, __PYX_ERR(0, 287, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 287, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_2__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths(__pyx_v_h, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_2neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_81__pyx_fuse_3neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_13neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_3__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths(__Pyx_memviewslice __pyx_v_h, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_3neighbour_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_3neighbour_shared_prefix_lengths", __pyx_f[0], 287, 0, __PYX_ERR(0, 287, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_AddTraceback("allel.opt.stats.neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_81__pyx_fuse_3neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_81__pyx_fuse_3neighbour_shared_prefix_lengths = {"__pyx_fuse_3neighbour_shared_prefix_lengths", (PyCFunction)__pyx_pw_5allel_3opt_5stats_81__pyx_fuse_3neighbour_shared_prefix_lengths, METH_O, __pyx_doc_5allel_3opt_5stats_12neighbour_shared_prefix_lengths};
    static PyObject *__pyx_pw_5allel_3opt_5stats_81__pyx_fuse_3neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_3neighbour_shared_prefix_lengths (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 287, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_3neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_80__pyx_fuse_3neighbour_shared_prefix_lengths(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_80__pyx_fuse_3neighbour_shared_prefix_lengths(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_3neighbour_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_3neighbour_shared_prefix_lengths (wrapper)", __pyx_f[0], 287, 0, __PYX_ERR(0, 287, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 287, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_3__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths(__pyx_v_h, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_3neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_83__pyx_fuse_4neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_13neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_4__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths(__Pyx_memviewslice __pyx_v_h, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_4neighbour_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_4neighbour_shared_prefix_lengths", __pyx_f[0], 287, 0, __PYX_ERR(0, 287, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_AddTraceback("allel.opt.stats.neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_83__pyx_fuse_4neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_83__pyx_fuse_4neighbour_shared_prefix_lengths = {"__pyx_fuse_4neighbour_shared_prefix_lengths", (PyCFunction)__pyx_pw_5allel_3opt_5stats_83__pyx_fuse_4neighbour_shared_prefix_lengths, METH_O, __pyx_doc_5allel_3opt_5stats_12neighbour_shared_prefix_lengths};
    static PyObject *__pyx_pw_5allel_3opt_5stats_83__pyx_fuse_4neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_4neighbour_shared_prefix_lengths (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 287, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_4neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_82__pyx_fuse_4neighbour_shared_prefix_lengths(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_82__pyx_fuse_4neighbour_shared_prefix_lengths(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_4neighbour_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_4neighbour_shared_prefix_lengths (wrapper)", __pyx_f[0], 287, 0, __PYX_ERR(0, 287, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 287, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_4__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths(__pyx_v_h, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_4neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_85__pyx_fuse_5neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_13neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_5__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths(__Pyx_memviewslice __pyx_v_h, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_5neighbour_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_5neighbour_shared_prefix_lengths", __pyx_f[0], 287, 0, __PYX_ERR(0, 287, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_AddTraceback("allel.opt.stats.neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_85__pyx_fuse_5neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_85__pyx_fuse_5neighbour_shared_prefix_lengths = {"__pyx_fuse_5neighbour_shared_prefix_lengths", (PyCFunction)__pyx_pw_5allel_3opt_5stats_85__pyx_fuse_5neighbour_shared_prefix_lengths, METH_O, __pyx_doc_5allel_3opt_5stats_12neighbour_shared_prefix_lengths};
    static PyObject *__pyx_pw_5allel_3opt_5stats_85__pyx_fuse_5neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_5neighbour_shared_prefix_lengths (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint16_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 287, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_5neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_84__pyx_fuse_5neighbour_shared_prefix_lengths(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_84__pyx_fuse_5neighbour_shared_prefix_lengths(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_5neighbour_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_5neighbour_shared_prefix_lengths (wrapper)", __pyx_f[0], 287, 0, __PYX_ERR(0, 287, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 287, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_5__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths(__pyx_v_h, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_5neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_87__pyx_fuse_6neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_13neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_6__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths(__Pyx_memviewslice __pyx_v_h, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_6neighbour_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_6neighbour_shared_prefix_lengths", __pyx_f[0], 287, 0, __PYX_ERR(0, 287, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_AddTraceback("allel.opt.stats.neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_87__pyx_fuse_6neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_87__pyx_fuse_6neighbour_shared_prefix_lengths = {"__pyx_fuse_6neighbour_shared_prefix_lengths", (PyCFunction)__pyx_pw_5allel_3opt_5stats_87__pyx_fuse_6neighbour_shared_prefix_lengths, METH_O, __pyx_doc_5allel_3opt_5stats_12neighbour_shared_prefix_lengths};
    static PyObject *__pyx_pw_5allel_3opt_5stats_87__pyx_fuse_6neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_6neighbour_shared_prefix_lengths (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 287, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_6neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_86__pyx_fuse_6neighbour_shared_prefix_lengths(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_86__pyx_fuse_6neighbour_shared_prefix_lengths(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_6neighbour_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_6neighbour_shared_prefix_lengths (wrapper)", __pyx_f[0], 287, 0, __PYX_ERR(0, 287, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 287, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_6__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths(__pyx_v_h, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_6neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_89__pyx_fuse_7neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_13neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_7__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths(__Pyx_memviewslice __pyx_v_h, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_7neighbour_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_7neighbour_shared_prefix_lengths", __pyx_f[0], 287, 0, __PYX_ERR(0, 287, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_AddTraceback("allel.opt.stats.neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_89__pyx_fuse_7neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_89__pyx_fuse_7neighbour_shared_prefix_lengths = {"__pyx_fuse_7neighbour_shared_prefix_lengths", (PyCFunction)__pyx_pw_5allel_3opt_5stats_89__pyx_fuse_7neighbour_shared_prefix_lengths, METH_O, __pyx_doc_5allel_3opt_5stats_12neighbour_shared_prefix_lengths};
    static PyObject *__pyx_pw_5allel_3opt_5stats_89__pyx_fuse_7neighbour_shared_prefix_lengths(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_7neighbour_shared_prefix_lengths (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint64_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 287, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_7neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_88__pyx_fuse_7neighbour_shared_prefix_lengths(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_88__pyx_fuse_7neighbour_shared_prefix_lengths(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_7neighbour_shared_prefix_lengths", 0);
      __Pyx_TraceCall("__pyx_fuse_7neighbour_shared_prefix_lengths (wrapper)", __pyx_f[0], 287, 0, __PYX_ERR(0, 287, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 287, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_7__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths(__pyx_v_h, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_7neighbour_shared_prefix_lengths", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
      __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__19);
      __Pyx_GIVEREF(__pyx_tuple__19);
    /* … */
      __pyx_tuple__113 = PyTuple_Pack(2, __pyx_n_s_h, __pyx_n_s_h); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__113);
      __Pyx_GIVEREF(__pyx_tuple__113);
    /* … */
      __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_75__pyx_fuse_0neighbour_shared_prefix_lengths, 0, __pyx_n_s_pyx_fuse_0neighbour_shared_pre, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_int8_t, __pyx_t_8) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_77__pyx_fuse_1neighbour_shared_prefix_lengths, 0, __pyx_n_s_pyx_fuse_1neighbour_shared_pre, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_int16_t, __pyx_t_8) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_79__pyx_fuse_2neighbour_shared_prefix_lengths, 0, __pyx_n_s_pyx_fuse_2neighbour_shared_pre, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_int32_t, __pyx_t_8) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_81__pyx_fuse_3neighbour_shared_prefix_lengths, 0, __pyx_n_s_pyx_fuse_3neighbour_shared_pre, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_int64_t, __pyx_t_8) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_83__pyx_fuse_4neighbour_shared_prefix_lengths, 0, __pyx_n_s_pyx_fuse_4neighbour_shared_pre, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_uint8_t, __pyx_t_8) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_85__pyx_fuse_5neighbour_shared_prefix_lengths, 0, __pyx_n_s_pyx_fuse_5neighbour_shared_pre, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_uint16_t, __pyx_t_8) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_87__pyx_fuse_6neighbour_shared_prefix_lengths, 0, __pyx_n_s_pyx_fuse_6neighbour_shared_pre, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_uint32_t, __pyx_t_8) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_89__pyx_fuse_7neighbour_shared_prefix_lengths, 0, __pyx_n_s_pyx_fuse_7neighbour_shared_pre, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_uint64_t, __pyx_t_8) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __pyx_FusedFunction_NewEx(&__pyx_mdef_5allel_3opt_5stats_13neighbour_shared_prefix_lengths, 0, __pyx_n_s_neighbour_shared_prefix_lengths, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_empty_tuple);
      ((__pyx_FusedFunctionObject *) __pyx_t_8)->__signatures__ = __pyx_t_7;
      __Pyx_GIVEREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_neighbour_shared_prefix_lengths, __pyx_t_8) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aliman_src_github_cggh_sci, __pyx_n_s_pyx_fuse_0neighbour_shared_pre, 287, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 287, __pyx_L1_error)

     0288:     """Compute the length of the shared prefix between neighbouring

     0289:     columns in a 2-dimensional array."""

     0290:

     0291:     cdef:

     0292:         Py_ssize_t i, n

     0293:         cnp.int32_t[:] lengths

     0294:

     0295:     # initialise variables

    +0296:     n = h.shape[1]

      __pyx_v_n = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n = (__pyx_v_h.shape[1]);

    +0297:     lengths = np.empty(n-1, dtype='i4')

      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_n - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 297, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_n - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 297, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_n - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 297, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_n - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 297, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_n - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 297, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_n - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 297, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_n - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 297, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_n - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 297, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

     0298:

     0299:     # iterate over columns

    +0300:     with nogil:

      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }

    +0301:         for i in range(n-1):

            __pyx_t_6 = (__pyx_v_n - 1);
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;
    /* … */
            __pyx_t_6 = (__pyx_v_n - 1);
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;
    /* … */
            __pyx_t_6 = (__pyx_v_n - 1);
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;
    /* … */
            __pyx_t_6 = (__pyx_v_n - 1);
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;
    /* … */
            __pyx_t_6 = (__pyx_v_n - 1);
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;
    /* … */
            __pyx_t_6 = (__pyx_v_n - 1);
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;
    /* … */
            __pyx_t_6 = (__pyx_v_n - 1);
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;
    /* … */
            __pyx_t_6 = (__pyx_v_n - 1);
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;

    +0302:             lengths[i] = shared_prefix_length(h[:, i], h[:, i+1])

              __pyx_t_8.data = __pyx_v_h.data;
              __pyx_t_8.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
              __pyx_t_8.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_8.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_8.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 302, __pyx_L4_error)
        }
            __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_9.data = __pyx_v_h.data;
              __pyx_t_9.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_9, 0);
              __pyx_t_9.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_9.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_9.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = (__pyx_v_i + 1);
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 302, __pyx_L4_error)
        }
            __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_10 = __pyx_v_i;
              *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_10 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_0__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_8, __pyx_t_9, 0);
              __PYX_XDEC_MEMVIEW(&__pyx_t_8, 0);
              __pyx_t_8.memview = NULL;
              __pyx_t_8.data = NULL;
              __PYX_XDEC_MEMVIEW(&__pyx_t_9, 0);
              __pyx_t_9.memview = NULL;
              __pyx_t_9.data = NULL;
            }
          }
    /* … */
              __pyx_t_8.data = __pyx_v_h.data;
              __pyx_t_8.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
              __pyx_t_8.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_8.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_8.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 302, __pyx_L4_error)
        }
            __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_9.data = __pyx_v_h.data;
              __pyx_t_9.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_9, 0);
              __pyx_t_9.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_9.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_9.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = (__pyx_v_i + 1);
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 302, __pyx_L4_error)
        }
            __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_10 = __pyx_v_i;
              *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_10 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_1__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_8, __pyx_t_9, 0);
              __PYX_XDEC_MEMVIEW(&__pyx_t_8, 0);
              __pyx_t_8.memview = NULL;
              __pyx_t_8.data = NULL;
              __PYX_XDEC_MEMVIEW(&__pyx_t_9, 0);
              __pyx_t_9.memview = NULL;
              __pyx_t_9.data = NULL;
            }
          }
    /* … */
              __pyx_t_5.data = __pyx_v_h.data;
              __pyx_t_5.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
              __pyx_t_5.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_5.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_5.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 302, __pyx_L4_error)
        }
            __pyx_t_5.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_8.data = __pyx_v_h.data;
              __pyx_t_8.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
              __pyx_t_8.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_8.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_8.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = (__pyx_v_i + 1);
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 302, __pyx_L4_error)
        }
            __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_9 = __pyx_v_i;
              *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_9 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_2__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_5, __pyx_t_8, 0);
              __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);
              __pyx_t_5.memview = NULL;
              __pyx_t_5.data = NULL;
              __PYX_XDEC_MEMVIEW(&__pyx_t_8, 0);
              __pyx_t_8.memview = NULL;
              __pyx_t_8.data = NULL;
            }
          }
    /* … */
              __pyx_t_8.data = __pyx_v_h.data;
              __pyx_t_8.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
              __pyx_t_8.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_8.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_8.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 302, __pyx_L4_error)
        }
            __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_9.data = __pyx_v_h.data;
              __pyx_t_9.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_9, 0);
              __pyx_t_9.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_9.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_9.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = (__pyx_v_i + 1);
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 302, __pyx_L4_error)
        }
            __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_10 = __pyx_v_i;
              *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_10 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_3__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_8, __pyx_t_9, 0);
              __PYX_XDEC_MEMVIEW(&__pyx_t_8, 0);
              __pyx_t_8.memview = NULL;
              __pyx_t_8.data = NULL;
              __PYX_XDEC_MEMVIEW(&__pyx_t_9, 0);
              __pyx_t_9.memview = NULL;
              __pyx_t_9.data = NULL;
            }
          }
    /* … */
              __pyx_t_8.data = __pyx_v_h.data;
              __pyx_t_8.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
              __pyx_t_8.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_8.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_8.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 302, __pyx_L4_error)
        }
            __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_9.data = __pyx_v_h.data;
              __pyx_t_9.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_9, 0);
              __pyx_t_9.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_9.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_9.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = (__pyx_v_i + 1);
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 302, __pyx_L4_error)
        }
            __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_10 = __pyx_v_i;
              *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_10 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_4__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_8, __pyx_t_9, 0);
              __PYX_XDEC_MEMVIEW(&__pyx_t_8, 0);
              __pyx_t_8.memview = NULL;
              __pyx_t_8.data = NULL;
              __PYX_XDEC_MEMVIEW(&__pyx_t_9, 0);
              __pyx_t_9.memview = NULL;
              __pyx_t_9.data = NULL;
            }
          }
    /* … */
              __pyx_t_8.data = __pyx_v_h.data;
              __pyx_t_8.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
              __pyx_t_8.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_8.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_8.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 302, __pyx_L4_error)
        }
            __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_9.data = __pyx_v_h.data;
              __pyx_t_9.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_9, 0);
              __pyx_t_9.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_9.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_9.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = (__pyx_v_i + 1);
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 302, __pyx_L4_error)
        }
            __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_10 = __pyx_v_i;
              *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_10 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_5__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_8, __pyx_t_9, 0);
              __PYX_XDEC_MEMVIEW(&__pyx_t_8, 0);
              __pyx_t_8.memview = NULL;
              __pyx_t_8.data = NULL;
              __PYX_XDEC_MEMVIEW(&__pyx_t_9, 0);
              __pyx_t_9.memview = NULL;
              __pyx_t_9.data = NULL;
            }
          }
    /* … */
              __pyx_t_8.data = __pyx_v_h.data;
              __pyx_t_8.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
              __pyx_t_8.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_8.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_8.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 302, __pyx_L4_error)
        }
            __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_9.data = __pyx_v_h.data;
              __pyx_t_9.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_9, 0);
              __pyx_t_9.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_9.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_9.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = (__pyx_v_i + 1);
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 302, __pyx_L4_error)
        }
            __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_10 = __pyx_v_i;
              *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_10 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_6__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_8, __pyx_t_9, 0);
              __PYX_XDEC_MEMVIEW(&__pyx_t_8, 0);
              __pyx_t_8.memview = NULL;
              __pyx_t_8.data = NULL;
              __PYX_XDEC_MEMVIEW(&__pyx_t_9, 0);
              __pyx_t_9.memview = NULL;
              __pyx_t_9.data = NULL;
            }
          }
    /* … */
              __pyx_t_8.data = __pyx_v_h.data;
              __pyx_t_8.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
              __pyx_t_8.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_8.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_8.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 302, __pyx_L4_error)
        }
            __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_9.data = __pyx_v_h.data;
              __pyx_t_9.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_9, 0);
              __pyx_t_9.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_9.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_9.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = (__pyx_v_i + 1);
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 302, __pyx_L4_error)
        }
            __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_10 = __pyx_v_i;
              *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_10 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_7__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_8, __pyx_t_9, 0);
              __PYX_XDEC_MEMVIEW(&__pyx_t_8, 0);
              __pyx_t_8.memview = NULL;
              __pyx_t_8.data = NULL;
              __PYX_XDEC_MEMVIEW(&__pyx_t_9, 0);
              __pyx_t_9.memview = NULL;
              __pyx_t_9.data = NULL;
            }
          }

     0303:

    +0304:     return np.asarray(lengths)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;

     0305:

     0306:

     0307: @cython.boundscheck(False)

     0308: @cython.wraparound(False)

    +0309: cpdef neighbour_shared_prefix_lengths_unsorted(integer[:, :] h,

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_15neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_5allel_3opt_5stats_14neighbour_shared_prefix_lengths_unsorted[] = "Compute the length of the shared prefix between neighbouring\n    columns in a 2-dimensional array.";
    static PyMethodDef __pyx_mdef_5allel_3opt_5stats_15neighbour_shared_prefix_lengths_unsorted = {"neighbour_shared_prefix_lengths_unsorted", (PyCFunction)__pyx_pw_5allel_3opt_5stats_15neighbour_shared_prefix_lengths_unsorted, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_14neighbour_shared_prefix_lengths_unsorted};
    static PyObject *__pyx_pw_5allel_3opt_5stats_15neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_signatures = 0;
      PyObject *__pyx_v_args = 0;
      PyObject *__pyx_v_kwargs = 0;
      CYTHON_UNUSED PyObject *__pyx_v_defaults = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0};
        PyObject* values[4] = {0,0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 309, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 309, __pyx_L3_error)
            }
            case  3:
            if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 309, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 309, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        }
        __pyx_v_signatures = values[0];
        __pyx_v_args = values[1];
        __pyx_v_kwargs = values[2];
        __pyx_v_defaults = values[3];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 309, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_14neighbour_shared_prefix_lengths_unsorted(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_14neighbour_shared_prefix_lengths_unsorted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
      PyObject *__pyx_v_dest_sig = NULL;
      PyTypeObject *__pyx_v_ndarray = 0;
      PyObject *__pyx_v_numpy = NULL;
      __Pyx_memviewslice __pyx_v_memslice;
      Py_ssize_t __pyx_v_itemsize;
      int __pyx_v_dtype_signed;
      char __pyx_v_kind;
      int __pyx_v____pyx_int32_t_is_signed;
      int __pyx_v____pyx_uint32_t_is_signed;
      int __pyx_v____pyx_uint64_t_is_signed;
      int __pyx_v____pyx_uint16_t_is_signed;
      int __pyx_v____pyx_int16_t_is_signed;
      int __pyx_v____pyx_uint8_t_is_signed;
      int __pyx_v____pyx_int64_t_is_signed;
      int __pyx_v____pyx_int8_t_is_signed;
      PyObject *__pyx_v_arg = NULL;
      PyObject *__pyx_v_dtype = NULL;
      PyObject *__pyx_v_arg_base = NULL;
      PyObject *__pyx_v_candidates = NULL;
      PyObject *__pyx_v_sig = NULL;
      int __pyx_v_match_found;
      PyObject *__pyx_v_src_type = NULL;
      PyObject *__pyx_v_dst_type = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("neighbour_shared_prefix_lengths_unsorted", 0);
      __Pyx_TraceCall("neighbour_shared_prefix_lengths_unsorted", __pyx_f[0], 309, 0, __PYX_ERR(0, 309, __pyx_L1_error));
      __Pyx_INCREF(__pyx_v_kwargs);
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
      __pyx_v_dest_sig = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_2 = (__pyx_v_kwargs == Py_None);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {
        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1);
        __pyx_t_1 = 0;
      }
      {
        /*try:*/ {
          __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_v_numpy = __pyx_t_1;
          __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 309, __pyx_L4_error)
          __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1);
          __pyx_t_1 = 0;
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L11_try_end;
        __pyx_L4_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
        if (__pyx_t_7) {
          __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 309, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_INCREF(Py_None);
          __Pyx_XDECREF_SET(__pyx_v_ndarray, ((PyTypeObject*)Py_None));
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L5_exception_handled;
        }
        goto __pyx_L6_except_error;
        __pyx_L6_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L1_error;
        __pyx_L5_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        __pyx_L11_try_end:;
      }
      __pyx_v_itemsize = -1L;
      __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1L) < 0);
      __pyx_v____pyx_uint32_t_is_signed = (((__pyx_t_5numpy_uint32_t)-1L) < 0);
      __pyx_v____pyx_uint64_t_is_signed = (((__pyx_t_5numpy_uint64_t)-1L) < 0);
      __pyx_v____pyx_uint16_t_is_signed = (((__pyx_t_5numpy_uint16_t)-1L) < 0);
      __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1L) < 0);
      __pyx_v____pyx_uint8_t_is_signed = (((__pyx_t_5numpy_uint8_t)-1L) < 0);
      __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1L) < 0);
      __pyx_v____pyx_int8_t_is_signed = (((__pyx_t_5numpy_int8_t)-1L) < 0);
      if (unlikely(__pyx_v_args == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 309, __pyx_L1_error)
      }
      __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 309, __pyx_L1_error)
      __pyx_t_3 = ((0 < __pyx_t_10) != 0);
      if (__pyx_t_3) {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 309, __pyx_L1_error)
        }
        __pyx_t_9 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      if (unlikely(__pyx_v_kwargs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 309, __pyx_L1_error)
      }
      __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_h, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {
        if (unlikely(__pyx_v_kwargs == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 309, __pyx_L1_error)
        }
        __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_h); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      /*else*/ {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(0, 309, __pyx_L1_error)
        }
        __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 309, __pyx_L1_error)
        __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 309, __pyx_L1_error)
      }
      __pyx_L14:;
      while (1) {
        __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None));
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {
          __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 309, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_dtype = __pyx_t_8;
            __pyx_t_8 = 0;
            goto __pyx_L18;
          }
          __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 309, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_arg_base = __pyx_t_8;
            __pyx_t_8 = 0;
            __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
            __pyx_t_2 = (__pyx_t_3 != 0);
            if (__pyx_t_2) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 309, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_v_dtype = __pyx_t_8;
              __pyx_t_8 = 0;
              goto __pyx_L19;
            }
            /*else*/ {
              __Pyx_INCREF(Py_None);
              __pyx_v_dtype = Py_None;
            }
            __pyx_L19:;
            goto __pyx_L18;
          }
          /*else*/ {
            __Pyx_INCREF(Py_None);
            __pyx_v_dtype = Py_None;
          }
          __pyx_L18:;
          __pyx_v_itemsize = -1L;
          __pyx_t_2 = (__pyx_v_dtype != Py_None);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 309, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_itemsize = __pyx_t_10;
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 309, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 309, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_kind = __pyx_t_11;
            __pyx_v_dtype_signed = (__pyx_v_kind == 'i');
            switch (__pyx_v_kind) {
              case 'i':
              case 'u':
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 309, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L22_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 309, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L26_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 309, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L30_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 309, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L34_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 309, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L38_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 309, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L42_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 309, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L46_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 309, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L50_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              break;
              case 'f':
              break;
              case 'c':
              break;
              case 'O':
              break;
              default: break;
            }
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L54_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L54_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L58_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L58_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L62_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L62_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L66_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L66_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L70_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L70_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L74_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L74_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L78_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L78_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L82_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L82_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
        goto __pyx_L16_break;
      }
      __pyx_L16_break:;
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_candidates = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_10 = 0;
      if (unlikely(__pyx_v_signatures == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 309, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8);
      __pyx_t_8 = __pyx_t_9;
      __pyx_t_9 = 0;
      while (1) {
        __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_13, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7);
        if (unlikely(__pyx_t_14 == 0)) break;
        if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_v_match_found = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /* … */
      __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__20);
      __Pyx_GIVEREF(__pyx_tuple__20);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
        __Pyx_INCREF(__pyx_v_dest_sig);
        __Pyx_GIVEREF(__pyx_v_dest_sig);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dest_sig);
        __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
          __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_15 = 0;
          __pyx_t_16 = NULL;
        } else {
          __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 309, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 309, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        for (;;) {
          if (likely(!__pyx_t_16)) {
            if (likely(PyList_CheckExact(__pyx_t_9))) {
              if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            } else {
              if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            }
          } else {
            __pyx_t_1 = __pyx_t_16(__pyx_t_9);
            if (unlikely(!__pyx_t_1)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 309, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_1);
          }
          if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
            PyObject* sequence = __pyx_t_1;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 309, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1);
            } else {
              __pyx_t_17 = PyList_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyList_GET_ITEM(sequence, 1);
            }
            __Pyx_INCREF(__pyx_t_17);
            __Pyx_INCREF(__pyx_t_18);
            #else
            __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 309, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 309, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_18);
            #endif
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 309, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
            index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_17);
            index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_18);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
            __pyx_t_20 = NULL;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            goto __pyx_L90_unpacking_done;
            __pyx_L89_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __pyx_t_20 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 309, __pyx_L1_error)
            __pyx_L90_unpacking_done:;
          }
          __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17);
          __pyx_t_17 = 0;
          __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18);
          __pyx_t_18 = 0;
          __pyx_t_3 = (__pyx_v_dst_type != Py_None);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (__pyx_t_2) {
              __pyx_v_match_found = 1;
              goto __pyx_L92;
            }
            /*else*/ {
              __pyx_v_match_found = 0;
              goto __pyx_L88_break;
            }
            __pyx_L92:;
          }
        }
        __pyx_L88_break:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_2 = (__pyx_v_match_found != 0);
        if (__pyx_t_2) {
          __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 309, __pyx_L1_error)
        }
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
      __pyx_t_3 = ((!__pyx_t_2) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s__8); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__21);
      __Pyx_GIVEREF(__pyx_tuple__21);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 309, __pyx_L1_error)
      }
      __pyx_t_13 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 309, __pyx_L1_error)
      __pyx_t_3 = ((__pyx_t_13 > 1) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__22);
      __Pyx_GIVEREF(__pyx_tuple__22);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 309, __pyx_L1_error)
      }
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_signatures == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 309, __pyx_L1_error)
        }
        __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        goto __pyx_L0;
      }

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_dest_sig);
      __Pyx_XDECREF(__pyx_v_ndarray);
      __Pyx_XDECREF(__pyx_v_numpy);
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XDECREF(__pyx_v_dtype);
      __Pyx_XDECREF(__pyx_v_arg_base);
      __Pyx_XDECREF(__pyx_v_candidates);
      __Pyx_XDECREF(__pyx_v_sig);
      __Pyx_XDECREF(__pyx_v_src_type);
      __Pyx_XDECREF(__pyx_v_dst_type);
      __Pyx_XDECREF(__pyx_v_kwargs);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_93__pyx_fuse_0neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_15neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_0__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths_unsorted(__Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_indices, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_ix;
      Py_ssize_t __pyx_v_jx;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cindices = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_0neighbour_shared_prefix_lengths_unsorted", 0);
      __Pyx_TraceCall("__pyx_fuse_0neighbour_shared_prefix_lengths_unsorted", __pyx_f[0], 309, 0, __PYX_ERR(0, 309, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
      __Pyx_XDECREF(__pyx_t_13);
      __Pyx_AddTraceback("allel.opt.stats.neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cindices, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_93__pyx_fuse_0neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_93__pyx_fuse_0neighbour_shared_prefix_lengths_unsorted = {"__pyx_fuse_0neighbour_shared_prefix_lengths_unsorted", (PyCFunction)__pyx_pw_5allel_3opt_5stats_93__pyx_fuse_0neighbour_shared_prefix_lengths_unsorted, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_14neighbour_shared_prefix_lengths_unsorted};
    static PyObject *__pyx_pw_5allel_3opt_5stats_93__pyx_fuse_0neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_indices = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_0neighbour_shared_prefix_lengths_unsorted (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_indices,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_0neighbour_shared_prefix_lengths_unsorted", 1, 2, 2, 1); __PYX_ERR(0, 309, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_0neighbour_shared_prefix_lengths_unsorted") < 0)) __PYX_ERR(0, 309, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 309, __pyx_L3_error)
        __pyx_v_indices = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_0neighbour_shared_prefix_lengths_unsorted", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 309, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_0neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_92__pyx_fuse_0neighbour_shared_prefix_lengths_unsorted(__pyx_self, __pyx_v_h, __pyx_v_indices);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_92__pyx_fuse_0neighbour_shared_prefix_lengths_unsorted(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_indices) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_0neighbour_shared_prefix_lengths_unsorted", 0);
      __Pyx_TraceCall("__pyx_fuse_0neighbour_shared_prefix_lengths_unsorted (wrapper)", __pyx_f[0], 309, 0, __PYX_ERR(0, 309, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 309, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_0__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths_unsorted(__pyx_v_h, __pyx_v_indices, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_0neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_95__pyx_fuse_1neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_15neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_1__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths_unsorted(__Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_indices, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_ix;
      Py_ssize_t __pyx_v_jx;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cindices = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_1neighbour_shared_prefix_lengths_unsorted", 0);
      __Pyx_TraceCall("__pyx_fuse_1neighbour_shared_prefix_lengths_unsorted", __pyx_f[0], 309, 0, __PYX_ERR(0, 309, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
      __Pyx_XDECREF(__pyx_t_13);
      __Pyx_AddTraceback("allel.opt.stats.neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cindices, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_95__pyx_fuse_1neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_95__pyx_fuse_1neighbour_shared_prefix_lengths_unsorted = {"__pyx_fuse_1neighbour_shared_prefix_lengths_unsorted", (PyCFunction)__pyx_pw_5allel_3opt_5stats_95__pyx_fuse_1neighbour_shared_prefix_lengths_unsorted, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_14neighbour_shared_prefix_lengths_unsorted};
    static PyObject *__pyx_pw_5allel_3opt_5stats_95__pyx_fuse_1neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_indices = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_1neighbour_shared_prefix_lengths_unsorted (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_indices,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_1neighbour_shared_prefix_lengths_unsorted", 1, 2, 2, 1); __PYX_ERR(0, 309, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_1neighbour_shared_prefix_lengths_unsorted") < 0)) __PYX_ERR(0, 309, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 309, __pyx_L3_error)
        __pyx_v_indices = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_1neighbour_shared_prefix_lengths_unsorted", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 309, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_1neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_94__pyx_fuse_1neighbour_shared_prefix_lengths_unsorted(__pyx_self, __pyx_v_h, __pyx_v_indices);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_94__pyx_fuse_1neighbour_shared_prefix_lengths_unsorted(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_indices) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_1neighbour_shared_prefix_lengths_unsorted", 0);
      __Pyx_TraceCall("__pyx_fuse_1neighbour_shared_prefix_lengths_unsorted (wrapper)", __pyx_f[0], 309, 0, __PYX_ERR(0, 309, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 309, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_1__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths_unsorted(__pyx_v_h, __pyx_v_indices, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_1neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_97__pyx_fuse_2neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_15neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_2__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths_unsorted(__Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_indices, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_ix;
      Py_ssize_t __pyx_v_jx;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cindices = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_2neighbour_shared_prefix_lengths_unsorted", 0);
      __Pyx_TraceCall("__pyx_fuse_2neighbour_shared_prefix_lengths_unsorted", __pyx_f[0], 309, 0, __PYX_ERR(0, 309, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __Pyx_XDECREF(__pyx_t_12);
      __Pyx_AddTraceback("allel.opt.stats.neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cindices, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_97__pyx_fuse_2neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_97__pyx_fuse_2neighbour_shared_prefix_lengths_unsorted = {"__pyx_fuse_2neighbour_shared_prefix_lengths_unsorted", (PyCFunction)__pyx_pw_5allel_3opt_5stats_97__pyx_fuse_2neighbour_shared_prefix_lengths_unsorted, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_14neighbour_shared_prefix_lengths_unsorted};
    static PyObject *__pyx_pw_5allel_3opt_5stats_97__pyx_fuse_2neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_indices = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_2neighbour_shared_prefix_lengths_unsorted (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_indices,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_2neighbour_shared_prefix_lengths_unsorted", 1, 2, 2, 1); __PYX_ERR(0, 309, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_2neighbour_shared_prefix_lengths_unsorted") < 0)) __PYX_ERR(0, 309, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 309, __pyx_L3_error)
        __pyx_v_indices = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_2neighbour_shared_prefix_lengths_unsorted", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 309, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_2neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_96__pyx_fuse_2neighbour_shared_prefix_lengths_unsorted(__pyx_self, __pyx_v_h, __pyx_v_indices);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_96__pyx_fuse_2neighbour_shared_prefix_lengths_unsorted(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_indices) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_2neighbour_shared_prefix_lengths_unsorted", 0);
      __Pyx_TraceCall("__pyx_fuse_2neighbour_shared_prefix_lengths_unsorted (wrapper)", __pyx_f[0], 309, 0, __PYX_ERR(0, 309, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 309, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_2__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths_unsorted(__pyx_v_h, __pyx_v_indices, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_2neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_99__pyx_fuse_3neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_15neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_3__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths_unsorted(__Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_indices, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_ix;
      Py_ssize_t __pyx_v_jx;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cindices = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_3neighbour_shared_prefix_lengths_unsorted", 0);
      __Pyx_TraceCall("__pyx_fuse_3neighbour_shared_prefix_lengths_unsorted", __pyx_f[0], 309, 0, __PYX_ERR(0, 309, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
      __Pyx_XDECREF(__pyx_t_13);
      __Pyx_AddTraceback("allel.opt.stats.neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cindices, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_99__pyx_fuse_3neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_99__pyx_fuse_3neighbour_shared_prefix_lengths_unsorted = {"__pyx_fuse_3neighbour_shared_prefix_lengths_unsorted", (PyCFunction)__pyx_pw_5allel_3opt_5stats_99__pyx_fuse_3neighbour_shared_prefix_lengths_unsorted, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_14neighbour_shared_prefix_lengths_unsorted};
    static PyObject *__pyx_pw_5allel_3opt_5stats_99__pyx_fuse_3neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_indices = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_3neighbour_shared_prefix_lengths_unsorted (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_indices,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_3neighbour_shared_prefix_lengths_unsorted", 1, 2, 2, 1); __PYX_ERR(0, 309, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_3neighbour_shared_prefix_lengths_unsorted") < 0)) __PYX_ERR(0, 309, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 309, __pyx_L3_error)
        __pyx_v_indices = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_3neighbour_shared_prefix_lengths_unsorted", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 309, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_3neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_98__pyx_fuse_3neighbour_shared_prefix_lengths_unsorted(__pyx_self, __pyx_v_h, __pyx_v_indices);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_98__pyx_fuse_3neighbour_shared_prefix_lengths_unsorted(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_indices) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_3neighbour_shared_prefix_lengths_unsorted", 0);
      __Pyx_TraceCall("__pyx_fuse_3neighbour_shared_prefix_lengths_unsorted (wrapper)", __pyx_f[0], 309, 0, __PYX_ERR(0, 309, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 309, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_3__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths_unsorted(__pyx_v_h, __pyx_v_indices, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_3neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_101__pyx_fuse_4neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_15neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_4__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths_unsorted(__Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_indices, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_ix;
      Py_ssize_t __pyx_v_jx;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cindices = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_4neighbour_shared_prefix_lengths_unsorted", 0);
      __Pyx_TraceCall("__pyx_fuse_4neighbour_shared_prefix_lengths_unsorted", __pyx_f[0], 309, 0, __PYX_ERR(0, 309, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
      __Pyx_XDECREF(__pyx_t_13);
      __Pyx_AddTraceback("allel.opt.stats.neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cindices, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_101__pyx_fuse_4neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_101__pyx_fuse_4neighbour_shared_prefix_lengths_unsorted = {"__pyx_fuse_4neighbour_shared_prefix_lengths_unsorted", (PyCFunction)__pyx_pw_5allel_3opt_5stats_101__pyx_fuse_4neighbour_shared_prefix_lengths_unsorted, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_14neighbour_shared_prefix_lengths_unsorted};
    static PyObject *__pyx_pw_5allel_3opt_5stats_101__pyx_fuse_4neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_indices = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_4neighbour_shared_prefix_lengths_unsorted (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_indices,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_4neighbour_shared_prefix_lengths_unsorted", 1, 2, 2, 1); __PYX_ERR(0, 309, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_4neighbour_shared_prefix_lengths_unsorted") < 0)) __PYX_ERR(0, 309, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 309, __pyx_L3_error)
        __pyx_v_indices = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_4neighbour_shared_prefix_lengths_unsorted", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 309, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_4neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_100__pyx_fuse_4neighbour_shared_prefix_lengths_unsorted(__pyx_self, __pyx_v_h, __pyx_v_indices);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_100__pyx_fuse_4neighbour_shared_prefix_lengths_unsorted(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_indices) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_4neighbour_shared_prefix_lengths_unsorted", 0);
      __Pyx_TraceCall("__pyx_fuse_4neighbour_shared_prefix_lengths_unsorted (wrapper)", __pyx_f[0], 309, 0, __PYX_ERR(0, 309, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 309, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_4__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths_unsorted(__pyx_v_h, __pyx_v_indices, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_4neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_103__pyx_fuse_5neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_15neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_5__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths_unsorted(__Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_indices, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_ix;
      Py_ssize_t __pyx_v_jx;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cindices = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_5neighbour_shared_prefix_lengths_unsorted", 0);
      __Pyx_TraceCall("__pyx_fuse_5neighbour_shared_prefix_lengths_unsorted", __pyx_f[0], 309, 0, __PYX_ERR(0, 309, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
      __Pyx_XDECREF(__pyx_t_13);
      __Pyx_AddTraceback("allel.opt.stats.neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cindices, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_103__pyx_fuse_5neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_103__pyx_fuse_5neighbour_shared_prefix_lengths_unsorted = {"__pyx_fuse_5neighbour_shared_prefix_lengths_unsorted", (PyCFunction)__pyx_pw_5allel_3opt_5stats_103__pyx_fuse_5neighbour_shared_prefix_lengths_unsorted, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_14neighbour_shared_prefix_lengths_unsorted};
    static PyObject *__pyx_pw_5allel_3opt_5stats_103__pyx_fuse_5neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_indices = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_5neighbour_shared_prefix_lengths_unsorted (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_indices,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_5neighbour_shared_prefix_lengths_unsorted", 1, 2, 2, 1); __PYX_ERR(0, 309, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_5neighbour_shared_prefix_lengths_unsorted") < 0)) __PYX_ERR(0, 309, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint16_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 309, __pyx_L3_error)
        __pyx_v_indices = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_5neighbour_shared_prefix_lengths_unsorted", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 309, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_5neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_102__pyx_fuse_5neighbour_shared_prefix_lengths_unsorted(__pyx_self, __pyx_v_h, __pyx_v_indices);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_102__pyx_fuse_5neighbour_shared_prefix_lengths_unsorted(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_indices) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_5neighbour_shared_prefix_lengths_unsorted", 0);
      __Pyx_TraceCall("__pyx_fuse_5neighbour_shared_prefix_lengths_unsorted (wrapper)", __pyx_f[0], 309, 0, __PYX_ERR(0, 309, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 309, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_5__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths_unsorted(__pyx_v_h, __pyx_v_indices, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_5neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_105__pyx_fuse_6neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_15neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_6__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths_unsorted(__Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_indices, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_ix;
      Py_ssize_t __pyx_v_jx;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cindices = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_6neighbour_shared_prefix_lengths_unsorted", 0);
      __Pyx_TraceCall("__pyx_fuse_6neighbour_shared_prefix_lengths_unsorted", __pyx_f[0], 309, 0, __PYX_ERR(0, 309, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
      __Pyx_XDECREF(__pyx_t_13);
      __Pyx_AddTraceback("allel.opt.stats.neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cindices, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_105__pyx_fuse_6neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_105__pyx_fuse_6neighbour_shared_prefix_lengths_unsorted = {"__pyx_fuse_6neighbour_shared_prefix_lengths_unsorted", (PyCFunction)__pyx_pw_5allel_3opt_5stats_105__pyx_fuse_6neighbour_shared_prefix_lengths_unsorted, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_14neighbour_shared_prefix_lengths_unsorted};
    static PyObject *__pyx_pw_5allel_3opt_5stats_105__pyx_fuse_6neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_indices = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_6neighbour_shared_prefix_lengths_unsorted (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_indices,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_6neighbour_shared_prefix_lengths_unsorted", 1, 2, 2, 1); __PYX_ERR(0, 309, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_6neighbour_shared_prefix_lengths_unsorted") < 0)) __PYX_ERR(0, 309, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 309, __pyx_L3_error)
        __pyx_v_indices = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_6neighbour_shared_prefix_lengths_unsorted", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 309, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_6neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_104__pyx_fuse_6neighbour_shared_prefix_lengths_unsorted(__pyx_self, __pyx_v_h, __pyx_v_indices);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_104__pyx_fuse_6neighbour_shared_prefix_lengths_unsorted(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_indices) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_6neighbour_shared_prefix_lengths_unsorted", 0);
      __Pyx_TraceCall("__pyx_fuse_6neighbour_shared_prefix_lengths_unsorted (wrapper)", __pyx_f[0], 309, 0, __PYX_ERR(0, 309, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 309, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_6__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths_unsorted(__pyx_v_h, __pyx_v_indices, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_6neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_107__pyx_fuse_7neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_15neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_fuse_7__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths_unsorted(__Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_indices, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_ix;
      Py_ssize_t __pyx_v_jx;
      __Pyx_memviewslice __pyx_v_lengths = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_cindices = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_7neighbour_shared_prefix_lengths_unsorted", 0);
      __Pyx_TraceCall("__pyx_fuse_7neighbour_shared_prefix_lengths_unsorted", __pyx_f[0], 309, 0, __PYX_ERR(0, 309, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
      __Pyx_XDECREF(__pyx_t_13);
      __Pyx_AddTraceback("allel.opt.stats.neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_lengths, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_cindices, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_107__pyx_fuse_7neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_107__pyx_fuse_7neighbour_shared_prefix_lengths_unsorted = {"__pyx_fuse_7neighbour_shared_prefix_lengths_unsorted", (PyCFunction)__pyx_pw_5allel_3opt_5stats_107__pyx_fuse_7neighbour_shared_prefix_lengths_unsorted, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_14neighbour_shared_prefix_lengths_unsorted};
    static PyObject *__pyx_pw_5allel_3opt_5stats_107__pyx_fuse_7neighbour_shared_prefix_lengths_unsorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_indices = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_7neighbour_shared_prefix_lengths_unsorted (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_indices,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_7neighbour_shared_prefix_lengths_unsorted", 1, 2, 2, 1); __PYX_ERR(0, 309, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_7neighbour_shared_prefix_lengths_unsorted") < 0)) __PYX_ERR(0, 309, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint64_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 309, __pyx_L3_error)
        __pyx_v_indices = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_7neighbour_shared_prefix_lengths_unsorted", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 309, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_7neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_106__pyx_fuse_7neighbour_shared_prefix_lengths_unsorted(__pyx_self, __pyx_v_h, __pyx_v_indices);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_106__pyx_fuse_7neighbour_shared_prefix_lengths_unsorted(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_indices) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_7neighbour_shared_prefix_lengths_unsorted", 0);
      __Pyx_TraceCall("__pyx_fuse_7neighbour_shared_prefix_lengths_unsorted (wrapper)", __pyx_f[0], 309, 0, __PYX_ERR(0, 309, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_h.memview)) { __Pyx_RaiseUnboundLocalError("h"); __PYX_ERR(0, 309, __pyx_L1_error) }
      __pyx_t_1 = __pyx_fuse_7__pyx_f_5allel_3opt_5stats_neighbour_shared_prefix_lengths_unsorted(__pyx_v_h, __pyx_v_indices, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_7neighbour_shared_prefix_lengths_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
      __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__23);
      __Pyx_GIVEREF(__pyx_tuple__23);
    /* … */
      __pyx_tuple__115 = PyTuple_Pack(2, __pyx_n_s_h, __pyx_n_s_indices); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__115);
      __Pyx_GIVEREF(__pyx_tuple__115);
    /* … */
      __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_93__pyx_fuse_0neighbour_shared_prefix_lengths_unsorted, 0, __pyx_n_s_pyx_fuse_0neighbour_shared_pre_2, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_int8_t, __pyx_t_10) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_95__pyx_fuse_1neighbour_shared_prefix_lengths_unsorted, 0, __pyx_n_s_pyx_fuse_1neighbour_shared_pre_2, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_int16_t, __pyx_t_10) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_97__pyx_fuse_2neighbour_shared_prefix_lengths_unsorted, 0, __pyx_n_s_pyx_fuse_2neighbour_shared_pre_2, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_int32_t, __pyx_t_10) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_99__pyx_fuse_3neighbour_shared_prefix_lengths_unsorted, 0, __pyx_n_s_pyx_fuse_3neighbour_shared_pre_2, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_int64_t, __pyx_t_10) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_101__pyx_fuse_4neighbour_shared_prefix_lengths_unsorted, 0, __pyx_n_s_pyx_fuse_4neighbour_shared_pre_2, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_uint8_t, __pyx_t_10) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_103__pyx_fuse_5neighbour_shared_prefix_lengths_unsorted, 0, __pyx_n_s_pyx_fuse_5neighbour_shared_pre_2, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_uint16_t, __pyx_t_10) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_105__pyx_fuse_6neighbour_shared_prefix_lengths_unsorted, 0, __pyx_n_s_pyx_fuse_6neighbour_shared_pre_2, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_uint32_t, __pyx_t_10) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_107__pyx_fuse_7neighbour_shared_prefix_lengths_unsorted, 0, __pyx_n_s_pyx_fuse_7neighbour_shared_pre_2, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_uint64_t, __pyx_t_10) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __pyx_FusedFunction_NewEx(&__pyx_mdef_5allel_3opt_5stats_15neighbour_shared_prefix_lengths_unsorted, 0, __pyx_n_s_neighbour_shared_prefix_lengths_2, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_empty_tuple);
      ((__pyx_FusedFunctionObject *) __pyx_t_10)->__signatures__ = __pyx_t_9;
      __Pyx_GIVEREF(__pyx_t_9);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_neighbour_shared_prefix_lengths_2, __pyx_t_10) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aliman_src_github_cggh_sci, __pyx_n_s_pyx_fuse_0neighbour_shared_pre_2, 309, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 309, __pyx_L1_error)

     0310:                                                indices):

     0311:     """Compute the length of the shared prefix between neighbouring

     0312:     columns in a 2-dimensional array."""

     0313:

     0314:     cdef:

     0315:         Py_ssize_t i, n, ix, jx

     0316:         cnp.int32_t[:] lengths

     0317:         cnp.int32_t[:] cindices

     0318:

    +0319:     cindices = np.asarray(indices, dtype='i4')

      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_indices);
      __Pyx_GIVEREF(__pyx_v_indices);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_indices);
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 319, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_cindices = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_indices);
      __Pyx_GIVEREF(__pyx_v_indices);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_indices);
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 319, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_cindices = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_indices);
      __Pyx_GIVEREF(__pyx_v_indices);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_indices);
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 319, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_cindices = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_indices);
      __Pyx_GIVEREF(__pyx_v_indices);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_indices);
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 319, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_cindices = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_indices);
      __Pyx_GIVEREF(__pyx_v_indices);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_indices);
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 319, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_cindices = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_indices);
      __Pyx_GIVEREF(__pyx_v_indices);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_indices);
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 319, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_cindices = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_indices);
      __Pyx_GIVEREF(__pyx_v_indices);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_indices);
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 319, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_cindices = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_indices);
      __Pyx_GIVEREF(__pyx_v_indices);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_indices);
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 319, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_cindices = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

     0320:

     0321:     # initialise variables

    +0322:     n = h.shape[1]

      __pyx_v_n = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n = (__pyx_v_h.shape[1]);

    +0323:     lengths = np.empty(n-1, dtype='i4')

      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_n - 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 323, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_n - 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 323, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_n - 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 323, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_n - 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 323, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_n - 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 323, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_n - 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 323, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_n - 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 323, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_n - 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 323, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_lengths = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

     0324:

     0325:     # iterate over columns

    +0326:     with nogil:

      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }

    +0327:         for i in range(n-1):

            __pyx_t_6 = (__pyx_v_n - 1);
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;
    /* … */
            __pyx_t_6 = (__pyx_v_n - 1);
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;
    /* … */
            __pyx_t_6 = (__pyx_v_n - 1);
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;
    /* … */
            __pyx_t_6 = (__pyx_v_n - 1);
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;
    /* … */
            __pyx_t_6 = (__pyx_v_n - 1);
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;
    /* … */
            __pyx_t_6 = (__pyx_v_n - 1);
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;
    /* … */
            __pyx_t_6 = (__pyx_v_n - 1);
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;
    /* … */
            __pyx_t_6 = (__pyx_v_n - 1);
            for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
              __pyx_v_i = __pyx_t_7;

    +0328:             ix = cindices[i]

              __pyx_t_8 = __pyx_v_i;
              __pyx_v_ix = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_cindices.data + __pyx_t_8 * __pyx_v_cindices.strides[0]) )));
    /* … */
              __pyx_t_8 = __pyx_v_i;
              __pyx_v_ix = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_cindices.data + __pyx_t_8 * __pyx_v_cindices.strides[0]) )));
    /* … */
              __pyx_t_8 = __pyx_v_i;
              __pyx_v_ix = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_cindices.data + __pyx_t_8 * __pyx_v_cindices.strides[0]) )));
    /* … */
              __pyx_t_8 = __pyx_v_i;
              __pyx_v_ix = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_cindices.data + __pyx_t_8 * __pyx_v_cindices.strides[0]) )));
    /* … */
              __pyx_t_8 = __pyx_v_i;
              __pyx_v_ix = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_cindices.data + __pyx_t_8 * __pyx_v_cindices.strides[0]) )));
    /* … */
              __pyx_t_8 = __pyx_v_i;
              __pyx_v_ix = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_cindices.data + __pyx_t_8 * __pyx_v_cindices.strides[0]) )));
    /* … */
              __pyx_t_8 = __pyx_v_i;
              __pyx_v_ix = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_cindices.data + __pyx_t_8 * __pyx_v_cindices.strides[0]) )));
    /* … */
              __pyx_t_8 = __pyx_v_i;
              __pyx_v_ix = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_cindices.data + __pyx_t_8 * __pyx_v_cindices.strides[0]) )));

    +0329:             jx = cindices[i+1]

              __pyx_t_9 = (__pyx_v_i + 1);
              __pyx_v_jx = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_cindices.data + __pyx_t_9 * __pyx_v_cindices.strides[0]) )));
    /* … */
              __pyx_t_9 = (__pyx_v_i + 1);
              __pyx_v_jx = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_cindices.data + __pyx_t_9 * __pyx_v_cindices.strides[0]) )));
    /* … */
              __pyx_t_9 = (__pyx_v_i + 1);
              __pyx_v_jx = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_cindices.data + __pyx_t_9 * __pyx_v_cindices.strides[0]) )));
    /* … */
              __pyx_t_9 = (__pyx_v_i + 1);
              __pyx_v_jx = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_cindices.data + __pyx_t_9 * __pyx_v_cindices.strides[0]) )));
    /* … */
              __pyx_t_9 = (__pyx_v_i + 1);
              __pyx_v_jx = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_cindices.data + __pyx_t_9 * __pyx_v_cindices.strides[0]) )));
    /* … */
              __pyx_t_9 = (__pyx_v_i + 1);
              __pyx_v_jx = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_cindices.data + __pyx_t_9 * __pyx_v_cindices.strides[0]) )));
    /* … */
              __pyx_t_9 = (__pyx_v_i + 1);
              __pyx_v_jx = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_cindices.data + __pyx_t_9 * __pyx_v_cindices.strides[0]) )));
    /* … */
              __pyx_t_9 = (__pyx_v_i + 1);
              __pyx_v_jx = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_cindices.data + __pyx_t_9 * __pyx_v_cindices.strides[0]) )));

    +0330:             lengths[i] = shared_prefix_length(h[:, ix], h[:, jx])

              __pyx_t_10.data = __pyx_v_h.data;
              __pyx_t_10.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
              __pyx_t_10.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_10.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_10.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_ix;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 330, __pyx_L4_error)
        }
            __pyx_t_10.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_11.data = __pyx_v_h.data;
              __pyx_t_11.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_11, 0);
              __pyx_t_11.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_11.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_11.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_jx;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 330, __pyx_L4_error)
        }
            __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_12 = __pyx_v_i;
              *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_12 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_0__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_10, __pyx_t_11, 0);
              __PYX_XDEC_MEMVIEW(&__pyx_t_10, 0);
              __pyx_t_10.memview = NULL;
              __pyx_t_10.data = NULL;
              __PYX_XDEC_MEMVIEW(&__pyx_t_11, 0);
              __pyx_t_11.memview = NULL;
              __pyx_t_11.data = NULL;
            }
          }
    /* … */
              __pyx_t_10.data = __pyx_v_h.data;
              __pyx_t_10.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
              __pyx_t_10.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_10.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_10.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_ix;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 330, __pyx_L4_error)
        }
            __pyx_t_10.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_11.data = __pyx_v_h.data;
              __pyx_t_11.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_11, 0);
              __pyx_t_11.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_11.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_11.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_jx;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 330, __pyx_L4_error)
        }
            __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_12 = __pyx_v_i;
              *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_12 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_1__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_10, __pyx_t_11, 0);
              __PYX_XDEC_MEMVIEW(&__pyx_t_10, 0);
              __pyx_t_10.memview = NULL;
              __pyx_t_10.data = NULL;
              __PYX_XDEC_MEMVIEW(&__pyx_t_11, 0);
              __pyx_t_11.memview = NULL;
              __pyx_t_11.data = NULL;
            }
          }
    /* … */
              __pyx_t_5.data = __pyx_v_h.data;
              __pyx_t_5.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
              __pyx_t_5.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_5.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_5.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_ix;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 330, __pyx_L4_error)
        }
            __pyx_t_5.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_10.data = __pyx_v_h.data;
              __pyx_t_10.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
              __pyx_t_10.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_10.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_10.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_jx;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 330, __pyx_L4_error)
        }
            __pyx_t_10.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_11 = __pyx_v_i;
              *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_11 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_2__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_5, __pyx_t_10, 0);
              __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);
              __pyx_t_5.memview = NULL;
              __pyx_t_5.data = NULL;
              __PYX_XDEC_MEMVIEW(&__pyx_t_10, 0);
              __pyx_t_10.memview = NULL;
              __pyx_t_10.data = NULL;
            }
          }
    /* … */
              __pyx_t_10.data = __pyx_v_h.data;
              __pyx_t_10.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
              __pyx_t_10.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_10.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_10.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_ix;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 330, __pyx_L4_error)
        }
            __pyx_t_10.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_11.data = __pyx_v_h.data;
              __pyx_t_11.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_11, 0);
              __pyx_t_11.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_11.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_11.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_jx;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 330, __pyx_L4_error)
        }
            __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_12 = __pyx_v_i;
              *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_12 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_3__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_10, __pyx_t_11, 0);
              __PYX_XDEC_MEMVIEW(&__pyx_t_10, 0);
              __pyx_t_10.memview = NULL;
              __pyx_t_10.data = NULL;
              __PYX_XDEC_MEMVIEW(&__pyx_t_11, 0);
              __pyx_t_11.memview = NULL;
              __pyx_t_11.data = NULL;
            }
          }
    /* … */
              __pyx_t_10.data = __pyx_v_h.data;
              __pyx_t_10.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
              __pyx_t_10.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_10.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_10.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_ix;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 330, __pyx_L4_error)
        }
            __pyx_t_10.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_11.data = __pyx_v_h.data;
              __pyx_t_11.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_11, 0);
              __pyx_t_11.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_11.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_11.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_jx;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 330, __pyx_L4_error)
        }
            __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_12 = __pyx_v_i;
              *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_12 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_4__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_10, __pyx_t_11, 0);
              __PYX_XDEC_MEMVIEW(&__pyx_t_10, 0);
              __pyx_t_10.memview = NULL;
              __pyx_t_10.data = NULL;
              __PYX_XDEC_MEMVIEW(&__pyx_t_11, 0);
              __pyx_t_11.memview = NULL;
              __pyx_t_11.data = NULL;
            }
          }
    /* … */
              __pyx_t_10.data = __pyx_v_h.data;
              __pyx_t_10.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
              __pyx_t_10.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_10.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_10.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_ix;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 330, __pyx_L4_error)
        }
            __pyx_t_10.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_11.data = __pyx_v_h.data;
              __pyx_t_11.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_11, 0);
              __pyx_t_11.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_11.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_11.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_jx;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 330, __pyx_L4_error)
        }
            __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_12 = __pyx_v_i;
              *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_12 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_5__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_10, __pyx_t_11, 0);
              __PYX_XDEC_MEMVIEW(&__pyx_t_10, 0);
              __pyx_t_10.memview = NULL;
              __pyx_t_10.data = NULL;
              __PYX_XDEC_MEMVIEW(&__pyx_t_11, 0);
              __pyx_t_11.memview = NULL;
              __pyx_t_11.data = NULL;
            }
          }
    /* … */
              __pyx_t_10.data = __pyx_v_h.data;
              __pyx_t_10.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
              __pyx_t_10.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_10.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_10.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_ix;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 330, __pyx_L4_error)
        }
            __pyx_t_10.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_11.data = __pyx_v_h.data;
              __pyx_t_11.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_11, 0);
              __pyx_t_11.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_11.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_11.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_jx;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 330, __pyx_L4_error)
        }
            __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_12 = __pyx_v_i;
              *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_12 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_6__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_10, __pyx_t_11, 0);
              __PYX_XDEC_MEMVIEW(&__pyx_t_10, 0);
              __pyx_t_10.memview = NULL;
              __pyx_t_10.data = NULL;
              __PYX_XDEC_MEMVIEW(&__pyx_t_11, 0);
              __pyx_t_11.memview = NULL;
              __pyx_t_11.data = NULL;
            }
          }
    /* … */
              __pyx_t_10.data = __pyx_v_h.data;
              __pyx_t_10.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_10, 0);
              __pyx_t_10.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_10.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_10.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_ix;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 330, __pyx_L4_error)
        }
            __pyx_t_10.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_11.data = __pyx_v_h.data;
              __pyx_t_11.memview = __pyx_v_h.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_11, 0);
              __pyx_t_11.shape[0] = __pyx_v_h.shape[0];
    __pyx_t_11.strides[0] = __pyx_v_h.strides[0];
        __pyx_t_11.suboffsets[0] = -1;

    {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_jx;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[1];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[1];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
            __PYX_ERR(0, 330, __pyx_L4_error)
        }
            __pyx_t_11.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_12 = __pyx_v_i;
              *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_lengths.data + __pyx_t_12 * __pyx_v_lengths.strides[0]) )) = __pyx_fuse_7__pyx_f_5allel_3opt_5stats_shared_prefix_length(__pyx_t_10, __pyx_t_11, 0);
              __PYX_XDEC_MEMVIEW(&__pyx_t_10, 0);
              __pyx_t_10.memview = NULL;
              __pyx_t_10.data = NULL;
              __PYX_XDEC_MEMVIEW(&__pyx_t_11, 0);
              __pyx_t_11.memview = NULL;
              __pyx_t_11.data = NULL;
            }
          }

     0331:

    +0332:     return np.asarray(lengths)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_3); __pyx_t_3 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_3); __pyx_t_3 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_3); __pyx_t_3 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_3); __pyx_t_3 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_3); __pyx_t_3 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_3); __pyx_t_3 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_3); __pyx_t_3 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_lengths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_3); __pyx_t_3 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

     0333:

     0334:

     0335: @cython.boundscheck(False)

     0336: @cython.wraparound(False)

    +0337: cpdef inline Py_ssize_t bisect_left(integer[:] s, integer x) nogil:

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_17bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_5allel_3opt_5stats_16bisect_left[] = "Optimized implementation of bisect_left.";
    static PyMethodDef __pyx_mdef_5allel_3opt_5stats_17bisect_left = {"bisect_left", (PyCFunction)__pyx_pw_5allel_3opt_5stats_17bisect_left, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_16bisect_left};
    static PyObject *__pyx_pw_5allel_3opt_5stats_17bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_signatures = 0;
      PyObject *__pyx_v_args = 0;
      PyObject *__pyx_v_kwargs = 0;
      CYTHON_UNUSED PyObject *__pyx_v_defaults = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0};
        PyObject* values[4] = {0,0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 337, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 337, __pyx_L3_error)
            }
            case  3:
            if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 337, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 337, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        }
        __pyx_v_signatures = values[0];
        __pyx_v_args = values[1];
        __pyx_v_kwargs = values[2];
        __pyx_v_defaults = values[3];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 337, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_16bisect_left(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_16bisect_left(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
      PyObject *__pyx_v_dest_sig = NULL;
      PyTypeObject *__pyx_v_ndarray = 0;
      PyObject *__pyx_v_numpy = NULL;
      __Pyx_memviewslice __pyx_v_memslice;
      Py_ssize_t __pyx_v_itemsize;
      int __pyx_v_dtype_signed;
      char __pyx_v_kind;
      int __pyx_v____pyx_int32_t_is_signed;
      int __pyx_v____pyx_uint32_t_is_signed;
      int __pyx_v____pyx_uint16_t_is_signed;
      int __pyx_v____pyx_int16_t_is_signed;
      int __pyx_v____pyx_uint64_t_is_signed;
      int __pyx_v____pyx_uint8_t_is_signed;
      int __pyx_v____pyx_int64_t_is_signed;
      int __pyx_v____pyx_int8_t_is_signed;
      PyObject *__pyx_v_arg = NULL;
      PyObject *__pyx_v_dtype = NULL;
      PyObject *__pyx_v_arg_base = NULL;
      PyObject *__pyx_v_candidates = NULL;
      PyObject *__pyx_v_sig = NULL;
      int __pyx_v_match_found;
      PyObject *__pyx_v_src_type = NULL;
      PyObject *__pyx_v_dst_type = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("bisect_left", 0);
      __Pyx_TraceCall("bisect_left", __pyx_f[0], 337, 0, __PYX_ERR(0, 337, __pyx_L1_error));
      __Pyx_INCREF(__pyx_v_kwargs);
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
      __pyx_v_dest_sig = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_2 = (__pyx_v_kwargs == Py_None);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {
        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1);
        __pyx_t_1 = 0;
      }
      {
        /*try:*/ {
          __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_v_numpy = __pyx_t_1;
          __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 337, __pyx_L4_error)
          __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1);
          __pyx_t_1 = 0;
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L11_try_end;
        __pyx_L4_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
        if (__pyx_t_7) {
          __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 337, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_INCREF(Py_None);
          __Pyx_XDECREF_SET(__pyx_v_ndarray, ((PyTypeObject*)Py_None));
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L5_exception_handled;
        }
        goto __pyx_L6_except_error;
        __pyx_L6_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L1_error;
        __pyx_L5_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        __pyx_L11_try_end:;
      }
      __pyx_v_itemsize = -1L;
      __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1L) < 0);
      __pyx_v____pyx_uint32_t_is_signed = (((__pyx_t_5numpy_uint32_t)-1L) < 0);
      __pyx_v____pyx_uint16_t_is_signed = (((__pyx_t_5numpy_uint16_t)-1L) < 0);
      __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1L) < 0);
      __pyx_v____pyx_uint64_t_is_signed = (((__pyx_t_5numpy_uint64_t)-1L) < 0);
      __pyx_v____pyx_uint8_t_is_signed = (((__pyx_t_5numpy_uint8_t)-1L) < 0);
      __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1L) < 0);
      __pyx_v____pyx_int8_t_is_signed = (((__pyx_t_5numpy_int8_t)-1L) < 0);
      if (unlikely(__pyx_v_args == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 337, __pyx_L1_error)
      }
      __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 337, __pyx_L1_error)
      __pyx_t_3 = ((0 < __pyx_t_10) != 0);
      if (__pyx_t_3) {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 337, __pyx_L1_error)
        }
        __pyx_t_9 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      if (unlikely(__pyx_v_kwargs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 337, __pyx_L1_error)
      }
      __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_s, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {
        if (unlikely(__pyx_v_kwargs == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 337, __pyx_L1_error)
        }
        __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_s); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 337, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      /*else*/ {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(0, 337, __pyx_L1_error)
        }
        __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 337, __pyx_L1_error)
        __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 337, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 337, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 337, __pyx_L1_error)
      }
      __pyx_L14:;
      while (1) {
        __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None));
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {
          __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_dtype = __pyx_t_8;
            __pyx_t_8 = 0;
            goto __pyx_L18;
          }
          __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_arg_base = __pyx_t_8;
            __pyx_t_8 = 0;
            __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
            __pyx_t_2 = (__pyx_t_3 != 0);
            if (__pyx_t_2) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_v_dtype = __pyx_t_8;
              __pyx_t_8 = 0;
              goto __pyx_L19;
            }
            /*else*/ {
              __Pyx_INCREF(Py_None);
              __pyx_v_dtype = Py_None;
            }
            __pyx_L19:;
            goto __pyx_L18;
          }
          /*else*/ {
            __Pyx_INCREF(Py_None);
            __pyx_v_dtype = Py_None;
          }
          __pyx_L18:;
          __pyx_v_itemsize = -1L;
          __pyx_t_2 = (__pyx_v_dtype != Py_None);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_itemsize = __pyx_t_10;
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 337, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_kind = __pyx_t_11;
            __pyx_v_dtype_signed = (__pyx_v_kind == 'i');
            switch (__pyx_v_kind) {
              case 'i':
              case 'u':
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L22_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L26_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L30_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L34_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L38_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L42_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L46_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L50_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              break;
              case 'f':
              break;
              case 'c':
              break;
              case 'O':
              break;
              default: break;
            }
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L54_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L54_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L58_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L58_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L62_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L62_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L66_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L66_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L70_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L70_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L74_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L74_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L78_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L78_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L82_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L82_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
        goto __pyx_L16_break;
      }
      __pyx_L16_break:;
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_candidates = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_10 = 0;
      if (unlikely(__pyx_v_signatures == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 337, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8);
      __pyx_t_8 = __pyx_t_9;
      __pyx_t_9 = 0;
      while (1) {
        __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_13, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7);
        if (unlikely(__pyx_t_14 == 0)) break;
        if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 337, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_v_match_found = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 337, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 337, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /* … */
      __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__24);
      __Pyx_GIVEREF(__pyx_tuple__24);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 337, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
        __Pyx_INCREF(__pyx_v_dest_sig);
        __Pyx_GIVEREF(__pyx_v_dest_sig);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dest_sig);
        __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
          __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_15 = 0;
          __pyx_t_16 = NULL;
        } else {
          __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 337, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 337, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        for (;;) {
          if (likely(!__pyx_t_16)) {
            if (likely(PyList_CheckExact(__pyx_t_9))) {
              if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            } else {
              if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            }
          } else {
            __pyx_t_1 = __pyx_t_16(__pyx_t_9);
            if (unlikely(!__pyx_t_1)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 337, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_1);
          }
          if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
            PyObject* sequence = __pyx_t_1;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 337, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1);
            } else {
              __pyx_t_17 = PyList_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyList_GET_ITEM(sequence, 1);
            }
            __Pyx_INCREF(__pyx_t_17);
            __Pyx_INCREF(__pyx_t_18);
            #else
            __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 337, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 337, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_18);
            #endif
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 337, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
            index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_17);
            index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_18);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
            __pyx_t_20 = NULL;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            goto __pyx_L90_unpacking_done;
            __pyx_L89_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __pyx_t_20 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 337, __pyx_L1_error)
            __pyx_L90_unpacking_done:;
          }
          __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17);
          __pyx_t_17 = 0;
          __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18);
          __pyx_t_18 = 0;
          __pyx_t_3 = (__pyx_v_dst_type != Py_None);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (__pyx_t_2) {
              __pyx_v_match_found = 1;
              goto __pyx_L92;
            }
            /*else*/ {
              __pyx_v_match_found = 0;
              goto __pyx_L88_break;
            }
            __pyx_L92:;
          }
        }
        __pyx_L88_break:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_2 = (__pyx_v_match_found != 0);
        if (__pyx_t_2) {
          __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 337, __pyx_L1_error)
        }
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
      __pyx_t_3 = ((!__pyx_t_2) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s__8); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__25);
      __Pyx_GIVEREF(__pyx_tuple__25);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 337, __pyx_L1_error)
      }
      __pyx_t_13 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 337, __pyx_L1_error)
      __pyx_t_3 = ((__pyx_t_13 > 1) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__26);
      __Pyx_GIVEREF(__pyx_tuple__26);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 337, __pyx_L1_error)
      }
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_signatures == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 337, __pyx_L1_error)
        }
        __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        goto __pyx_L0;
      }

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_dest_sig);
      __Pyx_XDECREF(__pyx_v_ndarray);
      __Pyx_XDECREF(__pyx_v_numpy);
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XDECREF(__pyx_v_dtype);
      __Pyx_XDECREF(__pyx_v_arg_base);
      __Pyx_XDECREF(__pyx_v_candidates);
      __Pyx_XDECREF(__pyx_v_sig);
      __Pyx_XDECREF(__pyx_v_src_type);
      __Pyx_XDECREF(__pyx_v_dst_type);
      __Pyx_XDECREF(__pyx_v_kwargs);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_111__pyx_fuse_0bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_17bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static CYTHON_INLINE Py_ssize_t __pyx_fuse_0__pyx_f_5allel_3opt_5stats_bisect_left(__Pyx_memviewslice __pyx_v_s, __pyx_t_5numpy_int8_t __pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_l;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_m;
      __pyx_t_5numpy_int8_t __pyx_v_v;
      Py_ssize_t __pyx_r;
      __Pyx_TraceDeclarations
      __Pyx_TraceCall("__pyx_fuse_0bisect_left", __pyx_f[0], 337, 1, __PYX_ERR(0, 337, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_WriteUnraisable("allel.opt.stats.bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_TraceReturn(Py_None, 1);
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_111__pyx_fuse_0bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_111__pyx_fuse_0bisect_left = {"__pyx_fuse_0bisect_left", (PyCFunction)__pyx_pw_5allel_3opt_5stats_111__pyx_fuse_0bisect_left, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_16bisect_left};
    static PyObject *__pyx_pw_5allel_3opt_5stats_111__pyx_fuse_0bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int8_t __pyx_v_x;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_0bisect_left (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s,&__pyx_n_s_x,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_s)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_0bisect_left", 1, 2, 2, 1); __PYX_ERR(0, 337, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_0bisect_left") < 0)) __PYX_ERR(0, 337, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_s = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_s.memview)) __PYX_ERR(0, 337, __pyx_L3_error)
        __pyx_v_x = __Pyx_PyInt_As_npy_int8(values[1]); if (unlikely((__pyx_v_x == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_0bisect_left", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 337, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_0bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_110__pyx_fuse_0bisect_left(__pyx_self, __pyx_v_s, __pyx_v_x);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_110__pyx_fuse_0bisect_left(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_s, __pyx_t_5numpy_int8_t __pyx_v_x) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_0bisect_left", 0);
      __Pyx_TraceCall("__pyx_fuse_0bisect_left (wrapper)", __pyx_f[0], 337, 0, __PYX_ERR(0, 337, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_s.memview)) { __Pyx_RaiseUnboundLocalError("s"); __PYX_ERR(0, 337, __pyx_L1_error) }
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_fuse_0__pyx_f_5allel_3opt_5stats_bisect_left(__pyx_v_s, __pyx_v_x, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_0bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_113__pyx_fuse_1bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_17bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static CYTHON_INLINE Py_ssize_t __pyx_fuse_1__pyx_f_5allel_3opt_5stats_bisect_left(__Pyx_memviewslice __pyx_v_s, __pyx_t_5numpy_int16_t __pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_l;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_m;
      __pyx_t_5numpy_int16_t __pyx_v_v;
      Py_ssize_t __pyx_r;
      __Pyx_TraceDeclarations
      __Pyx_TraceCall("__pyx_fuse_1bisect_left", __pyx_f[0], 337, 1, __PYX_ERR(0, 337, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_WriteUnraisable("allel.opt.stats.bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_TraceReturn(Py_None, 1);
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_113__pyx_fuse_1bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_113__pyx_fuse_1bisect_left = {"__pyx_fuse_1bisect_left", (PyCFunction)__pyx_pw_5allel_3opt_5stats_113__pyx_fuse_1bisect_left, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_16bisect_left};
    static PyObject *__pyx_pw_5allel_3opt_5stats_113__pyx_fuse_1bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int16_t __pyx_v_x;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_1bisect_left (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s,&__pyx_n_s_x,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_s)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_1bisect_left", 1, 2, 2, 1); __PYX_ERR(0, 337, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_1bisect_left") < 0)) __PYX_ERR(0, 337, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_s = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_s.memview)) __PYX_ERR(0, 337, __pyx_L3_error)
        __pyx_v_x = __Pyx_PyInt_As_npy_int16(values[1]); if (unlikely((__pyx_v_x == ((npy_int16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_1bisect_left", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 337, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_1bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_112__pyx_fuse_1bisect_left(__pyx_self, __pyx_v_s, __pyx_v_x);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_112__pyx_fuse_1bisect_left(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_s, __pyx_t_5numpy_int16_t __pyx_v_x) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_1bisect_left", 0);
      __Pyx_TraceCall("__pyx_fuse_1bisect_left (wrapper)", __pyx_f[0], 337, 0, __PYX_ERR(0, 337, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_s.memview)) { __Pyx_RaiseUnboundLocalError("s"); __PYX_ERR(0, 337, __pyx_L1_error) }
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_fuse_1__pyx_f_5allel_3opt_5stats_bisect_left(__pyx_v_s, __pyx_v_x, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_1bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_115__pyx_fuse_2bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_17bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static CYTHON_INLINE Py_ssize_t __pyx_fuse_2__pyx_f_5allel_3opt_5stats_bisect_left(__Pyx_memviewslice __pyx_v_s, __pyx_t_5numpy_int32_t __pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_l;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_m;
      __pyx_t_5numpy_int32_t __pyx_v_v;
      Py_ssize_t __pyx_r;
      __Pyx_TraceDeclarations
      __Pyx_TraceCall("__pyx_fuse_2bisect_left", __pyx_f[0], 337, 1, __PYX_ERR(0, 337, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_WriteUnraisable("allel.opt.stats.bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_TraceReturn(Py_None, 1);
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_115__pyx_fuse_2bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_115__pyx_fuse_2bisect_left = {"__pyx_fuse_2bisect_left", (PyCFunction)__pyx_pw_5allel_3opt_5stats_115__pyx_fuse_2bisect_left, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_16bisect_left};
    static PyObject *__pyx_pw_5allel_3opt_5stats_115__pyx_fuse_2bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int32_t __pyx_v_x;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_2bisect_left (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s,&__pyx_n_s_x,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_s)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_2bisect_left", 1, 2, 2, 1); __PYX_ERR(0, 337, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_2bisect_left") < 0)) __PYX_ERR(0, 337, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_s = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_s.memview)) __PYX_ERR(0, 337, __pyx_L3_error)
        __pyx_v_x = __Pyx_PyInt_As_npy_int32(values[1]); if (unlikely((__pyx_v_x == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_2bisect_left", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 337, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_2bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_114__pyx_fuse_2bisect_left(__pyx_self, __pyx_v_s, __pyx_v_x);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_114__pyx_fuse_2bisect_left(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_s, __pyx_t_5numpy_int32_t __pyx_v_x) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_2bisect_left", 0);
      __Pyx_TraceCall("__pyx_fuse_2bisect_left (wrapper)", __pyx_f[0], 337, 0, __PYX_ERR(0, 337, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_s.memview)) { __Pyx_RaiseUnboundLocalError("s"); __PYX_ERR(0, 337, __pyx_L1_error) }
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_fuse_2__pyx_f_5allel_3opt_5stats_bisect_left(__pyx_v_s, __pyx_v_x, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_2bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_117__pyx_fuse_3bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_17bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static CYTHON_INLINE Py_ssize_t __pyx_fuse_3__pyx_f_5allel_3opt_5stats_bisect_left(__Pyx_memviewslice __pyx_v_s, __pyx_t_5numpy_int64_t __pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_l;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_m;
      __pyx_t_5numpy_int64_t __pyx_v_v;
      Py_ssize_t __pyx_r;
      __Pyx_TraceDeclarations
      __Pyx_TraceCall("__pyx_fuse_3bisect_left", __pyx_f[0], 337, 1, __PYX_ERR(0, 337, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_WriteUnraisable("allel.opt.stats.bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_TraceReturn(Py_None, 1);
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_117__pyx_fuse_3bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_117__pyx_fuse_3bisect_left = {"__pyx_fuse_3bisect_left", (PyCFunction)__pyx_pw_5allel_3opt_5stats_117__pyx_fuse_3bisect_left, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_16bisect_left};
    static PyObject *__pyx_pw_5allel_3opt_5stats_117__pyx_fuse_3bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int64_t __pyx_v_x;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_3bisect_left (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s,&__pyx_n_s_x,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_s)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_3bisect_left", 1, 2, 2, 1); __PYX_ERR(0, 337, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_3bisect_left") < 0)) __PYX_ERR(0, 337, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_s = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_s.memview)) __PYX_ERR(0, 337, __pyx_L3_error)
        __pyx_v_x = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_x == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_3bisect_left", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 337, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_3bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_116__pyx_fuse_3bisect_left(__pyx_self, __pyx_v_s, __pyx_v_x);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_116__pyx_fuse_3bisect_left(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_s, __pyx_t_5numpy_int64_t __pyx_v_x) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_3bisect_left", 0);
      __Pyx_TraceCall("__pyx_fuse_3bisect_left (wrapper)", __pyx_f[0], 337, 0, __PYX_ERR(0, 337, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_s.memview)) { __Pyx_RaiseUnboundLocalError("s"); __PYX_ERR(0, 337, __pyx_L1_error) }
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_fuse_3__pyx_f_5allel_3opt_5stats_bisect_left(__pyx_v_s, __pyx_v_x, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_3bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_119__pyx_fuse_4bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_17bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static CYTHON_INLINE Py_ssize_t __pyx_fuse_4__pyx_f_5allel_3opt_5stats_bisect_left(__Pyx_memviewslice __pyx_v_s, __pyx_t_5numpy_uint8_t __pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_l;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_m;
      __pyx_t_5numpy_uint8_t __pyx_v_v;
      Py_ssize_t __pyx_r;
      __Pyx_TraceDeclarations
      __Pyx_TraceCall("__pyx_fuse_4bisect_left", __pyx_f[0], 337, 1, __PYX_ERR(0, 337, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_WriteUnraisable("allel.opt.stats.bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_TraceReturn(Py_None, 1);
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_119__pyx_fuse_4bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_119__pyx_fuse_4bisect_left = {"__pyx_fuse_4bisect_left", (PyCFunction)__pyx_pw_5allel_3opt_5stats_119__pyx_fuse_4bisect_left, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_16bisect_left};
    static PyObject *__pyx_pw_5allel_3opt_5stats_119__pyx_fuse_4bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_uint8_t __pyx_v_x;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_4bisect_left (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s,&__pyx_n_s_x,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_s)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_4bisect_left", 1, 2, 2, 1); __PYX_ERR(0, 337, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_4bisect_left") < 0)) __PYX_ERR(0, 337, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_s = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_s.memview)) __PYX_ERR(0, 337, __pyx_L3_error)
        __pyx_v_x = __Pyx_PyInt_As_npy_uint8(values[1]); if (unlikely((__pyx_v_x == ((npy_uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_4bisect_left", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 337, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_4bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_118__pyx_fuse_4bisect_left(__pyx_self, __pyx_v_s, __pyx_v_x);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_118__pyx_fuse_4bisect_left(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_s, __pyx_t_5numpy_uint8_t __pyx_v_x) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_4bisect_left", 0);
      __Pyx_TraceCall("__pyx_fuse_4bisect_left (wrapper)", __pyx_f[0], 337, 0, __PYX_ERR(0, 337, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_s.memview)) { __Pyx_RaiseUnboundLocalError("s"); __PYX_ERR(0, 337, __pyx_L1_error) }
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_fuse_4__pyx_f_5allel_3opt_5stats_bisect_left(__pyx_v_s, __pyx_v_x, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_4bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_121__pyx_fuse_5bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_17bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static CYTHON_INLINE Py_ssize_t __pyx_fuse_5__pyx_f_5allel_3opt_5stats_bisect_left(__Pyx_memviewslice __pyx_v_s, __pyx_t_5numpy_uint16_t __pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_l;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_m;
      __pyx_t_5numpy_uint16_t __pyx_v_v;
      Py_ssize_t __pyx_r;
      __Pyx_TraceDeclarations
      __Pyx_TraceCall("__pyx_fuse_5bisect_left", __pyx_f[0], 337, 1, __PYX_ERR(0, 337, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_WriteUnraisable("allel.opt.stats.bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_TraceReturn(Py_None, 1);
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_121__pyx_fuse_5bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_121__pyx_fuse_5bisect_left = {"__pyx_fuse_5bisect_left", (PyCFunction)__pyx_pw_5allel_3opt_5stats_121__pyx_fuse_5bisect_left, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_16bisect_left};
    static PyObject *__pyx_pw_5allel_3opt_5stats_121__pyx_fuse_5bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_uint16_t __pyx_v_x;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_5bisect_left (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s,&__pyx_n_s_x,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_s)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_5bisect_left", 1, 2, 2, 1); __PYX_ERR(0, 337, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_5bisect_left") < 0)) __PYX_ERR(0, 337, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_s = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(values[0]); if (unlikely(!__pyx_v_s.memview)) __PYX_ERR(0, 337, __pyx_L3_error)
        __pyx_v_x = __Pyx_PyInt_As_npy_uint16(values[1]); if (unlikely((__pyx_v_x == ((npy_uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_5bisect_left", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 337, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_5bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_120__pyx_fuse_5bisect_left(__pyx_self, __pyx_v_s, __pyx_v_x);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_120__pyx_fuse_5bisect_left(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_s, __pyx_t_5numpy_uint16_t __pyx_v_x) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_5bisect_left", 0);
      __Pyx_TraceCall("__pyx_fuse_5bisect_left (wrapper)", __pyx_f[0], 337, 0, __PYX_ERR(0, 337, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_s.memview)) { __Pyx_RaiseUnboundLocalError("s"); __PYX_ERR(0, 337, __pyx_L1_error) }
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_fuse_5__pyx_f_5allel_3opt_5stats_bisect_left(__pyx_v_s, __pyx_v_x, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_5bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_123__pyx_fuse_6bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_17bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static CYTHON_INLINE Py_ssize_t __pyx_fuse_6__pyx_f_5allel_3opt_5stats_bisect_left(__Pyx_memviewslice __pyx_v_s, __pyx_t_5numpy_uint32_t __pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_l;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_m;
      __pyx_t_5numpy_uint32_t __pyx_v_v;
      Py_ssize_t __pyx_r;
      __Pyx_TraceDeclarations
      __Pyx_TraceCall("__pyx_fuse_6bisect_left", __pyx_f[0], 337, 1, __PYX_ERR(0, 337, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_WriteUnraisable("allel.opt.stats.bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_TraceReturn(Py_None, 1);
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_123__pyx_fuse_6bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_123__pyx_fuse_6bisect_left = {"__pyx_fuse_6bisect_left", (PyCFunction)__pyx_pw_5allel_3opt_5stats_123__pyx_fuse_6bisect_left, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_16bisect_left};
    static PyObject *__pyx_pw_5allel_3opt_5stats_123__pyx_fuse_6bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_uint32_t __pyx_v_x;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_6bisect_left (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s,&__pyx_n_s_x,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_s)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_6bisect_left", 1, 2, 2, 1); __PYX_ERR(0, 337, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_6bisect_left") < 0)) __PYX_ERR(0, 337, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_s = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[0]); if (unlikely(!__pyx_v_s.memview)) __PYX_ERR(0, 337, __pyx_L3_error)
        __pyx_v_x = __Pyx_PyInt_As_npy_uint32(values[1]); if (unlikely((__pyx_v_x == ((npy_uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_6bisect_left", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 337, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_6bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_122__pyx_fuse_6bisect_left(__pyx_self, __pyx_v_s, __pyx_v_x);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_122__pyx_fuse_6bisect_left(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_s, __pyx_t_5numpy_uint32_t __pyx_v_x) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_6bisect_left", 0);
      __Pyx_TraceCall("__pyx_fuse_6bisect_left (wrapper)", __pyx_f[0], 337, 0, __PYX_ERR(0, 337, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_s.memview)) { __Pyx_RaiseUnboundLocalError("s"); __PYX_ERR(0, 337, __pyx_L1_error) }
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_fuse_6__pyx_f_5allel_3opt_5stats_bisect_left(__pyx_v_s, __pyx_v_x, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_6bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pw_5allel_3opt_5stats_125__pyx_fuse_7bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_5allel_3opt_5stats_17bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static CYTHON_INLINE Py_ssize_t __pyx_fuse_7__pyx_f_5allel_3opt_5stats_bisect_left(__Pyx_memviewslice __pyx_v_s, __pyx_t_5numpy_uint64_t __pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) {
      Py_ssize_t __pyx_v_l;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_m;
      __pyx_t_5numpy_uint64_t __pyx_v_v;
      Py_ssize_t __pyx_r;
      __Pyx_TraceDeclarations
      __Pyx_TraceCall("__pyx_fuse_7bisect_left", __pyx_f[0], 337, 1, __PYX_ERR(0, 337, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_WriteUnraisable("allel.opt.stats.bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_TraceReturn(Py_None, 1);
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_125__pyx_fuse_7bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_125__pyx_fuse_7bisect_left = {"__pyx_fuse_7bisect_left", (PyCFunction)__pyx_pw_5allel_3opt_5stats_125__pyx_fuse_7bisect_left, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_16bisect_left};
    static PyObject *__pyx_pw_5allel_3opt_5stats_125__pyx_fuse_7bisect_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_uint64_t __pyx_v_x;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_7bisect_left (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s,&__pyx_n_s_x,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_s)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fuse_7bisect_left", 1, 2, 2, 1); __PYX_ERR(0, 337, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fuse_7bisect_left") < 0)) __PYX_ERR(0, 337, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_s = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(values[0]); if (unlikely(!__pyx_v_s.memview)) __PYX_ERR(0, 337, __pyx_L3_error)
        __pyx_v_x = __Pyx_PyInt_As_npy_uint64(values[1]); if (unlikely((__pyx_v_x == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fuse_7bisect_left", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 337, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_7bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_124__pyx_fuse_7bisect_left(__pyx_self, __pyx_v_s, __pyx_v_x);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_124__pyx_fuse_7bisect_left(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_s, __pyx_t_5numpy_uint64_t __pyx_v_x) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_7bisect_left", 0);
      __Pyx_TraceCall("__pyx_fuse_7bisect_left (wrapper)", __pyx_f[0], 337, 0, __PYX_ERR(0, 337, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_s.memview)) { __Pyx_RaiseUnboundLocalError("s"); __PYX_ERR(0, 337, __pyx_L1_error) }
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_fuse_7__pyx_f_5allel_3opt_5stats_bisect_left(__pyx_v_s, __pyx_v_x, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fuse_7bisect_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
      __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__27);
      __Pyx_GIVEREF(__pyx_tuple__27);
    /* … */
      __pyx_tuple__117 = PyTuple_Pack(2, __pyx_n_s_s, __pyx_n_s_x); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__117);
      __Pyx_GIVEREF(__pyx_tuple__117);
    /* … */
      __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_111__pyx_fuse_0bisect_left, 0, __pyx_n_s_pyx_fuse_0bisect_left, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_int8_t, __pyx_t_12) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_113__pyx_fuse_1bisect_left, 0, __pyx_n_s_pyx_fuse_1bisect_left, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_int16_t, __pyx_t_12) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_115__pyx_fuse_2bisect_left, 0, __pyx_n_s_pyx_fuse_2bisect_left, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_int32_t, __pyx_t_12) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_117__pyx_fuse_3bisect_left, 0, __pyx_n_s_pyx_fuse_3bisect_left, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_int64_t, __pyx_t_12) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_119__pyx_fuse_4bisect_left, 0, __pyx_n_s_pyx_fuse_4bisect_left, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_uint8_t, __pyx_t_12) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_121__pyx_fuse_5bisect_left, 0, __pyx_n_s_pyx_fuse_5bisect_left, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_uint16_t, __pyx_t_12) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_123__pyx_fuse_6bisect_left, 0, __pyx_n_s_pyx_fuse_6bisect_left, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_uint32_t, __pyx_t_12) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_125__pyx_fuse_7bisect_left, 0, __pyx_n_s_pyx_fuse_7bisect_left, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_uint64_t, __pyx_t_12) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = __pyx_FusedFunction_NewEx(&__pyx_mdef_5allel_3opt_5stats_17bisect_left, 0, __pyx_n_s_bisect_left, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_empty_tuple);
      ((__pyx_FusedFunctionObject *) __pyx_t_12)->__signatures__ = __pyx_t_11;
      __Pyx_GIVEREF(__pyx_t_11);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_bisect_left, __pyx_t_12) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aliman_src_github_cggh_sci, __pyx_n_s_pyx_fuse_0bisect_left, 337, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(0, 337, __pyx_L1_error)

     0338:     """Optimized implementation of bisect_left."""

     0339:     cdef:

     0340:         Py_ssize_t l, u, m

     0341:         integer v

     0342:

     0343:     # initialise

    +0344:     l = 0  # lower index

      __pyx_v_l = 0;
    /* … */
      __pyx_v_l = 0;
    /* … */
      __pyx_v_l = 0;
    /* … */
      __pyx_v_l = 0;
    /* … */
      __pyx_v_l = 0;
    /* … */
      __pyx_v_l = 0;
    /* … */
      __pyx_v_l = 0;
    /* … */
      __pyx_v_l = 0;

    +0345:     u = s.shape[0]  # upper index

      __pyx_v_u = (__pyx_v_s.shape[0]);
    /* … */
      __pyx_v_u = (__pyx_v_s.shape[0]);
    /* … */
      __pyx_v_u = (__pyx_v_s.shape[0]);
    /* … */
      __pyx_v_u = (__pyx_v_s.shape[0]);
    /* … */
      __pyx_v_u = (__pyx_v_s.shape[0]);
    /* … */
      __pyx_v_u = (__pyx_v_s.shape[0]);
    /* … */
      __pyx_v_u = (__pyx_v_s.shape[0]);
    /* … */
      __pyx_v_u = (__pyx_v_s.shape[0]);

     0346:

     0347:     # bisect

    +0348:     while (u - l) > 1:

      while (1) {
        __pyx_t_1 = (((__pyx_v_u - __pyx_v_l) > 1) != 0);
        if (!__pyx_t_1) break;
    /* … */
      while (1) {
        __pyx_t_1 = (((__pyx_v_u - __pyx_v_l) > 1) != 0);
        if (!__pyx_t_1) break;
    /* … */
      while (1) {
        __pyx_t_1 = (((__pyx_v_u - __pyx_v_l) > 1) != 0);
        if (!__pyx_t_1) break;
    /* … */
      while (1) {
        __pyx_t_1 = (((__pyx_v_u - __pyx_v_l) > 1) != 0);
        if (!__pyx_t_1) break;
    /* … */
      while (1) {
        __pyx_t_1 = (((__pyx_v_u - __pyx_v_l) > 1) != 0);
        if (!__pyx_t_1) break;
    /* … */
      while (1) {
        __pyx_t_1 = (((__pyx_v_u - __pyx_v_l) > 1) != 0);
        if (!__pyx_t_1) break;
    /* … */
      while (1) {
        __pyx_t_1 = (((__pyx_v_u - __pyx_v_l) > 1) != 0);
        if (!__pyx_t_1) break;
    /* … */
      while (1) {
        __pyx_t_1 = (((__pyx_v_u - __pyx_v_l) > 1) != 0);
        if (!__pyx_t_1) break;

    +0349:         m = (u + l) // 2

        __pyx_v_m = __Pyx_div_Py_ssize_t((__pyx_v_u + __pyx_v_l), 2);
    /* … */
        __pyx_v_m = __Pyx_div_Py_ssize_t((__pyx_v_u + __pyx_v_l), 2);
    /* … */
        __pyx_v_m = __Pyx_div_Py_ssize_t((__pyx_v_u + __pyx_v_l), 2);
    /* … */
        __pyx_v_m = __Pyx_div_Py_ssize_t((__pyx_v_u + __pyx_v_l), 2);
    /* … */
        __pyx_v_m = __Pyx_div_Py_ssize_t((__pyx_v_u + __pyx_v_l), 2);
    /* … */
        __pyx_v_m = __Pyx_div_Py_ssize_t((__pyx_v_u + __pyx_v_l), 2);
    /* … */
        __pyx_v_m = __Pyx_div_Py_ssize_t((__pyx_v_u + __pyx_v_l), 2);
    /* … */
        __pyx_v_m = __Pyx_div_Py_ssize_t((__pyx_v_u + __pyx_v_l), 2);

    +0350:         v = s[m]

        __pyx_t_2 = __pyx_v_m;
        __pyx_v_v = (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_s.data + __pyx_t_2 * __pyx_v_s.strides[0]) )));
    /* … */
        __pyx_t_2 = __pyx_v_m;
        __pyx_v_v = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_s.data + __pyx_t_2 * __pyx_v_s.strides[0]) )));
    /* … */
        __pyx_t_2 = __pyx_v_m;
        __pyx_v_v = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_s.data + __pyx_t_2 * __pyx_v_s.strides[0]) )));
    /* … */
        __pyx_t_2 = __pyx_v_m;
        __pyx_v_v = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_s.data + __pyx_t_2 * __pyx_v_s.strides[0]) )));
    /* … */
        __pyx_t_2 = __pyx_v_m;
        __pyx_v_v = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_s.data + __pyx_t_2 * __pyx_v_s.strides[0]) )));
    /* … */
        __pyx_t_2 = __pyx_v_m;
        __pyx_v_v = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_s.data + __pyx_t_2 * __pyx_v_s.strides[0]) )));
    /* … */
        __pyx_t_2 = __pyx_v_m;
        __pyx_v_v = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_s.data + __pyx_t_2 * __pyx_v_s.strides[0]) )));
    /* … */
        __pyx_t_2 = __pyx_v_m;
        __pyx_v_v = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_s.data + __pyx_t_2 * __pyx_v_s.strides[0]) )));

    +0351:         if v >= x:

        __pyx_t_1 = ((__pyx_v_v >= __pyx_v_x) != 0);
        if (__pyx_t_1) {
    /* … */
          goto __pyx_L5;
        }
    /* … */
        __pyx_t_1 = ((__pyx_v_v >= __pyx_v_x) != 0);
        if (__pyx_t_1) {
    /* … */
          goto __pyx_L5;
        }
    /* … */
        __pyx_t_1 = ((__pyx_v_v >= __pyx_v_x) != 0);
        if (__pyx_t_1) {
    /* … */
          goto __pyx_L5;
        }
    /* … */
        __pyx_t_1 = ((__pyx_v_v >= __pyx_v_x) != 0);
        if (__pyx_t_1) {
    /* … */
          goto __pyx_L5;
        }
    /* … */
        __pyx_t_1 = ((__pyx_v_v >= __pyx_v_x) != 0);
        if (__pyx_t_1) {
    /* … */
          goto __pyx_L5;
        }
    /* … */
        __pyx_t_1 = ((__pyx_v_v >= __pyx_v_x) != 0);
        if (__pyx_t_1) {
    /* … */
          goto __pyx_L5;
        }
    /* … */
        __pyx_t_1 = ((__pyx_v_v >= __pyx_v_x) != 0);
        if (__pyx_t_1) {
    /* … */
          goto __pyx_L5;
        }
    /* … */
        __pyx_t_1 = ((__pyx_v_v >= __pyx_v_x) != 0);
        if (__pyx_t_1) {
    /* … */
          goto __pyx_L5;
        }

    +0352:             u = m

          __pyx_v_u = __pyx_v_m;
    /* … */
          __pyx_v_u = __pyx_v_m;
    /* … */
          __pyx_v_u = __pyx_v_m;
    /* … */
          __pyx_v_u = __pyx_v_m;
    /* … */
          __pyx_v_u = __pyx_v_m;
    /* … */
          __pyx_v_u = __pyx_v_m;
    /* … */
          __pyx_v_u = __pyx_v_m;
    /* … */
          __pyx_v_u = __pyx_v_m;

     0353:         else:

    +0354:             l = m

        /*else*/ {
          __pyx_v_l = __pyx_v_m;
        }
        __pyx_L5:;
      }
    /* … */
        /*else*/ {
          __pyx_v_l = __pyx_v_m;
        }
        __pyx_L5:;
      }
    /* … */
        /*else*/ {
          __pyx_v_l = __pyx_v_m;
        }
        __pyx_L5:;
      }
    /* … */
        /*else*/ {
          __pyx_v_l = __pyx_v_m;
        }
        __pyx_L5:;
      }
    /* … */
        /*else*/ {
          __pyx_v_l = __pyx_v_m;
        }
        __pyx_L5:;
      }
    /* … */
        /*else*/ {
          __pyx_v_l = __pyx_v_m;
        }
        __pyx_L5:;
      }
    /* … */
        /*else*/ {
          __pyx_v_l = __pyx_v_m;
        }
        __pyx_L5:;
      }
    /* … */
        /*else*/ {
          __pyx_v_l = __pyx_v_m;
        }
        __pyx_L5:;
      }

     0355:

     0356:     # check boundary condition

    +0357:     if s[l] >= x:

      __pyx_t_3 = __pyx_v_l;
      __pyx_t_1 = (((*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_s.data + __pyx_t_3 * __pyx_v_s.strides[0]) ))) >= __pyx_v_x) != 0);
      if (__pyx_t_1) {
    /* … */
      }
    /* … */
      __pyx_t_3 = __pyx_v_l;
      __pyx_t_1 = (((*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_s.data + __pyx_t_3 * __pyx_v_s.strides[0]) ))) >= __pyx_v_x) != 0);
      if (__pyx_t_1) {
    /* … */
      }
    /* … */
      __pyx_t_3 = __pyx_v_l;
      __pyx_t_1 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_s.data + __pyx_t_3 * __pyx_v_s.strides[0]) ))) >= __pyx_v_x) != 0);
      if (__pyx_t_1) {
    /* … */
      }
    /* … */
      __pyx_t_3 = __pyx_v_l;
      __pyx_t_1 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_s.data + __pyx_t_3 * __pyx_v_s.strides[0]) ))) >= __pyx_v_x) != 0);
      if (__pyx_t_1) {
    /* … */
      }
    /* … */
      __pyx_t_3 = __pyx_v_l;
      __pyx_t_1 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_s.data + __pyx_t_3 * __pyx_v_s.strides[0]) ))) >= __pyx_v_x) != 0);
      if (__pyx_t_1) {
    /* … */
      }
    /* … */
      __pyx_t_3 = __pyx_v_l;
      __pyx_t_1 = (((*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_s.data + __pyx_t_3 * __pyx_v_s.strides[0]) ))) >= __pyx_v_x) != 0);
      if (__pyx_t_1) {
    /* … */
      }
    /* … */
      __pyx_t_3 = __pyx_v_l;
      __pyx_t_1 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_s.data + __pyx_t_3 * __pyx_v_s.strides[0]) ))) >= __pyx_v_x) != 0);
      if (__pyx_t_1) {
    /* … */
      }
    /* … */
      __pyx_t_3 = __pyx_v_l;
      __pyx_t_1 = (((*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_s.data + __pyx_t_3 * __pyx_v_s.strides[0]) ))) >= __pyx_v_x) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +0358:         return l

        __pyx_r = __pyx_v_l;
        goto __pyx_L0;
    /* … */
        __pyx_r = __pyx_v_l;
        goto __pyx_L0;
    /* … */
        __pyx_r = __pyx_v_l;
        goto __pyx_L0;
    /* … */
        __pyx_r = __pyx_v_l;
        goto __pyx_L0;
    /* … */
        __pyx_r = __pyx_v_l;
        goto __pyx_L0;
    /* … */
        __pyx_r = __pyx_v_l;
        goto __pyx_L0;
    /* … */
        __pyx_r = __pyx_v_l;
        goto __pyx_L0;
    /* … */
        __pyx_r = __pyx_v_l;
        goto __pyx_L0;

     0359:

    +0360:     return u

      __pyx_r = __pyx_v_u;
      goto __pyx_L0;
    /* … */
      __pyx_r = __pyx_v_u;
      goto __pyx_L0;
    /* … */
      __pyx_r = __pyx_v_u;
      goto __pyx_L0;
    /* … */
      __pyx_r = __pyx_v_u;
      goto __pyx_L0;
    /* … */
      __pyx_r = __pyx_v_u;
      goto __pyx_L0;
    /* … */
      __pyx_r = __pyx_v_u;
      goto __pyx_L0;
    /* … */
      __pyx_r = __pyx_v_u;
      goto __pyx_L0;
    /* … */
      __pyx_r = __pyx_v_u;
      goto __pyx_L0;

     0361:

     0362:

     0363: @cython.boundscheck(False)

     0364: @cython.wraparound(False)

    +0365: def paint_shared_prefixes(integer[:, :] h):

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_19paint_shared_prefixes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_5allel_3opt_5stats_18paint_shared_prefixes[] = "Paint each shared prefix with a different number. N.B., `h` must be\n    already sorted by prefix.\n\n    ";
    static PyMethodDef __pyx_mdef_5allel_3opt_5stats_19paint_shared_prefixes = {"paint_shared_prefixes", (PyCFunction)__pyx_pw_5allel_3opt_5stats_19paint_shared_prefixes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_18paint_shared_prefixes};
    static PyObject *__pyx_pw_5allel_3opt_5stats_19paint_shared_prefixes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_signatures = 0;
      PyObject *__pyx_v_args = 0;
      PyObject *__pyx_v_kwargs = 0;
      CYTHON_UNUSED PyObject *__pyx_v_defaults = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0};
        PyObject* values[4] = {0,0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 365, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 365, __pyx_L3_error)
            }
            case  3:
            if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 365, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 365, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        }
        __pyx_v_signatures = values[0];
        __pyx_v_args = values[1];
        __pyx_v_kwargs = values[2];
        __pyx_v_defaults = values[3];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 365, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_18paint_shared_prefixes(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_18paint_shared_prefixes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
      PyObject *__pyx_v_dest_sig = NULL;
      PyTypeObject *__pyx_v_ndarray = 0;
      PyObject *__pyx_v_numpy = NULL;
      __Pyx_memviewslice __pyx_v_memslice;
      Py_ssize_t __pyx_v_itemsize;
      int __pyx_v_dtype_signed;
      char __pyx_v_kind;
      int __pyx_v____pyx_int32_t_is_signed;
      int __pyx_v____pyx_uint32_t_is_signed;
      int __pyx_v____pyx_uint64_t_is_signed;
      int __pyx_v____pyx_uint16_t_is_signed;
      int __pyx_v____pyx_int16_t_is_signed;
      int __pyx_v____pyx_uint8_t_is_signed;
      int __pyx_v____pyx_int64_t_is_signed;
      int __pyx_v____pyx_int8_t_is_signed;
      PyObject *__pyx_v_arg = NULL;
      PyObject *__pyx_v_dtype = NULL;
      PyObject *__pyx_v_arg_base = NULL;
      PyObject *__pyx_v_candidates = NULL;
      PyObject *__pyx_v_sig = NULL;
      int __pyx_v_match_found;
      PyObject *__pyx_v_src_type = NULL;
      PyObject *__pyx_v_dst_type = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("paint_shared_prefixes", 0);
      __Pyx_TraceCall("paint_shared_prefixes", __pyx_f[0], 365, 0, __PYX_ERR(0, 365, __pyx_L1_error));
      __Pyx_INCREF(__pyx_v_kwargs);
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
      __pyx_v_dest_sig = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_2 = (__pyx_v_kwargs == Py_None);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {
        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1);
        __pyx_t_1 = 0;
      }
      {
        /*try:*/ {
          __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_v_numpy = __pyx_t_1;
          __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 365, __pyx_L4_error)
          __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1);
          __pyx_t_1 = 0;
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L11_try_end;
        __pyx_L4_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
        if (__pyx_t_7) {
          __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 365, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_INCREF(Py_None);
          __Pyx_XDECREF_SET(__pyx_v_ndarray, ((PyTypeObject*)Py_None));
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L5_exception_handled;
        }
        goto __pyx_L6_except_error;
        __pyx_L6_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L1_error;
        __pyx_L5_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        __pyx_L11_try_end:;
      }
      __pyx_v_itemsize = -1L;
      __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1L) < 0);
      __pyx_v____pyx_uint32_t_is_signed = (((__pyx_t_5numpy_uint32_t)-1L) < 0);
      __pyx_v____pyx_uint64_t_is_signed = (((__pyx_t_5numpy_uint64_t)-1L) < 0);
      __pyx_v____pyx_uint16_t_is_signed = (((__pyx_t_5numpy_uint16_t)-1L) < 0);
      __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1L) < 0);
      __pyx_v____pyx_uint8_t_is_signed = (((__pyx_t_5numpy_uint8_t)-1L) < 0);
      __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1L) < 0);
      __pyx_v____pyx_int8_t_is_signed = (((__pyx_t_5numpy_int8_t)-1L) < 0);
      if (unlikely(__pyx_v_args == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 365, __pyx_L1_error)
      }
      __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 365, __pyx_L1_error)
      __pyx_t_3 = ((0 < __pyx_t_10) != 0);
      if (__pyx_t_3) {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 365, __pyx_L1_error)
        }
        __pyx_t_9 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      if (unlikely(__pyx_v_kwargs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 365, __pyx_L1_error)
      }
      __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_h, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {
        if (unlikely(__pyx_v_kwargs == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 365, __pyx_L1_error)
        }
        __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_h); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 365, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      /*else*/ {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(0, 365, __pyx_L1_error)
        }
        __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 365, __pyx_L1_error)
        __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 365, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 365, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 365, __pyx_L1_error)
      }
      __pyx_L14:;
      while (1) {
        __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None));
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {
          __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_dtype = __pyx_t_8;
            __pyx_t_8 = 0;
            goto __pyx_L18;
          }
          __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_arg_base = __pyx_t_8;
            __pyx_t_8 = 0;
            __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
            __pyx_t_2 = (__pyx_t_3 != 0);
            if (__pyx_t_2) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_v_dtype = __pyx_t_8;
              __pyx_t_8 = 0;
              goto __pyx_L19;
            }
            /*else*/ {
              __Pyx_INCREF(Py_None);
              __pyx_v_dtype = Py_None;
            }
            __pyx_L19:;
            goto __pyx_L18;
          }
          /*else*/ {
            __Pyx_INCREF(Py_None);
            __pyx_v_dtype = Py_None;
          }
          __pyx_L18:;
          __pyx_v_itemsize = -1L;
          __pyx_t_2 = (__pyx_v_dtype != Py_None);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_itemsize = __pyx_t_10;
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 365, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_kind = __pyx_t_11;
            __pyx_v_dtype_signed = (__pyx_v_kind == 'i');
            switch (__pyx_v_kind) {
              case 'i':
              case 'u':
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L22_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L26_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L30_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L34_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L38_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L42_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L46_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L50_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              break;
              case 'f':
              break;
              case 'c':
              break;
              case 'O':
              break;
              default: break;
            }
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L54_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L54_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L58_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L58_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L62_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L62_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L66_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L66_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L70_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L70_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L74_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L74_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L78_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L78_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L82_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L82_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
        goto __pyx_L16_break;
      }
      __pyx_L16_break:;
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_candidates = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_10 = 0;
      if (unlikely(__pyx_v_signatures == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 365, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8);
      __pyx_t_8 = __pyx_t_9;
      __pyx_t_9 = 0;
      while (1) {
        __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_13, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7);
        if (unlikely(__pyx_t_14 == 0)) break;
        if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 365, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_v_match_found = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 365, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 365, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /* … */
      __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__28);
      __Pyx_GIVEREF(__pyx_tuple__28);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 365, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
        __Pyx_INCREF(__pyx_v_dest_sig);
        __Pyx_GIVEREF(__pyx_v_dest_sig);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dest_sig);
        __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
          __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_15 = 0;
          __pyx_t_16 = NULL;
        } else {
          __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 365, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 365, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        for (;;) {
          if (likely(!__pyx_t_16)) {
            if (likely(PyList_CheckExact(__pyx_t_9))) {
              if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            } else {
              if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            }
          } else {
            __pyx_t_1 = __pyx_t_16(__pyx_t_9);
            if (unlikely(!__pyx_t_1)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 365, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_1);
          }
          if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
            PyObject* sequence = __pyx_t_1;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 365, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1);
            } else {
              __pyx_t_17 = PyList_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyList_GET_ITEM(sequence, 1);
            }
            __Pyx_INCREF(__pyx_t_17);
            __Pyx_INCREF(__pyx_t_18);
            #else
            __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 365, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 365, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_18);
            #endif
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 365, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
            index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_17);
            index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_18);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
            __pyx_t_20 = NULL;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            goto __pyx_L90_unpacking_done;
            __pyx_L89_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __pyx_t_20 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 365, __pyx_L1_error)
            __pyx_L90_unpacking_done:;
          }
          __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17);
          __pyx_t_17 = 0;
          __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18);
          __pyx_t_18 = 0;
          __pyx_t_3 = (__pyx_v_dst_type != Py_None);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 365, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (__pyx_t_2) {
              __pyx_v_match_found = 1;
              goto __pyx_L92;
            }
            /*else*/ {
              __pyx_v_match_found = 0;
              goto __pyx_L88_break;
            }
            __pyx_L92:;
          }
        }
        __pyx_L88_break:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_2 = (__pyx_v_match_found != 0);
        if (__pyx_t_2) {
          __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 365, __pyx_L1_error)
        }
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
      __pyx_t_3 = ((!__pyx_t_2) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s__8); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__29);
      __Pyx_GIVEREF(__pyx_tuple__29);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 365, __pyx_L1_error)
      }
      __pyx_t_13 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 365, __pyx_L1_error)
      __pyx_t_3 = ((__pyx_t_13 > 1) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__30);
      __Pyx_GIVEREF(__pyx_tuple__30);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 365, __pyx_L1_error)
      }
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_signatures == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 365, __pyx_L1_error)
        }
        __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        goto __pyx_L0;
      }

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_dest_sig);
      __Pyx_XDECREF(__pyx_v_ndarray);
      __Pyx_XDECREF(__pyx_v_numpy);
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XDECREF(__pyx_v_dtype);
      __Pyx_XDECREF(__pyx_v_arg_base);
      __Pyx_XDECREF(__pyx_v_candidates);
      __Pyx_XDECREF(__pyx_v_sig);
      __Pyx_XDECREF(__pyx_v_src_type);
      __Pyx_XDECREF(__pyx_v_dst_type);
      __Pyx_XDECREF(__pyx_v_kwargs);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_129paint_shared_prefixes(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_129paint_shared_prefixes = {"__pyx_fuse_0paint_shared_prefixes", (PyCFunction)__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_129paint_shared_prefixes, METH_O, __pyx_doc_5allel_3opt_5stats_18paint_shared_prefixes};
    static PyObject *__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_129paint_shared_prefixes(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("paint_shared_prefixes (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 365, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.paint_shared_prefixes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_128paint_shared_prefixes(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_128paint_shared_prefixes(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_pp_start;
      Py_ssize_t __pyx_v_pp_stop;
      Py_ssize_t __pyx_v_pp_size;
      Py_ssize_t __pyx_v_n0;
      Py_ssize_t __pyx_v_n1;
      __pyx_t_5numpy_int32_t __pyx_v_pp_color;
      __pyx_t_5numpy_int32_t __pyx_v_next_color;
      __Pyx_memviewslice __pyx_v_painting = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_prefixes = NULL;
      Py_ssize_t __pyx_v_i;
      PyObject *__pyx_v_parent_prefixes = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_0paint_shared_prefixes", 0);
      __Pyx_TraceCall("__pyx_fuse_0paint_shared_prefixes", __pyx_f[0], 365, 0, __PYX_ERR(0, 365, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_12);
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_25, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_26, 1);
      __Pyx_AddTraceback("allel.opt.stats.paint_shared_prefixes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_painting, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
      __Pyx_XDECREF(__pyx_v_prefixes);
      __Pyx_XDECREF(__pyx_v_parent_prefixes);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_131paint_shared_prefixes(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_131paint_shared_prefixes = {"__pyx_fuse_1paint_shared_prefixes", (PyCFunction)__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_131paint_shared_prefixes, METH_O, __pyx_doc_5allel_3opt_5stats_18paint_shared_prefixes};
    static PyObject *__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_131paint_shared_prefixes(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("paint_shared_prefixes (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 365, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.paint_shared_prefixes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_130paint_shared_prefixes(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_130paint_shared_prefixes(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_pp_start;
      Py_ssize_t __pyx_v_pp_stop;
      Py_ssize_t __pyx_v_pp_size;
      Py_ssize_t __pyx_v_n0;
      Py_ssize_t __pyx_v_n1;
      __pyx_t_5numpy_int32_t __pyx_v_pp_color;
      __pyx_t_5numpy_int32_t __pyx_v_next_color;
      __Pyx_memviewslice __pyx_v_painting = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_prefixes = NULL;
      Py_ssize_t __pyx_v_i;
      PyObject *__pyx_v_parent_prefixes = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_1paint_shared_prefixes", 0);
      __Pyx_TraceCall("__pyx_fuse_1paint_shared_prefixes", __pyx_f[0], 365, 0, __PYX_ERR(0, 365, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_12);
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_25, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_26, 1);
      __Pyx_AddTraceback("allel.opt.stats.paint_shared_prefixes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_painting, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
      __Pyx_XDECREF(__pyx_v_prefixes);
      __Pyx_XDECREF(__pyx_v_parent_prefixes);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_133paint_shared_prefixes(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_133paint_shared_prefixes = {"__pyx_fuse_2paint_shared_prefixes", (PyCFunction)__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_133paint_shared_prefixes, METH_O, __pyx_doc_5allel_3opt_5stats_18paint_shared_prefixes};
    static PyObject *__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_133paint_shared_prefixes(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("paint_shared_prefixes (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 365, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.paint_shared_prefixes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_132paint_shared_prefixes(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_132paint_shared_prefixes(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_pp_start;
      Py_ssize_t __pyx_v_pp_stop;
      Py_ssize_t __pyx_v_pp_size;
      Py_ssize_t __pyx_v_n0;
      Py_ssize_t __pyx_v_n1;
      __pyx_t_5numpy_int32_t __pyx_v_pp_color;
      __pyx_t_5numpy_int32_t __pyx_v_next_color;
      __Pyx_memviewslice __pyx_v_painting = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_prefixes = NULL;
      Py_ssize_t __pyx_v_i;
      PyObject *__pyx_v_parent_prefixes = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_2paint_shared_prefixes", 0);
      __Pyx_TraceCall("__pyx_fuse_2paint_shared_prefixes", __pyx_f[0], 365, 0, __PYX_ERR(0, 365, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_12);
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_25, 1);
      __Pyx_AddTraceback("allel.opt.stats.paint_shared_prefixes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_painting, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
      __Pyx_XDECREF(__pyx_v_prefixes);
      __Pyx_XDECREF(__pyx_v_parent_prefixes);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_135paint_shared_prefixes(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_135paint_shared_prefixes = {"__pyx_fuse_3paint_shared_prefixes", (PyCFunction)__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_135paint_shared_prefixes, METH_O, __pyx_doc_5allel_3opt_5stats_18paint_shared_prefixes};
    static PyObject *__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_135paint_shared_prefixes(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("paint_shared_prefixes (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 365, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.paint_shared_prefixes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_134paint_shared_prefixes(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_134paint_shared_prefixes(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_pp_start;
      Py_ssize_t __pyx_v_pp_stop;
      Py_ssize_t __pyx_v_pp_size;
      Py_ssize_t __pyx_v_n0;
      Py_ssize_t __pyx_v_n1;
      __pyx_t_5numpy_int32_t __pyx_v_pp_color;
      __pyx_t_5numpy_int32_t __pyx_v_next_color;
      __Pyx_memviewslice __pyx_v_painting = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_prefixes = NULL;
      Py_ssize_t __pyx_v_i;
      PyObject *__pyx_v_parent_prefixes = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_3paint_shared_prefixes", 0);
      __Pyx_TraceCall("__pyx_fuse_3paint_shared_prefixes", __pyx_f[0], 365, 0, __PYX_ERR(0, 365, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_12);
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_25, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_26, 1);
      __Pyx_AddTraceback("allel.opt.stats.paint_shared_prefixes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_painting, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
      __Pyx_XDECREF(__pyx_v_prefixes);
      __Pyx_XDECREF(__pyx_v_parent_prefixes);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_137paint_shared_prefixes(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_137paint_shared_prefixes = {"__pyx_fuse_4paint_shared_prefixes", (PyCFunction)__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_137paint_shared_prefixes, METH_O, __pyx_doc_5allel_3opt_5stats_18paint_shared_prefixes};
    static PyObject *__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_137paint_shared_prefixes(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("paint_shared_prefixes (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 365, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.paint_shared_prefixes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_136paint_shared_prefixes(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_136paint_shared_prefixes(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_pp_start;
      Py_ssize_t __pyx_v_pp_stop;
      Py_ssize_t __pyx_v_pp_size;
      Py_ssize_t __pyx_v_n0;
      Py_ssize_t __pyx_v_n1;
      __pyx_t_5numpy_int32_t __pyx_v_pp_color;
      __pyx_t_5numpy_int32_t __pyx_v_next_color;
      __Pyx_memviewslice __pyx_v_painting = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_prefixes = NULL;
      Py_ssize_t __pyx_v_i;
      PyObject *__pyx_v_parent_prefixes = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_4paint_shared_prefixes", 0);
      __Pyx_TraceCall("__pyx_fuse_4paint_shared_prefixes", __pyx_f[0], 365, 0, __PYX_ERR(0, 365, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_12);
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_25, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_26, 1);
      __Pyx_AddTraceback("allel.opt.stats.paint_shared_prefixes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_painting, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
      __Pyx_XDECREF(__pyx_v_prefixes);
      __Pyx_XDECREF(__pyx_v_parent_prefixes);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_139paint_shared_prefixes(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_139paint_shared_prefixes = {"__pyx_fuse_5paint_shared_prefixes", (PyCFunction)__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_139paint_shared_prefixes, METH_O, __pyx_doc_5allel_3opt_5stats_18paint_shared_prefixes};
    static PyObject *__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_139paint_shared_prefixes(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("paint_shared_prefixes (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint16_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 365, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.paint_shared_prefixes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_138paint_shared_prefixes(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_138paint_shared_prefixes(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_pp_start;
      Py_ssize_t __pyx_v_pp_stop;
      Py_ssize_t __pyx_v_pp_size;
      Py_ssize_t __pyx_v_n0;
      Py_ssize_t __pyx_v_n1;
      __pyx_t_5numpy_int32_t __pyx_v_pp_color;
      __pyx_t_5numpy_int32_t __pyx_v_next_color;
      __Pyx_memviewslice __pyx_v_painting = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_prefixes = NULL;
      Py_ssize_t __pyx_v_i;
      PyObject *__pyx_v_parent_prefixes = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_5paint_shared_prefixes", 0);
      __Pyx_TraceCall("__pyx_fuse_5paint_shared_prefixes", __pyx_f[0], 365, 0, __PYX_ERR(0, 365, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_12);
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_25, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_26, 1);
      __Pyx_AddTraceback("allel.opt.stats.paint_shared_prefixes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_painting, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
      __Pyx_XDECREF(__pyx_v_prefixes);
      __Pyx_XDECREF(__pyx_v_parent_prefixes);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_141paint_shared_prefixes(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_141paint_shared_prefixes = {"__pyx_fuse_6paint_shared_prefixes", (PyCFunction)__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_141paint_shared_prefixes, METH_O, __pyx_doc_5allel_3opt_5stats_18paint_shared_prefixes};
    static PyObject *__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_141paint_shared_prefixes(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("paint_shared_prefixes (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 365, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.paint_shared_prefixes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_140paint_shared_prefixes(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_140paint_shared_prefixes(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_pp_start;
      Py_ssize_t __pyx_v_pp_stop;
      Py_ssize_t __pyx_v_pp_size;
      Py_ssize_t __pyx_v_n0;
      Py_ssize_t __pyx_v_n1;
      __pyx_t_5numpy_int32_t __pyx_v_pp_color;
      __pyx_t_5numpy_int32_t __pyx_v_next_color;
      __Pyx_memviewslice __pyx_v_painting = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_prefixes = NULL;
      Py_ssize_t __pyx_v_i;
      PyObject *__pyx_v_parent_prefixes = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_6paint_shared_prefixes", 0);
      __Pyx_TraceCall("__pyx_fuse_6paint_shared_prefixes", __pyx_f[0], 365, 0, __PYX_ERR(0, 365, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_12);
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_25, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_26, 1);
      __Pyx_AddTraceback("allel.opt.stats.paint_shared_prefixes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_painting, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
      __Pyx_XDECREF(__pyx_v_prefixes);
      __Pyx_XDECREF(__pyx_v_parent_prefixes);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_143paint_shared_prefixes(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_143paint_shared_prefixes = {"__pyx_fuse_7paint_shared_prefixes", (PyCFunction)__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_143paint_shared_prefixes, METH_O, __pyx_doc_5allel_3opt_5stats_18paint_shared_prefixes};
    static PyObject *__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_143paint_shared_prefixes(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("paint_shared_prefixes (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint64_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 365, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.paint_shared_prefixes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_142paint_shared_prefixes(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_142paint_shared_prefixes(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_pp_start;
      Py_ssize_t __pyx_v_pp_stop;
      Py_ssize_t __pyx_v_pp_size;
      Py_ssize_t __pyx_v_n0;
      Py_ssize_t __pyx_v_n1;
      __pyx_t_5numpy_int32_t __pyx_v_pp_color;
      __pyx_t_5numpy_int32_t __pyx_v_next_color;
      __Pyx_memviewslice __pyx_v_painting = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_prefixes = NULL;
      Py_ssize_t __pyx_v_i;
      PyObject *__pyx_v_parent_prefixes = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_7paint_shared_prefixes", 0);
      __Pyx_TraceCall("__pyx_fuse_7paint_shared_prefixes", __pyx_f[0], 365, 0, __PYX_ERR(0, 365, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_12);
      __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_25, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_26, 1);
      __Pyx_AddTraceback("allel.opt.stats.paint_shared_prefixes", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_painting, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
      __Pyx_XDECREF(__pyx_v_prefixes);
      __Pyx_XDECREF(__pyx_v_parent_prefixes);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
      __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__31);
      __Pyx_GIVEREF(__pyx_tuple__31);
    /* … */
      __pyx_tuple__119 = PyTuple_Pack(16, __pyx_n_s_h, __pyx_n_s_h, __pyx_n_s_n_variants, __pyx_n_s_n_haplotypes, __pyx_n_s_pp_start, __pyx_n_s_pp_stop, __pyx_n_s_pp_size, __pyx_n_s_n0, __pyx_n_s_n1, __pyx_n_s_pp_color, __pyx_n_s_next_color, __pyx_n_s_painting, __pyx_n_s_s, __pyx_n_s_prefixes, __pyx_n_s_i, __pyx_n_s_parent_prefixes); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__119);
      __Pyx_GIVEREF(__pyx_tuple__119);
    /* … */
      __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_129paint_shared_prefixes, 0, __pyx_n_s_paint_shared_prefixes, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_int8_t, __pyx_t_14) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_131paint_shared_prefixes, 0, __pyx_n_s_paint_shared_prefixes, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_int16_t, __pyx_t_14) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_133paint_shared_prefixes, 0, __pyx_n_s_paint_shared_prefixes, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_int32_t, __pyx_t_14) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_135paint_shared_prefixes, 0, __pyx_n_s_paint_shared_prefixes, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_int64_t, __pyx_t_14) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_137paint_shared_prefixes, 0, __pyx_n_s_paint_shared_prefixes, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_uint8_t, __pyx_t_14) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_139paint_shared_prefixes, 0, __pyx_n_s_paint_shared_prefixes, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_uint16_t, __pyx_t_14) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_141paint_shared_prefixes, 0, __pyx_n_s_paint_shared_prefixes, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_uint32_t, __pyx_t_14) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_143paint_shared_prefixes, 0, __pyx_n_s_paint_shared_prefixes, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_uint64_t, __pyx_t_14) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __pyx_FusedFunction_NewEx(&__pyx_mdef_5allel_3opt_5stats_19paint_shared_prefixes, 0, __pyx_n_s_paint_shared_prefixes, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_empty_tuple);
      ((__pyx_FusedFunctionObject *) __pyx_t_14)->__signatures__ = __pyx_t_13;
      __Pyx_GIVEREF(__pyx_t_13);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_paint_shared_prefixes, __pyx_t_14) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(1, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aliman_src_github_cggh_sci, __pyx_n_s_paint_shared_prefixes, 365, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(0, 365, __pyx_L1_error)

     0366:     """Paint each shared prefix with a different number. N.B., `h` must be

     0367:     already sorted by prefix.

     0368:

     0369:     """

     0370:

     0371:     cdef:

     0372:         Py_ssize_t n_variants, n_haplotypes, pp_start, pp_stop, pp_size, n0, n1

     0373:         cnp.int32_t pp_color, next_color

     0374:         cnp.int32_t[:, :] painting

     0375:         integer[:] s

     0376:

     0377:     # initialise variables

    +0378:     n_variants = h.shape[0]

      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);

    +0379:     n_haplotypes = h.shape[1]

      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);

    +0380:     prefixes = [(0, n_haplotypes, 1)]

      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_haplotypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
      __Pyx_INCREF(__pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_v_prefixes = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
    /* … */
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_haplotypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
      __Pyx_INCREF(__pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_v_prefixes = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
    /* … */
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_haplotypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
      __Pyx_INCREF(__pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_v_prefixes = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
    /* … */
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_haplotypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
      __Pyx_INCREF(__pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_v_prefixes = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
    /* … */
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_haplotypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
      __Pyx_INCREF(__pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_v_prefixes = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
    /* … */
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_haplotypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
      __Pyx_INCREF(__pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_v_prefixes = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
    /* … */
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_haplotypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
      __Pyx_INCREF(__pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_v_prefixes = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
    /* … */
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_haplotypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
      __Pyx_INCREF(__pyx_int_1);
      __Pyx_GIVEREF(__pyx_int_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_v_prefixes = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

    +0381:     next_color = 2

      __pyx_v_next_color = 2;
    /* … */
      __pyx_v_next_color = 2;
    /* … */
      __pyx_v_next_color = 2;
    /* … */
      __pyx_v_next_color = 2;
    /* … */
      __pyx_v_next_color = 2;
    /* … */
      __pyx_v_next_color = 2;
    /* … */
      __pyx_v_next_color = 2;
    /* … */
      __pyx_v_next_color = 2;

    +0382:     painting = np.zeros((n_variants, n_haplotypes), dtype='i4')

      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n_haplotypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 382, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_painting = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n_haplotypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 382, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_painting = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n_haplotypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 382, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_painting = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n_haplotypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 382, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_painting = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n_haplotypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 382, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_painting = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n_haplotypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 382, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_painting = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n_haplotypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 382, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_painting = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n_haplotypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 382, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_painting = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

     0383:

     0384:     # iterate over variants

    +0385:     for i in range(n_variants):

      __pyx_t_6 = __pyx_v_n_variants;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v_i = __pyx_t_7;
    /* … */
      __pyx_t_6 = __pyx_v_n_variants;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v_i = __pyx_t_7;
    /* … */
      __pyx_t_6 = __pyx_v_n_variants;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v_i = __pyx_t_7;
    /* … */
      __pyx_t_6 = __pyx_v_n_variants;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v_i = __pyx_t_7;
    /* … */
      __pyx_t_6 = __pyx_v_n_variants;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v_i = __pyx_t_7;
    /* … */
      __pyx_t_6 = __pyx_v_n_variants;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v_i = __pyx_t_7;
    /* … */
      __pyx_t_6 = __pyx_v_n_variants;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v_i = __pyx_t_7;
    /* … */
      __pyx_t_6 = __pyx_v_n_variants;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v_i = __pyx_t_7;

     0386:

     0387:         # setup for this iteration

    +0388:         parent_prefixes = prefixes

        __Pyx_INCREF(__pyx_v_prefixes);
        __Pyx_XDECREF_SET(__pyx_v_parent_prefixes, __pyx_v_prefixes);
    /* … */
        __Pyx_INCREF(__pyx_v_prefixes);
        __Pyx_XDECREF_SET(__pyx_v_parent_prefixes, __pyx_v_prefixes);
    /* … */
        __Pyx_INCREF(__pyx_v_prefixes);
        __Pyx_XDECREF_SET(__pyx_v_parent_prefixes, __pyx_v_prefixes);
    /* … */
        __Pyx_INCREF(__pyx_v_prefixes);
        __Pyx_XDECREF_SET(__pyx_v_parent_prefixes, __pyx_v_prefixes);
    /* … */
        __Pyx_INCREF(__pyx_v_prefixes);
        __Pyx_XDECREF_SET(__pyx_v_parent_prefixes, __pyx_v_prefixes);
    /* … */
        __Pyx_INCREF(__pyx_v_prefixes);
        __Pyx_XDECREF_SET(__pyx_v_parent_prefixes, __pyx_v_prefixes);
    /* … */
        __Pyx_INCREF(__pyx_v_prefixes);
        __Pyx_XDECREF_SET(__pyx_v_parent_prefixes, __pyx_v_prefixes);
    /* … */
        __Pyx_INCREF(__pyx_v_prefixes);
        __Pyx_XDECREF_SET(__pyx_v_parent_prefixes, __pyx_v_prefixes);

    +0389:         prefixes = list()

        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_prefixes, ((PyObject*)__pyx_t_1));
        __pyx_t_1 = 0;
    /* … */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_prefixes, ((PyObject*)__pyx_t_1));
        __pyx_t_1 = 0;
    /* … */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_prefixes, ((PyObject*)__pyx_t_1));
        __pyx_t_1 = 0;
    /* … */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_prefixes, ((PyObject*)__pyx_t_1));
        __pyx_t_1 = 0;
    /* … */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_prefixes, ((PyObject*)__pyx_t_1));
        __pyx_t_1 = 0;
    /* … */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_prefixes, ((PyObject*)__pyx_t_1));
        __pyx_t_1 = 0;
    /* … */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_prefixes, ((PyObject*)__pyx_t_1));
        __pyx_t_1 = 0;
    /* … */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_prefixes, ((PyObject*)__pyx_t_1));
        __pyx_t_1 = 0;

     0390:

    +0391:         if not parent_prefixes:

        __pyx_t_8 = (__pyx_v_parent_prefixes != Py_None) && (PyList_GET_SIZE(__pyx_v_parent_prefixes) != 0);
        __pyx_t_9 = ((!__pyx_t_8) != 0);
        if (__pyx_t_9) {
    /* … */
        }
    /* … */
        __pyx_t_8 = (__pyx_v_parent_prefixes != Py_None) && (PyList_GET_SIZE(__pyx_v_parent_prefixes) != 0);
        __pyx_t_9 = ((!__pyx_t_8) != 0);
        if (__pyx_t_9) {
    /* … */
        }
    /* … */
        __pyx_t_8 = (__pyx_v_parent_prefixes != Py_None) && (PyList_GET_SIZE(__pyx_v_parent_prefixes) != 0);
        __pyx_t_9 = ((!__pyx_t_8) != 0);
        if (__pyx_t_9) {
    /* … */
        }
    /* … */
        __pyx_t_8 = (__pyx_v_parent_prefixes != Py_None) && (PyList_GET_SIZE(__pyx_v_parent_prefixes) != 0);
        __pyx_t_9 = ((!__pyx_t_8) != 0);
        if (__pyx_t_9) {
    /* … */
        }
    /* … */
        __pyx_t_8 = (__pyx_v_parent_prefixes != Py_None) && (PyList_GET_SIZE(__pyx_v_parent_prefixes) != 0);
        __pyx_t_9 = ((!__pyx_t_8) != 0);
        if (__pyx_t_9) {
    /* … */
        }
    /* … */
        __pyx_t_8 = (__pyx_v_parent_prefixes != Py_None) && (PyList_GET_SIZE(__pyx_v_parent_prefixes) != 0);
        __pyx_t_9 = ((!__pyx_t_8) != 0);
        if (__pyx_t_9) {
    /* … */
        }
    /* … */
        __pyx_t_8 = (__pyx_v_parent_prefixes != Py_None) && (PyList_GET_SIZE(__pyx_v_parent_prefixes) != 0);
        __pyx_t_9 = ((!__pyx_t_8) != 0);
        if (__pyx_t_9) {
    /* … */
        }
    /* … */
        __pyx_t_8 = (__pyx_v_parent_prefixes != Py_None) && (PyList_GET_SIZE(__pyx_v_parent_prefixes) != 0);
        __pyx_t_9 = ((!__pyx_t_8) != 0);
        if (__pyx_t_9) {
    /* … */
        }

     0392:             # no more shared prefixes

    +0393:             break

          goto __pyx_L4_break;
    /* … */
          goto __pyx_L4_break;
    /* … */
          goto __pyx_L4_break;
    /* … */
          goto __pyx_L4_break;
    /* … */
          goto __pyx_L4_break;
    /* … */
          goto __pyx_L4_break;
    /* … */
          goto __pyx_L4_break;
    /* … */
          goto __pyx_L4_break;

     0394:

     0395:         # iterate over parent prefixes

    +0396:         for pp_start, pp_stop, pp_color in parent_prefixes:

        __pyx_t_1 = __pyx_v_parent_prefixes; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0;
        for (;;) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 396, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
          if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
            PyObject* sequence = __pyx_t_4;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 3)) {
              if (size > 3) __Pyx_RaiseTooManyValuesError(3);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 396, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
              __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
              __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2);
            } else {
              __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
              __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
              __pyx_t_11 = PyList_GET_ITEM(sequence, 2);
            }
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_11);
            #else
            __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
            index = 0; __pyx_t_3 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_3);
            index = 1; __pyx_t_2 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_2);
            index = 2; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_11);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 3) < 0) __PYX_ERR(0, 396, __pyx_L1_error)
            __pyx_t_13 = NULL;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            goto __pyx_L9_unpacking_done;
            __pyx_L8_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_13 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 396, __pyx_L1_error)
            __pyx_L9_unpacking_done:;
          }
          __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_16 = __Pyx_PyInt_As_npy_int32(__pyx_t_11); if (unlikely((__pyx_t_16 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_v_pp_start = __pyx_t_14;
          __pyx_v_pp_stop = __pyx_t_15;
          __pyx_v_pp_color = __pyx_t_16;
    /* … */
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_L4_break:;
    /* … */
        __pyx_t_1 = __pyx_v_parent_prefixes; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0;
        for (;;) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 396, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
          if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
            PyObject* sequence = __pyx_t_4;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 3)) {
              if (size > 3) __Pyx_RaiseTooManyValuesError(3);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 396, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
              __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
              __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2);
            } else {
              __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
              __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
              __pyx_t_11 = PyList_GET_ITEM(sequence, 2);
            }
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_11);
            #else
            __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
            index = 0; __pyx_t_3 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_3);
            index = 1; __pyx_t_2 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_2);
            index = 2; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_11);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 3) < 0) __PYX_ERR(0, 396, __pyx_L1_error)
            __pyx_t_13 = NULL;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            goto __pyx_L9_unpacking_done;
            __pyx_L8_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_13 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 396, __pyx_L1_error)
            __pyx_L9_unpacking_done:;
          }
          __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_16 = __Pyx_PyInt_As_npy_int32(__pyx_t_11); if (unlikely((__pyx_t_16 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_v_pp_start = __pyx_t_14;
          __pyx_v_pp_stop = __pyx_t_15;
          __pyx_v_pp_color = __pyx_t_16;
    /* … */
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_L4_break:;
    /* … */
        __pyx_t_1 = __pyx_v_parent_prefixes; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0;
        for (;;) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 396, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
          if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
            PyObject* sequence = __pyx_t_4;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 3)) {
              if (size > 3) __Pyx_RaiseTooManyValuesError(3);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 396, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
              __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
              __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2);
            } else {
              __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
              __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
              __pyx_t_11 = PyList_GET_ITEM(sequence, 2);
            }
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_11);
            #else
            __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
            index = 0; __pyx_t_3 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_3);
            index = 1; __pyx_t_2 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_2);
            index = 2; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_11);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 3) < 0) __PYX_ERR(0, 396, __pyx_L1_error)
            __pyx_t_13 = NULL;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            goto __pyx_L9_unpacking_done;
            __pyx_L8_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_13 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 396, __pyx_L1_error)
            __pyx_L9_unpacking_done:;
          }
          __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_16 = __Pyx_PyInt_As_npy_int32(__pyx_t_11); if (unlikely((__pyx_t_16 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_v_pp_start = __pyx_t_14;
          __pyx_v_pp_stop = __pyx_t_15;
          __pyx_v_pp_color = __pyx_t_16;
    /* … */
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_L4_break:;
    /* … */
        __pyx_t_1 = __pyx_v_parent_prefixes; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0;
        for (;;) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 396, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
          if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
            PyObject* sequence = __pyx_t_4;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 3)) {
              if (size > 3) __Pyx_RaiseTooManyValuesError(3);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 396, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
              __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
              __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2);
            } else {
              __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
              __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
              __pyx_t_11 = PyList_GET_ITEM(sequence, 2);
            }
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_11);
            #else
            __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
            index = 0; __pyx_t_3 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_3);
            index = 1; __pyx_t_2 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_2);
            index = 2; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_11);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 3) < 0) __PYX_ERR(0, 396, __pyx_L1_error)
            __pyx_t_13 = NULL;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            goto __pyx_L9_unpacking_done;
            __pyx_L8_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_13 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 396, __pyx_L1_error)
            __pyx_L9_unpacking_done:;
          }
          __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_16 = __Pyx_PyInt_As_npy_int32(__pyx_t_11); if (unlikely((__pyx_t_16 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_v_pp_start = __pyx_t_14;
          __pyx_v_pp_stop = __pyx_t_15;
          __pyx_v_pp_color = __pyx_t_16;
    /* … */
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_L4_break:;
    /* … */
        __pyx_t_1 = __pyx_v_parent_prefixes; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0;
        for (;;) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 396, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
          if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
            PyObject* sequence = __pyx_t_4;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 3)) {
              if (size > 3) __Pyx_RaiseTooManyValuesError(3);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 396, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
              __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
              __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2);
            } else {
              __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
              __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
              __pyx_t_11 = PyList_GET_ITEM(sequence, 2);
            }
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_11);
            #else
            __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
            index = 0; __pyx_t_3 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_3);
            index = 1; __pyx_t_2 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_2);
            index = 2; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_11);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 3) < 0) __PYX_ERR(0, 396, __pyx_L1_error)
            __pyx_t_13 = NULL;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            goto __pyx_L9_unpacking_done;
            __pyx_L8_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_13 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 396, __pyx_L1_error)
            __pyx_L9_unpacking_done:;
          }
          __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_16 = __Pyx_PyInt_As_npy_int32(__pyx_t_11); if (unlikely((__pyx_t_16 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_v_pp_start = __pyx_t_14;
          __pyx_v_pp_stop = __pyx_t_15;
          __pyx_v_pp_color = __pyx_t_16;
    /* … */
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_L4_break:;
    /* … */
        __pyx_t_1 = __pyx_v_parent_prefixes; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0;
        for (;;) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 396, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
          if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
            PyObject* sequence = __pyx_t_4;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 3)) {
              if (size > 3) __Pyx_RaiseTooManyValuesError(3);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 396, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
              __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
              __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2);
            } else {
              __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
              __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
              __pyx_t_11 = PyList_GET_ITEM(sequence, 2);
            }
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_11);
            #else
            __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
            index = 0; __pyx_t_3 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_3);
            index = 1; __pyx_t_2 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_2);
            index = 2; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_11);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 3) < 0) __PYX_ERR(0, 396, __pyx_L1_error)
            __pyx_t_13 = NULL;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            goto __pyx_L9_unpacking_done;
            __pyx_L8_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_13 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 396, __pyx_L1_error)
            __pyx_L9_unpacking_done:;
          }
          __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_16 = __Pyx_PyInt_As_npy_int32(__pyx_t_11); if (unlikely((__pyx_t_16 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_v_pp_start = __pyx_t_14;
          __pyx_v_pp_stop = __pyx_t_15;
          __pyx_v_pp_color = __pyx_t_16;
    /* … */
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_L4_break:;
    /* … */
        __pyx_t_1 = __pyx_v_parent_prefixes; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0;
        for (;;) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 396, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
          if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
            PyObject* sequence = __pyx_t_4;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 3)) {
              if (size > 3) __Pyx_RaiseTooManyValuesError(3);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 396, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
              __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
              __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2);
            } else {
              __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
              __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
              __pyx_t_11 = PyList_GET_ITEM(sequence, 2);
            }
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_11);
            #else
            __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
            index = 0; __pyx_t_3 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_3);
            index = 1; __pyx_t_2 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_2);
            index = 2; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_11);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 3) < 0) __PYX_ERR(0, 396, __pyx_L1_error)
            __pyx_t_13 = NULL;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            goto __pyx_L9_unpacking_done;
            __pyx_L8_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_13 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 396, __pyx_L1_error)
            __pyx_L9_unpacking_done:;
          }
          __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_16 = __Pyx_PyInt_As_npy_int32(__pyx_t_11); if (unlikely((__pyx_t_16 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_v_pp_start = __pyx_t_14;
          __pyx_v_pp_stop = __pyx_t_15;
          __pyx_v_pp_color = __pyx_t_16;
    /* … */
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_L4_break:;
    /* … */
        __pyx_t_1 = __pyx_v_parent_prefixes; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0;
        for (;;) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 396, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
          if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
            PyObject* sequence = __pyx_t_4;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 3)) {
              if (size > 3) __Pyx_RaiseTooManyValuesError(3);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 396, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
              __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
              __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2);
            } else {
              __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
              __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
              __pyx_t_11 = PyList_GET_ITEM(sequence, 2);
            }
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_11);
            #else
            __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 396, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
            index = 0; __pyx_t_3 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_3);
            index = 1; __pyx_t_2 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_2);
            index = 2; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L8_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_11);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 3) < 0) __PYX_ERR(0, 396, __pyx_L1_error)
            __pyx_t_13 = NULL;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            goto __pyx_L9_unpacking_done;
            __pyx_L8_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_13 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 396, __pyx_L1_error)
            __pyx_L9_unpacking_done:;
          }
          __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_16 = __Pyx_PyInt_As_npy_int32(__pyx_t_11); if (unlikely((__pyx_t_16 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_v_pp_start = __pyx_t_14;
          __pyx_v_pp_stop = __pyx_t_15;
          __pyx_v_pp_color = __pyx_t_16;
    /* … */
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_L4_break:;

    +0397:             pp_size = pp_stop - pp_start

          __pyx_v_pp_size = (__pyx_v_pp_stop - __pyx_v_pp_start);
    /* … */
          __pyx_v_pp_size = (__pyx_v_pp_stop - __pyx_v_pp_start);
    /* … */
          __pyx_v_pp_size = (__pyx_v_pp_stop - __pyx_v_pp_start);
    /* … */
          __pyx_v_pp_size = (__pyx_v_pp_stop - __pyx_v_pp_start);
    /* … */
          __pyx_v_pp_size = (__pyx_v_pp_stop - __pyx_v_pp_start);
    /* … */
          __pyx_v_pp_size = (__pyx_v_pp_stop - __pyx_v_pp_start);
    /* … */
          __pyx_v_pp_size = (__pyx_v_pp_stop - __pyx_v_pp_start);
    /* … */
          __pyx_v_pp_size = (__pyx_v_pp_stop - __pyx_v_pp_start);

     0398:

     0399:             # find the split point

    +0400:             s = h[i, pp_start:pp_stop]

          __pyx_t_17.data = __pyx_v_h.data;
          __pyx_t_17.memview = __pyx_v_h.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_17, 0);
          {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 400, __pyx_L1_error)
        }
            __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
          if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_17,
        __pyx_v_h.shape[1], __pyx_v_h.strides[1], __pyx_v_h.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 400, __pyx_L1_error)
    }

    __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
          __pyx_v_s = __pyx_t_17;
          __pyx_t_17.memview = NULL;
          __pyx_t_17.data = NULL;
    /* … */
          __pyx_t_17.data = __pyx_v_h.data;
          __pyx_t_17.memview = __pyx_v_h.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_17, 0);
          {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 400, __pyx_L1_error)
        }
            __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
          if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_17,
        __pyx_v_h.shape[1], __pyx_v_h.strides[1], __pyx_v_h.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 400, __pyx_L1_error)
    }

    __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
          __pyx_v_s = __pyx_t_17;
          __pyx_t_17.memview = NULL;
          __pyx_t_17.data = NULL;
    /* … */
          __pyx_t_17.data = __pyx_v_h.data;
          __pyx_t_17.memview = __pyx_v_h.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_17, 0);
          {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 400, __pyx_L1_error)
        }
            __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
          if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_17,
        __pyx_v_h.shape[1], __pyx_v_h.strides[1], __pyx_v_h.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 400, __pyx_L1_error)
    }

    __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
          __pyx_v_s = __pyx_t_17;
          __pyx_t_17.memview = NULL;
          __pyx_t_17.data = NULL;
    /* … */
          __pyx_t_17.data = __pyx_v_h.data;
          __pyx_t_17.memview = __pyx_v_h.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_17, 0);
          {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 400, __pyx_L1_error)
        }
            __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
          if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_17,
        __pyx_v_h.shape[1], __pyx_v_h.strides[1], __pyx_v_h.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 400, __pyx_L1_error)
    }

    __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
          __pyx_v_s = __pyx_t_17;
          __pyx_t_17.memview = NULL;
          __pyx_t_17.data = NULL;
    /* … */
          __pyx_t_17.data = __pyx_v_h.data;
          __pyx_t_17.memview = __pyx_v_h.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_17, 0);
          {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 400, __pyx_L1_error)
        }
            __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
          if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_17,
        __pyx_v_h.shape[1], __pyx_v_h.strides[1], __pyx_v_h.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 400, __pyx_L1_error)
    }

    __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
          __pyx_v_s = __pyx_t_17;
          __pyx_t_17.memview = NULL;
          __pyx_t_17.data = NULL;
    /* … */
          __pyx_t_17.data = __pyx_v_h.data;
          __pyx_t_17.memview = __pyx_v_h.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_17, 0);
          {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 400, __pyx_L1_error)
        }
            __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
          if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_17,
        __pyx_v_h.shape[1], __pyx_v_h.strides[1], __pyx_v_h.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 400, __pyx_L1_error)
    }

    __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
          __pyx_v_s = __pyx_t_17;
          __pyx_t_17.memview = NULL;
          __pyx_t_17.data = NULL;
    /* … */
          __pyx_t_17.data = __pyx_v_h.data;
          __pyx_t_17.memview = __pyx_v_h.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_17, 0);
          {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 400, __pyx_L1_error)
        }
            __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
          if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_17,
        __pyx_v_h.shape[1], __pyx_v_h.strides[1], __pyx_v_h.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 400, __pyx_L1_error)
    }

    __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
          __pyx_v_s = __pyx_t_17;
          __pyx_t_17.memview = NULL;
          __pyx_t_17.data = NULL;
    /* … */
          __pyx_t_17.data = __pyx_v_h.data;
          __pyx_t_17.memview = __pyx_v_h.memview;
          __PYX_INC_MEMVIEW(&__pyx_t_17, 0);
          {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_h.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_h.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 400, __pyx_L1_error)
        }
            __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
          if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_17,
        __pyx_v_h.shape[1], __pyx_v_h.strides[1], __pyx_v_h.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 400, __pyx_L1_error)
    }

    __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
          __pyx_v_s = __pyx_t_17;
          __pyx_t_17.memview = NULL;
          __pyx_t_17.data = NULL;

     0401:             # number of reference alleles

    +0402:             n0 = bisect_left(s, 1)

          __pyx_v_n0 = __pyx_fuse_0__pyx_f_5allel_3opt_5stats_bisect_left(__pyx_v_s, 1, 0);
    /* … */
          __pyx_v_n0 = __pyx_fuse_1__pyx_f_5allel_3opt_5stats_bisect_left(__pyx_v_s, 1, 0);
    /* … */
          __pyx_v_n0 = __pyx_fuse_2__pyx_f_5allel_3opt_5stats_bisect_left(__pyx_v_s, 1, 0);
    /* … */
          __pyx_v_n0 = __pyx_fuse_3__pyx_f_5allel_3opt_5stats_bisect_left(__pyx_v_s, 1, 0);
    /* … */
          __pyx_v_n0 = __pyx_fuse_4__pyx_f_5allel_3opt_5stats_bisect_left(__pyx_v_s, 1, 0);
    /* … */
          __pyx_v_n0 = __pyx_fuse_5__pyx_f_5allel_3opt_5stats_bisect_left(__pyx_v_s, 1, 0);
    /* … */
          __pyx_v_n0 = __pyx_fuse_6__pyx_f_5allel_3opt_5stats_bisect_left(__pyx_v_s, 1, 0);
    /* … */
          __pyx_v_n0 = __pyx_fuse_7__pyx_f_5allel_3opt_5stats_bisect_left(__pyx_v_s, 1, 0);

     0403:             # number of alternate alleles

    +0404:             n1 = pp_size - n0

          __pyx_v_n1 = (__pyx_v_pp_size - __pyx_v_n0);
    /* … */
          __pyx_v_n1 = (__pyx_v_pp_size - __pyx_v_n0);
    /* … */
          __pyx_v_n1 = (__pyx_v_pp_size - __pyx_v_n0);
    /* … */
          __pyx_v_n1 = (__pyx_v_pp_size - __pyx_v_n0);
    /* … */
          __pyx_v_n1 = (__pyx_v_pp_size - __pyx_v_n0);
    /* … */
          __pyx_v_n1 = (__pyx_v_pp_size - __pyx_v_n0);
    /* … */
          __pyx_v_n1 = (__pyx_v_pp_size - __pyx_v_n0);
    /* … */
          __pyx_v_n1 = (__pyx_v_pp_size - __pyx_v_n0);

     0405:

    +0406:             if n0 == 0 or n1 == 0:

          __pyx_t_8 = ((__pyx_v_n0 == 0) != 0);
          if (!__pyx_t_8) {
          } else {
            __pyx_t_9 = __pyx_t_8;
            goto __pyx_L11_bool_binop_done;
          }
          __pyx_t_8 = ((__pyx_v_n1 == 0) != 0);
          __pyx_t_9 = __pyx_t_8;
          __pyx_L11_bool_binop_done:;
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }
    /* … */
          __pyx_t_8 = ((__pyx_v_n0 == 0) != 0);
          if (!__pyx_t_8) {
          } else {
            __pyx_t_9 = __pyx_t_8;
            goto __pyx_L11_bool_binop_done;
          }
          __pyx_t_8 = ((__pyx_v_n1 == 0) != 0);
          __pyx_t_9 = __pyx_t_8;
          __pyx_L11_bool_binop_done:;
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }
    /* … */
          __pyx_t_8 = ((__pyx_v_n0 == 0) != 0);
          if (!__pyx_t_8) {
          } else {
            __pyx_t_9 = __pyx_t_8;
            goto __pyx_L11_bool_binop_done;
          }
          __pyx_t_8 = ((__pyx_v_n1 == 0) != 0);
          __pyx_t_9 = __pyx_t_8;
          __pyx_L11_bool_binop_done:;
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }
    /* … */
          __pyx_t_8 = ((__pyx_v_n0 == 0) != 0);
          if (!__pyx_t_8) {
          } else {
            __pyx_t_9 = __pyx_t_8;
            goto __pyx_L11_bool_binop_done;
          }
          __pyx_t_8 = ((__pyx_v_n1 == 0) != 0);
          __pyx_t_9 = __pyx_t_8;
          __pyx_L11_bool_binop_done:;
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }
    /* … */
          __pyx_t_8 = ((__pyx_v_n0 == 0) != 0);
          if (!__pyx_t_8) {
          } else {
            __pyx_t_9 = __pyx_t_8;
            goto __pyx_L11_bool_binop_done;
          }
          __pyx_t_8 = ((__pyx_v_n1 == 0) != 0);
          __pyx_t_9 = __pyx_t_8;
          __pyx_L11_bool_binop_done:;
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }
    /* … */
          __pyx_t_8 = ((__pyx_v_n0 == 0) != 0);
          if (!__pyx_t_8) {
          } else {
            __pyx_t_9 = __pyx_t_8;
            goto __pyx_L11_bool_binop_done;
          }
          __pyx_t_8 = ((__pyx_v_n1 == 0) != 0);
          __pyx_t_9 = __pyx_t_8;
          __pyx_L11_bool_binop_done:;
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }
    /* … */
          __pyx_t_8 = ((__pyx_v_n0 == 0) != 0);
          if (!__pyx_t_8) {
          } else {
            __pyx_t_9 = __pyx_t_8;
            goto __pyx_L11_bool_binop_done;
          }
          __pyx_t_8 = ((__pyx_v_n1 == 0) != 0);
          __pyx_t_9 = __pyx_t_8;
          __pyx_L11_bool_binop_done:;
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }
    /* … */
          __pyx_t_8 = ((__pyx_v_n0 == 0) != 0);
          if (!__pyx_t_8) {
          } else {
            __pyx_t_9 = __pyx_t_8;
            goto __pyx_L11_bool_binop_done;
          }
          __pyx_t_8 = ((__pyx_v_n1 == 0) != 0);
          __pyx_t_9 = __pyx_t_8;
          __pyx_L11_bool_binop_done:;
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }

     0407:                 # no split, continue parent prefix

    +0408:                 painting[i, pp_start:pp_stop] = pp_color

            __pyx_t_19.data = __pyx_v_painting.data;
            __pyx_t_19.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_19, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 408, __pyx_L1_error)
        }
            __pyx_t_19.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_19,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 408, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_19.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_19.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_19.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
            __pyx_t_19.memview = NULL;
            __pyx_t_19.data = NULL;
    /* … */
            __pyx_t_19.data = __pyx_v_painting.data;
            __pyx_t_19.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_19, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 408, __pyx_L1_error)
        }
            __pyx_t_19.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_19,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 408, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_19.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_19.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_19.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
            __pyx_t_19.memview = NULL;
            __pyx_t_19.data = NULL;
    /* … */
            __pyx_t_17.data = __pyx_v_painting.data;
            __pyx_t_17.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_17, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 408, __pyx_L1_error)
        }
            __pyx_t_17.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_17,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 408, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_17.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_17.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_17.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
            __pyx_t_17.memview = NULL;
            __pyx_t_17.data = NULL;
    /* … */
            __pyx_t_19.data = __pyx_v_painting.data;
            __pyx_t_19.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_19, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 408, __pyx_L1_error)
        }
            __pyx_t_19.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_19,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 408, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_19.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_19.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_19.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
            __pyx_t_19.memview = NULL;
            __pyx_t_19.data = NULL;
    /* … */
            __pyx_t_19.data = __pyx_v_painting.data;
            __pyx_t_19.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_19, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 408, __pyx_L1_error)
        }
            __pyx_t_19.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_19,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 408, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_19.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_19.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_19.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
            __pyx_t_19.memview = NULL;
            __pyx_t_19.data = NULL;
    /* … */
            __pyx_t_19.data = __pyx_v_painting.data;
            __pyx_t_19.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_19, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 408, __pyx_L1_error)
        }
            __pyx_t_19.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_19,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 408, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_19.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_19.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_19.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
            __pyx_t_19.memview = NULL;
            __pyx_t_19.data = NULL;
    /* … */
            __pyx_t_19.data = __pyx_v_painting.data;
            __pyx_t_19.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_19, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 408, __pyx_L1_error)
        }
            __pyx_t_19.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_19,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 408, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_19.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_19.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_19.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
            __pyx_t_19.memview = NULL;
            __pyx_t_19.data = NULL;
    /* … */
            __pyx_t_19.data = __pyx_v_painting.data;
            __pyx_t_19.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_19, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 408, __pyx_L1_error)
        }
            __pyx_t_19.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_19,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 408, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_19.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_19.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_19.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
            __pyx_t_19.memview = NULL;
            __pyx_t_19.data = NULL;

    +0409:                 prefixes.append((pp_start, pp_stop, pp_color))

            __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
            __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
            __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_19 == -1)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
            __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
            __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
            __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
            __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
            __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 409, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     0410:

    +0411:             elif n0 > n1:

          __pyx_t_9 = ((__pyx_v_n0 > __pyx_v_n1) != 0);
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }
    /* … */
          __pyx_t_9 = ((__pyx_v_n0 > __pyx_v_n1) != 0);
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }
    /* … */
          __pyx_t_9 = ((__pyx_v_n0 > __pyx_v_n1) != 0);
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }
    /* … */
          __pyx_t_9 = ((__pyx_v_n0 > __pyx_v_n1) != 0);
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }
    /* … */
          __pyx_t_9 = ((__pyx_v_n0 > __pyx_v_n1) != 0);
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }
    /* … */
          __pyx_t_9 = ((__pyx_v_n0 > __pyx_v_n1) != 0);
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }
    /* … */
          __pyx_t_9 = ((__pyx_v_n0 > __pyx_v_n1) != 0);
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }
    /* … */
          __pyx_t_9 = ((__pyx_v_n0 > __pyx_v_n1) != 0);
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }

     0412:                 # ref is major, alt is minor

    +0413:                 painting[i, pp_start:pp_start+n0] = pp_color

            __pyx_t_21.data = __pyx_v_painting.data;
            __pyx_t_21.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_21, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 413, __pyx_L1_error)
        }
            __pyx_t_21.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_21,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 413, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_21.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_21.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_21.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
            __pyx_t_21.memview = NULL;
            __pyx_t_21.data = NULL;
    /* … */
            __pyx_t_21.data = __pyx_v_painting.data;
            __pyx_t_21.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_21, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 413, __pyx_L1_error)
        }
            __pyx_t_21.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_21,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 413, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_21.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_21.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_21.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
            __pyx_t_21.memview = NULL;
            __pyx_t_21.data = NULL;
    /* … */
            __pyx_t_20.data = __pyx_v_painting.data;
            __pyx_t_20.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_20, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 413, __pyx_L1_error)
        }
            __pyx_t_20.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_20,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 413, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_20.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_20.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_20.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
            __pyx_t_20.memview = NULL;
            __pyx_t_20.data = NULL;
    /* … */
            __pyx_t_21.data = __pyx_v_painting.data;
            __pyx_t_21.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_21, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 413, __pyx_L1_error)
        }
            __pyx_t_21.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_21,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 413, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_21.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_21.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_21.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
            __pyx_t_21.memview = NULL;
            __pyx_t_21.data = NULL;
    /* … */
            __pyx_t_21.data = __pyx_v_painting.data;
            __pyx_t_21.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_21, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 413, __pyx_L1_error)
        }
            __pyx_t_21.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_21,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 413, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_21.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_21.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_21.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
            __pyx_t_21.memview = NULL;
            __pyx_t_21.data = NULL;
    /* … */
            __pyx_t_21.data = __pyx_v_painting.data;
            __pyx_t_21.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_21, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 413, __pyx_L1_error)
        }
            __pyx_t_21.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_21,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 413, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_21.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_21.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_21.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
            __pyx_t_21.memview = NULL;
            __pyx_t_21.data = NULL;
    /* … */
            __pyx_t_21.data = __pyx_v_painting.data;
            __pyx_t_21.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_21, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 413, __pyx_L1_error)
        }
            __pyx_t_21.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_21,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 413, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_21.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_21.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_21.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
            __pyx_t_21.memview = NULL;
            __pyx_t_21.data = NULL;
    /* … */
            __pyx_t_21.data = __pyx_v_painting.data;
            __pyx_t_21.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_21, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 413, __pyx_L1_error)
        }
            __pyx_t_21.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_21,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 413, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_21.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_21.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_21.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
            __pyx_t_21.memview = NULL;
            __pyx_t_21.data = NULL;

    +0414:                 prefixes.append((pp_start, pp_start+n0, pp_color))

            __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
            __pyx_t_3 = 0;
            __pyx_t_2 = 0;
            __pyx_t_11 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
            __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
            __pyx_t_3 = 0;
            __pyx_t_2 = 0;
            __pyx_t_11 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
            __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
            __pyx_t_3 = 0;
            __pyx_t_2 = 0;
            __pyx_t_11 = 0;
            __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_19 == -1)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
            __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
            __pyx_t_3 = 0;
            __pyx_t_2 = 0;
            __pyx_t_11 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
            __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
            __pyx_t_3 = 0;
            __pyx_t_2 = 0;
            __pyx_t_11 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
            __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
            __pyx_t_3 = 0;
            __pyx_t_2 = 0;
            __pyx_t_11 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
            __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
            __pyx_t_3 = 0;
            __pyx_t_2 = 0;
            __pyx_t_11 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
            __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
            __pyx_t_3 = 0;
            __pyx_t_2 = 0;
            __pyx_t_11 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 414, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    +0415:                 if n1 > 1:

            __pyx_t_9 = ((__pyx_v_n1 > 1) != 0);
            if (__pyx_t_9) {
    /* … */
            }
    /* … */
            __pyx_t_9 = ((__pyx_v_n1 > 1) != 0);
            if (__pyx_t_9) {
    /* … */
            }
    /* … */
            __pyx_t_9 = ((__pyx_v_n1 > 1) != 0);
            if (__pyx_t_9) {
    /* … */
            }
    /* … */
            __pyx_t_9 = ((__pyx_v_n1 > 1) != 0);
            if (__pyx_t_9) {
    /* … */
            }
    /* … */
            __pyx_t_9 = ((__pyx_v_n1 > 1) != 0);
            if (__pyx_t_9) {
    /* … */
            }
    /* … */
            __pyx_t_9 = ((__pyx_v_n1 > 1) != 0);
            if (__pyx_t_9) {
    /* … */
            }
    /* … */
            __pyx_t_9 = ((__pyx_v_n1 > 1) != 0);
            if (__pyx_t_9) {
    /* … */
            }
    /* … */
            __pyx_t_9 = ((__pyx_v_n1 > 1) != 0);
            if (__pyx_t_9) {
    /* … */
            }

    +0416:                     painting[i, pp_start+n0:pp_stop] = next_color

              __pyx_t_22.data = __pyx_v_painting.data;
              __pyx_t_22.memview = __pyx_v_painting.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_22, 0);
              {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 416, __pyx_L1_error)
        }
            __pyx_t_22.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
              if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_22,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 416, __pyx_L1_error)
    }

    {
                  __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                  {
                      Py_ssize_t __pyx_temp_extent_0 = __pyx_t_22.shape[0];
                      Py_ssize_t __pyx_temp_stride_0 = __pyx_t_22.strides[0];
                      char *__pyx_temp_pointer_0;
                      Py_ssize_t __pyx_temp_idx_0;
                      __pyx_temp_pointer_0 = __pyx_t_22.data;
                      for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                        *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                        __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                      }
                  }
              }
              __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
              __pyx_t_22.memview = NULL;
              __pyx_t_22.data = NULL;
    /* … */
              __pyx_t_22.data = __pyx_v_painting.data;
              __pyx_t_22.memview = __pyx_v_painting.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_22, 0);
              {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 416, __pyx_L1_error)
        }
            __pyx_t_22.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
              if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_22,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 416, __pyx_L1_error)
    }

    {
                  __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                  {
                      Py_ssize_t __pyx_temp_extent_0 = __pyx_t_22.shape[0];
                      Py_ssize_t __pyx_temp_stride_0 = __pyx_t_22.strides[0];
                      char *__pyx_temp_pointer_0;
                      Py_ssize_t __pyx_temp_idx_0;
                      __pyx_temp_pointer_0 = __pyx_t_22.data;
                      for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                        *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                        __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                      }
                  }
              }
              __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
              __pyx_t_22.memview = NULL;
              __pyx_t_22.data = NULL;
    /* … */
              __pyx_t_21.data = __pyx_v_painting.data;
              __pyx_t_21.memview = __pyx_v_painting.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_21, 0);
              {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 416, __pyx_L1_error)
        }
            __pyx_t_21.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
              if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_21,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 416, __pyx_L1_error)
    }

    {
                  __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                  {
                      Py_ssize_t __pyx_temp_extent_0 = __pyx_t_21.shape[0];
                      Py_ssize_t __pyx_temp_stride_0 = __pyx_t_21.strides[0];
                      char *__pyx_temp_pointer_0;
                      Py_ssize_t __pyx_temp_idx_0;
                      __pyx_temp_pointer_0 = __pyx_t_21.data;
                      for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                        *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                        __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                      }
                  }
              }
              __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
              __pyx_t_21.memview = NULL;
              __pyx_t_21.data = NULL;
    /* … */
              __pyx_t_22.data = __pyx_v_painting.data;
              __pyx_t_22.memview = __pyx_v_painting.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_22, 0);
              {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 416, __pyx_L1_error)
        }
            __pyx_t_22.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
              if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_22,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 416, __pyx_L1_error)
    }

    {
                  __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                  {
                      Py_ssize_t __pyx_temp_extent_0 = __pyx_t_22.shape[0];
                      Py_ssize_t __pyx_temp_stride_0 = __pyx_t_22.strides[0];
                      char *__pyx_temp_pointer_0;
                      Py_ssize_t __pyx_temp_idx_0;
                      __pyx_temp_pointer_0 = __pyx_t_22.data;
                      for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                        *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                        __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                      }
                  }
              }
              __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
              __pyx_t_22.memview = NULL;
              __pyx_t_22.data = NULL;
    /* … */
              __pyx_t_22.data = __pyx_v_painting.data;
              __pyx_t_22.memview = __pyx_v_painting.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_22, 0);
              {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 416, __pyx_L1_error)
        }
            __pyx_t_22.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
              if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_22,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 416, __pyx_L1_error)
    }

    {
                  __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                  {
                      Py_ssize_t __pyx_temp_extent_0 = __pyx_t_22.shape[0];
                      Py_ssize_t __pyx_temp_stride_0 = __pyx_t_22.strides[0];
                      char *__pyx_temp_pointer_0;
                      Py_ssize_t __pyx_temp_idx_0;
                      __pyx_temp_pointer_0 = __pyx_t_22.data;
                      for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                        *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                        __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                      }
                  }
              }
              __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
              __pyx_t_22.memview = NULL;
              __pyx_t_22.data = NULL;
    /* … */
              __pyx_t_22.data = __pyx_v_painting.data;
              __pyx_t_22.memview = __pyx_v_painting.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_22, 0);
              {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 416, __pyx_L1_error)
        }
            __pyx_t_22.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
              if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_22,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 416, __pyx_L1_error)
    }

    {
                  __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                  {
                      Py_ssize_t __pyx_temp_extent_0 = __pyx_t_22.shape[0];
                      Py_ssize_t __pyx_temp_stride_0 = __pyx_t_22.strides[0];
                      char *__pyx_temp_pointer_0;
                      Py_ssize_t __pyx_temp_idx_0;
                      __pyx_temp_pointer_0 = __pyx_t_22.data;
                      for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                        *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                        __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                      }
                  }
              }
              __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
              __pyx_t_22.memview = NULL;
              __pyx_t_22.data = NULL;
    /* … */
              __pyx_t_22.data = __pyx_v_painting.data;
              __pyx_t_22.memview = __pyx_v_painting.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_22, 0);
              {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 416, __pyx_L1_error)
        }
            __pyx_t_22.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
              if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_22,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 416, __pyx_L1_error)
    }

    {
                  __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                  {
                      Py_ssize_t __pyx_temp_extent_0 = __pyx_t_22.shape[0];
                      Py_ssize_t __pyx_temp_stride_0 = __pyx_t_22.strides[0];
                      char *__pyx_temp_pointer_0;
                      Py_ssize_t __pyx_temp_idx_0;
                      __pyx_temp_pointer_0 = __pyx_t_22.data;
                      for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                        *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                        __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                      }
                  }
              }
              __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
              __pyx_t_22.memview = NULL;
              __pyx_t_22.data = NULL;
    /* … */
              __pyx_t_22.data = __pyx_v_painting.data;
              __pyx_t_22.memview = __pyx_v_painting.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_22, 0);
              {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 416, __pyx_L1_error)
        }
            __pyx_t_22.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
              if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_22,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 416, __pyx_L1_error)
    }

    {
                  __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                  {
                      Py_ssize_t __pyx_temp_extent_0 = __pyx_t_22.shape[0];
                      Py_ssize_t __pyx_temp_stride_0 = __pyx_t_22.strides[0];
                      char *__pyx_temp_pointer_0;
                      Py_ssize_t __pyx_temp_idx_0;
                      __pyx_temp_pointer_0 = __pyx_t_22.data;
                      for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                        *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                        __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                      }
                  }
              }
              __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
              __pyx_t_22.memview = NULL;
              __pyx_t_22.data = NULL;

    +0417:                     prefixes.append((pp_start+n0, pp_stop, next_color))

              __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_4);
              PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_11);
              PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
              __pyx_t_4 = 0;
              __pyx_t_11 = 0;
              __pyx_t_2 = 0;
              __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
              __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_4);
              PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_11);
              PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
              __pyx_t_4 = 0;
              __pyx_t_11 = 0;
              __pyx_t_2 = 0;
              __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
              __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_4);
              PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_11);
              PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
              __pyx_t_4 = 0;
              __pyx_t_11 = 0;
              __pyx_t_2 = 0;
              __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_19 == -1)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
              __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_4);
              PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_11);
              PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
              __pyx_t_4 = 0;
              __pyx_t_11 = 0;
              __pyx_t_2 = 0;
              __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
              __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_4);
              PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_11);
              PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
              __pyx_t_4 = 0;
              __pyx_t_11 = 0;
              __pyx_t_2 = 0;
              __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
              __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_4);
              PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_11);
              PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
              __pyx_t_4 = 0;
              __pyx_t_11 = 0;
              __pyx_t_2 = 0;
              __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
              __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_4);
              PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_11);
              PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
              __pyx_t_4 = 0;
              __pyx_t_11 = 0;
              __pyx_t_2 = 0;
              __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
              __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_4);
              PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_11);
              PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
              __pyx_t_4 = 0;
              __pyx_t_11 = 0;
              __pyx_t_2 = 0;
              __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +0418:                     next_color += 1

              __pyx_v_next_color = (__pyx_v_next_color + 1);
    /* … */
              __pyx_v_next_color = (__pyx_v_next_color + 1);
    /* … */
              __pyx_v_next_color = (__pyx_v_next_color + 1);
    /* … */
              __pyx_v_next_color = (__pyx_v_next_color + 1);
    /* … */
              __pyx_v_next_color = (__pyx_v_next_color + 1);
    /* … */
              __pyx_v_next_color = (__pyx_v_next_color + 1);
    /* … */
              __pyx_v_next_color = (__pyx_v_next_color + 1);
    /* … */
              __pyx_v_next_color = (__pyx_v_next_color + 1);

     0419:

    +0420:             elif n1 > n0:

          __pyx_t_9 = ((__pyx_v_n1 > __pyx_v_n0) != 0);
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }
    /* … */
          __pyx_t_9 = ((__pyx_v_n1 > __pyx_v_n0) != 0);
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }
    /* … */
          __pyx_t_9 = ((__pyx_v_n1 > __pyx_v_n0) != 0);
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }
    /* … */
          __pyx_t_9 = ((__pyx_v_n1 > __pyx_v_n0) != 0);
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }
    /* … */
          __pyx_t_9 = ((__pyx_v_n1 > __pyx_v_n0) != 0);
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }
    /* … */
          __pyx_t_9 = ((__pyx_v_n1 > __pyx_v_n0) != 0);
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }
    /* … */
          __pyx_t_9 = ((__pyx_v_n1 > __pyx_v_n0) != 0);
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }
    /* … */
          __pyx_t_9 = ((__pyx_v_n1 > __pyx_v_n0) != 0);
          if (__pyx_t_9) {
    /* … */
            goto __pyx_L10;
          }

     0421:                 # ref is minor, alt is major

    +0422:                 if n0 > 1:

            __pyx_t_9 = ((__pyx_v_n0 > 1) != 0);
            if (__pyx_t_9) {
    /* … */
            }
    /* … */
            __pyx_t_9 = ((__pyx_v_n0 > 1) != 0);
            if (__pyx_t_9) {
    /* … */
            }
    /* … */
            __pyx_t_9 = ((__pyx_v_n0 > 1) != 0);
            if (__pyx_t_9) {
    /* … */
            }
    /* … */
            __pyx_t_9 = ((__pyx_v_n0 > 1) != 0);
            if (__pyx_t_9) {
    /* … */
            }
    /* … */
            __pyx_t_9 = ((__pyx_v_n0 > 1) != 0);
            if (__pyx_t_9) {
    /* … */
            }
    /* … */
            __pyx_t_9 = ((__pyx_v_n0 > 1) != 0);
            if (__pyx_t_9) {
    /* … */
            }
    /* … */
            __pyx_t_9 = ((__pyx_v_n0 > 1) != 0);
            if (__pyx_t_9) {
    /* … */
            }
    /* … */
            __pyx_t_9 = ((__pyx_v_n0 > 1) != 0);
            if (__pyx_t_9) {
    /* … */
            }

    +0423:                     painting[i, pp_start:pp_start+n0] = next_color

              __pyx_t_23.data = __pyx_v_painting.data;
              __pyx_t_23.memview = __pyx_v_painting.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_23, 0);
              {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 423, __pyx_L1_error)
        }
            __pyx_t_23.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
              if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_23,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 423, __pyx_L1_error)
    }

    {
                  __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                  {
                      Py_ssize_t __pyx_temp_extent_0 = __pyx_t_23.shape[0];
                      Py_ssize_t __pyx_temp_stride_0 = __pyx_t_23.strides[0];
                      char *__pyx_temp_pointer_0;
                      Py_ssize_t __pyx_temp_idx_0;
                      __pyx_temp_pointer_0 = __pyx_t_23.data;
                      for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                        *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                        __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                      }
                  }
              }
              __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
              __pyx_t_23.memview = NULL;
              __pyx_t_23.data = NULL;
    /* … */
              __pyx_t_23.data = __pyx_v_painting.data;
              __pyx_t_23.memview = __pyx_v_painting.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_23, 0);
              {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 423, __pyx_L1_error)
        }
            __pyx_t_23.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
              if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_23,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 423, __pyx_L1_error)
    }

    {
                  __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                  {
                      Py_ssize_t __pyx_temp_extent_0 = __pyx_t_23.shape[0];
                      Py_ssize_t __pyx_temp_stride_0 = __pyx_t_23.strides[0];
                      char *__pyx_temp_pointer_0;
                      Py_ssize_t __pyx_temp_idx_0;
                      __pyx_temp_pointer_0 = __pyx_t_23.data;
                      for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                        *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                        __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                      }
                  }
              }
              __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
              __pyx_t_23.memview = NULL;
              __pyx_t_23.data = NULL;
    /* … */
              __pyx_t_22.data = __pyx_v_painting.data;
              __pyx_t_22.memview = __pyx_v_painting.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_22, 0);
              {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 423, __pyx_L1_error)
        }
            __pyx_t_22.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
              if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_22,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 423, __pyx_L1_error)
    }

    {
                  __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                  {
                      Py_ssize_t __pyx_temp_extent_0 = __pyx_t_22.shape[0];
                      Py_ssize_t __pyx_temp_stride_0 = __pyx_t_22.strides[0];
                      char *__pyx_temp_pointer_0;
                      Py_ssize_t __pyx_temp_idx_0;
                      __pyx_temp_pointer_0 = __pyx_t_22.data;
                      for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                        *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                        __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                      }
                  }
              }
              __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
              __pyx_t_22.memview = NULL;
              __pyx_t_22.data = NULL;
    /* … */
              __pyx_t_23.data = __pyx_v_painting.data;
              __pyx_t_23.memview = __pyx_v_painting.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_23, 0);
              {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 423, __pyx_L1_error)
        }
            __pyx_t_23.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
              if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_23,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 423, __pyx_L1_error)
    }

    {
                  __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                  {
                      Py_ssize_t __pyx_temp_extent_0 = __pyx_t_23.shape[0];
                      Py_ssize_t __pyx_temp_stride_0 = __pyx_t_23.strides[0];
                      char *__pyx_temp_pointer_0;
                      Py_ssize_t __pyx_temp_idx_0;
                      __pyx_temp_pointer_0 = __pyx_t_23.data;
                      for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                        *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                        __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                      }
                  }
              }
              __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
              __pyx_t_23.memview = NULL;
              __pyx_t_23.data = NULL;
    /* … */
              __pyx_t_23.data = __pyx_v_painting.data;
              __pyx_t_23.memview = __pyx_v_painting.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_23, 0);
              {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 423, __pyx_L1_error)
        }
            __pyx_t_23.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
              if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_23,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 423, __pyx_L1_error)
    }

    {
                  __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                  {
                      Py_ssize_t __pyx_temp_extent_0 = __pyx_t_23.shape[0];
                      Py_ssize_t __pyx_temp_stride_0 = __pyx_t_23.strides[0];
                      char *__pyx_temp_pointer_0;
                      Py_ssize_t __pyx_temp_idx_0;
                      __pyx_temp_pointer_0 = __pyx_t_23.data;
                      for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                        *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                        __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                      }
                  }
              }
              __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
              __pyx_t_23.memview = NULL;
              __pyx_t_23.data = NULL;
    /* … */
              __pyx_t_23.data = __pyx_v_painting.data;
              __pyx_t_23.memview = __pyx_v_painting.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_23, 0);
              {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 423, __pyx_L1_error)
        }
            __pyx_t_23.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
              if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_23,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 423, __pyx_L1_error)
    }

    {
                  __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                  {
                      Py_ssize_t __pyx_temp_extent_0 = __pyx_t_23.shape[0];
                      Py_ssize_t __pyx_temp_stride_0 = __pyx_t_23.strides[0];
                      char *__pyx_temp_pointer_0;
                      Py_ssize_t __pyx_temp_idx_0;
                      __pyx_temp_pointer_0 = __pyx_t_23.data;
                      for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                        *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                        __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                      }
                  }
              }
              __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
              __pyx_t_23.memview = NULL;
              __pyx_t_23.data = NULL;
    /* … */
              __pyx_t_23.data = __pyx_v_painting.data;
              __pyx_t_23.memview = __pyx_v_painting.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_23, 0);
              {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 423, __pyx_L1_error)
        }
            __pyx_t_23.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
              if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_23,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 423, __pyx_L1_error)
    }

    {
                  __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                  {
                      Py_ssize_t __pyx_temp_extent_0 = __pyx_t_23.shape[0];
                      Py_ssize_t __pyx_temp_stride_0 = __pyx_t_23.strides[0];
                      char *__pyx_temp_pointer_0;
                      Py_ssize_t __pyx_temp_idx_0;
                      __pyx_temp_pointer_0 = __pyx_t_23.data;
                      for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                        *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                        __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                      }
                  }
              }
              __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
              __pyx_t_23.memview = NULL;
              __pyx_t_23.data = NULL;
    /* … */
              __pyx_t_23.data = __pyx_v_painting.data;
              __pyx_t_23.memview = __pyx_v_painting.memview;
              __PYX_INC_MEMVIEW(&__pyx_t_23, 0);
              {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 423, __pyx_L1_error)
        }
            __pyx_t_23.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
              if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_23,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 423, __pyx_L1_error)
    }

    {
                  __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                  {
                      Py_ssize_t __pyx_temp_extent_0 = __pyx_t_23.shape[0];
                      Py_ssize_t __pyx_temp_stride_0 = __pyx_t_23.strides[0];
                      char *__pyx_temp_pointer_0;
                      Py_ssize_t __pyx_temp_idx_0;
                      __pyx_temp_pointer_0 = __pyx_t_23.data;
                      for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                        *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                        __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                      }
                  }
              }
              __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
              __pyx_t_23.memview = NULL;
              __pyx_t_23.data = NULL;

    +0424:                     prefixes.append((pp_start, pp_start+n0, next_color))

              __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_3);
              PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_11);
              PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
              __pyx_t_3 = 0;
              __pyx_t_2 = 0;
              __pyx_t_11 = 0;
              __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
              __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_3);
              PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_11);
              PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
              __pyx_t_3 = 0;
              __pyx_t_2 = 0;
              __pyx_t_11 = 0;
              __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
              __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_3);
              PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_11);
              PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
              __pyx_t_3 = 0;
              __pyx_t_2 = 0;
              __pyx_t_11 = 0;
              __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_19 == -1)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
              __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_3);
              PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_11);
              PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
              __pyx_t_3 = 0;
              __pyx_t_2 = 0;
              __pyx_t_11 = 0;
              __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
              __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_3);
              PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_11);
              PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
              __pyx_t_3 = 0;
              __pyx_t_2 = 0;
              __pyx_t_11 = 0;
              __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
              __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_3);
              PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_11);
              PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
              __pyx_t_3 = 0;
              __pyx_t_2 = 0;
              __pyx_t_11 = 0;
              __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
              __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_3);
              PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_11);
              PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
              __pyx_t_3 = 0;
              __pyx_t_2 = 0;
              __pyx_t_11 = 0;
              __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
              __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_3);
              PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_11);
              PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
              __pyx_t_3 = 0;
              __pyx_t_2 = 0;
              __pyx_t_11 = 0;
              __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 424, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    +0425:                     next_color += 1

              __pyx_v_next_color = (__pyx_v_next_color + 1);
    /* … */
              __pyx_v_next_color = (__pyx_v_next_color + 1);
    /* … */
              __pyx_v_next_color = (__pyx_v_next_color + 1);
    /* … */
              __pyx_v_next_color = (__pyx_v_next_color + 1);
    /* … */
              __pyx_v_next_color = (__pyx_v_next_color + 1);
    /* … */
              __pyx_v_next_color = (__pyx_v_next_color + 1);
    /* … */
              __pyx_v_next_color = (__pyx_v_next_color + 1);
    /* … */
              __pyx_v_next_color = (__pyx_v_next_color + 1);

    +0426:                 painting[i, pp_start+n0:pp_stop] = pp_color

            __pyx_t_24.data = __pyx_v_painting.data;
            __pyx_t_24.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_24, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 426, __pyx_L1_error)
        }
            __pyx_t_24.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_24,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 426, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_24.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_24.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_24.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
            __pyx_t_24.memview = NULL;
            __pyx_t_24.data = NULL;
    /* … */
            __pyx_t_24.data = __pyx_v_painting.data;
            __pyx_t_24.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_24, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 426, __pyx_L1_error)
        }
            __pyx_t_24.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_24,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 426, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_24.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_24.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_24.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
            __pyx_t_24.memview = NULL;
            __pyx_t_24.data = NULL;
    /* … */
            __pyx_t_23.data = __pyx_v_painting.data;
            __pyx_t_23.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_23, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 426, __pyx_L1_error)
        }
            __pyx_t_23.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_23,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 426, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_23.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_23.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_23.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
            __pyx_t_23.memview = NULL;
            __pyx_t_23.data = NULL;
    /* … */
            __pyx_t_24.data = __pyx_v_painting.data;
            __pyx_t_24.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_24, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 426, __pyx_L1_error)
        }
            __pyx_t_24.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_24,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 426, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_24.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_24.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_24.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
            __pyx_t_24.memview = NULL;
            __pyx_t_24.data = NULL;
    /* … */
            __pyx_t_24.data = __pyx_v_painting.data;
            __pyx_t_24.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_24, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 426, __pyx_L1_error)
        }
            __pyx_t_24.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_24,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 426, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_24.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_24.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_24.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
            __pyx_t_24.memview = NULL;
            __pyx_t_24.data = NULL;
    /* … */
            __pyx_t_24.data = __pyx_v_painting.data;
            __pyx_t_24.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_24, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 426, __pyx_L1_error)
        }
            __pyx_t_24.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_24,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 426, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_24.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_24.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_24.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
            __pyx_t_24.memview = NULL;
            __pyx_t_24.data = NULL;
    /* … */
            __pyx_t_24.data = __pyx_v_painting.data;
            __pyx_t_24.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_24, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 426, __pyx_L1_error)
        }
            __pyx_t_24.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_24,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 426, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_24.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_24.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_24.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
            __pyx_t_24.memview = NULL;
            __pyx_t_24.data = NULL;
    /* … */
            __pyx_t_24.data = __pyx_v_painting.data;
            __pyx_t_24.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_24, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 426, __pyx_L1_error)
        }
            __pyx_t_24.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_24,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 426, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_24.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_24.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_24.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
            __pyx_t_24.memview = NULL;
            __pyx_t_24.data = NULL;

    +0427:                 prefixes.append((pp_start+n0, pp_stop, pp_color))

            __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
            __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
            __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_19 == -1)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
            __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
            __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
            __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
            __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
            __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 427, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     0428:

    +0429:             elif n0 == n1 and n0 > 1:

          __pyx_t_8 = ((__pyx_v_n0 == __pyx_v_n1) != 0);
          if (__pyx_t_8) {
          } else {
            __pyx_t_9 = __pyx_t_8;
            goto __pyx_L15_bool_binop_done;
          }
          __pyx_t_8 = ((__pyx_v_n0 > 1) != 0);
          __pyx_t_9 = __pyx_t_8;
          __pyx_L15_bool_binop_done:;
          if (__pyx_t_9) {
    /* … */
          }
          __pyx_L10:;
    /* … */
          __pyx_t_8 = ((__pyx_v_n0 == __pyx_v_n1) != 0);
          if (__pyx_t_8) {
          } else {
            __pyx_t_9 = __pyx_t_8;
            goto __pyx_L15_bool_binop_done;
          }
          __pyx_t_8 = ((__pyx_v_n0 > 1) != 0);
          __pyx_t_9 = __pyx_t_8;
          __pyx_L15_bool_binop_done:;
          if (__pyx_t_9) {
    /* … */
          }
          __pyx_L10:;
    /* … */
          __pyx_t_8 = ((__pyx_v_n0 == __pyx_v_n1) != 0);
          if (__pyx_t_8) {
          } else {
            __pyx_t_9 = __pyx_t_8;
            goto __pyx_L15_bool_binop_done;
          }
          __pyx_t_8 = ((__pyx_v_n0 > 1) != 0);
          __pyx_t_9 = __pyx_t_8;
          __pyx_L15_bool_binop_done:;
          if (__pyx_t_9) {
    /* … */
          }
          __pyx_L10:;
    /* … */
          __pyx_t_8 = ((__pyx_v_n0 == __pyx_v_n1) != 0);
          if (__pyx_t_8) {
          } else {
            __pyx_t_9 = __pyx_t_8;
            goto __pyx_L15_bool_binop_done;
          }
          __pyx_t_8 = ((__pyx_v_n0 > 1) != 0);
          __pyx_t_9 = __pyx_t_8;
          __pyx_L15_bool_binop_done:;
          if (__pyx_t_9) {
    /* … */
          }
          __pyx_L10:;
    /* … */
          __pyx_t_8 = ((__pyx_v_n0 == __pyx_v_n1) != 0);
          if (__pyx_t_8) {
          } else {
            __pyx_t_9 = __pyx_t_8;
            goto __pyx_L15_bool_binop_done;
          }
          __pyx_t_8 = ((__pyx_v_n0 > 1) != 0);
          __pyx_t_9 = __pyx_t_8;
          __pyx_L15_bool_binop_done:;
          if (__pyx_t_9) {
    /* … */
          }
          __pyx_L10:;
    /* … */
          __pyx_t_8 = ((__pyx_v_n0 == __pyx_v_n1) != 0);
          if (__pyx_t_8) {
          } else {
            __pyx_t_9 = __pyx_t_8;
            goto __pyx_L15_bool_binop_done;
          }
          __pyx_t_8 = ((__pyx_v_n0 > 1) != 0);
          __pyx_t_9 = __pyx_t_8;
          __pyx_L15_bool_binop_done:;
          if (__pyx_t_9) {
    /* … */
          }
          __pyx_L10:;
    /* … */
          __pyx_t_8 = ((__pyx_v_n0 == __pyx_v_n1) != 0);
          if (__pyx_t_8) {
          } else {
            __pyx_t_9 = __pyx_t_8;
            goto __pyx_L15_bool_binop_done;
          }
          __pyx_t_8 = ((__pyx_v_n0 > 1) != 0);
          __pyx_t_9 = __pyx_t_8;
          __pyx_L15_bool_binop_done:;
          if (__pyx_t_9) {
    /* … */
          }
          __pyx_L10:;
    /* … */
          __pyx_t_8 = ((__pyx_v_n0 == __pyx_v_n1) != 0);
          if (__pyx_t_8) {
          } else {
            __pyx_t_9 = __pyx_t_8;
            goto __pyx_L15_bool_binop_done;
          }
          __pyx_t_8 = ((__pyx_v_n0 > 1) != 0);
          __pyx_t_9 = __pyx_t_8;
          __pyx_L15_bool_binop_done:;
          if (__pyx_t_9) {
    /* … */
          }
          __pyx_L10:;

     0430:                 # same number of ref and alt alleles, arbitrarily pick ref as major

    +0431:                 painting[i, pp_start:pp_start+n0] = pp_color

            __pyx_t_25.data = __pyx_v_painting.data;
            __pyx_t_25.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_25, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 431, __pyx_L1_error)
        }
            __pyx_t_25.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_25,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 431, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_25.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_25.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_25.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_25, 1);
            __pyx_t_25.memview = NULL;
            __pyx_t_25.data = NULL;
    /* … */
            __pyx_t_25.data = __pyx_v_painting.data;
            __pyx_t_25.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_25, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 431, __pyx_L1_error)
        }
            __pyx_t_25.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_25,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 431, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_25.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_25.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_25.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_25, 1);
            __pyx_t_25.memview = NULL;
            __pyx_t_25.data = NULL;
    /* … */
            __pyx_t_24.data = __pyx_v_painting.data;
            __pyx_t_24.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_24, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 431, __pyx_L1_error)
        }
            __pyx_t_24.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_24,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 431, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_24.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_24.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_24.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
            __pyx_t_24.memview = NULL;
            __pyx_t_24.data = NULL;
    /* … */
            __pyx_t_25.data = __pyx_v_painting.data;
            __pyx_t_25.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_25, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 431, __pyx_L1_error)
        }
            __pyx_t_25.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_25,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 431, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_25.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_25.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_25.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_25, 1);
            __pyx_t_25.memview = NULL;
            __pyx_t_25.data = NULL;
    /* … */
            __pyx_t_25.data = __pyx_v_painting.data;
            __pyx_t_25.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_25, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 431, __pyx_L1_error)
        }
            __pyx_t_25.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_25,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 431, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_25.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_25.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_25.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_25, 1);
            __pyx_t_25.memview = NULL;
            __pyx_t_25.data = NULL;
    /* … */
            __pyx_t_25.data = __pyx_v_painting.data;
            __pyx_t_25.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_25, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 431, __pyx_L1_error)
        }
            __pyx_t_25.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_25,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 431, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_25.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_25.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_25.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_25, 1);
            __pyx_t_25.memview = NULL;
            __pyx_t_25.data = NULL;
    /* … */
            __pyx_t_25.data = __pyx_v_painting.data;
            __pyx_t_25.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_25, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 431, __pyx_L1_error)
        }
            __pyx_t_25.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_25,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 431, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_25.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_25.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_25.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_25, 1);
            __pyx_t_25.memview = NULL;
            __pyx_t_25.data = NULL;
    /* … */
            __pyx_t_25.data = __pyx_v_painting.data;
            __pyx_t_25.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_25, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 431, __pyx_L1_error)
        }
            __pyx_t_25.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_25,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        __pyx_v_pp_start,
        (__pyx_v_pp_start + __pyx_v_n0),
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 431, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_pp_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_25.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_25.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_25.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_25, 1);
            __pyx_t_25.memview = NULL;
            __pyx_t_25.data = NULL;

    +0432:                 prefixes.append((pp_start, pp_start+n0, pp_color))

            __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
            __pyx_t_3 = 0;
            __pyx_t_2 = 0;
            __pyx_t_11 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
            __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
            __pyx_t_3 = 0;
            __pyx_t_2 = 0;
            __pyx_t_11 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
            __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
            __pyx_t_3 = 0;
            __pyx_t_2 = 0;
            __pyx_t_11 = 0;
            __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_19 == -1)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
            __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
            __pyx_t_3 = 0;
            __pyx_t_2 = 0;
            __pyx_t_11 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
            __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
            __pyx_t_3 = 0;
            __pyx_t_2 = 0;
            __pyx_t_11 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
            __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
            __pyx_t_3 = 0;
            __pyx_t_2 = 0;
            __pyx_t_11 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
            __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
            __pyx_t_3 = 0;
            __pyx_t_2 = 0;
            __pyx_t_11 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
            __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_pp_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = __Pyx_PyInt_From_npy_int32(__pyx_v_pp_color); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
            __pyx_t_3 = 0;
            __pyx_t_2 = 0;
            __pyx_t_11 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_4); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 432, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    +0433:                 painting[i, pp_start+n0:pp_stop] = next_color

            __pyx_t_26.data = __pyx_v_painting.data;
            __pyx_t_26.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_26, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 433, __pyx_L1_error)
        }
            __pyx_t_26.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_26,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 433, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_26.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_26.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_26.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_26, 1);
            __pyx_t_26.memview = NULL;
            __pyx_t_26.data = NULL;
    /* … */
            __pyx_t_26.data = __pyx_v_painting.data;
            __pyx_t_26.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_26, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 433, __pyx_L1_error)
        }
            __pyx_t_26.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_26,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 433, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_26.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_26.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_26.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_26, 1);
            __pyx_t_26.memview = NULL;
            __pyx_t_26.data = NULL;
    /* … */
            __pyx_t_25.data = __pyx_v_painting.data;
            __pyx_t_25.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_25, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 433, __pyx_L1_error)
        }
            __pyx_t_25.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_25,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 433, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_25.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_25.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_25.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_25, 1);
            __pyx_t_25.memview = NULL;
            __pyx_t_25.data = NULL;
    /* … */
            __pyx_t_26.data = __pyx_v_painting.data;
            __pyx_t_26.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_26, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 433, __pyx_L1_error)
        }
            __pyx_t_26.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_26,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 433, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_26.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_26.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_26.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_26, 1);
            __pyx_t_26.memview = NULL;
            __pyx_t_26.data = NULL;
    /* … */
            __pyx_t_26.data = __pyx_v_painting.data;
            __pyx_t_26.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_26, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 433, __pyx_L1_error)
        }
            __pyx_t_26.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_26,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 433, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_26.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_26.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_26.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_26, 1);
            __pyx_t_26.memview = NULL;
            __pyx_t_26.data = NULL;
    /* … */
            __pyx_t_26.data = __pyx_v_painting.data;
            __pyx_t_26.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_26, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 433, __pyx_L1_error)
        }
            __pyx_t_26.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_26,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 433, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_26.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_26.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_26.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_26, 1);
            __pyx_t_26.memview = NULL;
            __pyx_t_26.data = NULL;
    /* … */
            __pyx_t_26.data = __pyx_v_painting.data;
            __pyx_t_26.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_26, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 433, __pyx_L1_error)
        }
            __pyx_t_26.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_26,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 433, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_26.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_26.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_26.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_26, 1);
            __pyx_t_26.memview = NULL;
            __pyx_t_26.data = NULL;
    /* … */
            __pyx_t_26.data = __pyx_v_painting.data;
            __pyx_t_26.memview = __pyx_v_painting.memview;
            __PYX_INC_MEMVIEW(&__pyx_t_26, 0);
            {
        Py_ssize_t __pyx_tmp_idx = __pyx_v_i;
        Py_ssize_t __pyx_tmp_shape = __pyx_v_painting.shape[0];
        Py_ssize_t __pyx_tmp_stride = __pyx_v_painting.strides[0];
        if (0 && (__pyx_tmp_idx < 0))
            __pyx_tmp_idx += __pyx_tmp_shape;
        if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
            PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)");
            __PYX_ERR(0, 433, __pyx_L1_error)
        }
            __pyx_t_26.data += __pyx_tmp_idx * __pyx_tmp_stride;
    }

    __pyx_t_18 = -1;
            if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_26,
        __pyx_v_painting.shape[1], __pyx_v_painting.strides[1], __pyx_v_painting.suboffsets[1],
        1,
        0,
        &__pyx_t_18,
        (__pyx_v_pp_start + __pyx_v_n0),
        __pyx_v_pp_stop,
        0,
        1,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 433, __pyx_L1_error)
    }

    {
                __pyx_t_5numpy_int32_t __pyx_temp_scalar = __pyx_v_next_color;
                {
                    Py_ssize_t __pyx_temp_extent_0 = __pyx_t_26.shape[0];
                    Py_ssize_t __pyx_temp_stride_0 = __pyx_t_26.strides[0];
                    char *__pyx_temp_pointer_0;
                    Py_ssize_t __pyx_temp_idx_0;
                    __pyx_temp_pointer_0 = __pyx_t_26.data;
                    for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                      *((__pyx_t_5numpy_int32_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                      __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                    }
                }
            }
            __PYX_XDEC_MEMVIEW(&__pyx_t_26, 1);
            __pyx_t_26.memview = NULL;
            __pyx_t_26.data = NULL;

    +0434:                 prefixes.append((pp_start+n0, pp_stop, next_color))

            __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
            __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
            __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_19 == -1)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
            __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
            __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
            __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
            __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
            __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_pp_start + __pyx_v_n0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_pp_stop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_2 = __Pyx_PyInt_From_npy_int32(__pyx_v_next_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
            __pyx_t_4 = 0;
            __pyx_t_11 = 0;
            __pyx_t_2 = 0;
            __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_prefixes, __pyx_t_3); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 434, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +0435:                 next_color += 1

            __pyx_v_next_color = (__pyx_v_next_color + 1);
    /* … */
            __pyx_v_next_color = (__pyx_v_next_color + 1);
    /* … */
            __pyx_v_next_color = (__pyx_v_next_color + 1);
    /* … */
            __pyx_v_next_color = (__pyx_v_next_color + 1);
    /* … */
            __pyx_v_next_color = (__pyx_v_next_color + 1);
    /* … */
            __pyx_v_next_color = (__pyx_v_next_color + 1);
    /* … */
            __pyx_v_next_color = (__pyx_v_next_color + 1);
    /* … */
            __pyx_v_next_color = (__pyx_v_next_color + 1);

     0436:

    +0437:     return np.asarray(painting)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_painting, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_11) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11); __pyx_t_11 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_painting, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_11) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11); __pyx_t_11 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_painting, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_11) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11); __pyx_t_11 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_painting, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_11) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11); __pyx_t_11 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_painting, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_11) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11); __pyx_t_11 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_painting, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_11) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11); __pyx_t_11 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_painting, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_11) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11); __pyx_t_11 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_painting, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_11) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11); __pyx_t_11 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     0438:

     0439:

     0440: @cython.boundscheck(False)

     0441: @cython.wraparound(False)

     0442: @cython.cdivision(True)

    +0443: cpdef cnp.float64_t ssl2ihh(cnp.int32_t[:] ssl,

    static PyObject *__pyx_pw_5allel_3opt_5stats_21ssl2ihh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static __pyx_t_5numpy_float64_t __pyx_f_5allel_3opt_5stats_ssl2ihh(__Pyx_memviewslice __pyx_v_ssl, __pyx_t_5numpy_int32_t __pyx_v_l_max, Py_ssize_t __pyx_v_variant_idx, __Pyx_memviewslice __pyx_v_gaps, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_5allel_3opt_5stats_ssl2ihh *__pyx_optional_args) {
      __pyx_t_5numpy_float64_t __pyx_v_min_ehh = ((__pyx_t_5numpy_float64_t)0.0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_WriteUnraisable("allel.opt.stats.ssl2ihh", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_TraceReturn(Py_None, 1);
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_21ssl2ihh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_5allel_3opt_5stats_20ssl2ihh[] = "Compute integrated haplotype homozygosity from shared suffix lengths.\n\n    Parameters\n    ----------\n    ssl : ndarray, int32, shape (n_pairs,)\n        Shared suffix lengths between all haplotype pairs.\n    l_max : int\n        Largest value within `ssl`.\n    variant_idx : int\n        Current variant index.\n    gaps : ndarray, float64, shape (n_variants - 1,)\n        Gaps between variants.\n    min_ehh : float\n        Minimum EHH below which IHH computation will be truncated.\n    include_edges : bool\n        If True, report results for variants where EHH does not fall below the\n        specified minimum before reaching the contig end.\n\n    Returns\n    -------\n    ihh : float\n        Integrated haplotype homozygosity.\n\n    ";
    static PyObject *__pyx_pw_5allel_3opt_5stats_21ssl2ihh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int32_t __pyx_v_l_max;
      Py_ssize_t __pyx_v_variant_idx;
      __Pyx_memviewslice __pyx_v_gaps = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_min_ehh;
      int __pyx_v_include_edges;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ssl2ihh (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ssl,&__pyx_n_s_l_max,&__pyx_n_s_variant_idx,&__pyx_n_s_gaps,&__pyx_n_s_min_ehh,&__pyx_n_s_include_edges,0};
        PyObject* values[6] = {0,0,0,0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
            case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ssl)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_l_max)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ssl2ihh", 0, 4, 6, 1); __PYX_ERR(0, 443, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_variant_idx)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ssl2ihh", 0, 4, 6, 2); __PYX_ERR(0, 443, __pyx_L3_error)
            }
            case  3:
            if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gaps)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ssl2ihh", 0, 4, 6, 3); __PYX_ERR(0, 443, __pyx_L3_error)
            }
            case  4:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_ehh);
              if (value) { values[4] = value; kw_args--; }
            }
            case  5:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_include_edges);
              if (value) { values[5] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ssl2ihh") < 0)) __PYX_ERR(0, 443, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
            case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_ssl = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_ssl.memview)) __PYX_ERR(0, 443, __pyx_L3_error)
        __pyx_v_l_max = __Pyx_PyInt_As_npy_int32(values[1]); if (unlikely((__pyx_v_l_max == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L3_error)
        __pyx_v_variant_idx = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_variant_idx == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 445, __pyx_L3_error)
        __pyx_v_gaps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_gaps.memview)) __PYX_ERR(0, 446, __pyx_L3_error)
        if (values[4]) {
          __pyx_v_min_ehh = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_min_ehh == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L3_error)
        } else {
          __pyx_v_min_ehh = ((__pyx_t_5numpy_float64_t)0.0);
        }
        if (values[5]) {
          __pyx_v_include_edges = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_include_edges == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L3_error)
        } else {
    /* … */
      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_20ssl2ihh(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_ssl, __pyx_t_5numpy_int32_t __pyx_v_l_max, Py_ssize_t __pyx_v_variant_idx, __Pyx_memviewslice __pyx_v_gaps, __pyx_t_5numpy_float64_t __pyx_v_min_ehh, int __pyx_v_include_edges) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ssl2ihh", 0);
      __Pyx_TraceCall("ssl2ihh (wrapper)", __pyx_f[0], 443, 0, __PYX_ERR(0, 443, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_v_ssl.memview)) { __Pyx_RaiseUnboundLocalError("ssl"); __PYX_ERR(0, 443, __pyx_L1_error) }
      if (unlikely(!__pyx_v_gaps.memview)) { __Pyx_RaiseUnboundLocalError("gaps"); __PYX_ERR(0, 443, __pyx_L1_error) }
      __pyx_t_2.__pyx_n = 2;
      __pyx_t_2.min_ehh = __pyx_v_min_ehh;
      __pyx_t_2.include_edges = __pyx_v_include_edges;
      __pyx_t_1 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_v_ssl, __pyx_v_l_max, __pyx_v_variant_idx, __pyx_v_gaps, 0, &__pyx_t_2);
      __pyx_t_3 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("allel.opt.stats.ssl2ihh", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gaps, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
    struct __pyx_opt_args_5allel_3opt_5stats_ssl2ihh {
      int __pyx_n;
      __pyx_t_5numpy_float64_t min_ehh;
      int include_edges;
    };

     0444:                             cnp.int32_t l_max,

     0445:                             Py_ssize_t variant_idx,

     0446:                             cnp.float64_t[:] gaps,

     0447:                             cnp.float64_t min_ehh=0,

    +0448:                             bint include_edges=False) nogil:

      int __pyx_v_include_edges = ((int)0);
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_gap_idx;
      Py_ssize_t __pyx_v_n_pairs;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_float64_t __pyx_v_ehh_prv;
      __pyx_t_5numpy_float64_t __pyx_v_ehh_cur;
      __pyx_t_5numpy_float64_t __pyx_v_ihh;
      __pyx_t_5numpy_float64_t __pyx_v_gap;
      __pyx_t_5numpy_float64_t __pyx_v_n_pairs_ident;
      int *__pyx_v_hh_breaks;
      __pyx_t_5numpy_float64_t __pyx_r;
      __Pyx_TraceDeclarations
      __Pyx_TraceCall("ssl2ihh", __pyx_f[0], 443, 1, __PYX_ERR(0, 443, __pyx_L1_error));
      if (__pyx_optional_args) {
        if (__pyx_optional_args->__pyx_n > 0) {
          __pyx_v_min_ehh = __pyx_optional_args->min_ehh;
          if (__pyx_optional_args->__pyx_n > 1) {
            __pyx_v_include_edges = __pyx_optional_args->include_edges;
          }
        }
      }
    /* … */
          __pyx_v_include_edges = ((int)0);
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ssl2ihh", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 443, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.ssl2ihh", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_20ssl2ihh(__pyx_self, __pyx_v_ssl, __pyx_v_l_max, __pyx_v_variant_idx, __pyx_v_gaps, __pyx_v_min_ehh, __pyx_v_include_edges);

     0449:     """Compute integrated haplotype homozygosity from shared suffix lengths.

     0450:

     0451:     Parameters

     0452:     ----------

     0453:     ssl : ndarray, int32, shape (n_pairs,)

     0454:         Shared suffix lengths between all haplotype pairs.

     0455:     l_max : int

     0456:         Largest value within `ssl`.

     0457:     variant_idx : int

     0458:         Current variant index.

     0459:     gaps : ndarray, float64, shape (n_variants - 1,)

     0460:         Gaps between variants.

     0461:     min_ehh : float

     0462:         Minimum EHH below which IHH computation will be truncated.

     0463:     include_edges : bool

     0464:         If True, report results for variants where EHH does not fall below the

     0465:         specified minimum before reaching the contig end.

     0466:

     0467:     Returns

     0468:     -------

     0469:     ihh : float

     0470:         Integrated haplotype homozygosity.

     0471:

     0472:     """

     0473:

     0474:     cdef:

     0475:         Py_ssize_t i, j, gap_idx, n_pairs

     0476:         cnp.int32_t l

     0477:         cnp.float64_t ehh_prv, ehh_cur, ihh, ret, gap, n_pairs_ident

     0478:         int *hh_breaks

     0479:

     0480:     # initialize

    +0481:     n_pairs = ssl.shape[0]

      __pyx_v_n_pairs = (__pyx_v_ssl.shape[0]);

     0482:

     0483:     # only compute if at least 1 pair

    +0484:     if n_pairs > 0:

      __pyx_t_1 = ((__pyx_v_n_pairs > 0) != 0);
      if (__pyx_t_1) {
    /* … */
      }

     0485:

     0486:         # initialise

    +0487:         ihh = 0

        __pyx_v_ihh = 0.0;

     0488:

     0489:         # find breaks in haplotype homozygosity via bincount

    +0490:         hh_breaks = <int *>malloc((l_max + 1) * sizeof(int))

        __pyx_v_hh_breaks = ((int *)malloc(((__pyx_v_l_max + 1) * (sizeof(int)))));

     0491:

    +0492:         try:

        /*try:*/ {

     0493:

     0494:             # do bincount

    +0495:             memset(hh_breaks, 0, (l_max + 1) * sizeof(int))

          memset(__pyx_v_hh_breaks, 0, ((__pyx_v_l_max + 1) * (sizeof(int))));

    +0496:             for j in range(n_pairs):

          __pyx_t_2 = __pyx_v_n_pairs;
          for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
            __pyx_v_j = __pyx_t_3;

    +0497:                 l = ssl[j]

            __pyx_t_4 = __pyx_v_j;
            __pyx_v_l = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_4 * __pyx_v_ssl.strides[0]) )));

    +0498:                 hh_breaks[l] += 1

            __pyx_t_5 = __pyx_v_l;
            (__pyx_v_hh_breaks[__pyx_t_5]) = ((__pyx_v_hh_breaks[__pyx_t_5]) + 1);
          }

     0499:

     0500:             # initialise EHH

    +0501:             n_pairs_ident = n_pairs - hh_breaks[0]

          __pyx_v_n_pairs_ident = (__pyx_v_n_pairs - (__pyx_v_hh_breaks[0]));

    +0502:             ehh_prv = n_pairs_ident / n_pairs

          __pyx_v_ehh_prv = (__pyx_v_n_pairs_ident / ((__pyx_t_5numpy_float64_t)__pyx_v_n_pairs));

     0503:

     0504:             # edge case - check if haplotype homozygosity is already below

     0505:             # min_ehh

    +0506:             if ehh_prv <= min_ehh:

          __pyx_t_1 = ((__pyx_v_ehh_prv <= __pyx_v_min_ehh) != 0);
          if (__pyx_t_1) {
    /* … */
          }

    +0507:                 return 0

            __pyx_r = 0.0;
            goto __pyx_L4_return;

     0508:

     0509:             # iterate backwards over variants

    +0510:             for i in range(1, variant_idx + 1):

          __pyx_t_2 = (__pyx_v_variant_idx + 1);
          for (__pyx_t_3 = 1; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
            __pyx_v_i = __pyx_t_3;

     0511:

     0512:                 # compute current EHH

    +0513:                 n_pairs_ident -= hh_breaks[i]

            __pyx_v_n_pairs_ident = (__pyx_v_n_pairs_ident - (__pyx_v_hh_breaks[__pyx_v_i]));

    +0514:                 ehh_cur = n_pairs_ident / n_pairs

            __pyx_v_ehh_cur = (__pyx_v_n_pairs_ident / ((__pyx_t_5numpy_float64_t)__pyx_v_n_pairs));

     0515:

     0516:                 # determine gap width

    +0517:                 gap_idx = variant_idx - i

            __pyx_v_gap_idx = (__pyx_v_variant_idx - __pyx_v_i);

    +0518:                 gap = gaps[gap_idx]

            __pyx_t_6 = __pyx_v_gap_idx;
            __pyx_v_gap = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_gaps.data + __pyx_t_6 * __pyx_v_gaps.strides[0]) )));

     0519:

     0520:                 # handle very long gaps

    +0521:                 if gap < 0:

            __pyx_t_1 = ((__pyx_v_gap < 0.0) != 0);
            if (__pyx_t_1) {
    /* … */
            }

    +0522:                     return nan64

              __pyx_r = __pyx_v_5allel_3opt_5stats_nan64;
              goto __pyx_L4_return;

     0523:

     0524:                 # accumulate IHH

    +0525:                 ihh += gap * (ehh_cur + ehh_prv) / 2

            __pyx_v_ihh = (__pyx_v_ihh + ((__pyx_v_gap * (__pyx_v_ehh_cur + __pyx_v_ehh_prv)) / 2.0));

     0526:

     0527:                 # check if we've reached minimum EHH

    +0528:                 if ehh_cur <= min_ehh:

            __pyx_t_1 = ((__pyx_v_ehh_cur <= __pyx_v_min_ehh) != 0);
            if (__pyx_t_1) {
    /* … */
            }

    +0529:                     return ihh

              __pyx_r = __pyx_v_ihh;
              goto __pyx_L4_return;

     0530:

     0531:                 # move on

    +0532:                 ehh_prv = ehh_cur

            __pyx_v_ehh_prv = __pyx_v_ehh_cur;
          }
        }

     0533:

     0534:         finally:

     0535:             # clean up

    +0536:             free(hh_breaks)

        /*finally:*/ {
          /*normal exit:*/{
            free(__pyx_v_hh_breaks);
            goto __pyx_L6;
          }
          __pyx_L4_return: {
            free(__pyx_v_hh_breaks);
            goto __pyx_L0;
          }
          __pyx_L6:;
        }

     0537:

     0538:         # if we get this far, EHH never decayed below min_ehh

    +0539:         if include_edges:

        __pyx_t_1 = (__pyx_v_include_edges != 0);
        if (__pyx_t_1) {
    /* … */
        }

    +0540:             return ihh

          __pyx_r = __pyx_v_ihh;
          goto __pyx_L0;

     0541:

    +0542:     return nan64

      __pyx_r = __pyx_v_5allel_3opt_5stats_nan64;
      goto __pyx_L0;

     0543:

     0544:

     0545: @cython.boundscheck(False)

     0546: @cython.wraparound(False)

    +0547: def ihh_scan(integer[:, :] h,

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_23ihh_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_5allel_3opt_5stats_22ihh_scan[] = "Scan forwards over haplotypes, computing the integrated haplotype\n    homozygosity backwards for each variant.";
    static PyMethodDef __pyx_mdef_5allel_3opt_5stats_23ihh_scan = {"ihh_scan", (PyCFunction)__pyx_pw_5allel_3opt_5stats_23ihh_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_22ihh_scan};
    static PyObject *__pyx_pw_5allel_3opt_5stats_23ihh_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_signatures = 0;
      PyObject *__pyx_v_args = 0;
      PyObject *__pyx_v_kwargs = 0;
      CYTHON_UNUSED PyObject *__pyx_v_defaults = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0};
        PyObject* values[4] = {0,0,0,0};
        values[2] = __pyx_k__32;
        values[3] = __pyx_k__33;
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 547, __pyx_L3_error)
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults);
              if (value) { values[3] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 547, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        }
        __pyx_v_signatures = values[0];
        __pyx_v_args = values[1];
        __pyx_v_kwargs = values[2];
        __pyx_v_defaults = values[3];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 547, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_22ihh_scan(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_22ihh_scan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
      PyObject *__pyx_v_dest_sig = NULL;
      PyTypeObject *__pyx_v_ndarray = 0;
      PyObject *__pyx_v_numpy = NULL;
      __Pyx_memviewslice __pyx_v_memslice;
      Py_ssize_t __pyx_v_itemsize;
      int __pyx_v_dtype_signed;
      char __pyx_v_kind;
      int __pyx_v____pyx_int32_t_is_signed;
      int __pyx_v____pyx_uint32_t_is_signed;
      int __pyx_v____pyx_uint64_t_is_signed;
      int __pyx_v____pyx_uint16_t_is_signed;
      int __pyx_v____pyx_int16_t_is_signed;
      int __pyx_v____pyx_uint8_t_is_signed;
      int __pyx_v____pyx_int64_t_is_signed;
      int __pyx_v____pyx_int8_t_is_signed;
      PyObject *__pyx_v_arg = NULL;
      PyObject *__pyx_v_dtype = NULL;
      PyObject *__pyx_v_arg_base = NULL;
      PyObject *__pyx_v_candidates = NULL;
      PyObject *__pyx_v_sig = NULL;
      int __pyx_v_match_found;
      PyObject *__pyx_v_src_type = NULL;
      PyObject *__pyx_v_dst_type = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ihh_scan", 0);
      __Pyx_TraceCall("ihh_scan", __pyx_f[0], 547, 0, __PYX_ERR(0, 547, __pyx_L1_error));
      __Pyx_INCREF(__pyx_v_kwargs);
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
      __pyx_v_dest_sig = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_2 = (__pyx_v_kwargs == Py_None);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {
        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1);
        __pyx_t_1 = 0;
      }
      {
        /*try:*/ {
          __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_v_numpy = __pyx_t_1;
          __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 547, __pyx_L4_error)
          __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1);
          __pyx_t_1 = 0;
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L11_try_end;
        __pyx_L4_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
        if (__pyx_t_7) {
          __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 547, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_INCREF(Py_None);
          __Pyx_XDECREF_SET(__pyx_v_ndarray, ((PyTypeObject*)Py_None));
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L5_exception_handled;
        }
        goto __pyx_L6_except_error;
        __pyx_L6_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L1_error;
        __pyx_L5_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        __pyx_L11_try_end:;
      }
      __pyx_v_itemsize = -1L;
      __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1L) < 0);
      __pyx_v____pyx_uint32_t_is_signed = (((__pyx_t_5numpy_uint32_t)-1L) < 0);
      __pyx_v____pyx_uint64_t_is_signed = (((__pyx_t_5numpy_uint64_t)-1L) < 0);
      __pyx_v____pyx_uint16_t_is_signed = (((__pyx_t_5numpy_uint16_t)-1L) < 0);
      __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1L) < 0);
      __pyx_v____pyx_uint8_t_is_signed = (((__pyx_t_5numpy_uint8_t)-1L) < 0);
      __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1L) < 0);
      __pyx_v____pyx_int8_t_is_signed = (((__pyx_t_5numpy_int8_t)-1L) < 0);
      if (unlikely(__pyx_v_args == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 547, __pyx_L1_error)
      }
      __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 547, __pyx_L1_error)
      __pyx_t_3 = ((0 < __pyx_t_10) != 0);
      if (__pyx_t_3) {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 547, __pyx_L1_error)
        }
        __pyx_t_9 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      if (unlikely(__pyx_v_kwargs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 547, __pyx_L1_error)
      }
      __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_h, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {
        if (unlikely(__pyx_v_kwargs == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 547, __pyx_L1_error)
        }
        __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_h); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 547, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      /*else*/ {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(0, 547, __pyx_L1_error)
        }
        __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 547, __pyx_L1_error)
        __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 547, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 547, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 547, __pyx_L1_error)
      }
      __pyx_L14:;
      while (1) {
        __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None));
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {
          __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_dtype = __pyx_t_8;
            __pyx_t_8 = 0;
            goto __pyx_L18;
          }
          __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_arg_base = __pyx_t_8;
            __pyx_t_8 = 0;
            __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
            __pyx_t_2 = (__pyx_t_3 != 0);
            if (__pyx_t_2) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_v_dtype = __pyx_t_8;
              __pyx_t_8 = 0;
              goto __pyx_L19;
            }
            /*else*/ {
              __Pyx_INCREF(Py_None);
              __pyx_v_dtype = Py_None;
            }
            __pyx_L19:;
            goto __pyx_L18;
          }
          /*else*/ {
            __Pyx_INCREF(Py_None);
            __pyx_v_dtype = Py_None;
          }
          __pyx_L18:;
          __pyx_v_itemsize = -1L;
          __pyx_t_2 = (__pyx_v_dtype != Py_None);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_itemsize = __pyx_t_10;
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 547, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_kind = __pyx_t_11;
            __pyx_v_dtype_signed = (__pyx_v_kind == 'i');
            switch (__pyx_v_kind) {
              case 'i':
              case 'u':
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L22_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L26_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L30_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L34_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L38_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L42_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L46_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L50_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              break;
              case 'f':
              break;
              case 'c':
              break;
              case 'O':
              break;
              default: break;
            }
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L54_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L54_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L58_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L58_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L62_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L62_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L66_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L66_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L70_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L70_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L74_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L74_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L78_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L78_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L82_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L82_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
        goto __pyx_L16_break;
      }
      __pyx_L16_break:;
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_candidates = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_10 = 0;
      if (unlikely(__pyx_v_signatures == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 547, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8);
      __pyx_t_8 = __pyx_t_9;
      __pyx_t_9 = 0;
      while (1) {
        __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_13, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7);
        if (unlikely(__pyx_t_14 == 0)) break;
        if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 547, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_v_match_found = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 547, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 547, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /* … */
      __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__34);
      __Pyx_GIVEREF(__pyx_tuple__34);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 547, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
        __Pyx_INCREF(__pyx_v_dest_sig);
        __Pyx_GIVEREF(__pyx_v_dest_sig);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dest_sig);
        __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
          __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_15 = 0;
          __pyx_t_16 = NULL;
        } else {
          __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 547, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 547, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        for (;;) {
          if (likely(!__pyx_t_16)) {
            if (likely(PyList_CheckExact(__pyx_t_9))) {
              if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            } else {
              if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            }
          } else {
            __pyx_t_1 = __pyx_t_16(__pyx_t_9);
            if (unlikely(!__pyx_t_1)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 547, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_1);
          }
          if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
            PyObject* sequence = __pyx_t_1;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 547, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1);
            } else {
              __pyx_t_17 = PyList_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyList_GET_ITEM(sequence, 1);
            }
            __Pyx_INCREF(__pyx_t_17);
            __Pyx_INCREF(__pyx_t_18);
            #else
            __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 547, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 547, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_18);
            #endif
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 547, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
            index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_17);
            index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_18);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) __PYX_ERR(0, 547, __pyx_L1_error)
            __pyx_t_20 = NULL;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            goto __pyx_L90_unpacking_done;
            __pyx_L89_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __pyx_t_20 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 547, __pyx_L1_error)
            __pyx_L90_unpacking_done:;
          }
          __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17);
          __pyx_t_17 = 0;
          __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18);
          __pyx_t_18 = 0;
          __pyx_t_3 = (__pyx_v_dst_type != Py_None);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (__pyx_t_2) {
              __pyx_v_match_found = 1;
              goto __pyx_L92;
            }
            /*else*/ {
              __pyx_v_match_found = 0;
              goto __pyx_L88_break;
            }
            __pyx_L92:;
          }
        }
        __pyx_L88_break:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_2 = (__pyx_v_match_found != 0);
        if (__pyx_t_2) {
          __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 547, __pyx_L1_error)
        }
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
      __pyx_t_3 = ((!__pyx_t_2) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s__8); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__35);
      __Pyx_GIVEREF(__pyx_tuple__35);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 547, __pyx_L1_error)
      }
      __pyx_t_13 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 547, __pyx_L1_error)
      __pyx_t_3 = ((__pyx_t_13 > 1) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__36);
      __Pyx_GIVEREF(__pyx_tuple__36);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 547, __pyx_L1_error)
      }
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_signatures == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 547, __pyx_L1_error)
        }
        __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        goto __pyx_L0;
      }

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_dest_sig);
      __Pyx_XDECREF(__pyx_v_ndarray);
      __Pyx_XDECREF(__pyx_v_numpy);
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XDECREF(__pyx_v_dtype);
      __Pyx_XDECREF(__pyx_v_arg_base);
      __Pyx_XDECREF(__pyx_v_candidates);
      __Pyx_XDECREF(__pyx_v_sig);
      __Pyx_XDECREF(__pyx_v_src_type);
      __Pyx_XDECREF(__pyx_v_dst_type);
      __Pyx_XDECREF(__pyx_v_kwargs);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_306__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__defaults__", 0);
      __Pyx_TraceCall("__defaults__", __pyx_f[0], 547, 0, __PYX_ERR(0, 547, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_min_ehh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_include_edges); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("allel.opt.stats.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_147ihh_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_147ihh_scan = {"__pyx_fuse_0ihh_scan", (PyCFunction)__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_147ihh_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_22ihh_scan};
    static PyObject *__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_147ihh_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gaps = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_min_ehh;
      int __pyx_v_include_edges;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ihh_scan (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_gaps,&__pyx_n_s_min_ehh,&__pyx_n_s_include_edges,0};
        PyObject* values[4] = {0,0,0,0};
        __pyx_defaults8 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self);
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gaps)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ihh_scan", 0, 2, 4, 1); __PYX_ERR(0, 547, __pyx_L3_error)
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_ehh);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_include_edges);
              if (value) { values[3] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ihh_scan") < 0)) __PYX_ERR(0, 547, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 547, __pyx_L3_error)
        __pyx_v_gaps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_gaps.memview)) __PYX_ERR(0, 548, __pyx_L3_error)
        if (values[2]) {
          __pyx_v_min_ehh = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_min_ehh == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 549, __pyx_L3_error)
        } else {
          __pyx_v_min_ehh = __pyx_dynamic_args->__pyx_arg_min_ehh;
        }
        if (values[3]) {
          __pyx_v_include_edges = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_include_edges == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L3_error)
        } else {
          __pyx_v_include_edges = __pyx_dynamic_args->__pyx_arg_include_edges;
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ihh_scan", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 547, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.ihh_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_146ihh_scan(__pyx_self, __pyx_v_h, __pyx_v_gaps, __pyx_v_min_ehh, __pyx_v_include_edges);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_146ihh_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, __Pyx_memviewslice __pyx_v_gaps, __pyx_t_5numpy_float64_t __pyx_v_min_ehh, int __pyx_v_include_edges) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_int32_t __pyx_v_l_max;
      __pyx_t_5numpy_int8_t __pyx_v_a1;
      __pyx_t_5numpy_int8_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vihh = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_ihh;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_0ihh_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_0ihh_scan", __pyx_f[0], 547, 0, __PYX_ERR(0, 547, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_24);
      __Pyx_AddTraceback("allel.opt.stats.ihh_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vihh, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gaps, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_308__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__defaults__", 0);
      __Pyx_TraceCall("__defaults__", __pyx_f[0], 547, 0, __PYX_ERR(0, 547, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self)->__pyx_arg_min_ehh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self)->__pyx_arg_include_edges); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("allel.opt.stats.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_149ihh_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_149ihh_scan = {"__pyx_fuse_1ihh_scan", (PyCFunction)__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_149ihh_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_22ihh_scan};
    static PyObject *__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_149ihh_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gaps = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_min_ehh;
      int __pyx_v_include_edges;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ihh_scan (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_gaps,&__pyx_n_s_min_ehh,&__pyx_n_s_include_edges,0};
        PyObject* values[4] = {0,0,0,0};
        __pyx_defaults9 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self);
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gaps)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ihh_scan", 0, 2, 4, 1); __PYX_ERR(0, 547, __pyx_L3_error)
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_ehh);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_include_edges);
              if (value) { values[3] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ihh_scan") < 0)) __PYX_ERR(0, 547, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 547, __pyx_L3_error)
        __pyx_v_gaps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_gaps.memview)) __PYX_ERR(0, 548, __pyx_L3_error)
        if (values[2]) {
          __pyx_v_min_ehh = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_min_ehh == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 549, __pyx_L3_error)
        } else {
          __pyx_v_min_ehh = __pyx_dynamic_args->__pyx_arg_min_ehh;
        }
        if (values[3]) {
          __pyx_v_include_edges = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_include_edges == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L3_error)
        } else {
          __pyx_v_include_edges = __pyx_dynamic_args->__pyx_arg_include_edges;
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ihh_scan", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 547, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.ihh_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_148ihh_scan(__pyx_self, __pyx_v_h, __pyx_v_gaps, __pyx_v_min_ehh, __pyx_v_include_edges);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_148ihh_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, __Pyx_memviewslice __pyx_v_gaps, __pyx_t_5numpy_float64_t __pyx_v_min_ehh, int __pyx_v_include_edges) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_int32_t __pyx_v_l_max;
      __pyx_t_5numpy_int16_t __pyx_v_a1;
      __pyx_t_5numpy_int16_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vihh = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_ihh;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_1ihh_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_1ihh_scan", __pyx_f[0], 547, 0, __PYX_ERR(0, 547, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_24);
      __Pyx_AddTraceback("allel.opt.stats.ihh_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vihh, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gaps, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_310__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__defaults__", 0);
      __Pyx_TraceCall("__defaults__", __pyx_f[0], 547, 0, __PYX_ERR(0, 547, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_min_ehh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_include_edges); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("allel.opt.stats.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_151ihh_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_151ihh_scan = {"__pyx_fuse_2ihh_scan", (PyCFunction)__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_151ihh_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_22ihh_scan};
    static PyObject *__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_151ihh_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gaps = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_min_ehh;
      int __pyx_v_include_edges;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ihh_scan (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_gaps,&__pyx_n_s_min_ehh,&__pyx_n_s_include_edges,0};
        PyObject* values[4] = {0,0,0,0};
        __pyx_defaults10 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self);
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gaps)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ihh_scan", 0, 2, 4, 1); __PYX_ERR(0, 547, __pyx_L3_error)
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_ehh);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_include_edges);
              if (value) { values[3] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ihh_scan") < 0)) __PYX_ERR(0, 547, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 547, __pyx_L3_error)
        __pyx_v_gaps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_gaps.memview)) __PYX_ERR(0, 548, __pyx_L3_error)
        if (values[2]) {
          __pyx_v_min_ehh = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_min_ehh == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 549, __pyx_L3_error)
        } else {
          __pyx_v_min_ehh = __pyx_dynamic_args->__pyx_arg_min_ehh;
        }
        if (values[3]) {
          __pyx_v_include_edges = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_include_edges == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L3_error)
        } else {
          __pyx_v_include_edges = __pyx_dynamic_args->__pyx_arg_include_edges;
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ihh_scan", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 547, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.ihh_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_150ihh_scan(__pyx_self, __pyx_v_h, __pyx_v_gaps, __pyx_v_min_ehh, __pyx_v_include_edges);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_150ihh_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, __Pyx_memviewslice __pyx_v_gaps, __pyx_t_5numpy_float64_t __pyx_v_min_ehh, int __pyx_v_include_edges) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_int32_t __pyx_v_l_max;
      __pyx_t_5numpy_int32_t __pyx_v_a1;
      __pyx_t_5numpy_int32_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vihh = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_ihh;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_2ihh_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_2ihh_scan", __pyx_f[0], 547, 0, __PYX_ERR(0, 547, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_24);
      __Pyx_AddTraceback("allel.opt.stats.ihh_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vihh, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gaps, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_312__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__defaults__", 0);
      __Pyx_TraceCall("__defaults__", __pyx_f[0], 547, 0, __PYX_ERR(0, 547, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_min_ehh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_include_edges); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("allel.opt.stats.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_153ihh_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_153ihh_scan = {"__pyx_fuse_3ihh_scan", (PyCFunction)__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_153ihh_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_22ihh_scan};
    static PyObject *__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_153ihh_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gaps = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_min_ehh;
      int __pyx_v_include_edges;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ihh_scan (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_gaps,&__pyx_n_s_min_ehh,&__pyx_n_s_include_edges,0};
        PyObject* values[4] = {0,0,0,0};
        __pyx_defaults11 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self);
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gaps)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ihh_scan", 0, 2, 4, 1); __PYX_ERR(0, 547, __pyx_L3_error)
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_ehh);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_include_edges);
              if (value) { values[3] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ihh_scan") < 0)) __PYX_ERR(0, 547, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 547, __pyx_L3_error)
        __pyx_v_gaps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_gaps.memview)) __PYX_ERR(0, 548, __pyx_L3_error)
        if (values[2]) {
          __pyx_v_min_ehh = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_min_ehh == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 549, __pyx_L3_error)
        } else {
          __pyx_v_min_ehh = __pyx_dynamic_args->__pyx_arg_min_ehh;
        }
        if (values[3]) {
          __pyx_v_include_edges = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_include_edges == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L3_error)
        } else {
          __pyx_v_include_edges = __pyx_dynamic_args->__pyx_arg_include_edges;
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ihh_scan", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 547, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.ihh_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_152ihh_scan(__pyx_self, __pyx_v_h, __pyx_v_gaps, __pyx_v_min_ehh, __pyx_v_include_edges);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_152ihh_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, __Pyx_memviewslice __pyx_v_gaps, __pyx_t_5numpy_float64_t __pyx_v_min_ehh, int __pyx_v_include_edges) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_int32_t __pyx_v_l_max;
      __pyx_t_5numpy_int64_t __pyx_v_a1;
      __pyx_t_5numpy_int64_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vihh = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_ihh;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_3ihh_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_3ihh_scan", __pyx_f[0], 547, 0, __PYX_ERR(0, 547, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_24);
      __Pyx_AddTraceback("allel.opt.stats.ihh_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vihh, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gaps, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_314__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__defaults__", 0);
      __Pyx_TraceCall("__defaults__", __pyx_f[0], 547, 0, __PYX_ERR(0, 547, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self)->__pyx_arg_min_ehh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self)->__pyx_arg_include_edges); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("allel.opt.stats.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_155ihh_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_155ihh_scan = {"__pyx_fuse_4ihh_scan", (PyCFunction)__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_155ihh_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_22ihh_scan};
    static PyObject *__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_155ihh_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gaps = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_min_ehh;
      int __pyx_v_include_edges;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ihh_scan (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_gaps,&__pyx_n_s_min_ehh,&__pyx_n_s_include_edges,0};
        PyObject* values[4] = {0,0,0,0};
        __pyx_defaults12 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self);
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gaps)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ihh_scan", 0, 2, 4, 1); __PYX_ERR(0, 547, __pyx_L3_error)
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_ehh);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_include_edges);
              if (value) { values[3] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ihh_scan") < 0)) __PYX_ERR(0, 547, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 547, __pyx_L3_error)
        __pyx_v_gaps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_gaps.memview)) __PYX_ERR(0, 548, __pyx_L3_error)
        if (values[2]) {
          __pyx_v_min_ehh = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_min_ehh == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 549, __pyx_L3_error)
        } else {
          __pyx_v_min_ehh = __pyx_dynamic_args->__pyx_arg_min_ehh;
        }
        if (values[3]) {
          __pyx_v_include_edges = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_include_edges == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L3_error)
        } else {
          __pyx_v_include_edges = __pyx_dynamic_args->__pyx_arg_include_edges;
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ihh_scan", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 547, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.ihh_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_154ihh_scan(__pyx_self, __pyx_v_h, __pyx_v_gaps, __pyx_v_min_ehh, __pyx_v_include_edges);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_154ihh_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, __Pyx_memviewslice __pyx_v_gaps, __pyx_t_5numpy_float64_t __pyx_v_min_ehh, int __pyx_v_include_edges) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_int32_t __pyx_v_l_max;
      __pyx_t_5numpy_uint8_t __pyx_v_a1;
      __pyx_t_5numpy_uint8_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vihh = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_ihh;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_4ihh_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_4ihh_scan", __pyx_f[0], 547, 0, __PYX_ERR(0, 547, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_24);
      __Pyx_AddTraceback("allel.opt.stats.ihh_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vihh, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gaps, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_316__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__defaults__", 0);
      __Pyx_TraceCall("__defaults__", __pyx_f[0], 547, 0, __PYX_ERR(0, 547, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_self)->__pyx_arg_min_ehh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_self)->__pyx_arg_include_edges); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("allel.opt.stats.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_157ihh_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_157ihh_scan = {"__pyx_fuse_5ihh_scan", (PyCFunction)__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_157ihh_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_22ihh_scan};
    static PyObject *__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_157ihh_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gaps = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_min_ehh;
      int __pyx_v_include_edges;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ihh_scan (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_gaps,&__pyx_n_s_min_ehh,&__pyx_n_s_include_edges,0};
        PyObject* values[4] = {0,0,0,0};
        __pyx_defaults13 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_self);
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gaps)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ihh_scan", 0, 2, 4, 1); __PYX_ERR(0, 547, __pyx_L3_error)
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_ehh);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_include_edges);
              if (value) { values[3] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ihh_scan") < 0)) __PYX_ERR(0, 547, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint16_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 547, __pyx_L3_error)
        __pyx_v_gaps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_gaps.memview)) __PYX_ERR(0, 548, __pyx_L3_error)
        if (values[2]) {
          __pyx_v_min_ehh = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_min_ehh == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 549, __pyx_L3_error)
        } else {
          __pyx_v_min_ehh = __pyx_dynamic_args->__pyx_arg_min_ehh;
        }
        if (values[3]) {
          __pyx_v_include_edges = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_include_edges == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L3_error)
        } else {
          __pyx_v_include_edges = __pyx_dynamic_args->__pyx_arg_include_edges;
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ihh_scan", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 547, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.ihh_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_156ihh_scan(__pyx_self, __pyx_v_h, __pyx_v_gaps, __pyx_v_min_ehh, __pyx_v_include_edges);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_156ihh_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, __Pyx_memviewslice __pyx_v_gaps, __pyx_t_5numpy_float64_t __pyx_v_min_ehh, int __pyx_v_include_edges) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_int32_t __pyx_v_l_max;
      __pyx_t_5numpy_uint16_t __pyx_v_a1;
      __pyx_t_5numpy_uint16_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vihh = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_ihh;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_5ihh_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_5ihh_scan", __pyx_f[0], 547, 0, __PYX_ERR(0, 547, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_24);
      __Pyx_AddTraceback("allel.opt.stats.ihh_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vihh, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gaps, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_318__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__defaults__", 0);
      __Pyx_TraceCall("__defaults__", __pyx_f[0], 547, 0, __PYX_ERR(0, 547, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self)->__pyx_arg_min_ehh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self)->__pyx_arg_include_edges); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("allel.opt.stats.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_159ihh_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_159ihh_scan = {"__pyx_fuse_6ihh_scan", (PyCFunction)__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_159ihh_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_22ihh_scan};
    static PyObject *__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_159ihh_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gaps = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_min_ehh;
      int __pyx_v_include_edges;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ihh_scan (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_gaps,&__pyx_n_s_min_ehh,&__pyx_n_s_include_edges,0};
        PyObject* values[4] = {0,0,0,0};
        __pyx_defaults14 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self);
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gaps)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ihh_scan", 0, 2, 4, 1); __PYX_ERR(0, 547, __pyx_L3_error)
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_ehh);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_include_edges);
              if (value) { values[3] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ihh_scan") < 0)) __PYX_ERR(0, 547, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 547, __pyx_L3_error)
        __pyx_v_gaps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_gaps.memview)) __PYX_ERR(0, 548, __pyx_L3_error)
        if (values[2]) {
          __pyx_v_min_ehh = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_min_ehh == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 549, __pyx_L3_error)
        } else {
          __pyx_v_min_ehh = __pyx_dynamic_args->__pyx_arg_min_ehh;
        }
        if (values[3]) {
          __pyx_v_include_edges = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_include_edges == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L3_error)
        } else {
          __pyx_v_include_edges = __pyx_dynamic_args->__pyx_arg_include_edges;
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ihh_scan", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 547, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.ihh_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_158ihh_scan(__pyx_self, __pyx_v_h, __pyx_v_gaps, __pyx_v_min_ehh, __pyx_v_include_edges);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_158ihh_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, __Pyx_memviewslice __pyx_v_gaps, __pyx_t_5numpy_float64_t __pyx_v_min_ehh, int __pyx_v_include_edges) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_int32_t __pyx_v_l_max;
      __pyx_t_5numpy_uint32_t __pyx_v_a1;
      __pyx_t_5numpy_uint32_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vihh = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_ihh;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_6ihh_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_6ihh_scan", __pyx_f[0], 547, 0, __PYX_ERR(0, 547, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_24);
      __Pyx_AddTraceback("allel.opt.stats.ihh_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vihh, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gaps, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_320__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__defaults__", 0);
      __Pyx_TraceCall("__defaults__", __pyx_f[0], 547, 0, __PYX_ERR(0, 547, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self)->__pyx_arg_min_ehh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self)->__pyx_arg_include_edges); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("allel.opt.stats.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_161ihh_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_161ihh_scan = {"__pyx_fuse_7ihh_scan", (PyCFunction)__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_161ihh_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_22ihh_scan};
    static PyObject *__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_161ihh_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gaps = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_min_ehh;
      int __pyx_v_include_edges;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ihh_scan (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_gaps,&__pyx_n_s_min_ehh,&__pyx_n_s_include_edges,0};
        PyObject* values[4] = {0,0,0,0};
        __pyx_defaults15 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self);
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gaps)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ihh_scan", 0, 2, 4, 1); __PYX_ERR(0, 547, __pyx_L3_error)
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_ehh);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_include_edges);
              if (value) { values[3] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ihh_scan") < 0)) __PYX_ERR(0, 547, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint64_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 547, __pyx_L3_error)
        __pyx_v_gaps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_gaps.memview)) __PYX_ERR(0, 548, __pyx_L3_error)
        if (values[2]) {
          __pyx_v_min_ehh = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_min_ehh == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 549, __pyx_L3_error)
        } else {
          __pyx_v_min_ehh = __pyx_dynamic_args->__pyx_arg_min_ehh;
        }
        if (values[3]) {
          __pyx_v_include_edges = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_include_edges == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L3_error)
        } else {
          __pyx_v_include_edges = __pyx_dynamic_args->__pyx_arg_include_edges;
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ihh_scan", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 547, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.ihh_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_160ihh_scan(__pyx_self, __pyx_v_h, __pyx_v_gaps, __pyx_v_min_ehh, __pyx_v_include_edges);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_160ihh_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, __Pyx_memviewslice __pyx_v_gaps, __pyx_t_5numpy_float64_t __pyx_v_min_ehh, int __pyx_v_include_edges) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_int32_t __pyx_v_l_max;
      __pyx_t_5numpy_uint64_t __pyx_v_a1;
      __pyx_t_5numpy_uint64_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vihh = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_ihh;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_7ihh_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_7ihh_scan", __pyx_f[0], 547, 0, __PYX_ERR(0, 547, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_24);
      __Pyx_AddTraceback("allel.opt.stats.ihh_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vihh, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gaps, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
      __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__37);
      __Pyx_GIVEREF(__pyx_tuple__37);
    /* … */
      __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_15);
      PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_15);
      __Pyx_GIVEREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_16);
      __pyx_t_15 = 0;
      __pyx_t_16 = 0;
    /* … */
      __pyx_tuple__121 = PyTuple_Pack(19, __pyx_n_s_h, __pyx_n_s_gaps, __pyx_n_s_min_ehh, __pyx_n_s_include_edges, __pyx_n_s_n_variants, __pyx_n_s_n_haplotypes, __pyx_n_s_n_pairs, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_u, __pyx_n_s_s, __pyx_n_s_ssl, __pyx_n_s_l, __pyx_n_s_l_max, __pyx_n_s_a1, __pyx_n_s_a2, __pyx_n_s_vihh, __pyx_n_s_ihh); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__121);
      __Pyx_GIVEREF(__pyx_tuple__121);
    /* … */
      __pyx_t_16 = PyDict_New(); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_15 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_147ihh_scan, 0, __pyx_n_s_ihh_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_15, sizeof(__pyx_defaults8), 0)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_t_15)->__pyx_arg_min_ehh = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_t_15)->__pyx_arg_include_edges = 0;
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_15, __pyx_t_17);
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_15, __pyx_pf_5allel_3opt_5stats_306__defaults__);
      if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_int8_t, __pyx_t_15) < 0) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_149ihh_scan, 0, __pyx_n_s_ihh_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_15, sizeof(__pyx_defaults9), 0)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_t_15)->__pyx_arg_min_ehh = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_t_15)->__pyx_arg_include_edges = 0;
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_15, __pyx_t_17);
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_15, __pyx_pf_5allel_3opt_5stats_308__defaults__);
      if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_int16_t, __pyx_t_15) < 0) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_151ihh_scan, 0, __pyx_n_s_ihh_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_15, sizeof(__pyx_defaults10), 0)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_t_15)->__pyx_arg_min_ehh = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_t_15)->__pyx_arg_include_edges = 0;
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_15, __pyx_t_17);
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_15, __pyx_pf_5allel_3opt_5stats_310__defaults__);
      if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_int32_t, __pyx_t_15) < 0) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_153ihh_scan, 0, __pyx_n_s_ihh_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_15, sizeof(__pyx_defaults11), 0)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_t_15)->__pyx_arg_min_ehh = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_t_15)->__pyx_arg_include_edges = 0;
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_15, __pyx_t_17);
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_15, __pyx_pf_5allel_3opt_5stats_312__defaults__);
      if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_int64_t, __pyx_t_15) < 0) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_155ihh_scan, 0, __pyx_n_s_ihh_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_15, sizeof(__pyx_defaults12), 0)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_t_15)->__pyx_arg_min_ehh = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_t_15)->__pyx_arg_include_edges = 0;
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_15, __pyx_t_17);
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_15, __pyx_pf_5allel_3opt_5stats_314__defaults__);
      if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_uint8_t, __pyx_t_15) < 0) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_157ihh_scan, 0, __pyx_n_s_ihh_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_15, sizeof(__pyx_defaults13), 0)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_t_15)->__pyx_arg_min_ehh = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_t_15)->__pyx_arg_include_edges = 0;
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_15, __pyx_t_17);
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_15, __pyx_pf_5allel_3opt_5stats_316__defaults__);
      if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_uint16_t, __pyx_t_15) < 0) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_159ihh_scan, 0, __pyx_n_s_ihh_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_15, sizeof(__pyx_defaults14), 0)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_t_15)->__pyx_arg_min_ehh = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_t_15)->__pyx_arg_include_edges = 0;
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_15, __pyx_t_17);
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_15, __pyx_pf_5allel_3opt_5stats_318__defaults__);
      if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_uint32_t, __pyx_t_15) < 0) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_161ihh_scan, 0, __pyx_n_s_ihh_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_15, sizeof(__pyx_defaults15), 0)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_t_15)->__pyx_arg_min_ehh = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_t_15)->__pyx_arg_include_edges = 0;
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_15, __pyx_t_17);
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_15, __pyx_pf_5allel_3opt_5stats_320__defaults__);
      if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_uint64_t, __pyx_t_15) < 0) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = __pyx_FusedFunction_NewEx(&__pyx_mdef_5allel_3opt_5stats_23ihh_scan, 0, __pyx_n_s_ihh_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_15, __pyx_t_17);
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_15, __pyx_pf_5allel_3opt_5stats_306__defaults__);
      ((__pyx_FusedFunctionObject *) __pyx_t_15)->__signatures__ = __pyx_t_16;
      __Pyx_GIVEREF(__pyx_t_16);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_ihh_scan, __pyx_t_15) < 0) __PYX_ERR(0, 547, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aliman_src_github_cggh_sci, __pyx_n_s_ihh_scan, 547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(0, 547, __pyx_L1_error)

     0548:              cnp.float64_t[:] gaps,

    +0549:              cnp.float64_t min_ehh=0,

      __pyx_t_15 = __Pyx_PyInt_From_long(0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 549, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
    /* … */
      __pyx_t_16 = __Pyx_PyInt_From_long(0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 549, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_k__32 = __pyx_t_16;
      __Pyx_GIVEREF(__pyx_t_16);
      __pyx_t_16 = 0;

    +0550:              bint include_edges=False):

      __pyx_t_16 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 550, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
    /* … */
      __pyx_t_16 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 550, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_k__33 = __pyx_t_16;
      __Pyx_GIVEREF(__pyx_t_16);
      __pyx_t_16 = 0;

     0551:     """Scan forwards over haplotypes, computing the integrated haplotype

     0552:     homozygosity backwards for each variant."""

     0553:

     0554:     cdef:

     0555:         Py_ssize_t n_variants, n_haplotypes, n_pairs, i, j, k, u, s

     0556:         cnp.int32_t[:] ssl

     0557:         cnp.int32_t l, l_max

     0558:         integer a1, a2

     0559:         cnp.float64_t[:] vihh

     0560:         cnp.float64_t ihh

     0561:

    +0562:     n_variants = h.shape[0]

      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);

     0563:     # initialise

    +0564:     n_haplotypes = h.shape[1]

      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);

    +0565:     n_pairs = (n_haplotypes * (n_haplotypes - 1)) // 2

      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);

     0566:

     0567:     # shared suffix lengths between all pairs of haplotypes

    +0568:     ssl = np.zeros(n_pairs, dtype='i4')

      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 568, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

     0569:

     0570:     # integrated haplotype homozygosity values for each variant

    +0571:     vihh = np.empty(n_variants, dtype='f8')

      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 571, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vihh = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 571, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vihh = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 571, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vihh = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 571, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vihh = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 571, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vihh = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 571, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vihh = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 571, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vihh = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 571, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vihh = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

     0572:

    +0573:     with nogil:

      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L5:;
          }
      }

     0574:

     0575:         # iterate forward over variants

    +0576:         for i in range(n_variants):

            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;

    +0577:             u = 0  # pair index

              __pyx_v_u = 0;
    /* … */
              __pyx_v_u = 0;
    /* … */
              __pyx_v_u = 0;
    /* … */
              __pyx_v_u = 0;
    /* … */
              __pyx_v_u = 0;
    /* … */
              __pyx_v_u = 0;
    /* … */
              __pyx_v_u = 0;
    /* … */
              __pyx_v_u = 0;

    +0578:             l_max = 0

              __pyx_v_l_max = 0;
    /* … */
              __pyx_v_l_max = 0;
    /* … */
              __pyx_v_l_max = 0;
    /* … */
              __pyx_v_l_max = 0;
    /* … */
              __pyx_v_l_max = 0;
    /* … */
              __pyx_v_l_max = 0;
    /* … */
              __pyx_v_l_max = 0;
    /* … */
              __pyx_v_l_max = 0;

     0579:

     0580:             # pairwise comparison of alleles between haplotypes to determine

     0581:             # shared suffix lengths

    +0582:             for j in range(n_haplotypes):

              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;

    +0583:                 a1 = h[i, j]  # allele on first haplotype in pair

                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));

    +0584:                 for k in range(j+1, n_haplotypes):

                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;

    +0585:                     a2 = h[i, k]  # allele on second haplotype in pair

                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));

     0586:                     # test for non-equal and non-missing alleles

    +0587:                     if (a1 != a2) and (a1 >= 0) and (a2 >= 0):

                  __pyx_t_18 = ((__pyx_v_a1 != __pyx_v_a2) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a1 >= 0) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 >= 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 != __pyx_v_a2) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a1 >= 0) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 >= 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 != __pyx_v_a2) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a1 >= 0) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 >= 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 != __pyx_v_a2) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a1 >= 0) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 >= 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 != __pyx_v_a2) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a1 >= 0) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 >= 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 != __pyx_v_a2) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a1 >= 0) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 >= 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 != __pyx_v_a2) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a1 >= 0) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 >= 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 != __pyx_v_a2) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a1 >= 0) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 >= 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }

     0588:                         # break shared suffix, reset length to zero

    +0589:                         l = 0

                    __pyx_v_l = 0;
    /* … */
                    __pyx_v_l = 0;
    /* … */
                    __pyx_v_l = 0;
    /* … */
                    __pyx_v_l = 0;
    /* … */
                    __pyx_v_l = 0;
    /* … */
                    __pyx_v_l = 0;
    /* … */
                    __pyx_v_l = 0;
    /* … */
                    __pyx_v_l = 0;

     0590:                     else:

     0591:                         # extend shared suffix

    +0592:                         l = ssl[u] + 1

                  /*else*/ {
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
                  }
                  __pyx_L12:;

    +0593:                     ssl[u] = l

                  __pyx_t_20 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                  __pyx_t_20 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                  __pyx_t_20 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                  __pyx_t_20 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                  __pyx_t_20 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                  __pyx_t_20 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                  __pyx_t_20 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                  __pyx_t_20 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;

     0594:                     # increment pair index

    +0595:                     u += 1

                  __pyx_v_u = (__pyx_v_u + 1);
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);

     0596:                     # update max l

    +0597:                     if l > l_max:

                  __pyx_t_17 = ((__pyx_v_l > __pyx_v_l_max) != 0);
                  if (__pyx_t_17) {
    /* … */
                  }
                }
              }
    /* … */
                  __pyx_t_17 = ((__pyx_v_l > __pyx_v_l_max) != 0);
                  if (__pyx_t_17) {
    /* … */
                  }
                }
              }
    /* … */
                  __pyx_t_17 = ((__pyx_v_l > __pyx_v_l_max) != 0);
                  if (__pyx_t_17) {
    /* … */
                  }
                }
              }
    /* … */
                  __pyx_t_17 = ((__pyx_v_l > __pyx_v_l_max) != 0);
                  if (__pyx_t_17) {
    /* … */
                  }
                }
              }
    /* … */
                  __pyx_t_17 = ((__pyx_v_l > __pyx_v_l_max) != 0);
                  if (__pyx_t_17) {
    /* … */
                  }
                }
              }
    /* … */
                  __pyx_t_17 = ((__pyx_v_l > __pyx_v_l_max) != 0);
                  if (__pyx_t_17) {
    /* … */
                  }
                }
              }
    /* … */
                  __pyx_t_17 = ((__pyx_v_l > __pyx_v_l_max) != 0);
                  if (__pyx_t_17) {
    /* … */
                  }
                }
              }
    /* … */
                  __pyx_t_17 = ((__pyx_v_l > __pyx_v_l_max) != 0);
                  if (__pyx_t_17) {
    /* … */
                  }
                }
              }

    +0598:                         l_max = l

                    __pyx_v_l_max = __pyx_v_l;
    /* … */
                    __pyx_v_l_max = __pyx_v_l;
    /* … */
                    __pyx_v_l_max = __pyx_v_l;
    /* … */
                    __pyx_v_l_max = __pyx_v_l;
    /* … */
                    __pyx_v_l_max = __pyx_v_l;
    /* … */
                    __pyx_v_l_max = __pyx_v_l;
    /* … */
                    __pyx_v_l_max = __pyx_v_l;
    /* … */
                    __pyx_v_l_max = __pyx_v_l;

     0599:

     0600:             # compute IHH from shared suffix lengths

    +0601:             ihh = ssl2ihh(ssl, l_max, i, gaps,

              __pyx_t_22.__pyx_n = 2;
              __pyx_t_22.min_ehh = __pyx_v_min_ehh;
              __pyx_t_22.include_edges = __pyx_v_include_edges;
              __pyx_t_21 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_v_ssl, __pyx_v_l_max, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_22);
              __pyx_v_ihh = __pyx_t_21;
    /* … */
              __pyx_t_22.__pyx_n = 2;
              __pyx_t_22.min_ehh = __pyx_v_min_ehh;
              __pyx_t_22.include_edges = __pyx_v_include_edges;
              __pyx_t_21 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_v_ssl, __pyx_v_l_max, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_22);
              __pyx_v_ihh = __pyx_t_21;
    /* … */
              __pyx_t_22.__pyx_n = 2;
              __pyx_t_22.min_ehh = __pyx_v_min_ehh;
              __pyx_t_22.include_edges = __pyx_v_include_edges;
              __pyx_t_21 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_v_ssl, __pyx_v_l_max, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_22);
              __pyx_v_ihh = __pyx_t_21;
    /* … */
              __pyx_t_22.__pyx_n = 2;
              __pyx_t_22.min_ehh = __pyx_v_min_ehh;
              __pyx_t_22.include_edges = __pyx_v_include_edges;
              __pyx_t_21 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_v_ssl, __pyx_v_l_max, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_22);
              __pyx_v_ihh = __pyx_t_21;
    /* … */
              __pyx_t_22.__pyx_n = 2;
              __pyx_t_22.min_ehh = __pyx_v_min_ehh;
              __pyx_t_22.include_edges = __pyx_v_include_edges;
              __pyx_t_21 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_v_ssl, __pyx_v_l_max, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_22);
              __pyx_v_ihh = __pyx_t_21;
    /* … */
              __pyx_t_22.__pyx_n = 2;
              __pyx_t_22.min_ehh = __pyx_v_min_ehh;
              __pyx_t_22.include_edges = __pyx_v_include_edges;
              __pyx_t_21 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_v_ssl, __pyx_v_l_max, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_22);
              __pyx_v_ihh = __pyx_t_21;
    /* … */
              __pyx_t_22.__pyx_n = 2;
              __pyx_t_22.min_ehh = __pyx_v_min_ehh;
              __pyx_t_22.include_edges = __pyx_v_include_edges;
              __pyx_t_21 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_v_ssl, __pyx_v_l_max, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_22);
              __pyx_v_ihh = __pyx_t_21;
    /* … */
              __pyx_t_22.__pyx_n = 2;
              __pyx_t_22.min_ehh = __pyx_v_min_ehh;
              __pyx_t_22.include_edges = __pyx_v_include_edges;
              __pyx_t_21 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_v_ssl, __pyx_v_l_max, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_22);
              __pyx_v_ihh = __pyx_t_21;

     0602:                           min_ehh=min_ehh,

     0603:                           include_edges=include_edges)

    +0604:             vihh[i] = ihh

              __pyx_t_23 = __pyx_v_i;
              *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vihh.data + __pyx_t_23 * __pyx_v_vihh.strides[0]) )) = __pyx_v_ihh;
            }
          }
    /* … */
              __pyx_t_23 = __pyx_v_i;
              *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vihh.data + __pyx_t_23 * __pyx_v_vihh.strides[0]) )) = __pyx_v_ihh;
            }
          }
    /* … */
              __pyx_t_23 = __pyx_v_i;
              *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vihh.data + __pyx_t_23 * __pyx_v_vihh.strides[0]) )) = __pyx_v_ihh;
            }
          }
    /* … */
              __pyx_t_23 = __pyx_v_i;
              *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vihh.data + __pyx_t_23 * __pyx_v_vihh.strides[0]) )) = __pyx_v_ihh;
            }
          }
    /* … */
              __pyx_t_23 = __pyx_v_i;
              *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vihh.data + __pyx_t_23 * __pyx_v_vihh.strides[0]) )) = __pyx_v_ihh;
            }
          }
    /* … */
              __pyx_t_23 = __pyx_v_i;
              *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vihh.data + __pyx_t_23 * __pyx_v_vihh.strides[0]) )) = __pyx_v_ihh;
            }
          }
    /* … */
              __pyx_t_23 = __pyx_v_i;
              *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vihh.data + __pyx_t_23 * __pyx_v_vihh.strides[0]) )) = __pyx_v_ihh;
            }
          }
    /* … */
              __pyx_t_23 = __pyx_v_i;
              *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vihh.data + __pyx_t_23 * __pyx_v_vihh.strides[0]) )) = __pyx_v_ihh;
            }
          }

     0605:

    +0606:     return np.asarray(vihh)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vihh, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_24 = PyTuple_New(1+1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_24);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_24, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vihh, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_24 = PyTuple_New(1+1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_24);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_24, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vihh, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_24 = PyTuple_New(1+1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_24);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_24, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vihh, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_24 = PyTuple_New(1+1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_24);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_24, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vihh, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_24 = PyTuple_New(1+1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_24);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_24, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vihh, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_24 = PyTuple_New(1+1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_24);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_24, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vihh, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_24 = PyTuple_New(1+1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_24);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_24, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vihh, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_24 = PyTuple_New(1+1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_24);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_24, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

     0607:

     0608:

     0609: @cython.boundscheck(False)

     0610: @cython.wraparound(False)

    +0611: def nsl_scan(integer[:, :] h):

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_25nsl_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_5allel_3opt_5stats_24nsl_scan[] = "Scan forwards over haplotypes, computing NSL backwards for each variant.";
    static PyMethodDef __pyx_mdef_5allel_3opt_5stats_25nsl_scan = {"nsl_scan", (PyCFunction)__pyx_pw_5allel_3opt_5stats_25nsl_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_24nsl_scan};
    static PyObject *__pyx_pw_5allel_3opt_5stats_25nsl_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_signatures = 0;
      PyObject *__pyx_v_args = 0;
      PyObject *__pyx_v_kwargs = 0;
      CYTHON_UNUSED PyObject *__pyx_v_defaults = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0};
        PyObject* values[4] = {0,0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 611, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 611, __pyx_L3_error)
            }
            case  3:
            if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 611, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 611, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        }
        __pyx_v_signatures = values[0];
        __pyx_v_args = values[1];
        __pyx_v_kwargs = values[2];
        __pyx_v_defaults = values[3];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 611, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_24nsl_scan(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_24nsl_scan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
      PyObject *__pyx_v_dest_sig = NULL;
      PyTypeObject *__pyx_v_ndarray = 0;
      PyObject *__pyx_v_numpy = NULL;
      __Pyx_memviewslice __pyx_v_memslice;
      Py_ssize_t __pyx_v_itemsize;
      int __pyx_v_dtype_signed;
      char __pyx_v_kind;
      int __pyx_v____pyx_int32_t_is_signed;
      int __pyx_v____pyx_uint32_t_is_signed;
      int __pyx_v____pyx_uint64_t_is_signed;
      int __pyx_v____pyx_uint16_t_is_signed;
      int __pyx_v____pyx_int16_t_is_signed;
      int __pyx_v____pyx_uint8_t_is_signed;
      int __pyx_v____pyx_int64_t_is_signed;
      int __pyx_v____pyx_int8_t_is_signed;
      PyObject *__pyx_v_arg = NULL;
      PyObject *__pyx_v_dtype = NULL;
      PyObject *__pyx_v_arg_base = NULL;
      PyObject *__pyx_v_candidates = NULL;
      PyObject *__pyx_v_sig = NULL;
      int __pyx_v_match_found;
      PyObject *__pyx_v_src_type = NULL;
      PyObject *__pyx_v_dst_type = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("nsl_scan", 0);
      __Pyx_TraceCall("nsl_scan", __pyx_f[0], 611, 0, __PYX_ERR(0, 611, __pyx_L1_error));
      __Pyx_INCREF(__pyx_v_kwargs);
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
      __pyx_v_dest_sig = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_2 = (__pyx_v_kwargs == Py_None);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {
        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1);
        __pyx_t_1 = 0;
      }
      {
        /*try:*/ {
          __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_v_numpy = __pyx_t_1;
          __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 611, __pyx_L4_error)
          __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1);
          __pyx_t_1 = 0;
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L11_try_end;
        __pyx_L4_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
        if (__pyx_t_7) {
          __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 611, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_INCREF(Py_None);
          __Pyx_XDECREF_SET(__pyx_v_ndarray, ((PyTypeObject*)Py_None));
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L5_exception_handled;
        }
        goto __pyx_L6_except_error;
        __pyx_L6_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L1_error;
        __pyx_L5_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        __pyx_L11_try_end:;
      }
      __pyx_v_itemsize = -1L;
      __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1L) < 0);
      __pyx_v____pyx_uint32_t_is_signed = (((__pyx_t_5numpy_uint32_t)-1L) < 0);
      __pyx_v____pyx_uint64_t_is_signed = (((__pyx_t_5numpy_uint64_t)-1L) < 0);
      __pyx_v____pyx_uint16_t_is_signed = (((__pyx_t_5numpy_uint16_t)-1L) < 0);
      __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1L) < 0);
      __pyx_v____pyx_uint8_t_is_signed = (((__pyx_t_5numpy_uint8_t)-1L) < 0);
      __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1L) < 0);
      __pyx_v____pyx_int8_t_is_signed = (((__pyx_t_5numpy_int8_t)-1L) < 0);
      if (unlikely(__pyx_v_args == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 611, __pyx_L1_error)
      }
      __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 611, __pyx_L1_error)
      __pyx_t_3 = ((0 < __pyx_t_10) != 0);
      if (__pyx_t_3) {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 611, __pyx_L1_error)
        }
        __pyx_t_9 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      if (unlikely(__pyx_v_kwargs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 611, __pyx_L1_error)
      }
      __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_h, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {
        if (unlikely(__pyx_v_kwargs == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 611, __pyx_L1_error)
        }
        __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_h); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 611, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      /*else*/ {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(0, 611, __pyx_L1_error)
        }
        __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 611, __pyx_L1_error)
        __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 611, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 611, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 611, __pyx_L1_error)
      }
      __pyx_L14:;
      while (1) {
        __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None));
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {
          __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_dtype = __pyx_t_8;
            __pyx_t_8 = 0;
            goto __pyx_L18;
          }
          __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_arg_base = __pyx_t_8;
            __pyx_t_8 = 0;
            __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
            __pyx_t_2 = (__pyx_t_3 != 0);
            if (__pyx_t_2) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_v_dtype = __pyx_t_8;
              __pyx_t_8 = 0;
              goto __pyx_L19;
            }
            /*else*/ {
              __Pyx_INCREF(Py_None);
              __pyx_v_dtype = Py_None;
            }
            __pyx_L19:;
            goto __pyx_L18;
          }
          /*else*/ {
            __Pyx_INCREF(Py_None);
            __pyx_v_dtype = Py_None;
          }
          __pyx_L18:;
          __pyx_v_itemsize = -1L;
          __pyx_t_2 = (__pyx_v_dtype != Py_None);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 611, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_itemsize = __pyx_t_10;
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 611, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_kind = __pyx_t_11;
            __pyx_v_dtype_signed = (__pyx_v_kind == 'i');
            switch (__pyx_v_kind) {
              case 'i':
              case 'u':
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 611, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L22_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 611, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L26_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 611, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L30_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 611, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L34_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 611, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L38_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 611, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L42_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 611, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L46_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 611, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L50_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              break;
              case 'f':
              break;
              case 'c':
              break;
              case 'O':
              break;
              default: break;
            }
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L54_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L54_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L58_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L58_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L62_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L62_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L66_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L66_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L70_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L70_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L74_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L74_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L78_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L78_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L82_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L82_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
        goto __pyx_L16_break;
      }
      __pyx_L16_break:;
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_candidates = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_10 = 0;
      if (unlikely(__pyx_v_signatures == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 611, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8);
      __pyx_t_8 = __pyx_t_9;
      __pyx_t_9 = 0;
      while (1) {
        __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_13, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7);
        if (unlikely(__pyx_t_14 == 0)) break;
        if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 611, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_v_match_found = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 611, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 611, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /* … */
      __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__38);
      __Pyx_GIVEREF(__pyx_tuple__38);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 611, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
        __Pyx_INCREF(__pyx_v_dest_sig);
        __Pyx_GIVEREF(__pyx_v_dest_sig);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dest_sig);
        __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
          __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_15 = 0;
          __pyx_t_16 = NULL;
        } else {
          __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 611, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 611, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        for (;;) {
          if (likely(!__pyx_t_16)) {
            if (likely(PyList_CheckExact(__pyx_t_9))) {
              if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            } else {
              if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            }
          } else {
            __pyx_t_1 = __pyx_t_16(__pyx_t_9);
            if (unlikely(!__pyx_t_1)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 611, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_1);
          }
          if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
            PyObject* sequence = __pyx_t_1;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 611, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1);
            } else {
              __pyx_t_17 = PyList_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyList_GET_ITEM(sequence, 1);
            }
            __Pyx_INCREF(__pyx_t_17);
            __Pyx_INCREF(__pyx_t_18);
            #else
            __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 611, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 611, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_18);
            #endif
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 611, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
            index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_17);
            index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_18);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
            __pyx_t_20 = NULL;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            goto __pyx_L90_unpacking_done;
            __pyx_L89_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __pyx_t_20 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 611, __pyx_L1_error)
            __pyx_L90_unpacking_done:;
          }
          __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17);
          __pyx_t_17 = 0;
          __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18);
          __pyx_t_18 = 0;
          __pyx_t_3 = (__pyx_v_dst_type != Py_None);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (__pyx_t_2) {
              __pyx_v_match_found = 1;
              goto __pyx_L92;
            }
            /*else*/ {
              __pyx_v_match_found = 0;
              goto __pyx_L88_break;
            }
            __pyx_L92:;
          }
        }
        __pyx_L88_break:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_2 = (__pyx_v_match_found != 0);
        if (__pyx_t_2) {
          __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 611, __pyx_L1_error)
        }
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
      __pyx_t_3 = ((!__pyx_t_2) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s__8); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__39);
      __Pyx_GIVEREF(__pyx_tuple__39);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 611, __pyx_L1_error)
      }
      __pyx_t_13 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 611, __pyx_L1_error)
      __pyx_t_3 = ((__pyx_t_13 > 1) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__40);
      __Pyx_GIVEREF(__pyx_tuple__40);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 611, __pyx_L1_error)
      }
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_signatures == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 611, __pyx_L1_error)
        }
        __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        goto __pyx_L0;
      }

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_dest_sig);
      __Pyx_XDECREF(__pyx_v_ndarray);
      __Pyx_XDECREF(__pyx_v_numpy);
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XDECREF(__pyx_v_dtype);
      __Pyx_XDECREF(__pyx_v_arg_base);
      __Pyx_XDECREF(__pyx_v_candidates);
      __Pyx_XDECREF(__pyx_v_sig);
      __Pyx_XDECREF(__pyx_v_src_type);
      __Pyx_XDECREF(__pyx_v_dst_type);
      __Pyx_XDECREF(__pyx_v_kwargs);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_165nsl_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_165nsl_scan = {"__pyx_fuse_0nsl_scan", (PyCFunction)__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_165nsl_scan, METH_O, __pyx_doc_5allel_3opt_5stats_24nsl_scan};
    static PyObject *__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_165nsl_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("nsl_scan (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 611, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.nsl_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_164nsl_scan(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_164nsl_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int64_t __pyx_v_ssl_sum;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_int8_t __pyx_v_a1;
      __pyx_t_5numpy_int8_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vnsl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_nsl;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_0nsl_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_0nsl_scan", __pyx_f[0], 611, 0, __PYX_ERR(0, 611, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_22);
      __Pyx_AddTraceback("allel.opt.stats.nsl_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vnsl, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_167nsl_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_167nsl_scan = {"__pyx_fuse_1nsl_scan", (PyCFunction)__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_167nsl_scan, METH_O, __pyx_doc_5allel_3opt_5stats_24nsl_scan};
    static PyObject *__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_167nsl_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("nsl_scan (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 611, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.nsl_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_166nsl_scan(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_166nsl_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int64_t __pyx_v_ssl_sum;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_int16_t __pyx_v_a1;
      __pyx_t_5numpy_int16_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vnsl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_nsl;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_1nsl_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_1nsl_scan", __pyx_f[0], 611, 0, __PYX_ERR(0, 611, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_22);
      __Pyx_AddTraceback("allel.opt.stats.nsl_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vnsl, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_169nsl_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_169nsl_scan = {"__pyx_fuse_2nsl_scan", (PyCFunction)__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_169nsl_scan, METH_O, __pyx_doc_5allel_3opt_5stats_24nsl_scan};
    static PyObject *__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_169nsl_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("nsl_scan (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 611, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.nsl_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_168nsl_scan(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_168nsl_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int64_t __pyx_v_ssl_sum;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_int32_t __pyx_v_a1;
      __pyx_t_5numpy_int32_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vnsl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_nsl;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_2nsl_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_2nsl_scan", __pyx_f[0], 611, 0, __PYX_ERR(0, 611, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_22);
      __Pyx_AddTraceback("allel.opt.stats.nsl_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vnsl, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_171nsl_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_171nsl_scan = {"__pyx_fuse_3nsl_scan", (PyCFunction)__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_171nsl_scan, METH_O, __pyx_doc_5allel_3opt_5stats_24nsl_scan};
    static PyObject *__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_171nsl_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("nsl_scan (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 611, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.nsl_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_170nsl_scan(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_170nsl_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int64_t __pyx_v_ssl_sum;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_int64_t __pyx_v_a1;
      __pyx_t_5numpy_int64_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vnsl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_nsl;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_3nsl_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_3nsl_scan", __pyx_f[0], 611, 0, __PYX_ERR(0, 611, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_22);
      __Pyx_AddTraceback("allel.opt.stats.nsl_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vnsl, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_173nsl_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_173nsl_scan = {"__pyx_fuse_4nsl_scan", (PyCFunction)__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_173nsl_scan, METH_O, __pyx_doc_5allel_3opt_5stats_24nsl_scan};
    static PyObject *__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_173nsl_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("nsl_scan (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 611, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.nsl_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_172nsl_scan(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_172nsl_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int64_t __pyx_v_ssl_sum;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_uint8_t __pyx_v_a1;
      __pyx_t_5numpy_uint8_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vnsl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_nsl;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_4nsl_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_4nsl_scan", __pyx_f[0], 611, 0, __PYX_ERR(0, 611, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_22);
      __Pyx_AddTraceback("allel.opt.stats.nsl_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vnsl, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_175nsl_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_175nsl_scan = {"__pyx_fuse_5nsl_scan", (PyCFunction)__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_175nsl_scan, METH_O, __pyx_doc_5allel_3opt_5stats_24nsl_scan};
    static PyObject *__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_175nsl_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("nsl_scan (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint16_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 611, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.nsl_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_174nsl_scan(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_174nsl_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int64_t __pyx_v_ssl_sum;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_uint16_t __pyx_v_a1;
      __pyx_t_5numpy_uint16_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vnsl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_nsl;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_5nsl_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_5nsl_scan", __pyx_f[0], 611, 0, __PYX_ERR(0, 611, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_22);
      __Pyx_AddTraceback("allel.opt.stats.nsl_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vnsl, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_177nsl_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_177nsl_scan = {"__pyx_fuse_6nsl_scan", (PyCFunction)__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_177nsl_scan, METH_O, __pyx_doc_5allel_3opt_5stats_24nsl_scan};
    static PyObject *__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_177nsl_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("nsl_scan (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 611, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.nsl_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_176nsl_scan(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_176nsl_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int64_t __pyx_v_ssl_sum;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_uint32_t __pyx_v_a1;
      __pyx_t_5numpy_uint32_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vnsl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_nsl;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_6nsl_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_6nsl_scan", __pyx_f[0], 611, 0, __PYX_ERR(0, 611, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_22);
      __Pyx_AddTraceback("allel.opt.stats.nsl_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vnsl, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_179nsl_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_179nsl_scan = {"__pyx_fuse_7nsl_scan", (PyCFunction)__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_179nsl_scan, METH_O, __pyx_doc_5allel_3opt_5stats_24nsl_scan};
    static PyObject *__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_179nsl_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("nsl_scan (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint64_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 611, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.nsl_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_178nsl_scan(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_178nsl_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int64_t __pyx_v_ssl_sum;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_uint64_t __pyx_v_a1;
      __pyx_t_5numpy_uint64_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vnsl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_nsl;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_7nsl_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_7nsl_scan", __pyx_f[0], 611, 0, __PYX_ERR(0, 611, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_22);
      __Pyx_AddTraceback("allel.opt.stats.nsl_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vnsl, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
      __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__41);
      __Pyx_GIVEREF(__pyx_tuple__41);
    /* … */
      __pyx_tuple__123 = PyTuple_Pack(17, __pyx_n_s_h, __pyx_n_s_h, __pyx_n_s_n_variants, __pyx_n_s_n_haplotypes, __pyx_n_s_n_pairs, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_u, __pyx_n_s_s, __pyx_n_s_ssl, __pyx_n_s_ssl_sum, __pyx_n_s_l, __pyx_n_s_a1, __pyx_n_s_a2, __pyx_n_s_vnsl, __pyx_n_s_nsl); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__123);
      __Pyx_GIVEREF(__pyx_tuple__123);
    /* … */
      __pyx_t_18 = PyDict_New(); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_18);
      __pyx_t_19 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_165nsl_scan, 0, __pyx_n_s_nsl_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_19, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_int8_t, __pyx_t_19) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_167nsl_scan, 0, __pyx_n_s_nsl_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_19, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_int16_t, __pyx_t_19) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_169nsl_scan, 0, __pyx_n_s_nsl_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_19, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_int32_t, __pyx_t_19) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_171nsl_scan, 0, __pyx_n_s_nsl_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_19, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_int64_t, __pyx_t_19) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_173nsl_scan, 0, __pyx_n_s_nsl_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_19, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_uint8_t, __pyx_t_19) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_175nsl_scan, 0, __pyx_n_s_nsl_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_19, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_uint16_t, __pyx_t_19) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_177nsl_scan, 0, __pyx_n_s_nsl_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_19, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_uint32_t, __pyx_t_19) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_179nsl_scan, 0, __pyx_n_s_nsl_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_19, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_uint64_t, __pyx_t_19) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_19 = __pyx_FusedFunction_NewEx(&__pyx_mdef_5allel_3opt_5stats_25nsl_scan, 0, __pyx_n_s_nsl_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_19, __pyx_empty_tuple);
      ((__pyx_FusedFunctionObject *) __pyx_t_19)->__signatures__ = __pyx_t_18;
      __Pyx_GIVEREF(__pyx_t_18);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_nsl_scan, __pyx_t_19) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(1, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aliman_src_github_cggh_sci, __pyx_n_s_nsl_scan, 611, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) __PYX_ERR(0, 611, __pyx_L1_error)

     0612:     """Scan forwards over haplotypes, computing NSL backwards for each variant."""

     0613:

     0614:     cdef:

     0615:         Py_ssize_t n_variants, n_haplotypes, n_pairs, i, j, k, u, s

     0616:         cnp.int32_t[:] ssl

     0617:         cnp.int64_t ssl_sum

     0618:         cnp.int32_t l

     0619:         integer a1, a2

     0620:         cnp.float64_t[:] vnsl

     0621:         cnp.float64_t nsl

     0622:

     0623:     # initialise

    +0624:     n_variants = h.shape[0]

      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);

    +0625:     n_haplotypes = h.shape[1]

      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);

    +0626:     n_pairs = (n_haplotypes * (n_haplotypes - 1)) // 2

      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);

     0627:

     0628:     # shared suffix lengths between all pairs of haplotypes

    +0629:     ssl = np.zeros(n_pairs, dtype='i4')

      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 629, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 629, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 629, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 629, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 629, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 629, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 629, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 629, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

     0630:

     0631:     # NSL values for each variant

    +0632:     vnsl = np.empty(n_variants, dtype='f8')

      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 632, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vnsl = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 632, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vnsl = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 632, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vnsl = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 632, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vnsl = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 632, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vnsl = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 632, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vnsl = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 632, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vnsl = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 632, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vnsl = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

     0633:

    +0634:     with nogil:

      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }

     0635:

     0636:         # iterate forward over variants

    +0637:         for i in range(n_variants):

            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;

    +0638:             u = 0  # pair index

              __pyx_v_u = 0;
    /* … */
              __pyx_v_u = 0;
    /* … */
              __pyx_v_u = 0;
    /* … */
              __pyx_v_u = 0;
    /* … */
              __pyx_v_u = 0;
    /* … */
              __pyx_v_u = 0;
    /* … */
              __pyx_v_u = 0;
    /* … */
              __pyx_v_u = 0;

    +0639:             ssl_sum = 0

              __pyx_v_ssl_sum = 0;
    /* … */
              __pyx_v_ssl_sum = 0;
    /* … */
              __pyx_v_ssl_sum = 0;
    /* … */
              __pyx_v_ssl_sum = 0;
    /* … */
              __pyx_v_ssl_sum = 0;
    /* … */
              __pyx_v_ssl_sum = 0;
    /* … */
              __pyx_v_ssl_sum = 0;
    /* … */
              __pyx_v_ssl_sum = 0;

     0640:

     0641:             # pairwise comparison of alleles between haplotypes to determine

     0642:             # shared suffix lengths

    +0643:             for j in range(n_haplotypes):

              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;

    +0644:                 a1 = h[i, j]  # allele on first haplotype in pair

                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));

    +0645:                 for k in range(j+1, n_haplotypes):

                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;

    +0646:                     a2 = h[i, k]  # allele on second haplotype in pair

                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));

     0647:                     # test for non-equal and non-missing alleles

    +0648:                     if (a1 != a2) and (a1 >= 0) and (a2 >= 0):

                  __pyx_t_18 = ((__pyx_v_a1 != __pyx_v_a2) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a1 >= 0) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 >= 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 != __pyx_v_a2) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a1 >= 0) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 >= 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 != __pyx_v_a2) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a1 >= 0) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 >= 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 != __pyx_v_a2) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a1 >= 0) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 >= 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 != __pyx_v_a2) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a1 >= 0) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 >= 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 != __pyx_v_a2) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a1 >= 0) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 >= 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 != __pyx_v_a2) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a1 >= 0) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 >= 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 != __pyx_v_a2) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a1 >= 0) != 0);
                  if (__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 >= 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }

     0649:                         # break shared suffix, reset length to zero

    +0650:                         l = 0

                    __pyx_v_l = 0;
    /* … */
                    __pyx_v_l = 0;
    /* … */
                    __pyx_v_l = 0;
    /* … */
                    __pyx_v_l = 0;
    /* … */
                    __pyx_v_l = 0;
    /* … */
                    __pyx_v_l = 0;
    /* … */
                    __pyx_v_l = 0;
    /* … */
                    __pyx_v_l = 0;

     0651:                     else:

     0652:                         # extend shared suffix

    +0653:                         l = ssl[u] + 1

                  /*else*/ {
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
                  }
                  __pyx_L12:;

    +0654:                     ssl[u] = l

                  __pyx_t_20 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                  __pyx_t_20 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                  __pyx_t_20 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                  __pyx_t_20 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                  __pyx_t_20 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                  __pyx_t_20 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                  __pyx_t_20 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                  __pyx_t_20 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;

    +0655:                     ssl_sum += l

                  __pyx_v_ssl_sum = (__pyx_v_ssl_sum + __pyx_v_l);
    /* … */
                  __pyx_v_ssl_sum = (__pyx_v_ssl_sum + __pyx_v_l);
    /* … */
                  __pyx_v_ssl_sum = (__pyx_v_ssl_sum + __pyx_v_l);
    /* … */
                  __pyx_v_ssl_sum = (__pyx_v_ssl_sum + __pyx_v_l);
    /* … */
                  __pyx_v_ssl_sum = (__pyx_v_ssl_sum + __pyx_v_l);
    /* … */
                  __pyx_v_ssl_sum = (__pyx_v_ssl_sum + __pyx_v_l);
    /* … */
                  __pyx_v_ssl_sum = (__pyx_v_ssl_sum + __pyx_v_l);
    /* … */
                  __pyx_v_ssl_sum = (__pyx_v_ssl_sum + __pyx_v_l);

     0656:                     # increment pair index

    +0657:                     u += 1

                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }

     0658:

     0659:             # compute nsl from shared suffix lengths

    +0660:             nsl = ssl_sum / u

              if (unlikely(__pyx_v_u == 0)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
                PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 660, __pyx_L4_error)
              }
              __pyx_v_nsl = (((double)__pyx_v_ssl_sum) / ((double)__pyx_v_u));
    /* … */
              if (unlikely(__pyx_v_u == 0)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
                PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 660, __pyx_L4_error)
              }
              __pyx_v_nsl = (((double)__pyx_v_ssl_sum) / ((double)__pyx_v_u));
    /* … */
              if (unlikely(__pyx_v_u == 0)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
                PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 660, __pyx_L4_error)
              }
              __pyx_v_nsl = (((double)__pyx_v_ssl_sum) / ((double)__pyx_v_u));
    /* … */
              if (unlikely(__pyx_v_u == 0)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
                PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 660, __pyx_L4_error)
              }
              __pyx_v_nsl = (((double)__pyx_v_ssl_sum) / ((double)__pyx_v_u));
    /* … */
              if (unlikely(__pyx_v_u == 0)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
                PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 660, __pyx_L4_error)
              }
              __pyx_v_nsl = (((double)__pyx_v_ssl_sum) / ((double)__pyx_v_u));
    /* … */
              if (unlikely(__pyx_v_u == 0)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
                PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 660, __pyx_L4_error)
              }
              __pyx_v_nsl = (((double)__pyx_v_ssl_sum) / ((double)__pyx_v_u));
    /* … */
              if (unlikely(__pyx_v_u == 0)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
                PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 660, __pyx_L4_error)
              }
              __pyx_v_nsl = (((double)__pyx_v_ssl_sum) / ((double)__pyx_v_u));
    /* … */
              if (unlikely(__pyx_v_u == 0)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
                PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
                __PYX_ERR(0, 660, __pyx_L4_error)
              }
              __pyx_v_nsl = (((double)__pyx_v_ssl_sum) / ((double)__pyx_v_u));

    +0661:             vnsl[i] = nsl

              __pyx_t_21 = __pyx_v_i;
              *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vnsl.data + __pyx_t_21 * __pyx_v_vnsl.strides[0]) )) = __pyx_v_nsl;
            }
          }
    /* … */
              __pyx_t_21 = __pyx_v_i;
              *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vnsl.data + __pyx_t_21 * __pyx_v_vnsl.strides[0]) )) = __pyx_v_nsl;
            }
          }
    /* … */
              __pyx_t_21 = __pyx_v_i;
              *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vnsl.data + __pyx_t_21 * __pyx_v_vnsl.strides[0]) )) = __pyx_v_nsl;
            }
          }
    /* … */
              __pyx_t_21 = __pyx_v_i;
              *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vnsl.data + __pyx_t_21 * __pyx_v_vnsl.strides[0]) )) = __pyx_v_nsl;
            }
          }
    /* … */
              __pyx_t_21 = __pyx_v_i;
              *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vnsl.data + __pyx_t_21 * __pyx_v_vnsl.strides[0]) )) = __pyx_v_nsl;
            }
          }
    /* … */
              __pyx_t_21 = __pyx_v_i;
              *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vnsl.data + __pyx_t_21 * __pyx_v_vnsl.strides[0]) )) = __pyx_v_nsl;
            }
          }
    /* … */
              __pyx_t_21 = __pyx_v_i;
              *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vnsl.data + __pyx_t_21 * __pyx_v_vnsl.strides[0]) )) = __pyx_v_nsl;
            }
          }
    /* … */
              __pyx_t_21 = __pyx_v_i;
              *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vnsl.data + __pyx_t_21 * __pyx_v_vnsl.strides[0]) )) = __pyx_v_nsl;
            }
          }

     0662:

    +0663:     return np.asarray(vnsl)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vnsl, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_22);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_22, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vnsl, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_22);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_22, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vnsl, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_22);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_22, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vnsl, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_22);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_22, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vnsl, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_22);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_22, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vnsl, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_22);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_22, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vnsl, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_22);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_22, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vnsl, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_22);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_22, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

     0664:

     0665:

     0666: @cython.boundscheck(False)

     0667: @cython.wraparound(False)

    +0668: def ssl01_scan(integer[:, :] h, stat, **kwargs):

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_27ssl01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_5allel_3opt_5stats_26ssl01_scan[] = "Scan forwards over haplotypes, computing a summary statistic derived\n    from the pairwise shared suffix lengths for each variant, for the\n    reference (0) and alternate (1) alleles separately.";
    static PyMethodDef __pyx_mdef_5allel_3opt_5stats_27ssl01_scan = {"ssl01_scan", (PyCFunction)__pyx_pw_5allel_3opt_5stats_27ssl01_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_26ssl01_scan};
    static PyObject *__pyx_pw_5allel_3opt_5stats_27ssl01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_signatures = 0;
      PyObject *__pyx_v_args = 0;
      PyObject *__pyx_v_kwargs = 0;
      CYTHON_UNUSED PyObject *__pyx_v_defaults = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0};
        PyObject* values[4] = {0,0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 668, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 668, __pyx_L3_error)
            }
            case  3:
            if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 668, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 668, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        }
        __pyx_v_signatures = values[0];
        __pyx_v_args = values[1];
        __pyx_v_kwargs = values[2];
        __pyx_v_defaults = values[3];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 668, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_26ssl01_scan(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_26ssl01_scan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
      PyObject *__pyx_v_dest_sig = NULL;
      PyTypeObject *__pyx_v_ndarray = 0;
      PyObject *__pyx_v_numpy = NULL;
      __Pyx_memviewslice __pyx_v_memslice;
      Py_ssize_t __pyx_v_itemsize;
      int __pyx_v_dtype_signed;
      char __pyx_v_kind;
      int __pyx_v____pyx_int32_t_is_signed;
      int __pyx_v____pyx_uint32_t_is_signed;
      int __pyx_v____pyx_uint64_t_is_signed;
      int __pyx_v____pyx_uint16_t_is_signed;
      int __pyx_v____pyx_int16_t_is_signed;
      int __pyx_v____pyx_uint8_t_is_signed;
      int __pyx_v____pyx_int64_t_is_signed;
      int __pyx_v____pyx_int8_t_is_signed;
      PyObject *__pyx_v_arg = NULL;
      PyObject *__pyx_v_dtype = NULL;
      PyObject *__pyx_v_arg_base = NULL;
      PyObject *__pyx_v_candidates = NULL;
      PyObject *__pyx_v_sig = NULL;
      int __pyx_v_match_found;
      PyObject *__pyx_v_src_type = NULL;
      PyObject *__pyx_v_dst_type = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ssl01_scan", 0);
      __Pyx_TraceCall("ssl01_scan", __pyx_f[0], 668, 0, __PYX_ERR(0, 668, __pyx_L1_error));
      __Pyx_INCREF(__pyx_v_kwargs);
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
      __pyx_v_dest_sig = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_2 = (__pyx_v_kwargs == Py_None);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {
        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1);
        __pyx_t_1 = 0;
      }
      {
        /*try:*/ {
          __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_v_numpy = __pyx_t_1;
          __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 668, __pyx_L4_error)
          __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1);
          __pyx_t_1 = 0;
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L11_try_end;
        __pyx_L4_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
        if (__pyx_t_7) {
          __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 668, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_INCREF(Py_None);
          __Pyx_XDECREF_SET(__pyx_v_ndarray, ((PyTypeObject*)Py_None));
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L5_exception_handled;
        }
        goto __pyx_L6_except_error;
        __pyx_L6_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L1_error;
        __pyx_L5_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        __pyx_L11_try_end:;
      }
      __pyx_v_itemsize = -1L;
      __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1L) < 0);
      __pyx_v____pyx_uint32_t_is_signed = (((__pyx_t_5numpy_uint32_t)-1L) < 0);
      __pyx_v____pyx_uint64_t_is_signed = (((__pyx_t_5numpy_uint64_t)-1L) < 0);
      __pyx_v____pyx_uint16_t_is_signed = (((__pyx_t_5numpy_uint16_t)-1L) < 0);
      __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1L) < 0);
      __pyx_v____pyx_uint8_t_is_signed = (((__pyx_t_5numpy_uint8_t)-1L) < 0);
      __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1L) < 0);
      __pyx_v____pyx_int8_t_is_signed = (((__pyx_t_5numpy_int8_t)-1L) < 0);
      if (unlikely(__pyx_v_args == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 668, __pyx_L1_error)
      }
      __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 668, __pyx_L1_error)
      __pyx_t_3 = ((0 < __pyx_t_10) != 0);
      if (__pyx_t_3) {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 668, __pyx_L1_error)
        }
        __pyx_t_9 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      if (unlikely(__pyx_v_kwargs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 668, __pyx_L1_error)
      }
      __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_h, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {
        if (unlikely(__pyx_v_kwargs == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 668, __pyx_L1_error)
        }
        __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_h); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      /*else*/ {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(0, 668, __pyx_L1_error)
        }
        __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 668, __pyx_L1_error)
        __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 668, __pyx_L1_error)
      }
      __pyx_L14:;
      while (1) {
        __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None));
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {
          __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_dtype = __pyx_t_8;
            __pyx_t_8 = 0;
            goto __pyx_L18;
          }
          __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_arg_base = __pyx_t_8;
            __pyx_t_8 = 0;
            __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
            __pyx_t_2 = (__pyx_t_3 != 0);
            if (__pyx_t_2) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_v_dtype = __pyx_t_8;
              __pyx_t_8 = 0;
              goto __pyx_L19;
            }
            /*else*/ {
              __Pyx_INCREF(Py_None);
              __pyx_v_dtype = Py_None;
            }
            __pyx_L19:;
            goto __pyx_L18;
          }
          /*else*/ {
            __Pyx_INCREF(Py_None);
            __pyx_v_dtype = Py_None;
          }
          __pyx_L18:;
          __pyx_v_itemsize = -1L;
          __pyx_t_2 = (__pyx_v_dtype != Py_None);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 668, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_itemsize = __pyx_t_10;
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 668, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_kind = __pyx_t_11;
            __pyx_v_dtype_signed = (__pyx_v_kind == 'i');
            switch (__pyx_v_kind) {
              case 'i':
              case 'u':
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 668, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L22_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 668, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L26_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 668, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L30_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 668, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L34_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 668, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L38_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 668, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L42_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 668, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L46_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 668, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L50_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              break;
              case 'f':
              break;
              case 'c':
              break;
              case 'O':
              break;
              default: break;
            }
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L54_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L54_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L58_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L58_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L62_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L62_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L66_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L66_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L70_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L70_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L74_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L74_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L78_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L78_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L82_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L82_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
        goto __pyx_L16_break;
      }
      __pyx_L16_break:;
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_candidates = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_10 = 0;
      if (unlikely(__pyx_v_signatures == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 668, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8);
      __pyx_t_8 = __pyx_t_9;
      __pyx_t_9 = 0;
      while (1) {
        __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_13, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7);
        if (unlikely(__pyx_t_14 == 0)) break;
        if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_v_match_found = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /* … */
      __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__42);
      __Pyx_GIVEREF(__pyx_tuple__42);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
        __Pyx_INCREF(__pyx_v_dest_sig);
        __Pyx_GIVEREF(__pyx_v_dest_sig);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dest_sig);
        __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
          __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_15 = 0;
          __pyx_t_16 = NULL;
        } else {
          __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 668, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        for (;;) {
          if (likely(!__pyx_t_16)) {
            if (likely(PyList_CheckExact(__pyx_t_9))) {
              if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            } else {
              if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            }
          } else {
            __pyx_t_1 = __pyx_t_16(__pyx_t_9);
            if (unlikely(!__pyx_t_1)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 668, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_1);
          }
          if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
            PyObject* sequence = __pyx_t_1;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 668, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1);
            } else {
              __pyx_t_17 = PyList_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyList_GET_ITEM(sequence, 1);
            }
            __Pyx_INCREF(__pyx_t_17);
            __Pyx_INCREF(__pyx_t_18);
            #else
            __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 668, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 668, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_18);
            #endif
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 668, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
            index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_17);
            index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_18);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) __PYX_ERR(0, 668, __pyx_L1_error)
            __pyx_t_20 = NULL;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            goto __pyx_L90_unpacking_done;
            __pyx_L89_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __pyx_t_20 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 668, __pyx_L1_error)
            __pyx_L90_unpacking_done:;
          }
          __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17);
          __pyx_t_17 = 0;
          __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18);
          __pyx_t_18 = 0;
          __pyx_t_3 = (__pyx_v_dst_type != Py_None);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (__pyx_t_2) {
              __pyx_v_match_found = 1;
              goto __pyx_L92;
            }
            /*else*/ {
              __pyx_v_match_found = 0;
              goto __pyx_L88_break;
            }
            __pyx_L92:;
          }
        }
        __pyx_L88_break:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_2 = (__pyx_v_match_found != 0);
        if (__pyx_t_2) {
          __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 668, __pyx_L1_error)
        }
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
      __pyx_t_3 = ((!__pyx_t_2) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s__8); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__43);
      __Pyx_GIVEREF(__pyx_tuple__43);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 668, __pyx_L1_error)
      }
      __pyx_t_13 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 668, __pyx_L1_error)
      __pyx_t_3 = ((__pyx_t_13 > 1) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__44);
      __Pyx_GIVEREF(__pyx_tuple__44);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 668, __pyx_L1_error)
      }
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_signatures == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 668, __pyx_L1_error)
        }
        __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        goto __pyx_L0;
      }

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_dest_sig);
      __Pyx_XDECREF(__pyx_v_ndarray);
      __Pyx_XDECREF(__pyx_v_numpy);
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XDECREF(__pyx_v_dtype);
      __Pyx_XDECREF(__pyx_v_arg_base);
      __Pyx_XDECREF(__pyx_v_candidates);
      __Pyx_XDECREF(__pyx_v_sig);
      __Pyx_XDECREF(__pyx_v_src_type);
      __Pyx_XDECREF(__pyx_v_dst_type);
      __Pyx_XDECREF(__pyx_v_kwargs);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_183ssl01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_183ssl01_scan = {"__pyx_fuse_0ssl01_scan", (PyCFunction)__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_183ssl01_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_26ssl01_scan};
    static PyObject *__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_183ssl01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_stat = 0;
      PyObject *__pyx_v_kwargs = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ssl01_scan (wrapper)", 0);
      __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
      __Pyx_GOTREF(__pyx_v_kwargs);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_stat,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stat)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ssl01_scan", 1, 2, 2, 1); __PYX_ERR(0, 668, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "ssl01_scan") < 0)) __PYX_ERR(0, 668, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 668, __pyx_L3_error)
        __pyx_v_stat = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ssl01_scan", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 668, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_AddTraceback("allel.opt.stats.ssl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_182ssl01_scan(__pyx_self, __pyx_v_h, __pyx_v_stat, __pyx_v_kwargs);

      /* function exit code */
      __Pyx_XDECREF(__pyx_v_kwargs);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_182ssl01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_stat, PyObject *__pyx_v_kwargs) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl00 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl11 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int8_t __pyx_v_a1;
      __pyx_t_5numpy_int8_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_stat00 = NULL;
      PyObject *__pyx_v_stat11 = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_0ssl01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_0ssl01_scan", __pyx_f[0], 668, 0, __PYX_ERR(0, 668, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_29);
      __Pyx_XDECREF(__pyx_t_33);
      __Pyx_AddTraceback("allel.opt.stats.ssl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl00, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl11, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __Pyx_XDECREF(__pyx_v_stat00);
      __Pyx_XDECREF(__pyx_v_stat11);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_185ssl01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_185ssl01_scan = {"__pyx_fuse_1ssl01_scan", (PyCFunction)__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_185ssl01_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_26ssl01_scan};
    static PyObject *__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_185ssl01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_stat = 0;
      PyObject *__pyx_v_kwargs = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ssl01_scan (wrapper)", 0);
      __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
      __Pyx_GOTREF(__pyx_v_kwargs);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_stat,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stat)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ssl01_scan", 1, 2, 2, 1); __PYX_ERR(0, 668, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "ssl01_scan") < 0)) __PYX_ERR(0, 668, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 668, __pyx_L3_error)
        __pyx_v_stat = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ssl01_scan", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 668, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_AddTraceback("allel.opt.stats.ssl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_184ssl01_scan(__pyx_self, __pyx_v_h, __pyx_v_stat, __pyx_v_kwargs);

      /* function exit code */
      __Pyx_XDECREF(__pyx_v_kwargs);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_184ssl01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_stat, PyObject *__pyx_v_kwargs) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl00 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl11 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int16_t __pyx_v_a1;
      __pyx_t_5numpy_int16_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_stat00 = NULL;
      PyObject *__pyx_v_stat11 = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_1ssl01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_1ssl01_scan", __pyx_f[0], 668, 0, __PYX_ERR(0, 668, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_29);
      __Pyx_XDECREF(__pyx_t_33);
      __Pyx_AddTraceback("allel.opt.stats.ssl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl00, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl11, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __Pyx_XDECREF(__pyx_v_stat00);
      __Pyx_XDECREF(__pyx_v_stat11);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_187ssl01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_187ssl01_scan = {"__pyx_fuse_2ssl01_scan", (PyCFunction)__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_187ssl01_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_26ssl01_scan};
    static PyObject *__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_187ssl01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_stat = 0;
      PyObject *__pyx_v_kwargs = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ssl01_scan (wrapper)", 0);
      __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
      __Pyx_GOTREF(__pyx_v_kwargs);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_stat,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stat)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ssl01_scan", 1, 2, 2, 1); __PYX_ERR(0, 668, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "ssl01_scan") < 0)) __PYX_ERR(0, 668, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 668, __pyx_L3_error)
        __pyx_v_stat = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ssl01_scan", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 668, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_AddTraceback("allel.opt.stats.ssl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_186ssl01_scan(__pyx_self, __pyx_v_h, __pyx_v_stat, __pyx_v_kwargs);

      /* function exit code */
      __Pyx_XDECREF(__pyx_v_kwargs);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_186ssl01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_stat, PyObject *__pyx_v_kwargs) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl00 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl11 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int32_t __pyx_v_a1;
      __pyx_t_5numpy_int32_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_stat00 = NULL;
      PyObject *__pyx_v_stat11 = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_2ssl01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_2ssl01_scan", __pyx_f[0], 668, 0, __PYX_ERR(0, 668, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_29);
      __Pyx_XDECREF(__pyx_t_33);
      __Pyx_AddTraceback("allel.opt.stats.ssl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl00, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl11, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __Pyx_XDECREF(__pyx_v_stat00);
      __Pyx_XDECREF(__pyx_v_stat11);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_189ssl01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_189ssl01_scan = {"__pyx_fuse_3ssl01_scan", (PyCFunction)__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_189ssl01_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_26ssl01_scan};
    static PyObject *__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_189ssl01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_stat = 0;
      PyObject *__pyx_v_kwargs = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ssl01_scan (wrapper)", 0);
      __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
      __Pyx_GOTREF(__pyx_v_kwargs);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_stat,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stat)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ssl01_scan", 1, 2, 2, 1); __PYX_ERR(0, 668, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "ssl01_scan") < 0)) __PYX_ERR(0, 668, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 668, __pyx_L3_error)
        __pyx_v_stat = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ssl01_scan", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 668, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_AddTraceback("allel.opt.stats.ssl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_188ssl01_scan(__pyx_self, __pyx_v_h, __pyx_v_stat, __pyx_v_kwargs);

      /* function exit code */
      __Pyx_XDECREF(__pyx_v_kwargs);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_188ssl01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_stat, PyObject *__pyx_v_kwargs) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl00 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl11 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int64_t __pyx_v_a1;
      __pyx_t_5numpy_int64_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_stat00 = NULL;
      PyObject *__pyx_v_stat11 = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_3ssl01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_3ssl01_scan", __pyx_f[0], 668, 0, __PYX_ERR(0, 668, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_29);
      __Pyx_XDECREF(__pyx_t_33);
      __Pyx_AddTraceback("allel.opt.stats.ssl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl00, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl11, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __Pyx_XDECREF(__pyx_v_stat00);
      __Pyx_XDECREF(__pyx_v_stat11);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_191ssl01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_191ssl01_scan = {"__pyx_fuse_4ssl01_scan", (PyCFunction)__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_191ssl01_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_26ssl01_scan};
    static PyObject *__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_191ssl01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_stat = 0;
      PyObject *__pyx_v_kwargs = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ssl01_scan (wrapper)", 0);
      __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
      __Pyx_GOTREF(__pyx_v_kwargs);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_stat,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stat)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ssl01_scan", 1, 2, 2, 1); __PYX_ERR(0, 668, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "ssl01_scan") < 0)) __PYX_ERR(0, 668, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 668, __pyx_L3_error)
        __pyx_v_stat = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ssl01_scan", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 668, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_AddTraceback("allel.opt.stats.ssl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_190ssl01_scan(__pyx_self, __pyx_v_h, __pyx_v_stat, __pyx_v_kwargs);

      /* function exit code */
      __Pyx_XDECREF(__pyx_v_kwargs);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_190ssl01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_stat, PyObject *__pyx_v_kwargs) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl00 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl11 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_uint8_t __pyx_v_a1;
      __pyx_t_5numpy_uint8_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_stat00 = NULL;
      PyObject *__pyx_v_stat11 = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_4ssl01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_4ssl01_scan", __pyx_f[0], 668, 0, __PYX_ERR(0, 668, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_29);
      __Pyx_XDECREF(__pyx_t_33);
      __Pyx_AddTraceback("allel.opt.stats.ssl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl00, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl11, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __Pyx_XDECREF(__pyx_v_stat00);
      __Pyx_XDECREF(__pyx_v_stat11);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_193ssl01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_193ssl01_scan = {"__pyx_fuse_5ssl01_scan", (PyCFunction)__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_193ssl01_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_26ssl01_scan};
    static PyObject *__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_193ssl01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_stat = 0;
      PyObject *__pyx_v_kwargs = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ssl01_scan (wrapper)", 0);
      __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
      __Pyx_GOTREF(__pyx_v_kwargs);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_stat,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stat)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ssl01_scan", 1, 2, 2, 1); __PYX_ERR(0, 668, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "ssl01_scan") < 0)) __PYX_ERR(0, 668, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint16_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 668, __pyx_L3_error)
        __pyx_v_stat = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ssl01_scan", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 668, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_AddTraceback("allel.opt.stats.ssl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_192ssl01_scan(__pyx_self, __pyx_v_h, __pyx_v_stat, __pyx_v_kwargs);

      /* function exit code */
      __Pyx_XDECREF(__pyx_v_kwargs);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_192ssl01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_stat, PyObject *__pyx_v_kwargs) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl00 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl11 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_uint16_t __pyx_v_a1;
      __pyx_t_5numpy_uint16_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_stat00 = NULL;
      PyObject *__pyx_v_stat11 = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_5ssl01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_5ssl01_scan", __pyx_f[0], 668, 0, __PYX_ERR(0, 668, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_29);
      __Pyx_XDECREF(__pyx_t_33);
      __Pyx_AddTraceback("allel.opt.stats.ssl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl00, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl11, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __Pyx_XDECREF(__pyx_v_stat00);
      __Pyx_XDECREF(__pyx_v_stat11);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_195ssl01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_195ssl01_scan = {"__pyx_fuse_6ssl01_scan", (PyCFunction)__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_195ssl01_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_26ssl01_scan};
    static PyObject *__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_195ssl01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_stat = 0;
      PyObject *__pyx_v_kwargs = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ssl01_scan (wrapper)", 0);
      __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
      __Pyx_GOTREF(__pyx_v_kwargs);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_stat,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stat)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ssl01_scan", 1, 2, 2, 1); __PYX_ERR(0, 668, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "ssl01_scan") < 0)) __PYX_ERR(0, 668, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 668, __pyx_L3_error)
        __pyx_v_stat = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ssl01_scan", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 668, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_AddTraceback("allel.opt.stats.ssl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_194ssl01_scan(__pyx_self, __pyx_v_h, __pyx_v_stat, __pyx_v_kwargs);

      /* function exit code */
      __Pyx_XDECREF(__pyx_v_kwargs);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_194ssl01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_stat, PyObject *__pyx_v_kwargs) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl00 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl11 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_uint32_t __pyx_v_a1;
      __pyx_t_5numpy_uint32_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_stat00 = NULL;
      PyObject *__pyx_v_stat11 = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_6ssl01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_6ssl01_scan", __pyx_f[0], 668, 0, __PYX_ERR(0, 668, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_29);
      __Pyx_XDECREF(__pyx_t_33);
      __Pyx_AddTraceback("allel.opt.stats.ssl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl00, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl11, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __Pyx_XDECREF(__pyx_v_stat00);
      __Pyx_XDECREF(__pyx_v_stat11);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_197ssl01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_197ssl01_scan = {"__pyx_fuse_7ssl01_scan", (PyCFunction)__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_197ssl01_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_26ssl01_scan};
    static PyObject *__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_197ssl01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_stat = 0;
      PyObject *__pyx_v_kwargs = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ssl01_scan (wrapper)", 0);
      __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
      __Pyx_GOTREF(__pyx_v_kwargs);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_stat,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stat)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ssl01_scan", 1, 2, 2, 1); __PYX_ERR(0, 668, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "ssl01_scan") < 0)) __PYX_ERR(0, 668, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint64_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 668, __pyx_L3_error)
        __pyx_v_stat = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ssl01_scan", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 668, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_AddTraceback("allel.opt.stats.ssl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_196ssl01_scan(__pyx_self, __pyx_v_h, __pyx_v_stat, __pyx_v_kwargs);

      /* function exit code */
      __Pyx_XDECREF(__pyx_v_kwargs);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_196ssl01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, PyObject *__pyx_v_stat, PyObject *__pyx_v_kwargs) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl00 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl11 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_uint64_t __pyx_v_a1;
      __pyx_t_5numpy_uint64_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_stat00 = NULL;
      PyObject *__pyx_v_stat11 = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_7ssl01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_7ssl01_scan", __pyx_f[0], 668, 0, __PYX_ERR(0, 668, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_29);
      __Pyx_XDECREF(__pyx_t_33);
      __Pyx_AddTraceback("allel.opt.stats.ssl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl00, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl11, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __Pyx_XDECREF(__pyx_v_stat00);
      __Pyx_XDECREF(__pyx_v_stat11);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
      __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__45);
      __Pyx_GIVEREF(__pyx_tuple__45);
    /* … */
      __pyx_tuple__125 = PyTuple_Pack(22, __pyx_n_s_h, __pyx_n_s_stat, __pyx_n_s_kwargs, __pyx_n_s_n_variants, __pyx_n_s_n_haplotypes, __pyx_n_s_n_pairs, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_u, __pyx_n_s_u00, __pyx_n_s_u11, __pyx_n_s_l, __pyx_n_s_ssl, __pyx_n_s_ssl00, __pyx_n_s_ssl11, __pyx_n_s_a1, __pyx_n_s_a2, __pyx_n_s_vstat0, __pyx_n_s_vstat1, __pyx_n_s_stat00, __pyx_n_s_stat11); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__125);
      __Pyx_GIVEREF(__pyx_tuple__125);
    /* … */
      __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_21 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_183ssl01_scan, 0, __pyx_n_s_ssl01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_21);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_21, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_int8_t, __pyx_t_21) < 0) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __pyx_t_21 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_185ssl01_scan, 0, __pyx_n_s_ssl01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_21);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_21, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_int16_t, __pyx_t_21) < 0) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __pyx_t_21 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_187ssl01_scan, 0, __pyx_n_s_ssl01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_21);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_21, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_int32_t, __pyx_t_21) < 0) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __pyx_t_21 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_189ssl01_scan, 0, __pyx_n_s_ssl01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_21);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_21, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_int64_t, __pyx_t_21) < 0) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __pyx_t_21 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_191ssl01_scan, 0, __pyx_n_s_ssl01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_21);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_21, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_uint8_t, __pyx_t_21) < 0) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __pyx_t_21 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_193ssl01_scan, 0, __pyx_n_s_ssl01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_21);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_21, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_uint16_t, __pyx_t_21) < 0) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __pyx_t_21 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_195ssl01_scan, 0, __pyx_n_s_ssl01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_21);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_21, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_uint32_t, __pyx_t_21) < 0) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __pyx_t_21 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_197ssl01_scan, 0, __pyx_n_s_ssl01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_21);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_21, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_uint64_t, __pyx_t_21) < 0) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __pyx_t_21 = __pyx_FusedFunction_NewEx(&__pyx_mdef_5allel_3opt_5stats_27ssl01_scan, 0, __pyx_n_s_ssl01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_21);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_21, __pyx_empty_tuple);
      ((__pyx_FusedFunctionObject *) __pyx_t_21)->__signatures__ = __pyx_t_20;
      __Pyx_GIVEREF(__pyx_t_20);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_ssl01_scan, __pyx_t_21) < 0) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(2, 0, 22, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aliman_src_github_cggh_sci, __pyx_n_s_ssl01_scan, 668, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(0, 668, __pyx_L1_error)

     0669:     """Scan forwards over haplotypes, computing a summary statistic derived

     0670:     from the pairwise shared suffix lengths for each variant, for the

     0671:     reference (0) and alternate (1) alleles separately."""

     0672:

     0673:     cdef:

     0674:         Py_ssize_t n_variants, n_haplotypes, n_pairs, i, j, k, u, u00, u11

     0675:         cnp.int32_t l

     0676:         cnp.int32_t[:] ssl, ssl00, ssl11

     0677:         integer a1, a2

     0678:         cnp.float64_t[:] vstat0, vstat1

     0679:

     0680:     # initialise

    +0681:     n_variants = h.shape[0]

      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);

    +0682:     n_haplotypes = h.shape[1]

      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);

     0683:

     0684:     # shared suffix lengths between all pairs of haplotypes

    +0685:     n_pairs = (n_haplotypes * (n_haplotypes - 1)) // 2

      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);

    +0686:     ssl = np.zeros(n_pairs, dtype='i4')

      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 686, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

    +0687:     ssl00 = np.zeros(n_pairs, dtype='i4')

      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 687, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_ssl00 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 687, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_ssl00 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 687, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_ssl00 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 687, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_ssl00 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 687, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_ssl00 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 687, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_ssl00 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 687, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_ssl00 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 687, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_ssl00 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

    +0688:     ssl11 = np.zeros(n_pairs, dtype='i4')

      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 688, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_ssl11 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 688, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_ssl11 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 688, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_ssl11 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 688, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_ssl11 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 688, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_ssl11 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 688, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_ssl11 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 688, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_ssl11 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 688, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 688, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_ssl11 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

     0689:

     0690:     # statistic values for each variant

    +0691:     vstat0 = np.empty(n_variants, dtype='f8')

      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 691, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_4);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 691, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_4);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 691, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_4);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 691, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_4);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 691, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_4);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 691, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_4);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 691, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_4);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 691, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_4);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +0692:     vstat1 = np.empty(n_variants, dtype='f8')

      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 692, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 692, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 692, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 692, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 692, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 692, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 692, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 692, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

     0693:

     0694:     # iterate forward over variants

    +0695:     for i in range(n_variants):

      __pyx_t_7 = __pyx_v_n_variants;
      for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
        __pyx_v_i = __pyx_t_8;
    /* … */
      __pyx_t_7 = __pyx_v_n_variants;
      for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
        __pyx_v_i = __pyx_t_8;
    /* … */
      __pyx_t_7 = __pyx_v_n_variants;
      for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
        __pyx_v_i = __pyx_t_8;
    /* … */
      __pyx_t_7 = __pyx_v_n_variants;
      for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
        __pyx_v_i = __pyx_t_8;
    /* … */
      __pyx_t_7 = __pyx_v_n_variants;
      for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
        __pyx_v_i = __pyx_t_8;
    /* … */
      __pyx_t_7 = __pyx_v_n_variants;
      for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
        __pyx_v_i = __pyx_t_8;
    /* … */
      __pyx_t_7 = __pyx_v_n_variants;
      for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
        __pyx_v_i = __pyx_t_8;
    /* … */
      __pyx_t_7 = __pyx_v_n_variants;
      for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
        __pyx_v_i = __pyx_t_8;

     0696:

     0697:         # pairwise comparison of alleles between haplotypes to determine

     0698:         # shared suffix lengths

    +0699:         with nogil:

        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            #endif
            /*try:*/ {
    /* … */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L9;
              }
              __pyx_L9:;
            }
        }
    /* … */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            #endif
            /*try:*/ {
    /* … */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L9;
              }
              __pyx_L9:;
            }
        }
    /* … */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            #endif
            /*try:*/ {
    /* … */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L9;
              }
              __pyx_L9:;
            }
        }
    /* … */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            #endif
            /*try:*/ {
    /* … */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L9;
              }
              __pyx_L9:;
            }
        }
    /* … */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            #endif
            /*try:*/ {
    /* … */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L9;
              }
              __pyx_L9:;
            }
        }
    /* … */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            #endif
            /*try:*/ {
    /* … */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L9;
              }
              __pyx_L9:;
            }
        }
    /* … */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            #endif
            /*try:*/ {
    /* … */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L9;
              }
              __pyx_L9:;
            }
        }
    /* … */
        {
            #ifdef WITH_THREAD
            PyThreadState *_save;
            Py_UNBLOCK_THREADS
            #endif
            /*try:*/ {
    /* … */
            /*finally:*/ {
              /*normal exit:*/{
                #ifdef WITH_THREAD
                Py_BLOCK_THREADS
                #endif
                goto __pyx_L9;
              }
              __pyx_L9:;
            }
        }

    +0700:             u = u00 = u11 = 0

              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;
    /* … */
              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;
    /* … */
              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;
    /* … */
              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;
    /* … */
              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;
    /* … */
              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;
    /* … */
              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;
    /* … */
              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;

    +0701:             for j in range(n_haplotypes):

              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;

    +0702:                 a1 = h[i, j]

                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));

    +0703:                 for k in range(j+1, n_haplotypes):

                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;

    +0704:                     a2 = h[i, k]

                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));

    +0705:                     if a1 < 0 or a2 < 0:

                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L15_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L15_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L14;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L15_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L15_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L14;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L15_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L15_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L14;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L15_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L15_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L14;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L15_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L15_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L14;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L15_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L15_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L14;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L15_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L15_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L14;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L15_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L15_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L14;
                  }

     0706:                         # missing allele, assume sharing continues

    +0707:                         l = ssl[u] + 1

                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);

    +0708:                         ssl[u] = l

                    __pyx_t_20 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_20 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_20 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_20 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_20 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_20 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_20 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_20 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;

    +0709:                     elif a1 == a2 == 0:

                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L14;
                  }
    /* … */
                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L14;
                  }
    /* … */
                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L14;
                  }
    /* … */
                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L14;
                  }
    /* … */
                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L14;
                  }
    /* … */
                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L14;
                  }
    /* … */
                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L14;
                  }
    /* … */
                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L14;
                  }

    +0710:                         l = ssl[u] + 1

                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);

    +0711:                         ssl[u] = l

                    __pyx_t_22 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_22 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_22 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_22 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_22 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_22 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_22 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_22 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;

    +0712:                         ssl00[u00] = l

                    __pyx_t_23 = __pyx_v_u00;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl00.data + __pyx_t_23 * __pyx_v_ssl00.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_23 = __pyx_v_u00;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl00.data + __pyx_t_23 * __pyx_v_ssl00.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_23 = __pyx_v_u00;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl00.data + __pyx_t_23 * __pyx_v_ssl00.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_23 = __pyx_v_u00;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl00.data + __pyx_t_23 * __pyx_v_ssl00.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_23 = __pyx_v_u00;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl00.data + __pyx_t_23 * __pyx_v_ssl00.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_23 = __pyx_v_u00;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl00.data + __pyx_t_23 * __pyx_v_ssl00.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_23 = __pyx_v_u00;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl00.data + __pyx_t_23 * __pyx_v_ssl00.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_23 = __pyx_v_u00;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl00.data + __pyx_t_23 * __pyx_v_ssl00.strides[0]) )) = __pyx_v_l;

    +0713:                         u00 += 1

                    __pyx_v_u00 = (__pyx_v_u00 + 1);
    /* … */
                    __pyx_v_u00 = (__pyx_v_u00 + 1);
    /* … */
                    __pyx_v_u00 = (__pyx_v_u00 + 1);
    /* … */
                    __pyx_v_u00 = (__pyx_v_u00 + 1);
    /* … */
                    __pyx_v_u00 = (__pyx_v_u00 + 1);
    /* … */
                    __pyx_v_u00 = (__pyx_v_u00 + 1);
    /* … */
                    __pyx_v_u00 = (__pyx_v_u00 + 1);
    /* … */
                    __pyx_v_u00 = (__pyx_v_u00 + 1);

    +0714:                     elif a1 == a2 == 1:

                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L14;
                  }
    /* … */
                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L14;
                  }
    /* … */
                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L14;
                  }
    /* … */
                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L14;
                  }
    /* … */
                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L14;
                  }
    /* … */
                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L14;
                  }
    /* … */
                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L14;
                  }
    /* … */
                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L14;
                  }

    +0715:                         l = ssl[u] + 1

                    __pyx_t_24 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_24 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_24 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_24 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_24 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_24 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_24 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_24 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_24 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_24 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_24 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_24 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_24 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_24 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_24 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_24 * __pyx_v_ssl.strides[0]) ))) + 1);

    +0716:                         ssl[u] = l

                    __pyx_t_25 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_25 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_25 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_25 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_25 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_25 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_25 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_25 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_25 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_25 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_25 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_25 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_25 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_25 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_25 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_25 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;

    +0717:                         ssl11[u11] = l

                    __pyx_t_26 = __pyx_v_u11;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl11.data + __pyx_t_26 * __pyx_v_ssl11.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_26 = __pyx_v_u11;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl11.data + __pyx_t_26 * __pyx_v_ssl11.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_26 = __pyx_v_u11;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl11.data + __pyx_t_26 * __pyx_v_ssl11.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_26 = __pyx_v_u11;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl11.data + __pyx_t_26 * __pyx_v_ssl11.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_26 = __pyx_v_u11;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl11.data + __pyx_t_26 * __pyx_v_ssl11.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_26 = __pyx_v_u11;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl11.data + __pyx_t_26 * __pyx_v_ssl11.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_26 = __pyx_v_u11;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl11.data + __pyx_t_26 * __pyx_v_ssl11.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_26 = __pyx_v_u11;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl11.data + __pyx_t_26 * __pyx_v_ssl11.strides[0]) )) = __pyx_v_l;

    +0718:                         u11 += 1

                    __pyx_v_u11 = (__pyx_v_u11 + 1);
    /* … */
                    __pyx_v_u11 = (__pyx_v_u11 + 1);
    /* … */
                    __pyx_v_u11 = (__pyx_v_u11 + 1);
    /* … */
                    __pyx_v_u11 = (__pyx_v_u11 + 1);
    /* … */
                    __pyx_v_u11 = (__pyx_v_u11 + 1);
    /* … */
                    __pyx_v_u11 = (__pyx_v_u11 + 1);
    /* … */
                    __pyx_v_u11 = (__pyx_v_u11 + 1);
    /* … */
                    __pyx_v_u11 = (__pyx_v_u11 + 1);

     0719:                     else:

     0720:                         # break shared suffix, reset to zero

    +0721:                         ssl[u] = 0

                  /*else*/ {
                    __pyx_t_27 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_27 * __pyx_v_ssl.strides[0]) )) = 0;
                  }
                  __pyx_L14:;
    /* … */
                  /*else*/ {
                    __pyx_t_27 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_27 * __pyx_v_ssl.strides[0]) )) = 0;
                  }
                  __pyx_L14:;
    /* … */
                  /*else*/ {
                    __pyx_t_27 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_27 * __pyx_v_ssl.strides[0]) )) = 0;
                  }
                  __pyx_L14:;
    /* … */
                  /*else*/ {
                    __pyx_t_27 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_27 * __pyx_v_ssl.strides[0]) )) = 0;
                  }
                  __pyx_L14:;
    /* … */
                  /*else*/ {
                    __pyx_t_27 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_27 * __pyx_v_ssl.strides[0]) )) = 0;
                  }
                  __pyx_L14:;
    /* … */
                  /*else*/ {
                    __pyx_t_27 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_27 * __pyx_v_ssl.strides[0]) )) = 0;
                  }
                  __pyx_L14:;
    /* … */
                  /*else*/ {
                    __pyx_t_27 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_27 * __pyx_v_ssl.strides[0]) )) = 0;
                  }
                  __pyx_L14:;
    /* … */
                  /*else*/ {
                    __pyx_t_27 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_27 * __pyx_v_ssl.strides[0]) )) = 0;
                  }
                  __pyx_L14:;

    +0722:                     u += 1

                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
            }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
            }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
            }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
            }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
            }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
            }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
            }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
            }

     0723:

     0724:         # compute statistic from shared suffix lengths

    +0725:         stat00 = stat(np.asarray(ssl00[:u00]), i, **kwargs)

        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_5.data = __pyx_v_ssl00.data;
        __pyx_t_5.memview = __pyx_v_ssl00.memview;
        __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
        __pyx_t_28 = -1;
        if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl00.shape[0], __pyx_v_ssl00.strides[0], __pyx_v_ssl00.suboffsets[0],
        0,
        0,
        &__pyx_t_28,
        0,
        __pyx_v_u00,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 725, __pyx_L1_error)
    }

    __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_t_5, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
        __pyx_t_5.memview = NULL;
        __pyx_t_5.data = NULL;
        __pyx_t_1 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_1) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
            __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
            __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          {
            __pyx_t_29 = PyTuple_New(1+1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_29);
            __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_1); __pyx_t_1 = NULL;
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_29, 0+1, __pyx_t_4);
            __pyx_t_4 = 0;
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_29 = PyTuple_New(2); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_t_3);
        __pyx_t_2 = 0;
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_stat, __pyx_t_29, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __Pyx_XDECREF_SET(__pyx_v_stat00, __pyx_t_3);
        __pyx_t_3 = 0;
    /* … */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_5.data = __pyx_v_ssl00.data;
        __pyx_t_5.memview = __pyx_v_ssl00.memview;
        __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
        __pyx_t_28 = -1;
        if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl00.shape[0], __pyx_v_ssl00.strides[0], __pyx_v_ssl00.suboffsets[0],
        0,
        0,
        &__pyx_t_28,
        0,
        __pyx_v_u00,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 725, __pyx_L1_error)
    }

    __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_t_5, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
        __pyx_t_5.memview = NULL;
        __pyx_t_5.data = NULL;
        __pyx_t_1 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_1) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
            __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
            __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          {
            __pyx_t_29 = PyTuple_New(1+1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_29);
            __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_1); __pyx_t_1 = NULL;
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_29, 0+1, __pyx_t_4);
            __pyx_t_4 = 0;
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_29 = PyTuple_New(2); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_t_3);
        __pyx_t_2 = 0;
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_stat, __pyx_t_29, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __Pyx_XDECREF_SET(__pyx_v_stat00, __pyx_t_3);
        __pyx_t_3 = 0;
    /* … */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_5.data = __pyx_v_ssl00.data;
        __pyx_t_5.memview = __pyx_v_ssl00.memview;
        __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
        __pyx_t_28 = -1;
        if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl00.shape[0], __pyx_v_ssl00.strides[0], __pyx_v_ssl00.suboffsets[0],
        0,
        0,
        &__pyx_t_28,
        0,
        __pyx_v_u00,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 725, __pyx_L1_error)
    }

    __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_t_5, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
        __pyx_t_5.memview = NULL;
        __pyx_t_5.data = NULL;
        __pyx_t_1 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_1) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
            __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
            __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          {
            __pyx_t_29 = PyTuple_New(1+1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_29);
            __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_1); __pyx_t_1 = NULL;
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_29, 0+1, __pyx_t_4);
            __pyx_t_4 = 0;
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_29 = PyTuple_New(2); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_t_3);
        __pyx_t_2 = 0;
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_stat, __pyx_t_29, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __Pyx_XDECREF_SET(__pyx_v_stat00, __pyx_t_3);
        __pyx_t_3 = 0;
    /* … */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_5.data = __pyx_v_ssl00.data;
        __pyx_t_5.memview = __pyx_v_ssl00.memview;
        __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
        __pyx_t_28 = -1;
        if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl00.shape[0], __pyx_v_ssl00.strides[0], __pyx_v_ssl00.suboffsets[0],
        0,
        0,
        &__pyx_t_28,
        0,
        __pyx_v_u00,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 725, __pyx_L1_error)
    }

    __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_t_5, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
        __pyx_t_5.memview = NULL;
        __pyx_t_5.data = NULL;
        __pyx_t_1 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_1) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
            __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
            __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          {
            __pyx_t_29 = PyTuple_New(1+1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_29);
            __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_1); __pyx_t_1 = NULL;
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_29, 0+1, __pyx_t_4);
            __pyx_t_4 = 0;
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_29 = PyTuple_New(2); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_t_3);
        __pyx_t_2 = 0;
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_stat, __pyx_t_29, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __Pyx_XDECREF_SET(__pyx_v_stat00, __pyx_t_3);
        __pyx_t_3 = 0;
    /* … */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_5.data = __pyx_v_ssl00.data;
        __pyx_t_5.memview = __pyx_v_ssl00.memview;
        __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
        __pyx_t_28 = -1;
        if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl00.shape[0], __pyx_v_ssl00.strides[0], __pyx_v_ssl00.suboffsets[0],
        0,
        0,
        &__pyx_t_28,
        0,
        __pyx_v_u00,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 725, __pyx_L1_error)
    }

    __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_t_5, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
        __pyx_t_5.memview = NULL;
        __pyx_t_5.data = NULL;
        __pyx_t_1 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_1) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
            __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
            __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          {
            __pyx_t_29 = PyTuple_New(1+1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_29);
            __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_1); __pyx_t_1 = NULL;
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_29, 0+1, __pyx_t_4);
            __pyx_t_4 = 0;
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_29 = PyTuple_New(2); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_t_3);
        __pyx_t_2 = 0;
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_stat, __pyx_t_29, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __Pyx_XDECREF_SET(__pyx_v_stat00, __pyx_t_3);
        __pyx_t_3 = 0;
    /* … */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_5.data = __pyx_v_ssl00.data;
        __pyx_t_5.memview = __pyx_v_ssl00.memview;
        __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
        __pyx_t_28 = -1;
        if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl00.shape[0], __pyx_v_ssl00.strides[0], __pyx_v_ssl00.suboffsets[0],
        0,
        0,
        &__pyx_t_28,
        0,
        __pyx_v_u00,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 725, __pyx_L1_error)
    }

    __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_t_5, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
        __pyx_t_5.memview = NULL;
        __pyx_t_5.data = NULL;
        __pyx_t_1 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_1) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
            __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
            __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          {
            __pyx_t_29 = PyTuple_New(1+1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_29);
            __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_1); __pyx_t_1 = NULL;
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_29, 0+1, __pyx_t_4);
            __pyx_t_4 = 0;
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_29 = PyTuple_New(2); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_t_3);
        __pyx_t_2 = 0;
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_stat, __pyx_t_29, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __Pyx_XDECREF_SET(__pyx_v_stat00, __pyx_t_3);
        __pyx_t_3 = 0;
    /* … */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_5.data = __pyx_v_ssl00.data;
        __pyx_t_5.memview = __pyx_v_ssl00.memview;
        __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
        __pyx_t_28 = -1;
        if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl00.shape[0], __pyx_v_ssl00.strides[0], __pyx_v_ssl00.suboffsets[0],
        0,
        0,
        &__pyx_t_28,
        0,
        __pyx_v_u00,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 725, __pyx_L1_error)
    }

    __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_t_5, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
        __pyx_t_5.memview = NULL;
        __pyx_t_5.data = NULL;
        __pyx_t_1 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_1) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
            __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
            __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          {
            __pyx_t_29 = PyTuple_New(1+1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_29);
            __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_1); __pyx_t_1 = NULL;
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_29, 0+1, __pyx_t_4);
            __pyx_t_4 = 0;
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_29 = PyTuple_New(2); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_t_3);
        __pyx_t_2 = 0;
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_stat, __pyx_t_29, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __Pyx_XDECREF_SET(__pyx_v_stat00, __pyx_t_3);
        __pyx_t_3 = 0;
    /* … */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_5.data = __pyx_v_ssl00.data;
        __pyx_t_5.memview = __pyx_v_ssl00.memview;
        __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
        __pyx_t_28 = -1;
        if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl00.shape[0], __pyx_v_ssl00.strides[0], __pyx_v_ssl00.suboffsets[0],
        0,
        0,
        &__pyx_t_28,
        0,
        __pyx_v_u00,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 725, __pyx_L1_error)
    }

    __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_t_5, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
        __pyx_t_5.memview = NULL;
        __pyx_t_5.data = NULL;
        __pyx_t_1 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_1) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
            __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
            PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
            __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else
          #endif
          {
            __pyx_t_29 = PyTuple_New(1+1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_29);
            __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_1); __pyx_t_1 = NULL;
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_29, 0+1, __pyx_t_4);
            __pyx_t_4 = 0;
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_29 = PyTuple_New(2); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_t_3);
        __pyx_t_2 = 0;
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_stat, __pyx_t_29, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __Pyx_XDECREF_SET(__pyx_v_stat00, __pyx_t_3);
        __pyx_t_3 = 0;

    +0726:         stat11 = stat(np.asarray(ssl11[:u11]), i, **kwargs)

        __pyx_t_29 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_29, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __pyx_t_5.data = __pyx_v_ssl11.data;
        __pyx_t_5.memview = __pyx_v_ssl11.memview;
        __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
        __pyx_t_28 = -1;
        if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl11.shape[0], __pyx_v_ssl11.strides[0], __pyx_v_ssl11.suboffsets[0],
        0,
        0,
        &__pyx_t_28,
        0,
        __pyx_v_u11,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 726, __pyx_L1_error)
    }

    __pyx_t_29 = __pyx_memoryview_fromslice(__pyx_t_5, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
        __pyx_t_5.memview = NULL;
        __pyx_t_5.data = NULL;
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        if (!__pyx_t_4) {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_29); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_29};
            __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_29};
            __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          } else
          #endif
          {
            __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL;
            __Pyx_GIVEREF(__pyx_t_29);
            PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_29);
            __pyx_t_29 = 0;
            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
        __pyx_t_3 = 0;
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_stat, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_stat11, __pyx_t_2);
        __pyx_t_2 = 0;
    /* … */
        __pyx_t_29 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_29, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __pyx_t_5.data = __pyx_v_ssl11.data;
        __pyx_t_5.memview = __pyx_v_ssl11.memview;
        __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
        __pyx_t_28 = -1;
        if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl11.shape[0], __pyx_v_ssl11.strides[0], __pyx_v_ssl11.suboffsets[0],
        0,
        0,
        &__pyx_t_28,
        0,
        __pyx_v_u11,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 726, __pyx_L1_error)
    }

    __pyx_t_29 = __pyx_memoryview_fromslice(__pyx_t_5, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
        __pyx_t_5.memview = NULL;
        __pyx_t_5.data = NULL;
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        if (!__pyx_t_4) {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_29); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_29};
            __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_29};
            __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          } else
          #endif
          {
            __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL;
            __Pyx_GIVEREF(__pyx_t_29);
            PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_29);
            __pyx_t_29 = 0;
            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
        __pyx_t_3 = 0;
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_stat, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_stat11, __pyx_t_2);
        __pyx_t_2 = 0;
    /* … */
        __pyx_t_29 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_29, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __pyx_t_5.data = __pyx_v_ssl11.data;
        __pyx_t_5.memview = __pyx_v_ssl11.memview;
        __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
        __pyx_t_28 = -1;
        if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl11.shape[0], __pyx_v_ssl11.strides[0], __pyx_v_ssl11.suboffsets[0],
        0,
        0,
        &__pyx_t_28,
        0,
        __pyx_v_u11,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 726, __pyx_L1_error)
    }

    __pyx_t_29 = __pyx_memoryview_fromslice(__pyx_t_5, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
        __pyx_t_5.memview = NULL;
        __pyx_t_5.data = NULL;
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        if (!__pyx_t_4) {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_29); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_29};
            __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_29};
            __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          } else
          #endif
          {
            __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL;
            __Pyx_GIVEREF(__pyx_t_29);
            PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_29);
            __pyx_t_29 = 0;
            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
        __pyx_t_3 = 0;
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_stat, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_stat11, __pyx_t_2);
        __pyx_t_2 = 0;
    /* … */
        __pyx_t_29 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_29, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __pyx_t_5.data = __pyx_v_ssl11.data;
        __pyx_t_5.memview = __pyx_v_ssl11.memview;
        __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
        __pyx_t_28 = -1;
        if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl11.shape[0], __pyx_v_ssl11.strides[0], __pyx_v_ssl11.suboffsets[0],
        0,
        0,
        &__pyx_t_28,
        0,
        __pyx_v_u11,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 726, __pyx_L1_error)
    }

    __pyx_t_29 = __pyx_memoryview_fromslice(__pyx_t_5, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
        __pyx_t_5.memview = NULL;
        __pyx_t_5.data = NULL;
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        if (!__pyx_t_4) {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_29); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_29};
            __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_29};
            __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          } else
          #endif
          {
            __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL;
            __Pyx_GIVEREF(__pyx_t_29);
            PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_29);
            __pyx_t_29 = 0;
            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
        __pyx_t_3 = 0;
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_stat, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_stat11, __pyx_t_2);
        __pyx_t_2 = 0;
    /* … */
        __pyx_t_29 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_29, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __pyx_t_5.data = __pyx_v_ssl11.data;
        __pyx_t_5.memview = __pyx_v_ssl11.memview;
        __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
        __pyx_t_28 = -1;
        if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl11.shape[0], __pyx_v_ssl11.strides[0], __pyx_v_ssl11.suboffsets[0],
        0,
        0,
        &__pyx_t_28,
        0,
        __pyx_v_u11,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 726, __pyx_L1_error)
    }

    __pyx_t_29 = __pyx_memoryview_fromslice(__pyx_t_5, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
        __pyx_t_5.memview = NULL;
        __pyx_t_5.data = NULL;
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        if (!__pyx_t_4) {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_29); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_29};
            __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_29};
            __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          } else
          #endif
          {
            __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL;
            __Pyx_GIVEREF(__pyx_t_29);
            PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_29);
            __pyx_t_29 = 0;
            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
        __pyx_t_3 = 0;
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_stat, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_stat11, __pyx_t_2);
        __pyx_t_2 = 0;
    /* … */
        __pyx_t_29 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_29, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __pyx_t_5.data = __pyx_v_ssl11.data;
        __pyx_t_5.memview = __pyx_v_ssl11.memview;
        __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
        __pyx_t_28 = -1;
        if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl11.shape[0], __pyx_v_ssl11.strides[0], __pyx_v_ssl11.suboffsets[0],
        0,
        0,
        &__pyx_t_28,
        0,
        __pyx_v_u11,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 726, __pyx_L1_error)
    }

    __pyx_t_29 = __pyx_memoryview_fromslice(__pyx_t_5, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
        __pyx_t_5.memview = NULL;
        __pyx_t_5.data = NULL;
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        if (!__pyx_t_4) {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_29); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_29};
            __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_29};
            __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          } else
          #endif
          {
            __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL;
            __Pyx_GIVEREF(__pyx_t_29);
            PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_29);
            __pyx_t_29 = 0;
            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
        __pyx_t_3 = 0;
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_stat, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_stat11, __pyx_t_2);
        __pyx_t_2 = 0;
    /* … */
        __pyx_t_29 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_29, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __pyx_t_5.data = __pyx_v_ssl11.data;
        __pyx_t_5.memview = __pyx_v_ssl11.memview;
        __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
        __pyx_t_28 = -1;
        if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl11.shape[0], __pyx_v_ssl11.strides[0], __pyx_v_ssl11.suboffsets[0],
        0,
        0,
        &__pyx_t_28,
        0,
        __pyx_v_u11,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 726, __pyx_L1_error)
    }

    __pyx_t_29 = __pyx_memoryview_fromslice(__pyx_t_5, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
        __pyx_t_5.memview = NULL;
        __pyx_t_5.data = NULL;
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        if (!__pyx_t_4) {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_29); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_29};
            __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_29};
            __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          } else
          #endif
          {
            __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL;
            __Pyx_GIVEREF(__pyx_t_29);
            PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_29);
            __pyx_t_29 = 0;
            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
        __pyx_t_3 = 0;
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_stat, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_stat11, __pyx_t_2);
        __pyx_t_2 = 0;
    /* … */
        __pyx_t_29 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_29, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
        __pyx_t_5.data = __pyx_v_ssl11.data;
        __pyx_t_5.memview = __pyx_v_ssl11.memview;
        __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
        __pyx_t_28 = -1;
        if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl11.shape[0], __pyx_v_ssl11.strides[0], __pyx_v_ssl11.suboffsets[0],
        0,
        0,
        &__pyx_t_28,
        0,
        __pyx_v_u11,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 726, __pyx_L1_error)
    }

    __pyx_t_29 = __pyx_memoryview_fromslice(__pyx_t_5, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_29);
        __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
        __pyx_t_5.memview = NULL;
        __pyx_t_5.data = NULL;
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        if (!__pyx_t_4) {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_29); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_29};
            __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
            PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_29};
            __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
          } else
          #endif
          {
            __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL;
            __Pyx_GIVEREF(__pyx_t_29);
            PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_29);
            __pyx_t_29 = 0;
            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
        __pyx_t_3 = 0;
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_stat, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_stat11, __pyx_t_2);
        __pyx_t_2 = 0;

    +0727:         vstat0[i] = stat00

        __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_v_stat00); if (unlikely((__pyx_t_30 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 727, __pyx_L1_error)
        __pyx_t_31 = __pyx_v_i;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_31 * __pyx_v_vstat0.strides[0]) )) = __pyx_t_30;
    /* … */
        __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_v_stat00); if (unlikely((__pyx_t_30 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 727, __pyx_L1_error)
        __pyx_t_31 = __pyx_v_i;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_31 * __pyx_v_vstat0.strides[0]) )) = __pyx_t_30;
    /* … */
        __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_v_stat00); if (unlikely((__pyx_t_30 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 727, __pyx_L1_error)
        __pyx_t_31 = __pyx_v_i;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_31 * __pyx_v_vstat0.strides[0]) )) = __pyx_t_30;
    /* … */
        __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_v_stat00); if (unlikely((__pyx_t_30 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 727, __pyx_L1_error)
        __pyx_t_31 = __pyx_v_i;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_31 * __pyx_v_vstat0.strides[0]) )) = __pyx_t_30;
    /* … */
        __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_v_stat00); if (unlikely((__pyx_t_30 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 727, __pyx_L1_error)
        __pyx_t_31 = __pyx_v_i;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_31 * __pyx_v_vstat0.strides[0]) )) = __pyx_t_30;
    /* … */
        __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_v_stat00); if (unlikely((__pyx_t_30 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 727, __pyx_L1_error)
        __pyx_t_31 = __pyx_v_i;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_31 * __pyx_v_vstat0.strides[0]) )) = __pyx_t_30;
    /* … */
        __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_v_stat00); if (unlikely((__pyx_t_30 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 727, __pyx_L1_error)
        __pyx_t_31 = __pyx_v_i;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_31 * __pyx_v_vstat0.strides[0]) )) = __pyx_t_30;
    /* … */
        __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_v_stat00); if (unlikely((__pyx_t_30 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 727, __pyx_L1_error)
        __pyx_t_31 = __pyx_v_i;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_31 * __pyx_v_vstat0.strides[0]) )) = __pyx_t_30;

    +0728:         vstat1[i] = stat11

        __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_v_stat11); if (unlikely((__pyx_t_30 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 728, __pyx_L1_error)
        __pyx_t_32 = __pyx_v_i;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_32 * __pyx_v_vstat1.strides[0]) )) = __pyx_t_30;
      }
    /* … */
        __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_v_stat11); if (unlikely((__pyx_t_30 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 728, __pyx_L1_error)
        __pyx_t_32 = __pyx_v_i;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_32 * __pyx_v_vstat1.strides[0]) )) = __pyx_t_30;
      }
    /* … */
        __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_v_stat11); if (unlikely((__pyx_t_30 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 728, __pyx_L1_error)
        __pyx_t_32 = __pyx_v_i;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_32 * __pyx_v_vstat1.strides[0]) )) = __pyx_t_30;
      }
    /* … */
        __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_v_stat11); if (unlikely((__pyx_t_30 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 728, __pyx_L1_error)
        __pyx_t_32 = __pyx_v_i;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_32 * __pyx_v_vstat1.strides[0]) )) = __pyx_t_30;
      }
    /* … */
        __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_v_stat11); if (unlikely((__pyx_t_30 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 728, __pyx_L1_error)
        __pyx_t_32 = __pyx_v_i;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_32 * __pyx_v_vstat1.strides[0]) )) = __pyx_t_30;
      }
    /* … */
        __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_v_stat11); if (unlikely((__pyx_t_30 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 728, __pyx_L1_error)
        __pyx_t_32 = __pyx_v_i;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_32 * __pyx_v_vstat1.strides[0]) )) = __pyx_t_30;
      }
    /* … */
        __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_v_stat11); if (unlikely((__pyx_t_30 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 728, __pyx_L1_error)
        __pyx_t_32 = __pyx_v_i;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_32 * __pyx_v_vstat1.strides[0]) )) = __pyx_t_30;
      }
    /* … */
        __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_v_stat11); if (unlikely((__pyx_t_30 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 728, __pyx_L1_error)
        __pyx_t_32 = __pyx_v_i;
        *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_32 * __pyx_v_vstat1.strides[0]) )) = __pyx_t_30;
      }

     0729:

    +0730:     return np.asarray(vstat0), np.asarray(vstat1)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_29 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_29)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_29);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_29) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_1};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_1};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_29); __pyx_t_29 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_29 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_29)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_29);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_29) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_33 = PyTuple_New(1+1); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_33);
          __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_29); __pyx_t_29 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_33, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_29 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_29)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_29);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_29) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_1};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_1};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_29); __pyx_t_29 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_29 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_29)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_29);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_29) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_33 = PyTuple_New(1+1); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_33);
          __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_29); __pyx_t_29 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_33, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_29 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_29)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_29);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_29) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_1};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_1};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_29); __pyx_t_29 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_29 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_29)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_29);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_29) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_33 = PyTuple_New(1+1); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_33);
          __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_29); __pyx_t_29 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_33, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_29 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_29)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_29);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_29) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_1};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_1};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_29); __pyx_t_29 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_29 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_29)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_29);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_29) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_33 = PyTuple_New(1+1); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_33);
          __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_29); __pyx_t_29 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_33, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_29 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_29)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_29);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_29) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_1};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_1};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_29); __pyx_t_29 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_29 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_29)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_29);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_29) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_33 = PyTuple_New(1+1); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_33);
          __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_29); __pyx_t_29 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_33, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_29 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_29)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_29);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_29) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_1};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_1};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_29); __pyx_t_29 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_29 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_29)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_29);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_29) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_33 = PyTuple_New(1+1); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_33);
          __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_29); __pyx_t_29 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_33, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_29 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_29)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_29);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_29) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_1};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_1};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_29); __pyx_t_29 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_29 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_29)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_29);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_29) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_33 = PyTuple_New(1+1); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_33);
          __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_29); __pyx_t_29 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_33, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_29 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_29)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_29);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_29) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_1};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_1};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else
        #endif
        {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_29); __pyx_t_29 = NULL;
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_29 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_29)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_29);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_29) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_33 = PyTuple_New(1+1); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_33);
          __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_29); __pyx_t_29 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_33, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     0731:

     0732:

     0733: @cython.boundscheck(False)

     0734: @cython.wraparound(False)

    +0735: def ihh01_scan(integer[:, :] h,

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_29ihh01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_5allel_3opt_5stats_28ihh01_scan[] = "Scan forwards over haplotypes, computing a summary statistic derived\n    from the pairwise shared suffix lengths for each variant, for the\n    reference (0) and alternate (1) alleles separately.";
    static PyMethodDef __pyx_mdef_5allel_3opt_5stats_29ihh01_scan = {"ihh01_scan", (PyCFunction)__pyx_pw_5allel_3opt_5stats_29ihh01_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_28ihh01_scan};
    static PyObject *__pyx_pw_5allel_3opt_5stats_29ihh01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_signatures = 0;
      PyObject *__pyx_v_args = 0;
      PyObject *__pyx_v_kwargs = 0;
      CYTHON_UNUSED PyObject *__pyx_v_defaults = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0};
        PyObject* values[4] = {0,0,0,0};
        values[2] = __pyx_k__46;
        values[3] = __pyx_k__47;
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 735, __pyx_L3_error)
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults);
              if (value) { values[3] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 735, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        }
        __pyx_v_signatures = values[0];
        __pyx_v_args = values[1];
        __pyx_v_kwargs = values[2];
        __pyx_v_defaults = values[3];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 735, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_28ihh01_scan(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_28ihh01_scan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
      PyObject *__pyx_v_dest_sig = NULL;
      PyTypeObject *__pyx_v_ndarray = 0;
      PyObject *__pyx_v_numpy = NULL;
      __Pyx_memviewslice __pyx_v_memslice;
      Py_ssize_t __pyx_v_itemsize;
      int __pyx_v_dtype_signed;
      char __pyx_v_kind;
      int __pyx_v____pyx_int32_t_is_signed;
      int __pyx_v____pyx_uint32_t_is_signed;
      int __pyx_v____pyx_uint64_t_is_signed;
      int __pyx_v____pyx_uint16_t_is_signed;
      int __pyx_v____pyx_int16_t_is_signed;
      int __pyx_v____pyx_uint8_t_is_signed;
      int __pyx_v____pyx_int64_t_is_signed;
      int __pyx_v____pyx_int8_t_is_signed;
      PyObject *__pyx_v_arg = NULL;
      PyObject *__pyx_v_dtype = NULL;
      PyObject *__pyx_v_arg_base = NULL;
      PyObject *__pyx_v_candidates = NULL;
      PyObject *__pyx_v_sig = NULL;
      int __pyx_v_match_found;
      PyObject *__pyx_v_src_type = NULL;
      PyObject *__pyx_v_dst_type = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ihh01_scan", 0);
      __Pyx_TraceCall("ihh01_scan", __pyx_f[0], 735, 0, __PYX_ERR(0, 735, __pyx_L1_error));
      __Pyx_INCREF(__pyx_v_kwargs);
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
      __pyx_v_dest_sig = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_2 = (__pyx_v_kwargs == Py_None);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {
        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1);
        __pyx_t_1 = 0;
      }
      {
        /*try:*/ {
          __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_v_numpy = __pyx_t_1;
          __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 735, __pyx_L4_error)
          __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1);
          __pyx_t_1 = 0;
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L11_try_end;
        __pyx_L4_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
        if (__pyx_t_7) {
          __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 735, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_INCREF(Py_None);
          __Pyx_XDECREF_SET(__pyx_v_ndarray, ((PyTypeObject*)Py_None));
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L5_exception_handled;
        }
        goto __pyx_L6_except_error;
        __pyx_L6_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L1_error;
        __pyx_L5_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        __pyx_L11_try_end:;
      }
      __pyx_v_itemsize = -1L;
      __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1L) < 0);
      __pyx_v____pyx_uint32_t_is_signed = (((__pyx_t_5numpy_uint32_t)-1L) < 0);
      __pyx_v____pyx_uint64_t_is_signed = (((__pyx_t_5numpy_uint64_t)-1L) < 0);
      __pyx_v____pyx_uint16_t_is_signed = (((__pyx_t_5numpy_uint16_t)-1L) < 0);
      __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1L) < 0);
      __pyx_v____pyx_uint8_t_is_signed = (((__pyx_t_5numpy_uint8_t)-1L) < 0);
      __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1L) < 0);
      __pyx_v____pyx_int8_t_is_signed = (((__pyx_t_5numpy_int8_t)-1L) < 0);
      if (unlikely(__pyx_v_args == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 735, __pyx_L1_error)
      }
      __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 735, __pyx_L1_error)
      __pyx_t_3 = ((0 < __pyx_t_10) != 0);
      if (__pyx_t_3) {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 735, __pyx_L1_error)
        }
        __pyx_t_9 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      if (unlikely(__pyx_v_kwargs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 735, __pyx_L1_error)
      }
      __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_h, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {
        if (unlikely(__pyx_v_kwargs == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 735, __pyx_L1_error)
        }
        __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_h); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 735, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      /*else*/ {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(0, 735, __pyx_L1_error)
        }
        __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 735, __pyx_L1_error)
        __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 735, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 735, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 735, __pyx_L1_error)
      }
      __pyx_L14:;
      while (1) {
        __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None));
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {
          __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_dtype = __pyx_t_8;
            __pyx_t_8 = 0;
            goto __pyx_L18;
          }
          __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_arg_base = __pyx_t_8;
            __pyx_t_8 = 0;
            __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
            __pyx_t_2 = (__pyx_t_3 != 0);
            if (__pyx_t_2) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_v_dtype = __pyx_t_8;
              __pyx_t_8 = 0;
              goto __pyx_L19;
            }
            /*else*/ {
              __Pyx_INCREF(Py_None);
              __pyx_v_dtype = Py_None;
            }
            __pyx_L19:;
            goto __pyx_L18;
          }
          /*else*/ {
            __Pyx_INCREF(Py_None);
            __pyx_v_dtype = Py_None;
          }
          __pyx_L18:;
          __pyx_v_itemsize = -1L;
          __pyx_t_2 = (__pyx_v_dtype != Py_None);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_itemsize = __pyx_t_10;
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 735, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_kind = __pyx_t_11;
            __pyx_v_dtype_signed = (__pyx_v_kind == 'i');
            switch (__pyx_v_kind) {
              case 'i':
              case 'u':
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L22_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L26_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L30_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L34_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L38_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L42_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L46_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L50_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              break;
              case 'f':
              break;
              case 'c':
              break;
              case 'O':
              break;
              default: break;
            }
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L54_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L54_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L58_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L58_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L62_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L62_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L66_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L66_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L70_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L70_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L74_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L74_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L78_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L78_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L82_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L82_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
        goto __pyx_L16_break;
      }
      __pyx_L16_break:;
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_candidates = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_10 = 0;
      if (unlikely(__pyx_v_signatures == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 735, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8);
      __pyx_t_8 = __pyx_t_9;
      __pyx_t_9 = 0;
      while (1) {
        __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_13, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7);
        if (unlikely(__pyx_t_14 == 0)) break;
        if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 735, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_v_match_found = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 735, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 735, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /* … */
      __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__48);
      __Pyx_GIVEREF(__pyx_tuple__48);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 735, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
        __Pyx_INCREF(__pyx_v_dest_sig);
        __Pyx_GIVEREF(__pyx_v_dest_sig);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dest_sig);
        __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
          __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_15 = 0;
          __pyx_t_16 = NULL;
        } else {
          __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 735, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 735, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        for (;;) {
          if (likely(!__pyx_t_16)) {
            if (likely(PyList_CheckExact(__pyx_t_9))) {
              if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            } else {
              if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            }
          } else {
            __pyx_t_1 = __pyx_t_16(__pyx_t_9);
            if (unlikely(!__pyx_t_1)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 735, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_1);
          }
          if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
            PyObject* sequence = __pyx_t_1;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 735, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1);
            } else {
              __pyx_t_17 = PyList_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyList_GET_ITEM(sequence, 1);
            }
            __Pyx_INCREF(__pyx_t_17);
            __Pyx_INCREF(__pyx_t_18);
            #else
            __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 735, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 735, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_18);
            #endif
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 735, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
            index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_17);
            index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_18);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) __PYX_ERR(0, 735, __pyx_L1_error)
            __pyx_t_20 = NULL;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            goto __pyx_L90_unpacking_done;
            __pyx_L89_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __pyx_t_20 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 735, __pyx_L1_error)
            __pyx_L90_unpacking_done:;
          }
          __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17);
          __pyx_t_17 = 0;
          __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18);
          __pyx_t_18 = 0;
          __pyx_t_3 = (__pyx_v_dst_type != Py_None);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (__pyx_t_2) {
              __pyx_v_match_found = 1;
              goto __pyx_L92;
            }
            /*else*/ {
              __pyx_v_match_found = 0;
              goto __pyx_L88_break;
            }
            __pyx_L92:;
          }
        }
        __pyx_L88_break:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_2 = (__pyx_v_match_found != 0);
        if (__pyx_t_2) {
          __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 735, __pyx_L1_error)
        }
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
      __pyx_t_3 = ((!__pyx_t_2) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s__8); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__49);
      __Pyx_GIVEREF(__pyx_tuple__49);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 735, __pyx_L1_error)
      }
      __pyx_t_13 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 735, __pyx_L1_error)
      __pyx_t_3 = ((__pyx_t_13 > 1) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__50);
      __Pyx_GIVEREF(__pyx_tuple__50);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 735, __pyx_L1_error)
      }
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_signatures == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 735, __pyx_L1_error)
        }
        __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        goto __pyx_L0;
      }

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_dest_sig);
      __Pyx_XDECREF(__pyx_v_ndarray);
      __Pyx_XDECREF(__pyx_v_numpy);
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XDECREF(__pyx_v_dtype);
      __Pyx_XDECREF(__pyx_v_arg_base);
      __Pyx_XDECREF(__pyx_v_candidates);
      __Pyx_XDECREF(__pyx_v_sig);
      __Pyx_XDECREF(__pyx_v_src_type);
      __Pyx_XDECREF(__pyx_v_dst_type);
      __Pyx_XDECREF(__pyx_v_kwargs);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_338__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__defaults__", 0);
      __Pyx_TraceCall("__defaults__", __pyx_f[0], 735, 0, __PYX_ERR(0, 735, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults24, __pyx_self)->__pyx_arg_min_ehh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults24, __pyx_self)->__pyx_arg_min_maf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults24, __pyx_self)->__pyx_arg_include_edges); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None);
      __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_AddTraceback("allel.opt.stats.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_201ihh01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_201ihh01_scan = {"__pyx_fuse_0ihh01_scan", (PyCFunction)__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_201ihh01_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_28ihh01_scan};
    static PyObject *__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_201ihh01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gaps = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_min_ehh;
      __pyx_t_5numpy_float64_t __pyx_v_min_maf;
      int __pyx_v_include_edges;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ihh01_scan (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_gaps,&__pyx_n_s_min_ehh,&__pyx_n_s_min_maf,&__pyx_n_s_include_edges,0};
        PyObject* values[5] = {0,0,0,0,0};
        __pyx_defaults24 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults24, __pyx_self);
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gaps)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ihh01_scan", 0, 2, 5, 1); __PYX_ERR(0, 735, __pyx_L3_error)
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_ehh);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_maf);
              if (value) { values[3] = value; kw_args--; }
            }
            case  4:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_include_edges);
              if (value) { values[4] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ihh01_scan") < 0)) __PYX_ERR(0, 735, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 735, __pyx_L3_error)
        __pyx_v_gaps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_gaps.memview)) __PYX_ERR(0, 736, __pyx_L3_error)
        if (values[2]) {
          __pyx_v_min_ehh = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_min_ehh == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L3_error)
        } else {
          __pyx_v_min_ehh = __pyx_dynamic_args->__pyx_arg_min_ehh;
        }
        if (values[3]) {
          __pyx_v_min_maf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_maf == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 738, __pyx_L3_error)
        } else {
          __pyx_v_min_maf = __pyx_dynamic_args->__pyx_arg_min_maf;
        }
        if (values[4]) {
          __pyx_v_include_edges = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_include_edges == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 739, __pyx_L3_error)
        } else {
          __pyx_v_include_edges = __pyx_dynamic_args->__pyx_arg_include_edges;
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ihh01_scan", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 735, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.ihh01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_200ihh01_scan(__pyx_self, __pyx_v_h, __pyx_v_gaps, __pyx_v_min_ehh, __pyx_v_min_maf, __pyx_v_include_edges);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_200ihh01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, __Pyx_memviewslice __pyx_v_gaps, __pyx_t_5numpy_float64_t __pyx_v_min_ehh, __pyx_t_5numpy_float64_t __pyx_v_min_maf, int __pyx_v_include_edges) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      Py_ssize_t __pyx_v_c0;
      Py_ssize_t __pyx_v_c1;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_int32_t __pyx_v_l_max_00;
      __pyx_t_5numpy_int32_t __pyx_v_l_max_11;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl00 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl11 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int8_t __pyx_v_a1;
      __pyx_t_5numpy_int8_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_maf;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_0ihh01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_0ihh01_scan", __pyx_f[0], 735, 0, __PYX_ERR(0, 735, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_35);
      __Pyx_XDECREF(__pyx_t_36);
      __Pyx_AddTraceback("allel.opt.stats.ihh01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl00, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl11, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gaps, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_340__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__defaults__", 0);
      __Pyx_TraceCall("__defaults__", __pyx_f[0], 735, 0, __PYX_ERR(0, 735, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults25, __pyx_self)->__pyx_arg_min_ehh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults25, __pyx_self)->__pyx_arg_min_maf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults25, __pyx_self)->__pyx_arg_include_edges); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None);
      __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_AddTraceback("allel.opt.stats.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_203ihh01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_203ihh01_scan = {"__pyx_fuse_1ihh01_scan", (PyCFunction)__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_203ihh01_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_28ihh01_scan};
    static PyObject *__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_203ihh01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gaps = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_min_ehh;
      __pyx_t_5numpy_float64_t __pyx_v_min_maf;
      int __pyx_v_include_edges;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ihh01_scan (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_gaps,&__pyx_n_s_min_ehh,&__pyx_n_s_min_maf,&__pyx_n_s_include_edges,0};
        PyObject* values[5] = {0,0,0,0,0};
        __pyx_defaults25 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults25, __pyx_self);
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gaps)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ihh01_scan", 0, 2, 5, 1); __PYX_ERR(0, 735, __pyx_L3_error)
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_ehh);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_maf);
              if (value) { values[3] = value; kw_args--; }
            }
            case  4:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_include_edges);
              if (value) { values[4] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ihh01_scan") < 0)) __PYX_ERR(0, 735, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 735, __pyx_L3_error)
        __pyx_v_gaps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_gaps.memview)) __PYX_ERR(0, 736, __pyx_L3_error)
        if (values[2]) {
          __pyx_v_min_ehh = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_min_ehh == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L3_error)
        } else {
          __pyx_v_min_ehh = __pyx_dynamic_args->__pyx_arg_min_ehh;
        }
        if (values[3]) {
          __pyx_v_min_maf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_maf == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 738, __pyx_L3_error)
        } else {
          __pyx_v_min_maf = __pyx_dynamic_args->__pyx_arg_min_maf;
        }
        if (values[4]) {
          __pyx_v_include_edges = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_include_edges == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 739, __pyx_L3_error)
        } else {
          __pyx_v_include_edges = __pyx_dynamic_args->__pyx_arg_include_edges;
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ihh01_scan", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 735, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.ihh01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_202ihh01_scan(__pyx_self, __pyx_v_h, __pyx_v_gaps, __pyx_v_min_ehh, __pyx_v_min_maf, __pyx_v_include_edges);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_202ihh01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, __Pyx_memviewslice __pyx_v_gaps, __pyx_t_5numpy_float64_t __pyx_v_min_ehh, __pyx_t_5numpy_float64_t __pyx_v_min_maf, int __pyx_v_include_edges) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      Py_ssize_t __pyx_v_c0;
      Py_ssize_t __pyx_v_c1;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_int32_t __pyx_v_l_max_00;
      __pyx_t_5numpy_int32_t __pyx_v_l_max_11;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl00 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl11 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int16_t __pyx_v_a1;
      __pyx_t_5numpy_int16_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_maf;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_1ihh01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_1ihh01_scan", __pyx_f[0], 735, 0, __PYX_ERR(0, 735, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_35);
      __Pyx_XDECREF(__pyx_t_36);
      __Pyx_AddTraceback("allel.opt.stats.ihh01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl00, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl11, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gaps, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_342__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__defaults__", 0);
      __Pyx_TraceCall("__defaults__", __pyx_f[0], 735, 0, __PYX_ERR(0, 735, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults26, __pyx_self)->__pyx_arg_min_ehh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults26, __pyx_self)->__pyx_arg_min_maf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults26, __pyx_self)->__pyx_arg_include_edges); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None);
      __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_AddTraceback("allel.opt.stats.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_205ihh01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_205ihh01_scan = {"__pyx_fuse_2ihh01_scan", (PyCFunction)__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_205ihh01_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_28ihh01_scan};
    static PyObject *__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_205ihh01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gaps = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_min_ehh;
      __pyx_t_5numpy_float64_t __pyx_v_min_maf;
      int __pyx_v_include_edges;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ihh01_scan (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_gaps,&__pyx_n_s_min_ehh,&__pyx_n_s_min_maf,&__pyx_n_s_include_edges,0};
        PyObject* values[5] = {0,0,0,0,0};
        __pyx_defaults26 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults26, __pyx_self);
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gaps)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ihh01_scan", 0, 2, 5, 1); __PYX_ERR(0, 735, __pyx_L3_error)
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_ehh);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_maf);
              if (value) { values[3] = value; kw_args--; }
            }
            case  4:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_include_edges);
              if (value) { values[4] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ihh01_scan") < 0)) __PYX_ERR(0, 735, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 735, __pyx_L3_error)
        __pyx_v_gaps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_gaps.memview)) __PYX_ERR(0, 736, __pyx_L3_error)
        if (values[2]) {
          __pyx_v_min_ehh = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_min_ehh == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L3_error)
        } else {
          __pyx_v_min_ehh = __pyx_dynamic_args->__pyx_arg_min_ehh;
        }
        if (values[3]) {
          __pyx_v_min_maf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_maf == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 738, __pyx_L3_error)
        } else {
          __pyx_v_min_maf = __pyx_dynamic_args->__pyx_arg_min_maf;
        }
        if (values[4]) {
          __pyx_v_include_edges = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_include_edges == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 739, __pyx_L3_error)
        } else {
          __pyx_v_include_edges = __pyx_dynamic_args->__pyx_arg_include_edges;
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ihh01_scan", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 735, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.ihh01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_204ihh01_scan(__pyx_self, __pyx_v_h, __pyx_v_gaps, __pyx_v_min_ehh, __pyx_v_min_maf, __pyx_v_include_edges);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_204ihh01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, __Pyx_memviewslice __pyx_v_gaps, __pyx_t_5numpy_float64_t __pyx_v_min_ehh, __pyx_t_5numpy_float64_t __pyx_v_min_maf, int __pyx_v_include_edges) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      Py_ssize_t __pyx_v_c0;
      Py_ssize_t __pyx_v_c1;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_int32_t __pyx_v_l_max_00;
      __pyx_t_5numpy_int32_t __pyx_v_l_max_11;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl00 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl11 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int32_t __pyx_v_a1;
      __pyx_t_5numpy_int32_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_maf;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_2ihh01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_2ihh01_scan", __pyx_f[0], 735, 0, __PYX_ERR(0, 735, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_35);
      __Pyx_XDECREF(__pyx_t_36);
      __Pyx_AddTraceback("allel.opt.stats.ihh01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl00, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl11, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gaps, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_344__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__defaults__", 0);
      __Pyx_TraceCall("__defaults__", __pyx_f[0], 735, 0, __PYX_ERR(0, 735, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults27, __pyx_self)->__pyx_arg_min_ehh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults27, __pyx_self)->__pyx_arg_min_maf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults27, __pyx_self)->__pyx_arg_include_edges); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None);
      __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_AddTraceback("allel.opt.stats.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_207ihh01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_207ihh01_scan = {"__pyx_fuse_3ihh01_scan", (PyCFunction)__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_207ihh01_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_28ihh01_scan};
    static PyObject *__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_207ihh01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gaps = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_min_ehh;
      __pyx_t_5numpy_float64_t __pyx_v_min_maf;
      int __pyx_v_include_edges;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ihh01_scan (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_gaps,&__pyx_n_s_min_ehh,&__pyx_n_s_min_maf,&__pyx_n_s_include_edges,0};
        PyObject* values[5] = {0,0,0,0,0};
        __pyx_defaults27 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults27, __pyx_self);
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gaps)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ihh01_scan", 0, 2, 5, 1); __PYX_ERR(0, 735, __pyx_L3_error)
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_ehh);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_maf);
              if (value) { values[3] = value; kw_args--; }
            }
            case  4:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_include_edges);
              if (value) { values[4] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ihh01_scan") < 0)) __PYX_ERR(0, 735, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 735, __pyx_L3_error)
        __pyx_v_gaps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_gaps.memview)) __PYX_ERR(0, 736, __pyx_L3_error)
        if (values[2]) {
          __pyx_v_min_ehh = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_min_ehh == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L3_error)
        } else {
          __pyx_v_min_ehh = __pyx_dynamic_args->__pyx_arg_min_ehh;
        }
        if (values[3]) {
          __pyx_v_min_maf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_maf == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 738, __pyx_L3_error)
        } else {
          __pyx_v_min_maf = __pyx_dynamic_args->__pyx_arg_min_maf;
        }
        if (values[4]) {
          __pyx_v_include_edges = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_include_edges == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 739, __pyx_L3_error)
        } else {
          __pyx_v_include_edges = __pyx_dynamic_args->__pyx_arg_include_edges;
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ihh01_scan", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 735, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.ihh01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_206ihh01_scan(__pyx_self, __pyx_v_h, __pyx_v_gaps, __pyx_v_min_ehh, __pyx_v_min_maf, __pyx_v_include_edges);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_206ihh01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, __Pyx_memviewslice __pyx_v_gaps, __pyx_t_5numpy_float64_t __pyx_v_min_ehh, __pyx_t_5numpy_float64_t __pyx_v_min_maf, int __pyx_v_include_edges) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      Py_ssize_t __pyx_v_c0;
      Py_ssize_t __pyx_v_c1;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_int32_t __pyx_v_l_max_00;
      __pyx_t_5numpy_int32_t __pyx_v_l_max_11;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl00 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl11 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int64_t __pyx_v_a1;
      __pyx_t_5numpy_int64_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_maf;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_3ihh01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_3ihh01_scan", __pyx_f[0], 735, 0, __PYX_ERR(0, 735, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_35);
      __Pyx_XDECREF(__pyx_t_36);
      __Pyx_AddTraceback("allel.opt.stats.ihh01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl00, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl11, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gaps, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_346__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__defaults__", 0);
      __Pyx_TraceCall("__defaults__", __pyx_f[0], 735, 0, __PYX_ERR(0, 735, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults28, __pyx_self)->__pyx_arg_min_ehh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults28, __pyx_self)->__pyx_arg_min_maf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults28, __pyx_self)->__pyx_arg_include_edges); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None);
      __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_AddTraceback("allel.opt.stats.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_209ihh01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_209ihh01_scan = {"__pyx_fuse_4ihh01_scan", (PyCFunction)__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_209ihh01_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_28ihh01_scan};
    static PyObject *__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_209ihh01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gaps = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_min_ehh;
      __pyx_t_5numpy_float64_t __pyx_v_min_maf;
      int __pyx_v_include_edges;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ihh01_scan (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_gaps,&__pyx_n_s_min_ehh,&__pyx_n_s_min_maf,&__pyx_n_s_include_edges,0};
        PyObject* values[5] = {0,0,0,0,0};
        __pyx_defaults28 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults28, __pyx_self);
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gaps)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ihh01_scan", 0, 2, 5, 1); __PYX_ERR(0, 735, __pyx_L3_error)
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_ehh);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_maf);
              if (value) { values[3] = value; kw_args--; }
            }
            case  4:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_include_edges);
              if (value) { values[4] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ihh01_scan") < 0)) __PYX_ERR(0, 735, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 735, __pyx_L3_error)
        __pyx_v_gaps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_gaps.memview)) __PYX_ERR(0, 736, __pyx_L3_error)
        if (values[2]) {
          __pyx_v_min_ehh = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_min_ehh == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L3_error)
        } else {
          __pyx_v_min_ehh = __pyx_dynamic_args->__pyx_arg_min_ehh;
        }
        if (values[3]) {
          __pyx_v_min_maf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_maf == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 738, __pyx_L3_error)
        } else {
          __pyx_v_min_maf = __pyx_dynamic_args->__pyx_arg_min_maf;
        }
        if (values[4]) {
          __pyx_v_include_edges = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_include_edges == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 739, __pyx_L3_error)
        } else {
          __pyx_v_include_edges = __pyx_dynamic_args->__pyx_arg_include_edges;
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ihh01_scan", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 735, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.ihh01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_208ihh01_scan(__pyx_self, __pyx_v_h, __pyx_v_gaps, __pyx_v_min_ehh, __pyx_v_min_maf, __pyx_v_include_edges);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_208ihh01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, __Pyx_memviewslice __pyx_v_gaps, __pyx_t_5numpy_float64_t __pyx_v_min_ehh, __pyx_t_5numpy_float64_t __pyx_v_min_maf, int __pyx_v_include_edges) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      Py_ssize_t __pyx_v_c0;
      Py_ssize_t __pyx_v_c1;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_int32_t __pyx_v_l_max_00;
      __pyx_t_5numpy_int32_t __pyx_v_l_max_11;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl00 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl11 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_uint8_t __pyx_v_a1;
      __pyx_t_5numpy_uint8_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_maf;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_4ihh01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_4ihh01_scan", __pyx_f[0], 735, 0, __PYX_ERR(0, 735, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_35);
      __Pyx_XDECREF(__pyx_t_36);
      __Pyx_AddTraceback("allel.opt.stats.ihh01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl00, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl11, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gaps, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_348__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__defaults__", 0);
      __Pyx_TraceCall("__defaults__", __pyx_f[0], 735, 0, __PYX_ERR(0, 735, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults29, __pyx_self)->__pyx_arg_min_ehh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults29, __pyx_self)->__pyx_arg_min_maf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults29, __pyx_self)->__pyx_arg_include_edges); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None);
      __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_AddTraceback("allel.opt.stats.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_211ihh01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_211ihh01_scan = {"__pyx_fuse_5ihh01_scan", (PyCFunction)__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_211ihh01_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_28ihh01_scan};
    static PyObject *__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_211ihh01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gaps = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_min_ehh;
      __pyx_t_5numpy_float64_t __pyx_v_min_maf;
      int __pyx_v_include_edges;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ihh01_scan (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_gaps,&__pyx_n_s_min_ehh,&__pyx_n_s_min_maf,&__pyx_n_s_include_edges,0};
        PyObject* values[5] = {0,0,0,0,0};
        __pyx_defaults29 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults29, __pyx_self);
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gaps)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ihh01_scan", 0, 2, 5, 1); __PYX_ERR(0, 735, __pyx_L3_error)
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_ehh);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_maf);
              if (value) { values[3] = value; kw_args--; }
            }
            case  4:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_include_edges);
              if (value) { values[4] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ihh01_scan") < 0)) __PYX_ERR(0, 735, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint16_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 735, __pyx_L3_error)
        __pyx_v_gaps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_gaps.memview)) __PYX_ERR(0, 736, __pyx_L3_error)
        if (values[2]) {
          __pyx_v_min_ehh = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_min_ehh == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L3_error)
        } else {
          __pyx_v_min_ehh = __pyx_dynamic_args->__pyx_arg_min_ehh;
        }
        if (values[3]) {
          __pyx_v_min_maf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_maf == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 738, __pyx_L3_error)
        } else {
          __pyx_v_min_maf = __pyx_dynamic_args->__pyx_arg_min_maf;
        }
        if (values[4]) {
          __pyx_v_include_edges = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_include_edges == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 739, __pyx_L3_error)
        } else {
          __pyx_v_include_edges = __pyx_dynamic_args->__pyx_arg_include_edges;
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ihh01_scan", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 735, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.ihh01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_210ihh01_scan(__pyx_self, __pyx_v_h, __pyx_v_gaps, __pyx_v_min_ehh, __pyx_v_min_maf, __pyx_v_include_edges);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_210ihh01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, __Pyx_memviewslice __pyx_v_gaps, __pyx_t_5numpy_float64_t __pyx_v_min_ehh, __pyx_t_5numpy_float64_t __pyx_v_min_maf, int __pyx_v_include_edges) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      Py_ssize_t __pyx_v_c0;
      Py_ssize_t __pyx_v_c1;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_int32_t __pyx_v_l_max_00;
      __pyx_t_5numpy_int32_t __pyx_v_l_max_11;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl00 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl11 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_uint16_t __pyx_v_a1;
      __pyx_t_5numpy_uint16_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_maf;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_5ihh01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_5ihh01_scan", __pyx_f[0], 735, 0, __PYX_ERR(0, 735, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_35);
      __Pyx_XDECREF(__pyx_t_36);
      __Pyx_AddTraceback("allel.opt.stats.ihh01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl00, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl11, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gaps, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_350__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__defaults__", 0);
      __Pyx_TraceCall("__defaults__", __pyx_f[0], 735, 0, __PYX_ERR(0, 735, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults30, __pyx_self)->__pyx_arg_min_ehh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults30, __pyx_self)->__pyx_arg_min_maf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults30, __pyx_self)->__pyx_arg_include_edges); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None);
      __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_AddTraceback("allel.opt.stats.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_213ihh01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_213ihh01_scan = {"__pyx_fuse_6ihh01_scan", (PyCFunction)__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_213ihh01_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_28ihh01_scan};
    static PyObject *__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_213ihh01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gaps = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_min_ehh;
      __pyx_t_5numpy_float64_t __pyx_v_min_maf;
      int __pyx_v_include_edges;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ihh01_scan (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_gaps,&__pyx_n_s_min_ehh,&__pyx_n_s_min_maf,&__pyx_n_s_include_edges,0};
        PyObject* values[5] = {0,0,0,0,0};
        __pyx_defaults30 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults30, __pyx_self);
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gaps)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ihh01_scan", 0, 2, 5, 1); __PYX_ERR(0, 735, __pyx_L3_error)
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_ehh);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_maf);
              if (value) { values[3] = value; kw_args--; }
            }
            case  4:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_include_edges);
              if (value) { values[4] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ihh01_scan") < 0)) __PYX_ERR(0, 735, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 735, __pyx_L3_error)
        __pyx_v_gaps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_gaps.memview)) __PYX_ERR(0, 736, __pyx_L3_error)
        if (values[2]) {
          __pyx_v_min_ehh = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_min_ehh == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L3_error)
        } else {
          __pyx_v_min_ehh = __pyx_dynamic_args->__pyx_arg_min_ehh;
        }
        if (values[3]) {
          __pyx_v_min_maf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_maf == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 738, __pyx_L3_error)
        } else {
          __pyx_v_min_maf = __pyx_dynamic_args->__pyx_arg_min_maf;
        }
        if (values[4]) {
          __pyx_v_include_edges = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_include_edges == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 739, __pyx_L3_error)
        } else {
          __pyx_v_include_edges = __pyx_dynamic_args->__pyx_arg_include_edges;
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ihh01_scan", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 735, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.ihh01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_212ihh01_scan(__pyx_self, __pyx_v_h, __pyx_v_gaps, __pyx_v_min_ehh, __pyx_v_min_maf, __pyx_v_include_edges);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_212ihh01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, __Pyx_memviewslice __pyx_v_gaps, __pyx_t_5numpy_float64_t __pyx_v_min_ehh, __pyx_t_5numpy_float64_t __pyx_v_min_maf, int __pyx_v_include_edges) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      Py_ssize_t __pyx_v_c0;
      Py_ssize_t __pyx_v_c1;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_int32_t __pyx_v_l_max_00;
      __pyx_t_5numpy_int32_t __pyx_v_l_max_11;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl00 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl11 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_uint32_t __pyx_v_a1;
      __pyx_t_5numpy_uint32_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_maf;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_6ihh01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_6ihh01_scan", __pyx_f[0], 735, 0, __PYX_ERR(0, 735, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_35);
      __Pyx_XDECREF(__pyx_t_36);
      __Pyx_AddTraceback("allel.opt.stats.ihh01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl00, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl11, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gaps, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_352__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__defaults__", 0);
      __Pyx_TraceCall("__defaults__", __pyx_f[0], 735, 0, __PYX_ERR(0, 735, __pyx_L1_error));
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults31, __pyx_self)->__pyx_arg_min_ehh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults31, __pyx_self)->__pyx_arg_min_maf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults31, __pyx_self)->__pyx_arg_include_edges); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None);
      __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_AddTraceback("allel.opt.stats.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_215ihh01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_215ihh01_scan = {"__pyx_fuse_7ihh01_scan", (PyCFunction)__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_215ihh01_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_28ihh01_scan};
    static PyObject *__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_215ihh01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_gaps = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_min_ehh;
      __pyx_t_5numpy_float64_t __pyx_v_min_maf;
      int __pyx_v_include_edges;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ihh01_scan (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_h,&__pyx_n_s_gaps,&__pyx_n_s_min_ehh,&__pyx_n_s_min_maf,&__pyx_n_s_include_edges,0};
        PyObject* values[5] = {0,0,0,0,0};
        __pyx_defaults31 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults31, __pyx_self);
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gaps)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("ihh01_scan", 0, 2, 5, 1); __PYX_ERR(0, 735, __pyx_L3_error)
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_ehh);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_maf);
              if (value) { values[3] = value; kw_args--; }
            }
            case  4:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_include_edges);
              if (value) { values[4] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ihh01_scan") < 0)) __PYX_ERR(0, 735, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint64_t(values[0]); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 735, __pyx_L3_error)
        __pyx_v_gaps = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[1]); if (unlikely(!__pyx_v_gaps.memview)) __PYX_ERR(0, 736, __pyx_L3_error)
        if (values[2]) {
          __pyx_v_min_ehh = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_min_ehh == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L3_error)
        } else {
          __pyx_v_min_ehh = __pyx_dynamic_args->__pyx_arg_min_ehh;
        }
        if (values[3]) {
          __pyx_v_min_maf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_maf == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 738, __pyx_L3_error)
        } else {
          __pyx_v_min_maf = __pyx_dynamic_args->__pyx_arg_min_maf;
        }
        if (values[4]) {
          __pyx_v_include_edges = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_include_edges == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 739, __pyx_L3_error)
        } else {
          __pyx_v_include_edges = __pyx_dynamic_args->__pyx_arg_include_edges;
        }
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("ihh01_scan", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 735, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.ihh01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_214ihh01_scan(__pyx_self, __pyx_v_h, __pyx_v_gaps, __pyx_v_min_ehh, __pyx_v_min_maf, __pyx_v_include_edges);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_214ihh01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h, __Pyx_memviewslice __pyx_v_gaps, __pyx_t_5numpy_float64_t __pyx_v_min_ehh, __pyx_t_5numpy_float64_t __pyx_v_min_maf, int __pyx_v_include_edges) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      Py_ssize_t __pyx_v_c0;
      Py_ssize_t __pyx_v_c1;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __pyx_t_5numpy_int32_t __pyx_v_l_max_00;
      __pyx_t_5numpy_int32_t __pyx_v_l_max_11;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl00 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_ssl11 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_uint64_t __pyx_v_a1;
      __pyx_t_5numpy_uint64_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_float64_t __pyx_v_maf;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_7ihh01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_7ihh01_scan", __pyx_f[0], 735, 0, __PYX_ERR(0, 735, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_35);
      __Pyx_XDECREF(__pyx_t_36);
      __Pyx_AddTraceback("allel.opt.stats.ihh01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl00, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl11, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_gaps, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
      __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__51);
      __Pyx_GIVEREF(__pyx_tuple__51);
    /* … */
      __pyx_t_25 = PyTuple_New(3); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_25);
      __Pyx_GIVEREF(__pyx_t_22);
      PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_22);
      __Pyx_GIVEREF(__pyx_t_23);
      PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_t_23);
      __Pyx_GIVEREF(__pyx_t_24);
      PyTuple_SET_ITEM(__pyx_t_25, 2, __pyx_t_24);
      __pyx_t_22 = 0;
      __pyx_t_23 = 0;
      __pyx_t_24 = 0;
    /* … */
      __pyx_tuple__127 = PyTuple_Pack(27, __pyx_n_s_h, __pyx_n_s_gaps, __pyx_n_s_min_ehh, __pyx_n_s_min_maf, __pyx_n_s_include_edges, __pyx_n_s_n_variants, __pyx_n_s_n_haplotypes, __pyx_n_s_n_pairs, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_u, __pyx_n_s_u00, __pyx_n_s_u11, __pyx_n_s_c0, __pyx_n_s_c1, __pyx_n_s_l, __pyx_n_s_l_max_00, __pyx_n_s_l_max_11, __pyx_n_s_ssl, __pyx_n_s_ssl00, __pyx_n_s_ssl11, __pyx_n_s_a1, __pyx_n_s_a2, __pyx_n_s_vstat0, __pyx_n_s_vstat1, __pyx_n_s_maf); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__127);
      __Pyx_GIVEREF(__pyx_tuple__127);
    /* … */
      __pyx_t_24 = PyDict_New(); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_24);
      __pyx_t_23 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_201ihh01_scan, 0, __pyx_n_s_ihh01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_23);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_23, sizeof(__pyx_defaults24), 0)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_CyFunction_Defaults(__pyx_defaults24, __pyx_t_23)->__pyx_arg_min_ehh = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults24, __pyx_t_23)->__pyx_arg_min_maf = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults24, __pyx_t_23)->__pyx_arg_include_edges = 0;
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_23, __pyx_t_25);
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_23, __pyx_pf_5allel_3opt_5stats_338__defaults__);
      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_int8_t, __pyx_t_23) < 0) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
      __pyx_t_23 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_203ihh01_scan, 0, __pyx_n_s_ihh01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_23);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_23, sizeof(__pyx_defaults25), 0)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_CyFunction_Defaults(__pyx_defaults25, __pyx_t_23)->__pyx_arg_min_ehh = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults25, __pyx_t_23)->__pyx_arg_min_maf = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults25, __pyx_t_23)->__pyx_arg_include_edges = 0;
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_23, __pyx_t_25);
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_23, __pyx_pf_5allel_3opt_5stats_340__defaults__);
      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_int16_t, __pyx_t_23) < 0) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
      __pyx_t_23 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_205ihh01_scan, 0, __pyx_n_s_ihh01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_23);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_23, sizeof(__pyx_defaults26), 0)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_CyFunction_Defaults(__pyx_defaults26, __pyx_t_23)->__pyx_arg_min_ehh = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults26, __pyx_t_23)->__pyx_arg_min_maf = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults26, __pyx_t_23)->__pyx_arg_include_edges = 0;
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_23, __pyx_t_25);
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_23, __pyx_pf_5allel_3opt_5stats_342__defaults__);
      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_int32_t, __pyx_t_23) < 0) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
      __pyx_t_23 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_207ihh01_scan, 0, __pyx_n_s_ihh01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_23);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_23, sizeof(__pyx_defaults27), 0)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_CyFunction_Defaults(__pyx_defaults27, __pyx_t_23)->__pyx_arg_min_ehh = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults27, __pyx_t_23)->__pyx_arg_min_maf = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults27, __pyx_t_23)->__pyx_arg_include_edges = 0;
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_23, __pyx_t_25);
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_23, __pyx_pf_5allel_3opt_5stats_344__defaults__);
      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_int64_t, __pyx_t_23) < 0) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
      __pyx_t_23 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_209ihh01_scan, 0, __pyx_n_s_ihh01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_23);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_23, sizeof(__pyx_defaults28), 0)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_CyFunction_Defaults(__pyx_defaults28, __pyx_t_23)->__pyx_arg_min_ehh = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults28, __pyx_t_23)->__pyx_arg_min_maf = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults28, __pyx_t_23)->__pyx_arg_include_edges = 0;
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_23, __pyx_t_25);
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_23, __pyx_pf_5allel_3opt_5stats_346__defaults__);
      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_uint8_t, __pyx_t_23) < 0) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
      __pyx_t_23 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_211ihh01_scan, 0, __pyx_n_s_ihh01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_23);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_23, sizeof(__pyx_defaults29), 0)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_CyFunction_Defaults(__pyx_defaults29, __pyx_t_23)->__pyx_arg_min_ehh = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults29, __pyx_t_23)->__pyx_arg_min_maf = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults29, __pyx_t_23)->__pyx_arg_include_edges = 0;
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_23, __pyx_t_25);
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_23, __pyx_pf_5allel_3opt_5stats_348__defaults__);
      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_uint16_t, __pyx_t_23) < 0) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
      __pyx_t_23 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_213ihh01_scan, 0, __pyx_n_s_ihh01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_23);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_23, sizeof(__pyx_defaults30), 0)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_CyFunction_Defaults(__pyx_defaults30, __pyx_t_23)->__pyx_arg_min_ehh = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults30, __pyx_t_23)->__pyx_arg_min_maf = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults30, __pyx_t_23)->__pyx_arg_include_edges = 0;
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_23, __pyx_t_25);
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_23, __pyx_pf_5allel_3opt_5stats_350__defaults__);
      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_uint32_t, __pyx_t_23) < 0) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
      __pyx_t_23 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_215ihh01_scan, 0, __pyx_n_s_ihh01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_23);
      if (!__Pyx_CyFunction_InitDefaults(__pyx_t_23, sizeof(__pyx_defaults31), 0)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_CyFunction_Defaults(__pyx_defaults31, __pyx_t_23)->__pyx_arg_min_ehh = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults31, __pyx_t_23)->__pyx_arg_min_maf = 0;
      __Pyx_CyFunction_Defaults(__pyx_defaults31, __pyx_t_23)->__pyx_arg_include_edges = 0;
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_23, __pyx_t_25);
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_23, __pyx_pf_5allel_3opt_5stats_352__defaults__);
      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_uint64_t, __pyx_t_23) < 0) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
      __pyx_t_23 = __pyx_FusedFunction_NewEx(&__pyx_mdef_5allel_3opt_5stats_29ihh01_scan, 0, __pyx_n_s_ihh01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_23);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_23, __pyx_t_25);
      __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_23, __pyx_pf_5allel_3opt_5stats_338__defaults__);
      ((__pyx_FusedFunctionObject *) __pyx_t_23)->__signatures__ = __pyx_t_24;
      __Pyx_GIVEREF(__pyx_t_24);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_ihh01_scan, __pyx_t_23) < 0) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
      __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
      __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(5, 0, 27, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aliman_src_github_cggh_sci, __pyx_n_s_ihh01_scan, 735, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(0, 735, __pyx_L1_error)

     0736:                cnp.float64_t[:] gaps,

    +0737:                cnp.float64_t min_ehh=0,

      __pyx_t_22 = __Pyx_PyInt_From_long(0); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 737, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_22);
    /* … */
      __pyx_t_24 = __Pyx_PyInt_From_long(0); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 737, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_24);
      __pyx_k__46 = __pyx_t_24;
      __Pyx_GIVEREF(__pyx_t_24);
      __pyx_t_24 = 0;

    +0738:                cnp.float64_t min_maf=0,

      __pyx_t_23 = __Pyx_PyInt_From_long(0); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 738, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_23);
    /* … */
      __pyx_t_24 = __Pyx_PyInt_From_long(0); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 738, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_24);
      __pyx_k__47 = __pyx_t_24;
      __Pyx_GIVEREF(__pyx_t_24);
      __pyx_t_24 = 0;

    +0739:                bint include_edges=False):

      __pyx_t_24 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 739, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_24);

     0740:     """Scan forwards over haplotypes, computing a summary statistic derived

     0741:     from the pairwise shared suffix lengths for each variant, for the

     0742:     reference (0) and alternate (1) alleles separately."""

     0743:

     0744:     cdef:

     0745:         Py_ssize_t n_variants, n_haplotypes, n_pairs, i, j, k, u, u00, u11, \

     0746:             c0, c1

     0747:         cnp.int32_t l, l_max_00, l_max_11

     0748:         cnp.int32_t[:] ssl, ssl00, ssl11

     0749:         integer a1, a2

     0750:         cnp.float64_t[:] vstat0, vstat1

     0751:         cnp.float64_t maf

     0752:

     0753:     # initialise

    +0754:     n_variants = h.shape[0]

      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);

    +0755:     n_haplotypes = h.shape[1]

      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);

     0756:

     0757:     # shared suffix lengths between all pairs of haplotypes

    +0758:     n_pairs = (n_haplotypes * (n_haplotypes - 1)) // 2

      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);

    +0759:     ssl = np.zeros(n_pairs, dtype='i4')

      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 759, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 759, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 759, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 759, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 759, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 759, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 759, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 759, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

    +0760:     ssl00 = np.zeros(n_pairs, dtype='i4')

      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 760, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_ssl00 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 760, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_ssl00 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 760, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_ssl00 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 760, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_ssl00 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 760, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_ssl00 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 760, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_ssl00 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 760, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_ssl00 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 760, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_2);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 760, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_ssl00 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

    +0761:     ssl11 = np.zeros(n_pairs, dtype='i4')

      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 761, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_ssl11 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 761, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_ssl11 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 761, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_ssl11 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 761, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_ssl11 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 761, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_ssl11 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 761, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_ssl11 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 761, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_ssl11 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 761, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 761, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_ssl11 = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

     0762:

     0763:     # statistic values for each variant

    +0764:     vstat0 = np.empty(n_variants, dtype='f8')

      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 764, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_4);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 764, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_4);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 764, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_4);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 764, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_4);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 764, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_4);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 764, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_4);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 764, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_4);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 764, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_4);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +0765:     vstat1 = np.empty(n_variants, dtype='f8')

      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 765, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 765, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 765, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 765, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 765, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 765, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 765, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 765, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

     0766:

    +0767:     with nogil:

      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }

     0768:

     0769:         # iterate forward over variants

    +0770:         for i in range(n_variants):

            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;

    +0771:             u = u00 = u11 = c0 = c1 = 0

              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;
              __pyx_v_c0 = 0;
              __pyx_v_c1 = 0;
    /* … */
              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;
              __pyx_v_c0 = 0;
              __pyx_v_c1 = 0;
    /* … */
              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;
              __pyx_v_c0 = 0;
              __pyx_v_c1 = 0;
    /* … */
              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;
              __pyx_v_c0 = 0;
              __pyx_v_c1 = 0;
    /* … */
              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;
              __pyx_v_c0 = 0;
              __pyx_v_c1 = 0;
    /* … */
              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;
              __pyx_v_c0 = 0;
              __pyx_v_c1 = 0;
    /* … */
              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;
              __pyx_v_c0 = 0;
              __pyx_v_c1 = 0;
    /* … */
              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;
              __pyx_v_c0 = 0;
              __pyx_v_c1 = 0;

    +0772:             l_max_00 = l_max_11 = 0

              __pyx_v_l_max_00 = 0;
              __pyx_v_l_max_11 = 0;
    /* … */
              __pyx_v_l_max_00 = 0;
              __pyx_v_l_max_11 = 0;
    /* … */
              __pyx_v_l_max_00 = 0;
              __pyx_v_l_max_11 = 0;
    /* … */
              __pyx_v_l_max_00 = 0;
              __pyx_v_l_max_11 = 0;
    /* … */
              __pyx_v_l_max_00 = 0;
              __pyx_v_l_max_11 = 0;
    /* … */
              __pyx_v_l_max_00 = 0;
              __pyx_v_l_max_11 = 0;
    /* … */
              __pyx_v_l_max_00 = 0;
              __pyx_v_l_max_11 = 0;
    /* … */
              __pyx_v_l_max_00 = 0;
              __pyx_v_l_max_11 = 0;

     0773:

     0774:             # pairwise comparison of alleles between haplotypes to determine

     0775:             # shared suffix lengths

    +0776:             for j in range(n_haplotypes):

              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;

    +0777:                 a1 = h[i, j]

                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));

    +0778:                 if a1 == 0:

                switch (__pyx_v_a1) {
                  case 0:
    /* … */
                  break;
    /* … */
                switch (__pyx_v_a1) {
                  case 0:
    /* … */
                  break;
    /* … */
                switch (__pyx_v_a1) {
                  case 0:
    /* … */
                  break;
    /* … */
                switch (__pyx_v_a1) {
                  case 0:
    /* … */
                  break;
    /* … */
                switch (__pyx_v_a1) {
                  case 0:
    /* … */
                  break;
    /* … */
                switch (__pyx_v_a1) {
                  case 0:
    /* … */
                  break;
    /* … */
                switch (__pyx_v_a1) {
                  case 0:
    /* … */
                  break;
    /* … */
                switch (__pyx_v_a1) {
                  case 0:
    /* … */
                  break;

    +0779:                     c0 += 1

                  __pyx_v_c0 = (__pyx_v_c0 + 1);
    /* … */
                  __pyx_v_c0 = (__pyx_v_c0 + 1);
    /* … */
                  __pyx_v_c0 = (__pyx_v_c0 + 1);
    /* … */
                  __pyx_v_c0 = (__pyx_v_c0 + 1);
    /* … */
                  __pyx_v_c0 = (__pyx_v_c0 + 1);
    /* … */
                  __pyx_v_c0 = (__pyx_v_c0 + 1);
    /* … */
                  __pyx_v_c0 = (__pyx_v_c0 + 1);
    /* … */
                  __pyx_v_c0 = (__pyx_v_c0 + 1);

    +0780:                 elif a1 == 1:

                  case 1:
    /* … */
                  break;
                  default: break;
                }
    /* … */
                  case 1:
    /* … */
                  break;
                  default: break;
                }
    /* … */
                  case 1:
    /* … */
                  break;
                  default: break;
                }
    /* … */
                  case 1:
    /* … */
                  break;
                  default: break;
                }
    /* … */
                  case 1:
    /* … */
                  break;
                  default: break;
                }
    /* … */
                  case 1:
    /* … */
                  break;
                  default: break;
                }
    /* … */
                  case 1:
    /* … */
                  break;
                  default: break;
                }
    /* … */
                  case 1:
    /* … */
                  break;
                  default: break;
                }

    +0781:                     c1 += 1

                  __pyx_v_c1 = (__pyx_v_c1 + 1);
    /* … */
                  __pyx_v_c1 = (__pyx_v_c1 + 1);
    /* … */
                  __pyx_v_c1 = (__pyx_v_c1 + 1);
    /* … */
                  __pyx_v_c1 = (__pyx_v_c1 + 1);
    /* … */
                  __pyx_v_c1 = (__pyx_v_c1 + 1);
    /* … */
                  __pyx_v_c1 = (__pyx_v_c1 + 1);
    /* … */
                  __pyx_v_c1 = (__pyx_v_c1 + 1);
    /* … */
                  __pyx_v_c1 = (__pyx_v_c1 + 1);

    +0782:                 for k in range(j+1, n_haplotypes):

                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;

    +0783:                     a2 = h[i, k]

                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));

    +0784:                     if a1 < 0 or a2 < 0:

                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }

     0785:                         # missing allele, assume sharing continues

    +0786:                         l = ssl[u] + 1

                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);

    +0787:                         ssl[u] = l

                    __pyx_t_20 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_20 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_20 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_20 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_20 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_20 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_20 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_20 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;

    +0788:                     elif a1 == a2 == 0:

                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L12;
                  }

    +0789:                         l = ssl[u] + 1

                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);

    +0790:                         ssl[u] = l

                    __pyx_t_22 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_22 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_22 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_22 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_22 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_22 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_22 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_22 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;

    +0791:                         ssl00[u00] = l

                    __pyx_t_23 = __pyx_v_u00;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl00.data + __pyx_t_23 * __pyx_v_ssl00.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_23 = __pyx_v_u00;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl00.data + __pyx_t_23 * __pyx_v_ssl00.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_23 = __pyx_v_u00;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl00.data + __pyx_t_23 * __pyx_v_ssl00.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_23 = __pyx_v_u00;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl00.data + __pyx_t_23 * __pyx_v_ssl00.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_23 = __pyx_v_u00;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl00.data + __pyx_t_23 * __pyx_v_ssl00.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_23 = __pyx_v_u00;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl00.data + __pyx_t_23 * __pyx_v_ssl00.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_23 = __pyx_v_u00;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl00.data + __pyx_t_23 * __pyx_v_ssl00.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_23 = __pyx_v_u00;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl00.data + __pyx_t_23 * __pyx_v_ssl00.strides[0]) )) = __pyx_v_l;

    +0792:                         u00 += 1

                    __pyx_v_u00 = (__pyx_v_u00 + 1);
    /* … */
                    __pyx_v_u00 = (__pyx_v_u00 + 1);
    /* … */
                    __pyx_v_u00 = (__pyx_v_u00 + 1);
    /* … */
                    __pyx_v_u00 = (__pyx_v_u00 + 1);
    /* … */
                    __pyx_v_u00 = (__pyx_v_u00 + 1);
    /* … */
                    __pyx_v_u00 = (__pyx_v_u00 + 1);
    /* … */
                    __pyx_v_u00 = (__pyx_v_u00 + 1);
    /* … */
                    __pyx_v_u00 = (__pyx_v_u00 + 1);

    +0793:                         if l > l_max_00:

                    __pyx_t_18 = ((__pyx_v_l > __pyx_v_l_max_00) != 0);
                    if (__pyx_t_18) {
    /* … */
                    }
    /* … */
                    __pyx_t_18 = ((__pyx_v_l > __pyx_v_l_max_00) != 0);
                    if (__pyx_t_18) {
    /* … */
                    }
    /* … */
                    __pyx_t_18 = ((__pyx_v_l > __pyx_v_l_max_00) != 0);
                    if (__pyx_t_18) {
    /* … */
                    }
    /* … */
                    __pyx_t_18 = ((__pyx_v_l > __pyx_v_l_max_00) != 0);
                    if (__pyx_t_18) {
    /* … */
                    }
    /* … */
                    __pyx_t_18 = ((__pyx_v_l > __pyx_v_l_max_00) != 0);
                    if (__pyx_t_18) {
    /* … */
                    }
    /* … */
                    __pyx_t_18 = ((__pyx_v_l > __pyx_v_l_max_00) != 0);
                    if (__pyx_t_18) {
    /* … */
                    }
    /* … */
                    __pyx_t_18 = ((__pyx_v_l > __pyx_v_l_max_00) != 0);
                    if (__pyx_t_18) {
    /* … */
                    }
    /* … */
                    __pyx_t_18 = ((__pyx_v_l > __pyx_v_l_max_00) != 0);
                    if (__pyx_t_18) {
    /* … */
                    }

    +0794:                             l_max_00 = l

                      __pyx_v_l_max_00 = __pyx_v_l;
    /* … */
                      __pyx_v_l_max_00 = __pyx_v_l;
    /* … */
                      __pyx_v_l_max_00 = __pyx_v_l;
    /* … */
                      __pyx_v_l_max_00 = __pyx_v_l;
    /* … */
                      __pyx_v_l_max_00 = __pyx_v_l;
    /* … */
                      __pyx_v_l_max_00 = __pyx_v_l;
    /* … */
                      __pyx_v_l_max_00 = __pyx_v_l;
    /* … */
                      __pyx_v_l_max_00 = __pyx_v_l;

    +0795:                     elif a1 == a2 == 1:

                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }

    +0796:                         l = ssl[u] + 1

                    __pyx_t_24 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_24 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_24 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_24 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_24 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_24 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_24 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_24 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_24 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_24 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_24 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_24 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_24 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_24 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_24 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_24 * __pyx_v_ssl.strides[0]) ))) + 1);

    +0797:                         ssl[u] = l

                    __pyx_t_25 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_25 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_25 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_25 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_25 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_25 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_25 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_25 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_25 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_25 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_25 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_25 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_25 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_25 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_25 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_25 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;

    +0798:                         ssl11[u11] = l

                    __pyx_t_26 = __pyx_v_u11;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl11.data + __pyx_t_26 * __pyx_v_ssl11.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_26 = __pyx_v_u11;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl11.data + __pyx_t_26 * __pyx_v_ssl11.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_26 = __pyx_v_u11;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl11.data + __pyx_t_26 * __pyx_v_ssl11.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_26 = __pyx_v_u11;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl11.data + __pyx_t_26 * __pyx_v_ssl11.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_26 = __pyx_v_u11;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl11.data + __pyx_t_26 * __pyx_v_ssl11.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_26 = __pyx_v_u11;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl11.data + __pyx_t_26 * __pyx_v_ssl11.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_26 = __pyx_v_u11;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl11.data + __pyx_t_26 * __pyx_v_ssl11.strides[0]) )) = __pyx_v_l;
    /* … */
                    __pyx_t_26 = __pyx_v_u11;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl11.data + __pyx_t_26 * __pyx_v_ssl11.strides[0]) )) = __pyx_v_l;

    +0799:                         u11 += 1

                    __pyx_v_u11 = (__pyx_v_u11 + 1);
    /* … */
                    __pyx_v_u11 = (__pyx_v_u11 + 1);
    /* … */
                    __pyx_v_u11 = (__pyx_v_u11 + 1);
    /* … */
                    __pyx_v_u11 = (__pyx_v_u11 + 1);
    /* … */
                    __pyx_v_u11 = (__pyx_v_u11 + 1);
    /* … */
                    __pyx_v_u11 = (__pyx_v_u11 + 1);
    /* … */
                    __pyx_v_u11 = (__pyx_v_u11 + 1);
    /* … */
                    __pyx_v_u11 = (__pyx_v_u11 + 1);

    +0800:                         if l > l_max_11:

                    __pyx_t_17 = ((__pyx_v_l > __pyx_v_l_max_11) != 0);
                    if (__pyx_t_17) {
    /* … */
                    }
    /* … */
                    __pyx_t_17 = ((__pyx_v_l > __pyx_v_l_max_11) != 0);
                    if (__pyx_t_17) {
    /* … */
                    }
    /* … */
                    __pyx_t_17 = ((__pyx_v_l > __pyx_v_l_max_11) != 0);
                    if (__pyx_t_17) {
    /* … */
                    }
    /* … */
                    __pyx_t_17 = ((__pyx_v_l > __pyx_v_l_max_11) != 0);
                    if (__pyx_t_17) {
    /* … */
                    }
    /* … */
                    __pyx_t_17 = ((__pyx_v_l > __pyx_v_l_max_11) != 0);
                    if (__pyx_t_17) {
    /* … */
                    }
    /* … */
                    __pyx_t_17 = ((__pyx_v_l > __pyx_v_l_max_11) != 0);
                    if (__pyx_t_17) {
    /* … */
                    }
    /* … */
                    __pyx_t_17 = ((__pyx_v_l > __pyx_v_l_max_11) != 0);
                    if (__pyx_t_17) {
    /* … */
                    }
    /* … */
                    __pyx_t_17 = ((__pyx_v_l > __pyx_v_l_max_11) != 0);
                    if (__pyx_t_17) {
    /* … */
                    }

    +0801:                             l_max_11 = l

                      __pyx_v_l_max_11 = __pyx_v_l;
    /* … */
                      __pyx_v_l_max_11 = __pyx_v_l;
    /* … */
                      __pyx_v_l_max_11 = __pyx_v_l;
    /* … */
                      __pyx_v_l_max_11 = __pyx_v_l;
    /* … */
                      __pyx_v_l_max_11 = __pyx_v_l;
    /* … */
                      __pyx_v_l_max_11 = __pyx_v_l;
    /* … */
                      __pyx_v_l_max_11 = __pyx_v_l;
    /* … */
                      __pyx_v_l_max_11 = __pyx_v_l;

     0802:                     else:

     0803:                         # break shared suffix, reset to zero

    +0804:                         ssl[u] = 0

                  /*else*/ {
                    __pyx_t_27 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_27 * __pyx_v_ssl.strides[0]) )) = 0;
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_t_27 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_27 * __pyx_v_ssl.strides[0]) )) = 0;
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_t_27 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_27 * __pyx_v_ssl.strides[0]) )) = 0;
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_t_27 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_27 * __pyx_v_ssl.strides[0]) )) = 0;
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_t_27 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_27 * __pyx_v_ssl.strides[0]) )) = 0;
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_t_27 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_27 * __pyx_v_ssl.strides[0]) )) = 0;
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_t_27 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_27 * __pyx_v_ssl.strides[0]) )) = 0;
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_t_27 = __pyx_v_u;
                    *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_27 * __pyx_v_ssl.strides[0]) )) = 0;
                  }
                  __pyx_L12:;

    +0805:                     u += 1

                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }

     0806:

     0807:             # compute minor allele frequency

    +0808:             if c0 < c1:

              __pyx_t_17 = ((__pyx_v_c0 < __pyx_v_c1) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L17;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_c0 < __pyx_v_c1) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L17;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_c0 < __pyx_v_c1) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L17;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_c0 < __pyx_v_c1) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L17;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_c0 < __pyx_v_c1) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L17;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_c0 < __pyx_v_c1) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L17;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_c0 < __pyx_v_c1) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L17;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_c0 < __pyx_v_c1) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L17;
              }

    +0809:                 maf = c0 / (c0 + c1)

                __pyx_t_9 = (__pyx_v_c0 + __pyx_v_c1);
                if (unlikely(__pyx_t_9 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 809, __pyx_L4_error)
                }
                __pyx_v_maf = (((double)__pyx_v_c0) / ((double)__pyx_t_9));
    /* … */
                __pyx_t_9 = (__pyx_v_c0 + __pyx_v_c1);
                if (unlikely(__pyx_t_9 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 809, __pyx_L4_error)
                }
                __pyx_v_maf = (((double)__pyx_v_c0) / ((double)__pyx_t_9));
    /* … */
                __pyx_t_9 = (__pyx_v_c0 + __pyx_v_c1);
                if (unlikely(__pyx_t_9 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 809, __pyx_L4_error)
                }
                __pyx_v_maf = (((double)__pyx_v_c0) / ((double)__pyx_t_9));
    /* … */
                __pyx_t_9 = (__pyx_v_c0 + __pyx_v_c1);
                if (unlikely(__pyx_t_9 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 809, __pyx_L4_error)
                }
                __pyx_v_maf = (((double)__pyx_v_c0) / ((double)__pyx_t_9));
    /* … */
                __pyx_t_9 = (__pyx_v_c0 + __pyx_v_c1);
                if (unlikely(__pyx_t_9 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 809, __pyx_L4_error)
                }
                __pyx_v_maf = (((double)__pyx_v_c0) / ((double)__pyx_t_9));
    /* … */
                __pyx_t_9 = (__pyx_v_c0 + __pyx_v_c1);
                if (unlikely(__pyx_t_9 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 809, __pyx_L4_error)
                }
                __pyx_v_maf = (((double)__pyx_v_c0) / ((double)__pyx_t_9));
    /* … */
                __pyx_t_9 = (__pyx_v_c0 + __pyx_v_c1);
                if (unlikely(__pyx_t_9 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 809, __pyx_L4_error)
                }
                __pyx_v_maf = (((double)__pyx_v_c0) / ((double)__pyx_t_9));
    /* … */
                __pyx_t_9 = (__pyx_v_c0 + __pyx_v_c1);
                if (unlikely(__pyx_t_9 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 809, __pyx_L4_error)
                }
                __pyx_v_maf = (((double)__pyx_v_c0) / ((double)__pyx_t_9));

     0810:             else:

    +0811:                 maf = c1 / (c0 + c1)

              /*else*/ {
                __pyx_t_9 = (__pyx_v_c0 + __pyx_v_c1);
                if (unlikely(__pyx_t_9 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 811, __pyx_L4_error)
                }
                __pyx_v_maf = (((double)__pyx_v_c1) / ((double)__pyx_t_9));
              }
              __pyx_L17:;
    /* … */
              /*else*/ {
                __pyx_t_9 = (__pyx_v_c0 + __pyx_v_c1);
                if (unlikely(__pyx_t_9 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 811, __pyx_L4_error)
                }
                __pyx_v_maf = (((double)__pyx_v_c1) / ((double)__pyx_t_9));
              }
              __pyx_L17:;
    /* … */
              /*else*/ {
                __pyx_t_9 = (__pyx_v_c0 + __pyx_v_c1);
                if (unlikely(__pyx_t_9 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 811, __pyx_L4_error)
                }
                __pyx_v_maf = (((double)__pyx_v_c1) / ((double)__pyx_t_9));
              }
              __pyx_L17:;
    /* … */
              /*else*/ {
                __pyx_t_9 = (__pyx_v_c0 + __pyx_v_c1);
                if (unlikely(__pyx_t_9 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 811, __pyx_L4_error)
                }
                __pyx_v_maf = (((double)__pyx_v_c1) / ((double)__pyx_t_9));
              }
              __pyx_L17:;
    /* … */
              /*else*/ {
                __pyx_t_9 = (__pyx_v_c0 + __pyx_v_c1);
                if (unlikely(__pyx_t_9 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 811, __pyx_L4_error)
                }
                __pyx_v_maf = (((double)__pyx_v_c1) / ((double)__pyx_t_9));
              }
              __pyx_L17:;
    /* … */
              /*else*/ {
                __pyx_t_9 = (__pyx_v_c0 + __pyx_v_c1);
                if (unlikely(__pyx_t_9 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 811, __pyx_L4_error)
                }
                __pyx_v_maf = (((double)__pyx_v_c1) / ((double)__pyx_t_9));
              }
              __pyx_L17:;
    /* … */
              /*else*/ {
                __pyx_t_9 = (__pyx_v_c0 + __pyx_v_c1);
                if (unlikely(__pyx_t_9 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 811, __pyx_L4_error)
                }
                __pyx_v_maf = (((double)__pyx_v_c1) / ((double)__pyx_t_9));
              }
              __pyx_L17:;
    /* … */
              /*else*/ {
                __pyx_t_9 = (__pyx_v_c0 + __pyx_v_c1);
                if (unlikely(__pyx_t_9 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 811, __pyx_L4_error)
                }
                __pyx_v_maf = (((double)__pyx_v_c1) / ((double)__pyx_t_9));
              }
              __pyx_L17:;

     0812:

    +0813:             if maf < min_maf:

              __pyx_t_17 = ((__pyx_v_maf < __pyx_v_min_maf) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L18;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_maf < __pyx_v_min_maf) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L18;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_maf < __pyx_v_min_maf) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L18;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_maf < __pyx_v_min_maf) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L18;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_maf < __pyx_v_min_maf) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L18;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_maf < __pyx_v_min_maf) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L18;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_maf < __pyx_v_min_maf) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L18;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_maf < __pyx_v_min_maf) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L18;
              }

     0814:                 # minor allele frequency below cutoff, don't bother to compute

    +0815:                 vstat0[i] = nan64

                __pyx_t_28 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_28 * __pyx_v_vstat0.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
    /* … */
                __pyx_t_28 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_28 * __pyx_v_vstat0.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
    /* … */
                __pyx_t_28 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_28 * __pyx_v_vstat0.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
    /* … */
                __pyx_t_28 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_28 * __pyx_v_vstat0.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
    /* … */
                __pyx_t_28 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_28 * __pyx_v_vstat0.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
    /* … */
                __pyx_t_28 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_28 * __pyx_v_vstat0.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
    /* … */
                __pyx_t_28 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_28 * __pyx_v_vstat0.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
    /* … */
                __pyx_t_28 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_28 * __pyx_v_vstat0.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;

    +0816:                 vstat1[i] = nan64

                __pyx_t_29 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_29 * __pyx_v_vstat1.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
    /* … */
                __pyx_t_29 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_29 * __pyx_v_vstat1.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
    /* … */
                __pyx_t_29 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_29 * __pyx_v_vstat1.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
    /* … */
                __pyx_t_29 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_29 * __pyx_v_vstat1.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
    /* … */
                __pyx_t_29 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_29 * __pyx_v_vstat1.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
    /* … */
                __pyx_t_29 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_29 * __pyx_v_vstat1.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
    /* … */
                __pyx_t_29 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_29 * __pyx_v_vstat1.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
    /* … */
                __pyx_t_29 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_29 * __pyx_v_vstat1.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;

     0817:

     0818:             else:

     0819:                 # compute statistic from shared suffix lengths

    +0820:                 vstat0[i] = ssl2ihh(ssl00[:u00], l_max_00, i, gaps,

              /*else*/ {
                __pyx_t_5.data = __pyx_v_ssl00.data;
                __pyx_t_5.memview = __pyx_v_ssl00.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_30 = -1;
                if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl00.shape[0], __pyx_v_ssl00.strides[0], __pyx_v_ssl00.suboffsets[0],
        0,
        0,
        &__pyx_t_30,
        0,
        __pyx_v_u00,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 820, __pyx_L4_error)
    }

    __pyx_t_32.__pyx_n = 2;
    /* … */
                __pyx_t_32.min_ehh = __pyx_v_min_ehh;
                __pyx_t_32.include_edges = __pyx_v_include_edges;
                __pyx_t_31 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_t_5, __pyx_v_l_max_00, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_32);
                __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_5.memview = NULL;
                __pyx_t_5.data = NULL;
    /* … */
                __pyx_t_33 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_33 * __pyx_v_vstat0.strides[0]) )) = __pyx_t_31;
    /* … */
              /*else*/ {
                __pyx_t_5.data = __pyx_v_ssl00.data;
                __pyx_t_5.memview = __pyx_v_ssl00.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_30 = -1;
                if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl00.shape[0], __pyx_v_ssl00.strides[0], __pyx_v_ssl00.suboffsets[0],
        0,
        0,
        &__pyx_t_30,
        0,
        __pyx_v_u00,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 820, __pyx_L4_error)
    }

    __pyx_t_32.__pyx_n = 2;
    /* … */
                __pyx_t_32.min_ehh = __pyx_v_min_ehh;
                __pyx_t_32.include_edges = __pyx_v_include_edges;
                __pyx_t_31 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_t_5, __pyx_v_l_max_00, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_32);
                __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_5.memview = NULL;
                __pyx_t_5.data = NULL;
    /* … */
                __pyx_t_33 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_33 * __pyx_v_vstat0.strides[0]) )) = __pyx_t_31;
    /* … */
              /*else*/ {
                __pyx_t_5.data = __pyx_v_ssl00.data;
                __pyx_t_5.memview = __pyx_v_ssl00.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_30 = -1;
                if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl00.shape[0], __pyx_v_ssl00.strides[0], __pyx_v_ssl00.suboffsets[0],
        0,
        0,
        &__pyx_t_30,
        0,
        __pyx_v_u00,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 820, __pyx_L4_error)
    }

    __pyx_t_32.__pyx_n = 2;
    /* … */
                __pyx_t_32.min_ehh = __pyx_v_min_ehh;
                __pyx_t_32.include_edges = __pyx_v_include_edges;
                __pyx_t_31 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_t_5, __pyx_v_l_max_00, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_32);
                __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_5.memview = NULL;
                __pyx_t_5.data = NULL;
    /* … */
                __pyx_t_33 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_33 * __pyx_v_vstat0.strides[0]) )) = __pyx_t_31;
    /* … */
              /*else*/ {
                __pyx_t_5.data = __pyx_v_ssl00.data;
                __pyx_t_5.memview = __pyx_v_ssl00.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_30 = -1;
                if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl00.shape[0], __pyx_v_ssl00.strides[0], __pyx_v_ssl00.suboffsets[0],
        0,
        0,
        &__pyx_t_30,
        0,
        __pyx_v_u00,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 820, __pyx_L4_error)
    }

    __pyx_t_32.__pyx_n = 2;
    /* … */
                __pyx_t_32.min_ehh = __pyx_v_min_ehh;
                __pyx_t_32.include_edges = __pyx_v_include_edges;
                __pyx_t_31 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_t_5, __pyx_v_l_max_00, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_32);
                __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_5.memview = NULL;
                __pyx_t_5.data = NULL;
    /* … */
                __pyx_t_33 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_33 * __pyx_v_vstat0.strides[0]) )) = __pyx_t_31;
    /* … */
              /*else*/ {
                __pyx_t_5.data = __pyx_v_ssl00.data;
                __pyx_t_5.memview = __pyx_v_ssl00.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_30 = -1;
                if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl00.shape[0], __pyx_v_ssl00.strides[0], __pyx_v_ssl00.suboffsets[0],
        0,
        0,
        &__pyx_t_30,
        0,
        __pyx_v_u00,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 820, __pyx_L4_error)
    }

    __pyx_t_32.__pyx_n = 2;
    /* … */
                __pyx_t_32.min_ehh = __pyx_v_min_ehh;
                __pyx_t_32.include_edges = __pyx_v_include_edges;
                __pyx_t_31 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_t_5, __pyx_v_l_max_00, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_32);
                __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_5.memview = NULL;
                __pyx_t_5.data = NULL;
    /* … */
                __pyx_t_33 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_33 * __pyx_v_vstat0.strides[0]) )) = __pyx_t_31;
    /* … */
              /*else*/ {
                __pyx_t_5.data = __pyx_v_ssl00.data;
                __pyx_t_5.memview = __pyx_v_ssl00.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_30 = -1;
                if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl00.shape[0], __pyx_v_ssl00.strides[0], __pyx_v_ssl00.suboffsets[0],
        0,
        0,
        &__pyx_t_30,
        0,
        __pyx_v_u00,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 820, __pyx_L4_error)
    }

    __pyx_t_32.__pyx_n = 2;
    /* … */
                __pyx_t_32.min_ehh = __pyx_v_min_ehh;
                __pyx_t_32.include_edges = __pyx_v_include_edges;
                __pyx_t_31 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_t_5, __pyx_v_l_max_00, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_32);
                __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_5.memview = NULL;
                __pyx_t_5.data = NULL;
    /* … */
                __pyx_t_33 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_33 * __pyx_v_vstat0.strides[0]) )) = __pyx_t_31;
    /* … */
              /*else*/ {
                __pyx_t_5.data = __pyx_v_ssl00.data;
                __pyx_t_5.memview = __pyx_v_ssl00.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_30 = -1;
                if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl00.shape[0], __pyx_v_ssl00.strides[0], __pyx_v_ssl00.suboffsets[0],
        0,
        0,
        &__pyx_t_30,
        0,
        __pyx_v_u00,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 820, __pyx_L4_error)
    }

    __pyx_t_32.__pyx_n = 2;
    /* … */
                __pyx_t_32.min_ehh = __pyx_v_min_ehh;
                __pyx_t_32.include_edges = __pyx_v_include_edges;
                __pyx_t_31 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_t_5, __pyx_v_l_max_00, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_32);
                __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_5.memview = NULL;
                __pyx_t_5.data = NULL;
    /* … */
                __pyx_t_33 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_33 * __pyx_v_vstat0.strides[0]) )) = __pyx_t_31;
    /* … */
              /*else*/ {
                __pyx_t_5.data = __pyx_v_ssl00.data;
                __pyx_t_5.memview = __pyx_v_ssl00.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_30 = -1;
                if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl00.shape[0], __pyx_v_ssl00.strides[0], __pyx_v_ssl00.suboffsets[0],
        0,
        0,
        &__pyx_t_30,
        0,
        __pyx_v_u00,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 820, __pyx_L4_error)
    }

    __pyx_t_32.__pyx_n = 2;
    /* … */
                __pyx_t_32.min_ehh = __pyx_v_min_ehh;
                __pyx_t_32.include_edges = __pyx_v_include_edges;
                __pyx_t_31 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_t_5, __pyx_v_l_max_00, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_32);
                __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_5.memview = NULL;
                __pyx_t_5.data = NULL;
    /* … */
                __pyx_t_33 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_33 * __pyx_v_vstat0.strides[0]) )) = __pyx_t_31;

     0821:                                     min_ehh=min_ehh,

     0822:                                     include_edges=include_edges)

    +0823:                 vstat1[i] = ssl2ihh(ssl11[:u11], l_max_11, i, gaps,

                __pyx_t_5.data = __pyx_v_ssl11.data;
                __pyx_t_5.memview = __pyx_v_ssl11.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_30 = -1;
                if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl11.shape[0], __pyx_v_ssl11.strides[0], __pyx_v_ssl11.suboffsets[0],
        0,
        0,
        &__pyx_t_30,
        0,
        __pyx_v_u11,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 823, __pyx_L4_error)
    }

    __pyx_t_32.__pyx_n = 2;
    /* … */
                __pyx_t_32.min_ehh = __pyx_v_min_ehh;
                __pyx_t_32.include_edges = __pyx_v_include_edges;
                __pyx_t_31 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_t_5, __pyx_v_l_max_11, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_32);
                __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_5.memview = NULL;
                __pyx_t_5.data = NULL;
    /* … */
                __pyx_t_34 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_34 * __pyx_v_vstat1.strides[0]) )) = __pyx_t_31;
              }
              __pyx_L18:;
            }
          }
    /* … */
                __pyx_t_5.data = __pyx_v_ssl11.data;
                __pyx_t_5.memview = __pyx_v_ssl11.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_30 = -1;
                if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl11.shape[0], __pyx_v_ssl11.strides[0], __pyx_v_ssl11.suboffsets[0],
        0,
        0,
        &__pyx_t_30,
        0,
        __pyx_v_u11,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 823, __pyx_L4_error)
    }

    __pyx_t_32.__pyx_n = 2;
    /* … */
                __pyx_t_32.min_ehh = __pyx_v_min_ehh;
                __pyx_t_32.include_edges = __pyx_v_include_edges;
                __pyx_t_31 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_t_5, __pyx_v_l_max_11, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_32);
                __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_5.memview = NULL;
                __pyx_t_5.data = NULL;
    /* … */
                __pyx_t_34 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_34 * __pyx_v_vstat1.strides[0]) )) = __pyx_t_31;
              }
              __pyx_L18:;
            }
          }
    /* … */
                __pyx_t_5.data = __pyx_v_ssl11.data;
                __pyx_t_5.memview = __pyx_v_ssl11.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_30 = -1;
                if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl11.shape[0], __pyx_v_ssl11.strides[0], __pyx_v_ssl11.suboffsets[0],
        0,
        0,
        &__pyx_t_30,
        0,
        __pyx_v_u11,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 823, __pyx_L4_error)
    }

    __pyx_t_32.__pyx_n = 2;
    /* … */
                __pyx_t_32.min_ehh = __pyx_v_min_ehh;
                __pyx_t_32.include_edges = __pyx_v_include_edges;
                __pyx_t_31 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_t_5, __pyx_v_l_max_11, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_32);
                __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_5.memview = NULL;
                __pyx_t_5.data = NULL;
    /* … */
                __pyx_t_34 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_34 * __pyx_v_vstat1.strides[0]) )) = __pyx_t_31;
              }
              __pyx_L18:;
            }
          }
    /* … */
                __pyx_t_5.data = __pyx_v_ssl11.data;
                __pyx_t_5.memview = __pyx_v_ssl11.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_30 = -1;
                if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl11.shape[0], __pyx_v_ssl11.strides[0], __pyx_v_ssl11.suboffsets[0],
        0,
        0,
        &__pyx_t_30,
        0,
        __pyx_v_u11,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 823, __pyx_L4_error)
    }

    __pyx_t_32.__pyx_n = 2;
    /* … */
                __pyx_t_32.min_ehh = __pyx_v_min_ehh;
                __pyx_t_32.include_edges = __pyx_v_include_edges;
                __pyx_t_31 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_t_5, __pyx_v_l_max_11, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_32);
                __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_5.memview = NULL;
                __pyx_t_5.data = NULL;
    /* … */
                __pyx_t_34 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_34 * __pyx_v_vstat1.strides[0]) )) = __pyx_t_31;
              }
              __pyx_L18:;
            }
          }
    /* … */
                __pyx_t_5.data = __pyx_v_ssl11.data;
                __pyx_t_5.memview = __pyx_v_ssl11.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_30 = -1;
                if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl11.shape[0], __pyx_v_ssl11.strides[0], __pyx_v_ssl11.suboffsets[0],
        0,
        0,
        &__pyx_t_30,
        0,
        __pyx_v_u11,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 823, __pyx_L4_error)
    }

    __pyx_t_32.__pyx_n = 2;
    /* … */
                __pyx_t_32.min_ehh = __pyx_v_min_ehh;
                __pyx_t_32.include_edges = __pyx_v_include_edges;
                __pyx_t_31 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_t_5, __pyx_v_l_max_11, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_32);
                __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_5.memview = NULL;
                __pyx_t_5.data = NULL;
    /* … */
                __pyx_t_34 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_34 * __pyx_v_vstat1.strides[0]) )) = __pyx_t_31;
              }
              __pyx_L18:;
            }
          }
    /* … */
                __pyx_t_5.data = __pyx_v_ssl11.data;
                __pyx_t_5.memview = __pyx_v_ssl11.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_30 = -1;
                if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl11.shape[0], __pyx_v_ssl11.strides[0], __pyx_v_ssl11.suboffsets[0],
        0,
        0,
        &__pyx_t_30,
        0,
        __pyx_v_u11,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 823, __pyx_L4_error)
    }

    __pyx_t_32.__pyx_n = 2;
    /* … */
                __pyx_t_32.min_ehh = __pyx_v_min_ehh;
                __pyx_t_32.include_edges = __pyx_v_include_edges;
                __pyx_t_31 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_t_5, __pyx_v_l_max_11, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_32);
                __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_5.memview = NULL;
                __pyx_t_5.data = NULL;
    /* … */
                __pyx_t_34 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_34 * __pyx_v_vstat1.strides[0]) )) = __pyx_t_31;
              }
              __pyx_L18:;
            }
          }
    /* … */
                __pyx_t_5.data = __pyx_v_ssl11.data;
                __pyx_t_5.memview = __pyx_v_ssl11.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_30 = -1;
                if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl11.shape[0], __pyx_v_ssl11.strides[0], __pyx_v_ssl11.suboffsets[0],
        0,
        0,
        &__pyx_t_30,
        0,
        __pyx_v_u11,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 823, __pyx_L4_error)
    }

    __pyx_t_32.__pyx_n = 2;
    /* … */
                __pyx_t_32.min_ehh = __pyx_v_min_ehh;
                __pyx_t_32.include_edges = __pyx_v_include_edges;
                __pyx_t_31 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_t_5, __pyx_v_l_max_11, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_32);
                __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_5.memview = NULL;
                __pyx_t_5.data = NULL;
    /* … */
                __pyx_t_34 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_34 * __pyx_v_vstat1.strides[0]) )) = __pyx_t_31;
              }
              __pyx_L18:;
            }
          }
    /* … */
                __pyx_t_5.data = __pyx_v_ssl11.data;
                __pyx_t_5.memview = __pyx_v_ssl11.memview;
                __PYX_INC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_30 = -1;
                if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_5,
        __pyx_v_ssl11.shape[0], __pyx_v_ssl11.strides[0], __pyx_v_ssl11.suboffsets[0],
        0,
        0,
        &__pyx_t_30,
        0,
        __pyx_v_u11,
        0,
        0,
        1,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 823, __pyx_L4_error)
    }

    __pyx_t_32.__pyx_n = 2;
    /* … */
                __pyx_t_32.min_ehh = __pyx_v_min_ehh;
                __pyx_t_32.include_edges = __pyx_v_include_edges;
                __pyx_t_31 = __pyx_f_5allel_3opt_5stats_ssl2ihh(__pyx_t_5, __pyx_v_l_max_11, __pyx_v_i, __pyx_v_gaps, 0, &__pyx_t_32);
                __PYX_XDEC_MEMVIEW(&__pyx_t_5, 0);
                __pyx_t_5.memview = NULL;
                __pyx_t_5.data = NULL;
    /* … */
                __pyx_t_34 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_34 * __pyx_v_vstat1.strides[0]) )) = __pyx_t_31;
              }
              __pyx_L18:;
            }
          }

     0824:                                     min_ehh=min_ehh,

     0825:                                     include_edges=include_edges)

     0826:

    +0827:     return np.asarray(vstat0), np.asarray(vstat1)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_35 = PyTuple_New(1+1); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_35);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_35, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_35 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_35);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_35, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
      __pyx_t_35 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_35);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_35); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_35};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_35};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        } else
        #endif
        {
          __pyx_t_36 = PyTuple_New(1+1); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_36);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_36, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_35);
          PyTuple_SET_ITEM(__pyx_t_36, 0+1, __pyx_t_35);
          __pyx_t_35 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_36, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_35 = PyTuple_New(1+1); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_35);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_35, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_35 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_35);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_35, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
      __pyx_t_35 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_35);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_35); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_35};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_35};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        } else
        #endif
        {
          __pyx_t_36 = PyTuple_New(1+1); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_36);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_36, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_35);
          PyTuple_SET_ITEM(__pyx_t_36, 0+1, __pyx_t_35);
          __pyx_t_35 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_36, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_35 = PyTuple_New(1+1); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_35);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_35, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_35 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_35);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_35, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
      __pyx_t_35 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_35);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_35); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_35};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_35};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        } else
        #endif
        {
          __pyx_t_36 = PyTuple_New(1+1); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_36);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_36, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_35);
          PyTuple_SET_ITEM(__pyx_t_36, 0+1, __pyx_t_35);
          __pyx_t_35 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_36, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_35 = PyTuple_New(1+1); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_35);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_35, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_35 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_35);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_35, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
      __pyx_t_35 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_35);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_35); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_35};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_35};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        } else
        #endif
        {
          __pyx_t_36 = PyTuple_New(1+1); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_36);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_36, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_35);
          PyTuple_SET_ITEM(__pyx_t_36, 0+1, __pyx_t_35);
          __pyx_t_35 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_36, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_35 = PyTuple_New(1+1); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_35);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_35, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_35 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_35);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_35, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
      __pyx_t_35 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_35);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_35); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_35};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_35};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        } else
        #endif
        {
          __pyx_t_36 = PyTuple_New(1+1); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_36);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_36, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_35);
          PyTuple_SET_ITEM(__pyx_t_36, 0+1, __pyx_t_35);
          __pyx_t_35 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_36, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_35 = PyTuple_New(1+1); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_35);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_35, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_35 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_35);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_35, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
      __pyx_t_35 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_35);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_35); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_35};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_35};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        } else
        #endif
        {
          __pyx_t_36 = PyTuple_New(1+1); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_36);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_36, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_35);
          PyTuple_SET_ITEM(__pyx_t_36, 0+1, __pyx_t_35);
          __pyx_t_35 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_36, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_35 = PyTuple_New(1+1); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_35);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_35, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_35 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_35);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_35, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
      __pyx_t_35 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_35);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_35); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_35};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_35};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        } else
        #endif
        {
          __pyx_t_36 = PyTuple_New(1+1); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_36);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_36, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_35);
          PyTuple_SET_ITEM(__pyx_t_36, 0+1, __pyx_t_35);
          __pyx_t_35 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_36, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else
        #endif
        {
          __pyx_t_35 = PyTuple_New(1+1); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_35);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_35, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_35 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_35);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_35, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
      __pyx_t_35 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_35);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_35); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_35};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_35};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
        } else
        #endif
        {
          __pyx_t_36 = PyTuple_New(1+1); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_36);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_36, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_35);
          PyTuple_SET_ITEM(__pyx_t_36, 0+1, __pyx_t_35);
          __pyx_t_35 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_36, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;

     0828:

     0829:

     0830: @cython.boundscheck(False)

     0831: @cython.wraparound(False)

    +0832: def nsl01_scan(integer[:, :] h):

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_31nsl01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_5allel_3opt_5stats_30nsl01_scan[] = "Scan forwards over haplotypes, computing the number of segregating\n    sites by length backwards for each variant for the reference (0) and\n    alternate (1) alleles separately.";
    static PyMethodDef __pyx_mdef_5allel_3opt_5stats_31nsl01_scan = {"nsl01_scan", (PyCFunction)__pyx_pw_5allel_3opt_5stats_31nsl01_scan, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_30nsl01_scan};
    static PyObject *__pyx_pw_5allel_3opt_5stats_31nsl01_scan(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_signatures = 0;
      PyObject *__pyx_v_args = 0;
      PyObject *__pyx_v_kwargs = 0;
      CYTHON_UNUSED PyObject *__pyx_v_defaults = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0};
        PyObject* values[4] = {0,0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 832, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 832, __pyx_L3_error)
            }
            case  3:
            if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 832, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 832, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        }
        __pyx_v_signatures = values[0];
        __pyx_v_args = values[1];
        __pyx_v_kwargs = values[2];
        __pyx_v_defaults = values[3];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 832, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_30nsl01_scan(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_30nsl01_scan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
      PyObject *__pyx_v_dest_sig = NULL;
      PyTypeObject *__pyx_v_ndarray = 0;
      PyObject *__pyx_v_numpy = NULL;
      __Pyx_memviewslice __pyx_v_memslice;
      Py_ssize_t __pyx_v_itemsize;
      int __pyx_v_dtype_signed;
      char __pyx_v_kind;
      int __pyx_v____pyx_int32_t_is_signed;
      int __pyx_v____pyx_uint32_t_is_signed;
      int __pyx_v____pyx_uint64_t_is_signed;
      int __pyx_v____pyx_uint16_t_is_signed;
      int __pyx_v____pyx_int16_t_is_signed;
      int __pyx_v____pyx_uint8_t_is_signed;
      int __pyx_v____pyx_int64_t_is_signed;
      int __pyx_v____pyx_int8_t_is_signed;
      PyObject *__pyx_v_arg = NULL;
      PyObject *__pyx_v_dtype = NULL;
      PyObject *__pyx_v_arg_base = NULL;
      PyObject *__pyx_v_candidates = NULL;
      PyObject *__pyx_v_sig = NULL;
      int __pyx_v_match_found;
      PyObject *__pyx_v_src_type = NULL;
      PyObject *__pyx_v_dst_type = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("nsl01_scan", 0);
      __Pyx_TraceCall("nsl01_scan", __pyx_f[0], 832, 0, __PYX_ERR(0, 832, __pyx_L1_error));
      __Pyx_INCREF(__pyx_v_kwargs);
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
      __pyx_v_dest_sig = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_2 = (__pyx_v_kwargs == Py_None);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {
        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1);
        __pyx_t_1 = 0;
      }
      {
        /*try:*/ {
          __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_v_numpy = __pyx_t_1;
          __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 832, __pyx_L4_error)
          __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1);
          __pyx_t_1 = 0;
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L11_try_end;
        __pyx_L4_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
        if (__pyx_t_7) {
          __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 832, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_INCREF(Py_None);
          __Pyx_XDECREF_SET(__pyx_v_ndarray, ((PyTypeObject*)Py_None));
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L5_exception_handled;
        }
        goto __pyx_L6_except_error;
        __pyx_L6_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L1_error;
        __pyx_L5_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        __pyx_L11_try_end:;
      }
      __pyx_v_itemsize = -1L;
      __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1L) < 0);
      __pyx_v____pyx_uint32_t_is_signed = (((__pyx_t_5numpy_uint32_t)-1L) < 0);
      __pyx_v____pyx_uint64_t_is_signed = (((__pyx_t_5numpy_uint64_t)-1L) < 0);
      __pyx_v____pyx_uint16_t_is_signed = (((__pyx_t_5numpy_uint16_t)-1L) < 0);
      __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1L) < 0);
      __pyx_v____pyx_uint8_t_is_signed = (((__pyx_t_5numpy_uint8_t)-1L) < 0);
      __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1L) < 0);
      __pyx_v____pyx_int8_t_is_signed = (((__pyx_t_5numpy_int8_t)-1L) < 0);
      if (unlikely(__pyx_v_args == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 832, __pyx_L1_error)
      }
      __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 832, __pyx_L1_error)
      __pyx_t_3 = ((0 < __pyx_t_10) != 0);
      if (__pyx_t_3) {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 832, __pyx_L1_error)
        }
        __pyx_t_9 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      if (unlikely(__pyx_v_kwargs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 832, __pyx_L1_error)
      }
      __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_h, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 832, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {
        if (unlikely(__pyx_v_kwargs == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 832, __pyx_L1_error)
        }
        __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_h); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      /*else*/ {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(0, 832, __pyx_L1_error)
        }
        __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 832, __pyx_L1_error)
        __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 832, __pyx_L1_error)
      }
      __pyx_L14:;
      while (1) {
        __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None));
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {
          __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_dtype = __pyx_t_8;
            __pyx_t_8 = 0;
            goto __pyx_L18;
          }
          __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_arg_base = __pyx_t_8;
            __pyx_t_8 = 0;
            __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
            __pyx_t_2 = (__pyx_t_3 != 0);
            if (__pyx_t_2) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_v_dtype = __pyx_t_8;
              __pyx_t_8 = 0;
              goto __pyx_L19;
            }
            /*else*/ {
              __Pyx_INCREF(Py_None);
              __pyx_v_dtype = Py_None;
            }
            __pyx_L19:;
            goto __pyx_L18;
          }
          /*else*/ {
            __Pyx_INCREF(Py_None);
            __pyx_v_dtype = Py_None;
          }
          __pyx_L18:;
          __pyx_v_itemsize = -1L;
          __pyx_t_2 = (__pyx_v_dtype != Py_None);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_itemsize = __pyx_t_10;
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 832, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_kind = __pyx_t_11;
            __pyx_v_dtype_signed = (__pyx_v_kind == 'i');
            switch (__pyx_v_kind) {
              case 'i':
              case 'u':
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L22_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 832, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L26_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 832, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L30_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 832, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L34_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 832, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L38_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 832, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L42_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 832, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L46_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 832, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 832, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 2) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L50_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 832, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              break;
              case 'f':
              break;
              case 'c':
              break;
              case 'O':
              break;
              default: break;
            }
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L54_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L54_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 832, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L58_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L58_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 832, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L62_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L62_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 832, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L66_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L66_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 832, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L70_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L70_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 832, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L74_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L74_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 832, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L78_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L78_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 832, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L82_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L82_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 832, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 832, __pyx_L1_error)
        goto __pyx_L16_break;
      }
      __pyx_L16_break:;
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_candidates = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_10 = 0;
      if (unlikely(__pyx_v_signatures == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 832, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8);
      __pyx_t_8 = __pyx_t_9;
      __pyx_t_9 = 0;
      while (1) {
        __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_13, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7);
        if (unlikely(__pyx_t_14 == 0)) break;
        if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_v_match_found = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /* … */
      __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__52);
      __Pyx_GIVEREF(__pyx_tuple__52);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
        __Pyx_INCREF(__pyx_v_dest_sig);
        __Pyx_GIVEREF(__pyx_v_dest_sig);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dest_sig);
        __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
          __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_15 = 0;
          __pyx_t_16 = NULL;
        } else {
          __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 832, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 832, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        for (;;) {
          if (likely(!__pyx_t_16)) {
            if (likely(PyList_CheckExact(__pyx_t_9))) {
              if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 832, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            } else {
              if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 832, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            }
          } else {
            __pyx_t_1 = __pyx_t_16(__pyx_t_9);
            if (unlikely(!__pyx_t_1)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 832, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_1);
          }
          if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
            PyObject* sequence = __pyx_t_1;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 832, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1);
            } else {
              __pyx_t_17 = PyList_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyList_GET_ITEM(sequence, 1);
            }
            __Pyx_INCREF(__pyx_t_17);
            __Pyx_INCREF(__pyx_t_18);
            #else
            __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 832, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 832, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_18);
            #endif
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 832, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
            index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_17);
            index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_18);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) __PYX_ERR(0, 832, __pyx_L1_error)
            __pyx_t_20 = NULL;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            goto __pyx_L90_unpacking_done;
            __pyx_L89_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __pyx_t_20 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 832, __pyx_L1_error)
            __pyx_L90_unpacking_done:;
          }
          __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17);
          __pyx_t_17 = 0;
          __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18);
          __pyx_t_18 = 0;
          __pyx_t_3 = (__pyx_v_dst_type != Py_None);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error)
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 832, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (__pyx_t_2) {
              __pyx_v_match_found = 1;
              goto __pyx_L92;
            }
            /*else*/ {
              __pyx_v_match_found = 0;
              goto __pyx_L88_break;
            }
            __pyx_L92:;
          }
        }
        __pyx_L88_break:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_2 = (__pyx_v_match_found != 0);
        if (__pyx_t_2) {
          __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 832, __pyx_L1_error)
        }
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
      __pyx_t_3 = ((!__pyx_t_2) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s__8); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__53);
      __Pyx_GIVEREF(__pyx_tuple__53);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 832, __pyx_L1_error)
      }
      __pyx_t_13 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 832, __pyx_L1_error)
      __pyx_t_3 = ((__pyx_t_13 > 1) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__54);
      __Pyx_GIVEREF(__pyx_tuple__54);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 832, __pyx_L1_error)
      }
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_signatures == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 832, __pyx_L1_error)
        }
        __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        goto __pyx_L0;
      }

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_dest_sig);
      __Pyx_XDECREF(__pyx_v_ndarray);
      __Pyx_XDECREF(__pyx_v_numpy);
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XDECREF(__pyx_v_dtype);
      __Pyx_XDECREF(__pyx_v_arg_base);
      __Pyx_XDECREF(__pyx_v_candidates);
      __Pyx_XDECREF(__pyx_v_sig);
      __Pyx_XDECREF(__pyx_v_src_type);
      __Pyx_XDECREF(__pyx_v_dst_type);
      __Pyx_XDECREF(__pyx_v_kwargs);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_219nsl01_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_219nsl01_scan = {"__pyx_fuse_0nsl01_scan", (PyCFunction)__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_219nsl01_scan, METH_O, __pyx_doc_5allel_3opt_5stats_30nsl01_scan};
    static PyObject *__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_219nsl01_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("nsl01_scan (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int8_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 832, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.nsl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_218nsl01_scan(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_218nsl01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int64_t __pyx_v_ssl00_sum;
      __pyx_t_5numpy_int64_t __pyx_v_ssl11_sum;
      __pyx_t_5numpy_int8_t __pyx_v_a1;
      __pyx_t_5numpy_int8_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_0nsl01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_0nsl01_scan", __pyx_f[0], 832, 0, __PYX_ERR(0, 832, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_27);
      __Pyx_XDECREF(__pyx_t_28);
      __Pyx_AddTraceback("allel.opt.stats.nsl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_221nsl01_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_221nsl01_scan = {"__pyx_fuse_1nsl01_scan", (PyCFunction)__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_221nsl01_scan, METH_O, __pyx_doc_5allel_3opt_5stats_30nsl01_scan};
    static PyObject *__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_221nsl01_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("nsl01_scan (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int16_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 832, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.nsl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_220nsl01_scan(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_220nsl01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int64_t __pyx_v_ssl00_sum;
      __pyx_t_5numpy_int64_t __pyx_v_ssl11_sum;
      __pyx_t_5numpy_int16_t __pyx_v_a1;
      __pyx_t_5numpy_int16_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_1nsl01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_1nsl01_scan", __pyx_f[0], 832, 0, __PYX_ERR(0, 832, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_27);
      __Pyx_XDECREF(__pyx_t_28);
      __Pyx_AddTraceback("allel.opt.stats.nsl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_223nsl01_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_223nsl01_scan = {"__pyx_fuse_2nsl01_scan", (PyCFunction)__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_223nsl01_scan, METH_O, __pyx_doc_5allel_3opt_5stats_30nsl01_scan};
    static PyObject *__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_223nsl01_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("nsl01_scan (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 832, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.nsl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_222nsl01_scan(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_222nsl01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int64_t __pyx_v_ssl00_sum;
      __pyx_t_5numpy_int64_t __pyx_v_ssl11_sum;
      __pyx_t_5numpy_int32_t __pyx_v_a1;
      __pyx_t_5numpy_int32_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_2nsl01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_2nsl01_scan", __pyx_f[0], 832, 0, __PYX_ERR(0, 832, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_27);
      __Pyx_XDECREF(__pyx_t_28);
      __Pyx_AddTraceback("allel.opt.stats.nsl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_225nsl01_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_225nsl01_scan = {"__pyx_fuse_3nsl01_scan", (PyCFunction)__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_225nsl01_scan, METH_O, __pyx_doc_5allel_3opt_5stats_30nsl01_scan};
    static PyObject *__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_225nsl01_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("nsl01_scan (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 832, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.nsl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_224nsl01_scan(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_224nsl01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int64_t __pyx_v_ssl00_sum;
      __pyx_t_5numpy_int64_t __pyx_v_ssl11_sum;
      __pyx_t_5numpy_int64_t __pyx_v_a1;
      __pyx_t_5numpy_int64_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_3nsl01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_3nsl01_scan", __pyx_f[0], 832, 0, __PYX_ERR(0, 832, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_27);
      __Pyx_XDECREF(__pyx_t_28);
      __Pyx_AddTraceback("allel.opt.stats.nsl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_227nsl01_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_227nsl01_scan = {"__pyx_fuse_4nsl01_scan", (PyCFunction)__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_227nsl01_scan, METH_O, __pyx_doc_5allel_3opt_5stats_30nsl01_scan};
    static PyObject *__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_227nsl01_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("nsl01_scan (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 832, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.nsl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_226nsl01_scan(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_226nsl01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int64_t __pyx_v_ssl00_sum;
      __pyx_t_5numpy_int64_t __pyx_v_ssl11_sum;
      __pyx_t_5numpy_uint8_t __pyx_v_a1;
      __pyx_t_5numpy_uint8_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_4nsl01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_4nsl01_scan", __pyx_f[0], 832, 0, __PYX_ERR(0, 832, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_27);
      __Pyx_XDECREF(__pyx_t_28);
      __Pyx_AddTraceback("allel.opt.stats.nsl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_229nsl01_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_229nsl01_scan = {"__pyx_fuse_5nsl01_scan", (PyCFunction)__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_229nsl01_scan, METH_O, __pyx_doc_5allel_3opt_5stats_30nsl01_scan};
    static PyObject *__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_229nsl01_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("nsl01_scan (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint16_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 832, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.nsl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_228nsl01_scan(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_228nsl01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int64_t __pyx_v_ssl00_sum;
      __pyx_t_5numpy_int64_t __pyx_v_ssl11_sum;
      __pyx_t_5numpy_uint16_t __pyx_v_a1;
      __pyx_t_5numpy_uint16_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_5nsl01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_5nsl01_scan", __pyx_f[0], 832, 0, __PYX_ERR(0, 832, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_27);
      __Pyx_XDECREF(__pyx_t_28);
      __Pyx_AddTraceback("allel.opt.stats.nsl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_231nsl01_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_231nsl01_scan = {"__pyx_fuse_6nsl01_scan", (PyCFunction)__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_231nsl01_scan, METH_O, __pyx_doc_5allel_3opt_5stats_30nsl01_scan};
    static PyObject *__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_231nsl01_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("nsl01_scan (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 832, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.nsl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_230nsl01_scan(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_230nsl01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int64_t __pyx_v_ssl00_sum;
      __pyx_t_5numpy_int64_t __pyx_v_ssl11_sum;
      __pyx_t_5numpy_uint32_t __pyx_v_a1;
      __pyx_t_5numpy_uint32_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_6nsl01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_6nsl01_scan", __pyx_f[0], 832, 0, __PYX_ERR(0, 832, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_27);
      __Pyx_XDECREF(__pyx_t_28);
      __Pyx_AddTraceback("allel.opt.stats.nsl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_233nsl01_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h); /*proto*/
    static PyMethodDef __pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_233nsl01_scan = {"__pyx_fuse_7nsl01_scan", (PyCFunction)__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_233nsl01_scan, METH_O, __pyx_doc_5allel_3opt_5stats_30nsl01_scan};
    static PyObject *__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_233nsl01_scan(PyObject *__pyx_self, PyObject *__pyx_arg_h) {
      __Pyx_memviewslice __pyx_v_h = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("nsl01_scan (wrapper)", 0);
      assert(__pyx_arg_h); {
        __pyx_v_h = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint64_t(__pyx_arg_h); if (unlikely(!__pyx_v_h.memview)) __PYX_ERR(0, 832, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.nsl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_232nsl01_scan(__pyx_self, __pyx_v_h);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_232nsl01_scan(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_h) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_haplotypes;
      Py_ssize_t __pyx_v_n_pairs;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_k;
      Py_ssize_t __pyx_v_u;
      Py_ssize_t __pyx_v_u00;
      Py_ssize_t __pyx_v_u11;
      __pyx_t_5numpy_int32_t __pyx_v_l;
      __Pyx_memviewslice __pyx_v_ssl = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int64_t __pyx_v_ssl00_sum;
      __pyx_t_5numpy_int64_t __pyx_v_ssl11_sum;
      __pyx_t_5numpy_uint64_t __pyx_v_a1;
      __pyx_t_5numpy_uint64_t __pyx_v_a2;
      __Pyx_memviewslice __pyx_v_vstat0 = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_vstat1 = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_7nsl01_scan", 0);
      __Pyx_TraceCall("__pyx_fuse_7nsl01_scan", __pyx_f[0], 832, 0, __PYX_ERR(0, 832, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
      __Pyx_XDECREF(__pyx_t_27);
      __Pyx_XDECREF(__pyx_t_28);
      __Pyx_AddTraceback("allel.opt.stats.nsl01_scan", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_h, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_ssl, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat0, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_vstat1, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
      __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__55);
      __Pyx_GIVEREF(__pyx_tuple__55);
    /* … */
      __pyx_tuple__129 = PyTuple_Pack(19, __pyx_n_s_h, __pyx_n_s_h, __pyx_n_s_n_variants, __pyx_n_s_n_haplotypes, __pyx_n_s_n_pairs, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_u, __pyx_n_s_u00, __pyx_n_s_u11, __pyx_n_s_l, __pyx_n_s_ssl, __pyx_n_s_ssl00_sum, __pyx_n_s_ssl11_sum, __pyx_n_s_a1, __pyx_n_s_a2, __pyx_n_s_vstat0, __pyx_n_s_vstat1); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__129);
      __Pyx_GIVEREF(__pyx_tuple__129);
    /* … */
      __pyx_t_22 = PyDict_New(); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_22);
      __pyx_t_26 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_219nsl01_scan, 0, __pyx_n_s_nsl01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_26);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_26, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_22, __pyx_n_s_int8_t, __pyx_t_26) < 0) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
      __pyx_t_26 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_221nsl01_scan, 0, __pyx_n_s_nsl01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_26);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_26, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_22, __pyx_n_s_int16_t, __pyx_t_26) < 0) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
      __pyx_t_26 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_223nsl01_scan, 0, __pyx_n_s_nsl01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_26);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_26, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_22, __pyx_n_s_int32_t, __pyx_t_26) < 0) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
      __pyx_t_26 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_225nsl01_scan, 0, __pyx_n_s_nsl01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_26);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_26, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_22, __pyx_n_s_int64_t, __pyx_t_26) < 0) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
      __pyx_t_26 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_227nsl01_scan, 0, __pyx_n_s_nsl01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_26);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_26, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_22, __pyx_n_s_uint8_t, __pyx_t_26) < 0) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
      __pyx_t_26 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_229nsl01_scan, 0, __pyx_n_s_nsl01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_26);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_26, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_22, __pyx_n_s_uint16_t, __pyx_t_26) < 0) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
      __pyx_t_26 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_231nsl01_scan, 0, __pyx_n_s_nsl01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_26);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_26, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_22, __pyx_n_s_uint32_t, __pyx_t_26) < 0) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
      __pyx_t_26 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_233nsl01_scan, 0, __pyx_n_s_nsl01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_26);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_26, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_22, __pyx_n_s_uint64_t, __pyx_t_26) < 0) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
      __pyx_t_26 = __pyx_FusedFunction_NewEx(&__pyx_mdef_5allel_3opt_5stats_31nsl01_scan, 0, __pyx_n_s_nsl01_scan, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_26);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_26, __pyx_empty_tuple);
      ((__pyx_FusedFunctionObject *) __pyx_t_26)->__signatures__ = __pyx_t_22;
      __Pyx_GIVEREF(__pyx_t_22);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_nsl01_scan, __pyx_t_26) < 0) __PYX_ERR(0, 832, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
      __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(1, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aliman_src_github_cggh_sci, __pyx_n_s_nsl01_scan, 832, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) __PYX_ERR(0, 832, __pyx_L1_error)

     0833:     """Scan forwards over haplotypes, computing the number of segregating

     0834:     sites by length backwards for each variant for the reference (0) and

     0835:     alternate (1) alleles separately."""

     0836:

     0837:     cdef:

     0838:         Py_ssize_t n_variants, n_haplotypes, n_pairs, i, j, k, u, u00, u11

     0839:         cnp.int32_t l

     0840:         cnp.int32_t[:] ssl

     0841:         cnp.int64_t ssl00_sum, ssl11_sum

     0842:         integer a1, a2

     0843:         cnp.float64_t[:] vstat0, vstat1

     0844:

     0845:     # initialise

    +0846:     n_variants = h.shape[0]

      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_h.shape[0]);

    +0847:     n_haplotypes = h.shape[1]

      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);
    /* … */
      __pyx_v_n_haplotypes = (__pyx_v_h.shape[1]);

     0848:

     0849:     # shared suffix lengths between all pairs of haplotypes

    +0850:     n_pairs = (n_haplotypes * (n_haplotypes - 1)) // 2

      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);
    /* … */
      __pyx_v_n_pairs = __Pyx_div_Py_ssize_t((__pyx_v_n_haplotypes * (__pyx_v_n_haplotypes - 1)), 2);

    +0851:     ssl = np.zeros(n_pairs, dtype='i4')

      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 851, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 851, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 851, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 851, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 851, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 851, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 851, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_i4) < 0) __PYX_ERR(0, 851, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_t_4);
      if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_ssl = __pyx_t_5;
      __pyx_t_5.memview = NULL;
      __pyx_t_5.data = NULL;

     0852:

     0853:     # statistic values for each variant

    +0854:     vstat0 = np.empty(n_variants, dtype='f8')

      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 854, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 854, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 854, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 854, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 854, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 854, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 854, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 854, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_2);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 854, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_vstat0 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

    +0855:     vstat1 = np.empty(n_variants, dtype='f8')

      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 855, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_1);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 855, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_1);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 855, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_1);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 855, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_1);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 855, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_1);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 855, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_1);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 855, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_1);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_f8) < 0) __PYX_ERR(0, 855, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_t_1);
      if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 855, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_vstat1 = __pyx_t_6;
      __pyx_t_6.memview = NULL;
      __pyx_t_6.data = NULL;

     0856:

    +0857:     with nogil:

      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }
    /* … */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          #endif
          /*try:*/ {
    /* … */
          /*finally:*/ {
            /*normal exit:*/{
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L5;
            }
            __pyx_L4_error: {
              #ifdef WITH_THREAD
              Py_BLOCK_THREADS
              #endif
              goto __pyx_L1_error;
            }
            __pyx_L5:;
          }
      }

     0858:

     0859:         # iterate forward over variants

    +0860:         for i in range(n_variants):

            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;
    /* … */
            __pyx_t_7 = __pyx_v_n_variants;
            for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
              __pyx_v_i = __pyx_t_8;

    +0861:             u = u00 = u11 = 0

              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;
    /* … */
              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;
    /* … */
              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;
    /* … */
              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;
    /* … */
              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;
    /* … */
              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;
    /* … */
              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;
    /* … */
              __pyx_v_u = 0;
              __pyx_v_u00 = 0;
              __pyx_v_u11 = 0;

    +0862:             ssl00_sum = ssl11_sum = 0

              __pyx_v_ssl00_sum = 0;
              __pyx_v_ssl11_sum = 0;
    /* … */
              __pyx_v_ssl00_sum = 0;
              __pyx_v_ssl11_sum = 0;
    /* … */
              __pyx_v_ssl00_sum = 0;
              __pyx_v_ssl11_sum = 0;
    /* … */
              __pyx_v_ssl00_sum = 0;
              __pyx_v_ssl11_sum = 0;
    /* … */
              __pyx_v_ssl00_sum = 0;
              __pyx_v_ssl11_sum = 0;
    /* … */
              __pyx_v_ssl00_sum = 0;
              __pyx_v_ssl11_sum = 0;
    /* … */
              __pyx_v_ssl00_sum = 0;
              __pyx_v_ssl11_sum = 0;
    /* … */
              __pyx_v_ssl00_sum = 0;
              __pyx_v_ssl11_sum = 0;

     0863:

     0864:             # pairwise comparison of alleles between haplotypes to determine

     0865:             # shared suffix lengths

    +0866:             for j in range(n_haplotypes):

              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;
    /* … */
              __pyx_t_9 = __pyx_v_n_haplotypes;
              for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
                __pyx_v_j = __pyx_t_10;

    +0867:                 a1 = h[i, j]

                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));
    /* … */
                __pyx_t_11 = __pyx_v_i;
                __pyx_t_12 = __pyx_v_j;
                __pyx_v_a1 = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_11 * __pyx_v_h.strides[0]) ) + __pyx_t_12 * __pyx_v_h.strides[1]) )));

    +0868:                 for k in range(j+1, n_haplotypes):

                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;
    /* … */
                __pyx_t_13 = __pyx_v_n_haplotypes;
                for (__pyx_t_14 = (__pyx_v_j + 1); __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
                  __pyx_v_k = __pyx_t_14;

    +0869:                     a2 = h[i, k]

                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));
    /* … */
                  __pyx_t_15 = __pyx_v_i;
                  __pyx_t_16 = __pyx_v_k;
                  __pyx_v_a2 = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_h.data + __pyx_t_15 * __pyx_v_h.strides[0]) ) + __pyx_t_16 * __pyx_v_h.strides[1]) )));

    +0870:                     if a1 < 0 or a2 < 0:

                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = ((__pyx_v_a1 < 0) != 0);
                  if (!__pyx_t_18) {
                  } else {
                    __pyx_t_17 = __pyx_t_18;
                    goto __pyx_L13_bool_binop_done;
                  }
                  __pyx_t_18 = ((__pyx_v_a2 < 0) != 0);
                  __pyx_t_17 = __pyx_t_18;
                  __pyx_L13_bool_binop_done:;
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }

     0871:                         # missing allele, assume sharing continues

    +0872:                         l = ssl[u] + 1

                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_19 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_19 * __pyx_v_ssl.strides[0]) ))) + 1);

    +0873:                     elif a1 == a2 == 0:

                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_17 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_17) {
                    __pyx_t_17 = (__pyx_v_a2 == 0);
                  }
                  __pyx_t_18 = (__pyx_t_17 != 0);
                  if (__pyx_t_18) {
    /* … */
                    goto __pyx_L12;
                  }

    +0874:                         l = ssl[u] + 1

                    __pyx_t_20 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_20 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_20 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_20 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_20 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_20 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_20 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_20 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_20 * __pyx_v_ssl.strides[0]) ))) + 1);

    +0875:                         ssl00_sum += l

                    __pyx_v_ssl00_sum = (__pyx_v_ssl00_sum + __pyx_v_l);
    /* … */
                    __pyx_v_ssl00_sum = (__pyx_v_ssl00_sum + __pyx_v_l);
    /* … */
                    __pyx_v_ssl00_sum = (__pyx_v_ssl00_sum + __pyx_v_l);
    /* … */
                    __pyx_v_ssl00_sum = (__pyx_v_ssl00_sum + __pyx_v_l);
    /* … */
                    __pyx_v_ssl00_sum = (__pyx_v_ssl00_sum + __pyx_v_l);
    /* … */
                    __pyx_v_ssl00_sum = (__pyx_v_ssl00_sum + __pyx_v_l);
    /* … */
                    __pyx_v_ssl00_sum = (__pyx_v_ssl00_sum + __pyx_v_l);
    /* … */
                    __pyx_v_ssl00_sum = (__pyx_v_ssl00_sum + __pyx_v_l);

    +0876:                         u00 += 1

                    __pyx_v_u00 = (__pyx_v_u00 + 1);
    /* … */
                    __pyx_v_u00 = (__pyx_v_u00 + 1);
    /* … */
                    __pyx_v_u00 = (__pyx_v_u00 + 1);
    /* … */
                    __pyx_v_u00 = (__pyx_v_u00 + 1);
    /* … */
                    __pyx_v_u00 = (__pyx_v_u00 + 1);
    /* … */
                    __pyx_v_u00 = (__pyx_v_u00 + 1);
    /* … */
                    __pyx_v_u00 = (__pyx_v_u00 + 1);
    /* … */
                    __pyx_v_u00 = (__pyx_v_u00 + 1);

    +0877:                     elif a1 == a2 == 1:

                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }
    /* … */
                  __pyx_t_18 = (__pyx_v_a1 == __pyx_v_a2);
                  if (__pyx_t_18) {
                    __pyx_t_18 = (__pyx_v_a2 == 1);
                  }
                  __pyx_t_17 = (__pyx_t_18 != 0);
                  if (__pyx_t_17) {
    /* … */
                    goto __pyx_L12;
                  }

    +0878:                         l = ssl[u] + 1

                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);
    /* … */
                    __pyx_t_21 = __pyx_v_u;
                    __pyx_v_l = ((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_21 * __pyx_v_ssl.strides[0]) ))) + 1);

    +0879:                         ssl11_sum += l

                    __pyx_v_ssl11_sum = (__pyx_v_ssl11_sum + __pyx_v_l);
    /* … */
                    __pyx_v_ssl11_sum = (__pyx_v_ssl11_sum + __pyx_v_l);
    /* … */
                    __pyx_v_ssl11_sum = (__pyx_v_ssl11_sum + __pyx_v_l);
    /* … */
                    __pyx_v_ssl11_sum = (__pyx_v_ssl11_sum + __pyx_v_l);
    /* … */
                    __pyx_v_ssl11_sum = (__pyx_v_ssl11_sum + __pyx_v_l);
    /* … */
                    __pyx_v_ssl11_sum = (__pyx_v_ssl11_sum + __pyx_v_l);
    /* … */
                    __pyx_v_ssl11_sum = (__pyx_v_ssl11_sum + __pyx_v_l);
    /* … */
                    __pyx_v_ssl11_sum = (__pyx_v_ssl11_sum + __pyx_v_l);

    +0880:                         u11 += 1

                    __pyx_v_u11 = (__pyx_v_u11 + 1);
    /* … */
                    __pyx_v_u11 = (__pyx_v_u11 + 1);
    /* … */
                    __pyx_v_u11 = (__pyx_v_u11 + 1);
    /* … */
                    __pyx_v_u11 = (__pyx_v_u11 + 1);
    /* … */
                    __pyx_v_u11 = (__pyx_v_u11 + 1);
    /* … */
                    __pyx_v_u11 = (__pyx_v_u11 + 1);
    /* … */
                    __pyx_v_u11 = (__pyx_v_u11 + 1);
    /* … */
                    __pyx_v_u11 = (__pyx_v_u11 + 1);

     0881:                     else:

     0882:                         # break shared suffix, reset to zero

    +0883:                         l = 0

                  /*else*/ {
                    __pyx_v_l = 0;
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_v_l = 0;
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_v_l = 0;
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_v_l = 0;
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_v_l = 0;
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_v_l = 0;
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_v_l = 0;
                  }
                  __pyx_L12:;
    /* … */
                  /*else*/ {
                    __pyx_v_l = 0;
                  }
                  __pyx_L12:;

    +0884:                     ssl[u] = l

                  __pyx_t_22 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                  __pyx_t_22 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                  __pyx_t_22 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                  __pyx_t_22 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                  __pyx_t_22 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                  __pyx_t_22 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                  __pyx_t_22 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;
    /* … */
                  __pyx_t_22 = __pyx_v_u;
                  *((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_ssl.data + __pyx_t_22 * __pyx_v_ssl.strides[0]) )) = __pyx_v_l;

    +0885:                     u += 1

                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }
    /* … */
                  __pyx_v_u = (__pyx_v_u + 1);
                }
              }

     0886:

    +0887:             if u00 > 0:

              __pyx_t_17 = ((__pyx_v_u00 > 0) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L15;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_u00 > 0) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L15;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_u00 > 0) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L15;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_u00 > 0) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L15;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_u00 > 0) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L15;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_u00 > 0) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L15;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_u00 > 0) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L15;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_u00 > 0) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L15;
              }

    +0888:                 vstat0[i] = ssl00_sum / u00

                if (unlikely(__pyx_v_u00 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 888, __pyx_L4_error)
                }
                __pyx_t_23 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_23 * __pyx_v_vstat0.strides[0]) )) = (((double)__pyx_v_ssl00_sum) / ((double)__pyx_v_u00));
    /* … */
                if (unlikely(__pyx_v_u00 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 888, __pyx_L4_error)
                }
                __pyx_t_23 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_23 * __pyx_v_vstat0.strides[0]) )) = (((double)__pyx_v_ssl00_sum) / ((double)__pyx_v_u00));
    /* … */
                if (unlikely(__pyx_v_u00 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 888, __pyx_L4_error)
                }
                __pyx_t_23 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_23 * __pyx_v_vstat0.strides[0]) )) = (((double)__pyx_v_ssl00_sum) / ((double)__pyx_v_u00));
    /* … */
                if (unlikely(__pyx_v_u00 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 888, __pyx_L4_error)
                }
                __pyx_t_23 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_23 * __pyx_v_vstat0.strides[0]) )) = (((double)__pyx_v_ssl00_sum) / ((double)__pyx_v_u00));
    /* … */
                if (unlikely(__pyx_v_u00 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 888, __pyx_L4_error)
                }
                __pyx_t_23 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_23 * __pyx_v_vstat0.strides[0]) )) = (((double)__pyx_v_ssl00_sum) / ((double)__pyx_v_u00));
    /* … */
                if (unlikely(__pyx_v_u00 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 888, __pyx_L4_error)
                }
                __pyx_t_23 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_23 * __pyx_v_vstat0.strides[0]) )) = (((double)__pyx_v_ssl00_sum) / ((double)__pyx_v_u00));
    /* … */
                if (unlikely(__pyx_v_u00 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 888, __pyx_L4_error)
                }
                __pyx_t_23 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_23 * __pyx_v_vstat0.strides[0]) )) = (((double)__pyx_v_ssl00_sum) / ((double)__pyx_v_u00));
    /* … */
                if (unlikely(__pyx_v_u00 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 888, __pyx_L4_error)
                }
                __pyx_t_23 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_23 * __pyx_v_vstat0.strides[0]) )) = (((double)__pyx_v_ssl00_sum) / ((double)__pyx_v_u00));

     0889:             else:

    +0890:                 vstat0[i] = nan64

              /*else*/ {
                __pyx_t_24 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_24 * __pyx_v_vstat0.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
              }
              __pyx_L15:;
    /* … */
              /*else*/ {
                __pyx_t_24 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_24 * __pyx_v_vstat0.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
              }
              __pyx_L15:;
    /* … */
              /*else*/ {
                __pyx_t_24 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_24 * __pyx_v_vstat0.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
              }
              __pyx_L15:;
    /* … */
              /*else*/ {
                __pyx_t_24 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_24 * __pyx_v_vstat0.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
              }
              __pyx_L15:;
    /* … */
              /*else*/ {
                __pyx_t_24 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_24 * __pyx_v_vstat0.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
              }
              __pyx_L15:;
    /* … */
              /*else*/ {
                __pyx_t_24 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_24 * __pyx_v_vstat0.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
              }
              __pyx_L15:;
    /* … */
              /*else*/ {
                __pyx_t_24 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_24 * __pyx_v_vstat0.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
              }
              __pyx_L15:;
    /* … */
              /*else*/ {
                __pyx_t_24 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat0.data + __pyx_t_24 * __pyx_v_vstat0.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
              }
              __pyx_L15:;

    +0891:             if u11 > 0:

              __pyx_t_17 = ((__pyx_v_u11 > 0) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L16;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_u11 > 0) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L16;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_u11 > 0) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L16;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_u11 > 0) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L16;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_u11 > 0) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L16;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_u11 > 0) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L16;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_u11 > 0) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L16;
              }
    /* … */
              __pyx_t_17 = ((__pyx_v_u11 > 0) != 0);
              if (__pyx_t_17) {
    /* … */
                goto __pyx_L16;
              }

    +0892:                 vstat1[i] = ssl11_sum / u11

                if (unlikely(__pyx_v_u11 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 892, __pyx_L4_error)
                }
                __pyx_t_25 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_25 * __pyx_v_vstat1.strides[0]) )) = (((double)__pyx_v_ssl11_sum) / ((double)__pyx_v_u11));
    /* … */
                if (unlikely(__pyx_v_u11 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 892, __pyx_L4_error)
                }
                __pyx_t_25 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_25 * __pyx_v_vstat1.strides[0]) )) = (((double)__pyx_v_ssl11_sum) / ((double)__pyx_v_u11));
    /* … */
                if (unlikely(__pyx_v_u11 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 892, __pyx_L4_error)
                }
                __pyx_t_25 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_25 * __pyx_v_vstat1.strides[0]) )) = (((double)__pyx_v_ssl11_sum) / ((double)__pyx_v_u11));
    /* … */
                if (unlikely(__pyx_v_u11 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 892, __pyx_L4_error)
                }
                __pyx_t_25 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_25 * __pyx_v_vstat1.strides[0]) )) = (((double)__pyx_v_ssl11_sum) / ((double)__pyx_v_u11));
    /* … */
                if (unlikely(__pyx_v_u11 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 892, __pyx_L4_error)
                }
                __pyx_t_25 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_25 * __pyx_v_vstat1.strides[0]) )) = (((double)__pyx_v_ssl11_sum) / ((double)__pyx_v_u11));
    /* … */
                if (unlikely(__pyx_v_u11 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 892, __pyx_L4_error)
                }
                __pyx_t_25 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_25 * __pyx_v_vstat1.strides[0]) )) = (((double)__pyx_v_ssl11_sum) / ((double)__pyx_v_u11));
    /* … */
                if (unlikely(__pyx_v_u11 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 892, __pyx_L4_error)
                }
                __pyx_t_25 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_25 * __pyx_v_vstat1.strides[0]) )) = (((double)__pyx_v_ssl11_sum) / ((double)__pyx_v_u11));
    /* … */
                if (unlikely(__pyx_v_u11 == 0)) {
                  #ifdef WITH_THREAD
                  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                  #endif
                  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                  #ifdef WITH_THREAD
                  PyGILState_Release(__pyx_gilstate_save);
                  #endif
                  __PYX_ERR(0, 892, __pyx_L4_error)
                }
                __pyx_t_25 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_25 * __pyx_v_vstat1.strides[0]) )) = (((double)__pyx_v_ssl11_sum) / ((double)__pyx_v_u11));

     0893:             else:

    +0894:                 vstat1[i] = nan64

              /*else*/ {
                __pyx_t_26 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_26 * __pyx_v_vstat1.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
              }
              __pyx_L16:;
            }
          }
    /* … */
              /*else*/ {
                __pyx_t_26 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_26 * __pyx_v_vstat1.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
              }
              __pyx_L16:;
            }
          }
    /* … */
              /*else*/ {
                __pyx_t_26 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_26 * __pyx_v_vstat1.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
              }
              __pyx_L16:;
            }
          }
    /* … */
              /*else*/ {
                __pyx_t_26 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_26 * __pyx_v_vstat1.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
              }
              __pyx_L16:;
            }
          }
    /* … */
              /*else*/ {
                __pyx_t_26 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_26 * __pyx_v_vstat1.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
              }
              __pyx_L16:;
            }
          }
    /* … */
              /*else*/ {
                __pyx_t_26 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_26 * __pyx_v_vstat1.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
              }
              __pyx_L16:;
            }
          }
    /* … */
              /*else*/ {
                __pyx_t_26 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_26 * __pyx_v_vstat1.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
              }
              __pyx_L16:;
            }
          }
    /* … */
              /*else*/ {
                __pyx_t_26 = __pyx_v_i;
                *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_vstat1.data + __pyx_t_26 * __pyx_v_vstat1.strides[0]) )) = __pyx_v_5allel_3opt_5stats_nan64;
              }
              __pyx_L16:;
            }
          }

     0895:

    +0896:     return np.asarray(vstat0), np.asarray(vstat1)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_27 = PyTuple_New(1+1); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_27);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_27, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_27 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_27, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
      __pyx_t_27 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_27); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_27};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_27};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        } else
        #endif
        {
          __pyx_t_28 = PyTuple_New(1+1); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_28);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_28, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_27);
          PyTuple_SET_ITEM(__pyx_t_28, 0+1, __pyx_t_27);
          __pyx_t_27 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_27 = PyTuple_New(1+1); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_27);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_27, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_27 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_27, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
      __pyx_t_27 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_27); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_27};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_27};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        } else
        #endif
        {
          __pyx_t_28 = PyTuple_New(1+1); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_28);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_28, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_27);
          PyTuple_SET_ITEM(__pyx_t_28, 0+1, __pyx_t_27);
          __pyx_t_27 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_27 = PyTuple_New(1+1); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_27);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_27, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_27 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_27, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
      __pyx_t_27 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_27); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_27};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_27};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        } else
        #endif
        {
          __pyx_t_28 = PyTuple_New(1+1); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_28);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_28, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_27);
          PyTuple_SET_ITEM(__pyx_t_28, 0+1, __pyx_t_27);
          __pyx_t_27 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_27 = PyTuple_New(1+1); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_27);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_27, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_27 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_27, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
      __pyx_t_27 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_27); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_27};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_27};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        } else
        #endif
        {
          __pyx_t_28 = PyTuple_New(1+1); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_28);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_28, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_27);
          PyTuple_SET_ITEM(__pyx_t_28, 0+1, __pyx_t_27);
          __pyx_t_27 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_27 = PyTuple_New(1+1); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_27);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_27, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_27 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_27, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
      __pyx_t_27 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_27); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_27};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_27};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        } else
        #endif
        {
          __pyx_t_28 = PyTuple_New(1+1); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_28);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_28, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_27);
          PyTuple_SET_ITEM(__pyx_t_28, 0+1, __pyx_t_27);
          __pyx_t_27 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_27 = PyTuple_New(1+1); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_27);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_27, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_27 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_27, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
      __pyx_t_27 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_27); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_27};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_27};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        } else
        #endif
        {
          __pyx_t_28 = PyTuple_New(1+1); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_28);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_28, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_27);
          PyTuple_SET_ITEM(__pyx_t_28, 0+1, __pyx_t_27);
          __pyx_t_27 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_27 = PyTuple_New(1+1); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_27);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_27, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_27 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_27, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
      __pyx_t_27 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_27); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_27};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_27};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        } else
        #endif
        {
          __pyx_t_28 = PyTuple_New(1+1); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_28);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_28, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_27);
          PyTuple_SET_ITEM(__pyx_t_28, 0+1, __pyx_t_27);
          __pyx_t_27 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_vstat0, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_27 = PyTuple_New(1+1); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_27);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_27, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_27 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_27, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
      __pyx_t_27 = __pyx_memoryview_fromslice(__pyx_v_vstat1, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_27); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_27};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_27};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        } else
        #endif
        {
          __pyx_t_28 = PyTuple_New(1+1); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_28);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_28, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_27);
          PyTuple_SET_ITEM(__pyx_t_28, 0+1, __pyx_t_27);
          __pyx_t_27 = 0;
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

     0897:

     0898:

     0899: @cython.boundscheck(False)

     0900: @cython.wraparound(False)

    +0901: def phase_progeny_by_transmission(integer[:, :, :] g):

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_33phase_progeny_by_transmission(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_mdef_5allel_3opt_5stats_33phase_progeny_by_transmission = {"phase_progeny_by_transmission", (PyCFunction)__pyx_pw_5allel_3opt_5stats_33phase_progeny_by_transmission, METH_VARARGS|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_5allel_3opt_5stats_33phase_progeny_by_transmission(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_signatures = 0;
      PyObject *__pyx_v_args = 0;
      PyObject *__pyx_v_kwargs = 0;
      CYTHON_UNUSED PyObject *__pyx_v_defaults = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0};
        PyObject* values[4] = {0,0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 901, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 901, __pyx_L3_error)
            }
            case  3:
            if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 901, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 901, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        }
        __pyx_v_signatures = values[0];
        __pyx_v_args = values[1];
        __pyx_v_kwargs = values[2];
        __pyx_v_defaults = values[3];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 901, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_32phase_progeny_by_transmission(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_32phase_progeny_by_transmission(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
      PyObject *__pyx_v_dest_sig = NULL;
      PyTypeObject *__pyx_v_ndarray = 0;
      PyObject *__pyx_v_numpy = NULL;
      __Pyx_memviewslice __pyx_v_memslice;
      Py_ssize_t __pyx_v_itemsize;
      int __pyx_v_dtype_signed;
      char __pyx_v_kind;
      int __pyx_v____pyx_uint8_t_is_signed;
      int __pyx_v____pyx_int64_t_is_signed;
      int __pyx_v____pyx_uint64_t_is_signed;
      int __pyx_v____pyx_int8_t_is_signed;
      int __pyx_v____pyx_int32_t_is_signed;
      int __pyx_v____pyx_uint32_t_is_signed;
      int __pyx_v____pyx_uint16_t_is_signed;
      int __pyx_v____pyx_int16_t_is_signed;
      PyObject *__pyx_v_arg = NULL;
      PyObject *__pyx_v_dtype = NULL;
      PyObject *__pyx_v_arg_base = NULL;
      PyObject *__pyx_v_candidates = NULL;
      PyObject *__pyx_v_sig = NULL;
      int __pyx_v_match_found;
      PyObject *__pyx_v_src_type = NULL;
      PyObject *__pyx_v_dst_type = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("phase_progeny_by_transmission", 0);
      __Pyx_TraceCall("phase_progeny_by_transmission", __pyx_f[0], 901, 0, __PYX_ERR(0, 901, __pyx_L1_error));
      __Pyx_INCREF(__pyx_v_kwargs);
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
      __pyx_v_dest_sig = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_2 = (__pyx_v_kwargs == Py_None);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {
        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1);
        __pyx_t_1 = 0;
      }
      {
        /*try:*/ {
          __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_v_numpy = __pyx_t_1;
          __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 901, __pyx_L4_error)
          __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1);
          __pyx_t_1 = 0;
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L11_try_end;
        __pyx_L4_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
        if (__pyx_t_7) {
          __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 901, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_INCREF(Py_None);
          __Pyx_XDECREF_SET(__pyx_v_ndarray, ((PyTypeObject*)Py_None));
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L5_exception_handled;
        }
        goto __pyx_L6_except_error;
        __pyx_L6_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L1_error;
        __pyx_L5_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        __pyx_L11_try_end:;
      }
      __pyx_v_itemsize = -1L;
      __pyx_v____pyx_uint8_t_is_signed = (((__pyx_t_5numpy_uint8_t)-1L) < 0);
      __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1L) < 0);
      __pyx_v____pyx_uint64_t_is_signed = (((__pyx_t_5numpy_uint64_t)-1L) < 0);
      __pyx_v____pyx_int8_t_is_signed = (((__pyx_t_5numpy_int8_t)-1L) < 0);
      __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1L) < 0);
      __pyx_v____pyx_uint32_t_is_signed = (((__pyx_t_5numpy_uint32_t)-1L) < 0);
      __pyx_v____pyx_uint16_t_is_signed = (((__pyx_t_5numpy_uint16_t)-1L) < 0);
      __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1L) < 0);
      if (unlikely(__pyx_v_args == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 901, __pyx_L1_error)
      }
      __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 901, __pyx_L1_error)
      __pyx_t_3 = ((0 < __pyx_t_10) != 0);
      if (__pyx_t_3) {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 901, __pyx_L1_error)
        }
        __pyx_t_9 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      if (unlikely(__pyx_v_kwargs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 901, __pyx_L1_error)
      }
      __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_g, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {
        if (unlikely(__pyx_v_kwargs == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 901, __pyx_L1_error)
        }
        __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_g); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      /*else*/ {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(0, 901, __pyx_L1_error)
        }
        __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 901, __pyx_L1_error)
        __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 901, __pyx_L1_error)
      }
      __pyx_L14:;
      while (1) {
        __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None));
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {
          __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_dtype = __pyx_t_8;
            __pyx_t_8 = 0;
            goto __pyx_L18;
          }
          __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_arg_base = __pyx_t_8;
            __pyx_t_8 = 0;
            __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
            __pyx_t_2 = (__pyx_t_3 != 0);
            if (__pyx_t_2) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_v_dtype = __pyx_t_8;
              __pyx_t_8 = 0;
              goto __pyx_L19;
            }
            /*else*/ {
              __Pyx_INCREF(Py_None);
              __pyx_v_dtype = Py_None;
            }
            __pyx_L19:;
            goto __pyx_L18;
          }
          /*else*/ {
            __Pyx_INCREF(Py_None);
            __pyx_v_dtype = Py_None;
          }
          __pyx_L18:;
          __pyx_v_itemsize = -1L;
          __pyx_t_2 = (__pyx_v_dtype != Py_None);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 901, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_itemsize = __pyx_t_10;
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 901, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_kind = __pyx_t_11;
            __pyx_v_dtype_signed = (__pyx_v_kind == 'i');
            switch (__pyx_v_kind) {
              case 'i':
              case 'u':
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 901, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 3) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L22_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 901, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 3) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L26_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 901, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 3) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L30_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 901, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 3) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L34_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 901, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 3) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L38_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 901, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 3) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L42_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 901, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 3) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L46_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 901, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 3) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L50_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              break;
              case 'f':
              break;
              case 'c':
              break;
              case 'O':
              break;
              default: break;
            }
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L54_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L54_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L58_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L58_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L62_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L62_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L66_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L66_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L70_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L70_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L74_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L74_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L78_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L78_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L82_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L82_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
        goto __pyx_L16_break;
      }
      __pyx_L16_break:;
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_candidates = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_10 = 0;
      if (unlikely(__pyx_v_signatures == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 901, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8);
      __pyx_t_8 = __pyx_t_9;
      __pyx_t_9 = 0;
      while (1) {
        __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_13, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7);
        if (unlikely(__pyx_t_14 == 0)) break;
        if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_v_match_found = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /* … */
      __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__56);
      __Pyx_GIVEREF(__pyx_tuple__56);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
        __Pyx_INCREF(__pyx_v_dest_sig);
        __Pyx_GIVEREF(__pyx_v_dest_sig);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dest_sig);
        __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
          __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_15 = 0;
          __pyx_t_16 = NULL;
        } else {
          __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 901, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 901, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        for (;;) {
          if (likely(!__pyx_t_16)) {
            if (likely(PyList_CheckExact(__pyx_t_9))) {
              if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            } else {
              if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            }
          } else {
            __pyx_t_1 = __pyx_t_16(__pyx_t_9);
            if (unlikely(!__pyx_t_1)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 901, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_1);
          }
          if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
            PyObject* sequence = __pyx_t_1;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 901, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1);
            } else {
              __pyx_t_17 = PyList_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyList_GET_ITEM(sequence, 1);
            }
            __Pyx_INCREF(__pyx_t_17);
            __Pyx_INCREF(__pyx_t_18);
            #else
            __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 901, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 901, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_18);
            #endif
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 901, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
            index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_17);
            index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_18);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) __PYX_ERR(0, 901, __pyx_L1_error)
            __pyx_t_20 = NULL;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            goto __pyx_L90_unpacking_done;
            __pyx_L89_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __pyx_t_20 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 901, __pyx_L1_error)
            __pyx_L90_unpacking_done:;
          }
          __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17);
          __pyx_t_17 = 0;
          __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18);
          __pyx_t_18 = 0;
          __pyx_t_3 = (__pyx_v_dst_type != Py_None);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error)
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (__pyx_t_2) {
              __pyx_v_match_found = 1;
              goto __pyx_L92;
            }
            /*else*/ {
              __pyx_v_match_found = 0;
              goto __pyx_L88_break;
            }
            __pyx_L92:;
          }
        }
        __pyx_L88_break:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_2 = (__pyx_v_match_found != 0);
        if (__pyx_t_2) {
          __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 901, __pyx_L1_error)
        }
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
      __pyx_t_3 = ((!__pyx_t_2) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s__8); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__57);
      __Pyx_GIVEREF(__pyx_tuple__57);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 901, __pyx_L1_error)
      }
      __pyx_t_13 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 901, __pyx_L1_error)
      __pyx_t_3 = ((__pyx_t_13 > 1) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__58);
      __Pyx_GIVEREF(__pyx_tuple__58);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 901, __pyx_L1_error)
      }
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_signatures == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 901, __pyx_L1_error)
        }
        __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        goto __pyx_L0;
      }

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_dest_sig);
      __Pyx_XDECREF(__pyx_v_ndarray);
      __Pyx_XDECREF(__pyx_v_numpy);
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XDECREF(__pyx_v_dtype);
      __Pyx_XDECREF(__pyx_v_arg_base);
      __Pyx_XDECREF(__pyx_v_candidates);
      __Pyx_XDECREF(__pyx_v_sig);
      __Pyx_XDECREF(__pyx_v_src_type);
      __Pyx_XDECREF(__pyx_v_dst_type);
      __Pyx_XDECREF(__pyx_v_kwargs);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_237phase_progeny_by_transmission(PyObject *__pyx_self, PyObject *__pyx_arg_g); /*proto*/
    static PyMethodDef __pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_237phase_progeny_by_transmission = {"__pyx_fuse_0phase_progeny_by_transmission", (PyCFunction)__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_237phase_progeny_by_transmission, METH_O, 0};
    static PyObject *__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_237phase_progeny_by_transmission(PyObject *__pyx_self, PyObject *__pyx_arg_g) {
      __Pyx_memviewslice __pyx_v_g = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("phase_progeny_by_transmission (wrapper)", 0);
      assert(__pyx_arg_g); {
        __pyx_v_g = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int8_t(__pyx_arg_g); if (unlikely(!__pyx_v_g.memview)) __PYX_ERR(0, 901, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.phase_progeny_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_236phase_progeny_by_transmission(__pyx_self, __pyx_v_g);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_236phase_progeny_by_transmission(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_g) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_samples;
      Py_ssize_t __pyx_v_n_progeny;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_max_allele;
      __Pyx_memviewslice __pyx_v_is_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int8_t __pyx_v_a1;
      __pyx_t_5numpy_int8_t __pyx_v_a2;
      __pyx_t_5numpy_int8_t __pyx_v_ma1;
      __pyx_t_5numpy_int8_t __pyx_v_ma2;
      __pyx_t_5numpy_int8_t __pyx_v_pa1;
      __pyx_t_5numpy_int8_t __pyx_v_pa2;
      __Pyx_memviewslice __pyx_v_mac = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_pac = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_0phase_progeny_by_transmission", 0);
      __Pyx_TraceCall("__pyx_fuse_0phase_progeny_by_transmission", __pyx_f[0], 901, 0, __PYX_ERR(0, 901, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __Pyx_AddTraceback("allel.opt.stats.phase_progeny_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_g, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_phased, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_mac, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_pac, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_239phase_progeny_by_transmission(PyObject *__pyx_self, PyObject *__pyx_arg_g); /*proto*/
    static PyMethodDef __pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_239phase_progeny_by_transmission = {"__pyx_fuse_1phase_progeny_by_transmission", (PyCFunction)__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_239phase_progeny_by_transmission, METH_O, 0};
    static PyObject *__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_239phase_progeny_by_transmission(PyObject *__pyx_self, PyObject *__pyx_arg_g) {
      __Pyx_memviewslice __pyx_v_g = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("phase_progeny_by_transmission (wrapper)", 0);
      assert(__pyx_arg_g); {
        __pyx_v_g = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int16_t(__pyx_arg_g); if (unlikely(!__pyx_v_g.memview)) __PYX_ERR(0, 901, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.phase_progeny_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_238phase_progeny_by_transmission(__pyx_self, __pyx_v_g);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_238phase_progeny_by_transmission(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_g) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_samples;
      Py_ssize_t __pyx_v_n_progeny;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_max_allele;
      __Pyx_memviewslice __pyx_v_is_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int16_t __pyx_v_a1;
      __pyx_t_5numpy_int16_t __pyx_v_a2;
      __pyx_t_5numpy_int16_t __pyx_v_ma1;
      __pyx_t_5numpy_int16_t __pyx_v_ma2;
      __pyx_t_5numpy_int16_t __pyx_v_pa1;
      __pyx_t_5numpy_int16_t __pyx_v_pa2;
      __Pyx_memviewslice __pyx_v_mac = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_pac = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_1phase_progeny_by_transmission", 0);
      __Pyx_TraceCall("__pyx_fuse_1phase_progeny_by_transmission", __pyx_f[0], 901, 0, __PYX_ERR(0, 901, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __Pyx_AddTraceback("allel.opt.stats.phase_progeny_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_g, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_phased, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_mac, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_pac, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_241phase_progeny_by_transmission(PyObject *__pyx_self, PyObject *__pyx_arg_g); /*proto*/
    static PyMethodDef __pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_241phase_progeny_by_transmission = {"__pyx_fuse_2phase_progeny_by_transmission", (PyCFunction)__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_241phase_progeny_by_transmission, METH_O, 0};
    static PyObject *__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_241phase_progeny_by_transmission(PyObject *__pyx_self, PyObject *__pyx_arg_g) {
      __Pyx_memviewslice __pyx_v_g = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("phase_progeny_by_transmission (wrapper)", 0);
      assert(__pyx_arg_g); {
        __pyx_v_g = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int32_t(__pyx_arg_g); if (unlikely(!__pyx_v_g.memview)) __PYX_ERR(0, 901, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.phase_progeny_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_240phase_progeny_by_transmission(__pyx_self, __pyx_v_g);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_240phase_progeny_by_transmission(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_g) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_samples;
      Py_ssize_t __pyx_v_n_progeny;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_max_allele;
      __Pyx_memviewslice __pyx_v_is_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int32_t __pyx_v_a1;
      __pyx_t_5numpy_int32_t __pyx_v_a2;
      __pyx_t_5numpy_int32_t __pyx_v_ma1;
      __pyx_t_5numpy_int32_t __pyx_v_ma2;
      __pyx_t_5numpy_int32_t __pyx_v_pa1;
      __pyx_t_5numpy_int32_t __pyx_v_pa2;
      __Pyx_memviewslice __pyx_v_mac = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_pac = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_2phase_progeny_by_transmission", 0);
      __Pyx_TraceCall("__pyx_fuse_2phase_progeny_by_transmission", __pyx_f[0], 901, 0, __PYX_ERR(0, 901, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __Pyx_AddTraceback("allel.opt.stats.phase_progeny_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_g, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_phased, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_mac, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_pac, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_243phase_progeny_by_transmission(PyObject *__pyx_self, PyObject *__pyx_arg_g); /*proto*/
    static PyMethodDef __pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_243phase_progeny_by_transmission = {"__pyx_fuse_3phase_progeny_by_transmission", (PyCFunction)__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_243phase_progeny_by_transmission, METH_O, 0};
    static PyObject *__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_243phase_progeny_by_transmission(PyObject *__pyx_self, PyObject *__pyx_arg_g) {
      __Pyx_memviewslice __pyx_v_g = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("phase_progeny_by_transmission (wrapper)", 0);
      assert(__pyx_arg_g); {
        __pyx_v_g = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int64_t(__pyx_arg_g); if (unlikely(!__pyx_v_g.memview)) __PYX_ERR(0, 901, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.phase_progeny_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_242phase_progeny_by_transmission(__pyx_self, __pyx_v_g);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_242phase_progeny_by_transmission(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_g) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_samples;
      Py_ssize_t __pyx_v_n_progeny;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_max_allele;
      __Pyx_memviewslice __pyx_v_is_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_int64_t __pyx_v_a1;
      __pyx_t_5numpy_int64_t __pyx_v_a2;
      __pyx_t_5numpy_int64_t __pyx_v_ma1;
      __pyx_t_5numpy_int64_t __pyx_v_ma2;
      __pyx_t_5numpy_int64_t __pyx_v_pa1;
      __pyx_t_5numpy_int64_t __pyx_v_pa2;
      __Pyx_memviewslice __pyx_v_mac = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_pac = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_3phase_progeny_by_transmission", 0);
      __Pyx_TraceCall("__pyx_fuse_3phase_progeny_by_transmission", __pyx_f[0], 901, 0, __PYX_ERR(0, 901, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __Pyx_AddTraceback("allel.opt.stats.phase_progeny_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_g, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_phased, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_mac, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_pac, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_245phase_progeny_by_transmission(PyObject *__pyx_self, PyObject *__pyx_arg_g); /*proto*/
    static PyMethodDef __pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_245phase_progeny_by_transmission = {"__pyx_fuse_4phase_progeny_by_transmission", (PyCFunction)__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_245phase_progeny_by_transmission, METH_O, 0};
    static PyObject *__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_245phase_progeny_by_transmission(PyObject *__pyx_self, PyObject *__pyx_arg_g) {
      __Pyx_memviewslice __pyx_v_g = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("phase_progeny_by_transmission (wrapper)", 0);
      assert(__pyx_arg_g); {
        __pyx_v_g = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint8_t(__pyx_arg_g); if (unlikely(!__pyx_v_g.memview)) __PYX_ERR(0, 901, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.phase_progeny_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_244phase_progeny_by_transmission(__pyx_self, __pyx_v_g);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_244phase_progeny_by_transmission(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_g) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_samples;
      Py_ssize_t __pyx_v_n_progeny;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_max_allele;
      __Pyx_memviewslice __pyx_v_is_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_uint8_t __pyx_v_a1;
      __pyx_t_5numpy_uint8_t __pyx_v_a2;
      __pyx_t_5numpy_uint8_t __pyx_v_ma1;
      __pyx_t_5numpy_uint8_t __pyx_v_ma2;
      __pyx_t_5numpy_uint8_t __pyx_v_pa1;
      __pyx_t_5numpy_uint8_t __pyx_v_pa2;
      __Pyx_memviewslice __pyx_v_mac = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_pac = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_4phase_progeny_by_transmission", 0);
      __Pyx_TraceCall("__pyx_fuse_4phase_progeny_by_transmission", __pyx_f[0], 901, 0, __PYX_ERR(0, 901, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __Pyx_AddTraceback("allel.opt.stats.phase_progeny_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_g, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_phased, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_mac, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_pac, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_247phase_progeny_by_transmission(PyObject *__pyx_self, PyObject *__pyx_arg_g); /*proto*/
    static PyMethodDef __pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_247phase_progeny_by_transmission = {"__pyx_fuse_5phase_progeny_by_transmission", (PyCFunction)__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_247phase_progeny_by_transmission, METH_O, 0};
    static PyObject *__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_247phase_progeny_by_transmission(PyObject *__pyx_self, PyObject *__pyx_arg_g) {
      __Pyx_memviewslice __pyx_v_g = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("phase_progeny_by_transmission (wrapper)", 0);
      assert(__pyx_arg_g); {
        __pyx_v_g = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint16_t(__pyx_arg_g); if (unlikely(!__pyx_v_g.memview)) __PYX_ERR(0, 901, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.phase_progeny_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_246phase_progeny_by_transmission(__pyx_self, __pyx_v_g);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_246phase_progeny_by_transmission(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_g) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_samples;
      Py_ssize_t __pyx_v_n_progeny;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_max_allele;
      __Pyx_memviewslice __pyx_v_is_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_uint16_t __pyx_v_a1;
      __pyx_t_5numpy_uint16_t __pyx_v_a2;
      __pyx_t_5numpy_uint16_t __pyx_v_ma1;
      __pyx_t_5numpy_uint16_t __pyx_v_ma2;
      __pyx_t_5numpy_uint16_t __pyx_v_pa1;
      __pyx_t_5numpy_uint16_t __pyx_v_pa2;
      __Pyx_memviewslice __pyx_v_mac = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_pac = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_5phase_progeny_by_transmission", 0);
      __Pyx_TraceCall("__pyx_fuse_5phase_progeny_by_transmission", __pyx_f[0], 901, 0, __PYX_ERR(0, 901, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __Pyx_AddTraceback("allel.opt.stats.phase_progeny_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_g, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_phased, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_mac, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_pac, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_249phase_progeny_by_transmission(PyObject *__pyx_self, PyObject *__pyx_arg_g); /*proto*/
    static PyMethodDef __pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_249phase_progeny_by_transmission = {"__pyx_fuse_6phase_progeny_by_transmission", (PyCFunction)__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_249phase_progeny_by_transmission, METH_O, 0};
    static PyObject *__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_249phase_progeny_by_transmission(PyObject *__pyx_self, PyObject *__pyx_arg_g) {
      __Pyx_memviewslice __pyx_v_g = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("phase_progeny_by_transmission (wrapper)", 0);
      assert(__pyx_arg_g); {
        __pyx_v_g = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint32_t(__pyx_arg_g); if (unlikely(!__pyx_v_g.memview)) __PYX_ERR(0, 901, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.phase_progeny_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_248phase_progeny_by_transmission(__pyx_self, __pyx_v_g);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_248phase_progeny_by_transmission(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_g) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_samples;
      Py_ssize_t __pyx_v_n_progeny;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_max_allele;
      __Pyx_memviewslice __pyx_v_is_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_uint32_t __pyx_v_a1;
      __pyx_t_5numpy_uint32_t __pyx_v_a2;
      __pyx_t_5numpy_uint32_t __pyx_v_ma1;
      __pyx_t_5numpy_uint32_t __pyx_v_ma2;
      __pyx_t_5numpy_uint32_t __pyx_v_pa1;
      __pyx_t_5numpy_uint32_t __pyx_v_pa2;
      __Pyx_memviewslice __pyx_v_mac = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_pac = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_6phase_progeny_by_transmission", 0);
      __Pyx_TraceCall("__pyx_fuse_6phase_progeny_by_transmission", __pyx_f[0], 901, 0, __PYX_ERR(0, 901, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __Pyx_AddTraceback("allel.opt.stats.phase_progeny_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_g, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_phased, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_mac, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_pac, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_251phase_progeny_by_transmission(PyObject *__pyx_self, PyObject *__pyx_arg_g); /*proto*/
    static PyMethodDef __pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_251phase_progeny_by_transmission = {"__pyx_fuse_7phase_progeny_by_transmission", (PyCFunction)__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_251phase_progeny_by_transmission, METH_O, 0};
    static PyObject *__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_251phase_progeny_by_transmission(PyObject *__pyx_self, PyObject *__pyx_arg_g) {
      __Pyx_memviewslice __pyx_v_g = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("phase_progeny_by_transmission (wrapper)", 0);
      assert(__pyx_arg_g); {
        __pyx_v_g = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint64_t(__pyx_arg_g); if (unlikely(!__pyx_v_g.memview)) __PYX_ERR(0, 901, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.phase_progeny_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_250phase_progeny_by_transmission(__pyx_self, __pyx_v_g);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_250phase_progeny_by_transmission(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_g) {
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_samples;
      Py_ssize_t __pyx_v_n_progeny;
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_j;
      Py_ssize_t __pyx_v_max_allele;
      __Pyx_memviewslice __pyx_v_is_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      __pyx_t_5numpy_uint64_t __pyx_v_a1;
      __pyx_t_5numpy_uint64_t __pyx_v_a2;
      __pyx_t_5numpy_uint64_t __pyx_v_ma1;
      __pyx_t_5numpy_uint64_t __pyx_v_ma2;
      __pyx_t_5numpy_uint64_t __pyx_v_pa1;
      __pyx_t_5numpy_uint64_t __pyx_v_pa2;
      __Pyx_memviewslice __pyx_v_mac = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_pac = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_7phase_progeny_by_transmission", 0);
      __Pyx_TraceCall("__pyx_fuse_7phase_progeny_by_transmission", __pyx_f[0], 901, 0, __PYX_ERR(0, 901, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __Pyx_AddTraceback("allel.opt.stats.phase_progeny_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_g, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_phased, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_mac, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_pac, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
      __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__59);
      __Pyx_GIVEREF(__pyx_tuple__59);
    /* … */
      __pyx_tuple__131 = PyTuple_Pack(17, __pyx_n_s_g, __pyx_n_s_g, __pyx_n_s_n_variants, __pyx_n_s_n_samples, __pyx_n_s_n_progeny, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_max_allele, __pyx_n_s_is_phased, __pyx_n_s_a1, __pyx_n_s_a2, __pyx_n_s_ma1, __pyx_n_s_ma2, __pyx_n_s_pa1, __pyx_n_s_pa2, __pyx_n_s_mac, __pyx_n_s_pac); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__131);
      __Pyx_GIVEREF(__pyx_tuple__131);
    /* … */
      __pyx_t_27 = PyDict_New(); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      __pyx_t_28 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_237phase_progeny_by_transmission, 0, __pyx_n_s_phase_progeny_by_transmission, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_28, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_27, __pyx_n_s_int8_t, __pyx_t_28) < 0) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __pyx_t_28 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_239phase_progeny_by_transmission, 0, __pyx_n_s_phase_progeny_by_transmission, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_28, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_27, __pyx_n_s_int16_t, __pyx_t_28) < 0) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __pyx_t_28 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_241phase_progeny_by_transmission, 0, __pyx_n_s_phase_progeny_by_transmission, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_28, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_27, __pyx_n_s_int32_t, __pyx_t_28) < 0) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __pyx_t_28 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_243phase_progeny_by_transmission, 0, __pyx_n_s_phase_progeny_by_transmission, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_28, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_27, __pyx_n_s_int64_t, __pyx_t_28) < 0) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __pyx_t_28 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_245phase_progeny_by_transmission, 0, __pyx_n_s_phase_progeny_by_transmission, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_28, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_27, __pyx_n_s_uint8_t, __pyx_t_28) < 0) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __pyx_t_28 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_247phase_progeny_by_transmission, 0, __pyx_n_s_phase_progeny_by_transmission, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_28, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_27, __pyx_n_s_uint16_t, __pyx_t_28) < 0) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __pyx_t_28 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_249phase_progeny_by_transmission, 0, __pyx_n_s_phase_progeny_by_transmission, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_28, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_27, __pyx_n_s_uint32_t, __pyx_t_28) < 0) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __pyx_t_28 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_251phase_progeny_by_transmission, 0, __pyx_n_s_phase_progeny_by_transmission, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_28, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_27, __pyx_n_s_uint64_t, __pyx_t_28) < 0) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __pyx_t_28 = __pyx_FusedFunction_NewEx(&__pyx_mdef_5allel_3opt_5stats_33phase_progeny_by_transmission, 0, __pyx_n_s_phase_progeny_by_transmission, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_28, __pyx_empty_tuple);
      ((__pyx_FusedFunctionObject *) __pyx_t_28)->__signatures__ = __pyx_t_27;
      __Pyx_GIVEREF(__pyx_t_27);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_phase_progeny_by_transmission, __pyx_t_28) < 0) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __pyx_codeobj__132 = (PyObject*)__Pyx_PyCode_New(1, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aliman_src_github_cggh_sci, __pyx_n_s_phase_progeny_by_transmission, 901, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__132)) __PYX_ERR(0, 901, __pyx_L1_error)

     0902:     # N.B., here we will modify g in-place

     0903:

     0904:     cdef:

     0905:         Py_ssize_t n_variants, n_samples, n_progeny, i, j, max_allele

     0906:         cnp.uint8_t[:, :] is_phased

     0907:         integer a1, a2, ma1, ma2, pa1, pa2

     0908:         cnp.uint8_t[:] mac, pac

     0909:

     0910:     # guard conditions

    +0911:     assert g.shape[2] == 2

      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[2]) == 2) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 911, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[2]) == 2) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 911, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[2]) == 2) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 911, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[2]) == 2) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 911, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[2]) == 2) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 911, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[2]) == 2) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 911, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[2]) == 2) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 911, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[2]) == 2) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 911, __pyx_L1_error)
        }
      }
      #endif

     0912:

    +0913:     n_variants = g.shape[0]

      __pyx_v_n_variants = (__pyx_v_g.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_g.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_g.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_g.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_g.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_g.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_g.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_g.shape[0]);

    +0914:     n_samples = g.shape[1]

      __pyx_v_n_samples = (__pyx_v_g.shape[1]);
    /* … */
      __pyx_v_n_samples = (__pyx_v_g.shape[1]);
    /* … */
      __pyx_v_n_samples = (__pyx_v_g.shape[1]);
    /* … */
      __pyx_v_n_samples = (__pyx_v_g.shape[1]);
    /* … */
      __pyx_v_n_samples = (__pyx_v_g.shape[1]);
    /* … */
      __pyx_v_n_samples = (__pyx_v_g.shape[1]);
    /* … */
      __pyx_v_n_samples = (__pyx_v_g.shape[1]);
    /* … */
      __pyx_v_n_samples = (__pyx_v_g.shape[1]);

    +0915:     n_progeny = n_samples - 2

      __pyx_v_n_progeny = (__pyx_v_n_samples - 2);
    /* … */
      __pyx_v_n_progeny = (__pyx_v_n_samples - 2);
    /* … */
      __pyx_v_n_progeny = (__pyx_v_n_samples - 2);
    /* … */
      __pyx_v_n_progeny = (__pyx_v_n_samples - 2);
    /* … */
      __pyx_v_n_progeny = (__pyx_v_n_samples - 2);
    /* … */
      __pyx_v_n_progeny = (__pyx_v_n_samples - 2);
    /* … */
      __pyx_v_n_progeny = (__pyx_v_n_samples - 2);
    /* … */
      __pyx_v_n_progeny = (__pyx_v_n_samples - 2);

    +0916:     max_allele = np.max(g)

      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_g, 3, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_allele = __pyx_t_6;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_g, 3, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int16_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_allele = __pyx_t_6;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_g, 3, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_allele = __pyx_t_6;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_g, 3, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_allele = __pyx_t_6;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_g, 3, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_allele = __pyx_t_6;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_g, 3, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint16_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_allele = __pyx_t_6;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_g, 3, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint32_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_allele = __pyx_t_6;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_g, 3, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 916, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_allele = __pyx_t_6;

     0917:

     0918:     # setup intermediates

    +0919:     mac = np.zeros(max_allele + 1, dtype='u1')  # maternal allele counts

      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 919, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_2);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_mac = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 919, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_2);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_mac = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 919, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_2);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_mac = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 919, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_2);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_mac = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 919, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_2);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_mac = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 919, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_2);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_mac = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 919, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_2);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_mac = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 919, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_2);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_mac = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;

    +0920:     pac = np.zeros(max_allele + 1, dtype='u1')  # paternal allele counts

      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 920, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_3);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_pac = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 920, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_3);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_pac = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 920, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_3);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_pac = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 920, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_3);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_pac = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 920, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_3);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_pac = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 920, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_3);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_pac = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 920, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_3);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_pac = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 920, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_3);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 920, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_pac = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;

     0921:

     0922:     # setup outputs

    +0923:     is_phased = np.zeros((n_variants, n_samples), dtype='u1')

      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_n_samples); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 923, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_t_3);
      if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_is_phased = __pyx_t_8;
      __pyx_t_8.memview = NULL;
      __pyx_t_8.data = NULL;
    /* … */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_n_samples); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 923, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_t_3);
      if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_is_phased = __pyx_t_8;
      __pyx_t_8.memview = NULL;
      __pyx_t_8.data = NULL;
    /* … */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_n_samples); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 923, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_t_3);
      if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_is_phased = __pyx_t_8;
      __pyx_t_8.memview = NULL;
      __pyx_t_8.data = NULL;
    /* … */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_n_samples); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 923, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_t_3);
      if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_is_phased = __pyx_t_8;
      __pyx_t_8.memview = NULL;
      __pyx_t_8.data = NULL;
    /* … */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_n_samples); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 923, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_t_3);
      if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_is_phased = __pyx_t_8;
      __pyx_t_8.memview = NULL;
      __pyx_t_8.data = NULL;
    /* … */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_n_samples); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 923, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_t_3);
      if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_is_phased = __pyx_t_8;
      __pyx_t_8.memview = NULL;
      __pyx_t_8.data = NULL;
    /* … */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_n_samples); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 923, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_t_3);
      if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_is_phased = __pyx_t_8;
      __pyx_t_8.memview = NULL;
      __pyx_t_8.data = NULL;
    /* … */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n_variants); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_n_samples); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 923, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(__pyx_t_3);
      if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 923, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_is_phased = __pyx_t_8;
      __pyx_t_8.memview = NULL;
      __pyx_t_8.data = NULL;

     0924:

     0925:     # iterate over variants

    +0926:     for i in range(n_variants):

      __pyx_t_6 = __pyx_v_n_variants;
      for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) {
        __pyx_v_i = __pyx_t_9;
    /* … */
      __pyx_t_6 = __pyx_v_n_variants;
      for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) {
        __pyx_v_i = __pyx_t_9;
    /* … */
      __pyx_t_6 = __pyx_v_n_variants;
      for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) {
        __pyx_v_i = __pyx_t_9;
    /* … */
      __pyx_t_6 = __pyx_v_n_variants;
      for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) {
        __pyx_v_i = __pyx_t_9;
    /* … */
      __pyx_t_6 = __pyx_v_n_variants;
      for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) {
        __pyx_v_i = __pyx_t_9;
    /* … */
      __pyx_t_6 = __pyx_v_n_variants;
      for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) {
        __pyx_v_i = __pyx_t_9;
    /* … */
      __pyx_t_6 = __pyx_v_n_variants;
      for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) {
        __pyx_v_i = __pyx_t_9;
    /* … */
      __pyx_t_6 = __pyx_v_n_variants;
      for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) {
        __pyx_v_i = __pyx_t_9;

     0927:

     0928:         # access parental genotypes

    +0929:         ma1 = g[i, 0, 0]  # maternal allele 1

        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = 0;
        __pyx_t_12 = 0;
        __pyx_v_ma1 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_10 * __pyx_v_g.strides[0]) ) + __pyx_t_11 * __pyx_v_g.strides[1]) ) + __pyx_t_12 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = 0;
        __pyx_t_12 = 0;
        __pyx_v_ma1 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_10 * __pyx_v_g.strides[0]) ) + __pyx_t_11 * __pyx_v_g.strides[1]) ) + __pyx_t_12 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = 0;
        __pyx_t_12 = 0;
        __pyx_v_ma1 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_10 * __pyx_v_g.strides[0]) ) + __pyx_t_11 * __pyx_v_g.strides[1]) ) + __pyx_t_12 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = 0;
        __pyx_t_12 = 0;
        __pyx_v_ma1 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_10 * __pyx_v_g.strides[0]) ) + __pyx_t_11 * __pyx_v_g.strides[1]) ) + __pyx_t_12 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = 0;
        __pyx_t_12 = 0;
        __pyx_v_ma1 = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_10 * __pyx_v_g.strides[0]) ) + __pyx_t_11 * __pyx_v_g.strides[1]) ) + __pyx_t_12 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = 0;
        __pyx_t_12 = 0;
        __pyx_v_ma1 = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_10 * __pyx_v_g.strides[0]) ) + __pyx_t_11 * __pyx_v_g.strides[1]) ) + __pyx_t_12 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = 0;
        __pyx_t_12 = 0;
        __pyx_v_ma1 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_10 * __pyx_v_g.strides[0]) ) + __pyx_t_11 * __pyx_v_g.strides[1]) ) + __pyx_t_12 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = 0;
        __pyx_t_12 = 0;
        __pyx_v_ma1 = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_10 * __pyx_v_g.strides[0]) ) + __pyx_t_11 * __pyx_v_g.strides[1]) ) + __pyx_t_12 * __pyx_v_g.strides[2]) )));

    +0930:         ma2 = g[i, 0, 1]  # maternal allele 2

        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = 0;
        __pyx_t_15 = 1;
        __pyx_v_ma2 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_13 * __pyx_v_g.strides[0]) ) + __pyx_t_14 * __pyx_v_g.strides[1]) ) + __pyx_t_15 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = 0;
        __pyx_t_15 = 1;
        __pyx_v_ma2 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_13 * __pyx_v_g.strides[0]) ) + __pyx_t_14 * __pyx_v_g.strides[1]) ) + __pyx_t_15 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = 0;
        __pyx_t_15 = 1;
        __pyx_v_ma2 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_13 * __pyx_v_g.strides[0]) ) + __pyx_t_14 * __pyx_v_g.strides[1]) ) + __pyx_t_15 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = 0;
        __pyx_t_15 = 1;
        __pyx_v_ma2 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_13 * __pyx_v_g.strides[0]) ) + __pyx_t_14 * __pyx_v_g.strides[1]) ) + __pyx_t_15 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = 0;
        __pyx_t_15 = 1;
        __pyx_v_ma2 = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_13 * __pyx_v_g.strides[0]) ) + __pyx_t_14 * __pyx_v_g.strides[1]) ) + __pyx_t_15 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = 0;
        __pyx_t_15 = 1;
        __pyx_v_ma2 = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_13 * __pyx_v_g.strides[0]) ) + __pyx_t_14 * __pyx_v_g.strides[1]) ) + __pyx_t_15 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = 0;
        __pyx_t_15 = 1;
        __pyx_v_ma2 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_13 * __pyx_v_g.strides[0]) ) + __pyx_t_14 * __pyx_v_g.strides[1]) ) + __pyx_t_15 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = 0;
        __pyx_t_15 = 1;
        __pyx_v_ma2 = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_13 * __pyx_v_g.strides[0]) ) + __pyx_t_14 * __pyx_v_g.strides[1]) ) + __pyx_t_15 * __pyx_v_g.strides[2]) )));

    +0931:         pa1 = g[i, 1, 0]  # paternal allele 1

        __pyx_t_16 = __pyx_v_i;
        __pyx_t_17 = 1;
        __pyx_t_18 = 0;
        __pyx_v_pa1 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_16 * __pyx_v_g.strides[0]) ) + __pyx_t_17 * __pyx_v_g.strides[1]) ) + __pyx_t_18 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_16 = __pyx_v_i;
        __pyx_t_17 = 1;
        __pyx_t_18 = 0;
        __pyx_v_pa1 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_16 * __pyx_v_g.strides[0]) ) + __pyx_t_17 * __pyx_v_g.strides[1]) ) + __pyx_t_18 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_16 = __pyx_v_i;
        __pyx_t_17 = 1;
        __pyx_t_18 = 0;
        __pyx_v_pa1 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_16 * __pyx_v_g.strides[0]) ) + __pyx_t_17 * __pyx_v_g.strides[1]) ) + __pyx_t_18 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_16 = __pyx_v_i;
        __pyx_t_17 = 1;
        __pyx_t_18 = 0;
        __pyx_v_pa1 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_16 * __pyx_v_g.strides[0]) ) + __pyx_t_17 * __pyx_v_g.strides[1]) ) + __pyx_t_18 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_16 = __pyx_v_i;
        __pyx_t_17 = 1;
        __pyx_t_18 = 0;
        __pyx_v_pa1 = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_16 * __pyx_v_g.strides[0]) ) + __pyx_t_17 * __pyx_v_g.strides[1]) ) + __pyx_t_18 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_16 = __pyx_v_i;
        __pyx_t_17 = 1;
        __pyx_t_18 = 0;
        __pyx_v_pa1 = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_16 * __pyx_v_g.strides[0]) ) + __pyx_t_17 * __pyx_v_g.strides[1]) ) + __pyx_t_18 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_16 = __pyx_v_i;
        __pyx_t_17 = 1;
        __pyx_t_18 = 0;
        __pyx_v_pa1 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_16 * __pyx_v_g.strides[0]) ) + __pyx_t_17 * __pyx_v_g.strides[1]) ) + __pyx_t_18 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_16 = __pyx_v_i;
        __pyx_t_17 = 1;
        __pyx_t_18 = 0;
        __pyx_v_pa1 = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_16 * __pyx_v_g.strides[0]) ) + __pyx_t_17 * __pyx_v_g.strides[1]) ) + __pyx_t_18 * __pyx_v_g.strides[2]) )));

    +0932:         pa2 = g[i, 1, 1]  # paternal allele 2

        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = 1;
        __pyx_t_21 = 1;
        __pyx_v_pa2 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_19 * __pyx_v_g.strides[0]) ) + __pyx_t_20 * __pyx_v_g.strides[1]) ) + __pyx_t_21 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = 1;
        __pyx_t_21 = 1;
        __pyx_v_pa2 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_19 * __pyx_v_g.strides[0]) ) + __pyx_t_20 * __pyx_v_g.strides[1]) ) + __pyx_t_21 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = 1;
        __pyx_t_21 = 1;
        __pyx_v_pa2 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_19 * __pyx_v_g.strides[0]) ) + __pyx_t_20 * __pyx_v_g.strides[1]) ) + __pyx_t_21 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = 1;
        __pyx_t_21 = 1;
        __pyx_v_pa2 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_19 * __pyx_v_g.strides[0]) ) + __pyx_t_20 * __pyx_v_g.strides[1]) ) + __pyx_t_21 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = 1;
        __pyx_t_21 = 1;
        __pyx_v_pa2 = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_19 * __pyx_v_g.strides[0]) ) + __pyx_t_20 * __pyx_v_g.strides[1]) ) + __pyx_t_21 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = 1;
        __pyx_t_21 = 1;
        __pyx_v_pa2 = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_19 * __pyx_v_g.strides[0]) ) + __pyx_t_20 * __pyx_v_g.strides[1]) ) + __pyx_t_21 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = 1;
        __pyx_t_21 = 1;
        __pyx_v_pa2 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_19 * __pyx_v_g.strides[0]) ) + __pyx_t_20 * __pyx_v_g.strides[1]) ) + __pyx_t_21 * __pyx_v_g.strides[2]) )));
    /* … */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = 1;
        __pyx_t_21 = 1;
        __pyx_v_pa2 = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_19 * __pyx_v_g.strides[0]) ) + __pyx_t_20 * __pyx_v_g.strides[1]) ) + __pyx_t_21 * __pyx_v_g.strides[2]) )));

     0933:

     0934:         # check for any missing calls in parents

    +0935:         if ma1 < 0 or ma2 < 0 or pa1 < 0 or pa2 < 0:

        __pyx_t_23 = ((__pyx_v_ma1 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_ma2 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_pa1 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_pa2 < 0) != 0);
        __pyx_t_22 = __pyx_t_23;
        __pyx_L6_bool_binop_done:;
        if (__pyx_t_22) {
    /* … */
        }
    /* … */
        __pyx_t_23 = ((__pyx_v_ma1 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_ma2 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_pa1 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_pa2 < 0) != 0);
        __pyx_t_22 = __pyx_t_23;
        __pyx_L6_bool_binop_done:;
        if (__pyx_t_22) {
    /* … */
        }
    /* … */
        __pyx_t_23 = ((__pyx_v_ma1 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_ma2 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_pa1 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_pa2 < 0) != 0);
        __pyx_t_22 = __pyx_t_23;
        __pyx_L6_bool_binop_done:;
        if (__pyx_t_22) {
    /* … */
        }
    /* … */
        __pyx_t_23 = ((__pyx_v_ma1 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_ma2 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_pa1 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_pa2 < 0) != 0);
        __pyx_t_22 = __pyx_t_23;
        __pyx_L6_bool_binop_done:;
        if (__pyx_t_22) {
    /* … */
        }
    /* … */
        __pyx_t_23 = ((__pyx_v_ma1 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_ma2 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_pa1 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_pa2 < 0) != 0);
        __pyx_t_22 = __pyx_t_23;
        __pyx_L6_bool_binop_done:;
        if (__pyx_t_22) {
    /* … */
        }
    /* … */
        __pyx_t_23 = ((__pyx_v_ma1 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_ma2 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_pa1 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_pa2 < 0) != 0);
        __pyx_t_22 = __pyx_t_23;
        __pyx_L6_bool_binop_done:;
        if (__pyx_t_22) {
    /* … */
        }
    /* … */
        __pyx_t_23 = ((__pyx_v_ma1 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_ma2 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_pa1 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_pa2 < 0) != 0);
        __pyx_t_22 = __pyx_t_23;
        __pyx_L6_bool_binop_done:;
        if (__pyx_t_22) {
    /* … */
        }
    /* … */
        __pyx_t_23 = ((__pyx_v_ma1 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_ma2 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_pa1 < 0) != 0);
        if (!__pyx_t_23) {
        } else {
          __pyx_t_22 = __pyx_t_23;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_23 = ((__pyx_v_pa2 < 0) != 0);
        __pyx_t_22 = __pyx_t_23;
        __pyx_L6_bool_binop_done:;
        if (__pyx_t_22) {
    /* … */
        }

    +0936:             continue

          goto __pyx_L3_continue;
    /* … */
          goto __pyx_L3_continue;
    /* … */
          goto __pyx_L3_continue;
    /* … */
          goto __pyx_L3_continue;
    /* … */
          goto __pyx_L3_continue;
    /* … */
          goto __pyx_L3_continue;
    /* … */
          goto __pyx_L3_continue;
    /* … */
          goto __pyx_L3_continue;

     0937:

     0938:         # parental allele counts

    +0939:         mac[:] = 0  # reset to zero

        {
            __pyx_t_5numpy_uint8_t __pyx_temp_scalar = 0;
            {
                Py_ssize_t __pyx_temp_extent_0 = __pyx_v_mac.shape[0];
                Py_ssize_t __pyx_temp_stride_0 = __pyx_v_mac.strides[0];
                char *__pyx_temp_pointer_0;
                Py_ssize_t __pyx_temp_idx_0;
                __pyx_temp_pointer_0 = __pyx_v_mac.data;
                for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                  *((__pyx_t_5numpy_uint8_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                  __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                }
            }
        }
    /* … */
        {
            __pyx_t_5numpy_uint8_t __pyx_temp_scalar = 0;
            {
                Py_ssize_t __pyx_temp_extent_0 = __pyx_v_mac.shape[0];
                Py_ssize_t __pyx_temp_stride_0 = __pyx_v_mac.strides[0];
                char *__pyx_temp_pointer_0;
                Py_ssize_t __pyx_temp_idx_0;
                __pyx_temp_pointer_0 = __pyx_v_mac.data;
                for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                  *((__pyx_t_5numpy_uint8_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                  __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                }
            }
        }
    /* … */
        {
            __pyx_t_5numpy_uint8_t __pyx_temp_scalar = 0;
            {
                Py_ssize_t __pyx_temp_extent_0 = __pyx_v_mac.shape[0];
                Py_ssize_t __pyx_temp_stride_0 = __pyx_v_mac.strides[0];
                char *__pyx_temp_pointer_0;
                Py_ssize_t __pyx_temp_idx_0;
                __pyx_temp_pointer_0 = __pyx_v_mac.data;
                for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                  *((__pyx_t_5numpy_uint8_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                  __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                }
            }
        }
    /* … */
        {
            __pyx_t_5numpy_uint8_t __pyx_temp_scalar = 0;
            {
                Py_ssize_t __pyx_temp_extent_0 = __pyx_v_mac.shape[0];
                Py_ssize_t __pyx_temp_stride_0 = __pyx_v_mac.strides[0];
                char *__pyx_temp_pointer_0;
                Py_ssize_t __pyx_temp_idx_0;
                __pyx_temp_pointer_0 = __pyx_v_mac.data;
                for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                  *((__pyx_t_5numpy_uint8_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                  __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                }
            }
        }
    /* … */
        {
            __pyx_t_5numpy_uint8_t __pyx_temp_scalar = 0;
            {
                Py_ssize_t __pyx_temp_extent_0 = __pyx_v_mac.shape[0];
                Py_ssize_t __pyx_temp_stride_0 = __pyx_v_mac.strides[0];
                char *__pyx_temp_pointer_0;
                Py_ssize_t __pyx_temp_idx_0;
                __pyx_temp_pointer_0 = __pyx_v_mac.data;
                for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                  *((__pyx_t_5numpy_uint8_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                  __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                }
            }
        }
    /* … */
        {
            __pyx_t_5numpy_uint8_t __pyx_temp_scalar = 0;
            {
                Py_ssize_t __pyx_temp_extent_0 = __pyx_v_mac.shape[0];
                Py_ssize_t __pyx_temp_stride_0 = __pyx_v_mac.strides[0];
                char *__pyx_temp_pointer_0;
                Py_ssize_t __pyx_temp_idx_0;
                __pyx_temp_pointer_0 = __pyx_v_mac.data;
                for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                  *((__pyx_t_5numpy_uint8_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                  __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                }
            }
        }
    /* … */
        {
            __pyx_t_5numpy_uint8_t __pyx_temp_scalar = 0;
            {
                Py_ssize_t __pyx_temp_extent_0 = __pyx_v_mac.shape[0];
                Py_ssize_t __pyx_temp_stride_0 = __pyx_v_mac.strides[0];
                char *__pyx_temp_pointer_0;
                Py_ssize_t __pyx_temp_idx_0;
                __pyx_temp_pointer_0 = __pyx_v_mac.data;
                for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                  *((__pyx_t_5numpy_uint8_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                  __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                }
            }
        }
    /* … */
        {
            __pyx_t_5numpy_uint8_t __pyx_temp_scalar = 0;
            {
                Py_ssize_t __pyx_temp_extent_0 = __pyx_v_mac.shape[0];
                Py_ssize_t __pyx_temp_stride_0 = __pyx_v_mac.strides[0];
                char *__pyx_temp_pointer_0;
                Py_ssize_t __pyx_temp_idx_0;
                __pyx_temp_pointer_0 = __pyx_v_mac.data;
                for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                  *((__pyx_t_5numpy_uint8_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                  __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                }
            }
        }

    +0940:         pac[:] = 0  # reset to zero

        {
            __pyx_t_5numpy_uint8_t __pyx_temp_scalar = 0;
            {
                Py_ssize_t __pyx_temp_extent_0 = __pyx_v_pac.shape[0];
                Py_ssize_t __pyx_temp_stride_0 = __pyx_v_pac.strides[0];
                char *__pyx_temp_pointer_0;
                Py_ssize_t __pyx_temp_idx_0;
                __pyx_temp_pointer_0 = __pyx_v_pac.data;
                for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                  *((__pyx_t_5numpy_uint8_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                  __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                }
            }
        }
    /* … */
        {
            __pyx_t_5numpy_uint8_t __pyx_temp_scalar = 0;
            {
                Py_ssize_t __pyx_temp_extent_0 = __pyx_v_pac.shape[0];
                Py_ssize_t __pyx_temp_stride_0 = __pyx_v_pac.strides[0];
                char *__pyx_temp_pointer_0;
                Py_ssize_t __pyx_temp_idx_0;
                __pyx_temp_pointer_0 = __pyx_v_pac.data;
                for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                  *((__pyx_t_5numpy_uint8_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                  __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                }
            }
        }
    /* … */
        {
            __pyx_t_5numpy_uint8_t __pyx_temp_scalar = 0;
            {
                Py_ssize_t __pyx_temp_extent_0 = __pyx_v_pac.shape[0];
                Py_ssize_t __pyx_temp_stride_0 = __pyx_v_pac.strides[0];
                char *__pyx_temp_pointer_0;
                Py_ssize_t __pyx_temp_idx_0;
                __pyx_temp_pointer_0 = __pyx_v_pac.data;
                for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                  *((__pyx_t_5numpy_uint8_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                  __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                }
            }
        }
    /* … */
        {
            __pyx_t_5numpy_uint8_t __pyx_temp_scalar = 0;
            {
                Py_ssize_t __pyx_temp_extent_0 = __pyx_v_pac.shape[0];
                Py_ssize_t __pyx_temp_stride_0 = __pyx_v_pac.strides[0];
                char *__pyx_temp_pointer_0;
                Py_ssize_t __pyx_temp_idx_0;
                __pyx_temp_pointer_0 = __pyx_v_pac.data;
                for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                  *((__pyx_t_5numpy_uint8_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                  __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                }
            }
        }
    /* … */
        {
            __pyx_t_5numpy_uint8_t __pyx_temp_scalar = 0;
            {
                Py_ssize_t __pyx_temp_extent_0 = __pyx_v_pac.shape[0];
                Py_ssize_t __pyx_temp_stride_0 = __pyx_v_pac.strides[0];
                char *__pyx_temp_pointer_0;
                Py_ssize_t __pyx_temp_idx_0;
                __pyx_temp_pointer_0 = __pyx_v_pac.data;
                for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                  *((__pyx_t_5numpy_uint8_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                  __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                }
            }
        }
    /* … */
        {
            __pyx_t_5numpy_uint8_t __pyx_temp_scalar = 0;
            {
                Py_ssize_t __pyx_temp_extent_0 = __pyx_v_pac.shape[0];
                Py_ssize_t __pyx_temp_stride_0 = __pyx_v_pac.strides[0];
                char *__pyx_temp_pointer_0;
                Py_ssize_t __pyx_temp_idx_0;
                __pyx_temp_pointer_0 = __pyx_v_pac.data;
                for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                  *((__pyx_t_5numpy_uint8_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                  __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                }
            }
        }
    /* … */
        {
            __pyx_t_5numpy_uint8_t __pyx_temp_scalar = 0;
            {
                Py_ssize_t __pyx_temp_extent_0 = __pyx_v_pac.shape[0];
                Py_ssize_t __pyx_temp_stride_0 = __pyx_v_pac.strides[0];
                char *__pyx_temp_pointer_0;
                Py_ssize_t __pyx_temp_idx_0;
                __pyx_temp_pointer_0 = __pyx_v_pac.data;
                for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                  *((__pyx_t_5numpy_uint8_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                  __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                }
            }
        }
    /* … */
        {
            __pyx_t_5numpy_uint8_t __pyx_temp_scalar = 0;
            {
                Py_ssize_t __pyx_temp_extent_0 = __pyx_v_pac.shape[0];
                Py_ssize_t __pyx_temp_stride_0 = __pyx_v_pac.strides[0];
                char *__pyx_temp_pointer_0;
                Py_ssize_t __pyx_temp_idx_0;
                __pyx_temp_pointer_0 = __pyx_v_pac.data;
                for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                  *((__pyx_t_5numpy_uint8_t *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
                  __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                }
            }
        }

    +0941:         mac[ma1] = 1

        __pyx_t_24 = __pyx_v_ma1;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_24 * __pyx_v_mac.strides[0]) )) = 1;
    /* … */
        __pyx_t_24 = __pyx_v_ma1;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_24 * __pyx_v_mac.strides[0]) )) = 1;
    /* … */
        __pyx_t_24 = __pyx_v_ma1;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_24 * __pyx_v_mac.strides[0]) )) = 1;
    /* … */
        __pyx_t_24 = __pyx_v_ma1;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_24 * __pyx_v_mac.strides[0]) )) = 1;
    /* … */
        __pyx_t_24 = __pyx_v_ma1;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_24 * __pyx_v_mac.strides[0]) )) = 1;
    /* … */
        __pyx_t_24 = __pyx_v_ma1;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_24 * __pyx_v_mac.strides[0]) )) = 1;
    /* … */
        __pyx_t_24 = __pyx_v_ma1;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_24 * __pyx_v_mac.strides[0]) )) = 1;
    /* … */
        __pyx_t_24 = __pyx_v_ma1;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_24 * __pyx_v_mac.strides[0]) )) = 1;

    +0942:         mac[ma2] = 1

        __pyx_t_25 = __pyx_v_ma2;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_25 * __pyx_v_mac.strides[0]) )) = 1;
    /* … */
        __pyx_t_25 = __pyx_v_ma2;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_25 * __pyx_v_mac.strides[0]) )) = 1;
    /* … */
        __pyx_t_25 = __pyx_v_ma2;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_25 * __pyx_v_mac.strides[0]) )) = 1;
    /* … */
        __pyx_t_25 = __pyx_v_ma2;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_25 * __pyx_v_mac.strides[0]) )) = 1;
    /* … */
        __pyx_t_25 = __pyx_v_ma2;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_25 * __pyx_v_mac.strides[0]) )) = 1;
    /* … */
        __pyx_t_25 = __pyx_v_ma2;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_25 * __pyx_v_mac.strides[0]) )) = 1;
    /* … */
        __pyx_t_25 = __pyx_v_ma2;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_25 * __pyx_v_mac.strides[0]) )) = 1;
    /* … */
        __pyx_t_25 = __pyx_v_ma2;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_25 * __pyx_v_mac.strides[0]) )) = 1;

    +0943:         pac[pa1] = 1

        __pyx_t_26 = __pyx_v_pa1;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_26 * __pyx_v_pac.strides[0]) )) = 1;
    /* … */
        __pyx_t_26 = __pyx_v_pa1;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_26 * __pyx_v_pac.strides[0]) )) = 1;
    /* … */
        __pyx_t_26 = __pyx_v_pa1;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_26 * __pyx_v_pac.strides[0]) )) = 1;
    /* … */
        __pyx_t_26 = __pyx_v_pa1;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_26 * __pyx_v_pac.strides[0]) )) = 1;
    /* … */
        __pyx_t_26 = __pyx_v_pa1;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_26 * __pyx_v_pac.strides[0]) )) = 1;
    /* … */
        __pyx_t_26 = __pyx_v_pa1;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_26 * __pyx_v_pac.strides[0]) )) = 1;
    /* … */
        __pyx_t_26 = __pyx_v_pa1;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_26 * __pyx_v_pac.strides[0]) )) = 1;
    /* … */
        __pyx_t_26 = __pyx_v_pa1;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_26 * __pyx_v_pac.strides[0]) )) = 1;

    +0944:         pac[pa2] = 1

        __pyx_t_27 = __pyx_v_pa2;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_27 * __pyx_v_pac.strides[0]) )) = 1;
    /* … */
        __pyx_t_27 = __pyx_v_pa2;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_27 * __pyx_v_pac.strides[0]) )) = 1;
    /* … */
        __pyx_t_27 = __pyx_v_pa2;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_27 * __pyx_v_pac.strides[0]) )) = 1;
    /* … */
        __pyx_t_27 = __pyx_v_pa2;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_27 * __pyx_v_pac.strides[0]) )) = 1;
    /* … */
        __pyx_t_27 = __pyx_v_pa2;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_27 * __pyx_v_pac.strides[0]) )) = 1;
    /* … */
        __pyx_t_27 = __pyx_v_pa2;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_27 * __pyx_v_pac.strides[0]) )) = 1;
    /* … */
        __pyx_t_27 = __pyx_v_pa2;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_27 * __pyx_v_pac.strides[0]) )) = 1;
    /* … */
        __pyx_t_27 = __pyx_v_pa2;
        *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_27 * __pyx_v_pac.strides[0]) )) = 1;

     0945:

     0946:         # iterate over progeny

    +0947:         for j in range(2, n_progeny + 2):

        __pyx_t_28 = (__pyx_v_n_progeny + 2);
        for (__pyx_t_29 = 2; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
          __pyx_v_j = __pyx_t_29;
    /* … */
        __pyx_t_28 = (__pyx_v_n_progeny + 2);
        for (__pyx_t_29 = 2; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
          __pyx_v_j = __pyx_t_29;
    /* … */
        __pyx_t_28 = (__pyx_v_n_progeny + 2);
        for (__pyx_t_29 = 2; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
          __pyx_v_j = __pyx_t_29;
    /* … */
        __pyx_t_28 = (__pyx_v_n_progeny + 2);
        for (__pyx_t_29 = 2; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
          __pyx_v_j = __pyx_t_29;
    /* … */
        __pyx_t_28 = (__pyx_v_n_progeny + 2);
        for (__pyx_t_29 = 2; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
          __pyx_v_j = __pyx_t_29;
    /* … */
        __pyx_t_28 = (__pyx_v_n_progeny + 2);
        for (__pyx_t_29 = 2; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
          __pyx_v_j = __pyx_t_29;
    /* … */
        __pyx_t_28 = (__pyx_v_n_progeny + 2);
        for (__pyx_t_29 = 2; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
          __pyx_v_j = __pyx_t_29;
    /* … */
        __pyx_t_28 = (__pyx_v_n_progeny + 2);
        for (__pyx_t_29 = 2; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
          __pyx_v_j = __pyx_t_29;

     0948:

     0949:             # access progeny alleles

    +0950:             a1 = g[i, j, 0]

          __pyx_t_30 = __pyx_v_i;
          __pyx_t_31 = __pyx_v_j;
          __pyx_t_32 = 0;
          __pyx_v_a1 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_30 * __pyx_v_g.strides[0]) ) + __pyx_t_31 * __pyx_v_g.strides[1]) ) + __pyx_t_32 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_30 = __pyx_v_i;
          __pyx_t_31 = __pyx_v_j;
          __pyx_t_32 = 0;
          __pyx_v_a1 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_30 * __pyx_v_g.strides[0]) ) + __pyx_t_31 * __pyx_v_g.strides[1]) ) + __pyx_t_32 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_30 = __pyx_v_i;
          __pyx_t_31 = __pyx_v_j;
          __pyx_t_32 = 0;
          __pyx_v_a1 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_30 * __pyx_v_g.strides[0]) ) + __pyx_t_31 * __pyx_v_g.strides[1]) ) + __pyx_t_32 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_30 = __pyx_v_i;
          __pyx_t_31 = __pyx_v_j;
          __pyx_t_32 = 0;
          __pyx_v_a1 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_30 * __pyx_v_g.strides[0]) ) + __pyx_t_31 * __pyx_v_g.strides[1]) ) + __pyx_t_32 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_30 = __pyx_v_i;
          __pyx_t_31 = __pyx_v_j;
          __pyx_t_32 = 0;
          __pyx_v_a1 = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_30 * __pyx_v_g.strides[0]) ) + __pyx_t_31 * __pyx_v_g.strides[1]) ) + __pyx_t_32 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_30 = __pyx_v_i;
          __pyx_t_31 = __pyx_v_j;
          __pyx_t_32 = 0;
          __pyx_v_a1 = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_30 * __pyx_v_g.strides[0]) ) + __pyx_t_31 * __pyx_v_g.strides[1]) ) + __pyx_t_32 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_30 = __pyx_v_i;
          __pyx_t_31 = __pyx_v_j;
          __pyx_t_32 = 0;
          __pyx_v_a1 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_30 * __pyx_v_g.strides[0]) ) + __pyx_t_31 * __pyx_v_g.strides[1]) ) + __pyx_t_32 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_30 = __pyx_v_i;
          __pyx_t_31 = __pyx_v_j;
          __pyx_t_32 = 0;
          __pyx_v_a1 = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_30 * __pyx_v_g.strides[0]) ) + __pyx_t_31 * __pyx_v_g.strides[1]) ) + __pyx_t_32 * __pyx_v_g.strides[2]) )));

    +0951:             a2 = g[i, j, 1]

          __pyx_t_33 = __pyx_v_i;
          __pyx_t_34 = __pyx_v_j;
          __pyx_t_35 = 1;
          __pyx_v_a2 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_33 * __pyx_v_g.strides[0]) ) + __pyx_t_34 * __pyx_v_g.strides[1]) ) + __pyx_t_35 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_33 = __pyx_v_i;
          __pyx_t_34 = __pyx_v_j;
          __pyx_t_35 = 1;
          __pyx_v_a2 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_33 * __pyx_v_g.strides[0]) ) + __pyx_t_34 * __pyx_v_g.strides[1]) ) + __pyx_t_35 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_33 = __pyx_v_i;
          __pyx_t_34 = __pyx_v_j;
          __pyx_t_35 = 1;
          __pyx_v_a2 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_33 * __pyx_v_g.strides[0]) ) + __pyx_t_34 * __pyx_v_g.strides[1]) ) + __pyx_t_35 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_33 = __pyx_v_i;
          __pyx_t_34 = __pyx_v_j;
          __pyx_t_35 = 1;
          __pyx_v_a2 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_33 * __pyx_v_g.strides[0]) ) + __pyx_t_34 * __pyx_v_g.strides[1]) ) + __pyx_t_35 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_33 = __pyx_v_i;
          __pyx_t_34 = __pyx_v_j;
          __pyx_t_35 = 1;
          __pyx_v_a2 = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_33 * __pyx_v_g.strides[0]) ) + __pyx_t_34 * __pyx_v_g.strides[1]) ) + __pyx_t_35 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_33 = __pyx_v_i;
          __pyx_t_34 = __pyx_v_j;
          __pyx_t_35 = 1;
          __pyx_v_a2 = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_33 * __pyx_v_g.strides[0]) ) + __pyx_t_34 * __pyx_v_g.strides[1]) ) + __pyx_t_35 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_33 = __pyx_v_i;
          __pyx_t_34 = __pyx_v_j;
          __pyx_t_35 = 1;
          __pyx_v_a2 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_33 * __pyx_v_g.strides[0]) ) + __pyx_t_34 * __pyx_v_g.strides[1]) ) + __pyx_t_35 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_33 = __pyx_v_i;
          __pyx_t_34 = __pyx_v_j;
          __pyx_t_35 = 1;
          __pyx_v_a2 = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_33 * __pyx_v_g.strides[0]) ) + __pyx_t_34 * __pyx_v_g.strides[1]) ) + __pyx_t_35 * __pyx_v_g.strides[2]) )));

     0952:

    +0953:             if a1 < 0 or a2 < 0:  # child is missing

          __pyx_t_23 = ((__pyx_v_a1 < 0) != 0);
          if (!__pyx_t_23) {
          } else {
            __pyx_t_22 = __pyx_t_23;
            goto __pyx_L13_bool_binop_done;
          }
          __pyx_t_23 = ((__pyx_v_a2 < 0) != 0);
          __pyx_t_22 = __pyx_t_23;
          __pyx_L13_bool_binop_done:;
          if (__pyx_t_22) {
    /* … */
          }
    /* … */
          __pyx_t_23 = ((__pyx_v_a1 < 0) != 0);
          if (!__pyx_t_23) {
          } else {
            __pyx_t_22 = __pyx_t_23;
            goto __pyx_L13_bool_binop_done;
          }
          __pyx_t_23 = ((__pyx_v_a2 < 0) != 0);
          __pyx_t_22 = __pyx_t_23;
          __pyx_L13_bool_binop_done:;
          if (__pyx_t_22) {
    /* … */
          }
    /* … */
          __pyx_t_23 = ((__pyx_v_a1 < 0) != 0);
          if (!__pyx_t_23) {
          } else {
            __pyx_t_22 = __pyx_t_23;
            goto __pyx_L13_bool_binop_done;
          }
          __pyx_t_23 = ((__pyx_v_a2 < 0) != 0);
          __pyx_t_22 = __pyx_t_23;
          __pyx_L13_bool_binop_done:;
          if (__pyx_t_22) {
    /* … */
          }
    /* … */
          __pyx_t_23 = ((__pyx_v_a1 < 0) != 0);
          if (!__pyx_t_23) {
          } else {
            __pyx_t_22 = __pyx_t_23;
            goto __pyx_L13_bool_binop_done;
          }
          __pyx_t_23 = ((__pyx_v_a2 < 0) != 0);
          __pyx_t_22 = __pyx_t_23;
          __pyx_L13_bool_binop_done:;
          if (__pyx_t_22) {
    /* … */
          }
    /* … */
          __pyx_t_23 = ((__pyx_v_a1 < 0) != 0);
          if (!__pyx_t_23) {
          } else {
            __pyx_t_22 = __pyx_t_23;
            goto __pyx_L13_bool_binop_done;
          }
          __pyx_t_23 = ((__pyx_v_a2 < 0) != 0);
          __pyx_t_22 = __pyx_t_23;
          __pyx_L13_bool_binop_done:;
          if (__pyx_t_22) {
    /* … */
          }
    /* … */
          __pyx_t_23 = ((__pyx_v_a1 < 0) != 0);
          if (!__pyx_t_23) {
          } else {
            __pyx_t_22 = __pyx_t_23;
            goto __pyx_L13_bool_binop_done;
          }
          __pyx_t_23 = ((__pyx_v_a2 < 0) != 0);
          __pyx_t_22 = __pyx_t_23;
          __pyx_L13_bool_binop_done:;
          if (__pyx_t_22) {
    /* … */
          }
    /* … */
          __pyx_t_23 = ((__pyx_v_a1 < 0) != 0);
          if (!__pyx_t_23) {
          } else {
            __pyx_t_22 = __pyx_t_23;
            goto __pyx_L13_bool_binop_done;
          }
          __pyx_t_23 = ((__pyx_v_a2 < 0) != 0);
          __pyx_t_22 = __pyx_t_23;
          __pyx_L13_bool_binop_done:;
          if (__pyx_t_22) {
    /* … */
          }
    /* … */
          __pyx_t_23 = ((__pyx_v_a1 < 0) != 0);
          if (!__pyx_t_23) {
          } else {
            __pyx_t_22 = __pyx_t_23;
            goto __pyx_L13_bool_binop_done;
          }
          __pyx_t_23 = ((__pyx_v_a2 < 0) != 0);
          __pyx_t_22 = __pyx_t_23;
          __pyx_L13_bool_binop_done:;
          if (__pyx_t_22) {
    /* … */
          }

    +0954:                 continue

            goto __pyx_L10_continue;
    /* … */
            goto __pyx_L10_continue;
    /* … */
            goto __pyx_L10_continue;
    /* … */
            goto __pyx_L10_continue;
    /* … */
            goto __pyx_L10_continue;
    /* … */
            goto __pyx_L10_continue;
    /* … */
            goto __pyx_L10_continue;
    /* … */
            goto __pyx_L10_continue;

     0955:

    +0956:             elif a1 == a2:  # child is homozygous

          __pyx_t_22 = ((__pyx_v_a1 == __pyx_v_a2) != 0);
          if (__pyx_t_22) {
    /* … */
            goto __pyx_L12;
          }
    /* … */
          __pyx_t_22 = ((__pyx_v_a1 == __pyx_v_a2) != 0);
          if (__pyx_t_22) {
    /* … */
            goto __pyx_L12;
          }
    /* … */
          __pyx_t_22 = ((__pyx_v_a1 == __pyx_v_a2) != 0);
          if (__pyx_t_22) {
    /* … */
            goto __pyx_L12;
          }
    /* … */
          __pyx_t_22 = ((__pyx_v_a1 == __pyx_v_a2) != 0);
          if (__pyx_t_22) {
    /* … */
            goto __pyx_L12;
          }
    /* … */
          __pyx_t_22 = ((__pyx_v_a1 == __pyx_v_a2) != 0);
          if (__pyx_t_22) {
    /* … */
            goto __pyx_L12;
          }
    /* … */
          __pyx_t_22 = ((__pyx_v_a1 == __pyx_v_a2) != 0);
          if (__pyx_t_22) {
    /* … */
            goto __pyx_L12;
          }
    /* … */
          __pyx_t_22 = ((__pyx_v_a1 == __pyx_v_a2) != 0);
          if (__pyx_t_22) {
    /* … */
            goto __pyx_L12;
          }
    /* … */
          __pyx_t_22 = ((__pyx_v_a1 == __pyx_v_a2) != 0);
          if (__pyx_t_22) {
    /* … */
            goto __pyx_L12;
          }

     0957:

    +0958:                 if mac[a1] > 0 and pac[a1] > 0:  # Mendelian consistent

            __pyx_t_36 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_36 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L16_bool_binop_done;
            }
            __pyx_t_37 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_37 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L16_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
            }
    /* … */
            __pyx_t_36 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_36 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L16_bool_binop_done;
            }
            __pyx_t_37 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_37 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L16_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
            }
    /* … */
            __pyx_t_36 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_36 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L16_bool_binop_done;
            }
            __pyx_t_37 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_37 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L16_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
            }
    /* … */
            __pyx_t_36 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_36 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L16_bool_binop_done;
            }
            __pyx_t_37 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_37 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L16_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
            }
    /* … */
            __pyx_t_36 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_36 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L16_bool_binop_done;
            }
            __pyx_t_37 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_37 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L16_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
            }
    /* … */
            __pyx_t_36 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_36 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L16_bool_binop_done;
            }
            __pyx_t_37 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_37 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L16_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
            }
    /* … */
            __pyx_t_36 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_36 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L16_bool_binop_done;
            }
            __pyx_t_37 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_37 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L16_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
            }
    /* … */
            __pyx_t_36 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_36 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L16_bool_binop_done;
            }
            __pyx_t_37 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_37 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L16_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
            }

     0959:                     # trivially phase the child

    +0960:                     is_phased[i, j] = 1

              __pyx_t_38 = __pyx_v_i;
              __pyx_t_39 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_38 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_39 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_38 = __pyx_v_i;
              __pyx_t_39 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_38 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_39 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_38 = __pyx_v_i;
              __pyx_t_39 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_38 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_39 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_38 = __pyx_v_i;
              __pyx_t_39 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_38 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_39 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_38 = __pyx_v_i;
              __pyx_t_39 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_38 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_39 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_38 = __pyx_v_i;
              __pyx_t_39 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_38 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_39 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_38 = __pyx_v_i;
              __pyx_t_39 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_38 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_39 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_38 = __pyx_v_i;
              __pyx_t_39 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_38 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_39 * __pyx_v_is_phased.strides[1]) )) = 1;

     0961:

     0962:             else:  # child is heterozygous

     0963:

    +0964:                 if mac[a1] > 0 and pac[a1] == 0 and pac[a2] > 0:

          /*else*/ {
            __pyx_t_40 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_40 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L19_bool_binop_done;
            }
            __pyx_t_41 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_41 * __pyx_v_pac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L19_bool_binop_done;
            }
            __pyx_t_42 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_42 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L19_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }
    /* … */
          /*else*/ {
            __pyx_t_40 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_40 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L19_bool_binop_done;
            }
            __pyx_t_41 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_41 * __pyx_v_pac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L19_bool_binop_done;
            }
            __pyx_t_42 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_42 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L19_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }
    /* … */
          /*else*/ {
            __pyx_t_40 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_40 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L19_bool_binop_done;
            }
            __pyx_t_41 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_41 * __pyx_v_pac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L19_bool_binop_done;
            }
            __pyx_t_42 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_42 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L19_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }
    /* … */
          /*else*/ {
            __pyx_t_40 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_40 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L19_bool_binop_done;
            }
            __pyx_t_41 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_41 * __pyx_v_pac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L19_bool_binop_done;
            }
            __pyx_t_42 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_42 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L19_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }
    /* … */
          /*else*/ {
            __pyx_t_40 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_40 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L19_bool_binop_done;
            }
            __pyx_t_41 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_41 * __pyx_v_pac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L19_bool_binop_done;
            }
            __pyx_t_42 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_42 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L19_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }
    /* … */
          /*else*/ {
            __pyx_t_40 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_40 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L19_bool_binop_done;
            }
            __pyx_t_41 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_41 * __pyx_v_pac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L19_bool_binop_done;
            }
            __pyx_t_42 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_42 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L19_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }
    /* … */
          /*else*/ {
            __pyx_t_40 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_40 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L19_bool_binop_done;
            }
            __pyx_t_41 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_41 * __pyx_v_pac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L19_bool_binop_done;
            }
            __pyx_t_42 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_42 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L19_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }
    /* … */
          /*else*/ {
            __pyx_t_40 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_40 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L19_bool_binop_done;
            }
            __pyx_t_41 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_41 * __pyx_v_pac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L19_bool_binop_done;
            }
            __pyx_t_42 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_42 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L19_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }

     0965:                     # allele 1 is unique to mother, no need to swap

    +0966:                     is_phased[i, j] = 1

              __pyx_t_43 = __pyx_v_i;
              __pyx_t_44 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_43 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_44 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_43 = __pyx_v_i;
              __pyx_t_44 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_43 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_44 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_43 = __pyx_v_i;
              __pyx_t_44 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_43 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_44 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_43 = __pyx_v_i;
              __pyx_t_44 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_43 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_44 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_43 = __pyx_v_i;
              __pyx_t_44 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_43 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_44 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_43 = __pyx_v_i;
              __pyx_t_44 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_43 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_44 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_43 = __pyx_v_i;
              __pyx_t_44 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_43 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_44 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_43 = __pyx_v_i;
              __pyx_t_44 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_43 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_44 * __pyx_v_is_phased.strides[1]) )) = 1;

     0967:

    +0968:                 elif mac[a2] > 0 and pac[a2] == 0 and pac[a1] > 0:

            __pyx_t_45 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_45 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L22_bool_binop_done;
            }
            __pyx_t_46 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_46 * __pyx_v_pac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L22_bool_binop_done;
            }
            __pyx_t_47 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_47 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L22_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }
    /* … */
            __pyx_t_45 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_45 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L22_bool_binop_done;
            }
            __pyx_t_46 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_46 * __pyx_v_pac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L22_bool_binop_done;
            }
            __pyx_t_47 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_47 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L22_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }
    /* … */
            __pyx_t_45 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_45 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L22_bool_binop_done;
            }
            __pyx_t_46 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_46 * __pyx_v_pac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L22_bool_binop_done;
            }
            __pyx_t_47 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_47 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L22_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }
    /* … */
            __pyx_t_45 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_45 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L22_bool_binop_done;
            }
            __pyx_t_46 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_46 * __pyx_v_pac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L22_bool_binop_done;
            }
            __pyx_t_47 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_47 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L22_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }
    /* … */
            __pyx_t_45 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_45 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L22_bool_binop_done;
            }
            __pyx_t_46 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_46 * __pyx_v_pac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L22_bool_binop_done;
            }
            __pyx_t_47 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_47 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L22_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }
    /* … */
            __pyx_t_45 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_45 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L22_bool_binop_done;
            }
            __pyx_t_46 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_46 * __pyx_v_pac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L22_bool_binop_done;
            }
            __pyx_t_47 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_47 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L22_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }
    /* … */
            __pyx_t_45 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_45 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L22_bool_binop_done;
            }
            __pyx_t_46 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_46 * __pyx_v_pac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L22_bool_binop_done;
            }
            __pyx_t_47 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_47 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L22_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }
    /* … */
            __pyx_t_45 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_45 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L22_bool_binop_done;
            }
            __pyx_t_46 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_46 * __pyx_v_pac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L22_bool_binop_done;
            }
            __pyx_t_47 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_47 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L22_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }

     0969:                     # allele 2 is unique to mother, swap child alleles

    +0970:                     g[i, j, 0] = a2

              __pyx_t_48 = __pyx_v_i;
              __pyx_t_49 = __pyx_v_j;
              __pyx_t_50 = 0;
              *((__pyx_t_5numpy_int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_48 * __pyx_v_g.strides[0]) ) + __pyx_t_49 * __pyx_v_g.strides[1]) ) + __pyx_t_50 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;
    /* … */
              __pyx_t_48 = __pyx_v_i;
              __pyx_t_49 = __pyx_v_j;
              __pyx_t_50 = 0;
              *((__pyx_t_5numpy_int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_48 * __pyx_v_g.strides[0]) ) + __pyx_t_49 * __pyx_v_g.strides[1]) ) + __pyx_t_50 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;
    /* … */
              __pyx_t_48 = __pyx_v_i;
              __pyx_t_49 = __pyx_v_j;
              __pyx_t_50 = 0;
              *((__pyx_t_5numpy_int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_48 * __pyx_v_g.strides[0]) ) + __pyx_t_49 * __pyx_v_g.strides[1]) ) + __pyx_t_50 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;
    /* … */
              __pyx_t_48 = __pyx_v_i;
              __pyx_t_49 = __pyx_v_j;
              __pyx_t_50 = 0;
              *((__pyx_t_5numpy_int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_48 * __pyx_v_g.strides[0]) ) + __pyx_t_49 * __pyx_v_g.strides[1]) ) + __pyx_t_50 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;
    /* … */
              __pyx_t_48 = __pyx_v_i;
              __pyx_t_49 = __pyx_v_j;
              __pyx_t_50 = 0;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_48 * __pyx_v_g.strides[0]) ) + __pyx_t_49 * __pyx_v_g.strides[1]) ) + __pyx_t_50 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;
    /* … */
              __pyx_t_48 = __pyx_v_i;
              __pyx_t_49 = __pyx_v_j;
              __pyx_t_50 = 0;
              *((__pyx_t_5numpy_uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_48 * __pyx_v_g.strides[0]) ) + __pyx_t_49 * __pyx_v_g.strides[1]) ) + __pyx_t_50 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;
    /* … */
              __pyx_t_48 = __pyx_v_i;
              __pyx_t_49 = __pyx_v_j;
              __pyx_t_50 = 0;
              *((__pyx_t_5numpy_uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_48 * __pyx_v_g.strides[0]) ) + __pyx_t_49 * __pyx_v_g.strides[1]) ) + __pyx_t_50 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;
    /* … */
              __pyx_t_48 = __pyx_v_i;
              __pyx_t_49 = __pyx_v_j;
              __pyx_t_50 = 0;
              *((__pyx_t_5numpy_uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_48 * __pyx_v_g.strides[0]) ) + __pyx_t_49 * __pyx_v_g.strides[1]) ) + __pyx_t_50 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;

    +0971:                     g[i, j, 1] = a1

              __pyx_t_51 = __pyx_v_i;
              __pyx_t_52 = __pyx_v_j;
              __pyx_t_53 = 1;
              *((__pyx_t_5numpy_int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_51 * __pyx_v_g.strides[0]) ) + __pyx_t_52 * __pyx_v_g.strides[1]) ) + __pyx_t_53 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;
    /* … */
              __pyx_t_51 = __pyx_v_i;
              __pyx_t_52 = __pyx_v_j;
              __pyx_t_53 = 1;
              *((__pyx_t_5numpy_int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_51 * __pyx_v_g.strides[0]) ) + __pyx_t_52 * __pyx_v_g.strides[1]) ) + __pyx_t_53 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;
    /* … */
              __pyx_t_51 = __pyx_v_i;
              __pyx_t_52 = __pyx_v_j;
              __pyx_t_53 = 1;
              *((__pyx_t_5numpy_int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_51 * __pyx_v_g.strides[0]) ) + __pyx_t_52 * __pyx_v_g.strides[1]) ) + __pyx_t_53 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;
    /* … */
              __pyx_t_51 = __pyx_v_i;
              __pyx_t_52 = __pyx_v_j;
              __pyx_t_53 = 1;
              *((__pyx_t_5numpy_int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_51 * __pyx_v_g.strides[0]) ) + __pyx_t_52 * __pyx_v_g.strides[1]) ) + __pyx_t_53 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;
    /* … */
              __pyx_t_51 = __pyx_v_i;
              __pyx_t_52 = __pyx_v_j;
              __pyx_t_53 = 1;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_51 * __pyx_v_g.strides[0]) ) + __pyx_t_52 * __pyx_v_g.strides[1]) ) + __pyx_t_53 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;
    /* … */
              __pyx_t_51 = __pyx_v_i;
              __pyx_t_52 = __pyx_v_j;
              __pyx_t_53 = 1;
              *((__pyx_t_5numpy_uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_51 * __pyx_v_g.strides[0]) ) + __pyx_t_52 * __pyx_v_g.strides[1]) ) + __pyx_t_53 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;
    /* … */
              __pyx_t_51 = __pyx_v_i;
              __pyx_t_52 = __pyx_v_j;
              __pyx_t_53 = 1;
              *((__pyx_t_5numpy_uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_51 * __pyx_v_g.strides[0]) ) + __pyx_t_52 * __pyx_v_g.strides[1]) ) + __pyx_t_53 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;
    /* … */
              __pyx_t_51 = __pyx_v_i;
              __pyx_t_52 = __pyx_v_j;
              __pyx_t_53 = 1;
              *((__pyx_t_5numpy_uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_51 * __pyx_v_g.strides[0]) ) + __pyx_t_52 * __pyx_v_g.strides[1]) ) + __pyx_t_53 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;

    +0972:                     is_phased[i, j] = 1

              __pyx_t_54 = __pyx_v_i;
              __pyx_t_55 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_54 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_55 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_54 = __pyx_v_i;
              __pyx_t_55 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_54 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_55 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_54 = __pyx_v_i;
              __pyx_t_55 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_54 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_55 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_54 = __pyx_v_i;
              __pyx_t_55 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_54 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_55 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_54 = __pyx_v_i;
              __pyx_t_55 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_54 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_55 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_54 = __pyx_v_i;
              __pyx_t_55 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_54 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_55 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_54 = __pyx_v_i;
              __pyx_t_55 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_54 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_55 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_54 = __pyx_v_i;
              __pyx_t_55 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_54 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_55 * __pyx_v_is_phased.strides[1]) )) = 1;

     0973:

    +0974:                 elif pac[a1] > 0 and mac[a1] == 0 and mac[a2] > 0:

            __pyx_t_56 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_56 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L25_bool_binop_done;
            }
            __pyx_t_57 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_57 * __pyx_v_mac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L25_bool_binop_done;
            }
            __pyx_t_58 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_58 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L25_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }
    /* … */
            __pyx_t_56 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_56 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L25_bool_binop_done;
            }
            __pyx_t_57 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_57 * __pyx_v_mac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L25_bool_binop_done;
            }
            __pyx_t_58 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_58 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L25_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }
    /* … */
            __pyx_t_56 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_56 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L25_bool_binop_done;
            }
            __pyx_t_57 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_57 * __pyx_v_mac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L25_bool_binop_done;
            }
            __pyx_t_58 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_58 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L25_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }
    /* … */
            __pyx_t_56 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_56 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L25_bool_binop_done;
            }
            __pyx_t_57 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_57 * __pyx_v_mac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L25_bool_binop_done;
            }
            __pyx_t_58 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_58 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L25_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }
    /* … */
            __pyx_t_56 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_56 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L25_bool_binop_done;
            }
            __pyx_t_57 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_57 * __pyx_v_mac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L25_bool_binop_done;
            }
            __pyx_t_58 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_58 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L25_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }
    /* … */
            __pyx_t_56 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_56 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L25_bool_binop_done;
            }
            __pyx_t_57 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_57 * __pyx_v_mac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L25_bool_binop_done;
            }
            __pyx_t_58 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_58 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L25_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }
    /* … */
            __pyx_t_56 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_56 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L25_bool_binop_done;
            }
            __pyx_t_57 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_57 * __pyx_v_mac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L25_bool_binop_done;
            }
            __pyx_t_58 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_58 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L25_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }
    /* … */
            __pyx_t_56 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_56 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L25_bool_binop_done;
            }
            __pyx_t_57 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_57 * __pyx_v_mac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L25_bool_binop_done;
            }
            __pyx_t_58 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_58 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L25_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
              goto __pyx_L18;
            }

     0975:                     # allele 1 is unique to father, swap child alleles

    +0976:                     g[i, j, 0] = a2

              __pyx_t_59 = __pyx_v_i;
              __pyx_t_60 = __pyx_v_j;
              __pyx_t_61 = 0;
              *((__pyx_t_5numpy_int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_59 * __pyx_v_g.strides[0]) ) + __pyx_t_60 * __pyx_v_g.strides[1]) ) + __pyx_t_61 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;
    /* … */
              __pyx_t_59 = __pyx_v_i;
              __pyx_t_60 = __pyx_v_j;
              __pyx_t_61 = 0;
              *((__pyx_t_5numpy_int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_59 * __pyx_v_g.strides[0]) ) + __pyx_t_60 * __pyx_v_g.strides[1]) ) + __pyx_t_61 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;
    /* … */
              __pyx_t_59 = __pyx_v_i;
              __pyx_t_60 = __pyx_v_j;
              __pyx_t_61 = 0;
              *((__pyx_t_5numpy_int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_59 * __pyx_v_g.strides[0]) ) + __pyx_t_60 * __pyx_v_g.strides[1]) ) + __pyx_t_61 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;
    /* … */
              __pyx_t_59 = __pyx_v_i;
              __pyx_t_60 = __pyx_v_j;
              __pyx_t_61 = 0;
              *((__pyx_t_5numpy_int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_59 * __pyx_v_g.strides[0]) ) + __pyx_t_60 * __pyx_v_g.strides[1]) ) + __pyx_t_61 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;
    /* … */
              __pyx_t_59 = __pyx_v_i;
              __pyx_t_60 = __pyx_v_j;
              __pyx_t_61 = 0;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_59 * __pyx_v_g.strides[0]) ) + __pyx_t_60 * __pyx_v_g.strides[1]) ) + __pyx_t_61 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;
    /* … */
              __pyx_t_59 = __pyx_v_i;
              __pyx_t_60 = __pyx_v_j;
              __pyx_t_61 = 0;
              *((__pyx_t_5numpy_uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_59 * __pyx_v_g.strides[0]) ) + __pyx_t_60 * __pyx_v_g.strides[1]) ) + __pyx_t_61 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;
    /* … */
              __pyx_t_59 = __pyx_v_i;
              __pyx_t_60 = __pyx_v_j;
              __pyx_t_61 = 0;
              *((__pyx_t_5numpy_uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_59 * __pyx_v_g.strides[0]) ) + __pyx_t_60 * __pyx_v_g.strides[1]) ) + __pyx_t_61 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;
    /* … */
              __pyx_t_59 = __pyx_v_i;
              __pyx_t_60 = __pyx_v_j;
              __pyx_t_61 = 0;
              *((__pyx_t_5numpy_uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_59 * __pyx_v_g.strides[0]) ) + __pyx_t_60 * __pyx_v_g.strides[1]) ) + __pyx_t_61 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;

    +0977:                     g[i, j, 1] = a1

              __pyx_t_62 = __pyx_v_i;
              __pyx_t_63 = __pyx_v_j;
              __pyx_t_64 = 1;
              *((__pyx_t_5numpy_int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_62 * __pyx_v_g.strides[0]) ) + __pyx_t_63 * __pyx_v_g.strides[1]) ) + __pyx_t_64 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;
    /* … */
              __pyx_t_62 = __pyx_v_i;
              __pyx_t_63 = __pyx_v_j;
              __pyx_t_64 = 1;
              *((__pyx_t_5numpy_int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_62 * __pyx_v_g.strides[0]) ) + __pyx_t_63 * __pyx_v_g.strides[1]) ) + __pyx_t_64 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;
    /* … */
              __pyx_t_62 = __pyx_v_i;
              __pyx_t_63 = __pyx_v_j;
              __pyx_t_64 = 1;
              *((__pyx_t_5numpy_int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_62 * __pyx_v_g.strides[0]) ) + __pyx_t_63 * __pyx_v_g.strides[1]) ) + __pyx_t_64 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;
    /* … */
              __pyx_t_62 = __pyx_v_i;
              __pyx_t_63 = __pyx_v_j;
              __pyx_t_64 = 1;
              *((__pyx_t_5numpy_int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_62 * __pyx_v_g.strides[0]) ) + __pyx_t_63 * __pyx_v_g.strides[1]) ) + __pyx_t_64 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;
    /* … */
              __pyx_t_62 = __pyx_v_i;
              __pyx_t_63 = __pyx_v_j;
              __pyx_t_64 = 1;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_62 * __pyx_v_g.strides[0]) ) + __pyx_t_63 * __pyx_v_g.strides[1]) ) + __pyx_t_64 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;
    /* … */
              __pyx_t_62 = __pyx_v_i;
              __pyx_t_63 = __pyx_v_j;
              __pyx_t_64 = 1;
              *((__pyx_t_5numpy_uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_62 * __pyx_v_g.strides[0]) ) + __pyx_t_63 * __pyx_v_g.strides[1]) ) + __pyx_t_64 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;
    /* … */
              __pyx_t_62 = __pyx_v_i;
              __pyx_t_63 = __pyx_v_j;
              __pyx_t_64 = 1;
              *((__pyx_t_5numpy_uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_62 * __pyx_v_g.strides[0]) ) + __pyx_t_63 * __pyx_v_g.strides[1]) ) + __pyx_t_64 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;
    /* … */
              __pyx_t_62 = __pyx_v_i;
              __pyx_t_63 = __pyx_v_j;
              __pyx_t_64 = 1;
              *((__pyx_t_5numpy_uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_62 * __pyx_v_g.strides[0]) ) + __pyx_t_63 * __pyx_v_g.strides[1]) ) + __pyx_t_64 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;

    +0978:                     is_phased[i, j] = 1

              __pyx_t_65 = __pyx_v_i;
              __pyx_t_66 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_65 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_66 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_65 = __pyx_v_i;
              __pyx_t_66 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_65 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_66 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_65 = __pyx_v_i;
              __pyx_t_66 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_65 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_66 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_65 = __pyx_v_i;
              __pyx_t_66 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_65 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_66 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_65 = __pyx_v_i;
              __pyx_t_66 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_65 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_66 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_65 = __pyx_v_i;
              __pyx_t_66 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_65 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_66 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_65 = __pyx_v_i;
              __pyx_t_66 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_65 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_66 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_65 = __pyx_v_i;
              __pyx_t_66 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_65 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_66 * __pyx_v_is_phased.strides[1]) )) = 1;

     0979:

    +0980:                 elif pac[a2] > 0 and mac[a2] == 0 and mac[a1] > 0:

            __pyx_t_67 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_67 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L28_bool_binop_done;
            }
            __pyx_t_68 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_68 * __pyx_v_mac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L28_bool_binop_done;
            }
            __pyx_t_69 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_69 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L28_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
            }
            __pyx_L18:;
          }
          __pyx_L12:;
          __pyx_L10_continue:;
        }
        __pyx_L3_continue:;
      }
    /* … */
            __pyx_t_67 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_67 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L28_bool_binop_done;
            }
            __pyx_t_68 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_68 * __pyx_v_mac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L28_bool_binop_done;
            }
            __pyx_t_69 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_69 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L28_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
            }
            __pyx_L18:;
          }
          __pyx_L12:;
          __pyx_L10_continue:;
        }
        __pyx_L3_continue:;
      }
    /* … */
            __pyx_t_67 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_67 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L28_bool_binop_done;
            }
            __pyx_t_68 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_68 * __pyx_v_mac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L28_bool_binop_done;
            }
            __pyx_t_69 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_69 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L28_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
            }
            __pyx_L18:;
          }
          __pyx_L12:;
          __pyx_L10_continue:;
        }
        __pyx_L3_continue:;
      }
    /* … */
            __pyx_t_67 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_67 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L28_bool_binop_done;
            }
            __pyx_t_68 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_68 * __pyx_v_mac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L28_bool_binop_done;
            }
            __pyx_t_69 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_69 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L28_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
            }
            __pyx_L18:;
          }
          __pyx_L12:;
          __pyx_L10_continue:;
        }
        __pyx_L3_continue:;
      }
    /* … */
            __pyx_t_67 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_67 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L28_bool_binop_done;
            }
            __pyx_t_68 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_68 * __pyx_v_mac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L28_bool_binop_done;
            }
            __pyx_t_69 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_69 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L28_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
            }
            __pyx_L18:;
          }
          __pyx_L12:;
          __pyx_L10_continue:;
        }
        __pyx_L3_continue:;
      }
    /* … */
            __pyx_t_67 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_67 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L28_bool_binop_done;
            }
            __pyx_t_68 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_68 * __pyx_v_mac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L28_bool_binop_done;
            }
            __pyx_t_69 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_69 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L28_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
            }
            __pyx_L18:;
          }
          __pyx_L12:;
          __pyx_L10_continue:;
        }
        __pyx_L3_continue:;
      }
    /* … */
            __pyx_t_67 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_67 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L28_bool_binop_done;
            }
            __pyx_t_68 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_68 * __pyx_v_mac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L28_bool_binop_done;
            }
            __pyx_t_69 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_69 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L28_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
            }
            __pyx_L18:;
          }
          __pyx_L12:;
          __pyx_L10_continue:;
        }
        __pyx_L3_continue:;
      }
    /* … */
            __pyx_t_67 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_pac.data + __pyx_t_67 * __pyx_v_pac.strides[0]) ))) > 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L28_bool_binop_done;
            }
            __pyx_t_68 = __pyx_v_a2;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_68 * __pyx_v_mac.strides[0]) ))) == 0) != 0);
            if (__pyx_t_23) {
            } else {
              __pyx_t_22 = __pyx_t_23;
              goto __pyx_L28_bool_binop_done;
            }
            __pyx_t_69 = __pyx_v_a1;
            __pyx_t_23 = (((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_mac.data + __pyx_t_69 * __pyx_v_mac.strides[0]) ))) > 0) != 0);
            __pyx_t_22 = __pyx_t_23;
            __pyx_L28_bool_binop_done:;
            if (__pyx_t_22) {
    /* … */
            }
            __pyx_L18:;
          }
          __pyx_L12:;
          __pyx_L10_continue:;
        }
        __pyx_L3_continue:;
      }

     0981:                     # allele 2 is unique to father, no need to swap

    +0982:                     is_phased[i, j] = 1

              __pyx_t_70 = __pyx_v_i;
              __pyx_t_71 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_70 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_71 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_70 = __pyx_v_i;
              __pyx_t_71 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_70 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_71 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_70 = __pyx_v_i;
              __pyx_t_71 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_70 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_71 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_70 = __pyx_v_i;
              __pyx_t_71 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_70 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_71 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_70 = __pyx_v_i;
              __pyx_t_71 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_70 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_71 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_70 = __pyx_v_i;
              __pyx_t_71 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_70 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_71 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_70 = __pyx_v_i;
              __pyx_t_71 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_70 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_71 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_70 = __pyx_v_i;
              __pyx_t_71 = __pyx_v_j;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_70 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_71 * __pyx_v_is_phased.strides[1]) )) = 1;

     0983:

    +0984:     return is_phased

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_is_phased, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_is_phased, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_is_phased, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_is_phased, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_is_phased, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_is_phased, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_is_phased, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    /* … */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_is_phased, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

     0985:

     0986:

     0987: @cython.boundscheck(False)

     0988: @cython.wraparound(False)

    +0989: def phase_parents_by_transmission(integer[:, :, :] g,

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_35phase_parents_by_transmission(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_mdef_5allel_3opt_5stats_35phase_parents_by_transmission = {"phase_parents_by_transmission", (PyCFunction)__pyx_pw_5allel_3opt_5stats_35phase_parents_by_transmission, METH_VARARGS|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_5allel_3opt_5stats_35phase_parents_by_transmission(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_signatures = 0;
      PyObject *__pyx_v_args = 0;
      PyObject *__pyx_v_kwargs = 0;
      CYTHON_UNUSED PyObject *__pyx_v_defaults = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0};
        PyObject* values[4] = {0,0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 989, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 989, __pyx_L3_error)
            }
            case  3:
            if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 989, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 989, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        }
        __pyx_v_signatures = values[0];
        __pyx_v_args = values[1];
        __pyx_v_kwargs = values[2];
        __pyx_v_defaults = values[3];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 989, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_34phase_parents_by_transmission(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_34phase_parents_by_transmission(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
      PyObject *__pyx_v_dest_sig = NULL;
      PyTypeObject *__pyx_v_ndarray = 0;
      PyObject *__pyx_v_numpy = NULL;
      __Pyx_memviewslice __pyx_v_memslice;
      Py_ssize_t __pyx_v_itemsize;
      int __pyx_v_dtype_signed;
      char __pyx_v_kind;
      int __pyx_v____pyx_uint8_t_is_signed;
      int __pyx_v____pyx_int64_t_is_signed;
      int __pyx_v____pyx_uint64_t_is_signed;
      int __pyx_v____pyx_int8_t_is_signed;
      int __pyx_v____pyx_int32_t_is_signed;
      int __pyx_v____pyx_uint32_t_is_signed;
      int __pyx_v____pyx_uint16_t_is_signed;
      int __pyx_v____pyx_int16_t_is_signed;
      PyObject *__pyx_v_arg = NULL;
      PyObject *__pyx_v_dtype = NULL;
      PyObject *__pyx_v_arg_base = NULL;
      PyObject *__pyx_v_candidates = NULL;
      PyObject *__pyx_v_sig = NULL;
      int __pyx_v_match_found;
      PyObject *__pyx_v_src_type = NULL;
      PyObject *__pyx_v_dst_type = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("phase_parents_by_transmission", 0);
      __Pyx_TraceCall("phase_parents_by_transmission", __pyx_f[0], 989, 0, __PYX_ERR(0, 989, __pyx_L1_error));
      __Pyx_INCREF(__pyx_v_kwargs);
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
      __pyx_v_dest_sig = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_2 = (__pyx_v_kwargs == Py_None);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {
        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1);
        __pyx_t_1 = 0;
      }
      {
        /*try:*/ {
          __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_v_numpy = __pyx_t_1;
          __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 989, __pyx_L4_error)
          __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1);
          __pyx_t_1 = 0;
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L11_try_end;
        __pyx_L4_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
        if (__pyx_t_7) {
          __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 989, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_INCREF(Py_None);
          __Pyx_XDECREF_SET(__pyx_v_ndarray, ((PyTypeObject*)Py_None));
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L5_exception_handled;
        }
        goto __pyx_L6_except_error;
        __pyx_L6_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L1_error;
        __pyx_L5_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        __pyx_L11_try_end:;
      }
      __pyx_v_itemsize = -1L;
      __pyx_v____pyx_uint8_t_is_signed = (((__pyx_t_5numpy_uint8_t)-1L) < 0);
      __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1L) < 0);
      __pyx_v____pyx_uint64_t_is_signed = (((__pyx_t_5numpy_uint64_t)-1L) < 0);
      __pyx_v____pyx_int8_t_is_signed = (((__pyx_t_5numpy_int8_t)-1L) < 0);
      __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1L) < 0);
      __pyx_v____pyx_uint32_t_is_signed = (((__pyx_t_5numpy_uint32_t)-1L) < 0);
      __pyx_v____pyx_uint16_t_is_signed = (((__pyx_t_5numpy_uint16_t)-1L) < 0);
      __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1L) < 0);
      if (unlikely(__pyx_v_args == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 989, __pyx_L1_error)
      }
      __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 989, __pyx_L1_error)
      __pyx_t_3 = ((0 < __pyx_t_10) != 0);
      if (__pyx_t_3) {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 989, __pyx_L1_error)
        }
        __pyx_t_9 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      if (unlikely(__pyx_v_kwargs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 989, __pyx_L1_error)
      }
      __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_g, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {
        if (unlikely(__pyx_v_kwargs == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 989, __pyx_L1_error)
        }
        __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_g); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      /*else*/ {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(0, 989, __pyx_L1_error)
        }
        __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 989, __pyx_L1_error)
        __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 989, __pyx_L1_error)
      }
      __pyx_L14:;
      while (1) {
        __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None));
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {
          __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_dtype = __pyx_t_8;
            __pyx_t_8 = 0;
            goto __pyx_L18;
          }
          __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_arg_base = __pyx_t_8;
            __pyx_t_8 = 0;
            __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
            __pyx_t_2 = (__pyx_t_3 != 0);
            if (__pyx_t_2) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_v_dtype = __pyx_t_8;
              __pyx_t_8 = 0;
              goto __pyx_L19;
            }
            /*else*/ {
              __Pyx_INCREF(Py_None);
              __pyx_v_dtype = Py_None;
            }
            __pyx_L19:;
            goto __pyx_L18;
          }
          /*else*/ {
            __Pyx_INCREF(Py_None);
            __pyx_v_dtype = Py_None;
          }
          __pyx_L18:;
          __pyx_v_itemsize = -1L;
          __pyx_t_2 = (__pyx_v_dtype != Py_None);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 989, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_itemsize = __pyx_t_10;
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 989, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_kind = __pyx_t_11;
            __pyx_v_dtype_signed = (__pyx_v_kind == 'i');
            switch (__pyx_v_kind) {
              case 'i':
              case 'u':
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 989, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 3) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L22_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 989, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 3) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L26_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 989, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 3) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L30_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 989, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 3) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L34_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 989, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 3) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L38_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 989, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 3) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L42_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 989, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 3) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L46_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 989, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 3) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L50_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              break;
              case 'f':
              break;
              case 'c':
              break;
              case 'O':
              break;
              default: break;
            }
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L54_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L54_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L58_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L58_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L62_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L62_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L66_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L66_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L70_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L70_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L74_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L74_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L78_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L78_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L82_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L82_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
        goto __pyx_L16_break;
      }
      __pyx_L16_break:;
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_candidates = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_10 = 0;
      if (unlikely(__pyx_v_signatures == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 989, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8);
      __pyx_t_8 = __pyx_t_9;
      __pyx_t_9 = 0;
      while (1) {
        __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_13, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7);
        if (unlikely(__pyx_t_14 == 0)) break;
        if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_v_match_found = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /* … */
      __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__60);
      __Pyx_GIVEREF(__pyx_tuple__60);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
        __Pyx_INCREF(__pyx_v_dest_sig);
        __Pyx_GIVEREF(__pyx_v_dest_sig);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dest_sig);
        __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
          __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_15 = 0;
          __pyx_t_16 = NULL;
        } else {
          __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 989, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 989, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        for (;;) {
          if (likely(!__pyx_t_16)) {
            if (likely(PyList_CheckExact(__pyx_t_9))) {
              if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            } else {
              if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            }
          } else {
            __pyx_t_1 = __pyx_t_16(__pyx_t_9);
            if (unlikely(!__pyx_t_1)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 989, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_1);
          }
          if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
            PyObject* sequence = __pyx_t_1;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 989, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1);
            } else {
              __pyx_t_17 = PyList_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyList_GET_ITEM(sequence, 1);
            }
            __Pyx_INCREF(__pyx_t_17);
            __Pyx_INCREF(__pyx_t_18);
            #else
            __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 989, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 989, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_18);
            #endif
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 989, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
            index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_17);
            index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_18);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) __PYX_ERR(0, 989, __pyx_L1_error)
            __pyx_t_20 = NULL;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            goto __pyx_L90_unpacking_done;
            __pyx_L89_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __pyx_t_20 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 989, __pyx_L1_error)
            __pyx_L90_unpacking_done:;
          }
          __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17);
          __pyx_t_17 = 0;
          __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18);
          __pyx_t_18 = 0;
          __pyx_t_3 = (__pyx_v_dst_type != Py_None);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L1_error)
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (__pyx_t_2) {
              __pyx_v_match_found = 1;
              goto __pyx_L92;
            }
            /*else*/ {
              __pyx_v_match_found = 0;
              goto __pyx_L88_break;
            }
            __pyx_L92:;
          }
        }
        __pyx_L88_break:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_2 = (__pyx_v_match_found != 0);
        if (__pyx_t_2) {
          __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 989, __pyx_L1_error)
        }
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
      __pyx_t_3 = ((!__pyx_t_2) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s__8); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__61);
      __Pyx_GIVEREF(__pyx_tuple__61);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 989, __pyx_L1_error)
      }
      __pyx_t_13 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 989, __pyx_L1_error)
      __pyx_t_3 = ((__pyx_t_13 > 1) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__62);
      __Pyx_GIVEREF(__pyx_tuple__62);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 989, __pyx_L1_error)
      }
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_signatures == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 989, __pyx_L1_error)
        }
        __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        goto __pyx_L0;
      }

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_dest_sig);
      __Pyx_XDECREF(__pyx_v_ndarray);
      __Pyx_XDECREF(__pyx_v_numpy);
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XDECREF(__pyx_v_dtype);
      __Pyx_XDECREF(__pyx_v_arg_base);
      __Pyx_XDECREF(__pyx_v_candidates);
      __Pyx_XDECREF(__pyx_v_sig);
      __Pyx_XDECREF(__pyx_v_src_type);
      __Pyx_XDECREF(__pyx_v_dst_type);
      __Pyx_XDECREF(__pyx_v_kwargs);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_255phase_parents_by_transmission(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_255phase_parents_by_transmission = {"__pyx_fuse_0phase_parents_by_transmission", (PyCFunction)__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_255phase_parents_by_transmission, METH_VARARGS|METH_KEYWORDS, 0};
    static PyObject *__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_255phase_parents_by_transmission(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_g = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_is_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      Py_ssize_t __pyx_v_window_size;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("phase_parents_by_transmission (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_is_phased,&__pyx_n_s_window_size,0};
        PyObject* values[3] = {0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_is_phased)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, 1); __PYX_ERR(0, 989, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_window_size)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, 2); __PYX_ERR(0, 989, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "phase_parents_by_transmission") < 0)) __PYX_ERR(0, 989, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        }
        __pyx_v_g = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_g.memview)) __PYX_ERR(0, 989, __pyx_L3_error)
        __pyx_v_is_phased = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[1]); if (unlikely(!__pyx_v_is_phased.memview)) __PYX_ERR(0, 990, __pyx_L3_error)
        __pyx_v_window_size = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_window_size == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 989, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.phase_parents_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_254phase_parents_by_transmission(__pyx_self, __pyx_v_g, __pyx_v_is_phased, __pyx_v_window_size);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_254phase_parents_by_transmission(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_g, __Pyx_memviewslice __pyx_v_is_phased, Py_ssize_t __pyx_v_window_size) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_parent;
      Py_ssize_t __pyx_v_ii;
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_samples;
      Py_ssize_t __pyx_v_keep;
      Py_ssize_t __pyx_v_flip;
      Py_ssize_t __pyx_v_n_inf;
      __pyx_t_5numpy_int8_t __pyx_v_a1;
      __pyx_t_5numpy_int8_t __pyx_v_a2;
      __pyx_t_5numpy_int8_t __pyx_v_max_allele;
      __pyx_t_5numpy_int8_t __pyx_v_pa1;
      __pyx_t_5numpy_int8_t __pyx_v_pa2;
      __pyx_t_5numpy_int8_t __pyx_v_x;
      __pyx_t_5numpy_int8_t __pyx_v_y;
      __Pyx_memviewslice __pyx_v_n_progeny_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_linkage = { 0, 0, { 0 }, { 0 }, { 0 } };
      Py_ssize_t __pyx_v_j;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_0phase_parents_by_transmission", 0);
      __Pyx_TraceCall("__pyx_fuse_0phase_parents_by_transmission", __pyx_f[0], 989, 0, __PYX_ERR(0, 989, __pyx_L1_error));
      __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__63);
      __Pyx_GIVEREF(__pyx_tuple__63);
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __Pyx_AddTraceback("allel.opt.stats.phase_parents_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_n_progeny_phased, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_linkage, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_g, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_phased, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_257phase_parents_by_transmission(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_257phase_parents_by_transmission = {"__pyx_fuse_1phase_parents_by_transmission", (PyCFunction)__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_257phase_parents_by_transmission, METH_VARARGS|METH_KEYWORDS, 0};
    static PyObject *__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_257phase_parents_by_transmission(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_g = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_is_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      Py_ssize_t __pyx_v_window_size;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("phase_parents_by_transmission (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_is_phased,&__pyx_n_s_window_size,0};
        PyObject* values[3] = {0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_is_phased)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, 1); __PYX_ERR(0, 989, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_window_size)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, 2); __PYX_ERR(0, 989, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "phase_parents_by_transmission") < 0)) __PYX_ERR(0, 989, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        }
        __pyx_v_g = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_g.memview)) __PYX_ERR(0, 989, __pyx_L3_error)
        __pyx_v_is_phased = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[1]); if (unlikely(!__pyx_v_is_phased.memview)) __PYX_ERR(0, 990, __pyx_L3_error)
        __pyx_v_window_size = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_window_size == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 989, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.phase_parents_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_256phase_parents_by_transmission(__pyx_self, __pyx_v_g, __pyx_v_is_phased, __pyx_v_window_size);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_256phase_parents_by_transmission(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_g, __Pyx_memviewslice __pyx_v_is_phased, Py_ssize_t __pyx_v_window_size) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_parent;
      Py_ssize_t __pyx_v_ii;
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_samples;
      Py_ssize_t __pyx_v_keep;
      Py_ssize_t __pyx_v_flip;
      Py_ssize_t __pyx_v_n_inf;
      __pyx_t_5numpy_int16_t __pyx_v_a1;
      __pyx_t_5numpy_int16_t __pyx_v_a2;
      __pyx_t_5numpy_int16_t __pyx_v_max_allele;
      __pyx_t_5numpy_int16_t __pyx_v_pa1;
      __pyx_t_5numpy_int16_t __pyx_v_pa2;
      __pyx_t_5numpy_int16_t __pyx_v_x;
      __pyx_t_5numpy_int16_t __pyx_v_y;
      __Pyx_memviewslice __pyx_v_n_progeny_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_linkage = { 0, 0, { 0 }, { 0 }, { 0 } };
      Py_ssize_t __pyx_v_j;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_1phase_parents_by_transmission", 0);
      __Pyx_TraceCall("__pyx_fuse_1phase_parents_by_transmission", __pyx_f[0], 989, 0, __PYX_ERR(0, 989, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __Pyx_AddTraceback("allel.opt.stats.phase_parents_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_n_progeny_phased, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_linkage, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_g, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_phased, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_259phase_parents_by_transmission(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_259phase_parents_by_transmission = {"__pyx_fuse_2phase_parents_by_transmission", (PyCFunction)__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_259phase_parents_by_transmission, METH_VARARGS|METH_KEYWORDS, 0};
    static PyObject *__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_259phase_parents_by_transmission(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_g = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_is_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      Py_ssize_t __pyx_v_window_size;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("phase_parents_by_transmission (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_is_phased,&__pyx_n_s_window_size,0};
        PyObject* values[3] = {0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_is_phased)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, 1); __PYX_ERR(0, 989, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_window_size)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, 2); __PYX_ERR(0, 989, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "phase_parents_by_transmission") < 0)) __PYX_ERR(0, 989, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        }
        __pyx_v_g = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_g.memview)) __PYX_ERR(0, 989, __pyx_L3_error)
        __pyx_v_is_phased = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[1]); if (unlikely(!__pyx_v_is_phased.memview)) __PYX_ERR(0, 990, __pyx_L3_error)
        __pyx_v_window_size = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_window_size == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 989, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.phase_parents_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_258phase_parents_by_transmission(__pyx_self, __pyx_v_g, __pyx_v_is_phased, __pyx_v_window_size);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_258phase_parents_by_transmission(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_g, __Pyx_memviewslice __pyx_v_is_phased, Py_ssize_t __pyx_v_window_size) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_parent;
      Py_ssize_t __pyx_v_ii;
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_samples;
      Py_ssize_t __pyx_v_keep;
      Py_ssize_t __pyx_v_flip;
      Py_ssize_t __pyx_v_n_inf;
      __pyx_t_5numpy_int32_t __pyx_v_a1;
      __pyx_t_5numpy_int32_t __pyx_v_a2;
      __pyx_t_5numpy_int32_t __pyx_v_max_allele;
      __pyx_t_5numpy_int32_t __pyx_v_pa1;
      __pyx_t_5numpy_int32_t __pyx_v_pa2;
      __pyx_t_5numpy_int32_t __pyx_v_x;
      __pyx_t_5numpy_int32_t __pyx_v_y;
      __Pyx_memviewslice __pyx_v_n_progeny_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_linkage = { 0, 0, { 0 }, { 0 }, { 0 } };
      Py_ssize_t __pyx_v_j;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_2phase_parents_by_transmission", 0);
      __Pyx_TraceCall("__pyx_fuse_2phase_parents_by_transmission", __pyx_f[0], 989, 0, __PYX_ERR(0, 989, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __Pyx_AddTraceback("allel.opt.stats.phase_parents_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_n_progeny_phased, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_linkage, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_g, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_phased, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_261phase_parents_by_transmission(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_261phase_parents_by_transmission = {"__pyx_fuse_3phase_parents_by_transmission", (PyCFunction)__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_261phase_parents_by_transmission, METH_VARARGS|METH_KEYWORDS, 0};
    static PyObject *__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_261phase_parents_by_transmission(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_g = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_is_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      Py_ssize_t __pyx_v_window_size;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("phase_parents_by_transmission (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_is_phased,&__pyx_n_s_window_size,0};
        PyObject* values[3] = {0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_is_phased)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, 1); __PYX_ERR(0, 989, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_window_size)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, 2); __PYX_ERR(0, 989, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "phase_parents_by_transmission") < 0)) __PYX_ERR(0, 989, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        }
        __pyx_v_g = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_g.memview)) __PYX_ERR(0, 989, __pyx_L3_error)
        __pyx_v_is_phased = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[1]); if (unlikely(!__pyx_v_is_phased.memview)) __PYX_ERR(0, 990, __pyx_L3_error)
        __pyx_v_window_size = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_window_size == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 989, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.phase_parents_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_260phase_parents_by_transmission(__pyx_self, __pyx_v_g, __pyx_v_is_phased, __pyx_v_window_size);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_260phase_parents_by_transmission(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_g, __Pyx_memviewslice __pyx_v_is_phased, Py_ssize_t __pyx_v_window_size) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_parent;
      Py_ssize_t __pyx_v_ii;
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_samples;
      Py_ssize_t __pyx_v_keep;
      Py_ssize_t __pyx_v_flip;
      Py_ssize_t __pyx_v_n_inf;
      __pyx_t_5numpy_int64_t __pyx_v_a1;
      __pyx_t_5numpy_int64_t __pyx_v_a2;
      __pyx_t_5numpy_int64_t __pyx_v_max_allele;
      __pyx_t_5numpy_int64_t __pyx_v_pa1;
      __pyx_t_5numpy_int64_t __pyx_v_pa2;
      __pyx_t_5numpy_int64_t __pyx_v_x;
      __pyx_t_5numpy_int64_t __pyx_v_y;
      __Pyx_memviewslice __pyx_v_n_progeny_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_linkage = { 0, 0, { 0 }, { 0 }, { 0 } };
      Py_ssize_t __pyx_v_j;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_3phase_parents_by_transmission", 0);
      __Pyx_TraceCall("__pyx_fuse_3phase_parents_by_transmission", __pyx_f[0], 989, 0, __PYX_ERR(0, 989, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __Pyx_AddTraceback("allel.opt.stats.phase_parents_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_n_progeny_phased, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_linkage, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_g, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_phased, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_263phase_parents_by_transmission(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_263phase_parents_by_transmission = {"__pyx_fuse_4phase_parents_by_transmission", (PyCFunction)__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_263phase_parents_by_transmission, METH_VARARGS|METH_KEYWORDS, 0};
    static PyObject *__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_263phase_parents_by_transmission(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_g = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_is_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      Py_ssize_t __pyx_v_window_size;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("phase_parents_by_transmission (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_is_phased,&__pyx_n_s_window_size,0};
        PyObject* values[3] = {0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_is_phased)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, 1); __PYX_ERR(0, 989, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_window_size)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, 2); __PYX_ERR(0, 989, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "phase_parents_by_transmission") < 0)) __PYX_ERR(0, 989, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        }
        __pyx_v_g = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_g.memview)) __PYX_ERR(0, 989, __pyx_L3_error)
        __pyx_v_is_phased = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[1]); if (unlikely(!__pyx_v_is_phased.memview)) __PYX_ERR(0, 990, __pyx_L3_error)
        __pyx_v_window_size = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_window_size == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 989, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.phase_parents_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_262phase_parents_by_transmission(__pyx_self, __pyx_v_g, __pyx_v_is_phased, __pyx_v_window_size);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_262phase_parents_by_transmission(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_g, __Pyx_memviewslice __pyx_v_is_phased, Py_ssize_t __pyx_v_window_size) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_parent;
      Py_ssize_t __pyx_v_ii;
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_samples;
      Py_ssize_t __pyx_v_keep;
      Py_ssize_t __pyx_v_flip;
      Py_ssize_t __pyx_v_n_inf;
      __pyx_t_5numpy_uint8_t __pyx_v_a1;
      __pyx_t_5numpy_uint8_t __pyx_v_a2;
      __pyx_t_5numpy_uint8_t __pyx_v_max_allele;
      __pyx_t_5numpy_uint8_t __pyx_v_pa1;
      __pyx_t_5numpy_uint8_t __pyx_v_pa2;
      __pyx_t_5numpy_uint8_t __pyx_v_x;
      __pyx_t_5numpy_uint8_t __pyx_v_y;
      __Pyx_memviewslice __pyx_v_n_progeny_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_linkage = { 0, 0, { 0 }, { 0 }, { 0 } };
      Py_ssize_t __pyx_v_j;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_4phase_parents_by_transmission", 0);
      __Pyx_TraceCall("__pyx_fuse_4phase_parents_by_transmission", __pyx_f[0], 989, 0, __PYX_ERR(0, 989, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __Pyx_AddTraceback("allel.opt.stats.phase_parents_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_n_progeny_phased, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_linkage, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_g, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_phased, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_265phase_parents_by_transmission(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_265phase_parents_by_transmission = {"__pyx_fuse_5phase_parents_by_transmission", (PyCFunction)__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_265phase_parents_by_transmission, METH_VARARGS|METH_KEYWORDS, 0};
    static PyObject *__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_265phase_parents_by_transmission(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_g = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_is_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      Py_ssize_t __pyx_v_window_size;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("phase_parents_by_transmission (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_is_phased,&__pyx_n_s_window_size,0};
        PyObject* values[3] = {0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_is_phased)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, 1); __PYX_ERR(0, 989, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_window_size)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, 2); __PYX_ERR(0, 989, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "phase_parents_by_transmission") < 0)) __PYX_ERR(0, 989, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        }
        __pyx_v_g = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint16_t(values[0]); if (unlikely(!__pyx_v_g.memview)) __PYX_ERR(0, 989, __pyx_L3_error)
        __pyx_v_is_phased = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[1]); if (unlikely(!__pyx_v_is_phased.memview)) __PYX_ERR(0, 990, __pyx_L3_error)
        __pyx_v_window_size = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_window_size == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 989, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.phase_parents_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_264phase_parents_by_transmission(__pyx_self, __pyx_v_g, __pyx_v_is_phased, __pyx_v_window_size);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_264phase_parents_by_transmission(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_g, __Pyx_memviewslice __pyx_v_is_phased, Py_ssize_t __pyx_v_window_size) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_parent;
      Py_ssize_t __pyx_v_ii;
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_samples;
      Py_ssize_t __pyx_v_keep;
      Py_ssize_t __pyx_v_flip;
      Py_ssize_t __pyx_v_n_inf;
      __pyx_t_5numpy_uint16_t __pyx_v_a1;
      __pyx_t_5numpy_uint16_t __pyx_v_a2;
      __pyx_t_5numpy_uint16_t __pyx_v_max_allele;
      __pyx_t_5numpy_uint16_t __pyx_v_pa1;
      __pyx_t_5numpy_uint16_t __pyx_v_pa2;
      __pyx_t_5numpy_uint16_t __pyx_v_x;
      __pyx_t_5numpy_uint16_t __pyx_v_y;
      __Pyx_memviewslice __pyx_v_n_progeny_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_linkage = { 0, 0, { 0 }, { 0 }, { 0 } };
      Py_ssize_t __pyx_v_j;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_5phase_parents_by_transmission", 0);
      __Pyx_TraceCall("__pyx_fuse_5phase_parents_by_transmission", __pyx_f[0], 989, 0, __PYX_ERR(0, 989, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __Pyx_AddTraceback("allel.opt.stats.phase_parents_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_n_progeny_phased, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_linkage, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_g, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_phased, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_267phase_parents_by_transmission(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_267phase_parents_by_transmission = {"__pyx_fuse_6phase_parents_by_transmission", (PyCFunction)__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_267phase_parents_by_transmission, METH_VARARGS|METH_KEYWORDS, 0};
    static PyObject *__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_267phase_parents_by_transmission(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_g = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_is_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      Py_ssize_t __pyx_v_window_size;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("phase_parents_by_transmission (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_is_phased,&__pyx_n_s_window_size,0};
        PyObject* values[3] = {0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_is_phased)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, 1); __PYX_ERR(0, 989, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_window_size)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, 2); __PYX_ERR(0, 989, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "phase_parents_by_transmission") < 0)) __PYX_ERR(0, 989, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        }
        __pyx_v_g = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint32_t(values[0]); if (unlikely(!__pyx_v_g.memview)) __PYX_ERR(0, 989, __pyx_L3_error)
        __pyx_v_is_phased = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[1]); if (unlikely(!__pyx_v_is_phased.memview)) __PYX_ERR(0, 990, __pyx_L3_error)
        __pyx_v_window_size = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_window_size == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 989, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.phase_parents_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_266phase_parents_by_transmission(__pyx_self, __pyx_v_g, __pyx_v_is_phased, __pyx_v_window_size);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_266phase_parents_by_transmission(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_g, __Pyx_memviewslice __pyx_v_is_phased, Py_ssize_t __pyx_v_window_size) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_parent;
      Py_ssize_t __pyx_v_ii;
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_samples;
      Py_ssize_t __pyx_v_keep;
      Py_ssize_t __pyx_v_flip;
      Py_ssize_t __pyx_v_n_inf;
      __pyx_t_5numpy_uint32_t __pyx_v_a1;
      __pyx_t_5numpy_uint32_t __pyx_v_a2;
      __pyx_t_5numpy_uint32_t __pyx_v_max_allele;
      __pyx_t_5numpy_uint32_t __pyx_v_pa1;
      __pyx_t_5numpy_uint32_t __pyx_v_pa2;
      __pyx_t_5numpy_uint32_t __pyx_v_x;
      __pyx_t_5numpy_uint32_t __pyx_v_y;
      __Pyx_memviewslice __pyx_v_n_progeny_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_linkage = { 0, 0, { 0 }, { 0 }, { 0 } };
      Py_ssize_t __pyx_v_j;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_6phase_parents_by_transmission", 0);
      __Pyx_TraceCall("__pyx_fuse_6phase_parents_by_transmission", __pyx_f[0], 989, 0, __PYX_ERR(0, 989, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __Pyx_AddTraceback("allel.opt.stats.phase_parents_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_n_progeny_phased, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_linkage, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_g, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_phased, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_269phase_parents_by_transmission(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_269phase_parents_by_transmission = {"__pyx_fuse_7phase_parents_by_transmission", (PyCFunction)__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_269phase_parents_by_transmission, METH_VARARGS|METH_KEYWORDS, 0};
    static PyObject *__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_269phase_parents_by_transmission(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_g = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_is_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      Py_ssize_t __pyx_v_window_size;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("phase_parents_by_transmission (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_is_phased,&__pyx_n_s_window_size,0};
        PyObject* values[3] = {0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_is_phased)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, 1); __PYX_ERR(0, 989, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_window_size)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, 2); __PYX_ERR(0, 989, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "phase_parents_by_transmission") < 0)) __PYX_ERR(0, 989, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        }
        __pyx_v_g = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_5numpy_uint64_t(values[0]); if (unlikely(!__pyx_v_g.memview)) __PYX_ERR(0, 989, __pyx_L3_error)
        __pyx_v_is_phased = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint8_t(values[1]); if (unlikely(!__pyx_v_is_phased.memview)) __PYX_ERR(0, 990, __pyx_L3_error)
        __pyx_v_window_size = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_window_size == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L3_error)
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("phase_parents_by_transmission", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 989, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.phase_parents_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_268phase_parents_by_transmission(__pyx_self, __pyx_v_g, __pyx_v_is_phased, __pyx_v_window_size);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_268phase_parents_by_transmission(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_g, __Pyx_memviewslice __pyx_v_is_phased, Py_ssize_t __pyx_v_window_size) {
      Py_ssize_t __pyx_v_i;
      Py_ssize_t __pyx_v_parent;
      Py_ssize_t __pyx_v_ii;
      Py_ssize_t __pyx_v_n_variants;
      Py_ssize_t __pyx_v_n_samples;
      Py_ssize_t __pyx_v_keep;
      Py_ssize_t __pyx_v_flip;
      Py_ssize_t __pyx_v_n_inf;
      __pyx_t_5numpy_uint64_t __pyx_v_a1;
      __pyx_t_5numpy_uint64_t __pyx_v_a2;
      __pyx_t_5numpy_uint64_t __pyx_v_max_allele;
      __pyx_t_5numpy_uint64_t __pyx_v_pa1;
      __pyx_t_5numpy_uint64_t __pyx_v_pa2;
      __pyx_t_5numpy_uint64_t __pyx_v_x;
      __pyx_t_5numpy_uint64_t __pyx_v_y;
      __Pyx_memviewslice __pyx_v_n_progeny_phased = { 0, 0, { 0 }, { 0 }, { 0 } };
      __Pyx_memviewslice __pyx_v_linkage = { 0, 0, { 0 }, { 0 }, { 0 } };
      Py_ssize_t __pyx_v_j;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_7phase_parents_by_transmission", 0);
      __Pyx_TraceCall("__pyx_fuse_7phase_parents_by_transmission", __pyx_f[0], 989, 0, __PYX_ERR(0, 989, __pyx_L1_error));
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
      __Pyx_AddTraceback("allel.opt.stats.phase_parents_by_transmission", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __PYX_XDEC_MEMVIEW(&__pyx_v_n_progeny_phased, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_linkage, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_g, 1);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_phased, 1);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__133 = PyTuple_Pack(22, __pyx_n_s_g, __pyx_n_s_is_phased, __pyx_n_s_window_size, __pyx_n_s_i, __pyx_n_s_parent, __pyx_n_s_ii, __pyx_n_s_n_variants, __pyx_n_s_n_samples, __pyx_n_s_keep, __pyx_n_s_flip, __pyx_n_s_n_inf, __pyx_n_s_a1, __pyx_n_s_a2, __pyx_n_s_max_allele, __pyx_n_s_pa1, __pyx_n_s_pa2, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_block_start, __pyx_n_s_n_progeny_phased, __pyx_n_s_linkage, __pyx_n_s_j); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__133);
      __Pyx_GIVEREF(__pyx_tuple__133);
    /* … */
      __pyx_t_29 = PyDict_New(); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      __pyx_t_30 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_255phase_parents_by_transmission, 0, __pyx_n_s_phase_parents_by_transmission, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_30, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_29, __pyx_n_s_int8_t, __pyx_t_30) < 0) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
      __pyx_t_30 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_257phase_parents_by_transmission, 0, __pyx_n_s_phase_parents_by_transmission, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_30, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_29, __pyx_n_s_int16_t, __pyx_t_30) < 0) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
      __pyx_t_30 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_259phase_parents_by_transmission, 0, __pyx_n_s_phase_parents_by_transmission, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_30, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_29, __pyx_n_s_int32_t, __pyx_t_30) < 0) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
      __pyx_t_30 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_261phase_parents_by_transmission, 0, __pyx_n_s_phase_parents_by_transmission, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_30, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_29, __pyx_n_s_int64_t, __pyx_t_30) < 0) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
      __pyx_t_30 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_263phase_parents_by_transmission, 0, __pyx_n_s_phase_parents_by_transmission, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_30, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_29, __pyx_n_s_uint8_t, __pyx_t_30) < 0) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
      __pyx_t_30 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_265phase_parents_by_transmission, 0, __pyx_n_s_phase_parents_by_transmission, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_30, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_29, __pyx_n_s_uint16_t, __pyx_t_30) < 0) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
      __pyx_t_30 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_267phase_parents_by_transmission, 0, __pyx_n_s_phase_parents_by_transmission, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_30, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_29, __pyx_n_s_uint32_t, __pyx_t_30) < 0) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
      __pyx_t_30 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_269phase_parents_by_transmission, 0, __pyx_n_s_phase_parents_by_transmission, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_30, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_29, __pyx_n_s_uint64_t, __pyx_t_30) < 0) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
      __pyx_t_30 = __pyx_FusedFunction_NewEx(&__pyx_mdef_5allel_3opt_5stats_35phase_parents_by_transmission, 0, __pyx_n_s_phase_parents_by_transmission, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_30, __pyx_empty_tuple);
      ((__pyx_FusedFunctionObject *) __pyx_t_30)->__signatures__ = __pyx_t_29;
      __Pyx_GIVEREF(__pyx_t_29);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_phase_parents_by_transmission, __pyx_t_30) < 0) __PYX_ERR(0, 989, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
      __pyx_codeobj__134 = (PyObject*)__Pyx_PyCode_New(3, 0, 22, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aliman_src_github_cggh_sci, __pyx_n_s_phase_parents_by_transmission, 989, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__134)) __PYX_ERR(0, 989, __pyx_L1_error)

     0990:                                   cnp.uint8_t[:, :] is_phased,

     0991:                                   Py_ssize_t window_size):

     0992:     # N.B., here we will modify g and is_phased in-place

     0993:

     0994:     cdef:

     0995:         Py_ssize_t i, parent, ii, n_variants, n_samples, keep, flip, n_inf

     0996:         integer a1, a2, max_allele, pa1, pa2, x, y

     0997:         cnp.uint32_t[:] block_start

     0998:         cnp.uint32_t[:] n_progeny_phased

     0999:         cnp.uint32_t[:, :] linkage

     1000:

     1001:     # guard conditions

    +1002:     assert g.shape[2] == 2

      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[2]) == 2) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1002, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[2]) == 2) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1002, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[2]) == 2) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1002, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[2]) == 2) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1002, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[2]) == 2) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1002, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[2]) == 2) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1002, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[2]) == 2) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1002, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[2]) == 2) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1002, __pyx_L1_error)
        }
      }
      #endif

    +1003:     assert g.shape[0] == is_phased.shape[0]

      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[0]) == (__pyx_v_is_phased.shape[0])) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1003, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[0]) == (__pyx_v_is_phased.shape[0])) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1003, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[0]) == (__pyx_v_is_phased.shape[0])) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1003, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[0]) == (__pyx_v_is_phased.shape[0])) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1003, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[0]) == (__pyx_v_is_phased.shape[0])) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1003, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[0]) == (__pyx_v_is_phased.shape[0])) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1003, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[0]) == (__pyx_v_is_phased.shape[0])) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1003, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[0]) == (__pyx_v_is_phased.shape[0])) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1003, __pyx_L1_error)
        }
      }
      #endif

    +1004:     assert g.shape[1] == is_phased.shape[1]

      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[1]) == (__pyx_v_is_phased.shape[1])) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1004, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[1]) == (__pyx_v_is_phased.shape[1])) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1004, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[1]) == (__pyx_v_is_phased.shape[1])) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1004, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[1]) == (__pyx_v_is_phased.shape[1])) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1004, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[1]) == (__pyx_v_is_phased.shape[1])) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1004, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[1]) == (__pyx_v_is_phased.shape[1])) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1004, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[1]) == (__pyx_v_is_phased.shape[1])) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1004, __pyx_L1_error)
        }
      }
      #endif
    /* … */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(!Py_OptimizeFlag)) {
        if (unlikely(!(((__pyx_v_g.shape[1]) == (__pyx_v_is_phased.shape[1])) != 0))) {
          PyErr_SetNone(PyExc_AssertionError);
          __PYX_ERR(0, 1004, __pyx_L1_error)
        }
      }
      #endif

     1005:

     1006:     # setup intermediates

    +1007:     n_variants = g.shape[0]

      __pyx_v_n_variants = (__pyx_v_g.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_g.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_g.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_g.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_g.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_g.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_g.shape[0]);
    /* … */
      __pyx_v_n_variants = (__pyx_v_g.shape[0]);

    +1008:     n_samples = g.shape[1]

      __pyx_v_n_samples = (__pyx_v_g.shape[1]);
    /* … */
      __pyx_v_n_samples = (__pyx_v_g.shape[1]);
    /* … */
      __pyx_v_n_samples = (__pyx_v_g.shape[1]);
    /* … */
      __pyx_v_n_samples = (__pyx_v_g.shape[1]);
    /* … */
      __pyx_v_n_samples = (__pyx_v_g.shape[1]);
    /* … */
      __pyx_v_n_samples = (__pyx_v_g.shape[1]);
    /* … */
      __pyx_v_n_samples = (__pyx_v_g.shape[1]);
    /* … */
      __pyx_v_n_samples = (__pyx_v_g.shape[1]);

    +1009:     max_allele = np.max(g)

      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_g, 3, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyInt_As_npy_int8(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_int8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_allele = __pyx_t_6;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_g, 3, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int16_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyInt_As_npy_int16(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_int16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_allele = __pyx_t_6;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_g, 3, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyInt_As_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_allele = __pyx_t_6;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_g, 3, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_allele = __pyx_t_6;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_g, 3, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyInt_As_npy_uint8(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_allele = __pyx_t_6;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_g, 3, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint16_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyInt_As_npy_uint16(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_allele = __pyx_t_6;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_g, 3, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint32_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyInt_As_npy_uint32(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_allele = __pyx_t_6;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_g, 3, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyInt_As_npy_uint64(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1009, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_allele = __pyx_t_6;

    +1010:     linkage = np.zeros((max_allele + 1, max_allele + 1), dtype='u4')

      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
      __pyx_t_1 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_u4) < 0) __PYX_ERR(0, 1010, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_linkage = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
      __pyx_t_1 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_u4) < 0) __PYX_ERR(0, 1010, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_linkage = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
      __pyx_t_1 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_u4) < 0) __PYX_ERR(0, 1010, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_linkage = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyInt_From_npy_int64((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyInt_From_npy_int64((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
      __pyx_t_1 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_u4) < 0) __PYX_ERR(0, 1010, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_linkage = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
      __pyx_t_1 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_u4) < 0) __PYX_ERR(0, 1010, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_linkage = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
      __pyx_t_1 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_u4) < 0) __PYX_ERR(0, 1010, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_linkage = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
      __pyx_t_1 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_u4) < 0) __PYX_ERR(0, 1010, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_linkage = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyInt_From_npy_uint64((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyInt_From_npy_uint64((__pyx_v_max_allele + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
      __pyx_t_1 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_u4) < 0) __PYX_ERR(0, 1010, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_uint32_t(__pyx_t_1);
      if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 1010, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_linkage = __pyx_t_7;
      __pyx_t_7.memview = NULL;
      __pyx_t_7.data = NULL;

    +1011:     n_progeny_phased = np.sum(is_phased[:, 2:], axis=1).astype('u4')

      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8.data = __pyx_v_is_phased.data;
      __pyx_t_8.memview = __pyx_v_is_phased.memview;
      __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
      __pyx_t_8.shape[0] = __pyx_v_is_phased.shape[0];
    __pyx_t_8.strides[0] = __pyx_v_is_phased.strides[0];
        __pyx_t_8.suboffsets[0] = -1;

    __pyx_t_9 = -1;
      if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_8,
        __pyx_v_is_phased.shape[1], __pyx_v_is_phased.strides[1], __pyx_v_is_phased.suboffsets[1],
        1,
        1,
        &__pyx_t_9,
        2,
        0,
        0,
        1,
        0,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 1011, __pyx_L1_error)
    }

    __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_t_8, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __pyx_t_8.memview = NULL;
      __pyx_t_8.data = NULL;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 1011, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_t_3);
      if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_n_progeny_phased = __pyx_t_10;
      __pyx_t_10.memview = NULL;
      __pyx_t_10.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8.data = __pyx_v_is_phased.data;
      __pyx_t_8.memview = __pyx_v_is_phased.memview;
      __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
      __pyx_t_8.shape[0] = __pyx_v_is_phased.shape[0];
    __pyx_t_8.strides[0] = __pyx_v_is_phased.strides[0];
        __pyx_t_8.suboffsets[0] = -1;

    __pyx_t_9 = -1;
      if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_8,
        __pyx_v_is_phased.shape[1], __pyx_v_is_phased.strides[1], __pyx_v_is_phased.suboffsets[1],
        1,
        1,
        &__pyx_t_9,
        2,
        0,
        0,
        1,
        0,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 1011, __pyx_L1_error)
    }

    __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_t_8, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __pyx_t_8.memview = NULL;
      __pyx_t_8.data = NULL;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 1011, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
      __pyx_tuple__64 = PyTuple_Pack(1, __pyx_n_s_u4); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__64);
      __Pyx_GIVEREF(__pyx_tuple__64);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_t_3);
      if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_n_progeny_phased = __pyx_t_10;
      __pyx_t_10.memview = NULL;
      __pyx_t_10.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8.data = __pyx_v_is_phased.data;
      __pyx_t_8.memview = __pyx_v_is_phased.memview;
      __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
      __pyx_t_8.shape[0] = __pyx_v_is_phased.shape[0];
    __pyx_t_8.strides[0] = __pyx_v_is_phased.strides[0];
        __pyx_t_8.suboffsets[0] = -1;

    __pyx_t_9 = -1;
      if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_8,
        __pyx_v_is_phased.shape[1], __pyx_v_is_phased.strides[1], __pyx_v_is_phased.suboffsets[1],
        1,
        1,
        &__pyx_t_9,
        2,
        0,
        0,
        1,
        0,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 1011, __pyx_L1_error)
    }

    __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_t_8, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __pyx_t_8.memview = NULL;
      __pyx_t_8.data = NULL;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 1011, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_tuple__65 = PyTuple_Pack(1, __pyx_n_s_u4); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__65);
      __Pyx_GIVEREF(__pyx_tuple__65);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_t_3);
      if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_n_progeny_phased = __pyx_t_10;
      __pyx_t_10.memview = NULL;
      __pyx_t_10.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8.data = __pyx_v_is_phased.data;
      __pyx_t_8.memview = __pyx_v_is_phased.memview;
      __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
      __pyx_t_8.shape[0] = __pyx_v_is_phased.shape[0];
    __pyx_t_8.strides[0] = __pyx_v_is_phased.strides[0];
        __pyx_t_8.suboffsets[0] = -1;

    __pyx_t_9 = -1;
      if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_8,
        __pyx_v_is_phased.shape[1], __pyx_v_is_phased.strides[1], __pyx_v_is_phased.suboffsets[1],
        1,
        1,
        &__pyx_t_9,
        2,
        0,
        0,
        1,
        0,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 1011, __pyx_L1_error)
    }

    __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_t_8, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __pyx_t_8.memview = NULL;
      __pyx_t_8.data = NULL;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 1011, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_tuple__66 = PyTuple_Pack(1, __pyx_n_s_u4); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__66);
      __Pyx_GIVEREF(__pyx_tuple__66);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_t_3);
      if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_n_progeny_phased = __pyx_t_10;
      __pyx_t_10.memview = NULL;
      __pyx_t_10.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8.data = __pyx_v_is_phased.data;
      __pyx_t_8.memview = __pyx_v_is_phased.memview;
      __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
      __pyx_t_8.shape[0] = __pyx_v_is_phased.shape[0];
    __pyx_t_8.strides[0] = __pyx_v_is_phased.strides[0];
        __pyx_t_8.suboffsets[0] = -1;

    __pyx_t_9 = -1;
      if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_8,
        __pyx_v_is_phased.shape[1], __pyx_v_is_phased.strides[1], __pyx_v_is_phased.suboffsets[1],
        1,
        1,
        &__pyx_t_9,
        2,
        0,
        0,
        1,
        0,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 1011, __pyx_L1_error)
    }

    __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_t_8, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __pyx_t_8.memview = NULL;
      __pyx_t_8.data = NULL;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 1011, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_u4); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__67);
      __Pyx_GIVEREF(__pyx_tuple__67);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_t_3);
      if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_n_progeny_phased = __pyx_t_10;
      __pyx_t_10.memview = NULL;
      __pyx_t_10.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8.data = __pyx_v_is_phased.data;
      __pyx_t_8.memview = __pyx_v_is_phased.memview;
      __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
      __pyx_t_8.shape[0] = __pyx_v_is_phased.shape[0];
    __pyx_t_8.strides[0] = __pyx_v_is_phased.strides[0];
        __pyx_t_8.suboffsets[0] = -1;

    __pyx_t_9 = -1;
      if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_8,
        __pyx_v_is_phased.shape[1], __pyx_v_is_phased.strides[1], __pyx_v_is_phased.suboffsets[1],
        1,
        1,
        &__pyx_t_9,
        2,
        0,
        0,
        1,
        0,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 1011, __pyx_L1_error)
    }

    __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_t_8, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __pyx_t_8.memview = NULL;
      __pyx_t_8.data = NULL;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 1011, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_tuple__68 = PyTuple_Pack(1, __pyx_n_s_u4); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__68);
      __Pyx_GIVEREF(__pyx_tuple__68);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_t_3);
      if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_n_progeny_phased = __pyx_t_10;
      __pyx_t_10.memview = NULL;
      __pyx_t_10.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8.data = __pyx_v_is_phased.data;
      __pyx_t_8.memview = __pyx_v_is_phased.memview;
      __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
      __pyx_t_8.shape[0] = __pyx_v_is_phased.shape[0];
    __pyx_t_8.strides[0] = __pyx_v_is_phased.strides[0];
        __pyx_t_8.suboffsets[0] = -1;

    __pyx_t_9 = -1;
      if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_8,
        __pyx_v_is_phased.shape[1], __pyx_v_is_phased.strides[1], __pyx_v_is_phased.suboffsets[1],
        1,
        1,
        &__pyx_t_9,
        2,
        0,
        0,
        1,
        0,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 1011, __pyx_L1_error)
    }

    __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_t_8, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __pyx_t_8.memview = NULL;
      __pyx_t_8.data = NULL;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 1011, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_tuple__69 = PyTuple_Pack(1, __pyx_n_s_u4); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__69);
      __Pyx_GIVEREF(__pyx_tuple__69);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_t_3);
      if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_n_progeny_phased = __pyx_t_10;
      __pyx_t_10.memview = NULL;
      __pyx_t_10.data = NULL;
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8.data = __pyx_v_is_phased.data;
      __pyx_t_8.memview = __pyx_v_is_phased.memview;
      __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
      __pyx_t_8.shape[0] = __pyx_v_is_phased.shape[0];
    __pyx_t_8.strides[0] = __pyx_v_is_phased.strides[0];
        __pyx_t_8.suboffsets[0] = -1;

    __pyx_t_9 = -1;
      if (unlikely(__pyx_memoryview_slice_memviewslice(
        &__pyx_t_8,
        __pyx_v_is_phased.shape[1], __pyx_v_is_phased.strides[1], __pyx_v_is_phased.suboffsets[1],
        1,
        1,
        &__pyx_t_9,
        2,
        0,
        0,
        1,
        0,
        0,
        1) < 0))
    {
        __PYX_ERR(0, 1011, __pyx_L1_error)
    }

    __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_t_8, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
      __pyx_t_8.memview = NULL;
      __pyx_t_8.data = NULL;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 1011, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_tuple__70 = PyTuple_Pack(1, __pyx_n_s_u4); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__70);
      __Pyx_GIVEREF(__pyx_tuple__70);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_t_3);
      if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_n_progeny_phased = __pyx_t_10;
      __pyx_t_10.memview = NULL;
      __pyx_t_10.data = NULL;
      __pyx_tuple__71 = PyTuple_Pack(1, __pyx_n_s_u4); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__71);
      __Pyx_GIVEREF(__pyx_tuple__71);

     1012:

     1013:     # iterate over variants

    +1014:     for i in range(n_variants):

      __pyx_t_11 = __pyx_v_n_variants;
      for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
        __pyx_v_i = __pyx_t_12;
    /* … */
      __pyx_t_11 = __pyx_v_n_variants;
      for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
        __pyx_v_i = __pyx_t_12;
    /* … */
      __pyx_t_11 = __pyx_v_n_variants;
      for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
        __pyx_v_i = __pyx_t_12;
    /* … */
      __pyx_t_11 = __pyx_v_n_variants;
      for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
        __pyx_v_i = __pyx_t_12;
    /* … */
      __pyx_t_11 = __pyx_v_n_variants;
      for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
        __pyx_v_i = __pyx_t_12;
    /* … */
      __pyx_t_11 = __pyx_v_n_variants;
      for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
        __pyx_v_i = __pyx_t_12;
    /* … */
      __pyx_t_11 = __pyx_v_n_variants;
      for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
        __pyx_v_i = __pyx_t_12;
    /* … */
      __pyx_t_11 = __pyx_v_n_variants;
      for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
        __pyx_v_i = __pyx_t_12;

     1015:

    +1016:         if n_progeny_phased[i] == 0:

        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_13 * __pyx_v_n_progeny_phased.strides[0]) ))) == 0) != 0);
        if (__pyx_t_14) {
    /* … */
        }
    /* … */
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_13 * __pyx_v_n_progeny_phased.strides[0]) ))) == 0) != 0);
        if (__pyx_t_14) {
    /* … */
        }
    /* … */
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_13 * __pyx_v_n_progeny_phased.strides[0]) ))) == 0) != 0);
        if (__pyx_t_14) {
    /* … */
        }
    /* … */
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_13 * __pyx_v_n_progeny_phased.strides[0]) ))) == 0) != 0);
        if (__pyx_t_14) {
    /* … */
        }
    /* … */
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_13 * __pyx_v_n_progeny_phased.strides[0]) ))) == 0) != 0);
        if (__pyx_t_14) {
    /* … */
        }
    /* … */
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_13 * __pyx_v_n_progeny_phased.strides[0]) ))) == 0) != 0);
        if (__pyx_t_14) {
    /* … */
        }
    /* … */
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_13 * __pyx_v_n_progeny_phased.strides[0]) ))) == 0) != 0);
        if (__pyx_t_14) {
    /* … */
        }
    /* … */
        __pyx_t_13 = __pyx_v_i;
        __pyx_t_14 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_13 * __pyx_v_n_progeny_phased.strides[0]) ))) == 0) != 0);
        if (__pyx_t_14) {
    /* … */
        }

     1017:             # no progeny genotypes phased, cannot phase parent

    +1018:             continue

          goto __pyx_L3_continue;
    /* … */
          goto __pyx_L3_continue;
    /* … */
          goto __pyx_L3_continue;
    /* … */
          goto __pyx_L3_continue;
    /* … */
          goto __pyx_L3_continue;
    /* … */
          goto __pyx_L3_continue;
    /* … */
          goto __pyx_L3_continue;
    /* … */
          goto __pyx_L3_continue;

     1019:

     1020:         # iterate over parents

    +1021:         for parent in range(2):

        for (__pyx_t_15 = 0; __pyx_t_15 < 2; __pyx_t_15+=1) {
          __pyx_v_parent = __pyx_t_15;
    /* … */
        for (__pyx_t_15 = 0; __pyx_t_15 < 2; __pyx_t_15+=1) {
          __pyx_v_parent = __pyx_t_15;
    /* … */
        for (__pyx_t_15 = 0; __pyx_t_15 < 2; __pyx_t_15+=1) {
          __pyx_v_parent = __pyx_t_15;
    /* … */
        for (__pyx_t_15 = 0; __pyx_t_15 < 2; __pyx_t_15+=1) {
          __pyx_v_parent = __pyx_t_15;
    /* … */
        for (__pyx_t_15 = 0; __pyx_t_15 < 2; __pyx_t_15+=1) {
          __pyx_v_parent = __pyx_t_15;
    /* … */
        for (__pyx_t_15 = 0; __pyx_t_15 < 2; __pyx_t_15+=1) {
          __pyx_v_parent = __pyx_t_15;
    /* … */
        for (__pyx_t_15 = 0; __pyx_t_15 < 2; __pyx_t_15+=1) {
          __pyx_v_parent = __pyx_t_15;
    /* … */
        for (__pyx_t_15 = 0; __pyx_t_15 < 2; __pyx_t_15+=1) {
          __pyx_v_parent = __pyx_t_15;

     1022:

    +1023:             if is_phased[i, parent]:

          __pyx_t_16 = __pyx_v_i;
          __pyx_t_17 = __pyx_v_parent;
          __pyx_t_14 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_16 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_17 * __pyx_v_is_phased.strides[1]) ))) != 0);
          if (__pyx_t_14) {
    /* … */
          }
    /* … */
          __pyx_t_16 = __pyx_v_i;
          __pyx_t_17 = __pyx_v_parent;
          __pyx_t_14 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_16 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_17 * __pyx_v_is_phased.strides[1]) ))) != 0);
          if (__pyx_t_14) {
    /* … */
          }
    /* … */
          __pyx_t_16 = __pyx_v_i;
          __pyx_t_17 = __pyx_v_parent;
          __pyx_t_14 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_16 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_17 * __pyx_v_is_phased.strides[1]) ))) != 0);
          if (__pyx_t_14) {
    /* … */
          }
    /* … */
          __pyx_t_16 = __pyx_v_i;
          __pyx_t_17 = __pyx_v_parent;
          __pyx_t_14 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_16 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_17 * __pyx_v_is_phased.strides[1]) ))) != 0);
          if (__pyx_t_14) {
    /* … */
          }
    /* … */
          __pyx_t_16 = __pyx_v_i;
          __pyx_t_17 = __pyx_v_parent;
          __pyx_t_14 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_16 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_17 * __pyx_v_is_phased.strides[1]) ))) != 0);
          if (__pyx_t_14) {
    /* … */
          }
    /* … */
          __pyx_t_16 = __pyx_v_i;
          __pyx_t_17 = __pyx_v_parent;
          __pyx_t_14 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_16 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_17 * __pyx_v_is_phased.strides[1]) ))) != 0);
          if (__pyx_t_14) {
    /* … */
          }
    /* … */
          __pyx_t_16 = __pyx_v_i;
          __pyx_t_17 = __pyx_v_parent;
          __pyx_t_14 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_16 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_17 * __pyx_v_is_phased.strides[1]) ))) != 0);
          if (__pyx_t_14) {
    /* … */
          }
    /* … */
          __pyx_t_16 = __pyx_v_i;
          __pyx_t_17 = __pyx_v_parent;
          __pyx_t_14 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_16 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_17 * __pyx_v_is_phased.strides[1]) ))) != 0);
          if (__pyx_t_14) {
    /* … */
          }

     1024:                 # parent already phased somehow, not expected but skip anyway

    +1025:                 continue

            goto __pyx_L6_continue;
    /* … */
            goto __pyx_L6_continue;
    /* … */
            goto __pyx_L6_continue;
    /* … */
            goto __pyx_L6_continue;
    /* … */
            goto __pyx_L6_continue;
    /* … */
            goto __pyx_L6_continue;
    /* … */
            goto __pyx_L6_continue;
    /* … */
            goto __pyx_L6_continue;

     1026:

     1027:             # access parent's alleles

    +1028:             a1 = g[i, parent, 0]

          __pyx_t_18 = __pyx_v_i;
          __pyx_t_19 = __pyx_v_parent;
          __pyx_t_20 = 0;
          __pyx_v_a1 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_18 * __pyx_v_g.strides[0]) ) + __pyx_t_19 * __pyx_v_g.strides[1]) ) + __pyx_t_20 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_18 = __pyx_v_i;
          __pyx_t_19 = __pyx_v_parent;
          __pyx_t_20 = 0;
          __pyx_v_a1 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_18 * __pyx_v_g.strides[0]) ) + __pyx_t_19 * __pyx_v_g.strides[1]) ) + __pyx_t_20 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_18 = __pyx_v_i;
          __pyx_t_19 = __pyx_v_parent;
          __pyx_t_20 = 0;
          __pyx_v_a1 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_18 * __pyx_v_g.strides[0]) ) + __pyx_t_19 * __pyx_v_g.strides[1]) ) + __pyx_t_20 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_18 = __pyx_v_i;
          __pyx_t_19 = __pyx_v_parent;
          __pyx_t_20 = 0;
          __pyx_v_a1 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_18 * __pyx_v_g.strides[0]) ) + __pyx_t_19 * __pyx_v_g.strides[1]) ) + __pyx_t_20 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_18 = __pyx_v_i;
          __pyx_t_19 = __pyx_v_parent;
          __pyx_t_20 = 0;
          __pyx_v_a1 = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_18 * __pyx_v_g.strides[0]) ) + __pyx_t_19 * __pyx_v_g.strides[1]) ) + __pyx_t_20 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_18 = __pyx_v_i;
          __pyx_t_19 = __pyx_v_parent;
          __pyx_t_20 = 0;
          __pyx_v_a1 = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_18 * __pyx_v_g.strides[0]) ) + __pyx_t_19 * __pyx_v_g.strides[1]) ) + __pyx_t_20 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_18 = __pyx_v_i;
          __pyx_t_19 = __pyx_v_parent;
          __pyx_t_20 = 0;
          __pyx_v_a1 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_18 * __pyx_v_g.strides[0]) ) + __pyx_t_19 * __pyx_v_g.strides[1]) ) + __pyx_t_20 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_18 = __pyx_v_i;
          __pyx_t_19 = __pyx_v_parent;
          __pyx_t_20 = 0;
          __pyx_v_a1 = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_18 * __pyx_v_g.strides[0]) ) + __pyx_t_19 * __pyx_v_g.strides[1]) ) + __pyx_t_20 * __pyx_v_g.strides[2]) )));

    +1029:             a2 = g[i, parent, 1]

          __pyx_t_21 = __pyx_v_i;
          __pyx_t_22 = __pyx_v_parent;
          __pyx_t_23 = 1;
          __pyx_v_a2 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_21 * __pyx_v_g.strides[0]) ) + __pyx_t_22 * __pyx_v_g.strides[1]) ) + __pyx_t_23 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_22 = __pyx_v_parent;
          __pyx_t_23 = 1;
          __pyx_v_a2 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_21 * __pyx_v_g.strides[0]) ) + __pyx_t_22 * __pyx_v_g.strides[1]) ) + __pyx_t_23 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_22 = __pyx_v_parent;
          __pyx_t_23 = 1;
          __pyx_v_a2 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_21 * __pyx_v_g.strides[0]) ) + __pyx_t_22 * __pyx_v_g.strides[1]) ) + __pyx_t_23 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_22 = __pyx_v_parent;
          __pyx_t_23 = 1;
          __pyx_v_a2 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_21 * __pyx_v_g.strides[0]) ) + __pyx_t_22 * __pyx_v_g.strides[1]) ) + __pyx_t_23 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_22 = __pyx_v_parent;
          __pyx_t_23 = 1;
          __pyx_v_a2 = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_21 * __pyx_v_g.strides[0]) ) + __pyx_t_22 * __pyx_v_g.strides[1]) ) + __pyx_t_23 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_22 = __pyx_v_parent;
          __pyx_t_23 = 1;
          __pyx_v_a2 = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_21 * __pyx_v_g.strides[0]) ) + __pyx_t_22 * __pyx_v_g.strides[1]) ) + __pyx_t_23 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_22 = __pyx_v_parent;
          __pyx_t_23 = 1;
          __pyx_v_a2 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_21 * __pyx_v_g.strides[0]) ) + __pyx_t_22 * __pyx_v_g.strides[1]) ) + __pyx_t_23 * __pyx_v_g.strides[2]) )));
    /* … */
          __pyx_t_21 = __pyx_v_i;
          __pyx_t_22 = __pyx_v_parent;
          __pyx_t_23 = 1;
          __pyx_v_a2 = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_21 * __pyx_v_g.strides[0]) ) + __pyx_t_22 * __pyx_v_g.strides[1]) ) + __pyx_t_23 * __pyx_v_g.strides[2]) )));

     1030:

    +1031:             if a1 < 0 or a2 < 0:

          __pyx_t_24 = ((__pyx_v_a1 < 0) != 0);
          if (!__pyx_t_24) {
          } else {
            __pyx_t_14 = __pyx_t_24;
            goto __pyx_L10_bool_binop_done;
          }
          __pyx_t_24 = ((__pyx_v_a2 < 0) != 0);
          __pyx_t_14 = __pyx_t_24;
          __pyx_L10_bool_binop_done:;
          if (__pyx_t_14) {
    /* … */
          }
    /* … */
          __pyx_t_24 = ((__pyx_v_a1 < 0) != 0);
          if (!__pyx_t_24) {
          } else {
            __pyx_t_14 = __pyx_t_24;
            goto __pyx_L10_bool_binop_done;
          }
          __pyx_t_24 = ((__pyx_v_a2 < 0) != 0);
          __pyx_t_14 = __pyx_t_24;
          __pyx_L10_bool_binop_done:;
          if (__pyx_t_14) {
    /* … */
          }
    /* … */
          __pyx_t_24 = ((__pyx_v_a1 < 0) != 0);
          if (!__pyx_t_24) {
          } else {
            __pyx_t_14 = __pyx_t_24;
            goto __pyx_L10_bool_binop_done;
          }
          __pyx_t_24 = ((__pyx_v_a2 < 0) != 0);
          __pyx_t_14 = __pyx_t_24;
          __pyx_L10_bool_binop_done:;
          if (__pyx_t_14) {
    /* … */
          }
    /* … */
          __pyx_t_24 = ((__pyx_v_a1 < 0) != 0);
          if (!__pyx_t_24) {
          } else {
            __pyx_t_14 = __pyx_t_24;
            goto __pyx_L10_bool_binop_done;
          }
          __pyx_t_24 = ((__pyx_v_a2 < 0) != 0);
          __pyx_t_14 = __pyx_t_24;
          __pyx_L10_bool_binop_done:;
          if (__pyx_t_14) {
    /* … */
          }
    /* … */
          __pyx_t_24 = ((__pyx_v_a1 < 0) != 0);
          if (!__pyx_t_24) {
          } else {
            __pyx_t_14 = __pyx_t_24;
            goto __pyx_L10_bool_binop_done;
          }
          __pyx_t_24 = ((__pyx_v_a2 < 0) != 0);
          __pyx_t_14 = __pyx_t_24;
          __pyx_L10_bool_binop_done:;
          if (__pyx_t_14) {
    /* … */
          }
    /* … */
          __pyx_t_24 = ((__pyx_v_a1 < 0) != 0);
          if (!__pyx_t_24) {
          } else {
            __pyx_t_14 = __pyx_t_24;
            goto __pyx_L10_bool_binop_done;
          }
          __pyx_t_24 = ((__pyx_v_a2 < 0) != 0);
          __pyx_t_14 = __pyx_t_24;
          __pyx_L10_bool_binop_done:;
          if (__pyx_t_14) {
    /* … */
          }
    /* … */
          __pyx_t_24 = ((__pyx_v_a1 < 0) != 0);
          if (!__pyx_t_24) {
          } else {
            __pyx_t_14 = __pyx_t_24;
            goto __pyx_L10_bool_binop_done;
          }
          __pyx_t_24 = ((__pyx_v_a2 < 0) != 0);
          __pyx_t_14 = __pyx_t_24;
          __pyx_L10_bool_binop_done:;
          if (__pyx_t_14) {
    /* … */
          }
    /* … */
          __pyx_t_24 = ((__pyx_v_a1 < 0) != 0);
          if (!__pyx_t_24) {
          } else {
            __pyx_t_14 = __pyx_t_24;
            goto __pyx_L10_bool_binop_done;
          }
          __pyx_t_24 = ((__pyx_v_a2 < 0) != 0);
          __pyx_t_14 = __pyx_t_24;
          __pyx_L10_bool_binop_done:;
          if (__pyx_t_14) {
    /* … */
          }

     1032:                 # missing call, skip

    +1033:                 continue

            goto __pyx_L6_continue;
    /* … */
            goto __pyx_L6_continue;
    /* … */
            goto __pyx_L6_continue;
    /* … */
            goto __pyx_L6_continue;
    /* … */
            goto __pyx_L6_continue;
    /* … */
            goto __pyx_L6_continue;
    /* … */
            goto __pyx_L6_continue;
    /* … */
            goto __pyx_L6_continue;

     1034:

    +1035:             elif a1 == a2:

          __pyx_t_14 = ((__pyx_v_a1 == __pyx_v_a2) != 0);
          if (__pyx_t_14) {
    /* … */
            goto __pyx_L9;
          }
    /* … */
          __pyx_t_14 = ((__pyx_v_a1 == __pyx_v_a2) != 0);
          if (__pyx_t_14) {
    /* … */
            goto __pyx_L9;
          }
    /* … */
          __pyx_t_14 = ((__pyx_v_a1 == __pyx_v_a2) != 0);
          if (__pyx_t_14) {
    /* … */
            goto __pyx_L9;
          }
    /* … */
          __pyx_t_14 = ((__pyx_v_a1 == __pyx_v_a2) != 0);
          if (__pyx_t_14) {
    /* … */
            goto __pyx_L9;
          }
    /* … */
          __pyx_t_14 = ((__pyx_v_a1 == __pyx_v_a2) != 0);
          if (__pyx_t_14) {
    /* … */
            goto __pyx_L9;
          }
    /* … */
          __pyx_t_14 = ((__pyx_v_a1 == __pyx_v_a2) != 0);
          if (__pyx_t_14) {
    /* … */
            goto __pyx_L9;
          }
    /* … */
          __pyx_t_14 = ((__pyx_v_a1 == __pyx_v_a2) != 0);
          if (__pyx_t_14) {
    /* … */
            goto __pyx_L9;
          }
    /* … */
          __pyx_t_14 = ((__pyx_v_a1 == __pyx_v_a2) != 0);
          if (__pyx_t_14) {
    /* … */
            goto __pyx_L9;
          }

     1036:                 # parent is homozygous, trivially phase

    +1037:                 is_phased[i, parent] = 1

            __pyx_t_25 = __pyx_v_i;
            __pyx_t_26 = __pyx_v_parent;
            *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_25 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_26 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
            __pyx_t_25 = __pyx_v_i;
            __pyx_t_26 = __pyx_v_parent;
            *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_25 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_26 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
            __pyx_t_25 = __pyx_v_i;
            __pyx_t_26 = __pyx_v_parent;
            *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_25 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_26 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
            __pyx_t_25 = __pyx_v_i;
            __pyx_t_26 = __pyx_v_parent;
            *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_25 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_26 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
            __pyx_t_25 = __pyx_v_i;
            __pyx_t_26 = __pyx_v_parent;
            *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_25 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_26 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
            __pyx_t_25 = __pyx_v_i;
            __pyx_t_26 = __pyx_v_parent;
            *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_25 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_26 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
            __pyx_t_25 = __pyx_v_i;
            __pyx_t_26 = __pyx_v_parent;
            *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_25 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_26 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
            __pyx_t_25 = __pyx_v_i;
            __pyx_t_26 = __pyx_v_parent;
            *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_25 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_26 * __pyx_v_is_phased.strides[1]) )) = 1;

     1038:

    +1039:             elif n_progeny_phased[i] > 0:

          __pyx_t_27 = __pyx_v_i;
          __pyx_t_14 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_27 * __pyx_v_n_progeny_phased.strides[0]) ))) > 0) != 0);
          if (__pyx_t_14) {
    /* … */
          }
          __pyx_L9:;
          __pyx_L6_continue:;
        }
        __pyx_L3_continue:;
      }
    /* … */
          __pyx_t_27 = __pyx_v_i;
          __pyx_t_14 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_27 * __pyx_v_n_progeny_phased.strides[0]) ))) > 0) != 0);
          if (__pyx_t_14) {
    /* … */
          }
          __pyx_L9:;
          __pyx_L6_continue:;
        }
        __pyx_L3_continue:;
      }
    /* … */
          __pyx_t_27 = __pyx_v_i;
          __pyx_t_14 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_27 * __pyx_v_n_progeny_phased.strides[0]) ))) > 0) != 0);
          if (__pyx_t_14) {
    /* … */
          }
          __pyx_L9:;
          __pyx_L6_continue:;
        }
        __pyx_L3_continue:;
      }
    /* … */
          __pyx_t_27 = __pyx_v_i;
          __pyx_t_14 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_27 * __pyx_v_n_progeny_phased.strides[0]) ))) > 0) != 0);
          if (__pyx_t_14) {
    /* … */
          }
          __pyx_L9:;
          __pyx_L6_continue:;
        }
        __pyx_L3_continue:;
      }
    /* … */
          __pyx_t_27 = __pyx_v_i;
          __pyx_t_14 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_27 * __pyx_v_n_progeny_phased.strides[0]) ))) > 0) != 0);
          if (__pyx_t_14) {
    /* … */
          }
          __pyx_L9:;
          __pyx_L6_continue:;
        }
        __pyx_L3_continue:;
      }
    /* … */
          __pyx_t_27 = __pyx_v_i;
          __pyx_t_14 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_27 * __pyx_v_n_progeny_phased.strides[0]) ))) > 0) != 0);
          if (__pyx_t_14) {
    /* … */
          }
          __pyx_L9:;
          __pyx_L6_continue:;
        }
        __pyx_L3_continue:;
      }
    /* … */
          __pyx_t_27 = __pyx_v_i;
          __pyx_t_14 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_27 * __pyx_v_n_progeny_phased.strides[0]) ))) > 0) != 0);
          if (__pyx_t_14) {
    /* … */
          }
          __pyx_L9:;
          __pyx_L6_continue:;
        }
        __pyx_L3_continue:;
      }
    /* … */
          __pyx_t_27 = __pyx_v_i;
          __pyx_t_14 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_27 * __pyx_v_n_progeny_phased.strides[0]) ))) > 0) != 0);
          if (__pyx_t_14) {
    /* … */
          }
          __pyx_L9:;
          __pyx_L6_continue:;
        }
        __pyx_L3_continue:;
      }

     1040:                 # parent is het and some progeny are phased, so should be

     1041:                 # able to phase parent

     1042:

     1043:                 # setup accumulators for evidence on whether to swap alleles

    +1044:                 keep = flip = 0

            __pyx_v_keep = 0;
            __pyx_v_flip = 0;
    /* … */
            __pyx_v_keep = 0;
            __pyx_v_flip = 0;
    /* … */
            __pyx_v_keep = 0;
            __pyx_v_flip = 0;
    /* … */
            __pyx_v_keep = 0;
            __pyx_v_flip = 0;
    /* … */
            __pyx_v_keep = 0;
            __pyx_v_flip = 0;
    /* … */
            __pyx_v_keep = 0;
            __pyx_v_flip = 0;
    /* … */
            __pyx_v_keep = 0;
            __pyx_v_flip = 0;
    /* … */
            __pyx_v_keep = 0;
            __pyx_v_flip = 0;

     1045:

     1046:                 # keep track of how many informative variants are visited

    +1047:                 n_inf = 0

            __pyx_v_n_inf = 0;
    /* … */
            __pyx_v_n_inf = 0;
    /* … */
            __pyx_v_n_inf = 0;
    /* … */
            __pyx_v_n_inf = 0;
    /* … */
            __pyx_v_n_inf = 0;
    /* … */
            __pyx_v_n_inf = 0;
    /* … */
            __pyx_v_n_inf = 0;
    /* … */
            __pyx_v_n_inf = 0;

     1048:

     1049:                 # setup index for back-tracking

    +1050:                 ii = i - 1

            __pyx_v_ii = (__pyx_v_i - 1);
    /* … */
            __pyx_v_ii = (__pyx_v_i - 1);
    /* … */
            __pyx_v_ii = (__pyx_v_i - 1);
    /* … */
            __pyx_v_ii = (__pyx_v_i - 1);
    /* … */
            __pyx_v_ii = (__pyx_v_i - 1);
    /* … */
            __pyx_v_ii = (__pyx_v_i - 1);
    /* … */
            __pyx_v_ii = (__pyx_v_i - 1);
    /* … */
            __pyx_v_ii = (__pyx_v_i - 1);

     1051:

     1052:                 # look back and collect linkage evidence from previous variants

    +1053:                 while ii >= 0 and n_inf < window_size:

            while (1) {
              __pyx_t_24 = ((__pyx_v_ii >= 0) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L14_bool_binop_done;
              }
              __pyx_t_24 = ((__pyx_v_n_inf < __pyx_v_window_size) != 0);
              __pyx_t_14 = __pyx_t_24;
              __pyx_L14_bool_binop_done:;
              if (!__pyx_t_14) break;
    /* … */
            while (1) {
              __pyx_t_24 = ((__pyx_v_ii >= 0) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L14_bool_binop_done;
              }
              __pyx_t_24 = ((__pyx_v_n_inf < __pyx_v_window_size) != 0);
              __pyx_t_14 = __pyx_t_24;
              __pyx_L14_bool_binop_done:;
              if (!__pyx_t_14) break;
    /* … */
            while (1) {
              __pyx_t_24 = ((__pyx_v_ii >= 0) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L14_bool_binop_done;
              }
              __pyx_t_24 = ((__pyx_v_n_inf < __pyx_v_window_size) != 0);
              __pyx_t_14 = __pyx_t_24;
              __pyx_L14_bool_binop_done:;
              if (!__pyx_t_14) break;
    /* … */
            while (1) {
              __pyx_t_24 = ((__pyx_v_ii >= 0) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L14_bool_binop_done;
              }
              __pyx_t_24 = ((__pyx_v_n_inf < __pyx_v_window_size) != 0);
              __pyx_t_14 = __pyx_t_24;
              __pyx_L14_bool_binop_done:;
              if (!__pyx_t_14) break;
    /* … */
            while (1) {
              __pyx_t_24 = ((__pyx_v_ii >= 0) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L14_bool_binop_done;
              }
              __pyx_t_24 = ((__pyx_v_n_inf < __pyx_v_window_size) != 0);
              __pyx_t_14 = __pyx_t_24;
              __pyx_L14_bool_binop_done:;
              if (!__pyx_t_14) break;
    /* … */
            while (1) {
              __pyx_t_24 = ((__pyx_v_ii >= 0) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L14_bool_binop_done;
              }
              __pyx_t_24 = ((__pyx_v_n_inf < __pyx_v_window_size) != 0);
              __pyx_t_14 = __pyx_t_24;
              __pyx_L14_bool_binop_done:;
              if (!__pyx_t_14) break;
    /* … */
            while (1) {
              __pyx_t_24 = ((__pyx_v_ii >= 0) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L14_bool_binop_done;
              }
              __pyx_t_24 = ((__pyx_v_n_inf < __pyx_v_window_size) != 0);
              __pyx_t_14 = __pyx_t_24;
              __pyx_L14_bool_binop_done:;
              if (!__pyx_t_14) break;
    /* … */
            while (1) {
              __pyx_t_24 = ((__pyx_v_ii >= 0) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L14_bool_binop_done;
              }
              __pyx_t_24 = ((__pyx_v_n_inf < __pyx_v_window_size) != 0);
              __pyx_t_14 = __pyx_t_24;
              __pyx_L14_bool_binop_done:;
              if (!__pyx_t_14) break;

     1054:

     1055:                     # access alleles for previous variant

    +1056:                     pa1 = g[ii, parent, 0]

              __pyx_t_28 = __pyx_v_ii;
              __pyx_t_29 = __pyx_v_parent;
              __pyx_t_30 = 0;
              __pyx_v_pa1 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_28 * __pyx_v_g.strides[0]) ) + __pyx_t_29 * __pyx_v_g.strides[1]) ) + __pyx_t_30 * __pyx_v_g.strides[2]) )));
    /* … */
              __pyx_t_28 = __pyx_v_ii;
              __pyx_t_29 = __pyx_v_parent;
              __pyx_t_30 = 0;
              __pyx_v_pa1 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_28 * __pyx_v_g.strides[0]) ) + __pyx_t_29 * __pyx_v_g.strides[1]) ) + __pyx_t_30 * __pyx_v_g.strides[2]) )));
    /* … */
              __pyx_t_28 = __pyx_v_ii;
              __pyx_t_29 = __pyx_v_parent;
              __pyx_t_30 = 0;
              __pyx_v_pa1 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_28 * __pyx_v_g.strides[0]) ) + __pyx_t_29 * __pyx_v_g.strides[1]) ) + __pyx_t_30 * __pyx_v_g.strides[2]) )));
    /* … */
              __pyx_t_28 = __pyx_v_ii;
              __pyx_t_29 = __pyx_v_parent;
              __pyx_t_30 = 0;
              __pyx_v_pa1 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_28 * __pyx_v_g.strides[0]) ) + __pyx_t_29 * __pyx_v_g.strides[1]) ) + __pyx_t_30 * __pyx_v_g.strides[2]) )));
    /* … */
              __pyx_t_28 = __pyx_v_ii;
              __pyx_t_29 = __pyx_v_parent;
              __pyx_t_30 = 0;
              __pyx_v_pa1 = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_28 * __pyx_v_g.strides[0]) ) + __pyx_t_29 * __pyx_v_g.strides[1]) ) + __pyx_t_30 * __pyx_v_g.strides[2]) )));
    /* … */
              __pyx_t_28 = __pyx_v_ii;
              __pyx_t_29 = __pyx_v_parent;
              __pyx_t_30 = 0;
              __pyx_v_pa1 = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_28 * __pyx_v_g.strides[0]) ) + __pyx_t_29 * __pyx_v_g.strides[1]) ) + __pyx_t_30 * __pyx_v_g.strides[2]) )));
    /* … */
              __pyx_t_28 = __pyx_v_ii;
              __pyx_t_29 = __pyx_v_parent;
              __pyx_t_30 = 0;
              __pyx_v_pa1 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_28 * __pyx_v_g.strides[0]) ) + __pyx_t_29 * __pyx_v_g.strides[1]) ) + __pyx_t_30 * __pyx_v_g.strides[2]) )));
    /* … */
              __pyx_t_28 = __pyx_v_ii;
              __pyx_t_29 = __pyx_v_parent;
              __pyx_t_30 = 0;
              __pyx_v_pa1 = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_28 * __pyx_v_g.strides[0]) ) + __pyx_t_29 * __pyx_v_g.strides[1]) ) + __pyx_t_30 * __pyx_v_g.strides[2]) )));

    +1057:                     pa2 = g[ii, parent, 1]

              __pyx_t_31 = __pyx_v_ii;
              __pyx_t_32 = __pyx_v_parent;
              __pyx_t_33 = 1;
              __pyx_v_pa2 = (*((__pyx_t_5numpy_int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_31 * __pyx_v_g.strides[0]) ) + __pyx_t_32 * __pyx_v_g.strides[1]) ) + __pyx_t_33 * __pyx_v_g.strides[2]) )));
    /* … */
              __pyx_t_31 = __pyx_v_ii;
              __pyx_t_32 = __pyx_v_parent;
              __pyx_t_33 = 1;
              __pyx_v_pa2 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_31 * __pyx_v_g.strides[0]) ) + __pyx_t_32 * __pyx_v_g.strides[1]) ) + __pyx_t_33 * __pyx_v_g.strides[2]) )));
    /* … */
              __pyx_t_31 = __pyx_v_ii;
              __pyx_t_32 = __pyx_v_parent;
              __pyx_t_33 = 1;
              __pyx_v_pa2 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_31 * __pyx_v_g.strides[0]) ) + __pyx_t_32 * __pyx_v_g.strides[1]) ) + __pyx_t_33 * __pyx_v_g.strides[2]) )));
    /* … */
              __pyx_t_31 = __pyx_v_ii;
              __pyx_t_32 = __pyx_v_parent;
              __pyx_t_33 = 1;
              __pyx_v_pa2 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_31 * __pyx_v_g.strides[0]) ) + __pyx_t_32 * __pyx_v_g.strides[1]) ) + __pyx_t_33 * __pyx_v_g.strides[2]) )));
    /* … */
              __pyx_t_31 = __pyx_v_ii;
              __pyx_t_32 = __pyx_v_parent;
              __pyx_t_33 = 1;
              __pyx_v_pa2 = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_31 * __pyx_v_g.strides[0]) ) + __pyx_t_32 * __pyx_v_g.strides[1]) ) + __pyx_t_33 * __pyx_v_g.strides[2]) )));
    /* … */
              __pyx_t_31 = __pyx_v_ii;
              __pyx_t_32 = __pyx_v_parent;
              __pyx_t_33 = 1;
              __pyx_v_pa2 = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_31 * __pyx_v_g.strides[0]) ) + __pyx_t_32 * __pyx_v_g.strides[1]) ) + __pyx_t_33 * __pyx_v_g.strides[2]) )));
    /* … */
              __pyx_t_31 = __pyx_v_ii;
              __pyx_t_32 = __pyx_v_parent;
              __pyx_t_33 = 1;
              __pyx_v_pa2 = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_31 * __pyx_v_g.strides[0]) ) + __pyx_t_32 * __pyx_v_g.strides[1]) ) + __pyx_t_33 * __pyx_v_g.strides[2]) )));
    /* … */
              __pyx_t_31 = __pyx_v_ii;
              __pyx_t_32 = __pyx_v_parent;
              __pyx_t_33 = 1;
              __pyx_v_pa2 = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_31 * __pyx_v_g.strides[0]) ) + __pyx_t_32 * __pyx_v_g.strides[1]) ) + __pyx_t_33 * __pyx_v_g.strides[2]) )));

     1058:

    +1059:                     if (is_phased[ii, parent] and

              __pyx_t_34 = __pyx_v_ii;
              __pyx_t_35 = __pyx_v_parent;
              __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_34 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_35 * __pyx_v_is_phased.strides[1]) ))) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L17_bool_binop_done;
              }
    /* … */
              if (__pyx_t_14) {
    /* … */
              }
    /* … */
              __pyx_t_34 = __pyx_v_ii;
              __pyx_t_35 = __pyx_v_parent;
              __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_34 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_35 * __pyx_v_is_phased.strides[1]) ))) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L17_bool_binop_done;
              }
    /* … */
              if (__pyx_t_14) {
    /* … */
              }
    /* … */
              __pyx_t_34 = __pyx_v_ii;
              __pyx_t_35 = __pyx_v_parent;
              __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_34 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_35 * __pyx_v_is_phased.strides[1]) ))) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L17_bool_binop_done;
              }
    /* … */
              if (__pyx_t_14) {
    /* … */
              }
    /* … */
              __pyx_t_34 = __pyx_v_ii;
              __pyx_t_35 = __pyx_v_parent;
              __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_34 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_35 * __pyx_v_is_phased.strides[1]) ))) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L17_bool_binop_done;
              }
    /* … */
              if (__pyx_t_14) {
    /* … */
              }
    /* … */
              __pyx_t_34 = __pyx_v_ii;
              __pyx_t_35 = __pyx_v_parent;
              __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_34 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_35 * __pyx_v_is_phased.strides[1]) ))) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L17_bool_binop_done;
              }
    /* … */
              if (__pyx_t_14) {
    /* … */
              }
    /* … */
              __pyx_t_34 = __pyx_v_ii;
              __pyx_t_35 = __pyx_v_parent;
              __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_34 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_35 * __pyx_v_is_phased.strides[1]) ))) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L17_bool_binop_done;
              }
    /* … */
              if (__pyx_t_14) {
    /* … */
              }
    /* … */
              __pyx_t_34 = __pyx_v_ii;
              __pyx_t_35 = __pyx_v_parent;
              __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_34 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_35 * __pyx_v_is_phased.strides[1]) ))) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L17_bool_binop_done;
              }
    /* … */
              if (__pyx_t_14) {
    /* … */
              }
    /* … */
              __pyx_t_34 = __pyx_v_ii;
              __pyx_t_35 = __pyx_v_parent;
              __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_34 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_35 * __pyx_v_is_phased.strides[1]) ))) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L17_bool_binop_done;
              }
    /* … */
              if (__pyx_t_14) {
    /* … */
              }

    +1060:                             (pa1 != pa2) and

              __pyx_t_24 = ((__pyx_v_pa1 != __pyx_v_pa2) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L17_bool_binop_done;
              }
    /* … */
              __pyx_t_24 = ((__pyx_v_pa1 != __pyx_v_pa2) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L17_bool_binop_done;
              }
    /* … */
              __pyx_t_24 = ((__pyx_v_pa1 != __pyx_v_pa2) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L17_bool_binop_done;
              }
    /* … */
              __pyx_t_24 = ((__pyx_v_pa1 != __pyx_v_pa2) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L17_bool_binop_done;
              }
    /* … */
              __pyx_t_24 = ((__pyx_v_pa1 != __pyx_v_pa2) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L17_bool_binop_done;
              }
    /* … */
              __pyx_t_24 = ((__pyx_v_pa1 != __pyx_v_pa2) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L17_bool_binop_done;
              }
    /* … */
              __pyx_t_24 = ((__pyx_v_pa1 != __pyx_v_pa2) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L17_bool_binop_done;
              }
    /* … */
              __pyx_t_24 = ((__pyx_v_pa1 != __pyx_v_pa2) != 0);
              if (__pyx_t_24) {
              } else {
                __pyx_t_14 = __pyx_t_24;
                goto __pyx_L17_bool_binop_done;
              }

    +1061:                             (n_progeny_phased[ii] > 0)):

              __pyx_t_36 = __pyx_v_ii;
              __pyx_t_24 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_36 * __pyx_v_n_progeny_phased.strides[0]) ))) > 0) != 0);
              __pyx_t_14 = __pyx_t_24;
              __pyx_L17_bool_binop_done:;
    /* … */
              __pyx_t_36 = __pyx_v_ii;
              __pyx_t_24 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_36 * __pyx_v_n_progeny_phased.strides[0]) ))) > 0) != 0);
              __pyx_t_14 = __pyx_t_24;
              __pyx_L17_bool_binop_done:;
    /* … */
              __pyx_t_36 = __pyx_v_ii;
              __pyx_t_24 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_36 * __pyx_v_n_progeny_phased.strides[0]) ))) > 0) != 0);
              __pyx_t_14 = __pyx_t_24;
              __pyx_L17_bool_binop_done:;
    /* … */
              __pyx_t_36 = __pyx_v_ii;
              __pyx_t_24 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_36 * __pyx_v_n_progeny_phased.strides[0]) ))) > 0) != 0);
              __pyx_t_14 = __pyx_t_24;
              __pyx_L17_bool_binop_done:;
    /* … */
              __pyx_t_36 = __pyx_v_ii;
              __pyx_t_24 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_36 * __pyx_v_n_progeny_phased.strides[0]) ))) > 0) != 0);
              __pyx_t_14 = __pyx_t_24;
              __pyx_L17_bool_binop_done:;
    /* … */
              __pyx_t_36 = __pyx_v_ii;
              __pyx_t_24 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_36 * __pyx_v_n_progeny_phased.strides[0]) ))) > 0) != 0);
              __pyx_t_14 = __pyx_t_24;
              __pyx_L17_bool_binop_done:;
    /* … */
              __pyx_t_36 = __pyx_v_ii;
              __pyx_t_24 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_36 * __pyx_v_n_progeny_phased.strides[0]) ))) > 0) != 0);
              __pyx_t_14 = __pyx_t_24;
              __pyx_L17_bool_binop_done:;
    /* … */
              __pyx_t_36 = __pyx_v_ii;
              __pyx_t_24 = (((*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_n_progeny_phased.data + __pyx_t_36 * __pyx_v_n_progeny_phased.strides[0]) ))) > 0) != 0);
              __pyx_t_14 = __pyx_t_24;
              __pyx_L17_bool_binop_done:;

     1062:

     1063:                         # variant is phase informative, accumulate

    +1064:                         n_inf += 1

                __pyx_v_n_inf = (__pyx_v_n_inf + 1);
    /* … */
                __pyx_v_n_inf = (__pyx_v_n_inf + 1);
    /* … */
                __pyx_v_n_inf = (__pyx_v_n_inf + 1);
    /* … */
                __pyx_v_n_inf = (__pyx_v_n_inf + 1);
    /* … */
                __pyx_v_n_inf = (__pyx_v_n_inf + 1);
    /* … */
                __pyx_v_n_inf = (__pyx_v_n_inf + 1);
    /* … */
                __pyx_v_n_inf = (__pyx_v_n_inf + 1);
    /* … */
                __pyx_v_n_inf = (__pyx_v_n_inf + 1);

     1065:

     1066:                         # collect linkage information

    +1067:                         linkage[:, :] = 0

                {
                    __pyx_t_5numpy_uint32_t __pyx_temp_scalar = 0;
                    {
                        Py_ssize_t __pyx_temp_extent_0 = __pyx_v_linkage.shape[0];
                        Py_ssize_t __pyx_temp_stride_0 = __pyx_v_linkage.strides[0];
                        char *__pyx_temp_pointer_0;
                        Py_ssize_t __pyx_temp_idx_0;
                        Py_ssize_t __pyx_temp_extent_1 = __pyx_v_linkage.shape[1];
                        Py_ssize_t __pyx_temp_stride_1 = __pyx_v_linkage.strides[1];
                        char *__pyx_temp_pointer_1;
                        Py_ssize_t __pyx_temp_idx_1;
                        __pyx_temp_pointer_0 = __pyx_v_linkage.data;
                        for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                          __pyx_temp_pointer_1 = __pyx_temp_pointer_0;
                          for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
                            *((__pyx_t_5numpy_uint32_t *) __pyx_temp_pointer_1) = __pyx_temp_scalar;
                            __pyx_temp_pointer_1 += __pyx_temp_stride_1;
                          }
                          __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                        }
                    }
                }
    /* … */
                {
                    __pyx_t_5numpy_uint32_t __pyx_temp_scalar = 0;
                    {
                        Py_ssize_t __pyx_temp_extent_0 = __pyx_v_linkage.shape[0];
                        Py_ssize_t __pyx_temp_stride_0 = __pyx_v_linkage.strides[0];
                        char *__pyx_temp_pointer_0;
                        Py_ssize_t __pyx_temp_idx_0;
                        Py_ssize_t __pyx_temp_extent_1 = __pyx_v_linkage.shape[1];
                        Py_ssize_t __pyx_temp_stride_1 = __pyx_v_linkage.strides[1];
                        char *__pyx_temp_pointer_1;
                        Py_ssize_t __pyx_temp_idx_1;
                        __pyx_temp_pointer_0 = __pyx_v_linkage.data;
                        for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                          __pyx_temp_pointer_1 = __pyx_temp_pointer_0;
                          for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
                            *((__pyx_t_5numpy_uint32_t *) __pyx_temp_pointer_1) = __pyx_temp_scalar;
                            __pyx_temp_pointer_1 += __pyx_temp_stride_1;
                          }
                          __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                        }
                    }
                }
    /* … */
                {
                    __pyx_t_5numpy_uint32_t __pyx_temp_scalar = 0;
                    {
                        Py_ssize_t __pyx_temp_extent_0 = __pyx_v_linkage.shape[0];
                        Py_ssize_t __pyx_temp_stride_0 = __pyx_v_linkage.strides[0];
                        char *__pyx_temp_pointer_0;
                        Py_ssize_t __pyx_temp_idx_0;
                        Py_ssize_t __pyx_temp_extent_1 = __pyx_v_linkage.shape[1];
                        Py_ssize_t __pyx_temp_stride_1 = __pyx_v_linkage.strides[1];
                        char *__pyx_temp_pointer_1;
                        Py_ssize_t __pyx_temp_idx_1;
                        __pyx_temp_pointer_0 = __pyx_v_linkage.data;
                        for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                          __pyx_temp_pointer_1 = __pyx_temp_pointer_0;
                          for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
                            *((__pyx_t_5numpy_uint32_t *) __pyx_temp_pointer_1) = __pyx_temp_scalar;
                            __pyx_temp_pointer_1 += __pyx_temp_stride_1;
                          }
                          __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                        }
                    }
                }
    /* … */
                {
                    __pyx_t_5numpy_uint32_t __pyx_temp_scalar = 0;
                    {
                        Py_ssize_t __pyx_temp_extent_0 = __pyx_v_linkage.shape[0];
                        Py_ssize_t __pyx_temp_stride_0 = __pyx_v_linkage.strides[0];
                        char *__pyx_temp_pointer_0;
                        Py_ssize_t __pyx_temp_idx_0;
                        Py_ssize_t __pyx_temp_extent_1 = __pyx_v_linkage.shape[1];
                        Py_ssize_t __pyx_temp_stride_1 = __pyx_v_linkage.strides[1];
                        char *__pyx_temp_pointer_1;
                        Py_ssize_t __pyx_temp_idx_1;
                        __pyx_temp_pointer_0 = __pyx_v_linkage.data;
                        for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                          __pyx_temp_pointer_1 = __pyx_temp_pointer_0;
                          for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
                            *((__pyx_t_5numpy_uint32_t *) __pyx_temp_pointer_1) = __pyx_temp_scalar;
                            __pyx_temp_pointer_1 += __pyx_temp_stride_1;
                          }
                          __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                        }
                    }
                }
    /* … */
                {
                    __pyx_t_5numpy_uint32_t __pyx_temp_scalar = 0;
                    {
                        Py_ssize_t __pyx_temp_extent_0 = __pyx_v_linkage.shape[0];
                        Py_ssize_t __pyx_temp_stride_0 = __pyx_v_linkage.strides[0];
                        char *__pyx_temp_pointer_0;
                        Py_ssize_t __pyx_temp_idx_0;
                        Py_ssize_t __pyx_temp_extent_1 = __pyx_v_linkage.shape[1];
                        Py_ssize_t __pyx_temp_stride_1 = __pyx_v_linkage.strides[1];
                        char *__pyx_temp_pointer_1;
                        Py_ssize_t __pyx_temp_idx_1;
                        __pyx_temp_pointer_0 = __pyx_v_linkage.data;
                        for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                          __pyx_temp_pointer_1 = __pyx_temp_pointer_0;
                          for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
                            *((__pyx_t_5numpy_uint32_t *) __pyx_temp_pointer_1) = __pyx_temp_scalar;
                            __pyx_temp_pointer_1 += __pyx_temp_stride_1;
                          }
                          __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                        }
                    }
                }
    /* … */
                {
                    __pyx_t_5numpy_uint32_t __pyx_temp_scalar = 0;
                    {
                        Py_ssize_t __pyx_temp_extent_0 = __pyx_v_linkage.shape[0];
                        Py_ssize_t __pyx_temp_stride_0 = __pyx_v_linkage.strides[0];
                        char *__pyx_temp_pointer_0;
                        Py_ssize_t __pyx_temp_idx_0;
                        Py_ssize_t __pyx_temp_extent_1 = __pyx_v_linkage.shape[1];
                        Py_ssize_t __pyx_temp_stride_1 = __pyx_v_linkage.strides[1];
                        char *__pyx_temp_pointer_1;
                        Py_ssize_t __pyx_temp_idx_1;
                        __pyx_temp_pointer_0 = __pyx_v_linkage.data;
                        for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                          __pyx_temp_pointer_1 = __pyx_temp_pointer_0;
                          for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
                            *((__pyx_t_5numpy_uint32_t *) __pyx_temp_pointer_1) = __pyx_temp_scalar;
                            __pyx_temp_pointer_1 += __pyx_temp_stride_1;
                          }
                          __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                        }
                    }
                }
    /* … */
                {
                    __pyx_t_5numpy_uint32_t __pyx_temp_scalar = 0;
                    {
                        Py_ssize_t __pyx_temp_extent_0 = __pyx_v_linkage.shape[0];
                        Py_ssize_t __pyx_temp_stride_0 = __pyx_v_linkage.strides[0];
                        char *__pyx_temp_pointer_0;
                        Py_ssize_t __pyx_temp_idx_0;
                        Py_ssize_t __pyx_temp_extent_1 = __pyx_v_linkage.shape[1];
                        Py_ssize_t __pyx_temp_stride_1 = __pyx_v_linkage.strides[1];
                        char *__pyx_temp_pointer_1;
                        Py_ssize_t __pyx_temp_idx_1;
                        __pyx_temp_pointer_0 = __pyx_v_linkage.data;
                        for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                          __pyx_temp_pointer_1 = __pyx_temp_pointer_0;
                          for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
                            *((__pyx_t_5numpy_uint32_t *) __pyx_temp_pointer_1) = __pyx_temp_scalar;
                            __pyx_temp_pointer_1 += __pyx_temp_stride_1;
                          }
                          __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                        }
                    }
                }
    /* … */
                {
                    __pyx_t_5numpy_uint32_t __pyx_temp_scalar = 0;
                    {
                        Py_ssize_t __pyx_temp_extent_0 = __pyx_v_linkage.shape[0];
                        Py_ssize_t __pyx_temp_stride_0 = __pyx_v_linkage.strides[0];
                        char *__pyx_temp_pointer_0;
                        Py_ssize_t __pyx_temp_idx_0;
                        Py_ssize_t __pyx_temp_extent_1 = __pyx_v_linkage.shape[1];
                        Py_ssize_t __pyx_temp_stride_1 = __pyx_v_linkage.strides[1];
                        char *__pyx_temp_pointer_1;
                        Py_ssize_t __pyx_temp_idx_1;
                        __pyx_temp_pointer_0 = __pyx_v_linkage.data;
                        for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
                          __pyx_temp_pointer_1 = __pyx_temp_pointer_0;
                          for (__pyx_temp_idx_1 = 0; __pyx_temp_idx_1 < __pyx_temp_extent_1; __pyx_temp_idx_1++) {
                            *((__pyx_t_5numpy_uint32_t *) __pyx_temp_pointer_1) = __pyx_temp_scalar;
                            __pyx_temp_pointer_1 += __pyx_temp_stride_1;
                          }
                          __pyx_temp_pointer_0 += __pyx_temp_stride_0;
                        }
                    }
                }

    +1068:                         for j in range(2, n_samples):

                __pyx_t_37 = __pyx_v_n_samples;
                for (__pyx_t_38 = 2; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) {
                  __pyx_v_j = __pyx_t_38;
    /* … */
                __pyx_t_37 = __pyx_v_n_samples;
                for (__pyx_t_38 = 2; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) {
                  __pyx_v_j = __pyx_t_38;
    /* … */
                __pyx_t_37 = __pyx_v_n_samples;
                for (__pyx_t_38 = 2; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) {
                  __pyx_v_j = __pyx_t_38;
    /* … */
                __pyx_t_37 = __pyx_v_n_samples;
                for (__pyx_t_38 = 2; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) {
                  __pyx_v_j = __pyx_t_38;
    /* … */
                __pyx_t_37 = __pyx_v_n_samples;
                for (__pyx_t_38 = 2; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) {
                  __pyx_v_j = __pyx_t_38;
    /* … */
                __pyx_t_37 = __pyx_v_n_samples;
                for (__pyx_t_38 = 2; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) {
                  __pyx_v_j = __pyx_t_38;
    /* … */
                __pyx_t_37 = __pyx_v_n_samples;
                for (__pyx_t_38 = 2; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) {
                  __pyx_v_j = __pyx_t_38;
    /* … */
                __pyx_t_37 = __pyx_v_n_samples;
                for (__pyx_t_38 = 2; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) {
                  __pyx_v_j = __pyx_t_38;

    +1069:                             if is_phased[ii, j] and is_phased[i, j]:

                  __pyx_t_39 = __pyx_v_ii;
                  __pyx_t_40 = __pyx_v_j;
                  __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_39 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_40 * __pyx_v_is_phased.strides[1]) ))) != 0);
                  if (__pyx_t_24) {
                  } else {
                    __pyx_t_14 = __pyx_t_24;
                    goto __pyx_L23_bool_binop_done;
                  }
                  __pyx_t_41 = __pyx_v_i;
                  __pyx_t_42 = __pyx_v_j;
                  __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_41 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_42 * __pyx_v_is_phased.strides[1]) ))) != 0);
                  __pyx_t_14 = __pyx_t_24;
                  __pyx_L23_bool_binop_done:;
                  if (__pyx_t_14) {
    /* … */
                  }
                }
    /* … */
                  __pyx_t_39 = __pyx_v_ii;
                  __pyx_t_40 = __pyx_v_j;
                  __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_39 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_40 * __pyx_v_is_phased.strides[1]) ))) != 0);
                  if (__pyx_t_24) {
                  } else {
                    __pyx_t_14 = __pyx_t_24;
                    goto __pyx_L23_bool_binop_done;
                  }
                  __pyx_t_41 = __pyx_v_i;
                  __pyx_t_42 = __pyx_v_j;
                  __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_41 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_42 * __pyx_v_is_phased.strides[1]) ))) != 0);
                  __pyx_t_14 = __pyx_t_24;
                  __pyx_L23_bool_binop_done:;
                  if (__pyx_t_14) {
    /* … */
                  }
                }
    /* … */
                  __pyx_t_39 = __pyx_v_ii;
                  __pyx_t_40 = __pyx_v_j;
                  __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_39 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_40 * __pyx_v_is_phased.strides[1]) ))) != 0);
                  if (__pyx_t_24) {
                  } else {
                    __pyx_t_14 = __pyx_t_24;
                    goto __pyx_L23_bool_binop_done;
                  }
                  __pyx_t_41 = __pyx_v_i;
                  __pyx_t_42 = __pyx_v_j;
                  __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_41 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_42 * __pyx_v_is_phased.strides[1]) ))) != 0);
                  __pyx_t_14 = __pyx_t_24;
                  __pyx_L23_bool_binop_done:;
                  if (__pyx_t_14) {
    /* … */
                  }
                }
    /* … */
                  __pyx_t_39 = __pyx_v_ii;
                  __pyx_t_40 = __pyx_v_j;
                  __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_39 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_40 * __pyx_v_is_phased.strides[1]) ))) != 0);
                  if (__pyx_t_24) {
                  } else {
                    __pyx_t_14 = __pyx_t_24;
                    goto __pyx_L23_bool_binop_done;
                  }
                  __pyx_t_41 = __pyx_v_i;
                  __pyx_t_42 = __pyx_v_j;
                  __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_41 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_42 * __pyx_v_is_phased.strides[1]) ))) != 0);
                  __pyx_t_14 = __pyx_t_24;
                  __pyx_L23_bool_binop_done:;
                  if (__pyx_t_14) {
    /* … */
                  }
                }
    /* … */
                  __pyx_t_39 = __pyx_v_ii;
                  __pyx_t_40 = __pyx_v_j;
                  __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_39 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_40 * __pyx_v_is_phased.strides[1]) ))) != 0);
                  if (__pyx_t_24) {
                  } else {
                    __pyx_t_14 = __pyx_t_24;
                    goto __pyx_L23_bool_binop_done;
                  }
                  __pyx_t_41 = __pyx_v_i;
                  __pyx_t_42 = __pyx_v_j;
                  __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_41 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_42 * __pyx_v_is_phased.strides[1]) ))) != 0);
                  __pyx_t_14 = __pyx_t_24;
                  __pyx_L23_bool_binop_done:;
                  if (__pyx_t_14) {
    /* … */
                  }
                }
    /* … */
                  __pyx_t_39 = __pyx_v_ii;
                  __pyx_t_40 = __pyx_v_j;
                  __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_39 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_40 * __pyx_v_is_phased.strides[1]) ))) != 0);
                  if (__pyx_t_24) {
                  } else {
                    __pyx_t_14 = __pyx_t_24;
                    goto __pyx_L23_bool_binop_done;
                  }
                  __pyx_t_41 = __pyx_v_i;
                  __pyx_t_42 = __pyx_v_j;
                  __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_41 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_42 * __pyx_v_is_phased.strides[1]) ))) != 0);
                  __pyx_t_14 = __pyx_t_24;
                  __pyx_L23_bool_binop_done:;
                  if (__pyx_t_14) {
    /* … */
                  }
                }
    /* … */
                  __pyx_t_39 = __pyx_v_ii;
                  __pyx_t_40 = __pyx_v_j;
                  __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_39 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_40 * __pyx_v_is_phased.strides[1]) ))) != 0);
                  if (__pyx_t_24) {
                  } else {
                    __pyx_t_14 = __pyx_t_24;
                    goto __pyx_L23_bool_binop_done;
                  }
                  __pyx_t_41 = __pyx_v_i;
                  __pyx_t_42 = __pyx_v_j;
                  __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_41 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_42 * __pyx_v_is_phased.strides[1]) ))) != 0);
                  __pyx_t_14 = __pyx_t_24;
                  __pyx_L23_bool_binop_done:;
                  if (__pyx_t_14) {
    /* … */
                  }
                }
    /* … */
                  __pyx_t_39 = __pyx_v_ii;
                  __pyx_t_40 = __pyx_v_j;
                  __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_39 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_40 * __pyx_v_is_phased.strides[1]) ))) != 0);
                  if (__pyx_t_24) {
                  } else {
                    __pyx_t_14 = __pyx_t_24;
                    goto __pyx_L23_bool_binop_done;
                  }
                  __pyx_t_41 = __pyx_v_i;
                  __pyx_t_42 = __pyx_v_j;
                  __pyx_t_24 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_41 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_42 * __pyx_v_is_phased.strides[1]) ))) != 0);
                  __pyx_t_14 = __pyx_t_24;
                  __pyx_L23_bool_binop_done:;
                  if (__pyx_t_14) {
    /* … */
                  }
                }

    +1070:                                 x = g[ii, j, parent]

                    __pyx_t_43 = __pyx_v_ii;
                    __pyx_t_44 = __pyx_v_j;
                    __pyx_t_45 = __pyx_v_parent;
                    __pyx_v_x = (*((__pyx_t_5numpy_int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_43 * __pyx_v_g.strides[0]) ) + __pyx_t_44 * __pyx_v_g.strides[1]) ) + __pyx_t_45 * __pyx_v_g.strides[2]) )));
    /* … */
                    __pyx_t_43 = __pyx_v_ii;
                    __pyx_t_44 = __pyx_v_j;
                    __pyx_t_45 = __pyx_v_parent;
                    __pyx_v_x = (*((__pyx_t_5numpy_int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_43 * __pyx_v_g.strides[0]) ) + __pyx_t_44 * __pyx_v_g.strides[1]) ) + __pyx_t_45 * __pyx_v_g.strides[2]) )));
    /* … */
                    __pyx_t_43 = __pyx_v_ii;
                    __pyx_t_44 = __pyx_v_j;
                    __pyx_t_45 = __pyx_v_parent;
                    __pyx_v_x = (*((__pyx_t_5numpy_int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_43 * __pyx_v_g.strides[0]) ) + __pyx_t_44 * __pyx_v_g.strides[1]) ) + __pyx_t_45 * __pyx_v_g.strides[2]) )));
    /* … */
                    __pyx_t_43 = __pyx_v_ii;
                    __pyx_t_44 = __pyx_v_j;
                    __pyx_t_45 = __pyx_v_parent;
                    __pyx_v_x = (*((__pyx_t_5numpy_int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_43 * __pyx_v_g.strides[0]) ) + __pyx_t_44 * __pyx_v_g.strides[1]) ) + __pyx_t_45 * __pyx_v_g.strides[2]) )));
    /* … */
                    __pyx_t_43 = __pyx_v_ii;
                    __pyx_t_44 = __pyx_v_j;
                    __pyx_t_45 = __pyx_v_parent;
                    __pyx_v_x = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_43 * __pyx_v_g.strides[0]) ) + __pyx_t_44 * __pyx_v_g.strides[1]) ) + __pyx_t_45 * __pyx_v_g.strides[2]) )));
    /* … */
                    __pyx_t_43 = __pyx_v_ii;
                    __pyx_t_44 = __pyx_v_j;
                    __pyx_t_45 = __pyx_v_parent;
                    __pyx_v_x = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_43 * __pyx_v_g.strides[0]) ) + __pyx_t_44 * __pyx_v_g.strides[1]) ) + __pyx_t_45 * __pyx_v_g.strides[2]) )));
    /* … */
                    __pyx_t_43 = __pyx_v_ii;
                    __pyx_t_44 = __pyx_v_j;
                    __pyx_t_45 = __pyx_v_parent;
                    __pyx_v_x = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_43 * __pyx_v_g.strides[0]) ) + __pyx_t_44 * __pyx_v_g.strides[1]) ) + __pyx_t_45 * __pyx_v_g.strides[2]) )));
    /* … */
                    __pyx_t_43 = __pyx_v_ii;
                    __pyx_t_44 = __pyx_v_j;
                    __pyx_t_45 = __pyx_v_parent;
                    __pyx_v_x = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_43 * __pyx_v_g.strides[0]) ) + __pyx_t_44 * __pyx_v_g.strides[1]) ) + __pyx_t_45 * __pyx_v_g.strides[2]) )));

    +1071:                                 y = g[i, j, parent]

                    __pyx_t_46 = __pyx_v_i;
                    __pyx_t_47 = __pyx_v_j;
                    __pyx_t_48 = __pyx_v_parent;
                    __pyx_v_y = (*((__pyx_t_5numpy_int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_46 * __pyx_v_g.strides[0]) ) + __pyx_t_47 * __pyx_v_g.strides[1]) ) + __pyx_t_48 * __pyx_v_g.strides[2]) )));
    /* … */
                    __pyx_t_46 = __pyx_v_i;
                    __pyx_t_47 = __pyx_v_j;
                    __pyx_t_48 = __pyx_v_parent;
                    __pyx_v_y = (*((__pyx_t_5numpy_int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_46 * __pyx_v_g.strides[0]) ) + __pyx_t_47 * __pyx_v_g.strides[1]) ) + __pyx_t_48 * __pyx_v_g.strides[2]) )));
    /* … */
                    __pyx_t_46 = __pyx_v_i;
                    __pyx_t_47 = __pyx_v_j;
                    __pyx_t_48 = __pyx_v_parent;
                    __pyx_v_y = (*((__pyx_t_5numpy_int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_46 * __pyx_v_g.strides[0]) ) + __pyx_t_47 * __pyx_v_g.strides[1]) ) + __pyx_t_48 * __pyx_v_g.strides[2]) )));
    /* … */
                    __pyx_t_46 = __pyx_v_i;
                    __pyx_t_47 = __pyx_v_j;
                    __pyx_t_48 = __pyx_v_parent;
                    __pyx_v_y = (*((__pyx_t_5numpy_int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_46 * __pyx_v_g.strides[0]) ) + __pyx_t_47 * __pyx_v_g.strides[1]) ) + __pyx_t_48 * __pyx_v_g.strides[2]) )));
    /* … */
                    __pyx_t_46 = __pyx_v_i;
                    __pyx_t_47 = __pyx_v_j;
                    __pyx_t_48 = __pyx_v_parent;
                    __pyx_v_y = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_46 * __pyx_v_g.strides[0]) ) + __pyx_t_47 * __pyx_v_g.strides[1]) ) + __pyx_t_48 * __pyx_v_g.strides[2]) )));
    /* … */
                    __pyx_t_46 = __pyx_v_i;
                    __pyx_t_47 = __pyx_v_j;
                    __pyx_t_48 = __pyx_v_parent;
                    __pyx_v_y = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_46 * __pyx_v_g.strides[0]) ) + __pyx_t_47 * __pyx_v_g.strides[1]) ) + __pyx_t_48 * __pyx_v_g.strides[2]) )));
    /* … */
                    __pyx_t_46 = __pyx_v_i;
                    __pyx_t_47 = __pyx_v_j;
                    __pyx_t_48 = __pyx_v_parent;
                    __pyx_v_y = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_46 * __pyx_v_g.strides[0]) ) + __pyx_t_47 * __pyx_v_g.strides[1]) ) + __pyx_t_48 * __pyx_v_g.strides[2]) )));
    /* … */
                    __pyx_t_46 = __pyx_v_i;
                    __pyx_t_47 = __pyx_v_j;
                    __pyx_t_48 = __pyx_v_parent;
                    __pyx_v_y = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_46 * __pyx_v_g.strides[0]) ) + __pyx_t_47 * __pyx_v_g.strides[1]) ) + __pyx_t_48 * __pyx_v_g.strides[2]) )));

    +1072:                                 linkage[x, y] += 1

                    __pyx_t_49 = __pyx_v_x;
                    __pyx_t_50 = __pyx_v_y;
                    *((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_49 * __pyx_v_linkage.strides[0]) ) + __pyx_t_50 * __pyx_v_linkage.strides[1]) )) += 1;
    /* … */
                    __pyx_t_49 = __pyx_v_x;
                    __pyx_t_50 = __pyx_v_y;
                    *((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_49 * __pyx_v_linkage.strides[0]) ) + __pyx_t_50 * __pyx_v_linkage.strides[1]) )) += 1;
    /* … */
                    __pyx_t_49 = __pyx_v_x;
                    __pyx_t_50 = __pyx_v_y;
                    *((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_49 * __pyx_v_linkage.strides[0]) ) + __pyx_t_50 * __pyx_v_linkage.strides[1]) )) += 1;
    /* … */
                    __pyx_t_6 = __pyx_v_x;
                    __pyx_t_49 = __pyx_v_y;
                    *((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_6 * __pyx_v_linkage.strides[0]) ) + __pyx_t_49 * __pyx_v_linkage.strides[1]) )) += 1;
    /* … */
                    __pyx_t_49 = __pyx_v_x;
                    __pyx_t_50 = __pyx_v_y;
                    *((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_49 * __pyx_v_linkage.strides[0]) ) + __pyx_t_50 * __pyx_v_linkage.strides[1]) )) += 1;
    /* … */
                    __pyx_t_49 = __pyx_v_x;
                    __pyx_t_50 = __pyx_v_y;
                    *((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_49 * __pyx_v_linkage.strides[0]) ) + __pyx_t_50 * __pyx_v_linkage.strides[1]) )) += 1;
    /* … */
                    __pyx_t_49 = __pyx_v_x;
                    __pyx_t_50 = __pyx_v_y;
                    *((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_49 * __pyx_v_linkage.strides[0]) ) + __pyx_t_50 * __pyx_v_linkage.strides[1]) )) += 1;
    /* … */
                    __pyx_t_6 = __pyx_v_x;
                    __pyx_t_49 = __pyx_v_y;
                    *((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_6 * __pyx_v_linkage.strides[0]) ) + __pyx_t_49 * __pyx_v_linkage.strides[1]) )) += 1;

     1073:

     1074:                         # accumulate evidence

    +1075:                         keep += linkage[pa1, a1] + linkage[pa2, a2]

                __pyx_t_51 = __pyx_v_pa1;
                __pyx_t_52 = __pyx_v_a1;
                __pyx_t_53 = __pyx_v_pa2;
                __pyx_t_54 = __pyx_v_a2;
                __pyx_v_keep = (__pyx_v_keep + ((*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_51 * __pyx_v_linkage.strides[0]) ) + __pyx_t_52 * __pyx_v_linkage.strides[1]) ))) + (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_53 * __pyx_v_linkage.strides[0]) ) + __pyx_t_54 * __pyx_v_linkage.strides[1]) )))));
    /* … */
                __pyx_t_51 = __pyx_v_pa1;
                __pyx_t_52 = __pyx_v_a1;
                __pyx_t_53 = __pyx_v_pa2;
                __pyx_t_54 = __pyx_v_a2;
                __pyx_v_keep = (__pyx_v_keep + ((*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_51 * __pyx_v_linkage.strides[0]) ) + __pyx_t_52 * __pyx_v_linkage.strides[1]) ))) + (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_53 * __pyx_v_linkage.strides[0]) ) + __pyx_t_54 * __pyx_v_linkage.strides[1]) )))));
    /* … */
                __pyx_t_51 = __pyx_v_pa1;
                __pyx_t_52 = __pyx_v_a1;
                __pyx_t_53 = __pyx_v_pa2;
                __pyx_t_54 = __pyx_v_a2;
                __pyx_v_keep = (__pyx_v_keep + ((*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_51 * __pyx_v_linkage.strides[0]) ) + __pyx_t_52 * __pyx_v_linkage.strides[1]) ))) + (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_53 * __pyx_v_linkage.strides[0]) ) + __pyx_t_54 * __pyx_v_linkage.strides[1]) )))));
    /* … */
                __pyx_t_50 = __pyx_v_pa1;
                __pyx_t_51 = __pyx_v_a1;
                __pyx_t_52 = __pyx_v_pa2;
                __pyx_t_53 = __pyx_v_a2;
                __pyx_v_keep = (__pyx_v_keep + ((*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_50 * __pyx_v_linkage.strides[0]) ) + __pyx_t_51 * __pyx_v_linkage.strides[1]) ))) + (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_52 * __pyx_v_linkage.strides[0]) ) + __pyx_t_53 * __pyx_v_linkage.strides[1]) )))));
    /* … */
                __pyx_t_51 = __pyx_v_pa1;
                __pyx_t_52 = __pyx_v_a1;
                __pyx_t_53 = __pyx_v_pa2;
                __pyx_t_54 = __pyx_v_a2;
                __pyx_v_keep = (__pyx_v_keep + ((*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_51 * __pyx_v_linkage.strides[0]) ) + __pyx_t_52 * __pyx_v_linkage.strides[1]) ))) + (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_53 * __pyx_v_linkage.strides[0]) ) + __pyx_t_54 * __pyx_v_linkage.strides[1]) )))));
    /* … */
                __pyx_t_51 = __pyx_v_pa1;
                __pyx_t_52 = __pyx_v_a1;
                __pyx_t_53 = __pyx_v_pa2;
                __pyx_t_54 = __pyx_v_a2;
                __pyx_v_keep = (__pyx_v_keep + ((*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_51 * __pyx_v_linkage.strides[0]) ) + __pyx_t_52 * __pyx_v_linkage.strides[1]) ))) + (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_53 * __pyx_v_linkage.strides[0]) ) + __pyx_t_54 * __pyx_v_linkage.strides[1]) )))));
    /* … */
                __pyx_t_51 = __pyx_v_pa1;
                __pyx_t_52 = __pyx_v_a1;
                __pyx_t_53 = __pyx_v_pa2;
                __pyx_t_54 = __pyx_v_a2;
                __pyx_v_keep = (__pyx_v_keep + ((*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_51 * __pyx_v_linkage.strides[0]) ) + __pyx_t_52 * __pyx_v_linkage.strides[1]) ))) + (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_53 * __pyx_v_linkage.strides[0]) ) + __pyx_t_54 * __pyx_v_linkage.strides[1]) )))));
    /* … */
                __pyx_t_50 = __pyx_v_pa1;
                __pyx_t_51 = __pyx_v_a1;
                __pyx_t_52 = __pyx_v_pa2;
                __pyx_t_53 = __pyx_v_a2;
                __pyx_v_keep = (__pyx_v_keep + ((*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_50 * __pyx_v_linkage.strides[0]) ) + __pyx_t_51 * __pyx_v_linkage.strides[1]) ))) + (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_52 * __pyx_v_linkage.strides[0]) ) + __pyx_t_53 * __pyx_v_linkage.strides[1]) )))));

    +1076:                         flip += linkage[pa1, a2] + linkage[pa2, a1]

                __pyx_t_55 = __pyx_v_pa1;
                __pyx_t_56 = __pyx_v_a2;
                __pyx_t_57 = __pyx_v_pa2;
                __pyx_t_58 = __pyx_v_a1;
                __pyx_v_flip = (__pyx_v_flip + ((*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_55 * __pyx_v_linkage.strides[0]) ) + __pyx_t_56 * __pyx_v_linkage.strides[1]) ))) + (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_57 * __pyx_v_linkage.strides[0]) ) + __pyx_t_58 * __pyx_v_linkage.strides[1]) )))));
    /* … */
                __pyx_t_55 = __pyx_v_pa1;
                __pyx_t_56 = __pyx_v_a2;
                __pyx_t_57 = __pyx_v_pa2;
                __pyx_t_58 = __pyx_v_a1;
                __pyx_v_flip = (__pyx_v_flip + ((*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_55 * __pyx_v_linkage.strides[0]) ) + __pyx_t_56 * __pyx_v_linkage.strides[1]) ))) + (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_57 * __pyx_v_linkage.strides[0]) ) + __pyx_t_58 * __pyx_v_linkage.strides[1]) )))));
    /* … */
                __pyx_t_55 = __pyx_v_pa1;
                __pyx_t_56 = __pyx_v_a2;
                __pyx_t_57 = __pyx_v_pa2;
                __pyx_t_58 = __pyx_v_a1;
                __pyx_v_flip = (__pyx_v_flip + ((*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_55 * __pyx_v_linkage.strides[0]) ) + __pyx_t_56 * __pyx_v_linkage.strides[1]) ))) + (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_57 * __pyx_v_linkage.strides[0]) ) + __pyx_t_58 * __pyx_v_linkage.strides[1]) )))));
    /* … */
                __pyx_t_54 = __pyx_v_pa1;
                __pyx_t_55 = __pyx_v_a2;
                __pyx_t_56 = __pyx_v_pa2;
                __pyx_t_57 = __pyx_v_a1;
                __pyx_v_flip = (__pyx_v_flip + ((*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_54 * __pyx_v_linkage.strides[0]) ) + __pyx_t_55 * __pyx_v_linkage.strides[1]) ))) + (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_56 * __pyx_v_linkage.strides[0]) ) + __pyx_t_57 * __pyx_v_linkage.strides[1]) )))));
    /* … */
                __pyx_t_55 = __pyx_v_pa1;
                __pyx_t_56 = __pyx_v_a2;
                __pyx_t_57 = __pyx_v_pa2;
                __pyx_t_58 = __pyx_v_a1;
                __pyx_v_flip = (__pyx_v_flip + ((*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_55 * __pyx_v_linkage.strides[0]) ) + __pyx_t_56 * __pyx_v_linkage.strides[1]) ))) + (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_57 * __pyx_v_linkage.strides[0]) ) + __pyx_t_58 * __pyx_v_linkage.strides[1]) )))));
    /* … */
                __pyx_t_55 = __pyx_v_pa1;
                __pyx_t_56 = __pyx_v_a2;
                __pyx_t_57 = __pyx_v_pa2;
                __pyx_t_58 = __pyx_v_a1;
                __pyx_v_flip = (__pyx_v_flip + ((*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_55 * __pyx_v_linkage.strides[0]) ) + __pyx_t_56 * __pyx_v_linkage.strides[1]) ))) + (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_57 * __pyx_v_linkage.strides[0]) ) + __pyx_t_58 * __pyx_v_linkage.strides[1]) )))));
    /* … */
                __pyx_t_55 = __pyx_v_pa1;
                __pyx_t_56 = __pyx_v_a2;
                __pyx_t_57 = __pyx_v_pa2;
                __pyx_t_58 = __pyx_v_a1;
                __pyx_v_flip = (__pyx_v_flip + ((*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_55 * __pyx_v_linkage.strides[0]) ) + __pyx_t_56 * __pyx_v_linkage.strides[1]) ))) + (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_57 * __pyx_v_linkage.strides[0]) ) + __pyx_t_58 * __pyx_v_linkage.strides[1]) )))));
    /* … */
                __pyx_t_54 = __pyx_v_pa1;
                __pyx_t_55 = __pyx_v_a2;
                __pyx_t_56 = __pyx_v_pa2;
                __pyx_t_57 = __pyx_v_a1;
                __pyx_v_flip = (__pyx_v_flip + ((*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_54 * __pyx_v_linkage.strides[0]) ) + __pyx_t_55 * __pyx_v_linkage.strides[1]) ))) + (*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_linkage.data + __pyx_t_56 * __pyx_v_linkage.strides[0]) ) + __pyx_t_57 * __pyx_v_linkage.strides[1]) )))));

     1077:

    +1078:                     ii -= 1

              __pyx_v_ii = (__pyx_v_ii - 1);
            }
    /* … */
              __pyx_v_ii = (__pyx_v_ii - 1);
            }
    /* … */
              __pyx_v_ii = (__pyx_v_ii - 1);
            }
    /* … */
              __pyx_v_ii = (__pyx_v_ii - 1);
            }
    /* … */
              __pyx_v_ii = (__pyx_v_ii - 1);
            }
    /* … */
              __pyx_v_ii = (__pyx_v_ii - 1);
            }
    /* … */
              __pyx_v_ii = (__pyx_v_ii - 1);
            }
    /* … */
              __pyx_v_ii = (__pyx_v_ii - 1);
            }

     1079:

     1080:                 # make a decision

    +1081:                 if n_inf == 0:

            __pyx_t_14 = ((__pyx_v_n_inf == 0) != 0);
            if (__pyx_t_14) {
    /* … */
              goto __pyx_L25;
            }
    /* … */
            __pyx_t_14 = ((__pyx_v_n_inf == 0) != 0);
            if (__pyx_t_14) {
    /* … */
              goto __pyx_L25;
            }
    /* … */
            __pyx_t_14 = ((__pyx_v_n_inf == 0) != 0);
            if (__pyx_t_14) {
    /* … */
              goto __pyx_L25;
            }
    /* … */
            __pyx_t_14 = ((__pyx_v_n_inf == 0) != 0);
            if (__pyx_t_14) {
    /* … */
              goto __pyx_L25;
            }
    /* … */
            __pyx_t_14 = ((__pyx_v_n_inf == 0) != 0);
            if (__pyx_t_14) {
    /* … */
              goto __pyx_L25;
            }
    /* … */
            __pyx_t_14 = ((__pyx_v_n_inf == 0) != 0);
            if (__pyx_t_14) {
    /* … */
              goto __pyx_L25;
            }
    /* … */
            __pyx_t_14 = ((__pyx_v_n_inf == 0) != 0);
            if (__pyx_t_14) {
    /* … */
              goto __pyx_L25;
            }
    /* … */
            __pyx_t_14 = ((__pyx_v_n_inf == 0) != 0);
            if (__pyx_t_14) {
    /* … */
              goto __pyx_L25;
            }

     1082:                     # no previous informative variants, start of data,

     1083:                     # phase arbitrarily

    +1084:                     is_phased[i, parent] = 1

              __pyx_t_59 = __pyx_v_i;
              __pyx_t_60 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_59 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_60 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_59 = __pyx_v_i;
              __pyx_t_60 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_59 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_60 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_59 = __pyx_v_i;
              __pyx_t_60 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_59 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_60 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_58 = __pyx_v_i;
              __pyx_t_59 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_58 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_59 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_59 = __pyx_v_i;
              __pyx_t_60 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_59 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_60 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_59 = __pyx_v_i;
              __pyx_t_60 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_59 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_60 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_59 = __pyx_v_i;
              __pyx_t_60 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_59 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_60 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_58 = __pyx_v_i;
              __pyx_t_59 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_58 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_59 * __pyx_v_is_phased.strides[1]) )) = 1;

     1085:

    +1086:                 elif keep > flip:

            __pyx_t_14 = ((__pyx_v_keep > __pyx_v_flip) != 0);
            if (__pyx_t_14) {
    /* … */
              goto __pyx_L25;
            }
    /* … */
            __pyx_t_14 = ((__pyx_v_keep > __pyx_v_flip) != 0);
            if (__pyx_t_14) {
    /* … */
              goto __pyx_L25;
            }
    /* … */
            __pyx_t_14 = ((__pyx_v_keep > __pyx_v_flip) != 0);
            if (__pyx_t_14) {
    /* … */
              goto __pyx_L25;
            }
    /* … */
            __pyx_t_14 = ((__pyx_v_keep > __pyx_v_flip) != 0);
            if (__pyx_t_14) {
    /* … */
              goto __pyx_L25;
            }
    /* … */
            __pyx_t_14 = ((__pyx_v_keep > __pyx_v_flip) != 0);
            if (__pyx_t_14) {
    /* … */
              goto __pyx_L25;
            }
    /* … */
            __pyx_t_14 = ((__pyx_v_keep > __pyx_v_flip) != 0);
            if (__pyx_t_14) {
    /* … */
              goto __pyx_L25;
            }
    /* … */
            __pyx_t_14 = ((__pyx_v_keep > __pyx_v_flip) != 0);
            if (__pyx_t_14) {
    /* … */
              goto __pyx_L25;
            }
    /* … */
            __pyx_t_14 = ((__pyx_v_keep > __pyx_v_flip) != 0);
            if (__pyx_t_14) {
    /* … */
              goto __pyx_L25;
            }

    +1087:                     is_phased[i, parent] = 1

              __pyx_t_61 = __pyx_v_i;
              __pyx_t_62 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_61 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_62 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_61 = __pyx_v_i;
              __pyx_t_62 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_61 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_62 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_61 = __pyx_v_i;
              __pyx_t_62 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_61 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_62 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_60 = __pyx_v_i;
              __pyx_t_61 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_60 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_61 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_61 = __pyx_v_i;
              __pyx_t_62 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_61 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_62 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_61 = __pyx_v_i;
              __pyx_t_62 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_61 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_62 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_61 = __pyx_v_i;
              __pyx_t_62 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_61 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_62 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_60 = __pyx_v_i;
              __pyx_t_61 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_60 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_61 * __pyx_v_is_phased.strides[1]) )) = 1;

     1088:

    +1089:                 elif flip > keep:

            __pyx_t_14 = ((__pyx_v_flip > __pyx_v_keep) != 0);
            if (__pyx_t_14) {
    /* … */
            }
            __pyx_L25:;
    /* … */
            __pyx_t_14 = ((__pyx_v_flip > __pyx_v_keep) != 0);
            if (__pyx_t_14) {
    /* … */
            }
            __pyx_L25:;
    /* … */
            __pyx_t_14 = ((__pyx_v_flip > __pyx_v_keep) != 0);
            if (__pyx_t_14) {
    /* … */
            }
            __pyx_L25:;
    /* … */
            __pyx_t_14 = ((__pyx_v_flip > __pyx_v_keep) != 0);
            if (__pyx_t_14) {
    /* … */
            }
            __pyx_L25:;
    /* … */
            __pyx_t_14 = ((__pyx_v_flip > __pyx_v_keep) != 0);
            if (__pyx_t_14) {
    /* … */
            }
            __pyx_L25:;
    /* … */
            __pyx_t_14 = ((__pyx_v_flip > __pyx_v_keep) != 0);
            if (__pyx_t_14) {
    /* … */
            }
            __pyx_L25:;
    /* … */
            __pyx_t_14 = ((__pyx_v_flip > __pyx_v_keep) != 0);
            if (__pyx_t_14) {
    /* … */
            }
            __pyx_L25:;
    /* … */
            __pyx_t_14 = ((__pyx_v_flip > __pyx_v_keep) != 0);
            if (__pyx_t_14) {
    /* … */
            }
            __pyx_L25:;

    +1090:                     is_phased[i, parent] = 1

              __pyx_t_63 = __pyx_v_i;
              __pyx_t_64 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_63 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_64 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_63 = __pyx_v_i;
              __pyx_t_64 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_63 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_64 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_63 = __pyx_v_i;
              __pyx_t_64 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_63 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_64 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_62 = __pyx_v_i;
              __pyx_t_63 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_62 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_63 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_63 = __pyx_v_i;
              __pyx_t_64 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_63 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_64 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_63 = __pyx_v_i;
              __pyx_t_64 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_63 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_64 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_63 = __pyx_v_i;
              __pyx_t_64 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_63 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_64 * __pyx_v_is_phased.strides[1]) )) = 1;
    /* … */
              __pyx_t_62 = __pyx_v_i;
              __pyx_t_63 = __pyx_v_parent;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_is_phased.data + __pyx_t_62 * __pyx_v_is_phased.strides[0]) ) + __pyx_t_63 * __pyx_v_is_phased.strides[1]) )) = 1;

    +1091:                     g[i, parent, 0] = a2

              __pyx_t_65 = __pyx_v_i;
              __pyx_t_66 = __pyx_v_parent;
              __pyx_t_67 = 0;
              *((__pyx_t_5numpy_int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_65 * __pyx_v_g.strides[0]) ) + __pyx_t_66 * __pyx_v_g.strides[1]) ) + __pyx_t_67 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;
    /* … */
              __pyx_t_65 = __pyx_v_i;
              __pyx_t_66 = __pyx_v_parent;
              __pyx_t_67 = 0;
              *((__pyx_t_5numpy_int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_65 * __pyx_v_g.strides[0]) ) + __pyx_t_66 * __pyx_v_g.strides[1]) ) + __pyx_t_67 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;
    /* … */
              __pyx_t_65 = __pyx_v_i;
              __pyx_t_66 = __pyx_v_parent;
              __pyx_t_67 = 0;
              *((__pyx_t_5numpy_int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_65 * __pyx_v_g.strides[0]) ) + __pyx_t_66 * __pyx_v_g.strides[1]) ) + __pyx_t_67 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;
    /* … */
              __pyx_t_64 = __pyx_v_i;
              __pyx_t_65 = __pyx_v_parent;
              __pyx_t_66 = 0;
              *((__pyx_t_5numpy_int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_64 * __pyx_v_g.strides[0]) ) + __pyx_t_65 * __pyx_v_g.strides[1]) ) + __pyx_t_66 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;
    /* … */
              __pyx_t_65 = __pyx_v_i;
              __pyx_t_66 = __pyx_v_parent;
              __pyx_t_67 = 0;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_65 * __pyx_v_g.strides[0]) ) + __pyx_t_66 * __pyx_v_g.strides[1]) ) + __pyx_t_67 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;
    /* … */
              __pyx_t_65 = __pyx_v_i;
              __pyx_t_66 = __pyx_v_parent;
              __pyx_t_67 = 0;
              *((__pyx_t_5numpy_uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_65 * __pyx_v_g.strides[0]) ) + __pyx_t_66 * __pyx_v_g.strides[1]) ) + __pyx_t_67 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;
    /* … */
              __pyx_t_65 = __pyx_v_i;
              __pyx_t_66 = __pyx_v_parent;
              __pyx_t_67 = 0;
              *((__pyx_t_5numpy_uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_65 * __pyx_v_g.strides[0]) ) + __pyx_t_66 * __pyx_v_g.strides[1]) ) + __pyx_t_67 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;
    /* … */
              __pyx_t_64 = __pyx_v_i;
              __pyx_t_65 = __pyx_v_parent;
              __pyx_t_66 = 0;
              *((__pyx_t_5numpy_uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_64 * __pyx_v_g.strides[0]) ) + __pyx_t_65 * __pyx_v_g.strides[1]) ) + __pyx_t_66 * __pyx_v_g.strides[2]) )) = __pyx_v_a2;

    +1092:                     g[i, parent, 1] = a1

              __pyx_t_68 = __pyx_v_i;
              __pyx_t_69 = __pyx_v_parent;
              __pyx_t_70 = 1;
              *((__pyx_t_5numpy_int8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_68 * __pyx_v_g.strides[0]) ) + __pyx_t_69 * __pyx_v_g.strides[1]) ) + __pyx_t_70 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;
    /* … */
              __pyx_t_68 = __pyx_v_i;
              __pyx_t_69 = __pyx_v_parent;
              __pyx_t_70 = 1;
              *((__pyx_t_5numpy_int16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_68 * __pyx_v_g.strides[0]) ) + __pyx_t_69 * __pyx_v_g.strides[1]) ) + __pyx_t_70 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;
    /* … */
              __pyx_t_68 = __pyx_v_i;
              __pyx_t_69 = __pyx_v_parent;
              __pyx_t_70 = 1;
              *((__pyx_t_5numpy_int32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_68 * __pyx_v_g.strides[0]) ) + __pyx_t_69 * __pyx_v_g.strides[1]) ) + __pyx_t_70 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;
    /* … */
              __pyx_t_67 = __pyx_v_i;
              __pyx_t_68 = __pyx_v_parent;
              __pyx_t_69 = 1;
              *((__pyx_t_5numpy_int64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_67 * __pyx_v_g.strides[0]) ) + __pyx_t_68 * __pyx_v_g.strides[1]) ) + __pyx_t_69 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;
    /* … */
              __pyx_t_68 = __pyx_v_i;
              __pyx_t_69 = __pyx_v_parent;
              __pyx_t_70 = 1;
              *((__pyx_t_5numpy_uint8_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_68 * __pyx_v_g.strides[0]) ) + __pyx_t_69 * __pyx_v_g.strides[1]) ) + __pyx_t_70 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;
    /* … */
              __pyx_t_68 = __pyx_v_i;
              __pyx_t_69 = __pyx_v_parent;
              __pyx_t_70 = 1;
              *((__pyx_t_5numpy_uint16_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_68 * __pyx_v_g.strides[0]) ) + __pyx_t_69 * __pyx_v_g.strides[1]) ) + __pyx_t_70 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;
    /* … */
              __pyx_t_68 = __pyx_v_i;
              __pyx_t_69 = __pyx_v_parent;
              __pyx_t_70 = 1;
              *((__pyx_t_5numpy_uint32_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_68 * __pyx_v_g.strides[0]) ) + __pyx_t_69 * __pyx_v_g.strides[1]) ) + __pyx_t_70 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;
    /* … */
              __pyx_t_67 = __pyx_v_i;
              __pyx_t_68 = __pyx_v_parent;
              __pyx_t_69 = 1;
              *((__pyx_t_5numpy_uint64_t *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_g.data + __pyx_t_67 * __pyx_v_g.strides[0]) ) + __pyx_t_68 * __pyx_v_g.strides[1]) ) + __pyx_t_69 * __pyx_v_g.strides[2]) )) = __pyx_v_a1;

     1093:

     1094:

    +1095: def state_transitions(integer[:] x, states):

    /* Python wrapper */
    static PyObject *__pyx_pw_5allel_3opt_5stats_37state_transitions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_5allel_3opt_5stats_36state_transitions[] = "Find state transitions in a sequence of state values.\n\n    Parameters\n    ----------\n    x : array_like, int\n        1-dimensional array of state values.\n    states : set\n        Set of states of interest. Any state value not in this set will be ignored.\n\n    Returns\n    -------\n    switch_points : ndarray, int\n        2-dimensional array of switch points, where the first column contains indices of\n        values on the left side of a switch and the second column contains indices of values\n        on the right side of a switch.\n    transitions : ndarray, int\n        2-dimensional array of state transitions, where the first column contains state\n        values on the left side of a switch and the second column contains state values\n        on the right side of a switch.\n    observations : ndarray, int\n        1-dimensional array with numbers of state observations on the left side of each switch.\n\n    Notes\n    -----\n    N.B., includes rows for the left and right-hand boundaries, which are not true state\n    transitions but capture the first and last state observations.\n\n    ";
    static PyMethodDef __pyx_mdef_5allel_3opt_5stats_37state_transitions = {"state_transitions", (PyCFunction)__pyx_pw_5allel_3opt_5stats_37state_transitions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_36state_transitions};
    static PyObject *__pyx_pw_5allel_3opt_5stats_37state_transitions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_signatures = 0;
      PyObject *__pyx_v_args = 0;
      PyObject *__pyx_v_kwargs = 0;
      CYTHON_UNUSED PyObject *__pyx_v_defaults = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,0};
        PyObject* values[4] = {0,0,0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signatures)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 1095, __pyx_L3_error)
            }
            case  2:
            if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 1095, __pyx_L3_error)
            }
            case  3:
            if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_defaults)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 1095, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 1095, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
          values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
          values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        }
        __pyx_v_signatures = values[0];
        __pyx_v_args = values[1];
        __pyx_v_kwargs = values[2];
        __pyx_v_defaults = values[3];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1095, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_36state_transitions(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_36state_transitions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
      PyObject *__pyx_v_dest_sig = NULL;
      PyTypeObject *__pyx_v_ndarray = 0;
      PyObject *__pyx_v_numpy = NULL;
      __Pyx_memviewslice __pyx_v_memslice;
      Py_ssize_t __pyx_v_itemsize;
      int __pyx_v_dtype_signed;
      char __pyx_v_kind;
      int __pyx_v____pyx_int32_t_is_signed;
      int __pyx_v____pyx_uint32_t_is_signed;
      int __pyx_v____pyx_uint16_t_is_signed;
      int __pyx_v____pyx_int16_t_is_signed;
      int __pyx_v____pyx_uint64_t_is_signed;
      int __pyx_v____pyx_uint8_t_is_signed;
      int __pyx_v____pyx_int64_t_is_signed;
      int __pyx_v____pyx_int8_t_is_signed;
      PyObject *__pyx_v_arg = NULL;
      PyObject *__pyx_v_dtype = NULL;
      PyObject *__pyx_v_arg_base = NULL;
      PyObject *__pyx_v_candidates = NULL;
      PyObject *__pyx_v_sig = NULL;
      int __pyx_v_match_found;
      PyObject *__pyx_v_src_type = NULL;
      PyObject *__pyx_v_dst_type = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("state_transitions", 0);
      __Pyx_TraceCall("state_transitions", __pyx_f[0], 1095, 0, __PYX_ERR(0, 1095, __pyx_L1_error));
      __Pyx_INCREF(__pyx_v_kwargs);
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
      __pyx_v_dest_sig = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_2 = (__pyx_v_kwargs == Py_None);
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {
        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1);
        __pyx_t_1 = 0;
      }
      {
        /*try:*/ {
          __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_v_numpy = __pyx_t_1;
          __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 1095, __pyx_L4_error)
          __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1);
          __pyx_t_1 = 0;
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L11_try_end;
        __pyx_L4_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
        if (__pyx_t_7) {
          __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 1095, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_INCREF(Py_None);
          __Pyx_XDECREF_SET(__pyx_v_ndarray, ((PyTypeObject*)Py_None));
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L5_exception_handled;
        }
        goto __pyx_L6_except_error;
        __pyx_L6_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L1_error;
        __pyx_L5_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        __pyx_L11_try_end:;
      }
      __pyx_v_itemsize = -1L;
      __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1L) < 0);
      __pyx_v____pyx_uint32_t_is_signed = (((__pyx_t_5numpy_uint32_t)-1L) < 0);
      __pyx_v____pyx_uint16_t_is_signed = (((__pyx_t_5numpy_uint16_t)-1L) < 0);
      __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1L) < 0);
      __pyx_v____pyx_uint64_t_is_signed = (((__pyx_t_5numpy_uint64_t)-1L) < 0);
      __pyx_v____pyx_uint8_t_is_signed = (((__pyx_t_5numpy_uint8_t)-1L) < 0);
      __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1L) < 0);
      __pyx_v____pyx_int8_t_is_signed = (((__pyx_t_5numpy_int8_t)-1L) < 0);
      if (unlikely(__pyx_v_args == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 1095, __pyx_L1_error)
      }
      __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1095, __pyx_L1_error)
      __pyx_t_3 = ((0 < __pyx_t_10) != 0);
      if (__pyx_t_3) {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 1095, __pyx_L1_error)
        }
        __pyx_t_9 = __Pyx_GetItemInt_Tuple(((PyObject*)__pyx_v_args), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1095, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      if (unlikely(__pyx_v_kwargs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 1095, __pyx_L1_error)
      }
      __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_x, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1095, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {
        if (unlikely(__pyx_v_kwargs == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 1095, __pyx_L1_error)
        }
        __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_x); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1095, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_v_arg = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L14;
      }
      /*else*/ {
        if (unlikely(__pyx_v_args == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(0, 1095, __pyx_L1_error)
        }
        __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1095, __pyx_L1_error)
        __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1095, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1095, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1095, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1095, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 1095, __pyx_L1_error)
      }
      __pyx_L14:;
      while (1) {
        __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None));
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {
          __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1095, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_dtype = __pyx_t_8;
            __pyx_t_8 = 0;
            goto __pyx_L18;
          }
          __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1095, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_v_arg_base = __pyx_t_8;
            __pyx_t_8 = 0;
            __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
            __pyx_t_2 = (__pyx_t_3 != 0);
            if (__pyx_t_2) {
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1095, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_v_dtype = __pyx_t_8;
              __pyx_t_8 = 0;
              goto __pyx_L19;
            }
            /*else*/ {
              __Pyx_INCREF(Py_None);
              __pyx_v_dtype = Py_None;
            }
            __pyx_L19:;
            goto __pyx_L18;
          }
          /*else*/ {
            __Pyx_INCREF(Py_None);
            __pyx_v_dtype = Py_None;
          }
          __pyx_L18:;
          __pyx_v_itemsize = -1L;
          __pyx_t_2 = (__pyx_v_dtype != Py_None);
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1095, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_itemsize = __pyx_t_10;
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1095, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 1095, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_v_kind = __pyx_t_11;
            __pyx_v_dtype_signed = (__pyx_v_kind == 'i');
            switch (__pyx_v_kind) {
              case 'i':
              case 'u':
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1095, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L22_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L22_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1095, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1095, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L26_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L26_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1095, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1095, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L30_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L30_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1095, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1095, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L34_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L34_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1095, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint8_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1095, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L38_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint8_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L38_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1095, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint16_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1095, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L42_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L42_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1095, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint32_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1095, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L46_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L46_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1095, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              __pyx_t_2 = (((sizeof(__pyx_t_5numpy_uint64_t)) == __pyx_v_itemsize) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1095, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error)
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
              if (__pyx_t_2) {
              } else {
                __pyx_t_3 = __pyx_t_2;
                goto __pyx_L50_bool_binop_done;
              }
              __pyx_t_2 = ((!((__pyx_v____pyx_uint64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
              __pyx_t_3 = __pyx_t_2;
              __pyx_L50_bool_binop_done:;
              if (__pyx_t_3) {
                if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1095, __pyx_L1_error)
                goto __pyx_L16_break;
              }
              break;
              case 'f':
              break;
              case 'c':
              break;
              case 'O':
              break;
              default: break;
            }
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L54_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L54_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1095, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L58_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L58_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1095, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L62_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L62_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1095, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L66_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L66_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1095, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L70_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint8_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L70_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint8_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1095, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L74_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint16_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L74_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1095, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L78_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint32_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L78_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1095, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
        if (!__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L82_bool_binop_done;
        }
        __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_uint64_t))) != 0);
        __pyx_t_3 = __pyx_t_2;
        __pyx_L82_bool_binop_done:;
        if (__pyx_t_3) {
          __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(__pyx_v_arg);
          __pyx_v_memslice = __pyx_t_12;
          __pyx_t_3 = (__pyx_v_memslice.memview != 0);
          if (__pyx_t_3) {
            __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
            if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_uint64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1095, __pyx_L1_error)
            goto __pyx_L16_break;
          }
          /*else*/ {
            PyErr_Clear();
          }
        }
        if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 1095, __pyx_L1_error)
        goto __pyx_L16_break;
      }
      __pyx_L16_break:;
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_candidates = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_10 = 0;
      if (unlikely(__pyx_v_signatures == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(0, 1095, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8);
      __pyx_t_8 = __pyx_t_9;
      __pyx_t_9 = 0;
      while (1) {
        __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_13, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7);
        if (unlikely(__pyx_t_14 == 0)) break;
        if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 1095, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_v_match_found = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1095, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1095, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /* … */
      __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__72);
      __Pyx_GIVEREF(__pyx_tuple__72);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1095, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
        __Pyx_INCREF(__pyx_v_dest_sig);
        __Pyx_GIVEREF(__pyx_v_dest_sig);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dest_sig);
        __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
          __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_15 = 0;
          __pyx_t_16 = NULL;
        } else {
          __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1095, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1095, __pyx_L1_error)
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        for (;;) {
          if (likely(!__pyx_t_16)) {
            if (likely(PyList_CheckExact(__pyx_t_9))) {
              if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 1095, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            } else {
              if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 1095, __pyx_L1_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            }
          } else {
            __pyx_t_1 = __pyx_t_16(__pyx_t_9);
            if (unlikely(!__pyx_t_1)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 1095, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_1);
          }
          if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
            PyObject* sequence = __pyx_t_1;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 1095, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1);
            } else {
              __pyx_t_17 = PyList_GET_ITEM(sequence, 0);
              __pyx_t_18 = PyList_GET_ITEM(sequence, 1);
            }
            __Pyx_INCREF(__pyx_t_17);
            __Pyx_INCREF(__pyx_t_18);
            #else
            __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1095, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1095, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_18);
            #endif
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1095, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
            index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_17);
            index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L89_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_18);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) __PYX_ERR(0, 1095, __pyx_L1_error)
            __pyx_t_20 = NULL;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            goto __pyx_L90_unpacking_done;
            __pyx_L89_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __pyx_t_20 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 1095, __pyx_L1_error)
            __pyx_L90_unpacking_done:;
          }
          __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17);
          __pyx_t_17 = 0;
          __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18);
          __pyx_t_18 = 0;
          __pyx_t_3 = (__pyx_v_dst_type != Py_None);
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
            __pyx_t_1 = PyObject_RichCompare(__pyx_v_src_type, __pyx_v_dst_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L1_error)
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1095, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (__pyx_t_2) {
              __pyx_v_match_found = 1;
              goto __pyx_L92;
            }
            /*else*/ {
              __pyx_v_match_found = 0;
              goto __pyx_L88_break;
            }
            __pyx_L92:;
          }
        }
        __pyx_L88_break:;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_2 = (__pyx_v_match_found != 0);
        if (__pyx_t_2) {
          __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 1095, __pyx_L1_error)
        }
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
      __pyx_t_3 = ((!__pyx_t_2) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s__8); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__73);
      __Pyx_GIVEREF(__pyx_tuple__73);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1095, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 1095, __pyx_L1_error)
      }
      __pyx_t_13 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 1095, __pyx_L1_error)
      __pyx_t_3 = ((__pyx_t_13 > 1) != 0);
      if (__pyx_t_3) {
      __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__74);
      __Pyx_GIVEREF(__pyx_tuple__74);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1095, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(0, 1095, __pyx_L1_error)
      }
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_signatures == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 1095, __pyx_L1_error)
        }
        __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_candidates, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1095, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1095, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_r = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L0;
      }

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_AddTraceback("allel.opt.stats.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_dest_sig);
      __Pyx_XDECREF(__pyx_v_ndarray);
      __Pyx_XDECREF(__pyx_v_numpy);
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XDECREF(__pyx_v_dtype);
      __Pyx_XDECREF(__pyx_v_arg_base);
      __Pyx_XDECREF(__pyx_v_candidates);
      __Pyx_XDECREF(__pyx_v_sig);
      __Pyx_XDECREF(__pyx_v_src_type);
      __Pyx_XDECREF(__pyx_v_dst_type);
      __Pyx_XDECREF(__pyx_v_kwargs);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_273state_transitions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_273state_transitions = {"__pyx_fuse_0state_transitions", (PyCFunction)__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_273state_transitions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_36state_transitions};
    static PyObject *__pyx_fuse_0__pyx_pw_5allel_3opt_5stats_273state_transitions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_states = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("state_transitions (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_states,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_states)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("state_transitions", 1, 2, 2, 1); __PYX_ERR(0, 1095, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "state_transitions") < 0)) __PYX_ERR(0, 1095, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int8_t(values[0]); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 1095, __pyx_L3_error)
        __pyx_v_states = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("state_transitions", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1095, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.state_transitions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_272state_transitions(__pyx_self, __pyx_v_x, __pyx_v_states);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_272state_transitions(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, PyObject *__pyx_v_states) {
      Py_ssize_t __pyx_v_cur_idx;
      Py_ssize_t __pyx_v_prv_idx;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_observed;
      __pyx_t_5numpy_int8_t __pyx_v_cur;
      __pyx_t_5numpy_int8_t __pyx_v_prv;
      PyObject *__pyx_v_switch_points = 0;
      PyObject *__pyx_v_transitions = 0;
      PyObject *__pyx_v_observations = 0;
      __Pyx_memviewslice __pyx_v_is_state = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_max_state = NULL;
      PyObject *__pyx_v_switch = NULL;
      PyObject *__pyx_v_transition = NULL;
      PyObject *__pyx_v_s = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_0state_transitions", 0);
      __Pyx_TraceCall("__pyx_fuse_0state_transitions", __pyx_f[0], 1095, 0, __PYX_ERR(0, 1095, __pyx_L1_error));
      __Pyx_INCREF(__pyx_v_states);
      __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__75);
      __Pyx_GIVEREF(__pyx_tuple__75);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_8);
      __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
      __Pyx_XDECREF(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_16);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_AddTraceback("allel.opt.stats.state_transitions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_switch_points);
      __Pyx_XDECREF(__pyx_v_transitions);
      __Pyx_XDECREF(__pyx_v_observations);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_state, 1);
      __Pyx_XDECREF(__pyx_v_max_state);
      __Pyx_XDECREF(__pyx_v_switch);
      __Pyx_XDECREF(__pyx_v_transition);
      __Pyx_XDECREF(__pyx_v_s);
      __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
      __Pyx_XDECREF(__pyx_v_states);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_275state_transitions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_275state_transitions = {"__pyx_fuse_1state_transitions", (PyCFunction)__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_275state_transitions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_36state_transitions};
    static PyObject *__pyx_fuse_1__pyx_pw_5allel_3opt_5stats_275state_transitions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_states = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("state_transitions (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_states,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_states)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("state_transitions", 1, 2, 2, 1); __PYX_ERR(0, 1095, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "state_transitions") < 0)) __PYX_ERR(0, 1095, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 1095, __pyx_L3_error)
        __pyx_v_states = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("state_transitions", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1095, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.state_transitions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_274state_transitions(__pyx_self, __pyx_v_x, __pyx_v_states);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_274state_transitions(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, PyObject *__pyx_v_states) {
      Py_ssize_t __pyx_v_cur_idx;
      Py_ssize_t __pyx_v_prv_idx;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_observed;
      __pyx_t_5numpy_int16_t __pyx_v_cur;
      __pyx_t_5numpy_int16_t __pyx_v_prv;
      PyObject *__pyx_v_switch_points = 0;
      PyObject *__pyx_v_transitions = 0;
      PyObject *__pyx_v_observations = 0;
      __Pyx_memviewslice __pyx_v_is_state = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_max_state = NULL;
      PyObject *__pyx_v_switch = NULL;
      PyObject *__pyx_v_transition = NULL;
      PyObject *__pyx_v_s = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_1state_transitions", 0);
      __Pyx_TraceCall("__pyx_fuse_1state_transitions", __pyx_f[0], 1095, 0, __PYX_ERR(0, 1095, __pyx_L1_error));
      __Pyx_INCREF(__pyx_v_states);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_8);
      __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
      __Pyx_XDECREF(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_16);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_AddTraceback("allel.opt.stats.state_transitions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_switch_points);
      __Pyx_XDECREF(__pyx_v_transitions);
      __Pyx_XDECREF(__pyx_v_observations);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_state, 1);
      __Pyx_XDECREF(__pyx_v_max_state);
      __Pyx_XDECREF(__pyx_v_switch);
      __Pyx_XDECREF(__pyx_v_transition);
      __Pyx_XDECREF(__pyx_v_s);
      __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
      __Pyx_XDECREF(__pyx_v_states);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_277state_transitions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_277state_transitions = {"__pyx_fuse_2state_transitions", (PyCFunction)__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_277state_transitions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_36state_transitions};
    static PyObject *__pyx_fuse_2__pyx_pw_5allel_3opt_5stats_277state_transitions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_states = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("state_transitions (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_states,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_states)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("state_transitions", 1, 2, 2, 1); __PYX_ERR(0, 1095, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "state_transitions") < 0)) __PYX_ERR(0, 1095, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 1095, __pyx_L3_error)
        __pyx_v_states = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("state_transitions", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1095, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.state_transitions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_276state_transitions(__pyx_self, __pyx_v_x, __pyx_v_states);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_276state_transitions(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, PyObject *__pyx_v_states) {
      Py_ssize_t __pyx_v_cur_idx;
      Py_ssize_t __pyx_v_prv_idx;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_observed;
      __pyx_t_5numpy_int32_t __pyx_v_cur;
      __pyx_t_5numpy_int32_t __pyx_v_prv;
      PyObject *__pyx_v_switch_points = 0;
      PyObject *__pyx_v_transitions = 0;
      PyObject *__pyx_v_observations = 0;
      __Pyx_memviewslice __pyx_v_is_state = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_max_state = NULL;
      PyObject *__pyx_v_switch = NULL;
      PyObject *__pyx_v_transition = NULL;
      PyObject *__pyx_v_s = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_2state_transitions", 0);
      __Pyx_TraceCall("__pyx_fuse_2state_transitions", __pyx_f[0], 1095, 0, __PYX_ERR(0, 1095, __pyx_L1_error));
      __Pyx_INCREF(__pyx_v_states);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_8);
      __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
      __Pyx_XDECREF(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_16);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_AddTraceback("allel.opt.stats.state_transitions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_switch_points);
      __Pyx_XDECREF(__pyx_v_transitions);
      __Pyx_XDECREF(__pyx_v_observations);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_state, 1);
      __Pyx_XDECREF(__pyx_v_max_state);
      __Pyx_XDECREF(__pyx_v_switch);
      __Pyx_XDECREF(__pyx_v_transition);
      __Pyx_XDECREF(__pyx_v_s);
      __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
      __Pyx_XDECREF(__pyx_v_states);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_279state_transitions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_279state_transitions = {"__pyx_fuse_3state_transitions", (PyCFunction)__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_279state_transitions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_36state_transitions};
    static PyObject *__pyx_fuse_3__pyx_pw_5allel_3opt_5stats_279state_transitions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_states = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("state_transitions (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_states,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_states)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("state_transitions", 1, 2, 2, 1); __PYX_ERR(0, 1095, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "state_transitions") < 0)) __PYX_ERR(0, 1095, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 1095, __pyx_L3_error)
        __pyx_v_states = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("state_transitions", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1095, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.state_transitions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_278state_transitions(__pyx_self, __pyx_v_x, __pyx_v_states);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_278state_transitions(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, PyObject *__pyx_v_states) {
      Py_ssize_t __pyx_v_cur_idx;
      Py_ssize_t __pyx_v_prv_idx;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_observed;
      __pyx_t_5numpy_int64_t __pyx_v_cur;
      __pyx_t_5numpy_int64_t __pyx_v_prv;
      PyObject *__pyx_v_switch_points = 0;
      PyObject *__pyx_v_transitions = 0;
      PyObject *__pyx_v_observations = 0;
      __Pyx_memviewslice __pyx_v_is_state = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_max_state = NULL;
      PyObject *__pyx_v_switch = NULL;
      PyObject *__pyx_v_transition = NULL;
      PyObject *__pyx_v_s = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_3state_transitions", 0);
      __Pyx_TraceCall("__pyx_fuse_3state_transitions", __pyx_f[0], 1095, 0, __PYX_ERR(0, 1095, __pyx_L1_error));
      __Pyx_INCREF(__pyx_v_states);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_8);
      __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
      __Pyx_XDECREF(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_16);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_AddTraceback("allel.opt.stats.state_transitions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_switch_points);
      __Pyx_XDECREF(__pyx_v_transitions);
      __Pyx_XDECREF(__pyx_v_observations);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_state, 1);
      __Pyx_XDECREF(__pyx_v_max_state);
      __Pyx_XDECREF(__pyx_v_switch);
      __Pyx_XDECREF(__pyx_v_transition);
      __Pyx_XDECREF(__pyx_v_s);
      __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
      __Pyx_XDECREF(__pyx_v_states);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_281state_transitions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_281state_transitions = {"__pyx_fuse_4state_transitions", (PyCFunction)__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_281state_transitions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_36state_transitions};
    static PyObject *__pyx_fuse_4__pyx_pw_5allel_3opt_5stats_281state_transitions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_states = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("state_transitions (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_states,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_states)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("state_transitions", 1, 2, 2, 1); __PYX_ERR(0, 1095, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "state_transitions") < 0)) __PYX_ERR(0, 1095, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(values[0]); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 1095, __pyx_L3_error)
        __pyx_v_states = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("state_transitions", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1095, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.state_transitions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_280state_transitions(__pyx_self, __pyx_v_x, __pyx_v_states);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_280state_transitions(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, PyObject *__pyx_v_states) {
      Py_ssize_t __pyx_v_cur_idx;
      Py_ssize_t __pyx_v_prv_idx;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_observed;
      __pyx_t_5numpy_uint8_t __pyx_v_cur;
      __pyx_t_5numpy_uint8_t __pyx_v_prv;
      PyObject *__pyx_v_switch_points = 0;
      PyObject *__pyx_v_transitions = 0;
      PyObject *__pyx_v_observations = 0;
      __Pyx_memviewslice __pyx_v_is_state = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_max_state = NULL;
      PyObject *__pyx_v_switch = NULL;
      PyObject *__pyx_v_transition = NULL;
      PyObject *__pyx_v_s = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_4state_transitions", 0);
      __Pyx_TraceCall("__pyx_fuse_4state_transitions", __pyx_f[0], 1095, 0, __PYX_ERR(0, 1095, __pyx_L1_error));
      __Pyx_INCREF(__pyx_v_states);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_8);
      __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
      __Pyx_XDECREF(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_16);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_AddTraceback("allel.opt.stats.state_transitions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_switch_points);
      __Pyx_XDECREF(__pyx_v_transitions);
      __Pyx_XDECREF(__pyx_v_observations);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_state, 1);
      __Pyx_XDECREF(__pyx_v_max_state);
      __Pyx_XDECREF(__pyx_v_switch);
      __Pyx_XDECREF(__pyx_v_transition);
      __Pyx_XDECREF(__pyx_v_s);
      __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
      __Pyx_XDECREF(__pyx_v_states);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_283state_transitions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_283state_transitions = {"__pyx_fuse_5state_transitions", (PyCFunction)__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_283state_transitions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_36state_transitions};
    static PyObject *__pyx_fuse_5__pyx_pw_5allel_3opt_5stats_283state_transitions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_states = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("state_transitions (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_states,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_states)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("state_transitions", 1, 2, 2, 1); __PYX_ERR(0, 1095, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "state_transitions") < 0)) __PYX_ERR(0, 1095, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint16_t(values[0]); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 1095, __pyx_L3_error)
        __pyx_v_states = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("state_transitions", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1095, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.state_transitions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_282state_transitions(__pyx_self, __pyx_v_x, __pyx_v_states);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_282state_transitions(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, PyObject *__pyx_v_states) {
      Py_ssize_t __pyx_v_cur_idx;
      Py_ssize_t __pyx_v_prv_idx;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_observed;
      __pyx_t_5numpy_uint16_t __pyx_v_cur;
      __pyx_t_5numpy_uint16_t __pyx_v_prv;
      PyObject *__pyx_v_switch_points = 0;
      PyObject *__pyx_v_transitions = 0;
      PyObject *__pyx_v_observations = 0;
      __Pyx_memviewslice __pyx_v_is_state = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_max_state = NULL;
      PyObject *__pyx_v_switch = NULL;
      PyObject *__pyx_v_transition = NULL;
      PyObject *__pyx_v_s = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_5state_transitions", 0);
      __Pyx_TraceCall("__pyx_fuse_5state_transitions", __pyx_f[0], 1095, 0, __PYX_ERR(0, 1095, __pyx_L1_error));
      __Pyx_INCREF(__pyx_v_states);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_8);
      __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
      __Pyx_XDECREF(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_16);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_AddTraceback("allel.opt.stats.state_transitions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_switch_points);
      __Pyx_XDECREF(__pyx_v_transitions);
      __Pyx_XDECREF(__pyx_v_observations);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_state, 1);
      __Pyx_XDECREF(__pyx_v_max_state);
      __Pyx_XDECREF(__pyx_v_switch);
      __Pyx_XDECREF(__pyx_v_transition);
      __Pyx_XDECREF(__pyx_v_s);
      __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
      __Pyx_XDECREF(__pyx_v_states);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_285state_transitions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_285state_transitions = {"__pyx_fuse_6state_transitions", (PyCFunction)__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_285state_transitions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_36state_transitions};
    static PyObject *__pyx_fuse_6__pyx_pw_5allel_3opt_5stats_285state_transitions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_states = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("state_transitions (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_states,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_states)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("state_transitions", 1, 2, 2, 1); __PYX_ERR(0, 1095, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "state_transitions") < 0)) __PYX_ERR(0, 1095, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[0]); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 1095, __pyx_L3_error)
        __pyx_v_states = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("state_transitions", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1095, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.state_transitions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_284state_transitions(__pyx_self, __pyx_v_x, __pyx_v_states);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_284state_transitions(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, PyObject *__pyx_v_states) {
      Py_ssize_t __pyx_v_cur_idx;
      Py_ssize_t __pyx_v_prv_idx;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_observed;
      __pyx_t_5numpy_uint32_t __pyx_v_cur;
      __pyx_t_5numpy_uint32_t __pyx_v_prv;
      PyObject *__pyx_v_switch_points = 0;
      PyObject *__pyx_v_transitions = 0;
      PyObject *__pyx_v_observations = 0;
      __Pyx_memviewslice __pyx_v_is_state = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_max_state = NULL;
      PyObject *__pyx_v_switch = NULL;
      PyObject *__pyx_v_transition = NULL;
      PyObject *__pyx_v_s = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_6state_transitions", 0);
      __Pyx_TraceCall("__pyx_fuse_6state_transitions", __pyx_f[0], 1095, 0, __PYX_ERR(0, 1095, __pyx_L1_error));
      __Pyx_INCREF(__pyx_v_states);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_8);
      __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
      __Pyx_XDECREF(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_16);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_AddTraceback("allel.opt.stats.state_transitions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_switch_points);
      __Pyx_XDECREF(__pyx_v_transitions);
      __Pyx_XDECREF(__pyx_v_observations);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_state, 1);
      __Pyx_XDECREF(__pyx_v_max_state);
      __Pyx_XDECREF(__pyx_v_switch);
      __Pyx_XDECREF(__pyx_v_transition);
      __Pyx_XDECREF(__pyx_v_s);
      __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
      __Pyx_XDECREF(__pyx_v_states);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_287state_transitions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyMethodDef __pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_287state_transitions = {"__pyx_fuse_7state_transitions", (PyCFunction)__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_287state_transitions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5allel_3opt_5stats_36state_transitions};
    static PyObject *__pyx_fuse_7__pyx_pw_5allel_3opt_5stats_287state_transitions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_states = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("state_transitions (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_states,0};
        PyObject* values[2] = {0,0};
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_states)) != 0)) kw_args--;
            else {
              __Pyx_RaiseArgtupleInvalid("state_transitions", 1, 2, 2, 1); __PYX_ERR(0, 1095, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "state_transitions") < 0)) __PYX_ERR(0, 1095, __pyx_L3_error)
          }
        } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
          values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        }
        __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(values[0]); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 1095, __pyx_L3_error)
        __pyx_v_states = values[1];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("state_transitions", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1095, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("allel.opt.stats.state_transitions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_5allel_3opt_5stats_286state_transitions(__pyx_self, __pyx_v_x, __pyx_v_states);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_5allel_3opt_5stats_286state_transitions(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, PyObject *__pyx_v_states) {
      Py_ssize_t __pyx_v_cur_idx;
      Py_ssize_t __pyx_v_prv_idx;
      Py_ssize_t __pyx_v_n;
      Py_ssize_t __pyx_v_observed;
      __pyx_t_5numpy_uint64_t __pyx_v_cur;
      __pyx_t_5numpy_uint64_t __pyx_v_prv;
      PyObject *__pyx_v_switch_points = 0;
      PyObject *__pyx_v_transitions = 0;
      PyObject *__pyx_v_observations = 0;
      __Pyx_memviewslice __pyx_v_is_state = { 0, 0, { 0 }, { 0 }, { 0 } };
      PyObject *__pyx_v_max_state = NULL;
      PyObject *__pyx_v_switch = NULL;
      PyObject *__pyx_v_transition = NULL;
      PyObject *__pyx_v_s = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_TraceDeclarations
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__pyx_fuse_7state_transitions", 0);
      __Pyx_TraceCall("__pyx_fuse_7state_transitions", __pyx_f[0], 1095, 0, __PYX_ERR(0, 1095, __pyx_L1_error));
      __Pyx_INCREF(__pyx_v_states);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_8);
      __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
      __Pyx_XDECREF(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_16);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_AddTraceback("allel.opt.stats.state_transitions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_switch_points);
      __Pyx_XDECREF(__pyx_v_transitions);
      __Pyx_XDECREF(__pyx_v_observations);
      __PYX_XDEC_MEMVIEW(&__pyx_v_is_state, 1);
      __Pyx_XDECREF(__pyx_v_max_state);
      __Pyx_XDECREF(__pyx_v_switch);
      __Pyx_XDECREF(__pyx_v_transition);
      __Pyx_XDECREF(__pyx_v_s);
      __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
      __Pyx_XDECREF(__pyx_v_states);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_TraceReturn(__pyx_r, 0);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__135 = PyTuple_Pack(16, __pyx_n_s_x, __pyx_n_s_states, __pyx_n_s_cur_idx, __pyx_n_s_prv_idx, __pyx_n_s_n, __pyx_n_s_observed, __pyx_n_s_cur, __pyx_n_s_prv, __pyx_n_s_switch_points, __pyx_n_s_transitions, __pyx_n_s_observations, __pyx_n_s_is_state, __pyx_n_s_max_state, __pyx_n_s_switch, __pyx_n_s_transition, __pyx_n_s_s); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__135);
      __Pyx_GIVEREF(__pyx_tuple__135);
    /* … */
      __pyx_t_31 = PyDict_New(); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_31);
      __pyx_t_32 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_5allel_3opt_5stats_273state_transitions, 0, __pyx_n_s_state_transitions, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_32);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_32, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_31, __pyx_n_s_int8_t, __pyx_t_32) < 0) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
      __pyx_t_32 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_5allel_3opt_5stats_275state_transitions, 0, __pyx_n_s_state_transitions, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_32);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_32, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_31, __pyx_n_s_int16_t, __pyx_t_32) < 0) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
      __pyx_t_32 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_5allel_3opt_5stats_277state_transitions, 0, __pyx_n_s_state_transitions, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_32);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_32, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_31, __pyx_n_s_int32_t, __pyx_t_32) < 0) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
      __pyx_t_32 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_5allel_3opt_5stats_279state_transitions, 0, __pyx_n_s_state_transitions, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_32);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_32, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_31, __pyx_n_s_int64_t, __pyx_t_32) < 0) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
      __pyx_t_32 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_5allel_3opt_5stats_281state_transitions, 0, __pyx_n_s_state_transitions, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_32);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_32, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_31, __pyx_n_s_uint8_t, __pyx_t_32) < 0) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
      __pyx_t_32 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_5allel_3opt_5stats_283state_transitions, 0, __pyx_n_s_state_transitions, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_32);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_32, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_31, __pyx_n_s_uint16_t, __pyx_t_32) < 0) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
      __pyx_t_32 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_5allel_3opt_5stats_285state_transitions, 0, __pyx_n_s_state_transitions, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_32);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_32, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_31, __pyx_n_s_uint32_t, __pyx_t_32) < 0) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
      __pyx_t_32 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_5allel_3opt_5stats_287state_transitions, 0, __pyx_n_s_state_transitions, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_32);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_32, __pyx_empty_tuple);
      if (PyDict_SetItem(__pyx_t_31, __pyx_n_s_uint64_t, __pyx_t_32) < 0) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
      __pyx_t_32 = __pyx_FusedFunction_NewEx(&__pyx_mdef_5allel_3opt_5stats_37state_transitions, 0, __pyx_n_s_state_transitions, NULL, __pyx_n_s_allel_opt_stats, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_32);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_32, __pyx_empty_tuple);
      ((__pyx_FusedFunctionObject *) __pyx_t_32)->__signatures__ = __pyx_t_31;
      __Pyx_GIVEREF(__pyx_t_31);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_state_transitions, __pyx_t_32) < 0) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
      __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(2, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aliman_src_github_cggh_sci, __pyx_n_s_state_transitions, 1095, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(0, 1095, __pyx_L1_error)

     1096:     """Find state transitions in a sequence of state values.

     1097:

     1098:     Parameters

     1099:     ----------

     1100:     x : array_like, int

     1101:         1-dimensional array of state values.

     1102:     states : set

     1103:         Set of states of interest. Any state value not in this set will be ignored.

     1104:

     1105:     Returns

     1106:     -------

     1107:     switch_points : ndarray, int

     1108:         2-dimensional array of switch points, where the first column contains indices of

     1109:         values on the left side of a switch and the second column contains indices of values

     1110:         on the right side of a switch.

     1111:     transitions : ndarray, int

     1112:         2-dimensional array of state transitions, where the first column contains state

     1113:         values on the left side of a switch and the second column contains state values

     1114:         on the right side of a switch.

     1115:     observations : ndarray, int

     1116:         1-dimensional array with numbers of state observations on the left side of each switch.

     1117:

     1118:     Notes

     1119:     -----

     1120:     N.B., includes rows for the left and right-hand boundaries, which are not true state

     1121:     transitions but capture the first and last state observations.

     1122:

     1123:     """

     1124:

     1125:     cdef:

     1126:         Py_ssize_t cur_idx, prv_idx, n, observed

     1127:         integer cur, prv

     1128:         list switch_points, transitions, observations

     1129:         cnp.uint8_t[:] is_state

     1130:

     1131:     # setup intermediates

    +1132:     states = sorted(set(states))

      __pyx_t_2 = PySet_New(__pyx_v_states); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_1 = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_4 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_states, __pyx_t_1);
      __pyx_t_1 = 0;
    /* … */
      __pyx_t_2 = PySet_New(__pyx_v_states); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_1 = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_4 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_states, __pyx_t_1);
      __pyx_t_1 = 0;
    /* … */
      __pyx_t_2 = PySet_New(__pyx_v_states); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_1 = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_4 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_states, __pyx_t_1);
      __pyx_t_1 = 0;
    /* … */
      __pyx_t_2 = PySet_New(__pyx_v_states); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_1 = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_4 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_states, __pyx_t_1);
      __pyx_t_1 = 0;
    /* … */
      __pyx_t_2 = PySet_New(__pyx_v_states); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_1 = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_4 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_states, __pyx_t_1);
      __pyx_t_1 = 0;
    /* … */
      __pyx_t_2 = PySet_New(__pyx_v_states); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_1 = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_4 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_states, __pyx_t_1);
      __pyx_t_1 = 0;
    /* … */
      __pyx_t_2 = PySet_New(__pyx_v_states); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_1 = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_4 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_states, __pyx_t_1);
      __pyx_t_1 = 0;
    /* … */
      __pyx_t_2 = PySet_New(__pyx_v_states); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_1 = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_4 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_states, __pyx_t_1);
      __pyx_t_1 = 0;

    +1133:     if any([s < 0 for s in states]):

      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_v_states)) || PyTuple_CheckExact(__pyx_v_states)) {
        __pyx_t_3 = __pyx_v_states; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
        __pyx_t_6 = NULL;
      } else {
        __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_states); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1133, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_6)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          } else {
            if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          }
        } else {
          __pyx_t_2 = __pyx_t_6(__pyx_t_3);
          if (unlikely(!__pyx_t_2)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1133, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_RichCompare(__pyx_v_s, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1133, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_any, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_7) {
    /* … */
      }
    /* … */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_v_states)) || PyTuple_CheckExact(__pyx_v_states)) {
        __pyx_t_3 = __pyx_v_states; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
        __pyx_t_6 = NULL;
      } else {
        __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_states); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1133, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_6)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          } else {
            if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          }
        } else {
          __pyx_t_2 = __pyx_t_6(__pyx_t_3);
          if (unlikely(!__pyx_t_2)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1133, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_RichCompare(__pyx_v_s, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1133, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_any, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_7) {
    /* … */
      }
    /* … */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_v_states)) || PyTuple_CheckExact(__pyx_v_states)) {
        __pyx_t_3 = __pyx_v_states; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
        __pyx_t_6 = NULL;
      } else {
        __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_states); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1133, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_6)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          } else {
            if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          }
        } else {
          __pyx_t_2 = __pyx_t_6(__pyx_t_3);
          if (unlikely(!__pyx_t_2)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1133, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_RichCompare(__pyx_v_s, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1133, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_any, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_7) {
    /* … */
      }
    /* … */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_v_states)) || PyTuple_CheckExact(__pyx_v_states)) {
        __pyx_t_3 = __pyx_v_states; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
        __pyx_t_6 = NULL;
      } else {
        __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_states); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1133, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_6)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          } else {
            if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          }
        } else {
          __pyx_t_2 = __pyx_t_6(__pyx_t_3);
          if (unlikely(!__pyx_t_2)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1133, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_RichCompare(__pyx_v_s, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1133, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_any, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_7) {
    /* … */
      }
    /* … */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_v_states)) || PyTuple_CheckExact(__pyx_v_states)) {
        __pyx_t_3 = __pyx_v_states; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
        __pyx_t_6 = NULL;
      } else {
        __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_states); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1133, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_6)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          } else {
            if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          }
        } else {
          __pyx_t_2 = __pyx_t_6(__pyx_t_3);
          if (unlikely(!__pyx_t_2)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1133, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_RichCompare(__pyx_v_s, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1133, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_any, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_7) {
    /* … */
      }
    /* … */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_v_states)) || PyTuple_CheckExact(__pyx_v_states)) {
        __pyx_t_3 = __pyx_v_states; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
        __pyx_t_6 = NULL;
      } else {
        __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_states); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1133, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_6)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          } else {
            if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          }
        } else {
          __pyx_t_2 = __pyx_t_6(__pyx_t_3);
          if (unlikely(!__pyx_t_2)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1133, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_RichCompare(__pyx_v_s, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1133, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_any, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_7) {
    /* … */
      }
    /* … */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_v_states)) || PyTuple_CheckExact(__pyx_v_states)) {
        __pyx_t_3 = __pyx_v_states; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
        __pyx_t_6 = NULL;
      } else {
        __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_states); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1133, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_6)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          } else {
            if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          }
        } else {
          __pyx_t_2 = __pyx_t_6(__pyx_t_3);
          if (unlikely(!__pyx_t_2)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1133, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_RichCompare(__pyx_v_s, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1133, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_any, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_7) {
    /* … */
      }
    /* … */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_v_states)) || PyTuple_CheckExact(__pyx_v_states)) {
        __pyx_t_3 = __pyx_v_states; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
        __pyx_t_6 = NULL;
      } else {
        __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_states); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1133, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_6)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          } else {
            if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          }
        } else {
          __pyx_t_2 = __pyx_t_6(__pyx_t_3);
          if (unlikely(!__pyx_t_2)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1133, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_RichCompare(__pyx_v_s, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1133, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_any, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_7) {
    /* … */
      }

    +1134:         raise ValueError('all states must be >= 0')

        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1134, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 1134, __pyx_L1_error)
    /* … */
      __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_all_states_must_be_0); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 1134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__76);
      __Pyx_GIVEREF(__pyx_tuple__76);
    /* … */
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1134, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 1134, __pyx_L1_error)
      __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_all_states_must_be_0); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 1134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__77);
      __Pyx_GIVEREF(__pyx_tuple__77);
    /* … */
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1134, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 1134, __pyx_L1_error)
      __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_all_states_must_be_0); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 1134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__78);
      __Pyx_GIVEREF(__pyx_tuple__78);
    /* … */
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1134, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 1134, __pyx_L1_error)
      __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_all_states_must_be_0); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 1134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__79);
      __Pyx_GIVEREF(__pyx_tuple__79);
    /* … */
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1134, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 1134, __pyx_L1_error)
      __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_all_states_must_be_0); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 1134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__80);
      __Pyx_GIVEREF(__pyx_tuple__80);
    /* … */
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1134, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 1134, __pyx_L1_error)
      __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_all_states_must_be_0); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 1134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__81);
      __Pyx_GIVEREF(__pyx_tuple__81);
    /* … */
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1134, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 1134, __pyx_L1_error)
      __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_all_states_must_be_0); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 1134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__82);
      __Pyx_GIVEREF(__pyx_tuple__82);
    /* … */
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1134, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 1134, __pyx_L1_error)
      __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_all_states_must_be_0); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 1134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__83);
      __Pyx_GIVEREF(__pyx_tuple__83);

    +1135:     max_state = max(states)

      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_states);
      __Pyx_GIVEREF(__pyx_v_states);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_states);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_state = __pyx_t_3;
      __pyx_t_3 = 0;
    /* … */
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_states);
      __Pyx_GIVEREF(__pyx_v_states);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_states);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_state = __pyx_t_3;
      __pyx_t_3 = 0;
    /* … */
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_states);
      __Pyx_GIVEREF(__pyx_v_states);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_states);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_state = __pyx_t_3;
      __pyx_t_3 = 0;
    /* … */
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_states);
      __Pyx_GIVEREF(__pyx_v_states);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_states);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_state = __pyx_t_3;
      __pyx_t_3 = 0;
    /* … */
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_states);
      __Pyx_GIVEREF(__pyx_v_states);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_states);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_state = __pyx_t_3;
      __pyx_t_3 = 0;
    /* … */
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_states);
      __Pyx_GIVEREF(__pyx_v_states);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_states);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_state = __pyx_t_3;
      __pyx_t_3 = 0;
    /* … */
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_states);
      __Pyx_GIVEREF(__pyx_v_states);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_states);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_state = __pyx_t_3;
      __pyx_t_3 = 0;
    /* … */
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_states);
      __Pyx_GIVEREF(__pyx_v_states);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_states);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_max_state = __pyx_t_3;
      __pyx_t_3 = 0;

    +1136:     is_state = np.zeros(max_state + 1, dtype='u1')

      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_max_state, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 1136, __pyx_L1_error)
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_8);
      if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_is_state = __pyx_t_9;
      __pyx_t_9.memview = NULL;
      __pyx_t_9.data = NULL;
    /* … */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_max_state, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 1136, __pyx_L1_error)
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_8);
      if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_is_state = __pyx_t_9;
      __pyx_t_9.memview = NULL;
      __pyx_t_9.data = NULL;
    /* … */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_max_state, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 1136, __pyx_L1_error)
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_8);
      if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_is_state = __pyx_t_9;
      __pyx_t_9.memview = NULL;
      __pyx_t_9.data = NULL;
    /* … */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_max_state, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 1136, __pyx_L1_error)
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_8);
      if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_is_state = __pyx_t_9;
      __pyx_t_9.memview = NULL;
      __pyx_t_9.data = NULL;
    /* … */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_max_state, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 1136, __pyx_L1_error)
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_8);
      if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_is_state = __pyx_t_9;
      __pyx_t_9.memview = NULL;
      __pyx_t_9.data = NULL;
    /* … */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_max_state, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 1136, __pyx_L1_error)
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_8);
      if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_is_state = __pyx_t_9;
      __pyx_t_9.memview = NULL;
      __pyx_t_9.data = NULL;
    /* … */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_max_state, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 1136, __pyx_L1_error)
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_8);
      if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_is_state = __pyx_t_9;
      __pyx_t_9.memview = NULL;
      __pyx_t_9.data = NULL;
    /* … */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_max_state, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_u1) < 0) __PYX_ERR(0, 1136, __pyx_L1_error)
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_8);
      if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1136, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_is_state = __pyx_t_9;
      __pyx_t_9.memview = NULL;
      __pyx_t_9.data = NULL;

    +1137:     np.asarray(is_state)[states] = 1

      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_is_state, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_8);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
          __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
          __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(PyObject_SetItem(__pyx_t_8, __pyx_v_states, __pyx_int_1) < 0)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    /* … */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_is_state, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_8);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
          __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
          __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(PyObject_SetItem(__pyx_t_8, __pyx_v_states, __pyx_int_1) < 0)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    /* … */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_is_state, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_8);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
          __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
          __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(PyObject_SetItem(__pyx_t_8, __pyx_v_states, __pyx_int_1) < 0)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    /* … */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_is_state, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_8);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
          __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
          __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(PyObject_SetItem(__pyx_t_8, __pyx_v_states, __pyx_int_1) < 0)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    /* … */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_is_state, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_8);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
          __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
          __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(PyObject_SetItem(__pyx_t_8, __pyx_v_states, __pyx_int_1) < 0)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    /* … */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_is_state, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_8);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
          __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
          __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(PyObject_SetItem(__pyx_t_8, __pyx_v_states, __pyx_int_1) < 0)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    /* … */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_is_state, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_8);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
          __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
          __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(PyObject_SetItem(__pyx_t_8, __pyx_v_states, __pyx_int_1) < 0)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    /* … */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_is_state, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_8);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
          __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
          __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1137, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(PyObject_SetItem(__pyx_t_8, __pyx_v_states, __pyx_int_1) < 0)) __PYX_ERR(0, 1137, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    +1138:     n = x.shape[0]

      __pyx_v_n = (__pyx_v_x.shape[0]);
    /* … */
      __pyx_v_n = (__pyx_v_x.shape[0]);
    /* … */
      __pyx_v_n = (__pyx_v_x.shape[0]);
    /* … */
      __pyx_v_n = (__pyx_v_x.shape[0]);
    /* … */
      __pyx_v_n = (__pyx_v_x.shape[0]);
    /* … */
      __pyx_v_n = (__pyx_v_x.shape[0]);
    /* … */
      __pyx_v_n = (__pyx_v_x.shape[0]);
    /* … */
      __pyx_v_n = (__pyx_v_x.shape[0]);

    +1139:     prv_idx = -1

      __pyx_v_prv_idx = -1L;
    /* … */
      __pyx_v_prv_idx = -1L;
    /* … */
      __pyx_v_prv_idx = -1L;
    /* … */
      __pyx_v_prv_idx = -1L;
    /* … */
      __pyx_v_prv_idx = -1L;
    /* … */
      __pyx_v_prv_idx = -1L;
    /* … */
      __pyx_v_prv_idx = -1L;
    /* … */
      __pyx_v_prv_idx = -1L;

    +1140:     prv = -1

      __pyx_v_prv = -1;
    /* … */
      __pyx_v_prv = -1;
    /* … */
      __pyx_v_prv = -1;
    /* … */
      __pyx_v_prv = -1LL;
    /* … */
      __pyx_v_prv = -1;
    /* … */
      __pyx_v_prv = -1;
    /* … */
      __pyx_v_prv = -1;
    /* … */
      __pyx_v_prv = -1LL;

    +1141:     observed = 0

      __pyx_v_observed = 0;
    /* … */
      __pyx_v_observed = 0;
    /* … */
      __pyx_v_observed = 0;
    /* … */
      __pyx_v_observed = 0;
    /* … */
      __pyx_v_observed = 0;
    /* … */
      __pyx_v_observed = 0;
    /* … */
      __pyx_v_observed = 0;
    /* … */
      __pyx_v_observed = 0;

     1142:

     1143:     # setup outputs

    +1144:     switch_points = list()

      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1144, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_switch_points = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1144, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_switch_points = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1144, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_switch_points = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1144, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_switch_points = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1144, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_switch_points = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1144, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_switch_points = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1144, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_switch_points = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1144, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_switch_points = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;

    +1145:     transitions = list()

      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_transitions = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_transitions = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_transitions = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_transitions = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_transitions = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_transitions = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_transitions = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_transitions = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;

    +1146:     observations = list()

      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_observations = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_observations = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_observations = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_observations = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_observations = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_observations = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_observations = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_observations = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;

     1147:

     1148:     # iterate over state values

    +1149:     for cur_idx in range(n):

      __pyx_t_5 = __pyx_v_n;
      for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_5; __pyx_t_11+=1) {
        __pyx_v_cur_idx = __pyx_t_11;
    /* … */
      __pyx_t_5 = __pyx_v_n;
      for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_5; __pyx_t_11+=1) {
        __pyx_v_cur_idx = __pyx_t_11;
    /* … */
      __pyx_t_5 = __pyx_v_n;
      for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_5; __pyx_t_11+=1) {
        __pyx_v_cur_idx = __pyx_t_11;
    /* … */
      __pyx_t_5 = __pyx_v_n;
      for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_5; __pyx_t_11+=1) {
        __pyx_v_cur_idx = __pyx_t_11;
    /* … */
      __pyx_t_5 = __pyx_v_n;
      for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_5; __pyx_t_11+=1) {
        __pyx_v_cur_idx = __pyx_t_11;
    /* … */
      __pyx_t_5 = __pyx_v_n;
      for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_5; __pyx_t_11+=1) {
        __pyx_v_cur_idx = __pyx_t_11;
    /* … */
      __pyx_t_5 = __pyx_v_n;
      for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_5; __pyx_t_11+=1) {
        __pyx_v_cur_idx = __pyx_t_11;
    /* … */
      __pyx_t_5 = __pyx_v_n;
      for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_5; __pyx_t_11+=1) {
        __pyx_v_cur_idx = __pyx_t_11;

     1150:

     1151:         # access current state

    +1152:         cur = x[cur_idx]

        __pyx_t_12 = __pyx_v_cur_idx;
        __pyx_t_13 = -1;
        if (__pyx_t_12 < 0) {
          __pyx_t_12 += __pyx_v_x.shape[0];
          if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
        } else if (unlikely(__pyx_t_12 >= __pyx_v_x.shape[0])) __pyx_t_13 = 0;
        if (unlikely(__pyx_t_13 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_13);
          __PYX_ERR(0, 1152, __pyx_L1_error)
        }
        __pyx_v_cur = (*((__pyx_t_5numpy_int8_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_12 * __pyx_v_x.strides[0]) )));
    /* … */
        __pyx_t_12 = __pyx_v_cur_idx;
        __pyx_t_13 = -1;
        if (__pyx_t_12 < 0) {
          __pyx_t_12 += __pyx_v_x.shape[0];
          if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
        } else if (unlikely(__pyx_t_12 >= __pyx_v_x.shape[0])) __pyx_t_13 = 0;
        if (unlikely(__pyx_t_13 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_13);
          __PYX_ERR(0, 1152, __pyx_L1_error)
        }
        __pyx_v_cur = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_12 * __pyx_v_x.strides[0]) )));
    /* … */
        __pyx_t_12 = __pyx_v_cur_idx;
        __pyx_t_13 = -1;
        if (__pyx_t_12 < 0) {
          __pyx_t_12 += __pyx_v_x.shape[0];
          if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
        } else if (unlikely(__pyx_t_12 >= __pyx_v_x.shape[0])) __pyx_t_13 = 0;
        if (unlikely(__pyx_t_13 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_13);
          __PYX_ERR(0, 1152, __pyx_L1_error)
        }
        __pyx_v_cur = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_12 * __pyx_v_x.strides[0]) )));
    /* … */
        __pyx_t_12 = __pyx_v_cur_idx;
        __pyx_t_13 = -1;
        if (__pyx_t_12 < 0) {
          __pyx_t_12 += __pyx_v_x.shape[0];
          if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
        } else if (unlikely(__pyx_t_12 >= __pyx_v_x.shape[0])) __pyx_t_13 = 0;
        if (unlikely(__pyx_t_13 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_13);
          __PYX_ERR(0, 1152, __pyx_L1_error)
        }
        __pyx_v_cur = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_12 * __pyx_v_x.strides[0]) )));
    /* … */
        __pyx_t_12 = __pyx_v_cur_idx;
        __pyx_t_13 = -1;
        if (__pyx_t_12 < 0) {
          __pyx_t_12 += __pyx_v_x.shape[0];
          if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
        } else if (unlikely(__pyx_t_12 >= __pyx_v_x.shape[0])) __pyx_t_13 = 0;
        if (unlikely(__pyx_t_13 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_13);
          __PYX_ERR(0, 1152, __pyx_L1_error)
        }
        __pyx_v_cur = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_12 * __pyx_v_x.strides[0]) )));
    /* … */
        __pyx_t_12 = __pyx_v_cur_idx;
        __pyx_t_13 = -1;
        if (__pyx_t_12 < 0) {
          __pyx_t_12 += __pyx_v_x.shape[0];
          if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
        } else if (unlikely(__pyx_t_12 >= __pyx_v_x.shape[0])) __pyx_t_13 = 0;
        if (unlikely(__pyx_t_13 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_13);
          __PYX_ERR(0, 1152, __pyx_L1_error)
        }
        __pyx_v_cur = (*((__pyx_t_5numpy_uint16_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_12 * __pyx_v_x.strides[0]) )));
    /* … */
        __pyx_t_12 = __pyx_v_cur_idx;
        __pyx_t_13 = -1;
        if (__pyx_t_12 < 0) {
          __pyx_t_12 += __pyx_v_x.shape[0];
          if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
        } else if (unlikely(__pyx_t_12 >= __pyx_v_x.shape[0])) __pyx_t_13 = 0;
        if (unlikely(__pyx_t_13 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_13);
          __PYX_ERR(0, 1152, __pyx_L1_error)
        }
        __pyx_v_cur = (*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_12 * __pyx_v_x.strides[0]) )));
    /* … */
        __pyx_t_12 = __pyx_v_cur_idx;
        __pyx_t_13 = -1;
        if (__pyx_t_12 < 0) {
          __pyx_t_12 += __pyx_v_x.shape[0];
          if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
        } else if (unlikely(__pyx_t_12 >= __pyx_v_x.shape[0])) __pyx_t_13 = 0;
        if (unlikely(__pyx_t_13 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_13);
          __PYX_ERR(0, 1152, __pyx_L1_error)
        }
        __pyx_v_cur = (*((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_12 * __pyx_v_x.strides[0]) )));

     1153:

     1154:         # check if it's a state we're not interested in

    +1155:         if cur < 0 or cur > max_state or not is_state[cur]:

        __pyx_t_14 = ((__pyx_v_cur < 0) != 0);
        if (!__pyx_t_14) {
        } else {
          __pyx_t_7 = __pyx_t_14;
          goto __pyx_L9_bool_binop_done;
        }
        __pyx_t_8 = __Pyx_PyInt_From_npy_int8(__pyx_v_cur); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_v_max_state, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (!__pyx_t_14) {
        } else {
          __pyx_t_7 = __pyx_t_14;
          goto __pyx_L9_bool_binop_done;
        }
        __pyx_t_15 = __pyx_v_cur;
        __pyx_t_13 = -1;
        if (__pyx_t_15 < 0) {
          __pyx_t_15 += __pyx_v_is_state.shape[0];
          if (unlikely(__pyx_t_15 < 0)) __pyx_t_13 = 0;
        } else if (unlikely(__pyx_t_15 >= __pyx_v_is_state.shape[0])) __pyx_t_13 = 0;
        if (unlikely(__pyx_t_13 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_13);
          __PYX_ERR(0, 1155, __pyx_L1_error)
        }
        __pyx_t_14 = ((!((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_is_state.data + __pyx_t_15 * __pyx_v_is_state.strides[0]) ))) != 0)) != 0);
        __pyx_t_7 = __pyx_t_14;
        __pyx_L9_bool_binop_done:;
        if (__pyx_t_7) {
    /* … */
        }
    /* … */
        __pyx_t_14 = ((__pyx_v_cur < 0) != 0);
        if (!__pyx_t_14) {
        } else {
          __pyx_t_7 = __pyx_t_14;
          goto __pyx_L9_bool_binop_done;
        }
        __pyx_t_8 = __Pyx_PyInt_From_npy_int16(__pyx_v_cur); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_v_max_state, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (!__pyx_t_14) {
        } else {
          __pyx_t_7 = __pyx_t_14;
          goto __pyx_L9_bool_binop_done;
        }
        __pyx_t_15 = __pyx_v_cur;
        __pyx_t_13 = -1;
        if (__pyx_t_15 < 0) {
          __pyx_t_15 += __pyx_v_is_state.shape[0];
          if (unlikely(__pyx_t_15 < 0)) __pyx_t_13 = 0;
        } else if (unlikely(__pyx_t_15 >= __pyx_v_is_state.shape[0])) __pyx_t_13 = 0;
        if (unlikely(__pyx_t_13 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_13);
          __PYX_ERR(0, 1155, __pyx_L1_error)
        }
        __pyx_t_14 = ((!((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_is_state.data + __pyx_t_15 * __pyx_v_is_state.strides[0]) ))) != 0)) != 0);
        __pyx_t_7 = __pyx_t_14;
        __pyx_L9_bool_binop_done:;
        if (__pyx_t_7) {
    /* … */
        }
    /* … */
        __pyx_t_14 = ((__pyx_v_cur < 0) != 0);
        if (!__pyx_t_14) {
        } else {
          __pyx_t_7 = __pyx_t_14;
          goto __pyx_L9_bool_binop_done;
        }
        __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_cur); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_v_max_state, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (!__pyx_t_14) {
        } else {
          __pyx_t_7 = __pyx_t_14;
          goto __pyx_L9_bool_binop_done;
        }
        __pyx_t_15 = __pyx_v_cur;
        __pyx_t_13 = -1;
        if (__pyx_t_15 < 0) {
          __pyx_t_15 += __pyx_v_is_state.shape[0];
          if (unlikely(__pyx_t_15 < 0)) __pyx_t_13 = 0;
        } else if (unlikely(__pyx_t_15 >= __pyx_v_is_state.shape[0])) __pyx_t_13 = 0;
        if (unlikely(__pyx_t_13 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_13);
          __PYX_ERR(0, 1155, __pyx_L1_error)
        }
        __pyx_t_14 = ((!((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_is_state.data + __pyx_t_15 * __pyx_v_is_state.strides[0]) ))) != 0)) != 0);
        __pyx_t_7 = __pyx_t_14;
        __pyx_L9_bool_binop_done:;
        if (__pyx_t_7) {
    /* … */
        }
    /* … */
        __pyx_t_14 = ((__pyx_v_cur < 0) != 0);
        if (!__pyx_t_14) {
        } else {
          __pyx_t_7 = __pyx_t_14;
          goto __pyx_L9_bool_binop_done;
        }
        __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_cur); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_v_max_state, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (!__pyx_t_14) {
        } else {
          __pyx_t_7 = __pyx_t_14;
          goto __pyx_L9_bool_binop_done;
        }
        __pyx_t_15 = __pyx_v_cur;
        __pyx_t_13 = -1;
        if (__pyx_t_15 < 0) {
          __pyx_t_15 += __pyx_v_is_state.shape[0];
          if (unlikely(__pyx_t_15 < 0)) __pyx_t_13 = 0;
        } else if (unlikely(__pyx_t_15 >= __pyx_v_is_state.shape[0])) __pyx_t_13 = 0;
        if (unlikely(__pyx_t_13 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_13);
          __PYX_ERR(0, 1155, __pyx_L1_error)
        }
        __pyx_t_14 = ((!((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_is_state.data + __pyx_t_15 * __pyx_v_is_state.strides[0]) ))) != 0)) != 0);
        __pyx_t_7 = __pyx_t_14;
        __pyx_L9_bool_binop_done:;
        if (__pyx_t_7) {
    /* … */
        }
    /* … */
        __pyx_t_14 = ((__pyx_v_cur < 0) != 0);
        if (!__pyx_t_14) {
        } else {
          __pyx_t_7 = __pyx_t_14;
          goto __pyx_L9_bool_binop_done;
        }
        __pyx_t_8 = __Pyx_PyInt_From_npy_uint8(__pyx_v_cur); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_v_max_state, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (!__pyx_t_14) {
        } else {
          __pyx_t_7 = __pyx_t_14;
          goto __pyx_L9_bool_binop_done;
        }
        __pyx_t_15 = __pyx_v_cur;
        __pyx_t_13 = -1;
        if (unlikely(__pyx_t_15 >= (size_t)__pyx_v_is_state.shape[0])) __pyx_t_13 = 0;
        if (unlikely(__pyx_t_13 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_13);
          __PYX_ERR(0, 1155, __pyx_L1_error)
        }
        __pyx_t_14 = ((!((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_is_state.data + __pyx_t_15 * __pyx_v_is_state.strides[0]) ))) != 0)) != 0);
        __pyx_t_7 = __pyx_t_14;
        __pyx_L9_bool_binop_done:;
        if (__pyx_t_7) {
    /* … */
        }
    /* … */
        __pyx_t_14 = ((__pyx_v_cur < 0) != 0);
        if (!__pyx_t_14) {
        } else {
          __pyx_t_7 = __pyx_t_14;
          goto __pyx_L9_bool_binop_done;
        }
        __pyx_t_8 = __Pyx_PyInt_From_npy_uint16(__pyx_v_cur); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_v_max_state, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (!__pyx_t_14) {
        } else {
          __pyx_t_7 = __pyx_t_14;
          goto __pyx_L9_bool_binop_done;
        }
        __pyx_t_15 = __pyx_v_cur;
        __pyx_t_13 = -1;
        if (unlikely(__pyx_t_15 >= (size_t)__pyx_v_is_state.shape[0])) __pyx_t_13 = 0;
        if (unlikely(__pyx_t_13 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_13);
          __PYX_ERR(0, 1155, __pyx_L1_error)
        }
        __pyx_t_14 = ((!((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_is_state.data + __pyx_t_15 * __pyx_v_is_state.strides[0]) ))) != 0)) != 0);
        __pyx_t_7 = __pyx_t_14;
        __pyx_L9_bool_binop_done:;
        if (__pyx_t_7) {
    /* … */
        }
    /* … */
        __pyx_t_14 = ((__pyx_v_cur < 0) != 0);
        if (!__pyx_t_14) {
        } else {
          __pyx_t_7 = __pyx_t_14;
          goto __pyx_L9_bool_binop_done;
        }
        __pyx_t_8 = __Pyx_PyInt_From_npy_uint32(__pyx_v_cur); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_v_max_state, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (!__pyx_t_14) {
        } else {
          __pyx_t_7 = __pyx_t_14;
          goto __pyx_L9_bool_binop_done;
        }
        __pyx_t_15 = __pyx_v_cur;
        __pyx_t_13 = -1;
        if (unlikely(__pyx_t_15 >= (size_t)__pyx_v_is_state.shape[0])) __pyx_t_13 = 0;
        if (unlikely(__pyx_t_13 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_13);
          __PYX_ERR(0, 1155, __pyx_L1_error)
        }
        __pyx_t_14 = ((!((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_is_state.data + __pyx_t_15 * __pyx_v_is_state.strides[0]) ))) != 0)) != 0);
        __pyx_t_7 = __pyx_t_14;
        __pyx_L9_bool_binop_done:;
        if (__pyx_t_7) {
    /* … */
        }
    /* … */
        __pyx_t_14 = ((__pyx_v_cur < 0) != 0);
        if (!__pyx_t_14) {
        } else {
          __pyx_t_7 = __pyx_t_14;
          goto __pyx_L9_bool_binop_done;
        }
        __pyx_t_8 = __Pyx_PyInt_From_npy_uint64(__pyx_v_cur); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_v_max_state, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 1155, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (!__pyx_t_14) {
        } else {
          __pyx_t_7 = __pyx_t_14;
          goto __pyx_L9_bool_binop_done;
        }
        __pyx_t_15 = __pyx_v_cur;
        __pyx_t_13 = -1;
        if (unlikely(__pyx_t_15 >= (size_t)__pyx_v_is_state.shape[0])) __pyx_t_13 = 0;
        if (unlikely(__pyx_t_13 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_13);
          __PYX_ERR(0, 1155, __pyx_L1_error)
        }
        __pyx_t_14 = ((!((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_is_state.data + __pyx_t_15 * __pyx_v_is_state.strides[0]) ))) != 0)) != 0);
        __pyx_t_7 = __pyx_t_14;
        __pyx_L9_bool_binop_done:;
        if (__pyx_t_7) {
    /* … */
        }

    +1156:             continue

          goto __pyx_L6_continue;
    /* … */
          goto __pyx_L6_continue;
    /* … */
          goto __pyx_L6_continue;
    /* … */
          goto __pyx_L6_continue;
    /* … */
          goto __pyx_L6_continue;
    /* … */
          goto __pyx_L6_continue;
    /* … */
          goto __pyx_L6_continue;
    /* … */
          goto __pyx_L6_continue;

     1157:

    +1158:         elif cur != prv:

        __pyx_t_7 = ((__pyx_v_cur != __pyx_v_prv) != 0);
        if (__pyx_t_7) {
    /* … */
        }
    /* … */
        __pyx_t_7 = ((__pyx_v_cur != __pyx_v_prv) != 0);
        if (__pyx_t_7) {
    /* … */
        }
    /* … */
        __pyx_t_7 = ((__pyx_v_cur != __pyx_v_prv) != 0);
        if (__pyx_t_7) {
    /* … */
        }
    /* … */
        __pyx_t_7 = ((__pyx_v_cur != __pyx_v_prv) != 0);
        if (__pyx_t_7) {
    /* … */
        }
    /* … */
        __pyx_t_7 = ((__pyx_v_cur != __pyx_v_prv) != 0);
        if (__pyx_t_7) {
    /* … */
        }
    /* … */
        __pyx_t_7 = ((__pyx_v_cur != __pyx_v_prv) != 0);
        if (__pyx_t_7) {
    /* … */
        }
    /* … */
        __pyx_t_7 = ((__pyx_v_cur != __pyx_v_prv) != 0);
        if (__pyx_t_7) {
    /* … */
        }
    /* … */
        __pyx_t_7 = ((__pyx_v_cur != __pyx_v_prv) != 0);
        if (__pyx_t_7) {
    /* … */
        }

     1159:             # record a state transition

    +1160:             switch = prv_idx, cur_idx

          __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_prv_idx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_cur_idx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8);
          __pyx_t_2 = 0;
          __pyx_t_8 = 0;
          __Pyx_XDECREF_SET(__pyx_v_switch, __pyx_t_10);
          __pyx_t_10 = 0;
    /* … */
          __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_prv_idx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_cur_idx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8);
          __pyx_t_2 = 0;
          __pyx_t_8 = 0;
          __Pyx_XDECREF_SET(__pyx_v_switch, __pyx_t_10);
          __pyx_t_10 = 0;
    /* … */
          __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_prv_idx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_cur_idx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8);
          __pyx_t_2 = 0;
          __pyx_t_8 = 0;
          __Pyx_XDECREF_SET(__pyx_v_switch, __pyx_t_10);
          __pyx_t_10 = 0;
    /* … */
          __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_prv_idx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_cur_idx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8);
          __pyx_t_2 = 0;
          __pyx_t_8 = 0;
          __Pyx_XDECREF_SET(__pyx_v_switch, __pyx_t_10);
          __pyx_t_10 = 0;
    /* … */
          __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_prv_idx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_cur_idx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8);
          __pyx_t_2 = 0;
          __pyx_t_8 = 0;
          __Pyx_XDECREF_SET(__pyx_v_switch, __pyx_t_10);
          __pyx_t_10 = 0;
    /* … */
          __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_prv_idx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_cur_idx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8);
          __pyx_t_2 = 0;
          __pyx_t_8 = 0;
          __Pyx_XDECREF_SET(__pyx_v_switch, __pyx_t_10);
          __pyx_t_10 = 0;
    /* … */
          __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_prv_idx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_cur_idx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8);
          __pyx_t_2 = 0;
          __pyx_t_8 = 0;
          __Pyx_XDECREF_SET(__pyx_v_switch, __pyx_t_10);
          __pyx_t_10 = 0;
    /* … */
          __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_prv_idx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_cur_idx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8);
          __pyx_t_2 = 0;
          __pyx_t_8 = 0;
          __Pyx_XDECREF_SET(__pyx_v_switch, __pyx_t_10);
          __pyx_t_10 = 0;

    +1161:             switch_points.append(switch)

          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_switch_points, __pyx_v_switch); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1161, __pyx_L1_error)
    /* … */
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_switch_points, __pyx_v_switch); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1161, __pyx_L1_error)
    /* … */
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_switch_points, __pyx_v_switch); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1161, __pyx_L1_error)
    /* … */
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_switch_points, __pyx_v_switch); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1161, __pyx_L1_error)
    /* … */
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_switch_points, __pyx_v_switch); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1161, __pyx_L1_error)
    /* … */
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_switch_points, __pyx_v_switch); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1161, __pyx_L1_error)
    /* … */
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_switch_points, __pyx_v_switch); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1161, __pyx_L1_error)
    /* … */
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_switch_points, __pyx_v_switch); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1161, __pyx_L1_error)

    +1162:             transition = prv, cur

          __pyx_t_10 = __Pyx_PyInt_From_npy_int8(__pyx_v_prv); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_8 = __Pyx_PyInt_From_npy_int8(__pyx_v_cur); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_10);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8);
          __pyx_t_10 = 0;
          __pyx_t_8 = 0;
          __Pyx_XDECREF_SET(__pyx_v_transition, __pyx_t_2);
          __pyx_t_2 = 0;
    /* … */
          __pyx_t_10 = __Pyx_PyInt_From_npy_int16(__pyx_v_prv); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_8 = __Pyx_PyInt_From_npy_int16(__pyx_v_cur); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_10);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8);
          __pyx_t_10 = 0;
          __pyx_t_8 = 0;
          __Pyx_XDECREF_SET(__pyx_v_transition, __pyx_t_2);
          __pyx_t_2 = 0;
    /* … */
          __pyx_t_10 = __Pyx_PyInt_From_npy_int32(__pyx_v_prv); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_cur); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_10);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8);
          __pyx_t_10 = 0;
          __pyx_t_8 = 0;
          __Pyx_XDECREF_SET(__pyx_v_transition, __pyx_t_2);
          __pyx_t_2 = 0;
    /* … */
          __pyx_t_10 = __Pyx_PyInt_From_npy_int64(__pyx_v_prv); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_cur); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_10);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8);
          __pyx_t_10 = 0;
          __pyx_t_8 = 0;
          __Pyx_XDECREF_SET(__pyx_v_transition, __pyx_t_2);
          __pyx_t_2 = 0;
    /* … */
          __pyx_t_10 = __Pyx_PyInt_From_npy_uint8(__pyx_v_prv); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_8 = __Pyx_PyInt_From_npy_uint8(__pyx_v_cur); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_10);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8);
          __pyx_t_10 = 0;
          __pyx_t_8 = 0;
          __Pyx_XDECREF_SET(__pyx_v_transition, __pyx_t_2);
          __pyx_t_2 = 0;
    /* … */
          __pyx_t_10 = __Pyx_PyInt_From_npy_uint16(__pyx_v_prv); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_8 = __Pyx_PyInt_From_npy_uint16(__pyx_v_cur); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_10);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8);
          __pyx_t_10 = 0;
          __pyx_t_8 = 0;
          __Pyx_XDECREF_SET(__pyx_v_transition, __pyx_t_2);
          __pyx_t_2 = 0;
    /* … */
          __pyx_t_10 = __Pyx_PyInt_From_npy_uint32(__pyx_v_prv); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_8 = __Pyx_PyInt_From_npy_uint32(__pyx_v_cur); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_10);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8);
          __pyx_t_10 = 0;
          __pyx_t_8 = 0;
          __Pyx_XDECREF_SET(__pyx_v_transition, __pyx_t_2);
          __pyx_t_2 = 0;
    /* … */
          __pyx_t_10 = __Pyx_PyInt_From_npy_uint64(__pyx_v_prv); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_8 = __Pyx_PyInt_From_npy_uint64(__pyx_v_cur); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_10);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10);
          __Pyx_GIVEREF(__pyx_t_8);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8);
          __pyx_t_10 = 0;
          __pyx_t_8 = 0;
          __Pyx_XDECREF_SET(__pyx_v_transition, __pyx_t_2);
          __pyx_t_2 = 0;

    +1163:             transitions.append(transition)

          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_transitions, __pyx_v_transition); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1163, __pyx_L1_error)
    /* … */
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_transitions, __pyx_v_transition); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1163, __pyx_L1_error)
    /* … */
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_transitions, __pyx_v_transition); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1163, __pyx_L1_error)
    /* … */
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_transitions, __pyx_v_transition); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1163, __pyx_L1_error)
    /* … */
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_transitions, __pyx_v_transition); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1163, __pyx_L1_error)
    /* … */
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_transitions, __pyx_v_transition); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1163, __pyx_L1_error)
    /* … */
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_transitions, __pyx_v_transition); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1163, __pyx_L1_error)
    /* … */
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_transitions, __pyx_v_transition); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1163, __pyx_L1_error)

    +1164:             observations.append(observed)

          __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_observed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1164, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_observations, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1164, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
          __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_observed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1164, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_observations, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1164, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
          __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_observed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1164, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_observations, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1164, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
          __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_observed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1164, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_observations, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1164, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
          __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_observed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1164, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_observations, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1164, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
          __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_observed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1164, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_observations, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1164, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
          __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_observed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1164, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_observations, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1164, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
          __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_observed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1164, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_observations, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1164, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +1165:             observed = 0

          __pyx_v_observed = 0;
    /* … */
          __pyx_v_observed = 0;
    /* … */
          __pyx_v_observed = 0;
    /* … */
          __pyx_v_observed = 0;
    /* … */
          __pyx_v_observed = 0;
    /* … */
          __pyx_v_observed = 0;
    /* … */
          __pyx_v_observed = 0;
    /* … */
          __pyx_v_observed = 0;

     1166:

     1167:         # advance

    +1168:         prv = cur

        __pyx_v_prv = __pyx_v_cur;
    /* … */
        __pyx_v_prv = __pyx_v_cur;
    /* … */
        __pyx_v_prv = __pyx_v_cur;
    /* … */
        __pyx_v_prv = __pyx_v_cur;
    /* … */
        __pyx_v_prv = __pyx_v_cur;
    /* … */
        __pyx_v_prv = __pyx_v_cur;
    /* … */
        __pyx_v_prv = __pyx_v_cur;
    /* … */
        __pyx_v_prv = __pyx_v_cur;

    +1169:         prv_idx = cur_idx

        __pyx_v_prv_idx = __pyx_v_cur_idx;
    /* … */
        __pyx_v_prv_idx = __pyx_v_cur_idx;
    /* … */
        __pyx_v_prv_idx = __pyx_v_cur_idx;
    /* … */
        __pyx_v_prv_idx = __pyx_v_cur_idx;
    /* … */
        __pyx_v_prv_idx = __pyx_v_cur_idx;
    /* … */
        __pyx_v_prv_idx = __pyx_v_cur_idx;
    /* … */
        __pyx_v_prv_idx = __pyx_v_cur_idx;
    /* … */
        __pyx_v_prv_idx = __pyx_v_cur_idx;

    +1170:         observed += 1

        __pyx_v_observed = (__pyx_v_observed + 1);
        __pyx_L6_continue:;
      }
    /* … */
        __pyx_v_observed = (__pyx_v_observed + 1);
        __pyx_L6_continue:;
      }
    /* … */
        __pyx_v_observed = (__pyx_v_observed + 1);
        __pyx_L6_continue:;
      }
    /* … */
        __pyx_v_observed = (__pyx_v_observed + 1);
        __pyx_L6_continue:;
      }
    /* … */
        __pyx_v_observed = (__pyx_v_observed + 1);
        __pyx_L6_continue:;
      }
    /* … */
        __pyx_v_observed = (__pyx_v_observed + 1);
        __pyx_L6_continue:;
      }
    /* … */
        __pyx_v_observed = (__pyx_v_observed + 1);
        __pyx_L6_continue:;
      }
    /* … */
        __pyx_v_observed = (__pyx_v_observed + 1);
        __pyx_L6_continue:;
      }

     1171:

     1172:     # add final transition at right-hand boundary

    +1173:     switch = prv_idx, -1

      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_prv_idx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_int_neg_1);
      __Pyx_GIVEREF(__pyx_int_neg_1);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_neg_1);
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_switch, __pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_prv_idx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_int_neg_1);
      __Pyx_GIVEREF(__pyx_int_neg_1);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_neg_1);
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_switch, __pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_prv_idx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_int_neg_1);
      __Pyx_GIVEREF(__pyx_int_neg_1);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_neg_1);
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_switch, __pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_prv_idx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_int_neg_1);
      __Pyx_GIVEREF(__pyx_int_neg_1);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_neg_1);
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_switch, __pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_prv_idx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_int_neg_1);
      __Pyx_GIVEREF(__pyx_int_neg_1);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_neg_1);
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_switch, __pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_prv_idx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_int_neg_1);
      __Pyx_GIVEREF(__pyx_int_neg_1);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_neg_1);
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_switch, __pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_prv_idx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_int_neg_1);
      __Pyx_GIVEREF(__pyx_int_neg_1);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_neg_1);
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_switch, __pyx_t_8);
      __pyx_t_8 = 0;
    /* … */
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_prv_idx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
      __Pyx_INCREF(__pyx_int_neg_1);
      __Pyx_GIVEREF(__pyx_int_neg_1);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_neg_1);
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_switch, __pyx_t_8);
      __pyx_t_8 = 0;

    +1174:     switch_points.append(switch)

      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_switch_points, __pyx_v_switch); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1174, __pyx_L1_error)
    /* … */
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_switch_points, __pyx_v_switch); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1174, __pyx_L1_error)
    /* … */
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_switch_points, __pyx_v_switch); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1174, __pyx_L1_error)
    /* … */
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_switch_points, __pyx_v_switch); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1174, __pyx_L1_error)
    /* … */
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_switch_points, __pyx_v_switch); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1174, __pyx_L1_error)
    /* … */
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_switch_points, __pyx_v_switch); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1174, __pyx_L1_error)
    /* … */
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_switch_points, __pyx_v_switch); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1174, __pyx_L1_error)
    /* … */
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_switch_points, __pyx_v_switch); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1174, __pyx_L1_error)

    +1175:     transition = prv, -1

      __pyx_t_8 = __Pyx_PyInt_From_npy_int8(__pyx_v_prv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
      __Pyx_INCREF(__pyx_int_neg_1);
      __Pyx_GIVEREF(__pyx_int_neg_1);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_neg_1);
      __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_transition, __pyx_t_2);
      __pyx_t_2 = 0;
    /* … */
      __pyx_t_8 = __Pyx_PyInt_From_npy_int16(__pyx_v_prv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
      __Pyx_INCREF(__pyx_int_neg_1);
      __Pyx_GIVEREF(__pyx_int_neg_1);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_neg_1);
      __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_transition, __pyx_t_2);
      __pyx_t_2 = 0;
    /* … */
      __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_prv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
      __Pyx_INCREF(__pyx_int_neg_1);
      __Pyx_GIVEREF(__pyx_int_neg_1);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_neg_1);
      __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_transition, __pyx_t_2);
      __pyx_t_2 = 0;
    /* … */
      __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_prv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
      __Pyx_INCREF(__pyx_int_neg_1);
      __Pyx_GIVEREF(__pyx_int_neg_1);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_neg_1);
      __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_transition, __pyx_t_2);
      __pyx_t_2 = 0;
    /* … */
      __pyx_t_8 = __Pyx_PyInt_From_npy_uint8(__pyx_v_prv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
      __Pyx_INCREF(__pyx_int_neg_1);
      __Pyx_GIVEREF(__pyx_int_neg_1);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_neg_1);
      __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_transition, __pyx_t_2);
      __pyx_t_2 = 0;
    /* … */
      __pyx_t_8 = __Pyx_PyInt_From_npy_uint16(__pyx_v_prv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
      __Pyx_INCREF(__pyx_int_neg_1);
      __Pyx_GIVEREF(__pyx_int_neg_1);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_neg_1);
      __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_transition, __pyx_t_2);
      __pyx_t_2 = 0;
    /* … */
      __pyx_t_8 = __Pyx_PyInt_From_npy_uint32(__pyx_v_prv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
      __Pyx_INCREF(__pyx_int_neg_1);
      __Pyx_GIVEREF(__pyx_int_neg_1);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_neg_1);
      __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_transition, __pyx_t_2);
      __pyx_t_2 = 0;
    /* … */
      __pyx_t_8 = __Pyx_PyInt_From_npy_uint64(__pyx_v_prv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
      __Pyx_INCREF(__pyx_int_neg_1);
      __Pyx_GIVEREF(__pyx_int_neg_1);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_neg_1);
      __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_transition, __pyx_t_2);
      __pyx_t_2 = 0;

    +1176:     transitions.append(transition)

      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_transitions, __pyx_v_transition); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1176, __pyx_L1_error)
    /* … */
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_transitions, __pyx_v_transition); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1176, __pyx_L1_error)
    /* … */
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_transitions, __pyx_v_transition); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1176, __pyx_L1_error)
    /* … */
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_transitions, __pyx_v_transition); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1176, __pyx_L1_error)
    /* … */
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_transitions, __pyx_v_transition); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1176, __pyx_L1_error)
    /* … */
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_transitions, __pyx_v_transition); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1176, __pyx_L1_error)
    /* … */
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_transitions, __pyx_v_transition); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1176, __pyx_L1_error)
    /* … */
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_transitions, __pyx_v_transition); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1176, __pyx_L1_error)

    +1177:     observations.append(observed)

      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_observed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_observations, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1177, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_observed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_observations, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1177, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_observed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_observations, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1177, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_observed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_observations, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1177, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_observed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_observations, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1177, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_observed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_observations, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1177, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_observed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_observations, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1177, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_observed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_observations, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1177, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     1178:

    +1179:     return (

      __Pyx_XDECREF(__pyx_r);
    /* … */
      __Pyx_XDECREF(__pyx_r);
    /* … */
      __Pyx_XDECREF(__pyx_r);
    /* … */
      __Pyx_XDECREF(__pyx_r);
    /* … */
      __Pyx_XDECREF(__pyx_r);
    /* … */
      __Pyx_XDECREF(__pyx_r);
    /* … */
      __Pyx_XDECREF(__pyx_r);
    /* … */
      __Pyx_XDECREF(__pyx_r);

    +1180:         np.array(switch_points, dtype=int),

      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_switch_points);
      __Pyx_GIVEREF(__pyx_v_switch_points);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_switch_points);
      __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 1180, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    /* … */
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_17);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
      __pyx_t_3 = 0;
      __pyx_t_17 = 0;
      __pyx_t_1 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_switch_points);
      __Pyx_GIVEREF(__pyx_v_switch_points);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_switch_points);
      __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 1180, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    /* … */
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_17);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
      __pyx_t_3 = 0;
      __pyx_t_17 = 0;
      __pyx_t_1 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_switch_points);
      __Pyx_GIVEREF(__pyx_v_switch_points);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_switch_points);
      __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 1180, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    /* … */
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_17);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
      __pyx_t_3 = 0;
      __pyx_t_17 = 0;
      __pyx_t_1 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_switch_points);
      __Pyx_GIVEREF(__pyx_v_switch_points);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_switch_points);
      __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 1180, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    /* … */
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_17);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
      __pyx_t_3 = 0;
      __pyx_t_17 = 0;
      __pyx_t_1 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_switch_points);
      __Pyx_GIVEREF(__pyx_v_switch_points);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_switch_points);
      __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 1180, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    /* … */
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_17);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
      __pyx_t_3 = 0;
      __pyx_t_17 = 0;
      __pyx_t_1 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_switch_points);
      __Pyx_GIVEREF(__pyx_v_switch_points);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_switch_points);
      __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 1180, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    /* … */
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_17);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
      __pyx_t_3 = 0;
      __pyx_t_17 = 0;
      __pyx_t_1 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_switch_points);
      __Pyx_GIVEREF(__pyx_v_switch_points);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_switch_points);
      __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 1180, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    /* … */
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_17);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
      __pyx_t_3 = 0;
      __pyx_t_17 = 0;
      __pyx_t_1 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_switch_points);
      __Pyx_GIVEREF(__pyx_v_switch_points);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_switch_points);
      __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 1180, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    /* … */
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_17);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_17);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
      __pyx_t_3 = 0;
      __pyx_t_17 = 0;
      __pyx_t_1 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

    +1181:         np.array(transitions, dtype=np.asarray(x).dtype),

      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_v_transitions);
      __Pyx_GIVEREF(__pyx_v_transitions);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_transitions);
      __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_asarray); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_16 = __pyx_memoryview_fromslice(__pyx_v_x, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int8_t, 0);; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_18 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
        __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_17);
        if (likely(__pyx_t_18)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
          __Pyx_INCREF(__pyx_t_18);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_17, function);
        }
      }
      if (!__pyx_t_18) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_17)) {
          PyObject *__pyx_temp[2] = {__pyx_t_18, __pyx_t_16};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
          PyObject *__pyx_temp[2] = {__pyx_t_18, __pyx_t_16};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        } else
        #endif
        {
          __pyx_t_19 = PyTuple_New(1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_18); __pyx_t_18 = NULL;
          __Pyx_GIVEREF(__pyx_t_16);
          PyTuple_SET_ITEM(__pyx_t_19, 0+1, __pyx_t_16);
          __pyx_t_16 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_17) < 0) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    /* … */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_v_transitions);
      __Pyx_GIVEREF(__pyx_v_transitions);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_transitions);
      __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_asarray); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_16 = __pyx_memoryview_fromslice(__pyx_v_x, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int16_t, 0);; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_18 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
        __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_17);
        if (likely(__pyx_t_18)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
          __Pyx_INCREF(__pyx_t_18);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_17, function);
        }
      }
      if (!__pyx_t_18) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_17)) {
          PyObject *__pyx_temp[2] = {__pyx_t_18, __pyx_t_16};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
          PyObject *__pyx_temp[2] = {__pyx_t_18, __pyx_t_16};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        } else
        #endif
        {
          __pyx_t_19 = PyTuple_New(1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_18); __pyx_t_18 = NULL;
          __Pyx_GIVEREF(__pyx_t_16);
          PyTuple_SET_ITEM(__pyx_t_19, 0+1, __pyx_t_16);
          __pyx_t_16 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_17) < 0) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    /* … */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_v_transitions);
      __Pyx_GIVEREF(__pyx_v_transitions);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_transitions);
      __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_asarray); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_16 = __pyx_memoryview_fromslice(__pyx_v_x, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int32_t, 0);; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_18 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
        __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_17);
        if (likely(__pyx_t_18)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
          __Pyx_INCREF(__pyx_t_18);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_17, function);
        }
      }
      if (!__pyx_t_18) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_17)) {
          PyObject *__pyx_temp[2] = {__pyx_t_18, __pyx_t_16};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
          PyObject *__pyx_temp[2] = {__pyx_t_18, __pyx_t_16};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        } else
        #endif
        {
          __pyx_t_19 = PyTuple_New(1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_18); __pyx_t_18 = NULL;
          __Pyx_GIVEREF(__pyx_t_16);
          PyTuple_SET_ITEM(__pyx_t_19, 0+1, __pyx_t_16);
          __pyx_t_16 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_17) < 0) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    /* … */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_v_transitions);
      __Pyx_GIVEREF(__pyx_v_transitions);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_transitions);
      __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_asarray); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_16 = __pyx_memoryview_fromslice(__pyx_v_x, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_18 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
        __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_17);
        if (likely(__pyx_t_18)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
          __Pyx_INCREF(__pyx_t_18);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_17, function);
        }
      }
      if (!__pyx_t_18) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_17)) {
          PyObject *__pyx_temp[2] = {__pyx_t_18, __pyx_t_16};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
          PyObject *__pyx_temp[2] = {__pyx_t_18, __pyx_t_16};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        } else
        #endif
        {
          __pyx_t_19 = PyTuple_New(1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_18); __pyx_t_18 = NULL;
          __Pyx_GIVEREF(__pyx_t_16);
          PyTuple_SET_ITEM(__pyx_t_19, 0+1, __pyx_t_16);
          __pyx_t_16 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_17) < 0) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    /* … */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_v_transitions);
      __Pyx_GIVEREF(__pyx_v_transitions);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_transitions);
      __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_asarray); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_16 = __pyx_memoryview_fromslice(__pyx_v_x, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_18 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
        __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_17);
        if (likely(__pyx_t_18)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
          __Pyx_INCREF(__pyx_t_18);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_17, function);
        }
      }
      if (!__pyx_t_18) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_17)) {
          PyObject *__pyx_temp[2] = {__pyx_t_18, __pyx_t_16};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
          PyObject *__pyx_temp[2] = {__pyx_t_18, __pyx_t_16};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        } else
        #endif
        {
          __pyx_t_19 = PyTuple_New(1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_18); __pyx_t_18 = NULL;
          __Pyx_GIVEREF(__pyx_t_16);
          PyTuple_SET_ITEM(__pyx_t_19, 0+1, __pyx_t_16);
          __pyx_t_16 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_17) < 0) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    /* … */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_v_transitions);
      __Pyx_GIVEREF(__pyx_v_transitions);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_transitions);
      __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_asarray); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_16 = __pyx_memoryview_fromslice(__pyx_v_x, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint16_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint16_t, 0);; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_18 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
        __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_17);
        if (likely(__pyx_t_18)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
          __Pyx_INCREF(__pyx_t_18);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_17, function);
        }
      }
      if (!__pyx_t_18) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_17)) {
          PyObject *__pyx_temp[2] = {__pyx_t_18, __pyx_t_16};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
          PyObject *__pyx_temp[2] = {__pyx_t_18, __pyx_t_16};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        } else
        #endif
        {
          __pyx_t_19 = PyTuple_New(1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_18); __pyx_t_18 = NULL;
          __Pyx_GIVEREF(__pyx_t_16);
          PyTuple_SET_ITEM(__pyx_t_19, 0+1, __pyx_t_16);
          __pyx_t_16 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_17) < 0) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    /* … */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_v_transitions);
      __Pyx_GIVEREF(__pyx_v_transitions);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_transitions);
      __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_asarray); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_16 = __pyx_memoryview_fromslice(__pyx_v_x, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint32_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint32_t, 0);; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_18 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
        __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_17);
        if (likely(__pyx_t_18)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
          __Pyx_INCREF(__pyx_t_18);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_17, function);
        }
      }
      if (!__pyx_t_18) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_17)) {
          PyObject *__pyx_temp[2] = {__pyx_t_18, __pyx_t_16};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
          PyObject *__pyx_temp[2] = {__pyx_t_18, __pyx_t_16};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        } else
        #endif
        {
          __pyx_t_19 = PyTuple_New(1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_18); __pyx_t_18 = NULL;
          __Pyx_GIVEREF(__pyx_t_16);
          PyTuple_SET_ITEM(__pyx_t_19, 0+1, __pyx_t_16);
          __pyx_t_16 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_17) < 0) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    /* … */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_v_transitions);
      __Pyx_GIVEREF(__pyx_v_transitions);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_transitions);
      __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_asarray); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_16 = __pyx_memoryview_fromslice(__pyx_v_x, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint64_t, 0);; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_18 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
        __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_17);
        if (likely(__pyx_t_18)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
          __Pyx_INCREF(__pyx_t_18);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_17, function);
        }
      }
      if (!__pyx_t_18) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_17)) {
          PyObject *__pyx_temp[2] = {__pyx_t_18, __pyx_t_16};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
          PyObject *__pyx_temp[2] = {__pyx_t_18, __pyx_t_16};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        } else
        #endif
        {
          __pyx_t_19 = PyTuple_New(1+1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_18); __pyx_t_18 = NULL;
          __Pyx_GIVEREF(__pyx_t_16);
          PyTuple_SET_ITEM(__pyx_t_19, 0+1, __pyx_t_16);
          __pyx_t_16 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_17) < 0) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    +1182:         np.array(observations, dtype=int)

      __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_observations);
      __Pyx_GIVEREF(__pyx_v_observations);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_observations);
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 1182, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
      __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_observations);
      __Pyx_GIVEREF(__pyx_v_observations);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_observations);
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 1182, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
      __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_observations);
      __Pyx_GIVEREF(__pyx_v_observations);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_observations);
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 1182, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
      __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_observations);
      __Pyx_GIVEREF(__pyx_v_observations);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_observations);
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 1182, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
      __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_observations);
      __Pyx_GIVEREF(__pyx_v_observations);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_observations);
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 1182, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
      __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_observations);
      __Pyx_GIVEREF(__pyx_v_observations);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_observations);
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 1182, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
      __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_observations);
      __Pyx_GIVEREF(__pyx_v_observations);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_observations);
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 1182, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
      __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_observations);
      __Pyx_GIVEREF(__pyx_v_observations);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_observations);
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 1182, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     1183:     )