Cython: cares.pyx

Generated by Cython 3.1.0a1

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: cares.c

    +001: # Copyright (c) 2011-2012 Denis Bilenko. See LICENSE for details.

      __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     002: # Automatic pickling of cdef classes was added in 0.26. Unfortunately it

     003: # seems to be buggy (at least for the `result` class) and produces code that

     004: # can't compile ("local variable 'result' referenced before assignment").

     005: # See https://github.com/cython/cython/issues/1786

     006: # cython: auto_pickle=False,language_level=3str

     007: cimport libcares as cares

    +008: import sys

      __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_sys, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sys, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     009:

     010: from cpython.version cimport PY_MAJOR_VERSION

     011: from cpython.tuple cimport PyTuple_Check

     012: from cpython.getargs cimport PyArg_ParseTuple

     013: from cpython.ref cimport Py_INCREF

     014: from cpython.ref cimport Py_DECREF

     015: from cpython.mem cimport PyMem_Malloc

     016: from cpython.mem cimport PyMem_Free

     017: from libc.string cimport memset

     018:

    +019: from gevent._compat import MAC

      __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_MAC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_gevent__compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MAC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MAC, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     020:

    +021: import _socket

      __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_socket, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_socket, __pyx_t_3) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +022: from _socket import gaierror

      __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_gaierror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_socket, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_gaierror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_gaierror, __pyx_t_3) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +023: from _socket import herror

      __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_herror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_socket, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_herror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_herror, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     024:

     025:

    +026: __all__ = ['channel']

      __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_channel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_all, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     027:

     028: cdef tuple string_types

     029: cdef type text_type

     030:

    +031: if PY_MAJOR_VERSION >= 3:

      __pyx_t_4 = (PY_MAJOR_VERSION >= 3);
      if (__pyx_t_4) {
    /* … */
        goto __pyx_L2;
      }

    +032:     string_types = str,

        __pyx_t_3 = PyTuple_Pack(1, ((PyObject *)(&PyUnicode_Type))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares_string_types);
        __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_string_types, ((PyObject*)__pyx_t_3));
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;

    +033:     text_type = str

        __Pyx_INCREF((PyObject *)(&PyUnicode_Type));
        __Pyx_XGOTREF((PyObject *)__pyx_v_6gevent_8resolver_5cares_text_type);
        __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_text_type, (&PyUnicode_Type));
        __Pyx_GIVEREF((PyObject *)(&PyUnicode_Type));

     034: else:

    +035:     string_types = __builtins__.basestring,

      /*else*/ {
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_builtins); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_basestring); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares_string_types);
        __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_string_types, ((PyObject*)__pyx_t_3));
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;

    +036:     text_type = __builtins__.unicode

        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_builtins); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(PyType_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("type", __pyx_t_2))) __PYX_ERR(0, 36, __pyx_L1_error)
        __Pyx_XGOTREF((PyObject *)__pyx_v_6gevent_8resolver_5cares_text_type);
        __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_text_type, ((PyTypeObject*)__pyx_t_2));
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_2 = 0;
      }
      __pyx_L2:;

     037:

     038: # These three constants used to be DEF, but the DEF construct

     039: # is deprecated in Cython. Using a cdef extern, the generated

     040: # C code refers to the symbol (DEF would have inlined the value).

     041: # That's great when we're strictly in a C context, but for passing to

     042: # Python, it means we do a runtime translation from the C int to the

     043: # Python int. That is avoided if we use a cdef constant. TIMEOUT

     044: # is the only one that interacts with Python, but not in a performance-sensitive

     045: # way, so runtime translation is fine to keep it consistent.

     046: cdef extern from *:

     047:     """

     048:     #define TIMEOUT 1

     049:     #define EV_READ 1

     050:     #define EV_WRITE 2

     051:     """

     052:     int TIMEOUT

     053:     int EV_READ

     054:     int EV_WRITE

     055:

     056:

     057: cdef extern from *:

     058:     """

     059: #ifdef CARES_EMBED

     060: #include "ares_setup.h"

     061: #endif

     062:

     063: #ifdef HAVE_NETDB_H

     064: #include <netdb.h>

     065: #endif

     066:

     067:     #ifndef EAI_ADDRFAMILY

     068:     #define EAI_ADDRFAMILY -1

     069:     #endif

     070:

     071:     #ifndef EAI_BADHINTS

     072:     #define EAI_BADHINTS -2

     073:     #endif

     074:

     075:     #ifndef EAI_NODATA

     076:     #define EAI_NODATA -3

     077:     #endif

     078:

     079:     #ifndef EAI_OVERFLOW

     080:     #define EAI_OVERFLOW -4

     081:     #endif

     082:

     083:     #ifndef EAI_PROTOCOL

     084:     #define EAI_PROTOCOL -5

     085:     #endif

     086:

     087:     #ifndef EAI_SYSTEM

     088:     #define EAI_SYSTEM

     089:     #endif

     090:

     091:     """

     092:

     093: cdef extern from "ares.h":

     094:     int AF_INET

     095:     int AF_INET6

     096:     int INET6_ADDRSTRLEN

     097:

     098:     struct hostent:

     099:         char* h_name

     100:         int h_addrtype

     101:         char** h_aliases

     102:         char** h_addr_list

     103:

     104:     struct sockaddr_t "sockaddr":

     105:         pass

     106:

     107:     struct ares_channeldata:

     108:         pass

     109:

     110:     struct in_addr:

     111:         unsigned int s_addr

     112:

     113:     struct sockaddr_in:

     114:         int sin_family

     115:         int sin_port

     116:         in_addr sin_addr

     117:

     118:     struct in6_addr:

     119:         char s6_addr[16]

     120:

     121:     struct sockaddr_in6:

     122:         int sin6_family

     123:         int sin6_port

     124:         unsigned int sin6_flowinfo

     125:         in6_addr sin6_addr

     126:         unsigned int sin6_scope_id

     127:

     128:

     129:     unsigned int htons(unsigned int hostshort)

     130:     unsigned int ntohs(unsigned int hostshort)

     131:     unsigned int htonl(unsigned int hostlong)

     132:     unsigned int ntohl(unsigned int hostlong)

     133:

    +134: cdef int AI_NUMERICSERV = _socket.AI_NUMERICSERV

      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_AI_NUMERICSERV); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_6gevent_8resolver_5cares_AI_NUMERICSERV = __pyx_t_5;

    +135: cdef int AI_CANONNAME = _socket.AI_CANONNAME

      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_AI_CANONNAME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_6gevent_8resolver_5cares_AI_CANONNAME = __pyx_t_5;

    +136: cdef int NI_NUMERICHOST = _socket.NI_NUMERICHOST

      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NI_NUMERICHOST); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_6gevent_8resolver_5cares_NI_NUMERICHOST = __pyx_t_5;

    +137: cdef int NI_NUMERICSERV = _socket.NI_NUMERICSERV

      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_NI_NUMERICSERV); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_6gevent_8resolver_5cares_NI_NUMERICSERV = __pyx_t_5;

    +138: cdef int NI_NOFQDN = _socket.NI_NOFQDN

      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NI_NOFQDN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_6gevent_8resolver_5cares_NI_NOFQDN = __pyx_t_5;

    +139: cdef int NI_NAMEREQD = _socket.NI_NAMEREQD

      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_NI_NAMEREQD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_6gevent_8resolver_5cares_NI_NAMEREQD = __pyx_t_5;

    +140: cdef int NI_DGRAM = _socket.NI_DGRAM

      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NI_DGRAM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_6gevent_8resolver_5cares_NI_DGRAM = __pyx_t_5;

     141:

     142:

    +143: cdef dict _ares_errors = dict([

      __pyx_t_3 = __Pyx_PyList_Pack(26, __pyx_t_2, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_19, __pyx_t_20, __pyx_t_21, __pyx_t_22, __pyx_t_23, __pyx_t_24, __pyx_t_25, __pyx_t_26, __pyx_t_27, __pyx_t_28, __pyx_t_29, __pyx_t_30); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
      __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
      __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
      __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
      __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
      __pyx_t_30 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_3); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares__ares_errors);
      __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares__ares_errors, ((PyObject*)__pyx_t_30));
      __Pyx_GIVEREF(__pyx_t_30);
      __pyx_t_30 = 0;

    +144:     (cares.ARES_SUCCESS, 'ARES_SUCCESS'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_SUCCESS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_SUCCESS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     145:

    +146:     (cares.ARES_EADDRGETNETWORKPARAMS, 'ARES_EADDRGETNETWORKPARAMS'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_EADDRGETNETWORKPARAMS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_EADDRGETNETWORKPARAMS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +147:     (cares.ARES_EBADFAMILY, 'ARES_EBADFAMILY'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_EBADFAMILY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_EBADFAMILY); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +148:     (cares.ARES_EBADFLAGS, 'ARES_EBADFLAGS'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_EBADFLAGS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_EBADFLAGS); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +149:     (cares.ARES_EBADHINTS, 'ARES_EBADHINTS'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_EBADHINTS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_EBADHINTS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +150:     (cares.ARES_EBADNAME, 'ARES_EBADNAME'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_EBADNAME); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_EBADNAME); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +151:     (cares.ARES_EBADQUERY, 'ARES_EBADQUERY'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_EBADQUERY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_EBADQUERY); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +152:     (cares.ARES_EBADRESP, 'ARES_EBADRESP'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_EBADRESP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_12 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_EBADRESP); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +153:     (cares.ARES_EBADSTR, 'ARES_EBADSTR'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_EBADSTR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_EBADSTR); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +154:     (cares.ARES_ECANCELLED, 'ARES_ECANCELLED'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_ECANCELLED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_14 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_ECANCELLED); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 154, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +155:     (cares.ARES_ECONNREFUSED, 'ARES_ECONNREFUSED'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_ECONNREFUSED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_15 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_ECONNREFUSED); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 155, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +156:     (cares.ARES_EDESTRUCTION, 'ARES_EDESTRUCTION'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_16 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_EDESTRUCTION); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +157:     (cares.ARES_EFILE, 'ARES_EFILE'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_EFILE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_17 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_EFILE); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +158:     (cares.ARES_EFORMERR, 'ARES_EFORMERR'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_EFORMERR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_18 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_EFORMERR); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 158, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_18);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +159:     (cares.ARES_ELOADIPHLPAPI, 'ARES_ELOADIPHLPAPI'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_ELOADIPHLPAPI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_19 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_ELOADIPHLPAPI); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +160:     (cares.ARES_ENODATA, 'ARES_ENODATA'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_ENODATA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_20 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_ENODATA); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +161:     (cares.ARES_ENOMEM, 'ARES_ENOMEM'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_ENOMEM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_21 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_ENOMEM); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_21);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +162:     (cares.ARES_ENONAME, 'ARES_ENONAME'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_ENONAME); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_22 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_ENONAME); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_22);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +163:     (cares.ARES_ENOTFOUND, 'ARES_ENOTFOUND'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_ENOTFOUND); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_23 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_ENOTFOUND); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_23);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +164:     (cares.ARES_ENOTIMP, 'ARES_ENOTIMP'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_ENOTIMP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_24 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_ENOTIMP); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_24);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +165:     (cares.ARES_ENOTINITIALIZED, 'ARES_ENOTINITIALIZED'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_ENOTINITIALIZED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_25 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_ENOTINITIALIZED); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_25);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +166:     (cares.ARES_EOF, 'ARES_EOF'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_EOF); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_26 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_EOF); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_26);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +167:     (cares.ARES_EREFUSED, 'ARES_EREFUSED'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_EREFUSED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_27 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_EREFUSED); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 167, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +168:     (cares.ARES_ESERVICE, 'ARES_ESERVICE'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_ESERVICE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_28 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_ESERVICE); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +169:     (cares.ARES_ESERVFAIL, 'ARES_ESERVFAIL'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_ESERVFAIL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_29 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_ESERVFAIL); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 169, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +170:     (cares.ARES_ETIMEOUT, 'ARES_ETIMEOUT'),

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_ETIMEOUT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_30 = PyTuple_Pack(2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ARES_ETIMEOUT); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     171: ])

     172:

     173: cdef dict _ares_to_gai_system = {

    +174:     cares.ARES_EBADFAMILY: cares.EAI_ADDRFAMILY,

      __pyx_t_30 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 174, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_EBADFAMILY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_29 = __Pyx_PyLong_From_int(EAI_ADDRFAMILY); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 174, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      if (PyDict_SetItem(__pyx_t_30, __pyx_t_3, __pyx_t_29) < 0) __PYX_ERR(0, 174, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;

    +175:     cares.ARES_EBADFLAGS:  cares.EAI_BADFLAGS,

      __pyx_t_29 = __Pyx_PyLong_From_int(ARES_EBADFLAGS); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      __pyx_t_3 = __Pyx_PyLong_From_int(EAI_BADFLAGS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_30, __pyx_t_29, __pyx_t_3) < 0) __PYX_ERR(0, 174, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +176:     cares.ARES_EBADHINTS:  cares.EAI_BADHINTS,

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_EBADHINTS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_29 = __Pyx_PyLong_From_int(EAI_BADHINTS); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 176, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      if (PyDict_SetItem(__pyx_t_30, __pyx_t_3, __pyx_t_29) < 0) __PYX_ERR(0, 174, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;

    +177:     cares.ARES_ENOMEM:     cares.EAI_MEMORY,

      __pyx_t_29 = __Pyx_PyLong_From_int(ARES_ENOMEM); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      __pyx_t_3 = __Pyx_PyLong_From_int(EAI_MEMORY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_30, __pyx_t_29, __pyx_t_3) < 0) __PYX_ERR(0, 174, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +178:     cares.ARES_ENONAME:    cares.EAI_NONAME,

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_ENONAME); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_29 = __Pyx_PyLong_From_int(EAI_NONAME); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 178, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      if (PyDict_SetItem(__pyx_t_30, __pyx_t_3, __pyx_t_29) < 0) __PYX_ERR(0, 174, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;

    +179:     cares.ARES_ENOTFOUND:  cares.EAI_NONAME,

      __pyx_t_29 = __Pyx_PyLong_From_int(ARES_ENOTFOUND); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      __pyx_t_3 = __Pyx_PyLong_From_int(EAI_NONAME); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_30, __pyx_t_29, __pyx_t_3) < 0) __PYX_ERR(0, 174, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +180:     cares.ARES_ENOTIMP:    cares.EAI_FAMILY,

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_ENOTIMP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_29 = __Pyx_PyLong_From_int(EAI_FAMILY); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      if (PyDict_SetItem(__pyx_t_30, __pyx_t_3, __pyx_t_29) < 0) __PYX_ERR(0, 174, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;

     181:     # While EAI_NODATA ("No address associated with nodename") might

     182:     # seem to be the natural mapping, typical resolvers actually

     183:     # return EAI_NONAME in that same situation; I've yet to find EAI_NODATA

     184:     # in a test.

    +185:     cares.ARES_ENODATA:    cares.EAI_NONAME,

      __pyx_t_29 = __Pyx_PyLong_From_int(ARES_ENODATA); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 185, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      __pyx_t_3 = __Pyx_PyLong_From_int(EAI_NONAME); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_30, __pyx_t_29, __pyx_t_3) < 0) __PYX_ERR(0, 174, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     186:     # This one gets raised for unknown port/service names.

    +187:     cares.ARES_ESERVICE:   cares.EAI_NONAME if MAC else cares.EAI_SERVICE,

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_ESERVICE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GetModuleGlobalName(__pyx_t_28, __pyx_mstate_global->__pyx_n_u_MAC); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 187, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_28); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 187, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      if (__pyx_t_4) {
        __pyx_t_28 = __Pyx_PyLong_From_int(EAI_NONAME); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 187, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_28);
        __pyx_t_29 = __pyx_t_28;
        __pyx_t_28 = 0;
      } else {
        __pyx_t_28 = __Pyx_PyLong_From_int(EAI_SERVICE); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 187, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_28);
        __pyx_t_29 = __pyx_t_28;
        __pyx_t_28 = 0;
      }
      if (PyDict_SetItem(__pyx_t_30, __pyx_t_3, __pyx_t_29) < 0) __PYX_ERR(0, 174, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
      __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares__ares_to_gai_system);
      __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares__ares_to_gai_system, ((PyObject*)__pyx_t_30));
      __Pyx_GIVEREF(__pyx_t_30);
      __pyx_t_30 = 0;

     188: }

     189:

    +190: cdef _gevent_gai_strerror(code):

    static PyObject *__pyx_f_6gevent_8resolver_5cares__gevent_gai_strerror(PyObject *__pyx_v_code) {
      char const *__pyx_v_err_str;
      PyObject *__pyx_v_result = 0;
      int __pyx_v_system;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_AddTraceback("gevent.resolver.cares._gevent_gai_strerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_result);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     191:     cdef const char* err_str

    +192:     cdef object result = None

      __Pyx_INCREF(Py_None);
      __pyx_v_result = Py_None;

     193:     cdef int system

    +194:     try:

      {
        /*try:*/ {
    /* … */
        }
    /* … */
        __pyx_L5_except_error:;
        __Pyx_XGIVEREF(__pyx_t_1);
        __Pyx_XGIVEREF(__pyx_t_2);
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
        goto __pyx_L1_error;
        __pyx_L4_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_1);
        __Pyx_XGIVEREF(__pyx_t_2);
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
        __pyx_L8_try_end:;
      }

    +195:         system = _ares_to_gai_system[code]

          if (unlikely(__pyx_v_6gevent_8resolver_5cares__ares_to_gai_system == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 195, __pyx_L3_error)
          }
          __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_6gevent_8resolver_5cares__ares_to_gai_system, __pyx_v_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 195, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_v_system = __pyx_t_5;

    +196:     except KeyError:

        __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
        if (__pyx_t_5) {
          __Pyx_AddTraceback("gevent.resolver.cares._gevent_gai_strerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 196, __pyx_L5_except_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_7);

    +197:         err_str = cares.ares_strerror(code)

          __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_v_code); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L5_except_error)
          __pyx_v_err_str = ares_strerror(__pyx_t_5);

    +198:         result = '%s: %s' % (_ares_errors.get(code) or code, _as_str(err_str))

          if (unlikely(__pyx_v_6gevent_8resolver_5cares__ares_errors == Py_None)) {
            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
            __PYX_ERR(0, 198, __pyx_L5_except_error)
          }
          __pyx_t_9 = __Pyx_PyDict_GetItemDefault(__pyx_v_6gevent_8resolver_5cares__ares_errors, __pyx_v_code, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 198, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 198, __pyx_L5_except_error)
          if (!__pyx_t_10) {
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          } else {
            __Pyx_INCREF(__pyx_t_9);
            __pyx_t_8 = __pyx_t_9;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            goto __pyx_L11_bool_binop_done;
          }
          __Pyx_INCREF(__pyx_v_code);
          __pyx_t_8 = __pyx_v_code;
          __pyx_L11_bool_binop_done:;
          __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_8), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 198, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_8 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_err_str); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 198, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_11 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_8), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 198, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_12[0] = __pyx_t_9;
          __pyx_t_12[1] = __pyx_mstate_global->__pyx_kp_u_;
          __pyx_t_12[2] = __pyx_t_11;
          __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_12, 3, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11));
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 198, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_8);
          __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          goto __pyx_L4_exception_handled;
        }
        goto __pyx_L5_except_error;

     199:     else:

    +200:         err_str = cares.gai_strerror(system)

        /*else:*/ {
          __pyx_v_err_str = gai_strerror(__pyx_v_system);

    +201:         result = _as_str(err_str)

          __pyx_t_4 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_err_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_4);
          __pyx_t_4 = 0;
        }
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L8_try_end;
        __pyx_L3_error:;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    +202:     return result

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

     203:

    +204: cdef object _gevent_gaierror_from_status(int ares_status):

    static PyObject *__pyx_f_6gevent_8resolver_5cares__gevent_gaierror_from_status(int __pyx_v_ares_status) {
      PyObject *__pyx_v_code = 0;
      PyObject *__pyx_v_message = 0;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("gevent.resolver.cares._gevent_gaierror_from_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_code);
      __Pyx_XDECREF(__pyx_v_message);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +205:     cdef object code = _ares_to_gai_system.get(ares_status, ares_status)

      if (unlikely(__pyx_v_6gevent_8resolver_5cares__ares_to_gai_system == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
        __PYX_ERR(0, 205, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_ares_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_ares_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_6gevent_8resolver_5cares__ares_to_gai_system, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __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_v_code = __pyx_t_3;
      __pyx_t_3 = 0;

    +206:     cdef object message = _gevent_gai_strerror(ares_status)

      __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_ares_status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __pyx_f_6gevent_8resolver_5cares__gevent_gai_strerror(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_message = __pyx_t_2;
      __pyx_t_2 = 0;

    +207:     return gaierror(code, message)

      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_gaierror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        assert(__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);
        __pyx_t_4 = 1;
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_code, __pyx_v_message};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

     208:

     209: cdef dict _ares_to_host_system = {

    +210:     cares.ARES_ENONAME:    cares.HOST_NOT_FOUND,

      __pyx_t_30 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __pyx_t_29 = __Pyx_PyLong_From_int(ARES_ENONAME); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      __pyx_t_3 = __Pyx_PyLong_From_int(HOST_NOT_FOUND); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_30, __pyx_t_29, __pyx_t_3) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +211:     cares.ARES_ENOTFOUND:  cares.HOST_NOT_FOUND,

      __pyx_t_3 = __Pyx_PyLong_From_int(ARES_ENOTFOUND); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_29 = __Pyx_PyLong_From_int(HOST_NOT_FOUND); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 211, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      if (PyDict_SetItem(__pyx_t_30, __pyx_t_3, __pyx_t_29) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;

    +212:     cares.ARES_ENODATA:    cares.NO_DATA,

      __pyx_t_29 = __Pyx_PyLong_From_int(ARES_ENODATA); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 212, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      __pyx_t_3 = __Pyx_PyLong_From_int(NO_DATA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_30, __pyx_t_29, __pyx_t_3) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares__ares_to_host_system);
      __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares__ares_to_host_system, ((PyObject*)__pyx_t_30));
      __Pyx_GIVEREF(__pyx_t_30);
      __pyx_t_30 = 0;

     213: }

     214:

    +215: cdef _gevent_herror_strerror(code):

    static PyObject *__pyx_f_6gevent_8resolver_5cares__gevent_herror_strerror(PyObject *__pyx_v_code) {
      char const *__pyx_v_err_str;
      PyObject *__pyx_v_result = 0;
      int __pyx_v_system;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_AddTraceback("gevent.resolver.cares._gevent_herror_strerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_result);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     216:     cdef const char* err_str

    +217:     cdef object result = None

      __Pyx_INCREF(Py_None);
      __pyx_v_result = Py_None;

     218:     cdef int system

    +219:     try:

      {
        /*try:*/ {
    /* … */
        }
    /* … */
        __pyx_L5_except_error:;
        __Pyx_XGIVEREF(__pyx_t_1);
        __Pyx_XGIVEREF(__pyx_t_2);
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
        goto __pyx_L1_error;
        __pyx_L4_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_1);
        __Pyx_XGIVEREF(__pyx_t_2);
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
        __pyx_L8_try_end:;
      }

    +220:         system = _ares_to_host_system[code]

          if (unlikely(__pyx_v_6gevent_8resolver_5cares__ares_to_host_system == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 220, __pyx_L3_error)
          }
          __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_6gevent_8resolver_5cares__ares_to_host_system, __pyx_v_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 220, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_v_system = __pyx_t_5;

    +221:     except KeyError:

        __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
        if (__pyx_t_5) {
          __Pyx_AddTraceback("gevent.resolver.cares._gevent_herror_strerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 221, __pyx_L5_except_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_7);

    +222:         err_str = cares.ares_strerror(code)

          __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_v_code); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L5_except_error)
          __pyx_v_err_str = ares_strerror(__pyx_t_5);

    +223:         result = '%s: %s' % (_ares_errors.get(code) or code, _as_str(err_str))

          if (unlikely(__pyx_v_6gevent_8resolver_5cares__ares_errors == Py_None)) {
            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
            __PYX_ERR(0, 223, __pyx_L5_except_error)
          }
          __pyx_t_9 = __Pyx_PyDict_GetItemDefault(__pyx_v_6gevent_8resolver_5cares__ares_errors, __pyx_v_code, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 223, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 223, __pyx_L5_except_error)
          if (!__pyx_t_10) {
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          } else {
            __Pyx_INCREF(__pyx_t_9);
            __pyx_t_8 = __pyx_t_9;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            goto __pyx_L11_bool_binop_done;
          }
          __Pyx_INCREF(__pyx_v_code);
          __pyx_t_8 = __pyx_v_code;
          __pyx_L11_bool_binop_done:;
          __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_8), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 223, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_8 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_err_str); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 223, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_11 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_8), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 223, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_12[0] = __pyx_t_9;
          __pyx_t_12[1] = __pyx_mstate_global->__pyx_kp_u_;
          __pyx_t_12[2] = __pyx_t_11;
          __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_12, 3, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11));
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 223, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_8);
          __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          goto __pyx_L4_exception_handled;
        }
        goto __pyx_L5_except_error;

     224:     else:

    +225:         err_str = cares.hstrerror(system)

        /*else:*/ {
          __pyx_v_err_str = hstrerror(__pyx_v_system);

    +226:         result = _as_str(err_str)

          __pyx_t_4 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_err_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_4);
          __pyx_t_4 = 0;
        }
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L8_try_end;
        __pyx_L3_error:;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    +227:     return result

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

     228:

     229:

    +230: cdef object _gevent_herror_from_status(int ares_status):

    static PyObject *__pyx_f_6gevent_8resolver_5cares__gevent_herror_from_status(int __pyx_v_ares_status) {
      PyObject *__pyx_v_code = 0;
      PyObject *__pyx_v_message = 0;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("gevent.resolver.cares._gevent_herror_from_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_code);
      __Pyx_XDECREF(__pyx_v_message);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +231:     cdef object code = _ares_to_host_system.get(ares_status, ares_status)

      if (unlikely(__pyx_v_6gevent_8resolver_5cares__ares_to_host_system == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
        __PYX_ERR(0, 231, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_ares_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_ares_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_6gevent_8resolver_5cares__ares_to_host_system, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __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_v_code = __pyx_t_3;
      __pyx_t_3 = 0;

    +232:     cdef object message = _gevent_herror_strerror(ares_status)

      __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_ares_status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __pyx_f_6gevent_8resolver_5cares__gevent_herror_strerror(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_message = __pyx_t_2;
      __pyx_t_2 = 0;

    +233:     return herror(code, message)

      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_herror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        assert(__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);
        __pyx_t_4 = 1;
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_code, __pyx_v_message};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

     234:

     235:

    +236: class InvalidIP(ValueError):

      __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(1, __pyx_builtin_ValueError); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 236, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);
    /* … */
      __pyx_t_30 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[1]); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 236, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_30); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_29 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_30, __pyx_mstate_global->__pyx_n_u_InvalidIP, __pyx_mstate_global->__pyx_n_u_InvalidIP, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, (PyObject *) NULL); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 236, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      if (__pyx_t_30 != __pyx_mstate_global->__pyx_tuple[1]) {
        if (unlikely((PyDict_SetItemString(__pyx_t_29, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[1]) < 0))) __PYX_ERR(0, 236, __pyx_L1_error)
      }
      __pyx_t_28 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_InvalidIP, __pyx_t_30, __pyx_t_29, NULL, 0, 0); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 236, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_InvalidIP, __pyx_t_28) < 0) __PYX_ERR(0, 236, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
      __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(1, __pyx_builtin_ValueError); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 236, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);

     237:     pass

     238:

     239:

    +240: cdef void gevent_sock_state_callback(void *data, int s, int read, int write):

    static void __pyx_f_6gevent_8resolver_5cares_gevent_sock_state_callback(void *__pyx_v_data, int __pyx_v_s, int __pyx_v_read, int __pyx_v_write) {
      struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_ch = 0;
    /* … */
      /* function exit code */
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent.resolver.cares.gevent_sock_state_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_L0:;
      __Pyx_XDECREF((PyObject *)__pyx_v_ch);
      __Pyx_RefNannyFinishContext();
    }

    +241:     if not data:

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

    +242:         return

        goto __pyx_L0;

    +243:     cdef channel ch = <channel>data

      __pyx_t_2 = ((PyObject *)__pyx_v_data);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_v_ch = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2);
      __pyx_t_2 = 0;

    +244:     ch._sock_state_callback(s, read, write)

      __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_ch->__pyx_vtab)->_sock_state_callback(__pyx_v_ch, __pyx_v_s, __pyx_v_read, __pyx_v_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     245:

     246:

    +247: cdef class Result(object):

    struct __pyx_obj_6gevent_8resolver_5cares_Result {
      PyObject_HEAD
      PyObject *value;
      PyObject *exception;
    };

    +248:     cdef public object value

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_5value_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_5value_1__get__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_5value___get__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self));

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

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_6Result_5value___get__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->value);
      __pyx_r = __pyx_v_self->value;
      goto __pyx_L0;

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

    /* Python wrapper */
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_5value_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

    static int __pyx_pf_6gevent_8resolver_5cares_6Result_5value_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self, PyObject *__pyx_v_value) {
      int __pyx_r;
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      __Pyx_GOTREF(__pyx_v_self->value);
      __Pyx_DECREF(__pyx_v_self->value);
      __pyx_v_self->value = __pyx_v_value;

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

    /* Python wrapper */
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_5value_5__del__(PyObject *__pyx_v_self); /*proto*/
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_5value_5__del__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_5value_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self));

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

    static int __pyx_pf_6gevent_8resolver_5cares_6Result_5value_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self) {
      int __pyx_r;
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF(__pyx_v_self->value);
      __Pyx_DECREF(__pyx_v_self->value);
      __pyx_v_self->value = Py_None;

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

    +249:     cdef public object exception

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_9exception_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_9exception_1__get__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_9exception___get__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self));

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

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_6Result_9exception___get__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->exception);
      __pyx_r = __pyx_v_self->exception;
      goto __pyx_L0;

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

    /* Python wrapper */
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_9exception_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_9exception_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_9exception_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

    static int __pyx_pf_6gevent_8resolver_5cares_6Result_9exception_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self, PyObject *__pyx_v_value) {
      int __pyx_r;
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      __Pyx_GOTREF(__pyx_v_self->exception);
      __Pyx_DECREF(__pyx_v_self->exception);
      __pyx_v_self->exception = __pyx_v_value;

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

    /* Python wrapper */
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_9exception_5__del__(PyObject *__pyx_v_self); /*proto*/
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_9exception_5__del__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_9exception_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self));

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

    static int __pyx_pf_6gevent_8resolver_5cares_6Result_9exception_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self) {
      int __pyx_r;
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF(__pyx_v_self->exception);
      __Pyx_DECREF(__pyx_v_self->exception);
      __pyx_v_self->exception = Py_None;

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

     250:

    +251:     def __init__(self, object value=None, object exception=None):

    /* Python wrapper */
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_value = 0;
      PyObject *__pyx_v_exception = 0;
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
      #endif
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      {
        PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_value,&__pyx_mstate_global->__pyx_n_u_exception,0};
      PyObject* values[2] = {0,0};
        values[0] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None));
        values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None));
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  2:
            __Pyx_Arg_XDECREF_VARARGS(values[1]);
            values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1:
            __Pyx_Arg_XDECREF_VARARGS(values[0]);
            values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_value);
              if (value) {
                __Pyx_Arg_XDECREF_VARARGS(values[0]);
                values[0] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--;
              }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 251, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  1:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_exception);
              if (value) {
                __Pyx_Arg_XDECREF_VARARGS(values[1]);
                values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--;
              }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 251, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 251, __pyx_L3_error)
          }
        } else {
          switch (__pyx_nargs) {
            case  2:
            __Pyx_Arg_XDECREF_VARARGS(values[1]);
            values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1:
            __Pyx_Arg_XDECREF_VARARGS(values[0]);
            values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_value = values[0];
        __pyx_v_exception = values[1];
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 251, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
        }
      }
      __Pyx_AddTraceback("gevent.resolver.cares.Result.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return -1;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result___init__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self), __pyx_v_value, __pyx_v_exception);

      /* function exit code */
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
        }
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static int __pyx_pf_6gevent_8resolver_5cares_6Result___init__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_exception) {
      int __pyx_r;
    /* … */
      /* function exit code */
      __pyx_r = 0;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +252:         self.value = value

      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      __Pyx_GOTREF(__pyx_v_self->value);
      __Pyx_DECREF(__pyx_v_self->value);
      __pyx_v_self->value = __pyx_v_value;

    +253:         self.exception = exception

      __Pyx_INCREF(__pyx_v_exception);
      __Pyx_GIVEREF(__pyx_v_exception);
      __Pyx_GOTREF(__pyx_v_self->exception);
      __Pyx_DECREF(__pyx_v_self->exception);
      __pyx_v_self->exception = __pyx_v_exception;

     254:

    +255:     def __repr__(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_3__repr__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_3__repr__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_2__repr__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self));

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

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_6Result_2__repr__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_AddTraceback("gevent.resolver.cares.Result.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +256:         if self.exception is None:

      __pyx_t_1 = (__pyx_v_self->exception == Py_None);
      if (__pyx_t_1) {
    /* … */
      }

    +257:             return '%s(%r)' % (self.__class__.__name__, self.value)

        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_3), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_self->value), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4[0] = __pyx_t_2;
        __pyx_t_4[1] = __pyx_mstate_global->__pyx_kp_u__2;
        __pyx_t_4[2] = __pyx_t_3;
        __pyx_t_4[3] = __pyx_mstate_global->__pyx_kp_u__3;
        __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_4, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 1 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L0;

    +258:         elif self.value is None:

      __pyx_t_1 = (__pyx_v_self->value == Py_None);
      if (__pyx_t_1) {
    /* … */
      }

    +259:             return '%s(exception=%r)' % (self.__class__.__name__, self.exception)

        __Pyx_XDECREF(__pyx_r);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_3), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_self->exception), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4[0] = __pyx_t_5;
        __pyx_t_4[1] = __pyx_mstate_global->__pyx_kp_u_exception_2;
        __pyx_t_4[2] = __pyx_t_3;
        __pyx_t_4[3] = __pyx_mstate_global->__pyx_kp_u__3;
        __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_4, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L0;

     260:         else:

    +261:             return '%s(value=%r, exception=%r)' % (self.__class__.__name__, self.value, self.exception)

      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_3), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_self->value), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_self->exception), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6[0] = __pyx_t_2;
        __pyx_t_6[1] = __pyx_mstate_global->__pyx_kp_u_value_2;
        __pyx_t_6[2] = __pyx_t_3;
        __pyx_t_6[3] = __pyx_mstate_global->__pyx_kp_u_exception_3;
        __pyx_t_6[4] = __pyx_t_5;
        __pyx_t_6[5] = __pyx_mstate_global->__pyx_kp_u__3;
        __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_6, 6, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 7 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 12 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_r = __pyx_t_7;
        __pyx_t_7 = 0;
        goto __pyx_L0;
      }

     262:         # add repr_recursive precaution

     263:

    +264:     def successful(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_5successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_6Result_5successful = {"successful", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_6Result_5successful, METH_NOARGS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_5successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("successful (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_4successful(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self));

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

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_6Result_4successful(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent.resolver.cares.Result.successful", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_30 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_6Result_5successful, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Result_successful, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 264, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result, __pyx_mstate_global->__pyx_n_u_successful, __pyx_t_30) < 0) __PYX_ERR(0, 264, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;

    +265:         return self.exception is None

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = (__pyx_v_self->exception == Py_None);
      __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

     266:

    +267:     def get(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_7get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_6Result_7get = {"get", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_6Result_7get, METH_NOARGS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_7get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("get (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_6get(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self));

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

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_6Result_6get(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_AddTraceback("gevent.resolver.cares.Result.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_30 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_6Result_7get, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Result_get, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 267, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result, __pyx_mstate_global->__pyx_n_u_get, __pyx_t_30) < 0) __PYX_ERR(0, 267, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;

    +268:         if self.exception is not None:

      __pyx_t_1 = (__pyx_v_self->exception != Py_None);
      if (unlikely(__pyx_t_1)) {
    /* … */
      }

    +269:             raise self.exception

        __Pyx_Raise(__pyx_v_self->exception, 0, 0, 0);
        __PYX_ERR(0, 269, __pyx_L1_error)

    +270:         return self.value

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->value);
      __pyx_r = __pyx_v_self->value;
      goto __pyx_L0;

     271:

     272:

    +273: class ares_host_result(tuple):

      __pyx_t_30 = PyTuple_Pack(1, ((PyObject *)(&PyTuple_Type))); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_30); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_29 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      __pyx_t_28 = __Pyx_Py3MetaclassPrepare(__pyx_t_29, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ares_host_result, __pyx_mstate_global->__pyx_n_u_ares_host_result, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, (PyObject *) NULL); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      if (__pyx_t_3 != __pyx_t_30) {
        if (unlikely((PyDict_SetItemString(__pyx_t_28, "__orig_bases__", __pyx_t_30) < 0))) __PYX_ERR(0, 273, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
    /* … */
      __pyx_t_30 = __Pyx_Py3ClassCreate(__pyx_t_29, __pyx_mstate_global->__pyx_n_u_ares_host_result, __pyx_t_3, __pyx_t_28, NULL, 0, 0); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ares_host_result, __pyx_t_30) < 0) __PYX_ERR(0, 273, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     274:

    +275:     def __new__(cls, family, iterable):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_1__new__(PyObject *__pyx_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_1__new__ = {"__new__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_1__new__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_1__new__(PyObject *__pyx_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_cls = 0;
      PyObject *__pyx_v_family = 0;
      PyObject *__pyx_v_iterable = 0;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__new__ (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cls,&__pyx_mstate_global->__pyx_n_u_family,&__pyx_mstate_global->__pyx_n_u_iterable,0};
      PyObject* values[3] = {0,0,0};
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  3:
            values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
            CYTHON_FALLTHROUGH;
            case  2:
            values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1:
            values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_cls)) != 0)) {
              (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
              kw_args--;
            }
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L3_error)
            else goto __pyx_L5_argtuple_error;
            CYTHON_FALLTHROUGH;
            case  1:
            if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_family)) != 0)) {
              (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
              kw_args--;
            }
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L3_error)
            else {
              __Pyx_RaiseArgtupleInvalid("__new__", 1, 3, 3, 1); __PYX_ERR(0, 275, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  2:
            if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_iterable)) != 0)) {
              (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
              kw_args--;
            }
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L3_error)
            else {
              __Pyx_RaiseArgtupleInvalid("__new__", 1, 3, 3, 2); __PYX_ERR(0, 275, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__new__") < 0)) __PYX_ERR(0, 275, __pyx_L3_error)
          }
        } else if (unlikely(__pyx_nargs != 3)) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
          values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
          values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        }
        __pyx_v_cls = values[0];
        __pyx_v_family = values[1];
        __pyx_v_iterable = values[2];
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__new__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 275, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_AddTraceback("gevent.resolver.cares.ares_host_result.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_16ares_host_result___new__(__pyx_self, __pyx_v_cls, __pyx_v_family, __pyx_v_iterable);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_16ares_host_result___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_family, PyObject *__pyx_v_iterable) {
      PyObject *__pyx_v_self = 0;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("gevent.resolver.cares.ares_host_result.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_self);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_30 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_mstate_global->__pyx_n_u_ares_host_result___new, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 275, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      if (__Pyx_SetNewInClass(__pyx_t_28, __pyx_mstate_global->__pyx_n_u_new, __pyx_t_30) < 0) __PYX_ERR(0, 275, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;

    +276:         cdef object self = tuple.__new__(cls, iterable)

      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyTuple_Type)), __pyx_mstate_global->__pyx_n_u_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        assert(__pyx_t_3);
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_cls, __pyx_v_iterable};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_v_self = __pyx_t_1;
      __pyx_t_1 = 0;

    +277:         self.family = family

      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_family, __pyx_v_family) < 0) __PYX_ERR(0, 277, __pyx_L1_error)

    +278:         return self

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self);
      __pyx_r = __pyx_v_self;
      goto __pyx_L0;

     279:

    +280:     def __getnewargs__(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__ = {"__getnewargs__", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__, METH_O, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__getnewargs__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_16ares_host_result_2__getnewargs__(__pyx_self, ((PyObject *)__pyx_v_self));

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

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_16ares_host_result_2__getnewargs__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("gevent.resolver.cares.ares_host_result.__getnewargs__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_30 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__, 0, __pyx_mstate_global->__pyx_n_u_ares_host_result___getnewargs, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 280, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      if (__Pyx_SetNameInClass(__pyx_t_28, __pyx_mstate_global->__pyx_n_u_getnewargs, __pyx_t_30) < 0) __PYX_ERR(0, 280, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;

    +281:         return (self.family, tuple(self))

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_family); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 281, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_2);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 281, __pyx_L1_error);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

     282:

     283:

    +284: cdef list _parse_h_aliases(hostent* host):

    static PyObject *__pyx_f_6gevent_8resolver_5cares__parse_h_aliases(struct hostent *__pyx_v_host) {
      PyObject *__pyx_v_result = 0;
      char **__pyx_v_aliases;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("gevent.resolver.cares._parse_h_aliases", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_result);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +285:     cdef list result = []

      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_result = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

    +286:     cdef char** aliases = host.h_aliases

      __pyx_t_2 = __pyx_v_host->h_aliases;
      __pyx_v_aliases = __pyx_t_2;

     287:

    +288:     if not aliases or not aliases[0]:

      __pyx_t_4 = (!(__pyx_v_aliases != 0));
      if (!__pyx_t_4) {
      } else {
        __pyx_t_3 = __pyx_t_4;
        goto __pyx_L4_bool_binop_done;
      }
      __pyx_t_4 = (!((__pyx_v_aliases[0]) != 0));
      __pyx_t_3 = __pyx_t_4;
      __pyx_L4_bool_binop_done:;
      if (__pyx_t_3) {
    /* … */
      }

    +289:         return result

        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_result);
        __pyx_r = __pyx_v_result;
        goto __pyx_L0;

     290:

    +291:     while aliases[0]: # *aliases

      while (1) {
        __pyx_t_3 = ((__pyx_v_aliases[0]) != 0);
        if (!__pyx_t_3) break;

     292:         # The old C version of this excluded an alias if

     293:         # it matched the host name. I don't think the stdlib does that?

    +294:         result.append(_as_str(aliases[0]))

        __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__as_str((__pyx_v_aliases[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 294, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +295:         aliases += 1

        __pyx_v_aliases = (__pyx_v_aliases + 1);
      }

    +296:     return result

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

     297:

     298:

    +299: cdef list _parse_h_addr_list(hostent* host):

    static PyObject *__pyx_f_6gevent_8resolver_5cares__parse_h_addr_list(struct hostent *__pyx_v_host) {
      PyObject *__pyx_v_result = 0;
      char **__pyx_v_addr_list;
      CYTHON_UNUSED int __pyx_v_addr_type;
      char __pyx_v_tmpbuf[46];
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_AddTraceback("gevent.resolver.cares._parse_h_addr_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_result);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +300:     cdef list result = []

      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_result = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

    +301:     cdef char** addr_list = host.h_addr_list

      __pyx_t_2 = __pyx_v_host->h_addr_list;
      __pyx_v_addr_list = __pyx_t_2;

    +302:     cdef int addr_type = host.h_addrtype

      __pyx_t_3 = __pyx_v_host->h_addrtype;
      __pyx_v_addr_type = __pyx_t_3;

     303:     # INET6_ADDRSTRLEN is 46, but we can't use that named constant

     304:     # here; cython doesn't like it.

     305:     cdef char tmpbuf[46]

     306:

    +307:     if not addr_list or not addr_list[0]:

      __pyx_t_5 = (!(__pyx_v_addr_list != 0));
      if (!__pyx_t_5) {
      } else {
        __pyx_t_4 = __pyx_t_5;
        goto __pyx_L4_bool_binop_done;
      }
      __pyx_t_5 = (!((__pyx_v_addr_list[0]) != 0));
      __pyx_t_4 = __pyx_t_5;
      __pyx_L4_bool_binop_done:;
      if (__pyx_t_4) {
    /* … */
      }

    +308:         return result

        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_result);
        __pyx_r = __pyx_v_result;
        goto __pyx_L0;

     309:

    +310:     while addr_list[0]:

      while (1) {
        __pyx_t_4 = ((__pyx_v_addr_list[0]) != 0);
        if (!__pyx_t_4) break;

    +311:         if not cares.ares_inet_ntop(host.h_addrtype, addr_list[0], tmpbuf, INET6_ADDRSTRLEN):

        __pyx_t_4 = (!(ares_inet_ntop(__pyx_v_host->h_addrtype, (__pyx_v_addr_list[0]), __pyx_v_tmpbuf, INET6_ADDRSTRLEN) != 0));
        if (unlikely(__pyx_t_4)) {
    /* … */
        }

    +312:             raise _socket.error("Failed in ares_inet_ntop")

          __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 312, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = NULL;
          __pyx_t_8 = 0;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
            assert(__pyx_t_6);
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
            __pyx_t_8 = 1;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_Failed_in_ares_inet_ntop};
            __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          }
          __Pyx_Raise(__pyx_t_1, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __PYX_ERR(0, 312, __pyx_L1_error)

     313:

    +314:         result.append(_as_str(tmpbuf))

        __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_tmpbuf); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 314, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +315:         addr_list += 1

        __pyx_v_addr_list = (__pyx_v_addr_list + 1);
      }

     316:

    +317:     return result

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

     318:

     319:

    +320: cdef object _as_str(const char* val):

    static PyObject *__pyx_f_6gevent_8resolver_5cares__as_str(char const *__pyx_v_val) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent.resolver.cares._as_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +321:     if not val:

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

    +322:         return None

        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L0;

     323:

    +324:     if PY_MAJOR_VERSION < 3:

      __pyx_t_1 = (PY_MAJOR_VERSION < 3);
      if (__pyx_t_1) {
    /* … */
      }

    +325:         return <bytes>val

        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(((PyObject*)__pyx_t_2));
        __pyx_r = __pyx_t_2;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L0;

    +326:     return val.decode('utf-8')

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_ssize_strlen(__pyx_v_val); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 326, __pyx_L1_error)
      __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_val, 0, __pyx_t_3, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

     327:

     328:

    +329: cdef void gevent_ares_nameinfo_callback(void *arg, int status, int timeouts, char *c_node, char *c_service):

    static void __pyx_f_6gevent_8resolver_5cares_gevent_ares_nameinfo_callback(void *__pyx_v_arg, int __pyx_v_status, CYTHON_UNUSED int __pyx_v_timeouts, char *__pyx_v_c_node, char *__pyx_v_c_service) {
      struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_channel = 0;
      PyObject *__pyx_v_callback = 0;
      PyObject *__pyx_v_node = 0;
      PyObject *__pyx_v_service = 0;
    /* … */
      /* function exit code */
      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_8);
      __Pyx_XDECREF(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_12);
      __Pyx_AddTraceback("gevent.resolver.cares.gevent_ares_nameinfo_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_L0:;
      __Pyx_XDECREF((PyObject *)__pyx_v_channel);
      __Pyx_XDECREF(__pyx_v_callback);
      __Pyx_XDECREF(__pyx_v_node);
      __Pyx_XDECREF(__pyx_v_service);
      __Pyx_RefNannyFinishContext();
    }

     330:     cdef channel channel

     331:     cdef object callback

    +332:     channel, callback = <tuple>arg

      __pyx_t_1 = ((PyObject *)__pyx_v_arg);
      __Pyx_INCREF(__pyx_t_1);
      if (likely(__pyx_t_1 != Py_None)) {
        PyObject* sequence = __pyx_t_1;
        Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 332, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_3);
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 332, __pyx_L1_error)
      }
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel))))) __PYX_ERR(0, 332, __pyx_L1_error)
      __pyx_v_channel = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_v_callback = __pyx_t_3;
      __pyx_t_3 = 0;

    +333:     Py_DECREF(<tuple>arg)

      Py_DECREF(((PyObject *)__pyx_v_arg));

     334:     cdef object node

     335:     cdef object service

    +336:     try:

      {
        /*try:*/ {
    /* … */
        }
        __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_L8_try_end;
        __pyx_L3_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    /* … */
        __pyx_L5_except_error:;
        __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_L4_exception_handled:;
        __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_L8_try_end:;
      }

    +337:         if status:

          __pyx_t_7 = (__pyx_v_status != 0);
          if (__pyx_t_7) {
    /* … */
            goto __pyx_L9;
          }

    +338:             callback(Result(None, _gevent_gaierror_from_status(status)))

            __pyx_t_3 = __pyx_f_6gevent_8resolver_5cares__gevent_gaierror_from_status(__pyx_v_status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 338, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_INCREF(Py_None);
            __Pyx_GIVEREF(Py_None);
            if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None) != (0)) __PYX_ERR(0, 338, __pyx_L3_error);
            __Pyx_GIVEREF(__pyx_t_3);
            if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 338, __pyx_L3_error);
            __pyx_t_3 = 0;
            __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 338, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_INCREF(__pyx_v_callback);
            __pyx_t_2 = __pyx_v_callback; __pyx_t_8 = NULL;
            __pyx_t_9 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
              assert(__pyx_t_8);
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_8);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_9 = 1;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_3};
              __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     339:         else:

    +340:             node = _as_str(c_node)

          /*else*/ {
            __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_v_node = __pyx_t_1;
            __pyx_t_1 = 0;

    +341:             service = _as_str(c_service)

            __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_c_service); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_v_service = __pyx_t_1;
            __pyx_t_1 = 0;

    +342:             callback(Result((node, service)))

            __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_INCREF(__pyx_v_node);
            __Pyx_GIVEREF(__pyx_v_node);
            if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_node) != (0)) __PYX_ERR(0, 342, __pyx_L3_error);
            __Pyx_INCREF(__pyx_v_service);
            __Pyx_GIVEREF(__pyx_v_service);
            if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_service) != (0)) __PYX_ERR(0, 342, __pyx_L3_error);
            __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_INCREF(__pyx_v_callback);
            __pyx_t_2 = __pyx_v_callback; __pyx_t_8 = NULL;
            __pyx_t_9 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
              assert(__pyx_t_8);
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_8);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_9 = 1;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_3};
              __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __pyx_L9:;

    +343:     except:

        /*except:*/ {
          __Pyx_AddTraceback("gevent.resolver.cares.gevent_ares_nameinfo_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 343, __pyx_L5_except_error)
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_3);

    +344:         channel.loop.handle_error(callback, *sys.exc_info())

          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_channel->loop, __pyx_mstate_global->__pyx_n_u_handle_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 344, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 344, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_INCREF(__pyx_v_callback);
          __Pyx_GIVEREF(__pyx_v_callback);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_callback) != (0)) __PYX_ERR(0, 344, __pyx_L5_except_error);
          __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 344, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_exc_info); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 344, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = __Pyx_PyObject_CallNoArg(__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 344, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PySequence_Tuple(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 344, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 344, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 344, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L4_exception_handled;
        }

     345:

     346:

     347:

    +348: cdef int _make_sockaddr(const char* hostp, int port, int flowinfo, int scope_id, sockaddr_in6* sa6):

    static int __pyx_f_6gevent_8resolver_5cares__make_sockaddr(char const *__pyx_v_hostp, int __pyx_v_port, int __pyx_v_flowinfo, int __pyx_v_scope_id, struct sockaddr_in6 *__pyx_v_sa6) {
      int __pyx_r;
    /* … */
      /* function exit code */
      __pyx_L0:;
      return __pyx_r;
    }

    +349:     if cares.ares_inet_pton(AF_INET, hostp, &(<sockaddr_in*>sa6).sin_addr.s_addr) > 0:

      __pyx_t_1 = (ares_inet_pton(AF_INET, __pyx_v_hostp, (&((struct sockaddr_in *)__pyx_v_sa6)->sin_addr.s_addr)) > 0);
      if (__pyx_t_1) {
    /* … */
      }

    +350:         (<sockaddr_in*>sa6).sin_family = AF_INET

        ((struct sockaddr_in *)__pyx_v_sa6)->sin_family = AF_INET;

    +351:         (<sockaddr_in*>sa6).sin_port = htons(port)

        ((struct sockaddr_in *)__pyx_v_sa6)->sin_port = htons(__pyx_v_port);

    +352:         return sizeof(sockaddr_in)

        __pyx_r = (sizeof(struct sockaddr_in));
        goto __pyx_L0;

     353:

    +354:     if cares.ares_inet_pton(AF_INET6, hostp, &(sa6.sin6_addr).s6_addr) > 0:

      __pyx_t_1 = (ares_inet_pton(AF_INET6, __pyx_v_hostp, (&__pyx_v_sa6->sin6_addr.s6_addr)) > 0);
      if (__pyx_t_1) {
    /* … */
      }

    +355:         sa6.sin6_family = AF_INET6

        __pyx_v_sa6->sin6_family = AF_INET6;

    +356:         sa6.sin6_port = htons(port)

        __pyx_v_sa6->sin6_port = htons(__pyx_v_port);

    +357:         sa6.sin6_flowinfo = flowinfo

        __pyx_v_sa6->sin6_flowinfo = __pyx_v_flowinfo;

    +358:         sa6.sin6_scope_id = scope_id

        __pyx_v_sa6->sin6_scope_id = __pyx_v_scope_id;

    +359:         return sizeof(sockaddr_in6);

        __pyx_r = (sizeof(struct sockaddr_in6));
        goto __pyx_L0;

     360:

    +361:     return -1;

      __pyx_r = -1;
      goto __pyx_L0;

     362:

     363:

    +364: cdef class channel:

    struct __pyx_obj_6gevent_8resolver_5cares_channel {
      PyObject_HEAD
      struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *__pyx_vtab;
      struct ares_channeldata *channel;
      PyObject *loop;
      PyObject *_watchers;
      PyObject *_timer;
    };

    struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel {
      PyObject *(*_channel__destroy)(struct __pyx_obj_6gevent_8resolver_5cares_channel *);
      PyObject *(*set_servers)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers *__pyx_optional_args);
      PyObject *(*_sock_state_callback)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, int, int, int);
      void (*_gethostbyname_or_byaddr_cb)(void *, int, int, struct hostent *);
      PyObject *(*_getnameinfo)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, PyObject *, PyObject *, int, int __pyx_skip_dispatch);
      int (*_convert_cares_ni_flags)(int);
      int (*_convert_cares_ai_flags)(int);
      void (*_getaddrinfo_cb)(void *, int, int, struct ares_addrinfo *);
    };
    static struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *__pyx_vtabptr_6gevent_8resolver_5cares_channel;

     365:     cdef ares_channeldata* channel

     366:

    +367:     cdef readonly object loop

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_4loop_1__get__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_4loop___get__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));

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

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_4loop___get__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->loop);
      __pyx_r = __pyx_v_self->loop;
      goto __pyx_L0;

     368:

     369:     cdef dict _watchers

     370:     cdef object _timer

     371:

    +372:     def __init__(self, object loop, flags=None, timeout=None, tries=None, ndots=None,

    /* Python wrapper */
    static int __pyx_pw_6gevent_8resolver_5cares_7channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static int __pyx_pw_6gevent_8resolver_5cares_7channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_loop = 0;
      PyObject *__pyx_v_flags = 0;
      PyObject *__pyx_v_timeout = 0;
      PyObject *__pyx_v_tries = 0;
      PyObject *__pyx_v_ndots = 0;
      PyObject *__pyx_v_udp_port = 0;
      PyObject *__pyx_v_tcp_port = 0;
      PyObject *__pyx_v_servers = 0;
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
      #endif
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      {
        PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_loop,&__pyx_mstate_global->__pyx_n_u_flags,&__pyx_mstate_global->__pyx_n_u_timeout,&__pyx_mstate_global->__pyx_n_u_tries,&__pyx_mstate_global->__pyx_n_u_ndots,&__pyx_mstate_global->__pyx_n_u_udp_port,&__pyx_mstate_global->__pyx_n_u_tcp_port,&__pyx_mstate_global->__pyx_n_u_servers,0};
      PyObject* values[8] = {0,0,0,0,0,0,0,0};
        values[1] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None));
        values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None));
        values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None));
        values[4] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None));
    /* … */
      /* function exit code */
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
        }
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static int __pyx_pf_6gevent_8resolver_5cares_7channel___init__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_loop, PyObject *__pyx_v_flags, PyObject *__pyx_v_timeout, PyObject *__pyx_v_tries, PyObject *__pyx_v_ndots, PyObject *__pyx_v_udp_port, PyObject *__pyx_v_tcp_port, PyObject *__pyx_v_servers) {
      struct ares_channeldata *__pyx_v_channel;
      struct ares_options __pyx_v_options;
      int __pyx_v_optmask;
      int __pyx_v_result;
      int __pyx_r;
    /* … */
      /* function exit code */
      __pyx_r = 0;
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = -1;
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +373:                  udp_port=None, tcp_port=None, servers=None):

        values[5] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None));
        values[6] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None));
        values[7] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_None));
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  8:
            __Pyx_Arg_XDECREF_VARARGS(values[7]);
            values[7] = __Pyx_Arg_VARARGS(__pyx_args, 7);
            CYTHON_FALLTHROUGH;
            case  7:
            __Pyx_Arg_XDECREF_VARARGS(values[6]);
            values[6] = __Pyx_Arg_VARARGS(__pyx_args, 6);
            CYTHON_FALLTHROUGH;
            case  6:
            __Pyx_Arg_XDECREF_VARARGS(values[5]);
            values[5] = __Pyx_Arg_VARARGS(__pyx_args, 5);
            CYTHON_FALLTHROUGH;
            case  5:
            __Pyx_Arg_XDECREF_VARARGS(values[4]);
            values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
            CYTHON_FALLTHROUGH;
            case  4:
            __Pyx_Arg_XDECREF_VARARGS(values[3]);
            values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
            CYTHON_FALLTHROUGH;
            case  3:
            __Pyx_Arg_XDECREF_VARARGS(values[2]);
            values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
            CYTHON_FALLTHROUGH;
            case  2:
            __Pyx_Arg_XDECREF_VARARGS(values[1]);
            values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1:
            values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_loop)) != 0)) {
              (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
              kw_args--;
            }
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 372, __pyx_L3_error)
            else goto __pyx_L5_argtuple_error;
            CYTHON_FALLTHROUGH;
            case  1:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_flags);
              if (value) {
                __Pyx_Arg_XDECREF_VARARGS(values[1]);
                values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--;
              }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 372, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  2:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_timeout);
              if (value) {
                __Pyx_Arg_XDECREF_VARARGS(values[2]);
                values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--;
              }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 372, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  3:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_tries);
              if (value) {
                __Pyx_Arg_XDECREF_VARARGS(values[3]);
                values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--;
              }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 372, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  4:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_ndots);
              if (value) {
                __Pyx_Arg_XDECREF_VARARGS(values[4]);
                values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--;
              }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 372, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  5:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_udp_port);
              if (value) {
                __Pyx_Arg_XDECREF_VARARGS(values[5]);
                values[5] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--;
              }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 372, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  6:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_tcp_port);
              if (value) {
                __Pyx_Arg_XDECREF_VARARGS(values[6]);
                values[6] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--;
              }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 372, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  7:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_servers);
              if (value) {
                __Pyx_Arg_XDECREF_VARARGS(values[7]);
                values[7] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--;
              }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 372, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 372, __pyx_L3_error)
          }
        } else {
          switch (__pyx_nargs) {
            case  8:
            __Pyx_Arg_XDECREF_VARARGS(values[7]);
            values[7] = __Pyx_Arg_VARARGS(__pyx_args, 7);
            CYTHON_FALLTHROUGH;
            case  7:
            __Pyx_Arg_XDECREF_VARARGS(values[6]);
            values[6] = __Pyx_Arg_VARARGS(__pyx_args, 6);
            CYTHON_FALLTHROUGH;
            case  6:
            __Pyx_Arg_XDECREF_VARARGS(values[5]);
            values[5] = __Pyx_Arg_VARARGS(__pyx_args, 5);
            CYTHON_FALLTHROUGH;
            case  5:
            __Pyx_Arg_XDECREF_VARARGS(values[4]);
            values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
            CYTHON_FALLTHROUGH;
            case  4:
            __Pyx_Arg_XDECREF_VARARGS(values[3]);
            values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
            CYTHON_FALLTHROUGH;
            case  3:
            __Pyx_Arg_XDECREF_VARARGS(values[2]);
            values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
            CYTHON_FALLTHROUGH;
            case  2:
            __Pyx_Arg_XDECREF_VARARGS(values[1]);
            values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1:
            values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_loop = values[0];
        __pyx_v_flags = values[1];
        __pyx_v_timeout = values[2];
        __pyx_v_tries = values[3];
        __pyx_v_ndots = values[4];
        __pyx_v_udp_port = values[5];
        __pyx_v_tcp_port = values[6];
        __pyx_v_servers = values[7];
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 8, __pyx_nargs); __PYX_ERR(0, 372, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
        }
      }
      __Pyx_AddTraceback("gevent.resolver.cares.channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return -1;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel___init__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_loop, __pyx_v_flags, __pyx_v_timeout, __pyx_v_tries, __pyx_v_ndots, __pyx_v_udp_port, __pyx_v_tcp_port, __pyx_v_servers);

    +374:         cdef ares_channeldata* channel = NULL

      __pyx_v_channel = NULL;

     375:         cdef cares.ares_options options

    +376:         memset(&options, 0, sizeof(cares.ares_options))

      (void)(memset((&__pyx_v_options), 0, (sizeof(struct ares_options))));

    +377:         cdef int optmask = cares.ARES_OPT_SOCK_STATE_CB

      __pyx_v_optmask = ARES_OPT_SOCK_STATE_CB;

     378:

    +379:         options.sock_state_cb = <void*>gevent_sock_state_callback

      __pyx_v_options.sock_state_cb = ((void *)__pyx_f_6gevent_8resolver_5cares_gevent_sock_state_callback);

    +380:         options.sock_state_cb_data = <void*>self

      __pyx_v_options.sock_state_cb_data = ((void *)__pyx_v_self);

     381:

    +382:         if flags is not None:

      __pyx_t_1 = (__pyx_v_flags != Py_None);
      if (__pyx_t_1) {
    /* … */
      }

    +383:             options.flags = int(flags)

        __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_options.flags = __pyx_t_3;

    +384:             optmask |= cares.ARES_OPT_FLAGS

        __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_FLAGS);

     385:

    +386:         if timeout is not None:

      __pyx_t_1 = (__pyx_v_timeout != Py_None);
      if (__pyx_t_1) {
    /* … */
      }

    +387:             options.timeout = int(float(timeout) * 1000)

        __pyx_t_4 = __Pyx_PyObject_AsDouble(__pyx_v_timeout); if (unlikely(__pyx_t_4 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L1_error)
        __pyx_v_options.timeout = ((int)(__pyx_t_4 * 1000.0));

    +388:             optmask |= cares.ARES_OPT_TIMEOUTMS

        __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_TIMEOUTMS);

     389:

    +390:         if tries is not None:

      __pyx_t_1 = (__pyx_v_tries != Py_None);
      if (__pyx_t_1) {
    /* … */
      }

    +391:             options.tries = int(tries)

        __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_tries); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 391, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_options.tries = __pyx_t_3;

    +392:             optmask |= cares.ARES_OPT_TRIES

        __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_TRIES);

     393:

    +394:         if ndots is not None:

      __pyx_t_1 = (__pyx_v_ndots != Py_None);
      if (__pyx_t_1) {
    /* … */
      }

    +395:             options.ndots = int(ndots)

        __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_ndots); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 395, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_options.ndots = __pyx_t_3;

    +396:             optmask |= cares.ARES_OPT_NDOTS

        __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_NDOTS);

     397:

    +398:         if udp_port is not None:

      __pyx_t_1 = (__pyx_v_udp_port != Py_None);
      if (__pyx_t_1) {
    /* … */
      }

    +399:             options.udp_port = int(udp_port)

        __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_udp_port); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = __Pyx_PyLong_As_unsigned_short(__pyx_t_2); if (unlikely((__pyx_t_5 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 399, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_options.udp_port = __pyx_t_5;

    +400:             optmask |= cares.ARES_OPT_UDP_PORT

        __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_UDP_PORT);

     401:

    +402:         if tcp_port is not None:

      __pyx_t_1 = (__pyx_v_tcp_port != Py_None);
      if (__pyx_t_1) {
    /* … */
      }

    +403:             options.tcp_port = int(tcp_port)

        __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_tcp_port); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 403, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = __Pyx_PyLong_As_unsigned_short(__pyx_t_2); if (unlikely((__pyx_t_5 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 403, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_options.tcp_port = __pyx_t_5;

    +404:             optmask |= cares.ARES_OPT_TCP_PORT

        __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_TCP_PORT);

     405:

    +406:         cdef int result = cares.ares_library_init(cares.ARES_LIB_INIT_ALL)  # ARES_LIB_INIT_WIN32 -DUSE_WINSOCK?

      __pyx_v_result = ares_library_init(ARES_LIB_INIT_ALL);

    +407:         if result:

      __pyx_t_1 = (__pyx_v_result != 0);
      if (unlikely(__pyx_t_1)) {
    /* … */
      }

    +408:             raise gaierror(result, _gevent_gai_strerror(result))

        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_gaierror); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 408, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 408, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 408, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __pyx_f_6gevent_8resolver_5cares__gevent_gai_strerror(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 408, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = NULL;
        __pyx_t_10 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          assert(__pyx_t_8);
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_10 = 1;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_7, __pyx_t_9};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10);
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 408, __pyx_L1_error)

    +409:         result = cares.ares_init_options(&channel, &options, optmask)

      __pyx_v_result = ares_init_options((&__pyx_v_channel), (&__pyx_v_options), __pyx_v_optmask);

    +410:         if result:

      __pyx_t_1 = (__pyx_v_result != 0);
      if (unlikely(__pyx_t_1)) {
    /* … */
      }

    +411:             raise gaierror(result, _gevent_gai_strerror(result))

        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_gaierror); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 411, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_result); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 411, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 411, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __pyx_f_6gevent_8resolver_5cares__gevent_gai_strerror(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 411, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        __pyx_t_10 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          assert(__pyx_t_7);
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_10 = 1;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_9, __pyx_t_8};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 411, __pyx_L1_error)

    +412:         self._timer = loop.timer(TIMEOUT, TIMEOUT)

      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_loop, __pyx_mstate_global->__pyx_n_u_timer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 412, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = __Pyx_PyLong_From_int(TIMEOUT); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 412, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyLong_From_int(TIMEOUT); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 412, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_7 = NULL;
      __pyx_t_10 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        assert(__pyx_t_7);
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_10 = 1;
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_8, __pyx_t_9};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->_timer);
      __Pyx_DECREF(__pyx_v_self->_timer);
      __pyx_v_self->_timer = __pyx_t_2;
      __pyx_t_2 = 0;

    +413:         self._watchers = {}

      __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->_watchers);
      __Pyx_DECREF(__pyx_v_self->_watchers);
      __pyx_v_self->_watchers = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;

    +414:         self.channel = channel

      __pyx_v_self->channel = __pyx_v_channel;

    +415:         try:

      {
        /*try:*/ {
    /* … */
        }
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L16_try_end;
        __pyx_L11_error:;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    /* … */
        __pyx_L13_except_error:;
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        goto __pyx_L1_error;
        __pyx_L16_try_end:;
      }

    +416:             if servers is not None:

          __pyx_t_1 = (__pyx_v_servers != Py_None);
          if (__pyx_t_1) {
    /* … */
          }

    +417:                 self.set_servers(servers)

            __pyx_t_14.__pyx_n = 1;
            __pyx_t_14.servers = __pyx_v_servers;
            __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_self->__pyx_vtab)->set_servers(__pyx_v_self, 0, &__pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +418:             self.loop = loop

          __Pyx_INCREF(__pyx_v_loop);
          __Pyx_GIVEREF(__pyx_v_loop);
          __Pyx_GOTREF(__pyx_v_self->loop);
          __Pyx_DECREF(__pyx_v_self->loop);
          __pyx_v_self->loop = __pyx_v_loop;

    +419:         except:

        /*except:*/ {
          __Pyx_AddTraceback("gevent.resolver.cares.channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 419, __pyx_L13_except_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_9);

    +420:             self.destroy()

          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_destroy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 420, __pyx_L13_except_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L13_except_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    +421:             raise

          __Pyx_GIVEREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_6);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_6, __pyx_t_9);
          __pyx_t_2 = 0;  __pyx_t_6 = 0;  __pyx_t_9 = 0;
          __PYX_ERR(0, 421, __pyx_L13_except_error)
        }

     422:

    +423:     def __repr__(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_3__repr__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_3__repr__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_2__repr__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));

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

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_2__repr__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
      PyObject *__pyx_v_args = NULL;
      PyObject *__pyx_r = NULL;
    /* … */
      /* 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_5);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_args);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +424:         args = (self.__class__.__name__, id(self), self._timer, len(self._watchers))

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __pyx_v_self->_watchers;
      __Pyx_INCREF(__pyx_t_3);
      if (unlikely(__pyx_t_3 == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 424, __pyx_L1_error)
      }
      __pyx_t_4 = PyDict_Size(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 424, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyLong_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 424, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 424, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_1);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 424, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_self->_timer);
      __Pyx_GIVEREF(__pyx_v_self->_timer);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_self->_timer) != (0)) __PYX_ERR(0, 424, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_3);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_3) != (0)) __PYX_ERR(0, 424, __pyx_L1_error);
      __pyx_t_2 = 0;
      __pyx_t_1 = 0;
      __pyx_t_3 = 0;
      __pyx_v_args = ((PyObject*)__pyx_t_5);
      __pyx_t_5 = 0;

    +425:         return '<%s at 0x%x _timer=%r _watchers[%s]>' % args

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_s_at_0x_x__timer_r__watchers_s, __pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 425, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;

     426:

    +427:     def destroy(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_5destroy = {"destroy", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_7channel_5destroy, METH_NOARGS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("destroy (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_4destroy(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));

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

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_4destroy(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_5destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_channel_destroy, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_3) < 0) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +428:         self.__destroy()

      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_self->__pyx_vtab)->_channel__destroy(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     429:

    +430:     cdef __destroy(self):

    static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel__channel__destroy(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_AddTraceback("gevent.resolver.cares.channel._channel__destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +431:         if self.channel:

      __pyx_t_1 = (__pyx_v_self->channel != 0);
      if (__pyx_t_1) {
    /* … */
      }

     432:             # XXX ares_library_cleanup?

    +433:             cares.ares_destroy(self.channel)

        ares_destroy(__pyx_v_self->channel);

    +434:             self.channel = NULL

        __pyx_v_self->channel = NULL;

    +435:             self._watchers.clear()

        if (unlikely(__pyx_v_self->_watchers == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
          __PYX_ERR(0, 435, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_PyDict_Clear(__pyx_v_self->_watchers); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 435, __pyx_L1_error)

    +436:             self._timer.stop()

        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 436, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    +437:             self.loop = None

        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        __Pyx_GOTREF(__pyx_v_self->loop);
        __Pyx_DECREF(__pyx_v_self->loop);
        __pyx_v_self->loop = Py_None;

     438:

    +439:     def __dealloc__(self):

    /* Python wrapper */
    static void __pyx_pw_6gevent_8resolver_5cares_7channel_7__dealloc__(PyObject *__pyx_v_self); /*proto*/
    static void __pyx_pw_6gevent_8resolver_5cares_7channel_7__dealloc__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_pf_6gevent_8resolver_5cares_7channel_6__dealloc__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));

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

    static void __pyx_pf_6gevent_8resolver_5cares_7channel_6__dealloc__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
    /* … */
      /* function exit code */
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_WriteUnraisable("gevent.resolver.cares.channel.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
    }

    +440:         self.__destroy()

      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_self->__pyx_vtab)->_channel__destroy(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     441:

    +442:     cpdef set_servers(self, servers=None):

    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel_set_servers(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers *__pyx_optional_args) {
      PyObject *__pyx_v_servers = ((PyObject *)Py_None);
      int __pyx_v_length;
      CYTHON_UNUSED int __pyx_v_result;
      int __pyx_v_index;
      char *__pyx_v_string;
      struct ares_addr_node *__pyx_v_c_servers;
      PyObject *__pyx_v_server = NULL;
      PyObject *__pyx_r = NULL;
      if (__pyx_optional_args) {
        if (__pyx_optional_args->__pyx_n > 0) {
          __pyx_v_servers = __pyx_optional_args->servers;
        }
      }
      __Pyx_INCREF(__pyx_v_servers);
      /* Check if called by wrapper */
      if (unlikely(__pyx_skip_dispatch)) ;
      /* Check if overridden in Python */
      else if (
      #if !CYTHON_USE_TYPE_SLOTS
      unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel &&
      __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
      #else
      unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
      #endif
      ) {
        #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
        if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
          PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          #endif
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_set_servers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers)) {
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(__pyx_t_1);
            __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
            __pyx_t_5 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              assert(__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;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_servers};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            }
            __pyx_r = __pyx_t_2;
            __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L0;
          }
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
          __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
          if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
            __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
          }
          #endif
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        }
        #endif
      }
    /* … */
      /* 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_11);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.set_servers", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_server);
      __Pyx_XDECREF(__pyx_v_servers);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_9set_servers = {"set_servers", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_servers = 0;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("set_servers (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_servers,0};
      PyObject* values[1] = {0};
        values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  1:
            __Pyx_Arg_XDECREF_FASTCALL(values[0]);
            values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_servers);
              if (value) {
                __Pyx_Arg_XDECREF_FASTCALL(values[0]);
                values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--;
              }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 442, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_servers") < 0)) __PYX_ERR(0, 442, __pyx_L3_error)
          }
        } else {
          switch (__pyx_nargs) {
            case  1:
            __Pyx_Arg_XDECREF_FASTCALL(values[0]);
            values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_servers = values[0];
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("set_servers", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 442, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_AddTraceback("gevent.resolver.cares.channel.set_servers", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_8set_servers(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_servers);

      /* function exit code */
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_8set_servers(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_servers) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2.__pyx_n = 1;
      __pyx_t_2.servers = __pyx_v_servers;
      __pyx_t_1 = __pyx_vtabptr_6gevent_8resolver_5cares_channel->set_servers(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __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("gevent.resolver.cares.channel.set_servers", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_9set_servers, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_channel_set_servers, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[2]);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel, __pyx_mstate_global->__pyx_n_u_set_servers, __pyx_t_3) < 0) __PYX_ERR(0, 442, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /* … */
      __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 442, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);
    /* … */
    struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers {
      int __pyx_n;
      PyObject *servers;
    };

    +443:         if not self.channel:

      __pyx_t_6 = (!(__pyx_v_self->channel != 0));
      if (unlikely(__pyx_t_6)) {
    /* … */
      }

    +444:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')

        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyLong_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
          assert(__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);
          __pyx_t_5 = 1;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_3, __pyx_mstate_global->__pyx_kp_u_this_ares_channel_has_been_destr};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 444, __pyx_L1_error)

    +445:         if not servers:

      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_servers); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 445, __pyx_L1_error)
      __pyx_t_7 = (!__pyx_t_6);
      if (__pyx_t_7) {
    /* … */
      }

    +446:             servers = []

        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_servers, __pyx_t_1);
        __pyx_t_1 = 0;

    +447:         if isinstance(servers, string_types):

      __pyx_t_1 = __pyx_v_6gevent_8resolver_5cares_string_types;
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_7 = PyObject_IsInstance(__pyx_v_servers, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 447, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_7) {
    /* … */
      }

    +448:             servers = servers.split(',')

        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_servers, __pyx_mstate_global->__pyx_n_u_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
          assert(__pyx_t_3);
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_5 = 1;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u__4};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_DECREF_SET(__pyx_v_servers, __pyx_t_1);
        __pyx_t_1 = 0;

    +449:         cdef int length = len(servers)

      __pyx_t_8 = PyObject_Length(__pyx_v_servers); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 449, __pyx_L1_error)
      __pyx_v_length = __pyx_t_8;

     450:         cdef int result, index

     451:         cdef char* string

     452:         cdef cares.ares_addr_node* c_servers

    +453:         if length <= 0:

      __pyx_t_7 = (__pyx_v_length <= 0);
      if (__pyx_t_7) {
    /* … */
        goto __pyx_L6;
      }

    +454:             result = cares.ares_set_servers(self.channel, NULL)

        __pyx_v_result = ares_set_servers(__pyx_v_self->channel, NULL);

     455:         else:

    +456:             c_servers = <cares.ares_addr_node*>PyMem_Malloc(sizeof(cares.ares_addr_node) * length)

      /*else*/ {
        __pyx_v_c_servers = ((struct ares_addr_node *)PyMem_Malloc(((sizeof(struct ares_addr_node)) * __pyx_v_length)));

    +457:             if not c_servers:

        __pyx_t_7 = (!(__pyx_v_c_servers != 0));
        if (unlikely(__pyx_t_7)) {
    /* … */
        }

    +458:                 raise MemoryError

          PyErr_NoMemory(); __PYX_ERR(0, 458, __pyx_L1_error)

    +459:             try:

        /*try:*/ {

    +460:                 index = 0

          __pyx_v_index = 0;

    +461:                 for server in servers:

          if (likely(PyList_CheckExact(__pyx_v_servers)) || PyTuple_CheckExact(__pyx_v_servers)) {
            __pyx_t_1 = __pyx_v_servers; __Pyx_INCREF(__pyx_t_1);
            __pyx_t_8 = 0;
            __pyx_t_9 = NULL;
          } else {
            __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_servers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 461, __pyx_L9_error)
          }
          for (;;) {
            if (likely(!__pyx_t_9)) {
              if (likely(PyList_CheckExact(__pyx_t_1))) {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 461, __pyx_L9_error)
                  #endif
                  if (__pyx_t_8 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_8);
                if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L9_error)
                __Pyx_GOTREF(__pyx_t_2);
                __pyx_t_8++;
                #else
                __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L9_error)
                __Pyx_GOTREF(__pyx_t_2);
                #endif
              } else {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 461, __pyx_L9_error)
                  #endif
                  if (__pyx_t_8 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8);
                if (unlikely((0 < 0))) __PYX_ERR(0, 461, __pyx_L9_error)
                __Pyx_INCREF(__pyx_t_2);
                __pyx_t_8++;
                #else
                __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L9_error)
                __Pyx_GOTREF(__pyx_t_2);
                #endif
              }
            } else {
              __pyx_t_2 = __pyx_t_9(__pyx_t_1);
              if (unlikely(!__pyx_t_2)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                  else __PYX_ERR(0, 461, __pyx_L9_error)
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_2);
            }
            __Pyx_XDECREF_SET(__pyx_v_server, __pyx_t_2);
            __pyx_t_2 = 0;
    /* … */
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L16_for_end;
          __pyx_L12_break:;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L16_for_end;
          __pyx_L16_for_end:;

    +462:                     if isinstance(server, unicode):

            __pyx_t_7 = PyUnicode_Check(__pyx_v_server);
            if (__pyx_t_7) {
    /* … */
            }

    +463:                         server = server.encode('ascii')

              __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_server, __pyx_mstate_global->__pyx_n_u_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_4 = NULL;
              __pyx_t_5 = 0;
              #if CYTHON_UNPACK_METHODS
              if (likely(PyMethod_Check(__pyx_t_3))) {
                __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
                assert(__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;
              }
              #endif
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ascii};
                __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L9_error)
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              }
              __Pyx_DECREF_SET(__pyx_v_server, __pyx_t_2);
              __pyx_t_2 = 0;

    +464:                     string = <char*?>server

            __pyx_t_10 = __Pyx_PyObject_AsWritableString(__pyx_v_server); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 464, __pyx_L9_error)
            __pyx_v_string = ((char *)__pyx_t_10);

    +465:                     if cares.ares_inet_pton(AF_INET, string, &c_servers[index].addr) > 0:

            __pyx_t_7 = (ares_inet_pton(AF_INET, __pyx_v_string, (&(__pyx_v_c_servers[__pyx_v_index]).addr)) > 0);
            if (__pyx_t_7) {
    /* … */
              goto __pyx_L14;
            }

    +466:                         c_servers[index].family = AF_INET

              (__pyx_v_c_servers[__pyx_v_index]).family = AF_INET;

    +467:                     elif cares.ares_inet_pton(AF_INET6, string, &c_servers[index].addr) > 0:

            __pyx_t_7 = (ares_inet_pton(AF_INET6, __pyx_v_string, (&(__pyx_v_c_servers[__pyx_v_index]).addr)) > 0);
            if (likely(__pyx_t_7)) {
    /* … */
              goto __pyx_L14;
            }

    +468:                         c_servers[index].family = AF_INET6

              (__pyx_v_c_servers[__pyx_v_index]).family = AF_INET6;

     469:                     else:

    +470:                         raise InvalidIP(repr(string))

            /*else*/ {
              __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_InvalidIP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_string); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 470, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_11 = PyObject_Repr(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 470, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_11);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __pyx_t_4 = NULL;
              __pyx_t_5 = 0;
              #if CYTHON_UNPACK_METHODS
              if (unlikely(PyMethod_Check(__pyx_t_3))) {
                __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
                assert(__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;
              }
              #endif
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11};
                __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L9_error)
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              }
              __Pyx_Raise(__pyx_t_2, 0, 0, 0);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __PYX_ERR(0, 470, __pyx_L9_error)
            }
            __pyx_L14:;

    +471:                     c_servers[index].next = &c_servers[index] + 1

            (__pyx_v_c_servers[__pyx_v_index]).next = ((&(__pyx_v_c_servers[__pyx_v_index])) + 1);

    +472:                     index += 1

            __pyx_v_index = (__pyx_v_index + 1);

    +473:                     if index >= length:

            __pyx_t_7 = (__pyx_v_index >= __pyx_v_length);
            if (__pyx_t_7) {
    /* … */
            }

    +474:                         break

              goto __pyx_L12_break;

    +475:                 c_servers[length - 1].next = NULL

          (__pyx_v_c_servers[(__pyx_v_length - 1)]).next = NULL;

    +476:                 index = cares.ares_set_servers(self.channel, c_servers)

          __pyx_v_index = ares_set_servers(__pyx_v_self->channel, __pyx_v_c_servers);

    +477:                 if index:

          __pyx_t_7 = (__pyx_v_index != 0);
          if (unlikely(__pyx_t_7)) {
    /* … */
          }
        }

    +478:                     raise ValueError(_gevent_gai_strerror(index))

            __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_2 = __pyx_f_6gevent_8resolver_5cares__gevent_gai_strerror(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_Raise(__pyx_t_1, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __PYX_ERR(0, 478, __pyx_L9_error)

     479:             finally:

    +480:                 PyMem_Free(c_servers)

        /*finally:*/ {
          /*normal exit:*/{
            PyMem_Free(__pyx_v_c_servers);
            goto __pyx_L10;
          }
          __pyx_L9_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_15);
            __Pyx_XGOTREF(__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __pyx_t_12 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
            {
              PyMem_Free(__pyx_v_c_servers);
            }
            if (PY_MAJOR_VERSION >= 3) {
              __Pyx_XGIVEREF(__pyx_t_18);
              __Pyx_XGIVEREF(__pyx_t_19);
              __Pyx_XGIVEREF(__pyx_t_20);
              __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
            }
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
            __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
            __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
            goto __pyx_L1_error;
          }
          __pyx_L10:;
        }
      }
      __pyx_L6:;

     481:

     482:     # this crashes c-ares

     483:     #def cancel(self):

     484:     #    cares.ares_cancel(self.channel)

     485:

    +486:     cdef _sock_state_callback(self, int socket, int read, int write):

    static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel__sock_state_callback(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_v_socket, int __pyx_v_read, int __pyx_v_write) {
      PyObject *__pyx_v_watcher = 0;
      int __pyx_v_events;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_AddTraceback("gevent.resolver.cares.channel._sock_state_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_watcher);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +487:         if not self.channel:

      __pyx_t_1 = (!(__pyx_v_self->channel != 0));
      if (__pyx_t_1) {
    /* … */
      }

    +488:             return

        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L0;

    +489:         cdef object watcher = self._watchers.get(socket)

      if (unlikely(__pyx_v_self->_watchers == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
        __PYX_ERR(0, 489, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 489, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_watchers, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 489, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_watcher = __pyx_t_3;
      __pyx_t_3 = 0;

    +490:         cdef int events = 0

      __pyx_v_events = 0;

    +491:         if read:

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

    +492:             events |= EV_READ

        __pyx_v_events = (__pyx_v_events | EV_READ);

    +493:         if write:

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

    +494:             events |= EV_WRITE

        __pyx_v_events = (__pyx_v_events | EV_WRITE);

    +495:         if watcher is None:

      __pyx_t_1 = (__pyx_v_watcher == Py_None);
      if (__pyx_t_1) {
    /* … */
        goto __pyx_L6;
      }

    +496:             if not events:

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

    +497:                 return

          __Pyx_XDECREF(__pyx_r);
          __pyx_r = Py_None; __Pyx_INCREF(Py_None);
          goto __pyx_L0;

    +498:             watcher = self.loop.io(socket, events)

        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->loop, __pyx_mstate_global->__pyx_n_u_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 498, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_events); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 498, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = NULL;
        __pyx_t_7 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
          assert(__pyx_t_6);
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_7 = 1;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 498, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_DECREF_SET(__pyx_v_watcher, __pyx_t_3);
        __pyx_t_3 = 0;

    +499:             self._watchers[socket] = watcher

        if (unlikely(__pyx_v_self->_watchers == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 499, __pyx_L1_error)
        }
        __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely((PyDict_SetItem(__pyx_v_self->_watchers, __pyx_t_3, __pyx_v_watcher) < 0))) __PYX_ERR(0, 499, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +500:         elif events:

      __pyx_t_1 = (__pyx_v_events != 0);
      if (__pyx_t_1) {
    /* … */
        goto __pyx_L6;
      }

    +501:             if watcher.events == events:

        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_mstate_global->__pyx_n_u_events); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 501, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 501, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_1) {
    /* … */
        }

    +502:                 return

          __Pyx_XDECREF(__pyx_r);
          __pyx_r = Py_None; __Pyx_INCREF(Py_None);
          goto __pyx_L0;

    +503:             watcher.stop()

        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 503, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +504:             watcher.events = events

        __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_watcher, __pyx_mstate_global->__pyx_n_u_events, __pyx_t_2) < 0) __PYX_ERR(0, 504, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     505:         else:

    +506:             watcher.stop()

      /*else*/ {
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 506, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 506, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    +507:             watcher.close()

        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_mstate_global->__pyx_n_u_close); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +508:             self._watchers.pop(socket, None)

        if (unlikely(__pyx_v_self->_watchers == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
          __PYX_ERR(0, 508, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = __Pyx_PyDict_Pop_ignore(__pyx_v_self->_watchers, __pyx_t_2, Py_None); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 508, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +509:             if not self._watchers:

        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_watchers); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 509, __pyx_L1_error)
        __pyx_t_9 = (!__pyx_t_1);
        if (__pyx_t_9) {
    /* … */
        }

    +510:                 self._timer.stop()

          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 510, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    +511:             return

        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L0;
      }
      __pyx_L6:;

    +512:         watcher.start(self._process_fd, watcher, pass_events=True)

      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_process_fd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        assert(__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);
        __pyx_t_7 = 1;
      }
      #endif
      __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      {
        PyObject *__pyx_callargs[3+ ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_3, __pyx_v_watcher};
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_pass_events, Py_True, __pyx_t_6, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 512, __pyx_L1_error)
        __pyx_t_5 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7, __pyx_t_6);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 512, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    +513:         self._timer.again(self._on_timer)

      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_mstate_global->__pyx_n_u_again); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_on_timer); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        assert(__pyx_t_3);
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_7 = 1;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 513, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

     514:

    +515:     def _on_timer(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_11_on_timer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_11_on_timer = {"_on_timer", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_7channel_11_on_timer, METH_NOARGS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_11_on_timer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_on_timer (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_10_on_timer(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));

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

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_10_on_timer(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_11_on_timer, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_channel__on_timer, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel, __pyx_mstate_global->__pyx_n_u_on_timer, __pyx_t_3) < 0) __PYX_ERR(0, 515, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +516:         cares.ares_process_fd(self.channel, cares.ARES_SOCKET_BAD, cares.ARES_SOCKET_BAD)

      ares_process_fd(__pyx_v_self->channel, ARES_SOCKET_BAD, ARES_SOCKET_BAD);

     517:

    +518:     def _process_fd(self, int events, object watcher):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_13_process_fd(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_13_process_fd = {"_process_fd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_13_process_fd, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_13_process_fd(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      int __pyx_v_events;
      PyObject *__pyx_v_watcher = 0;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_process_fd (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_events,&__pyx_mstate_global->__pyx_n_u_watcher,0};
      PyObject* values[2] = {0,0};
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  2:
            values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1:
            values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_events)) != 0)) {
              (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
              kw_args--;
            }
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L3_error)
            else goto __pyx_L5_argtuple_error;
            CYTHON_FALLTHROUGH;
            case  1:
            if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_watcher)) != 0)) {
              (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
              kw_args--;
            }
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L3_error)
            else {
              __Pyx_RaiseArgtupleInvalid("_process_fd", 1, 2, 2, 1); __PYX_ERR(0, 518, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_process_fd") < 0)) __PYX_ERR(0, 518, __pyx_L3_error)
          }
        } else if (unlikely(__pyx_nargs != 2)) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
          values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        }
        __pyx_v_events = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L3_error)
        __pyx_v_watcher = values[1];
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("_process_fd", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 518, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_AddTraceback("gevent.resolver.cares.channel._process_fd", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_12_process_fd(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_events, __pyx_v_watcher);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_12_process_fd(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_v_events, PyObject *__pyx_v_watcher) {
      int __pyx_v_read_fd;
      int __pyx_v_write_fd;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent.resolver.cares.channel._process_fd", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_13_process_fd, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_channel__process_fd, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 518, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel, __pyx_mstate_global->__pyx_n_u_process_fd, __pyx_t_3) < 0) __PYX_ERR(0, 518, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +519:         if not self.channel:

      __pyx_t_1 = (!(__pyx_v_self->channel != 0));
      if (__pyx_t_1) {
    /* … */
      }

    +520:             return

        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L0;

    +521:         cdef int read_fd = watcher.fd

      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_mstate_global->__pyx_n_u_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 521, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 521, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_read_fd = __pyx_t_3;

    +522:         cdef int write_fd = read_fd

      __pyx_v_write_fd = __pyx_v_read_fd;

    +523:         if not (events & EV_READ):

      __pyx_t_1 = (!((__pyx_v_events & EV_READ) != 0));
      if (__pyx_t_1) {
    /* … */
      }

    +524:             read_fd = cares.ARES_SOCKET_BAD

        __pyx_v_read_fd = ARES_SOCKET_BAD;

    +525:         if not (events & EV_WRITE):

      __pyx_t_1 = (!((__pyx_v_events & EV_WRITE) != 0));
      if (__pyx_t_1) {
    /* … */
      }

    +526:             write_fd = cares.ARES_SOCKET_BAD

        __pyx_v_write_fd = ARES_SOCKET_BAD;

    +527:         cares.ares_process_fd(self.channel, read_fd, write_fd)

      ares_process_fd(__pyx_v_self->channel, __pyx_v_read_fd, __pyx_v_write_fd);

     528:

    +529:     @staticmethod

    static void __pyx_f_6gevent_8resolver_5cares_7channel__gethostbyname_or_byaddr_cb(void *__pyx_v_arg, int __pyx_v_status, CYTHON_UNUSED int __pyx_v_timeouts, struct hostent *__pyx_v_host) {
      struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_channel = 0;
      PyObject *__pyx_v_callback = 0;
      PyObject *__pyx_v_host_result = 0;
    /* … */
      /* function exit code */
      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_9);
      __Pyx_XDECREF(__pyx_t_14);
      __Pyx_XDECREF(__pyx_t_15);
      __Pyx_XDECREF(__pyx_t_16);
      __Pyx_AddTraceback("gevent.resolver.cares.channel._gethostbyname_or_byaddr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_L0:;
      __Pyx_XDECREF((PyObject *)__pyx_v_channel);
      __Pyx_XDECREF(__pyx_v_callback);
      __Pyx_XDECREF(__pyx_v_host_result);
      __Pyx_RefNannyFinishContext();
    }

     530:     cdef void _gethostbyname_or_byaddr_cb(void *arg, int status, int timeouts, hostent* host):

     531:         cdef channel channel

     532:         cdef object callback

    +533:         channel, callback = <tuple>arg

      __pyx_t_1 = ((PyObject *)__pyx_v_arg);
      __Pyx_INCREF(__pyx_t_1);
      if (likely(__pyx_t_1 != Py_None)) {
        PyObject* sequence = __pyx_t_1;
        Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 533, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_3);
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 533, __pyx_L1_error)
      }
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel))))) __PYX_ERR(0, 533, __pyx_L1_error)
      __pyx_v_channel = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_v_callback = __pyx_t_3;
      __pyx_t_3 = 0;

    +534:         Py_DECREF(<tuple>arg)

      Py_DECREF(((PyObject *)__pyx_v_arg));

     535:         cdef object host_result

    +536:         try:

      {
        /*try:*/ {
    /* … */
        }
        __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_L8_try_end;
        __pyx_L3_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    /* … */
        __pyx_L5_except_error:;
        __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_L4_exception_handled:;
        __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_L8_try_end:;
      }

    +537:             if status or not host:

          __pyx_t_8 = (__pyx_v_status != 0);
          if (!__pyx_t_8) {
          } else {
            __pyx_t_7 = __pyx_t_8;
            goto __pyx_L10_bool_binop_done;
          }
          __pyx_t_8 = (!(__pyx_v_host != 0));
          __pyx_t_7 = __pyx_t_8;
          __pyx_L10_bool_binop_done:;
          if (__pyx_t_7) {
    /* … */
            goto __pyx_L9;
          }

    +538:                 callback(Result(None, _gevent_herror_from_status(status)))

            __pyx_t_3 = __pyx_f_6gevent_8resolver_5cares__gevent_herror_from_status(__pyx_v_status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_INCREF(Py_None);
            __Pyx_GIVEREF(Py_None);
            if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None) != (0)) __PYX_ERR(0, 538, __pyx_L3_error);
            __Pyx_GIVEREF(__pyx_t_3);
            if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 538, __pyx_L3_error);
            __pyx_t_3 = 0;
            __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_INCREF(__pyx_v_callback);
            __pyx_t_2 = __pyx_v_callback; __pyx_t_9 = NULL;
            __pyx_t_10 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
              assert(__pyx_t_9);
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_9);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_10 = 1;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_3};
              __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     539:             else:

    +540:                 try:

          /*else*/ {
            {
              /*try:*/ {
    /* … */
              }
    /* … */
              __pyx_L14_except_error:;
              __Pyx_XGIVEREF(__pyx_t_11);
              __Pyx_XGIVEREF(__pyx_t_12);
              __Pyx_XGIVEREF(__pyx_t_13);
              __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
              goto __pyx_L3_error;
              __pyx_L13_exception_handled:;
              __Pyx_XGIVEREF(__pyx_t_11);
              __Pyx_XGIVEREF(__pyx_t_12);
              __Pyx_XGIVEREF(__pyx_t_13);
              __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
              __pyx_L17_try_end:;
            }
          }
          __pyx_L9:;

    +541:                     host_result = ares_host_result(host.h_addrtype,

                __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ares_host_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L12_error)
                __Pyx_GOTREF(__pyx_t_2);
                __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_host->h_addrtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L12_error)
                __Pyx_GOTREF(__pyx_t_3);

    +542:                                                    (_as_str(host.h_name),

                __pyx_t_9 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_host->h_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 542, __pyx_L12_error)
                __Pyx_GOTREF(__pyx_t_9);
    /* … */
                __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 542, __pyx_L12_error)
                __Pyx_GOTREF(__pyx_t_16);
                __Pyx_GIVEREF(__pyx_t_9);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_9) != (0)) __PYX_ERR(0, 542, __pyx_L12_error);
                __Pyx_GIVEREF(__pyx_t_14);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_14) != (0)) __PYX_ERR(0, 542, __pyx_L12_error);
                __Pyx_GIVEREF(__pyx_t_15);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_15) != (0)) __PYX_ERR(0, 542, __pyx_L12_error);
                __pyx_t_9 = 0;
                __pyx_t_14 = 0;
                __pyx_t_15 = 0;
                __pyx_t_15 = NULL;
                __pyx_t_10 = 0;
                #if CYTHON_UNPACK_METHODS
                if (unlikely(PyMethod_Check(__pyx_t_2))) {
                  __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2);
                  assert(__pyx_t_15);
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                  __Pyx_INCREF(__pyx_t_15);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_2, function);
                  __pyx_t_10 = 1;
                }
                #endif
                {
                  PyObject *__pyx_callargs[3] = {__pyx_t_15, __pyx_t_3, __pyx_t_16};
                  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10);
                  __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
                  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L12_error)
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                }
                __pyx_v_host_result = __pyx_t_1;
                __pyx_t_1 = 0;

    +543:                                                     _parse_h_aliases(host),

                __pyx_t_14 = __pyx_f_6gevent_8resolver_5cares__parse_h_aliases(__pyx_v_host); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 543, __pyx_L12_error)
                __Pyx_GOTREF(__pyx_t_14);

    +544:                                                     _parse_h_addr_list(host)))

                __pyx_t_15 = __pyx_f_6gevent_8resolver_5cares__parse_h_addr_list(__pyx_v_host); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 544, __pyx_L12_error)
                __Pyx_GOTREF(__pyx_t_15);

    +545:                 except:

              /*except:*/ {
                __Pyx_AddTraceback("gevent.resolver.cares.channel._gethostbyname_or_byaddr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
                if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_16, &__pyx_t_2) < 0) __PYX_ERR(0, 545, __pyx_L14_except_error)
                __Pyx_XGOTREF(__pyx_t_1);
                __Pyx_XGOTREF(__pyx_t_16);
                __Pyx_XGOTREF(__pyx_t_2);

    +546:                     callback(Result(None, sys.exc_info()[1]))

                __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 546, __pyx_L14_except_error)
                __Pyx_GOTREF(__pyx_t_15);
                __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_exc_info); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 546, __pyx_L14_except_error)
                __Pyx_GOTREF(__pyx_t_14);
                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                __pyx_t_15 = __Pyx_PyObject_CallNoArg(__pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 546, __pyx_L14_except_error)
                __Pyx_GOTREF(__pyx_t_15);
                __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_15, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 546, __pyx_L14_except_error)
                __Pyx_GOTREF(__pyx_t_14);
                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 546, __pyx_L14_except_error)
                __Pyx_GOTREF(__pyx_t_15);
                __Pyx_INCREF(Py_None);
                __Pyx_GIVEREF(Py_None);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, Py_None) != (0)) __PYX_ERR(0, 546, __pyx_L14_except_error);
                __Pyx_GIVEREF(__pyx_t_14);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_14) != (0)) __PYX_ERR(0, 546, __pyx_L14_except_error);
                __pyx_t_14 = 0;
                __pyx_t_14 = __Pyx_PyObject_Call(((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result), __pyx_t_15, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 546, __pyx_L14_except_error)
                __Pyx_GOTREF(__pyx_t_14);
                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                __Pyx_INCREF(__pyx_v_callback);
                __pyx_t_15 = __pyx_v_callback; __pyx_t_9 = NULL;
                __pyx_t_10 = 0;
                #if CYTHON_UNPACK_METHODS
                if (unlikely(PyMethod_Check(__pyx_t_15))) {
                  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_15);
                  assert(__pyx_t_9);
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
                  __Pyx_INCREF(__pyx_t_9);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_15, function);
                  __pyx_t_10 = 1;
                }
                #endif
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_14};
                  __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
                  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
                  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L14_except_error)
                  __Pyx_GOTREF(__pyx_t_3);
                  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                }
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                goto __pyx_L13_exception_handled;
              }

     547:                 else:

    +548:                     callback(Result(host_result))

              /*else:*/ {
                __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result), __pyx_v_host_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 548, __pyx_L14_except_error)
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_INCREF(__pyx_v_callback);
                __pyx_t_16 = __pyx_v_callback; __pyx_t_3 = NULL;
                __pyx_t_10 = 0;
                #if CYTHON_UNPACK_METHODS
                if (unlikely(PyMethod_Check(__pyx_t_16))) {
                  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_16);
                  assert(__pyx_t_3);
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
                  __Pyx_INCREF(__pyx_t_3);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_16, function);
                  __pyx_t_10 = 1;
                }
                #endif
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2};
                  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
                  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L14_except_error)
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              }
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              goto __pyx_L17_try_end;
              __pyx_L12_error:;
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    +549:         except:

        /*except:*/ {
          __Pyx_AddTraceback("gevent.resolver.cares.channel._gethostbyname_or_byaddr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_16, &__pyx_t_1) < 0) __PYX_ERR(0, 549, __pyx_L5_except_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_1);

    +550:             channel.loop.handle_error(callback, *sys.exc_info())

          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_channel->loop, __pyx_mstate_global->__pyx_n_u_handle_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 550, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 550, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_INCREF(__pyx_v_callback);
          __Pyx_GIVEREF(__pyx_v_callback);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_callback) != (0)) __PYX_ERR(0, 550, __pyx_L5_except_error);
          __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 550, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_exc_info); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 550, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 550, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 550, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = PyNumber_Add(__pyx_t_15, __pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 550, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_14, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 550, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L4_exception_handled;
        }

     551:

     552:

    +553:     def gethostbyname(self, object callback, char* name, int family=AF_INET):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_15gethostbyname(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_15gethostbyname = {"gethostbyname", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_15gethostbyname, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_15gethostbyname(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_callback = 0;
      char *__pyx_v_name;
      int __pyx_v_family;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("gethostbyname (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_callback,&__pyx_mstate_global->__pyx_n_u_name_2,&__pyx_mstate_global->__pyx_n_u_family,0};
      PyObject* values[3] = {0,0,0};
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  3:
            __Pyx_Arg_XDECREF_FASTCALL(values[2]);
            values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
            CYTHON_FALLTHROUGH;
            case  2:
            values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1:
            values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_callback)) != 0)) {
              (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
              kw_args--;
            }
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 553, __pyx_L3_error)
            else goto __pyx_L5_argtuple_error;
            CYTHON_FALLTHROUGH;
            case  1:
            if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_name_2)) != 0)) {
              (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
              kw_args--;
            }
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 553, __pyx_L3_error)
            else {
              __Pyx_RaiseArgtupleInvalid("gethostbyname", 0, 2, 3, 1); __PYX_ERR(0, 553, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  2:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_family);
              if (value) {
                __Pyx_Arg_XDECREF_FASTCALL(values[2]);
                values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--;
              }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 553, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "gethostbyname") < 0)) __PYX_ERR(0, 553, __pyx_L3_error)
          }
        } else {
          switch (__pyx_nargs) {
            case  3:
            __Pyx_Arg_XDECREF_FASTCALL(values[2]);
            values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
            CYTHON_FALLTHROUGH;
            case  2:
            values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
            values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_callback = values[0];
        __pyx_v_name = __Pyx_PyObject_AsWritableString(values[1]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(0, 553, __pyx_L3_error)
        if (values[2]) {
          __pyx_v_family = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_family == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 553, __pyx_L3_error)
        } else {
          __pyx_v_family = __pyx_mstate_global->__pyx_k__5;
        }
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("gethostbyname", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 553, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyname", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_14gethostbyname(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_name, __pyx_v_family);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_14gethostbyname(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, char *__pyx_v_name, int __pyx_v_family) {
      PyObject *__pyx_v_arg = 0;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyname", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_mstate_global->__pyx_k__5 = AF_INET;
      __pyx_t_3 = __Pyx_PyLong_From_int(AF_INET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 553, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_29 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 553, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_15gethostbyname, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_channel_gethostbyname, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 553, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_29);
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel, __pyx_mstate_global->__pyx_n_u_gethostbyname, __pyx_t_3) < 0) __PYX_ERR(0, 553, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +554:         if not self.channel:

      __pyx_t_1 = (!(__pyx_v_self->channel != 0));
      if (unlikely(__pyx_t_1)) {
    /* … */
      }

    +555:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')

        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_gaierror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyLong_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
          assert(__pyx_t_5);
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_6 = 1;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_kp_u_this_ares_channel_has_been_destr};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 555, __pyx_L1_error)

     556:         # note that for file lookups still AF_INET can be returned for AF_INET6 request

    +557:         cdef object arg = (self, callback)

      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __Pyx_GIVEREF((PyObject *)__pyx_v_self);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)) != (0)) __PYX_ERR(0, 557, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_callback);
      __Pyx_GIVEREF(__pyx_v_callback);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_callback) != (0)) __PYX_ERR(0, 557, __pyx_L1_error);
      __pyx_v_arg = __pyx_t_2;
      __pyx_t_2 = 0;

    +558:         Py_INCREF(arg)

      Py_INCREF(__pyx_v_arg);

    +559:         cares.ares_gethostbyname(self.channel, name, family,

      ares_gethostbyname(__pyx_v_self->channel, __pyx_v_name, __pyx_v_family, ((void *)__pyx_f_6gevent_8resolver_5cares_7channel__gethostbyname_or_byaddr_cb), ((void *)__pyx_v_arg));

     560:                                  <void*>channel._gethostbyname_or_byaddr_cb, <void*>arg)

     561:

    +562:     def gethostbyaddr(self, object callback, char* addr):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_17gethostbyaddr(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_17gethostbyaddr = {"gethostbyaddr", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_17gethostbyaddr, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_17gethostbyaddr(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_callback = 0;
      char *__pyx_v_addr;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("gethostbyaddr (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_callback,&__pyx_mstate_global->__pyx_n_u_addr,0};
      PyObject* values[2] = {0,0};
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  2:
            values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1:
            values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_callback)) != 0)) {
              (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
              kw_args--;
            }
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 562, __pyx_L3_error)
            else goto __pyx_L5_argtuple_error;
            CYTHON_FALLTHROUGH;
            case  1:
            if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_addr)) != 0)) {
              (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
              kw_args--;
            }
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 562, __pyx_L3_error)
            else {
              __Pyx_RaiseArgtupleInvalid("gethostbyaddr", 1, 2, 2, 1); __PYX_ERR(0, 562, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "gethostbyaddr") < 0)) __PYX_ERR(0, 562, __pyx_L3_error)
          }
        } else if (unlikely(__pyx_nargs != 2)) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
          values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        }
        __pyx_v_callback = values[0];
        __pyx_v_addr = __Pyx_PyObject_AsWritableString(values[1]); if (unlikely((!__pyx_v_addr) && PyErr_Occurred())) __PYX_ERR(0, 562, __pyx_L3_error)
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("gethostbyaddr", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 562, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyaddr", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_16gethostbyaddr(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_addr);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_16gethostbyaddr(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, char *__pyx_v_addr) {
      char __pyx_v_addr_packed[16];
      int __pyx_v_family;
      int __pyx_v_length;
      PyObject *__pyx_v_arg = 0;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyaddr", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_17gethostbyaddr, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_channel_gethostbyaddr, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel, __pyx_mstate_global->__pyx_n_u_gethostbyaddr, __pyx_t_3) < 0) __PYX_ERR(0, 562, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +563:         if not self.channel:

      __pyx_t_1 = (!(__pyx_v_self->channel != 0));
      if (unlikely(__pyx_t_1)) {
    /* … */
      }

    +564:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')

        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_gaierror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyLong_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 564, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
          assert(__pyx_t_5);
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_6 = 1;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_kp_u_this_ares_channel_has_been_destr};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 564, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 564, __pyx_L1_error)

     565:         # will guess the family

     566:         cdef char addr_packed[16]

     567:         cdef int family

     568:         cdef int length

    +569:         if cares.ares_inet_pton(AF_INET, addr, addr_packed) > 0:

      __pyx_t_1 = (ares_inet_pton(AF_INET, __pyx_v_addr, __pyx_v_addr_packed) > 0);
      if (__pyx_t_1) {
    /* … */
        goto __pyx_L4;
      }

    +570:             family = AF_INET

        __pyx_v_family = AF_INET;

    +571:             length = 4

        __pyx_v_length = 4;

    +572:         elif cares.ares_inet_pton(AF_INET6, addr, addr_packed) > 0:

      __pyx_t_1 = (ares_inet_pton(AF_INET6, __pyx_v_addr, __pyx_v_addr_packed) > 0);
      if (likely(__pyx_t_1)) {
    /* … */
        goto __pyx_L4;
      }

    +573:             family = AF_INET6

        __pyx_v_family = AF_INET6;

    +574:             length = 16

        __pyx_v_length = 16;

     575:         else:

    +576:             raise InvalidIP(repr(addr))

      /*else*/ {
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_InvalidIP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 576, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_addr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 576, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyObject_Repr(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 576, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        __pyx_t_6 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          assert(__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_6 = 1;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 576, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 576, __pyx_L1_error)
      }
      __pyx_L4:;

    +577:         cdef object arg = (self, callback)

      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __Pyx_GIVEREF((PyObject *)__pyx_v_self);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)) != (0)) __PYX_ERR(0, 577, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_callback);
      __Pyx_GIVEREF(__pyx_v_callback);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_callback) != (0)) __PYX_ERR(0, 577, __pyx_L1_error);
      __pyx_v_arg = __pyx_t_2;
      __pyx_t_2 = 0;

    +578:         Py_INCREF(arg)

      Py_INCREF(__pyx_v_arg);

    +579:         cares.ares_gethostbyaddr(self.channel, addr_packed, length, family,

      ares_gethostbyaddr(__pyx_v_self->channel, __pyx_v_addr_packed, __pyx_v_length, __pyx_v_family, ((void *)__pyx_f_6gevent_8resolver_5cares_7channel__gethostbyname_or_byaddr_cb), ((void *)__pyx_v_arg));

     580:                                  <void*>channel._gethostbyname_or_byaddr_cb, <void*>arg)

     581:

    +582:     cpdef _getnameinfo(self, object callback, tuple sockaddr, int flags):

    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel__getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags, int __pyx_skip_dispatch) {
      char *__pyx_v_hostp;
      int __pyx_v_port;
      int __pyx_v_flowinfo;
      int __pyx_v_scope_id;
      struct sockaddr_in6 __pyx_v_sa6;
      int __pyx_v_length;
      PyObject *__pyx_v_arg = 0;
      struct sockaddr *__pyx_v_x;
      PyObject *__pyx_r = NULL;
      /* Check if called by wrapper */
      if (unlikely(__pyx_skip_dispatch)) ;
      /* Check if overridden in Python */
      else if (
      #if !CYTHON_USE_TYPE_SLOTS
      unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel &&
      __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
      #else
      unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
      #endif
      ) {
        #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
        if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
          PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          #endif
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_getnameinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo)) {
            __Pyx_XDECREF(__pyx_r);
            __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_1);
            __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
            __pyx_t_6 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
              assert(__pyx_t_5);
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
              __Pyx_INCREF(__pyx_t_5);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_4, function);
              __pyx_t_6 = 1;
            }
            #endif
            {
              PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_callback, __pyx_v_sockaddr, __pyx_t_3};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            }
            __pyx_r = __pyx_t_2;
            __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L0;
          }
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
          __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
          if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
            __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
          }
          #endif
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        }
        #endif
      }
    /* … */
      /* 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_AddTraceback("gevent.resolver.cares.channel._getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_19_getnameinfo = {"_getnameinfo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_callback = 0;
      PyObject *__pyx_v_sockaddr = 0;
      int __pyx_v_flags;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_getnameinfo (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_callback,&__pyx_mstate_global->__pyx_n_u_sockaddr,&__pyx_mstate_global->__pyx_n_u_flags,0};
      PyObject* values[3] = {0,0,0};
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  3:
            values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
            CYTHON_FALLTHROUGH;
            case  2:
            values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1:
            values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_callback)) != 0)) {
              (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
              kw_args--;
            }
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L3_error)
            else goto __pyx_L5_argtuple_error;
            CYTHON_FALLTHROUGH;
            case  1:
            if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_sockaddr)) != 0)) {
              (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
              kw_args--;
            }
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L3_error)
            else {
              __Pyx_RaiseArgtupleInvalid("_getnameinfo", 1, 3, 3, 1); __PYX_ERR(0, 582, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  2:
            if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_flags)) != 0)) {
              (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
              kw_args--;
            }
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L3_error)
            else {
              __Pyx_RaiseArgtupleInvalid("_getnameinfo", 1, 3, 3, 2); __PYX_ERR(0, 582, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_getnameinfo") < 0)) __PYX_ERR(0, 582, __pyx_L3_error)
          }
        } else if (unlikely(__pyx_nargs != 3)) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
          values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
          values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        }
        __pyx_v_callback = values[0];
        __pyx_v_sockaddr = ((PyObject*)values[1]);
        __pyx_v_flags = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L3_error)
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("_getnameinfo", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 582, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_AddTraceback("gevent.resolver.cares.channel._getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sockaddr), (&PyTuple_Type), 1, "sockaddr", 1))) __PYX_ERR(0, 582, __pyx_L1_error)
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_18_getnameinfo(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      goto __pyx_L0;
      __pyx_L1_error:;
      __pyx_r = NULL;
      __pyx_L0:;
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_18_getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares_7channel__getnameinfo(__pyx_v_self, __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __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("gevent.resolver.cares.channel._getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_19_getnameinfo, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_channel__getnameinfo, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel, __pyx_mstate_global->__pyx_n_u_getnameinfo, __pyx_t_3) < 0) __PYX_ERR(0, 582, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +583:         if not self.channel:

      __pyx_t_7 = (!(__pyx_v_self->channel != 0));
      if (unlikely(__pyx_t_7)) {
    /* … */
      }

    +584:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')

        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = __Pyx_PyLong_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = NULL;
        __pyx_t_6 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
          assert(__pyx_t_3);
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_6 = 1;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_4, __pyx_mstate_global->__pyx_kp_u_this_ares_channel_has_been_destr};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 584, __pyx_L1_error)

    +585:         cdef char* hostp = NULL

      __pyx_v_hostp = NULL;

    +586:         cdef int port = 0

      __pyx_v_port = 0;

    +587:         cdef int flowinfo = 0

      __pyx_v_flowinfo = 0;

    +588:         cdef int scope_id = 0

      __pyx_v_scope_id = 0;

     589:         cdef sockaddr_in6 sa6

    +590:         if not PyTuple_Check(sockaddr):

      __pyx_t_7 = (!PyTuple_Check(__pyx_v_sockaddr));
      if (unlikely(__pyx_t_7)) {
    /* … */
      }

    +591:             raise TypeError('expected a tuple, got %r' % (sockaddr, ))

        __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_sockaddr), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_expected_a_tuple_got, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 591, __pyx_L1_error)

    +592:         PyArg_ParseTuple(sockaddr, "si|ii", &hostp, &port, &flowinfo, &scope_id)

      __pyx_t_8 = PyArg_ParseTuple(__pyx_v_sockaddr, ((char *)"si|ii"), (&__pyx_v_hostp), (&__pyx_v_port), (&__pyx_v_flowinfo), (&__pyx_v_scope_id)); if (unlikely(__pyx_t_8 == ((int)0))) __PYX_ERR(0, 592, __pyx_L1_error)

     593:         # if port < 0 or port > 65535:

     594:         #     raise gaierror(-8, 'Invalid value for port: %r' % port)

    +595:         cdef int length = _make_sockaddr(hostp, port, flowinfo, scope_id, &sa6)

      __pyx_t_8 = __pyx_f_6gevent_8resolver_5cares__make_sockaddr(__pyx_v_hostp, __pyx_v_port, __pyx_v_flowinfo, __pyx_v_scope_id, (&__pyx_v_sa6)); if (unlikely(__pyx_t_8 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L1_error)
      __pyx_v_length = __pyx_t_8;

    +596:         if length <= 0:

      __pyx_t_7 = (__pyx_v_length <= 0);
      if (unlikely(__pyx_t_7)) {
    /* … */
      }

    +597:             raise InvalidIP(repr(hostp))

        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_InvalidIP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_hostp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 597, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = PyObject_Repr(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        __pyx_t_6 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
          assert(__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);
          __pyx_t_6 = 1;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 597, __pyx_L1_error)

    +598:         cdef object arg = (self, callback)

      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __Pyx_GIVEREF((PyObject *)__pyx_v_self);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)) != (0)) __PYX_ERR(0, 598, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_callback);
      __Pyx_GIVEREF(__pyx_v_callback);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_callback) != (0)) __PYX_ERR(0, 598, __pyx_L1_error);
      __pyx_v_arg = __pyx_t_1;
      __pyx_t_1 = 0;

    +599:         Py_INCREF(arg)

      Py_INCREF(__pyx_v_arg);

    +600:         cdef sockaddr_t* x = <sockaddr_t*>&sa6

      __pyx_v_x = ((struct sockaddr *)(&__pyx_v_sa6));

    +601:         cares.ares_getnameinfo(self.channel, x, length, flags, <void*>gevent_ares_nameinfo_callback, <void*>arg)

      ares_getnameinfo(__pyx_v_self->channel, __pyx_v_x, __pyx_v_length, __pyx_v_flags, ((void *)__pyx_f_6gevent_8resolver_5cares_gevent_ares_nameinfo_callback), ((void *)__pyx_v_arg));

     602:

    +603:     @staticmethod

    static int __pyx_f_6gevent_8resolver_5cares_7channel__convert_cares_ni_flags(int __pyx_v_flags) {
      int __pyx_v_cares_flags;
      int __pyx_r;
    /* … */
      /* function exit code */
      __pyx_L0:;
      return __pyx_r;
    }

     604:     cdef int _convert_cares_ni_flags(int flags):

    +605:         cdef int cares_flags = cares.ARES_NI_LOOKUPHOST | cares.ARES_NI_LOOKUPSERVICE

      __pyx_v_cares_flags = (ARES_NI_LOOKUPHOST | ARES_NI_LOOKUPSERVICE);

    +606:         if flags & NI_NUMERICHOST:

      __pyx_t_1 = ((__pyx_v_flags & __pyx_v_6gevent_8resolver_5cares_NI_NUMERICHOST) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +607:             cares_flags |= cares.ARES_NI_NUMERICHOST

        __pyx_v_cares_flags = (__pyx_v_cares_flags | ARES_NI_NUMERICHOST);

    +608:         if flags & NI_NUMERICSERV:

      __pyx_t_1 = ((__pyx_v_flags & __pyx_v_6gevent_8resolver_5cares_NI_NUMERICSERV) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +609:             cares_flags |= cares.ARES_NI_NUMERICSERV

        __pyx_v_cares_flags = (__pyx_v_cares_flags | ARES_NI_NUMERICSERV);

    +610:         if flags & NI_NOFQDN:

      __pyx_t_1 = ((__pyx_v_flags & __pyx_v_6gevent_8resolver_5cares_NI_NOFQDN) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +611:             cares_flags |= cares.ARES_NI_NOFQDN

        __pyx_v_cares_flags = (__pyx_v_cares_flags | ARES_NI_NOFQDN);

    +612:         if flags & NI_NAMEREQD:

      __pyx_t_1 = ((__pyx_v_flags & __pyx_v_6gevent_8resolver_5cares_NI_NAMEREQD) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +613:             cares_flags |= cares.ARES_NI_NAMEREQD

        __pyx_v_cares_flags = (__pyx_v_cares_flags | ARES_NI_NAMEREQD);

    +614:         if flags & NI_DGRAM:

      __pyx_t_1 = ((__pyx_v_flags & __pyx_v_6gevent_8resolver_5cares_NI_DGRAM) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +615:             cares_flags |= cares.ARES_NI_DGRAM

        __pyx_v_cares_flags = (__pyx_v_cares_flags | ARES_NI_DGRAM);

    +616:         return cares_flags

      __pyx_r = __pyx_v_cares_flags;
      goto __pyx_L0;

     617:

    +618:     def getnameinfo(self, object callback, tuple sockaddr, int flags):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_21getnameinfo(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_21getnameinfo = {"getnameinfo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_21getnameinfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_21getnameinfo(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_callback = 0;
      PyObject *__pyx_v_sockaddr = 0;
      int __pyx_v_flags;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("getnameinfo (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_callback,&__pyx_mstate_global->__pyx_n_u_sockaddr,&__pyx_mstate_global->__pyx_n_u_flags,0};
      PyObject* values[3] = {0,0,0};
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  3:
            values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
            CYTHON_FALLTHROUGH;
            case  2:
            values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1:
            values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_callback)) != 0)) {
              (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
              kw_args--;
            }
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 618, __pyx_L3_error)
            else goto __pyx_L5_argtuple_error;
            CYTHON_FALLTHROUGH;
            case  1:
            if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_sockaddr)) != 0)) {
              (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
              kw_args--;
            }
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 618, __pyx_L3_error)
            else {
              __Pyx_RaiseArgtupleInvalid("getnameinfo", 1, 3, 3, 1); __PYX_ERR(0, 618, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  2:
            if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_flags)) != 0)) {
              (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
              kw_args--;
            }
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 618, __pyx_L3_error)
            else {
              __Pyx_RaiseArgtupleInvalid("getnameinfo", 1, 3, 3, 2); __PYX_ERR(0, 618, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getnameinfo") < 0)) __PYX_ERR(0, 618, __pyx_L3_error)
          }
        } else if (unlikely(__pyx_nargs != 3)) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
          values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
          values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        }
        __pyx_v_callback = values[0];
        __pyx_v_sockaddr = ((PyObject*)values[1]);
        __pyx_v_flags = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 618, __pyx_L3_error)
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("getnameinfo", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 618, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_AddTraceback("gevent.resolver.cares.channel.getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sockaddr), (&PyTuple_Type), 1, "sockaddr", 1))) __PYX_ERR(0, 618, __pyx_L1_error)
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_20getnameinfo(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      goto __pyx_L0;
      __pyx_L1_error:;
      __pyx_r = NULL;
      __pyx_L0:;
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_20getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_21getnameinfo, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_channel_getnameinfo, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 618, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel, __pyx_mstate_global->__pyx_n_u_getnameinfo_2, __pyx_t_3) < 0) __PYX_ERR(0, 618, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +619:         flags = channel._convert_cares_ni_flags(flags)

      __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares_7channel__convert_cares_ni_flags(__pyx_v_flags); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L1_error)
      __pyx_v_flags = __pyx_t_1;

    +620:         return self._getnameinfo(callback, sockaddr, flags)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_self->__pyx_vtab)->_getnameinfo(__pyx_v_self, __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

     621:

    +622:     @staticmethod

    static int __pyx_f_6gevent_8resolver_5cares_7channel__convert_cares_ai_flags(int __pyx_v_flags) {
      int __pyx_v_cares_flags;
      int __pyx_r;
    /* … */
      /* function exit code */
      __pyx_L0:;
      return __pyx_r;
    }

     623:     cdef int _convert_cares_ai_flags(int flags):

     624:         # c-ares supports a limited set of flags.

     625:         # We always want NOSORT, because that implies that

     626:         # c-ares will not connect to resolved addresses.

    +627:         cdef int cares_flags = cares.ARES_AI_NOSORT

      __pyx_v_cares_flags = ARES_AI_NOSORT;

    +628:         if flags & AI_CANONNAME:

      __pyx_t_1 = ((__pyx_v_flags & __pyx_v_6gevent_8resolver_5cares_AI_CANONNAME) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +629:             cares_flags |= cares.ARES_AI_CANONNAME

        __pyx_v_cares_flags = (__pyx_v_cares_flags | ARES_AI_CANONNAME);

    +630:         if flags & AI_NUMERICSERV:

      __pyx_t_1 = ((__pyx_v_flags & __pyx_v_6gevent_8resolver_5cares_AI_NUMERICSERV) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +631:             cares_flags |= cares.ARES_AI_NUMERICSERV

        __pyx_v_cares_flags = (__pyx_v_cares_flags | ARES_AI_NUMERICSERV);

    +632:         return cares_flags

      __pyx_r = __pyx_v_cares_flags;
      goto __pyx_L0;

     633:

    +634:     @staticmethod

    static void __pyx_f_6gevent_8resolver_5cares_7channel__getaddrinfo_cb(void *__pyx_v_arg, int __pyx_v_status, CYTHON_UNUSED int __pyx_v_timeouts, struct ares_addrinfo *__pyx_v_result) {
      struct ares_addrinfo_node *__pyx_v_nodes;
      struct ares_addrinfo_cname *__pyx_v_cnames;
      struct sockaddr_in *__pyx_v_sadr4;
      struct sockaddr_in6 *__pyx_v_sadr6;
      PyObject *__pyx_v_canonname = 0;
      struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_channel = 0;
      PyObject *__pyx_v_callback = 0;
      char __pyx_v_tmpbuf[46];
      PyObject *__pyx_v_addrs = NULL;
      PyObject *__pyx_v_sockaddr = NULL;
    /* … */
      /* function exit code */
      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_8);
      __Pyx_XDECREF(__pyx_t_12);
      __Pyx_XDECREF(__pyx_t_14);
      __Pyx_XDECREF(__pyx_t_15);
      __Pyx_AddTraceback("gevent.resolver.cares.channel._getaddrinfo_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_canonname);
      __Pyx_XDECREF((PyObject *)__pyx_v_channel);
      __Pyx_XDECREF(__pyx_v_callback);
      __Pyx_XDECREF(__pyx_v_addrs);
      __Pyx_XDECREF(__pyx_v_sockaddr);
      __Pyx_RefNannyFinishContext();
    }

     635:     cdef void _getaddrinfo_cb(void *arg,

     636:                               int status,

     637:                               int timeouts,

     638:                               cares.ares_addrinfo* result):

     639:         cdef cares.ares_addrinfo_node* nodes

     640:         cdef cares.ares_addrinfo_cname* cnames

     641:         cdef sockaddr_in* sadr4

     642:         cdef sockaddr_in6* sadr6

    +643:         cdef object canonname = ''

      __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__6);
      __pyx_v_canonname = __pyx_mstate_global->__pyx_kp_u__6;

     644:

     645:         cdef channel channel

     646:         cdef object callback

     647:         # INET6_ADDRSTRLEN is 46, but we can't use that named constant

     648:         # here; cython doesn't like it.

     649:         cdef char tmpbuf[46]

     650:

    +651:         channel, callback = <tuple>arg

      __pyx_t_1 = ((PyObject *)__pyx_v_arg);
      __Pyx_INCREF(__pyx_t_1);
      if (likely(__pyx_t_1 != Py_None)) {
        PyObject* sequence = __pyx_t_1;
        Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 651, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_3);
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 651, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 651, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 651, __pyx_L1_error)
      }
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel))))) __PYX_ERR(0, 651, __pyx_L1_error)
      __pyx_v_channel = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_v_callback = __pyx_t_3;
      __pyx_t_3 = 0;

    +652:         Py_DECREF(<tuple>arg)

      Py_DECREF(((PyObject *)__pyx_v_arg));

     653:

     654:

     655:         # Result is a list of:

     656:         # (family, socktype, proto, canonname, sockaddr)

     657:         # Where sockaddr depends on family; for INET it is

     658:         # (address, port)

     659:         # and INET6 is

     660:         # (address, port, flow info, scope id)

     661:         # TODO: Check the canonnames.

    +662:         addrs = []

      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_addrs = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

    +663:         try:

      /*try:*/ {
        {
          /*try:*/ {
    /* … */
          }
          __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_L6_error:;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    /* … */
          __pyx_L8_except_error:;
          __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_L4_error;
          __pyx_L10_try_return:;
          __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_L3_return;
          __pyx_L7_exception_handled:;
          __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:;
        }
      }

    +664:             if status != cares.ARES_SUCCESS:

            __pyx_t_7 = (__pyx_v_status != ARES_SUCCESS);
            if (__pyx_t_7) {
    /* … */
            }

    +665:                 callback(Result(None, _gevent_gaierror_from_status(status)))

              __pyx_t_3 = __pyx_f_6gevent_8resolver_5cares__gevent_gaierror_from_status(__pyx_v_status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_INCREF(Py_None);
              __Pyx_GIVEREF(Py_None);
              if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None) != (0)) __PYX_ERR(0, 665, __pyx_L6_error);
              __Pyx_GIVEREF(__pyx_t_3);
              if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 665, __pyx_L6_error);
              __pyx_t_3 = 0;
              __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_INCREF(__pyx_v_callback);
              __pyx_t_2 = __pyx_v_callback; __pyx_t_8 = NULL;
              __pyx_t_9 = 0;
              #if CYTHON_UNPACK_METHODS
              if (unlikely(PyMethod_Check(__pyx_t_2))) {
                __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
                assert(__pyx_t_8);
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                __Pyx_INCREF(__pyx_t_8);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_2, function);
                __pyx_t_9 = 1;
              }
              #endif
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_3};
                __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
                __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              }
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +666:                 return

              goto __pyx_L10_try_return;

    +667:             if result.cnames:

            __pyx_t_7 = (__pyx_v_result->cnames != 0);
            if (__pyx_t_7) {
    /* … */
            }

     668:                 # These tend to come in pairs:

     669:                 #

     670:                 # alias: www.gevent.org name: python-gevent.readthedocs.org

     671:                 # alias: python-gevent.readthedocs.org name: readthedocs.io

     672:                 #

     673:                 # The standard library returns the last name so we do too.

     674:

    +675:                 cnames = result.cnames

              __pyx_t_10 = __pyx_v_result->cnames;
              __pyx_v_cnames = __pyx_t_10;

    +676:                 while cnames:

              while (1) {
                __pyx_t_7 = (__pyx_v_cnames != 0);
                if (!__pyx_t_7) break;

    +677:                     canonname = _as_str(cnames.name)

                __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_cnames->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF_SET(__pyx_v_canonname, __pyx_t_1);
                __pyx_t_1 = 0;

    +678:                     cnames = cnames.next

                __pyx_t_10 = __pyx_v_cnames->next;
                __pyx_v_cnames = __pyx_t_10;
              }

     679:

    +680:             nodes = result.nodes

            __pyx_t_11 = __pyx_v_result->nodes;
            __pyx_v_nodes = __pyx_t_11;

    +681:             while nodes:

            while (1) {
              __pyx_t_7 = (__pyx_v_nodes != 0);
              if (!__pyx_t_7) break;

    +682:                 if nodes.ai_family == AF_INET:

              __pyx_t_7 = (__pyx_v_nodes->ai_family == AF_INET);
              if (__pyx_t_7) {
    /* … */
                goto __pyx_L18;
              }

    +683:                     sadr4 = <sockaddr_in*>nodes.ai_addr

                __pyx_v_sadr4 = ((struct sockaddr_in *)__pyx_v_nodes->ai_addr);

    +684:                     cares.ares_inet_ntop(nodes.ai_family, &sadr4.sin_addr, tmpbuf,

                (void)(ares_inet_ntop(__pyx_v_nodes->ai_family, (&__pyx_v_sadr4->sin_addr), __pyx_v_tmpbuf, INET6_ADDRSTRLEN));

     685:                                             INET6_ADDRSTRLEN)

     686:                     sockaddr = (

    +687:                         _as_str(tmpbuf),

                __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_tmpbuf); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_1);
    /* … */
                __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_3);
                __Pyx_GIVEREF(__pyx_t_1);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 687, __pyx_L6_error);
                __Pyx_GIVEREF(__pyx_t_2);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 687, __pyx_L6_error);
                __pyx_t_1 = 0;
                __pyx_t_2 = 0;
                __Pyx_XDECREF_SET(__pyx_v_sockaddr, ((PyObject*)__pyx_t_3));
                __pyx_t_3 = 0;

    +688:                         ntohs(sadr4.sin_port),

                __pyx_t_2 = __Pyx_PyLong_From_unsigned_int(ntohs(__pyx_v_sadr4->sin_port)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_2);

     689:                     )

    +690:                 elif nodes.ai_family == AF_INET6:

              __pyx_t_7 = (__pyx_v_nodes->ai_family == AF_INET6);
              if (__pyx_t_7) {
    /* … */
              }
              __pyx_L18:;

    +691:                     sadr6 = <sockaddr_in6*>nodes.ai_addr

                __pyx_v_sadr6 = ((struct sockaddr_in6 *)__pyx_v_nodes->ai_addr);

    +692:                     cares.ares_inet_ntop(nodes.ai_family, &sadr6.sin6_addr, tmpbuf,

                (void)(ares_inet_ntop(__pyx_v_nodes->ai_family, (&__pyx_v_sadr6->sin6_addr), __pyx_v_tmpbuf, INET6_ADDRSTRLEN));

     693:                                             INET6_ADDRSTRLEN)

     694:

     695:                     sockaddr = (

    +696:                         _as_str(tmpbuf),

                __pyx_t_3 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_tmpbuf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_3);
    /* … */
                __pyx_t_12 = PyTuple_New(4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 696, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_12);
                __Pyx_GIVEREF(__pyx_t_3);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 696, __pyx_L6_error);
                __Pyx_GIVEREF(__pyx_t_2);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 696, __pyx_L6_error);
                __Pyx_GIVEREF(__pyx_t_1);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_1) != (0)) __PYX_ERR(0, 696, __pyx_L6_error);
                __Pyx_GIVEREF(__pyx_t_8);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_8) != (0)) __PYX_ERR(0, 696, __pyx_L6_error);
                __pyx_t_3 = 0;
                __pyx_t_2 = 0;
                __pyx_t_1 = 0;
                __pyx_t_8 = 0;
                __Pyx_XDECREF_SET(__pyx_v_sockaddr, ((PyObject*)__pyx_t_12));
                __pyx_t_12 = 0;

    +697:                         ntohs(sadr6.sin6_port),

                __pyx_t_2 = __Pyx_PyLong_From_unsigned_int(ntohs(__pyx_v_sadr6->sin6_port)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_2);

    +698:                         sadr6.sin6_flowinfo,

                __pyx_t_1 = __Pyx_PyLong_From_unsigned_int(__pyx_v_sadr6->sin6_flowinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_1);

    +699:                         sadr6.sin6_scope_id,

                __pyx_t_8 = __Pyx_PyLong_From_unsigned_int(__pyx_v_sadr6->sin6_scope_id); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 699, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_8);

     700:                     )

    +701:                 addrs.append((

              __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_addrs, __pyx_t_2); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 701, __pyx_L6_error)
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +702:                     nodes.ai_family,

              __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_v_nodes->ai_family); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 702, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_12);
    /* … */
              __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_12);
              if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_12) != (0)) __PYX_ERR(0, 702, __pyx_L6_error);
              __Pyx_GIVEREF(__pyx_t_8);
              if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 702, __pyx_L6_error);
              __Pyx_GIVEREF(__pyx_t_1);
              if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1) != (0)) __PYX_ERR(0, 702, __pyx_L6_error);
              __Pyx_INCREF(__pyx_v_canonname);
              __Pyx_GIVEREF(__pyx_v_canonname);
              if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_canonname) != (0)) __PYX_ERR(0, 702, __pyx_L6_error);
              __Pyx_INCREF(__pyx_v_sockaddr);
              __Pyx_GIVEREF(__pyx_v_sockaddr);
              if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_sockaddr) != (0)) __PYX_ERR(0, 702, __pyx_L6_error);
              __pyx_t_12 = 0;
              __pyx_t_8 = 0;
              __pyx_t_1 = 0;

    +703:                     nodes.ai_socktype,

              __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_nodes->ai_socktype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 703, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_8);

    +704:                     nodes.ai_protocol,

              __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_nodes->ai_protocol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_1);

     705:                     canonname,

    +706:                     sockaddr,

              if (unlikely(!__pyx_v_sockaddr)) { __Pyx_RaiseUnboundLocalError("sockaddr"); __PYX_ERR(0, 706, __pyx_L6_error) }

     707:                 ))

    +708:                 nodes = nodes.ai_next

              __pyx_t_11 = __pyx_v_nodes->ai_next;
              __pyx_v_nodes = __pyx_t_11;
            }

     709:

    +710:             callback(Result(addrs, None))

            __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_INCREF(__pyx_v_addrs);
            __Pyx_GIVEREF(__pyx_v_addrs);
            if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_addrs) != (0)) __PYX_ERR(0, 710, __pyx_L6_error);
            __Pyx_INCREF(Py_None);
            __Pyx_GIVEREF(Py_None);
            if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None) != (0)) __PYX_ERR(0, 710, __pyx_L6_error);
            __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result), __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 710, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_INCREF(__pyx_v_callback);
            __pyx_t_1 = __pyx_v_callback; __pyx_t_12 = NULL;
            __pyx_t_9 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_1))) {
              __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1);
              assert(__pyx_t_12);
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_12);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_9 = 1;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_8};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            }
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +711:         except:

          /*except:*/ {
            __Pyx_AddTraceback("gevent.resolver.cares.channel._getaddrinfo_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_8) < 0) __PYX_ERR(0, 711, __pyx_L8_except_error)
            __Pyx_XGOTREF(__pyx_t_2);
            __Pyx_XGOTREF(__pyx_t_1);
            __Pyx_XGOTREF(__pyx_t_8);

    +712:             channel.loop.handle_error(callback, *sys.exc_info())

            __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_channel->loop, __pyx_mstate_global->__pyx_n_u_handle_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 712, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_INCREF(__pyx_v_callback);
            __Pyx_GIVEREF(__pyx_v_callback);
            if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_callback) != (0)) __PYX_ERR(0, 712, __pyx_L8_except_error);
            __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 712, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_exc_info); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 712, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __pyx_t_14 = __Pyx_PyObject_CallNoArg(__pyx_t_15); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 712, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            __pyx_t_15 = __Pyx_PySequence_Tuple(__pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 712, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __pyx_t_14 = PyNumber_Add(__pyx_t_3, __pyx_t_15); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 712, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_14, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 712, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            goto __pyx_L7_exception_handled;
          }

     713:         finally:

    +714:             if result:

      /*finally:*/ {
        /*normal exit:*/{
          __pyx_t_7 = (__pyx_v_result != 0);
          if (__pyx_t_7) {
    /* … */
          }
          goto __pyx_L5;
        }
        __pyx_L4_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_16 = __pyx_lineno; __pyx_t_17 = __pyx_clineno; __pyx_t_18 = __pyx_filename;
          {
            __pyx_t_7 = (__pyx_v_result != 0);
            if (__pyx_t_7) {
    /* … */
            }
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          }
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_XGIVEREF(__pyx_t_5);
          __Pyx_XGIVEREF(__pyx_t_4);
          __Pyx_ErrRestore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
          __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_16; __pyx_clineno = __pyx_t_17; __pyx_filename = __pyx_t_18;
          goto __pyx_L1_error;
        }
        __pyx_L3_return: {
          __pyx_t_7 = (__pyx_v_result != 0);
          if (__pyx_t_7) {
    /* … */
          }
          goto __pyx_L0;
        }
        __pyx_L5:;
      }

    +715:                 cares.ares_freeaddrinfo(result)

            ares_freeaddrinfo(__pyx_v_result);
    /* … */
              ares_freeaddrinfo(__pyx_v_result);
    /* … */
            ares_freeaddrinfo(__pyx_v_result);

     716:

    +717:     def getaddrinfo(self,

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_23getaddrinfo(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_23getaddrinfo = {"getaddrinfo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_23getaddrinfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_23getaddrinfo(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_callback = 0;
      char const *__pyx_v_name;
      PyObject *__pyx_v_service = 0;
      int __pyx_v_family;
      int __pyx_v_type;
      int __pyx_v_proto;
      int __pyx_v_flags;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("getaddrinfo (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_callback,&__pyx_mstate_global->__pyx_n_u_name_2,&__pyx_mstate_global->__pyx_n_u_service,&__pyx_mstate_global->__pyx_n_u_family,&__pyx_mstate_global->__pyx_n_u_type,&__pyx_mstate_global->__pyx_n_u_proto,&__pyx_mstate_global->__pyx_n_u_flags,0};
      PyObject* values[7] = {0,0,0,0,0,0,0};
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  7:
            __Pyx_Arg_XDECREF_FASTCALL(values[6]);
            values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
            CYTHON_FALLTHROUGH;
            case  6:
            __Pyx_Arg_XDECREF_FASTCALL(values[5]);
            values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
            CYTHON_FALLTHROUGH;
            case  5:
            __Pyx_Arg_XDECREF_FASTCALL(values[4]);
            values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
            CYTHON_FALLTHROUGH;
            case  4:
            __Pyx_Arg_XDECREF_FASTCALL(values[3]);
            values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
            CYTHON_FALLTHROUGH;
            case  3:
            values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
            CYTHON_FALLTHROUGH;
            case  2:
            values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1:
            values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_callback)) != 0)) {
              (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
              kw_args--;
            }
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 717, __pyx_L3_error)
            else goto __pyx_L5_argtuple_error;
            CYTHON_FALLTHROUGH;
            case  1:
            if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_name_2)) != 0)) {
              (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
              kw_args--;
            }
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 717, __pyx_L3_error)
            else {
              __Pyx_RaiseArgtupleInvalid("getaddrinfo", 0, 3, 7, 1); __PYX_ERR(0, 717, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  2:
            if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_service)) != 0)) {
              (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
              kw_args--;
            }
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 717, __pyx_L3_error)
            else {
              __Pyx_RaiseArgtupleInvalid("getaddrinfo", 0, 3, 7, 2); __PYX_ERR(0, 717, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  3:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_family);
              if (value) {
                __Pyx_Arg_XDECREF_FASTCALL(values[3]);
                values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--;
              }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 717, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  4:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_type);
              if (value) {
                __Pyx_Arg_XDECREF_FASTCALL(values[4]);
                values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--;
              }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 717, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  5:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_proto);
              if (value) {
                __Pyx_Arg_XDECREF_FASTCALL(values[5]);
                values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--;
              }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 717, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  6:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_flags);
              if (value) {
                __Pyx_Arg_XDECREF_FASTCALL(values[6]);
                values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--;
              }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 717, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getaddrinfo") < 0)) __PYX_ERR(0, 717, __pyx_L3_error)
          }
        } else {
          switch (__pyx_nargs) {
            case  7:
            __Pyx_Arg_XDECREF_FASTCALL(values[6]);
            values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
            CYTHON_FALLTHROUGH;
            case  6:
            __Pyx_Arg_XDECREF_FASTCALL(values[5]);
            values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
            CYTHON_FALLTHROUGH;
            case  5:
            __Pyx_Arg_XDECREF_FASTCALL(values[4]);
            values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
            CYTHON_FALLTHROUGH;
            case  4:
            __Pyx_Arg_XDECREF_FASTCALL(values[3]);
            values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
            CYTHON_FALLTHROUGH;
            case  3:
            values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
            values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
            values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_callback = values[0];
        __pyx_v_name = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(0, 719, __pyx_L3_error)
        __pyx_v_service = values[2];
        if (values[3]) {
          __pyx_v_family = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_family == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 721, __pyx_L3_error)
        } else {
          __pyx_v_family = ((int)0);
        }
        if (values[4]) {
          __pyx_v_type = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 722, __pyx_L3_error)
        } else {
          __pyx_v_type = ((int)0);
        }
        if (values[5]) {
          __pyx_v_proto = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_proto == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 723, __pyx_L3_error)
        } else {
          __pyx_v_proto = ((int)0);
        }
        if (values[6]) {
          __pyx_v_flags = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 724, __pyx_L3_error)
        } else {
          __pyx_v_flags = ((int)0);
        }
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("getaddrinfo", 0, 3, 7, __pyx_nargs); __PYX_ERR(0, 717, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_AddTraceback("gevent.resolver.cares.channel.getaddrinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_22getaddrinfo(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_name, __pyx_v_service, __pyx_v_family, __pyx_v_type, __pyx_v_proto, __pyx_v_flags);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_22getaddrinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, char const *__pyx_v_name, PyObject *__pyx_v_service, int __pyx_v_family, int __pyx_v_type, int __pyx_v_proto, int __pyx_v_flags) {
      struct ares_addrinfo_hints __pyx_v_hints;
      PyObject *__pyx_v_arg = 0;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.getaddrinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_23getaddrinfo, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_channel_getaddrinfo, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 717, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[3]);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel, __pyx_mstate_global->__pyx_n_u_getaddrinfo, __pyx_t_3) < 0) __PYX_ERR(0, 717, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     718:                     object callback,

     719:                     const char* name,

     720:                     object service, # AKA port

     721:                     int family=0,

     722:                     int type=0,

     723:                     int proto=0,

     724:                     int flags=0):

    +725:         if not self.channel:

      __pyx_t_1 = (!(__pyx_v_self->channel != 0));
      if (unlikely(__pyx_t_1)) {
    /* … */
      }

    +726:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')

        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_gaierror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyLong_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 726, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
          assert(__pyx_t_5);
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_6 = 1;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_kp_u_this_ares_channel_has_been_destr};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 726, __pyx_L1_error)

     727:

     728:         cdef cares.ares_addrinfo_hints hints

    +729:         memset(&hints, 0, sizeof(cares.ares_addrinfo_hints))

      (void)(memset((&__pyx_v_hints), 0, (sizeof(struct ares_addrinfo_hints))));

     730:

    +731:         hints.ai_flags = channel._convert_cares_ai_flags(flags)

      __pyx_t_7 = __pyx_f_6gevent_8resolver_5cares_7channel__convert_cares_ai_flags(__pyx_v_flags); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 731, __pyx_L1_error)
      __pyx_v_hints.ai_flags = __pyx_t_7;

    +732:         hints.ai_family = family

      __pyx_v_hints.ai_family = __pyx_v_family;

    +733:         hints.ai_socktype = type

      __pyx_v_hints.ai_socktype = __pyx_v_type;

    +734:         hints.ai_protocol = proto

      __pyx_v_hints.ai_protocol = __pyx_v_proto;

    +735:         cdef object arg = (self, callback)

      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __Pyx_GIVEREF((PyObject *)__pyx_v_self);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)) != (0)) __PYX_ERR(0, 735, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_callback);
      __Pyx_GIVEREF(__pyx_v_callback);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_callback) != (0)) __PYX_ERR(0, 735, __pyx_L1_error);
      __pyx_v_arg = __pyx_t_2;
      __pyx_t_2 = 0;

    +736:         Py_INCREF(arg)

      Py_INCREF(__pyx_v_arg);

     737:

    +738:         cares.ares_getaddrinfo(

      ares_getaddrinfo(__pyx_v_self->channel, __pyx_v_name, __pyx_t_8, (&__pyx_v_hints), ((void *)__pyx_f_6gevent_8resolver_5cares_7channel__getaddrinfo_cb), ((void *)__pyx_v_arg));

     739:             self.channel,

     740:             name,

    +741:             NULL if service is None else <char*>service,

      __pyx_t_1 = (__pyx_v_service == Py_None);
      if (__pyx_t_1) {
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_9 = __Pyx_PyObject_AsWritableString(__pyx_v_service); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 741, __pyx_L1_error)
        __pyx_t_8 = ((char *)__pyx_t_9);
      }

     742:             &hints,

     743:             <void*>channel._getaddrinfo_cb,

     744:             <void*>arg

     745:         )