§
    1@Äj ž  ã                   ó,  — d Z ddlZddlmZmZ ddlZddlmZ ddlm	Z	m
Z
mZmZ ddlZ ej        d¦  «        Z ej        d¦  «        Z ej        d¦  «        Z ej        e	j        ¦  «        Ze                     ¦   «         Z ed¦  «        Z ed¦  «        Z ed¦  «        Z ed¦  «        Zd	„ Zd[d
„Zd„ Zi Zd\d„Zd[d„Z  G d„ de!¦  «        Z" G d„ de"¦  «        Z# G d„ de"¦  «        Z$ G d„ de!¦  «        Z%d]d„Z&d„ Z'd^d„Z(d„ Z)d„ Z*d„ Z+d_d„Z,d „ Z-d!„ Z.d"„ Z/d#„ Z0d$„ Z1d%„ Z2d&„ Z3d'„ Z4 ej5        d(d)¦  «        Z6ed`d*„¦   «         Z7edad,„¦   «         Z8ed-„ ¦   «         Z9edbd/„¦   «         Z:ed0„ ¦   «         Z;d[d1„Z<d2„ Z=d[d3„Z>	 	 dcd4„Z?d[d5„Z@	 dcd6„ZAd7„ ZBd8„ ZCd9„ ZDd:„ ZEeDZFeCZGd;„ ZHed<efd=„¦   «         ZId>„ ZJd?„ ZKd[d@„ZLedddA„¦   «         ZMeKZNdB„ ZOdC„ ZPdD„ ZQdE„ ZRdF„ ZSd[dG„ZTdH„ ZUdI„ ZVdedK„ZWdL„ ZXdM„ ZYdN„ ZZdO„ Z[dfdP„Z\dfdQ„Z]dR„ Z^dS„ Z_dT„ Z`dU„ ZadV„ ZbdW„ ZcdX„ ZddY„ ZedZ„ ZfdS )gz+
Generic helpers for LLVM code generation.
é    N)ÚcontextmanagerÚ	ExitStack)Úir)ÚutilsÚtypesÚconfigÚ	debuginfoé   é   é    c                 óV   — |                       d||                     d¦  «        ¦  «        S )Nú!=r   )Úicmp_unsignedÚtype©ÚbuilderÚvalues     úCC:\Projects\Historical\venv\Lib\site-packages\numba/core/cgutils.pyÚas_bool_bitr      s$   € Ø× Ò   u¨e¯jªj¸©m¬mÑ<Ô<Ð<ó    c                 óÈ   — |€t          j        d„ |D ¦   «         ¦  «        } |t           j        ¦  «        }t          |¦  «        D ]\  }}|                      |||¦  «        }Œ|S )zH
    Create an anonymous struct containing the given LLVM *values*.
    Nc                 ó   — g | ]	}|j         ‘Œ
S © ©r   ©Ú.0Úvs     r   ú
<listcomp>z)make_anonymous_struct.<locals>.<listcomp>%   s   € Ð+CÐ+CÐ+C°q¨A¬FÐ+CÐ+CÐ+Cr   ©r   ÚLiteralStructTypeÚ	UndefinedÚ	enumerateÚinsert_value)r   ÚvaluesÚstruct_typeÚ
struct_valÚir   s         r   Úmake_anonymous_structr(       st   € ð ÐÝÔ*Ð+CÐ+C¸FÐ+CÑ+CÔ+CÑDÔDˆØ��Rœ\Ñ*Ô*€JÝ˜&Ñ!Ô!ð <ð <‰ˆˆ1Ø×)Ò)¨*°a¸Ñ;Ô;ˆ
ˆ
ØÐr   c                 ó²   — t          | ¦  «        }t          |¦  «        }t          j        t          j        t          j        d¦  «        |¦  «        |¦  «        S )z0
    Make a byte array constant from *buf*.
    r   )Ú	bytearrayÚlenr   ÚConstantÚ	ArrayTypeÚIntType)ÚbufÚbÚns      r   Úmake_bytearrayr2   ,   s@   € õ 	�#‰Œ€AÝˆA‰Œ€AÝŒ;•r”|¥B¤J¨q¡M¤M°1Ñ5Ô5°qÑ9Ô9Ð9r   r   c                 ó   — | |f}t                                |¦  «        }|€]t          t          dœ|         }|j        dz   t          | ¦  «        z   }|f}t          | ¬¦  «        }t          |||¦  «        }|t           |<   |S )zK
    Returns a specialized StructProxy subclass for the given fe_type.
    N)r   ÚdataÚ_)Ú_fe_type)Ú_struct_proxy_cacheÚgetÚValueStructProxyÚDataStructProxyÚ__name__ÚstrÚdictr   )Úfe_typeÚkindÚ	cache_keyÚresÚbaseÚclsnameÚbasesÚ
clsmemberss           r   Úcreate_struct_proxyrF   8   s�   € ð ˜$�€IÝ
×
!Ò
! )Ñ
,Ô
,€CØ
€{Ý)Ý'ðð àôˆð ”- #Ñ%­¨G©¬Ñ4ˆØ�ˆÝ 7Ð+Ñ+Ô+ˆ
Ý�7˜E :Ñ.Ô.ˆà),Õ˜IÑ&Ø€Jr   c                 ó  — |€i }|                      ¦   «         }|j        j        D ]7}|                     |t	          ||¦  «        ¦  «        }t          | ||¦  «         Œ8|                     ¦   «         D ]\  }}t          | ||¦  «         Œ| S )zJ
    Copy structure from *src* to *dst* with replacement from *repl*.
    )ÚcopyÚ
_datamodelÚ_fieldsÚpopÚgetattrÚsetattrÚitems)ÚdstÚsrcÚreplÚkr   s        r   Úcopy_structrS   K   s”   € ð €|ØˆØ�9Š9‰;Œ;€DàŒ^Ô#ð ð ˆØ�HŠH�Q�  Q™œÑ(Ô(ˆÝ��Q˜ÑÔÐÐà—
’
‘”ð ð ‰ˆˆ1Ý��Q˜ÑÔÐÐØ€Jr   c                   ó|   ‡ — e Zd ZdZdZdd„Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zˆ fd„Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zˆ xZS )Ú_StructProxyz·
    Creates a `Structure` like interface that is constructed with information
    from DataModel instance.  FE type must have a data model that is a
    subclass of StructModel.
    Nc                 óè  — || _         | j         j        | j                 | _        t	          | j        t
          j        j        j        ¦  «        s't          d 
                    | j        ¦  «        ¦  «        ‚|| _        |                      | j        ¦  «        | _        t          | j        ¦  «        rJ ‚|                      |¦  «        \  }}|j        j        | j        k    r1t%          d| j                             ¦   «         ›d|j        ›�¦  «        ‚|�T|j        |j        j        k    r$t%          d|j        j        ›d|j        ›�¦  «        ‚| j                             ||¦  «         || _        || _        d S )NzNot a structure model: {0}zbad ref type: expected z, got zbad value type: expected )Ú_contextÚdata_model_managerr6   rI   Ú
isinstanceÚnumbaÚcoreÚ	datamodelÚStructModelÚ	TypeErrorÚformatÚ_builderÚ_get_be_typeÚ_be_typeÚ
is_pointerÚ
_make_refsr   ÚpointeeÚAssertionErrorÚ
as_pointerÚstoreÚ_valueÚ
_outer_ref)ÚselfÚcontextr   r   ÚrefÚ	outer_refs         r   Ú__init__z_StructProxy.__init__e   sk  € ØˆŒØœ-Ô:¸4¼=ÔIˆŒÝ˜$œ/­5¬:Ô+?Ô+KÑLÔLð 	FÝØ,×3Ò3°D´OÑDÔDñFô Fð FàˆŒà×)Ò)¨$¬/Ñ:Ô:ˆŒÝ˜dœmÑ,Ô,Ð,Ð,Ð,àŸš¨Ñ-Ô-‰ˆ	�3ØŒ8Ô˜tœ}Ò,Ð,Ý �.Ø$(¤M×$<Ò$<Ñ$>Ô$>Ð$>Ð$>ÀÄÀð"Jñ Kô Kð Kð ÐØŒz˜Yœ^Ô3Ò3Ð3Ý$�nØ(1¬Ô(>Ð(>Ð(>ÀÄ
À
ð&Lñ Mô Mð MàŒM×Ò  yÑ1Ô1Ð1àˆŒØ#ˆŒˆˆr   c                 óF   — |€t          | j        | j        d¬¦  «        }||fS )z‘
        Return an (outer ref, value ref) pair.  By default, these are
        the same pointers, but a derived class may override this.
        NT©Úzfill)Úalloca_oncer`   rb   )rk   rm   s     r   rd   z_StructProxy._make_refs~   s*   € ð
 ˆ;Ý˜dœm¨T¬]À$ÐGÑGÔGˆCØ�Cˆxˆr   c                 ó   — t           ‚©N©ÚNotImplementedError©rk   r\   s     r   ra   z_StructProxy._get_be_type‡   ó   € Ý!Ð!r   c                 ó   — t           ‚ru   rv   ©rk   ÚindexÚvals      r   Ú_cast_member_to_valuez"_StructProxy._cast_member_to_valueŠ   ry   r   c                 ó   — t           ‚ru   rv   r{   s      r   Ú_cast_member_from_valuez$_StructProxy._cast_member_from_value�   ry   r   c                 ó:   — t          | j        | j        d|¦  «        S ©Nr   )Úgep_inboundsr`   ri   ©rk   r|   s     r   Ú_get_ptr_by_indexz_StructProxy._get_ptr_by_index�   s   € Ý˜DœM¨4¬;¸¸5ÑAÔAÐAr   c                 ó`   — | j                              |¦  «        }|                      |¦  «        S ru   )rI   Úget_field_positionr…   )rk   Úattrnamer|   s      r   Ú_get_ptr_by_namez_StructProxy._get_ptr_by_name“   s+   € Ø”×2Ò2°8Ñ<Ô<ˆØ×%Ò% eÑ,Ô,Ð,r   c                 óŠ   — |                      d¦  «        s | | j                             |¦  «                 S t          |¦  «        ‚©z;
        Load the LLVM value of the named *field*.
        r5   )Ú
startswithrI   r‡   ÚAttributeError©rk   Úfields     r   Ú__getattr__z_StructProxy.__getattr__—   sC   € ð ×Ò Ñ$Ô$ð 	(Ø˜œ×:Ò:¸5ÑAÔAÔBÐBå  Ñ'Ô'Ð'r   c                 ó¾   •— |                      d¦  «        r)t          t          | ¦  «                             ||¦  «        S || | j                             |¦  «        <   dS ©z@
        Store the LLVM *value* into the named *field*.
        r5   N)rŒ   ÚsuperrU   Ú__setattr__rI   r‡   ©rk   r�   r   Ú	__class__s      €r   r”   z_StructProxy.__setattr__    s\   ø€ ð ×Ò˜CÑ Ô ð 	GÝ� tÑ,Ô,×8Ò8¸ÀÑFÔFÐFØ:?ˆˆTŒ_×/Ò/°Ñ6Ô6Ñ7Ð7Ð7r   c                 óˆ   — | j                              |                      |¦  «        ¦  «        }|                      ||¦  «        S ©z>
        Load the LLVM value of the field at *index*.
        )r`   Úloadr…   r~   )rk   r|   Ú
member_vals      r   Ú__getitem__z_StructProxy.__getitem__¨   s=   € ð ”]×'Ò'¨×(>Ò(>¸uÑ(EÔ(EÑFÔFˆ
Ø×)Ò)¨%°Ñ<Ô<Ð<r   c                 ó  — |                       |¦  «        }|                      ||¦  «        }|j        |j        j        k    r£t	          |j        ¦  «        rit	          |j        j        ¦  «        rP|j        j        |j        j        j        k    r1| j                             | j        ||j        j        j        ¦  «        }n&t          d 
                    ||| |¬¦  «        ¦  «        ‚| j                             ||¦  «         dS )úC
        Store the LLVM *value* into the field at *index*.
        zjInvalid store of {value.type} to {ptr.type.pointee} in {self._datamodel} (trying to write member #{index}))r   Úptrrk   r|   N)r…   r€   r   re   rc   rW   Úaddrspacecastr`   Ú	addrspacer^   r_   rh   )rk   r|   r   rž   s       r   Ú__setitem__z_StructProxy.__setitem__¯   s  € ð ×$Ò$ UÑ+Ô+ˆØ×,Ò,¨U°EÑ:Ô:ˆØŒ:˜œÔ)Ò)Ð)Ý˜5œ:Ñ&Ô&ð 6­:°c´hÔ6FÑ+GÔ+Gð 6Øœ
Ô*¨c¬hÔ.>Ô.FÒFÐFð œ×3Ò3°D´MØ49Ø47´HÔ4DÔ4NñPô P��õ  ð !D÷ "(¢¨e¸À4Ø.3ð "(ñ "5ô "5ñ	6ô 6ð 6ð 	Œ×Ò˜E 3Ñ'Ô'Ð'Ð'Ð'r   c                 ó   — | j         j        S ©z.
        Return the number of fields.
        )rI   Úfield_count©rk   s    r   Ú__len__z_StructProxy.__len__Æ   s   € ð ŒÔ*Ð*r   c                 ó   — | j         S ©zF
        Return the LLVM pointer to the underlying structure.
        )rj   r¥   s    r   Ú_getpointerz_StructProxy._getpointerÌ   s   € ð ŒÐr   c                 ó@   — | j                              | j        ¦  «        S ©zM
        Load and return the value of the underlying LLVM structure.
        )r`   r™   rj   r¥   s    r   Ú	_getvaluez_StructProxy._getvalueÒ   s   € ð Œ}×!Ò! $¤/Ñ2Ô2Ð2r   c                 ó¾   — t          |j        ¦  «        rJ ‚|j        | j        k    sJ |j        | j        f¦   «         ‚| j                             || j        ¦  «         dS )z4
        Store the value in this structure.
        N)rc   r   rb   r`   rh   ri   ©rk   r   s     r   Ú	_setvaluez_StructProxy._setvalueØ   s`   € õ ˜eœjÑ)Ô)Ð)Ð)Ð)ØŒz˜Tœ]Ò*Ð*Ð*¨U¬Z¸¼Ð,GÑ*Ô*Ð*ØŒ×Ò˜E 4¤;Ñ/Ô/Ð/Ð/Ð/r   ©NN)r;   Ú
__module__Ú__qualname__Ú__doc__r6   ro   rd   ra   r~   r€   r…   r‰   r�   r”   r›   r¡   r¦   r©   r¬   r¯   Ú__classcell__©r–   s   @r   rU   rU   \   s(  ø€ € € € € ðð ð €Hð$ð $ð $ð $ð2ð ð ð"ð "ð "ð"ð "ð "ð"ð "ð "ðBð Bð Bð-ð -ð -ð(ð (ð (ð@ð @ð @ð @ð @ð=ð =ð =ð(ð (ð (ð.+ð +ð +ðð ð ð3ð 3ð 3ð0ð 0ð 0ð 0ð 0ð 0ð 0r   rU   c                   ó$   — e Zd ZdZd„ Zd„ Zd„ ZdS )r9   zl
    Create a StructProxy suitable for accessing regular values
    (e.g. LLVM values or alloca slots).
    c                 ó*   — |                      ¦   «         S ru   )Úget_value_typerx   s     r   ra   zValueStructProxy._get_be_typeæ   s   € Ø×'Ò'Ñ)Ô)Ð)r   c                 ó   — |S ru   r   r{   s      r   r~   z&ValueStructProxy._cast_member_to_valueé   ó   € Øˆ
r   c                 ó   — |S ru   r   r{   s      r   r€   z(ValueStructProxy._cast_member_from_valueì   rº   r   N©r;   r±   r²   r³   ra   r~   r€   r   r   r   r9   r9   á   sK   € € € € € ðð ð*ð *ð *ðð ð ðð ð ð ð r   r9   c                   ó$   — e Zd ZdZd„ Zd„ Zd„ ZdS )r:   zO
    Create a StructProxy suitable for accessing data persisted in memory.
    c                 ó*   — |                      ¦   «         S ru   )Úget_data_typerx   s     r   ra   zDataStructProxy._get_be_typeô   s   € Ø×&Ò&Ñ(Ô(Ð(r   c                 ól   — | j                              |¦  «        }|                     | j        |¦  «        S ru   )rI   Ú	get_modelÚ	from_datar`   ©rk   r|   r}   Úmodels       r   r~   z%DataStructProxy._cast_member_to_value÷   s-   € Ø”×)Ò)¨%Ñ0Ô0ˆØ�Š˜tœ}¨cÑ2Ô2Ð2r   c                 ól   — | j                              |¦  «        }|                     | j        |¦  «        S ru   )rI   rÁ   Úas_datar`   rÃ   s       r   r€   z'DataStructProxy._cast_member_from_valueû   s-   € Ø”×)Ò)¨%Ñ0Ô0ˆØ�}Š}˜Tœ]¨CÑ0Ô0Ð0r   Nr¼   r   r   r   r:   r:   ð   sK   € € € € € ðð ð)ð )ð )ð3ð 3ð 3ð1ð 1ð 1ð 1ð 1r   r:   c                   ó`   ‡ — e Zd ZdZdd„Zd„ Zd„ Zd„ Zˆ fd„Zd	„ Z	d
„ Z
d„ Zd„ Zd„ Zd„ Zˆ xZS )Ú	Structurezs
    A high-level object wrapping a alloca'ed LLVM structure, including
    named fields and attribute access.
    NFc                 óv  — |                      | ¦  «        | _        || _        || _        |€vt	          || j        d¬¦  «        | _        |�Wt          |j        ¦  «        rJ ‚|j        | j        k    sJ |j        | j        f¦   «         ‚|                     || j        ¦  «         nŠ|�J ‚t          |j        ¦  «        sJ ‚| j        |j        j	        k    rT|r.| 
                    || j                             ¦   «         ¦  «        }n$t          d|j        j	        ›d| j        ›�¦  «        ‚|| _        i | _        g | _        g | _        t!          d¦  «        }t#          | j        ¦  «        D ]U\  }\  }}	|| j        |<   | j                             |t!          |¦  «        f¦  «         | j                             |	¦  «         ŒVd S )NTrq   zmismatching pointer type: got z, expected r   )Úget_struct_typeÚ_typerW   r`   rs   ri   rc   r   rh   re   Úbitcastrg   r^   Ú_namemapÚ_fdmapÚ_typemapÚint32_tr"   rJ   Úappend)
rk   rl   r   r   rm   Úcast_refrB   r'   rR   Útps
             r   ro   zStructure.__init__  s¾  € Ø×,Ò,¨TÑ2Ô2ˆŒ
ØˆŒØˆŒØˆ;Ý% g¨t¬zÀÐFÑFÔFˆDŒKØÐ Ý% e¤jÑ1Ô1Ð1Ð1Ð1Ø”z T¤ZÒ/Ð/Ð/°%´*¸d¼jÐ1IÑ/Ô/Ð/Ø—’˜e T¤[Ñ1Ô1Ð1øà�=�=�=Ý˜cœhÑ'Ô'Ð'Ð'Ð'ØŒz˜SœXÔ-Ò-Ð-Øð :Ø!Ÿ/š/¨#¨t¬z×/DÒ/DÑ/FÔ/FÑGÔG�C�Cå#˜)àœ8Ô+Ð+Ð+¨T¬Z¨Zð9ñ:ô :ð :ð ˆDŒKàˆŒØˆŒØˆŒÝ�q‰zŒzˆÝ# D¤LÑ1Ô1ð 	%ð 	%‰JˆA‰w��2Ø ˆDŒM˜!ÑØŒK×Ò ¥g¨a¡j¤jÐ1Ñ2Ô2Ð2ØŒM× Ò  Ñ$Ô$Ð$Ð$ð	%ð 	%r   c                 ó`   — | j                              | j        | j        |         d¬¦  «        }|S )NT)Úinbounds)r`   Úgepri   rÎ   )rk   r|   rž   s      r   r…   zStructure._get_ptr_by_index&  s,   € ØŒm×Ò ¤¨T¬[¸Ô-?È$ÐÑOÔOˆØˆ
r   c                 óB   — |                       | j        |         ¦  «        S ru   )r…   rÍ   )rk   rˆ   s     r   r‰   zStructure._get_ptr_by_name*  s   € Ø×%Ò% d¤m°HÔ&=Ñ>Ô>Ð>r   c                 óp   — |                      d¦  «        s| | j        |                  S t          |¦  «        ‚r‹   )rŒ   rÍ   r�   rŽ   s     r   r�   zStructure.__getattr__-  s:   € ð ×Ò Ñ$Ô$ð 	(Ø˜œ eÔ,Ô-Ð-å  Ñ'Ô'Ð'r   c                 ó¤   •— |                      d¦  «        r)t          t          | ¦  «                             ||¦  «        S || | j        |         <   dS r’   )rŒ   r“   rÈ   r”   rÍ   r•   s      €r   r”   zStructure.__setattr__6  sS   ø€ ð ×Ò˜CÑ Ô ð 	DÝ� DÑ)Ô)×5Ò5°e¸UÑCÔCÐCØ%*ˆˆTŒ]˜5Ô!Ñ"Ð"Ð"r   c                 ó\   — | j                              |                      |¦  «        ¦  «        S r˜   )r`   r™   r…   r„   s     r   r›   zStructure.__getitem__>  s(   € ð
 Œ}×!Ò! $×"8Ò"8¸Ñ"?Ô"?Ñ@Ô@Ð@r   c                 ó  — |                       |¦  «        }|j        j        |j        k    r@d}t          ||t	          |j        j        ¦  «        t	          |j        ¦  «        fz  ¦  «        ‚| j                             ||¦  «         dS )r�   z:Type mismatch: __setitem__(%d, ...) expected %r but got %rN)r…   r   re   rf   r<   r`   rh   )rk   r|   r   rž   Úfmts        r   r¡   zStructure.__setitem__E  s‰   € ð ×$Ò$ UÑ+Ô+ˆØŒ8Ô˜uœzÒ)Ð)ØNˆCÝ  ¨Ý(+¨C¬HÔ,<Ñ(=Ô(=Ý(+¨E¬J©¬ð(9ñ "9ñ :ô :ð :ð 	Œ×Ò˜E 3Ñ'Ô'Ð'Ð'Ð'r   c                 ó*   — t          | j        ¦  «        S r£   )r+   rÍ   r¥   s    r   r¦   zStructure.__len__Q  s   € õ �4”=Ñ!Ô!Ð!r   c                 ó   — | j         S r¨   )ri   r¥   s    r   r©   zStructure._getpointerW  s   € ð Œ{Ðr   c                 ó@   — | j                              | j        ¦  «        S r«   )r`   r™   ri   r¥   s    r   r¬   zStructure._getvalue]  s   € ð Œ}×!Ò! $¤+Ñ.Ô.Ð.r   c                 ó¾   — t          |j        ¦  «        rJ ‚|j        | j        k    sJ |j        | j        f¦   «         ‚| j                             || j        ¦  «         dS )z!Store the value in this structureN)rc   r   rË   r`   rh   ri   r®   s     r   r¯   zStructure._setvaluec  s^   € å˜eœjÑ)Ô)Ð)Ð)Ð)ØŒz˜TœZÒ'Ð'Ð'¨%¬*°d´jÐ)AÑ'Ô'Ð'ØŒ×Ò˜E 4¤;Ñ/Ô/Ð/Ð/Ð/r   )NNF)r;   r±   r²   r³   ro   r…   r‰   r�   r”   r›   r¡   r¦   r©   r¬   r¯   r´   rµ   s   @r   rÈ   rÈ      sà   ø€ € € € € ðð ð%ð %ð %ð %ð>ð ð ð?ð ?ð ?ð(ð (ð (ð+ð +ð +ð +ð +ðAð Að Að
(ð 
(ð 
(ð"ð "ð "ðð ð ð/ð /ð /ð0ð 0ð 0ð 0ð 0ð 0ð 0r   rÈ   Ú Fc                 óæ  — t          |t          ¦  «        rt          j        t          |¦  «        }t          j        | ¦  «        5  |                      ¦   «         5  |                      |||¬¦  «        }|  	                     |d¦  «        |¦  «         ddd¦  «         n# 1 swxY w Y   |r.|  	                    |j
                             d¦  «        |¦  «         |cddd¦  «         S # 1 swxY w Y   dS )aä  Allocate stack memory at the entry block of the current function
    pointed by ``builder`` with llvm type ``ty``.  The optional ``size`` arg
    set the number of element to allocate.  The default is 1.  The optional
    ``name`` arg set the symbol name inside the llvm IR for debugging.
    If ``zfill`` is set, fill the memory with zeros at the current
    use-site location.  Note that the memory is always zero-filled after the
    ``alloca`` at init-site (the entry block).
    )ÚsizeÚnameN)rY   Úintr   r,   Úintp_tr	   Úsuspend_emissionÚgoto_entry_blockÚallocarh   r   re   )r   Útyrã   rä   rr   rž   s         r   rs   rs   l  si  € õ �$�ÑÔð )ÝŒ{�6 4Ñ(Ô(ˆõ 
Ô	# GÑ	,Ô	,ð ð Ø×%Ò%Ñ'Ô'ð 	)ð 	)Ø—.’. ¨$°T�.Ñ:Ô:ˆCà�MŠM˜"˜"˜T™(œ( CÑ(Ô(Ð(ð	)ð 	)ð 	)ñ 	)ô 	)ð 	)ð 	)ð 	)ð 	)ð 	)ð 	)øøøð 	)ð 	)ð 	)ð 	)ð
 ð 	7Ø�MŠM˜#œ(×*Ò*¨4Ñ0Ô0°#Ñ6Ô6Ð6Øðð ð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð ð ð s6   ÁC&Á8BÂC&ÂB!	Â!C&Â$B!	Â%4C&Ã&C*Ã-C*c                 ó”   —  |d¦  «        }|                      t          d¦  «        g¦  «        }|                      |t          ¦  «        S )zCompute sizeof using GEP
    Nr
   )rÖ   rÐ   Úptrtointræ   )r   Úptr_typeÚnullÚoffsets       r   Úsizeofrð   …  s@   € ð ˆ8�D‰>Œ>€DØ�XŠX•w˜q‘z”z�lÑ#Ô#€FØ×Ò˜F¥FÑ+Ô+Ð+r   c                 ó`   — t          | |j        |¬¦  «        }|                      ||¦  «         |S )z¥
    Like alloca_once(), but passing a *value* instead of a type.  The
    type is inferred and the allocated slot is also initialized with the
    given value.
    rq   )rs   r   rh   )r   r   rä   rr   Ústorages        r   Úalloca_once_valueró   �  s3   € õ ˜' 5¤:°UÐ;Ñ;Ô;€GØ‡M‚M�%˜Ñ!Ô!Ð!Ø€Nr   c                 ó�   — t          | ||¦  «        }|j                             d¦  «         |j                             d¦  «         |S )z_
    Insert a pure function (in the functional programming sense) in the
    given module.
    ÚreadonlyÚnounwind)Úget_or_insert_functionÚ
attributesÚadd©ÚmoduleÚfntyrä   Úfns       r   Úinsert_pure_functionrþ   ˜  sF   € õ
 
  ¨¨dÑ	3Ô	3€BØ„M×Ò�jÑ!Ô!Ð!Ø„M×Ò�jÑ!Ô!Ð!Ø€Ir   c                 ól   — | j                              |d¦  «        }|€t          j        | ||¦  «        }|S )zm
    Get the function named *name* with type *fnty* from *module*, or insert it
    if it doesn't exist.
    N)Úglobalsr8   r   ÚFunctionrú   s       r   r÷   r÷   £  s8   € ð
 
Œ×	Ò	˜D $Ñ	'Ô	'€BØ	€zÝŒ[˜  tÑ,Ô,ˆØ€Ir   c                 óx   — 	 |                       |¦  «        S # t          $ r |                      |¦  «        cY S w xY wru   )Úget_named_metadataÚKeyErrorÚadd_named_metadata)rû   rä   s     r   Úget_or_insert_named_metadatar  ®  sP   € ð/Ø×(Ò(¨Ñ.Ô.Ð.øÝð /ð /ð /Ø×(Ò(¨Ñ.Ô.Ð.Ð.Ð.ð/øøøs   ‚ —9¸9c                 óZ   — |                       |¦  «        }t          j        | |||¦  «        S ru   )Úget_unique_namer   ÚGlobalVariable)rû   rê   rä   r    Úunique_names        r   Úadd_global_variabler  µ  s,   € Ø×(Ò(¨Ñ.Ô.€KÝÔ˜V R¨°iÑ@Ô@Ð@r   c                 óP   — | j         }|j        €|                      |¦  «         d S d S ru   )Úbasic_blockÚ
terminatorÚbranch)r   ÚbbendÚbbs      r   Ú	terminater  º  s2   € Ø	Ô	€BØ	„}ÐØ�Š�uÑÔÐÐÐð Ðr   c                 ó   —  | d ¦  «        S ru   r   )Últypes    r   Úget_null_valuer  À  s   € Øˆ5�‰;Œ;Ðr   c                 óX   — t          |j        ¦  «        }|                      d||¦  «        S )Nú==©r  r   r   ©r   r}   rî   s      r   Úis_nullr  Ä  ó)   € Ý˜#œ(Ñ#Ô#€DØ× Ò   t¨SÑ1Ô1Ð1r   c                 óX   — t          |j        ¦  «        }|                      d||¦  «        S )Nr   r  r  s      r   Úis_not_nullr  É  r  r   c                 ó0   — |                       |d¬¦  «        S )NF©Úlikely©Úif_then©r   Úpreds     r   Úif_unlikelyr%  Î  s   € Ø�?Š?˜4¨ˆ?Ñ.Ô.Ð.r   c                 ó0   — |                       |d¬¦  «        S )NTr  r!  r#  s     r   Ú	if_likelyr'  Ò  s   € Ø�?Š?˜4¨ˆ?Ñ-Ô-Ð-r   c                 óR   — |                       |                      |¦  «        ¦  «        S ru   )r"  Únot_r#  s     r   Úifnotr*  Ö  s    € Ø�?Š?˜7Ÿ<š<¨Ñ-Ô-Ñ.Ô.Ð.r   c                 ó^   — |                      d¦  «        }|                      ||dg¬¦  «        S )z#
    Increment an index *val*.
    r
   Únsw)Úflags)r   rù   )r   r}   Úones      r   Úincrement_indexr/  Ú  s/   € ð �(Š(�1‰+Œ+€Cð �;Š;�s˜C¨ wˆ;Ñ/Ô/Ð/r   ÚLoop)r|   Údo_breakc              #   ó2  ‡ ‡K  — |€|j         }|€ |d¦  «        }|}‰                      d¦  «        }‰                      d¦  «        }‰                      d¦  «        Šˆˆ fd„}‰ j        }‰                      |¦  «         ‰                      |¦  «        5  ‰                      |d¬¦  «        }	‰                      d	|	|¦  «        }
‰                      |
|‰¦  «         ddd¦  «         n# 1 swxY w Y   ‰                      |¦  «        5  t          |	|¦  «        V — ‰ j        }t          ‰ |	¦  «        }t          ‰ |¦  «         ddd¦  «         n# 1 swxY w Y   |	                     ||¦  «         |	                     ||¦  «         ‰                      ‰¦  «         dS )
a  
    Generate LLVM IR for a for-loop in [start, count).
    *start* is equal to 0 by default.

    Yields a Loop namedtuple with the following members:
    - `index` is the loop index's value
    - `do_break` is a no-argument callable to break out of the loop
    Nr   úfor.condúfor.bodyúfor.endc                  ó2   •— ‰                      ‰ ¦  «         d S ru   )r  )r  r   s   €€r   r1  zfor_range.<locals>.do_breakü  s   ø€ Ø�Š�uÑÔÐÐÐr   ú
loop.index©rä   ú<)r   Úappend_basic_blockr  r  Ú
goto_blockÚphiÚicmp_signedÚcbranchr0  r/  r  Úadd_incomingÚposition_at_end)r   ÚcountÚstartÚintpÚstopÚbbcondÚbbbodyr1  Úbbstartr|   r$  Úincrr  s   `           @r   Ú	for_rangerI  è  s;  øøè è € ð €|ØŒzˆØ€}Ø��Q‘”ˆØ€Dà×'Ò'¨
Ñ3Ô3€FØ×'Ò'¨
Ñ3Ô3€FØ×&Ò& yÑ1Ô1€Eðð ð ð ð ð ð Ô!€GØ‡N‚N�6ÑÔÐà	×	Ò	˜FÑ	#Ô	#ð -ð -Ø—’˜D |�Ñ4Ô4ˆØ×"Ò" 3¨¨tÑ4Ô4ˆØ�Š˜˜f eÑ,Ô,Ð,ð-ð -ð -ñ -ô -ð -ð -ð -ð -ð -ð -øøøð -ð -ð -ð -ð
 
×	Ò	˜FÑ	#Ô	#ð #ð #Ý�5˜(Ñ#Ô#Ð#Ð#Ð#àÔ$ˆÝ˜w¨Ñ.Ô.ˆÝ�'˜6Ñ"Ô"Ð"ð#ð #ð #ñ #ô #ð #ð #ð #ð #ð #ð #øøøð #ð #ð #ð #ð 
×Ò�u˜gÑ&Ô&Ð&Ø	×Ò�t˜VÑ$Ô$Ð$à×Ò˜EÑ"Ô"Ð"Ð"Ð"s%   ÂAC%Ã%C)Ã,C)Ä:EÅEÅETc              #   óø  K  — |€|j         }|                      d¦  «        }|                      d¦  «        }|                      d¦  «        }| j        }	|                      |¦  «         |                      |¦  «        5  |                      |d¬¦  «        }
|                      |d¬¦  «        }|r|                      d|
|¦  «        }n|                      d	|
|¦  «        }|                      |||¦  «         ddd¦  «         n# 1 swxY w Y   |                      |¦  «        5  |
|fV — | j        }|                      |
|¦  «        }t          | |¦  «        }t          | |¦  «         ddd¦  «         n# 1 swxY w Y   |
                     ||	¦  «         |
                     ||¦  «         |                     t          j        |d
¦  «        |	¦  «         |                     ||¦  «         |                      |¦  «         dS )a[  
    Generate LLVM IR for a for-loop based on a slice.  Yields a
    (index, count) tuple where `index` is the slice index's value
    inside the loop, and `count` the iteration count.

    Parameters
    -------------
    builder : object
        IRBuilder object
    start : int
        The beginning value of the slice
    stop : int
        The end value of the slice
    step : int
        The step value of the slice
    intp :
        The data type
    inc : boolean, optional
        Signals whether the step is positive (True) or negative (False).

    Returns
    -----------
        None
    Nr3  r4  r5  r7  r8  z
loop.countr9  ú>r   )r   r:  r  r  r;  r<  r=  r>  rù   r/  r  r?  r   r,   r@  )r   rB  rD  ÚsteprC  ÚincrE  rF  r  rG  r|   rA  r$  rH  Ú
next_counts                  r   Úfor_range_slicerO    s}  è è € ð4 €|ØŒzˆà×'Ò'¨
Ñ3Ô3€FØ×'Ò'¨
Ñ3Ô3€FØ×&Ò& yÑ1Ô1€EØÔ!€GØ‡N‚N�6ÑÔÐà	×	Ò	˜FÑ	#Ô	#ð -ð -Ø—’˜D |�Ñ4Ô4ˆØ—’˜D |�Ñ4Ô4ˆØð 	9Ø×&Ò& s¨E°4Ñ8Ô8ˆDˆDà×&Ò& s¨E°4Ñ8Ô8ˆDØ�Š˜˜f eÑ,Ô,Ð,ð-ð -ð -ñ -ô -ð -ð -ð -ð -ð -ð -øøøð -ð -ð -ð -ð 
×	Ò	˜FÑ	#Ô	#ð #ð #Ø�UˆlÐÐÐØÔ$ˆØ�{Š{˜5 $Ñ'Ô'ˆÝ$ W¨eÑ4Ô4ˆ
Ý�'˜6Ñ"Ô"Ð"ð#ð #ð #ñ #ô #ð #ð #ð #ð #ð #ð #øøøð #ð #ð #ð #ð 
×Ò�u˜gÑ&Ô&Ð&Ø	×Ò�t˜VÑ$Ô$Ð$Ø	×Ò•r”{ 4¨Ñ+Ô+¨WÑ5Ô5Ð5Ø	×Ò�z 6Ñ*Ô*Ð*Ø×Ò˜EÑ"Ô"Ð"Ð"Ð"s&   Á<A7C?Ã?DÄDÄAE/Å/E3Å6E3c              #   óz  K  — |j         }|                      d|t          j        |d¦  «        ¦  «        }t	          | ||||d¬¦  «        }t	          | ||||d¬¦  «        }t
          d„ ¦   «         }|                      |d¬¦  «        5 \  }	}
 ||	|¦  «         ||
|¦  «        fV — ddd¦  «         dS # 1 swxY w Y   dS )	a«  
    A helper wrapper for for_range_slice().  This is a context manager which
    yields two for_range_slice()-alike context managers, the first for
    the positive step case, the second for the negative step case.

    Use:
        with for_range_slice_generic(...) as (pos_range, neg_range):
            with pos_range as (idx, count):
                ...
            with neg_range as (idx, count):
                ...
    ú>=r   T)rM  Fc              3   ó|   K  — | 5  |5 }|V — d d d ¦  «         n# 1 swxY w Y   d d d ¦  «         d S # 1 swxY w Y   d S ru   r   )ÚcondÚinner_cmr   s      r   Úcm_condz(for_range_slice_generic.<locals>.cm_condb  sÑ   è è € àð 	ð 	Øð ˜UØ���ðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð ð	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	øøøð 	ð 	ð 	ð 	ð 	ð 	s$   …1ˆ�1™	�1 	¡1±5¸5r  N)r   r=  r   r,   rO  r   Úif_else)r   rB  rD  rL  rC  Úis_pos_stepÚpos_for_rangeÚneg_for_rangerU  ÚthenÚ	otherwises              r   Úfor_range_slice_genericr\  N  s9  è è € ð Œ:€DØ×%Ò% d¨Dµ"´+¸dÀAÑ2FÔ2FÑGÔG€Kå# G¨U°D¸$ÀÈ$ÐOÑOÔO€MÝ# G¨U°D¸$ÀÈ%ÐPÑPÔP€Måðð ñ „^ðð
 
�Š˜¨TˆÑ	2Ô	2ð NÑ6G°t¸YØˆg�d˜MÑ*Ô*¨G¨G°I¸}Ñ,MÔ,MÐMÐMÐMÐMðNð Nð Nñ Nô Nð Nð Nð Nð Nð Nð Nð Nøøøð Nð Nð Nð Nð Nð Ns   ÂB0Â0B4Â7B4ÚCc              #   ó  K  — |dv sJ ‚|sdV — dS |dk    rd„ }nd„ }t          |  ||¦  «        |¦  «        5 }t          |¦  «        t          |¦  «        k    sJ ‚ ||¦  «        V — ddd¦  «         dS # 1 swxY w Y   dS )aò  
    Generate a loop nest walking a N-dimensional array.
    Yields a tuple of N indices for use in the inner loop body,
    iterating over the *shape* space.

    If *order* is 'C' (the default), indices are incremented inside-out
    (i.e. (0,0), (0,1), (0,2), (1,0) etc.).
    If *order* is 'F', they are incremented outside-in
    (i.e. (0,0), (1,0), (2,0), (0,1) etc.).
    This has performance implications when walking an array as it impacts
    the spatial locality of memory accesses.
    ÚCFr   ÚFc                 ó   — | d d d…         S )Néÿÿÿÿr   ©Úxs    r   ú<lambda>zloop_nest.<locals>.<lambda>€  s   € ˜a   " œg€ r   c                 ó   — | S ru   r   rc  s    r   re  zloop_nest.<locals>.<lambda>‚  s   € ˜a€ r   N)Ú
_loop_nestr+   )r   ÚshaperC  ÚorderÚ_swapÚindicess         r   Ú	loop_nestrl  l  sð   è è € ð �Dˆ=ˆ=ˆ=ˆ=Øð 
!àˆˆˆˆˆà�CŠ<ˆ<Ø%Ð%ˆEˆEà�KˆEÝ˜   u¡¤¨tÑ4Ô4ð 	!¸Ý�w‘<”<¥3 u¡:¤:Ò-Ð-Ð-Ð-Ø�%˜‘.”.Ð Ð Ð ð	!ð 	!ð 	!ñ 	!ô 	!ð 	!ð 	!ð 	!ð 	!ð 	!ð 	!ð 	!øøøð 	!ð 	!ð 	!ð 	!ð 	!ð 	!s   ¸0A5Á5A9Á<A9c              #   ó$  K  — t          | |d         |¬¦  «        5 }t          |¦  «        dk    r?t          | |dd …         |¦  «        5 }|j        f|z   V — d d d ¦  «         n# 1 swxY w Y   n
|j        fV — d d d ¦  «         d S # 1 swxY w Y   d S )Nr   ©rC  r
   )rI  r+   rg  r|   )r   rh  rC  Úlooprk  s        r   rg  rg  ˆ  s#  è è € å	�7˜E !œH¨4Ð	0Ñ	0Ô	0ð  °DÝˆu‰:Œ:˜Š>ˆ>Ý˜G U¨1¨2¨2¤Y°Ñ5Ô5ð .¸Ø”z�m gÑ-Ð-Ð-Ð-ð.ð .ð .ñ .ô .ð .ð .ð .ð .ð .ð .øøøð .ð .ð .ð .øð ”:�-ÐÐÐð ð  ð  ñ  ô  ð  ð  ð  ð  ð  ð  ð  øøøð  ð  ð  ð  ð  ð  s5   ›-BÁA"ÁBÁ"A&	Á&BÁ)A&	Á*BÂB	ÂB	c                 óê   — t          |¦  «        }|€|d         j        } t          j        ||¦  «        t          j        ¦  «        }t          |¦  «        D ]\  }}|                      |||¦  «        }Œ|S )z§
    Pack a sequence of values in a LLVM array.  *ty* should be given
    if the array may be empty, in which case the type can't be inferred
    from the values.
    Nr   )r+   r   r   r-   r!   r"   r#   )r   r$   rê   r1   Úaryr'   r   s          r   Ú
pack_arrayrr  ’  su   € õ 	ˆF‰Œ€AØ	€zØ�AŒYŒ^ˆØ
�"Œ,�r˜1Ñ
Ô
�bœlÑ
+Ô
+€CÝ˜&Ñ!Ô!ð .ð .‰ˆˆ1Ø×"Ò" 3¨¨1Ñ-Ô-ˆˆØ€Jr   c                 óÄ   — t          j        d„ |D ¦   «         ¦  «        } |t           j        ¦  «        }t          |¦  «        D ]\  }}|                      |||¦  «        }Œ|S )z7
    Pack a sequence of values into a LLVM struct.
    c                 ó   — g | ]	}|j         ‘Œ
S r   r   r   s     r   r   zpack_struct.<locals>.<listcomp>¥  s   € Ð$<Ð$<Ð$<° Q¤VÐ$<Ð$<Ð$<r   r   )r   r$   ÚstructtyÚstr'   r   s         r   Úpack_structrw  ¡  sm   € õ Ô#Ð$<Ð$<°VÐ$<Ñ$<Ô$<Ñ=Ô=€HØ	ˆ•"”,Ñ	Ô	€BÝ˜&Ñ!Ô!ð ,ð ,‰ˆˆ1Ø×!Ò! " a¨Ñ+Ô+ˆˆØ€Ir   c                 óx   ‡ ‡— |€t          ‰j        j        ¦  «        }ˆ ˆfd„t          |¦  «        D ¦   «         }|S )zH
    Unpack an array or structure of values, return a Python tuple.
    Nc                 ó<   •— g | ]}‰                      ‰|¦  «        ‘ŒS r   )Úextract_value)r   r'   r   Útups     €€r   r   z unpack_tuple.<locals>.<listcomp>³  s9   ø€ ð #ð #ð #Øð ×!Ò! # qÑ)Ô)ð #ð #ð #r   )r+   r   ÚelementsÚrange)r   r{  rA  Úvalss   ``  r   Úunpack_tupler  ¬  sU   øø€ ð €}å�C”HÔ%Ñ&Ô&ˆð#ð #ð #ð #ð #Ý˜5‘\”\ð#ñ #ô #€Dà€Kr   c                 ó¶   — t          ||j        |j        ¬¦  «        }t          ||j        |j        ¬¦  «        }t	          | ||j        |||j        |||¬¦	  «	        S )N)rA  )r4   rh  ÚstridesÚlayoutÚindsÚ
wraparoundÚboundscheck)r  rh  Úndimr�  Úget_item_pointer2r4   r‚  )	rl   r   Úarytyrq  rƒ  r„  r…  Úshapesr�  s	            r   Úget_item_pointerrŠ  ¸  sg   € õ
 ˜' 3¤9°E´JÐ?Ñ?Ô?€FÝ˜7 C¤K°u´zÐBÑBÔB€GÝ˜W g°C´HÀFØ%,°U´\ÈØ(2ÀðMñ Mô Mð Mr   c                 ó&  ‡‡‡‡— ˆˆˆˆfd„}d}‰                      d‰‰¦  «        }t          ‰|¦  «        5  t          j        r
 |¦   «          | j                             ‰t          |f¦  «         d d d ¦  «         n# 1 swxY w Y   ‰                      d‰‰                     d¦  «        ¦  «        }t          ‰|¦  «        5  t          j        r
 |¦   «          | j                             ‰t          |f¦  «         d d d ¦  «         d S # 1 swxY w Y   d S )Nc                  óÒ   •— ‰ �Qt          ‰ t          ¦  «        r't          ‰d                     ‰ ¦  «        ‰‰¦  «         d S t          ‰d‰‰ ‰¦  «         d S t          ‰d‰‰¦  «         d S )NzFdebug: IndexError: index %d is out of bounds for axis {} with size %d
zFdebug: IndexError: index %d is out of bounds for axis %d with size %d
z9debug: IndexError: index %d is out of bounds for size %d
)rY   rå   Úprintfr_   )Úaxisr   ÚdimlenÚinds   €€€€r   Ú_dbgzdo_boundscheck.<locals>._dbgÅ  s©   ø€ ð ÐÝ˜$¥Ñ$Ô$ð Ý�wð !4ß4:²F¸4±L´LÀ#ÀvñOô Oð Oð Oð Oõ �wð !4Ø58¸$Øñô ð ð ð õ �7ØOØ˜ñ ô  ð  ð  ð  r   zindex is out of boundsrQ  r9  r   )r=  r%  r   ÚFULL_TRACEBACKSÚ	call_convÚreturn_user_excÚ
IndexErrorr   )	rl   r   r�  r�  rŽ  r‘  ÚmsgÚout_of_bounds_upperÚout_of_bounds_lowers	    ````    r   Údo_boundscheckr™  Ä  s×  øøøø€ ð ð  ð  ð  ð  ð  ð  ð  ð  #€CØ!×-Ò-¨d°C¸Ñ@Ô@ÐÝ	�WÐ1Ñ	2Ô	2ð Gð GÝÔ!ð 	ØˆD‰FŒFˆFØÔ×)Ò)¨'µ:À¸vÑFÔFÐFðGð Gð Gñ Gô Gð Gð Gð Gð Gð Gð Gøøøð Gð Gð Gð Gð "×-Ò-¨c°3¸¿ºÀ¹¼ÑDÔDÐÝ	�WÐ1Ñ	2Ô	2ð Gð GÝÔ!ð 	ØˆD‰FŒFˆFØÔ×)Ò)¨'µ:À¸vÑFÔFÐFðGð Gð Gñ Gô Gð Gð Gð Gð Gð Gð Gð Gøøøð Gð Gð Gð Gð Gð Gs#   ¶9A;Á;A?ÂA?Ã 9DÄD
ÄD
c	                 ó"  ‡— |r…g }	t          ||¦  «        D ]q\  }
}‰                     d|
|
                     d¦  «        ¦  «        }‰                     ||
¦  «        }‰                     |||
¦  «        }|	                     |¦  «         Œrn|}	|r9t          t          |	|¦  «        ¦  «        D ]\  }\  }
}t          | ‰|
||¦  «         Œ|	s$‰                     |t          d¦  «        g¦  «        S |	d         j        }|dv �rLg }|dk    rft          t          |¦  «        ¦  «        D ]H} |d¦  «        }||dz   d …         D ]}‰                     ||¦  «        }Œ|                     |¦  «         ŒInx|dk    rct          t          |¦  «        ¦  «        D ]E} |d¦  «        }|d |…         D ]}‰                     ||¦  «        }Œ|                     |¦  «         ŒFnt          d¦  «        ‚ |d¦  «        }t          |	|¦  «        D ]1\  }}‰                     ||¦  «        }‰                     ||¦  «        }Œ2‰                     ||g¦  «        }|S ˆfd„t          ||	¦  «        D ¦   «         }t          j        ‰j        |¦  «        }t!          ‰||¦  «        S )	Nr9  r   r_  r]  r
   r`  Úunreachablec                 óB   •— g | ]\  }}‰                      ||¦  «        ‘ŒS r   )Úmul)r   Úsr'   r   s      €r   r   z%get_item_pointer2.<locals>.<listcomp>  s+   ø€ ÐGÐGÐG©¨¨A�7—;’;˜q !Ñ$Ô$ÐGÐGÐGr   )Úzipr=  r   rù   ÚselectrÑ   r"   r™  rÖ   rÐ   r}  r+   r�  Ú	ExceptionÚ	functoolsÚreduceÚpointer_add)rl   r   r4   rh  r�  r‚  rƒ  r„  r…  rk  r�  r�  ÚnegativeÚwrappedÚselectedrŽ  rC  Ústepsr'   ÚlastÚjÚlocrž  Útmprž   Údimoffsrï   s    `                         r   r‡  r‡  â  sæ  ø€ ð
 ð 	àˆÝ˜t UÑ+Ô+ð 	%ð 	%‰KˆC�Ø×*Ò*¨3°°S·X²X¸a±[´[ÑAÔAˆHØ—k’k &¨#Ñ.Ô.ˆGØ—~’~ h°¸Ñ=Ô=ˆHØ�NŠN˜8Ñ$Ô$Ð$Ð$ð		%ð ˆØð @Ý#,­S°¸%Ñ-@Ô-@Ñ#AÔ#Að 	@ð 	@ÑˆD‘-�3˜Ý˜7 G¨S°&¸$Ñ?Ô?Ð?Ð?àð /à�{Š{˜4¥'¨!¡*¤* Ñ.Ô.Ð.Ø�1Œ:Œ?€Dà�€~�~Øˆà�SŠ=ˆ=å�3˜u™:œ:Ñ&Ô&ð #ð #�Ø�t˜A‘w”w�Ø˜q 1™u˜v˜vœð 0ð 0�AØ"Ÿ;š; t¨QÑ/Ô/�D�DØ—’˜TÑ"Ô"Ð"Ð"ð	#ð
 �sŠ]ˆ]å�3˜u™:œ:Ñ&Ô&ð #ð #�Ø�t˜A‘w”w�Ø˜r ˜rœð 0ð 0�AØ"Ÿ;š; t¨QÑ/Ô/�D�DØ—’˜TÑ"Ô"Ð"Ð"ð	#õ ˜MÑ*Ô*Ð*ð ˆd�1‰gŒgˆÝ˜ Ñ'Ô'ð 	(ð 	(‰DˆAˆqØ—+’+˜a Ñ#Ô#ˆCØ—+’+˜c 3Ñ'Ô'ˆCˆCØ�kŠk˜$  Ñ&Ô&ˆØˆ
ð HÐGÐGÐGµ°W¸gÑ1FÔ1FÐGÑGÔGˆÝÔ! '¤+¨wÑ7Ô7ˆÝ˜7 D¨&Ñ1Ô1Ð1r   c                 ó<  — |                      d¦  «        }t          |j         t          j        t          j        f¦  «        r |||¦  «        }nNt          |j         t          j        ¦  «        r|                      |||¦  «        }nt          d|j         ›�¦  «        ‚|S )Nr   zunexpected value type )r   rY   r   Ú	FloatTypeÚ
DoubleTyper.   r=  r^   )r   r   ÚfpredÚicondÚnullvalÚisnulls         r   Ú_scalar_pred_against_zerorµ    sŽ   € Ø�jŠj˜‰mŒm€GÝ�%”*�rœ|­R¬]Ð;Ñ<Ô<ð DØ��u˜gÑ&Ô&ˆˆÝ	�E”J¥¤
Ñ	+Ô	+ð DØ×$Ò$ U¨E°7Ñ;Ô;ˆˆåˆi°e´j°jÐBÑCÔCÐCØ€Mr   c                 óV   — t          | |t          j        | j        d¦  «        d¦  «        S )zK
    Return a predicate representing whether *value* is equal to zero.
    r  ©rµ  r¢  ÚpartialÚfcmp_orderedr   s     r   Úis_scalar_zerorº  '  s2   € õ %Ø��	Ô)¨'Ô*>ÀÑEÔEÀtñMô Mð Mr   c                 óV   — t          | |t          j        | j        d¦  «        d¦  «        S )zˆ
    Return a predicate representing whether a *value* is not equal to zero.
    (not exactly "not is_scalar_zero" because of nans)
    r   ©rµ  r¢  r¸  Úfcmp_unorderedr   s     r   Úis_not_scalar_zeror¾  /  ó2   € õ
 %Ø��	Ô)¨'Ô*@À$ÑGÔGÈñOô Oð Or   c                 óV   — t          | |t          j        | j        d¦  «        d¦  «        S )z]
    Return a predicate representing whether *value* is equal to either zero
    or NaN.
    r  r¼  r   s     r   Úis_scalar_zero_or_nanrÁ  8  r¿  r   c                 óV   — t          | |t          j        | j        d¦  «        d¦  «        S )z:
    Is *value* negative?  Assumes *value* is signed.
    r9  r·  r   s     r   Úis_scalar_negrÃ  E  s2   € õ %Ø��	Ô)¨'Ô*>ÀÑDÔDÀcñKô Kð Kr   Ústackc              #   óÊ   K  — |                      |                      |d¬¦  «        ¦  «        \  }}|5  dV — ddd¦  «         n# 1 swxY w Y   |                      |¦  «         dS )a¤  
    The Python code::

        with contextlib.ExitStack() as stack:
            with early_exit_if(builder, stack, cond):
                cleanup()
            body()

    emits the code::

        if (cond) {
            <cleanup>
        }
        else {
            <body>
        }

    This can be useful for generating code with lots of early exits, without
    having to increase the indentation each time.
    Fr  N)Úenter_contextrV  )r   rÄ  rS  rZ  r[  s        r   Úearly_exit_ifrÇ  M  s­   è è € ð, ×)Ò)¨'¯/ª/¸$Àu¨/Ñ*MÔ*MÑNÔN�O€Dˆ)Ø	ð ð Øˆˆˆðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð à	×Ò˜	Ñ"Ô"Ð"Ð"Ð"s   ²AÁAÁ
Ac                 ó@   — t          | |t          | |¦  «        ¦  «        S )z’
    A convenience wrapper for :func:`early_exit_if`, for the common case where
    the CPython API indicates an error by returning ``NULL``.
    )rÇ  r  )r   rÄ  Úobjs      r   Úearly_exit_if_nullrÊ  i  s    € õ
 ˜ %­°¸#Ñ)>Ô)>Ñ?Ô?Ð?r   c                 óâ   — |                      t          ||¦  «        d¬¦  «        5  |d         }|dd…         pd}| j                             |||¦  «         ddd¦  «         dS # 1 swxY w Y   dS )zu
    Guard against *value* being null or zero.
    *exc_tuple* should be a (exception type, arguments...) tuple.
    Fr  r   r
   N)r"  rº  r“  r”  )rl   r   r   Ú	exc_tupleÚexcÚexc_argss         r   Ú
guard_nullrÏ  q  sÒ   € ð
 
�Š�¨°Ñ7Ô7ÀˆÑ	FÔ	Fð Bð BØ˜ŒlˆØ˜Q˜R˜R”=Ð( DˆØÔ×)Ò)¨'°3¸ÑAÔAÐAðBð Bð Bñ Bô Bð Bð Bð Bð Bð Bð Bð Bøøøð Bð Bð Bð Bð Bð Bs   ¦1A$Á$A(Á+A(c                 ó.  — t          |j        t          j        ¦  «        sJ |j        ¦   «         ‚|r|fnd}|                     t          ||¦  «        d¬¦  «        5  | j                             |t          |¦  «         ddd¦  «         dS # 1 swxY w Y   dS )zG
    Guard against *pointer* being NULL (and raise a MemoryError).
    r   Fr  N)	rY   r   r   ÚPointerTyper"  r  r“  r”  ÚMemoryError)rl   r   Úpointerr–  rÎ  s        r   Úguard_memory_errorrÔ  |  së   € õ �g”l¥B¤NÑ3Ô3ÐAÐA°W´\ÑAÔAÐ3ØÐ$�ˆvˆv "€HØ	�Š� ¨'Ñ2Ô2¸5ˆÑ	AÔ	Að Jð JØÔ×)Ò)¨'µ;ÀÑIÔIÐIðJð Jð Jñ Jô Jð Jð Jð Jð Jð Jð Jð Jøøøð Jð Jð Jð Jð Jð Js   Á"B
Â
BÂBc              #   óŽ   K  — |                       t          | |¦  «        |¬¦  «        5  dV — ddd¦  «         dS # 1 swxY w Y   dS )z>
    Execute the given block if the scalar value is zero.
    r  N)r"  rº  )r   r   r   s      r   Úif_zerorÖ  †  s•   è è € ð
 
�Š�¨°Ñ7Ô7ÀˆÑ	GÔ	Gð ð Øˆˆˆðð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð ð s   ¨:º>Á>c                 ó6   — t          | t          j        ¦  «        S )z7
    Whether the LLVM type *typ* is a struct type.
    )rY   r   rÑ  )Últyps    r   rc   rc   ’  s   € õ �d�BœNÑ+Ô+Ð+r   c                 ó¬   — t          | |d|¦  «        }t          |j        j        ¦  «        rJ ‚|                      ||                     ¦   «         ¦  «        S r‚   )rƒ   rc   r   re   rÌ   rg   )r   Úrecordrï   ÚtypÚpvals        r   Úget_record_memberrÝ  ™  sL   € Ý˜ ¨¨FÑ3Ô3€DÝ˜$œ)Ô+Ñ,Ô,Ð,Ð,Ð,Ø�?Š?˜4 §¢Ñ!1Ô!1Ñ2Ô2Ð2r   c                 óV   — |                       d||                     d¦  «        ¦  «        S )Nr9  r   )r=  r   )r   r}   s     r   Ú
is_neg_intrß  Ÿ  s$   € Ø×Ò˜s C¨¯ª°!©¬Ñ5Ô5Ð5r   c                 ó(   — t          | |g|¢R ddi|¤ŽS )z8
    Same as *gep*, but add the `inbounds` keyword.
    rÕ   T)rÖ   )r   rž   rƒ  Úkwss       r   rƒ   rƒ   £  s)   € õ ˆw˜Ð9˜dÐ9Ð9Ð9¨TÐ9°SÐ9Ð9Ð9r   c                 ó  — |                      dd¦  «        }|                      dd¦  «        }|rJ ‚g }|D ]>}t          |t          ¦  «        rt          |¦  «        }n|}|                     |¦  «         Œ?|                      ||||¬¦  «        S )z‰
    Emit a getelementptr instruction for the given pointer and indices.
    The indices can be LLVM values or Python int constants.
    rä   rá   rÕ   F)rä   rÕ   )rK   rY   rå   rÐ   rÑ   rÖ   )	r   rž   rƒ  rá  rä   rÕ   Úidxr'   r�  s	            r   rÖ   rÖ   ª  s–   € ð
 �7Š7�6˜2ÑÔ€DØ�wŠw�z 5Ñ)Ô)€HØ€N€Nˆ7Ø
€CØð ð ˆÝ�a�ÑÔð 	å˜!‘*”*ˆCˆCàˆCØ�
Š
�3‰ŒˆˆØ�;Š;�s˜C d°Xˆ;Ñ>Ô>Ð>r   c                 ó  — t          |t          ¦  «        rt          |¦  «        }|                      |t                               ¦   «         ¦  «        }|                      ||g¦  «        }|                      ||p|j        ¦  «        S )ax  
    Add an integral *offset* to pointer *ptr*, and return a pointer
    of *return_type* (or, if omitted, the same type as *ptr*).

    The computation is done in bytes (ignoring the width of the pointed
    item type) via a byte-wise getelementptr, so the result keeps the
    provenance of *ptr*. Only valid when *offset* stays within the object
    *ptr* points into.
    )rY   rå   ræ   rÌ   Úint8_trg   rÖ   r   )r   rž   rï   Úreturn_typerB   Úaddrs         r   r¤  r¤  ½  sp   € õ �&�#ÑÔð  Ý˜‘”ˆØ�?Š?˜3¥× 1Ò 1Ñ 3Ô 3Ñ4Ô4€DØ�;Š;�t˜f˜XÑ&Ô&€DØ�?Š?˜4 Ð!8°´Ñ9Ô9Ð9r   c           	      ó   — | j                              dt          |j        f¦  «        }|                      |t          ¦  «        }t          |t          ¦  «        rt          |¦  «        }|                      ||||t          d¦  «        g¦  «         dS )z=
    Fill *size* bytes starting from *ptr* with *value*.
    zllvm.memsetr   N)
rû   Údeclare_intrinsicÚ	voidptr_tr   rÌ   rY   rå   rå  ÚcallÚbool_t)r   rž   rã   r   rý   s        r   Úmemsetrí  Î  s{   € ð 
Œ×	)Ò	)¨-½)ÀTÄYÐ9OÑ	PÔ	P€BØ
�/Š/˜#�yÑ
)Ô
)€CÝ�%�ÑÔð Ý�u‘”ˆØ‡L‚L��c˜5 $­¨q©	¬	Ð2Ñ3Ô3Ð3Ð3Ð3r   c                 ó¦   — |                       |¦  «        }t          | |t          | |j        ¦  «        d¦  «         |                      ||¦  «         dS )z7
    Fill padding bytes of the pointee with zeros.
    r   N)r™   rí  rð   r   rh   )r   rž   r}   s      r   Úmemset_paddingrï  Ù  sO   € ð
 �,Š,�sÑ
Ô
€Cå
ˆ7�C� ¨¬Ñ2Ô2°AÑ6Ô6Ð6à‡M‚M�#�sÑÔÐÐÐr   Úinternalc                 ó¤   — t          | t          j        ¦  «        r| }n| j        }t	          ||j        |¦  «        }||_        d|_        ||_        |S )zO
    Get or create a (LLVM module-)global constant with *name* or *value*.
    T)	rY   r   ÚModulerû   r  r   ÚlinkageÚglobal_constantÚinitializer)Úbuilder_or_modulerä   r   ró  rû   r4   s         r   rô  rô  å  sW   € õ Ð#¥R¤YÑ/Ô/ð *Ø"ˆˆà"Ô)ˆÝ˜v u¤z°4Ñ8Ô8€DØ€D„LØ€DÔØ€DÔØ€Kr   c                 óþ  — |dk    sJ ‚|                      |¦  «        }|                      d¦  «        }t          | |j         ¦  «        }|                      t          | |¦  «        ¦  «        5 \  }}|5  |                      ||¦  «        }|                      ||¦  «         ddd¦  «         n# 1 swxY w Y   |5  |                      ||¦  «        }|                      ||¦  «        }|                      |                      ||¦  «        |¦  «         ddd¦  «         n# 1 swxY w Y   ddd¦  «         n# 1 swxY w Y   |                      |¦  «        }|                      ||  	                    ||¦  «        ¦  «        }	||	fS )a  
    Compute the (quotient, remainder) of *val* divided by the constant
    positive *divisor*.  The semantics reflects those of Python integer
    floor division, rather than C's / LLVM's signed division and modulo.
    The difference lies with a negative *val*.
    r   r
   N)
r   rs   rV  rß  Úsdivrh   rù   Úsubr™   r�  )
r   r}   Údivisorr.  ÚquotÚif_negÚif_posÚquot_valÚval_plus_oneÚrem_vals
             r   Údivmod_by_constantr  ô  s  € ð �QŠ;ˆ;ˆ;ˆ;Ø�hŠh�wÑÔ€GØ
�(Š(�1‰+Œ+€Cå�w ¤Ñ)Ô)€Dà	�Š� G¨SÑ1Ô1Ñ	2Ô	2ð 	<Ñ6F°v¸vØð 	*ð 	*à—|’| C¨Ñ1Ô1ˆHØ�MŠM˜( DÑ)Ô)Ð)ð	*ð 	*ð 	*ñ 	*ô 	*ð 	*ð 	*ð 	*ð 	*ð 	*ð 	*øøøð 	*ð 	*ð 	*ð 	*ð ð 	<ð 	<à"Ÿ;š; s¨CÑ0Ô0ˆLØ—|’| L°'Ñ:Ô:ˆHØ�MŠM˜'Ÿ+š+ h°Ñ4Ô4°dÑ;Ô;Ð;ð		<ð 	<ð 	<ñ 	<ô 	<ð 	<ð 	<ð 	<ð 	<ð 	<ð 	<øøøð 	<ð 	<ð 	<ð 	<ð	<ð 	<ð 	<ñ 	<ô 	<ð 	<ð 	<ð 	<ð 	<ð 	<ð 	<øøøð 	<ð 	<ð 	<ð 	<ð �|Š|˜DÑ!Ô!€HØ�kŠk˜#˜wŸ{š{¨8°WÑ=Ô=Ñ>Ô>€GØ�WÐÐs[   Á+D1Á1-B*ÂD1Â*B.	Â.D1Â1B.	Â2D1Â7ADÄD1ÄD	ÄD1Ä!D	Ä"D1Ä1D5Ä8D5c                 óˆ   — |                       d¦  «        }|                      |||¦  «         |                      |¦  «         |S )z‰
    Branch conditionally or continue.

    Note: a new block is created and builder is moved to the end of the new
          block.
    z	.continue)r:  r>  r@  )r   rS  ÚbbtrueÚbbconts       r   Úcbranch_or_continuer    sF   € ð ×'Ò'¨Ñ4Ô4€FØ‡O‚O�D˜& &Ñ)Ô)Ð)Ø×Ò˜FÑ#Ô#Ð#Ø€Mr   c                 óL  — |j         |j         k    sJ ‚t          | ||j         ¬¦  «        5 }|                      ||j        g¦  «        }|                      ||j        g¦  «        }|                      |                      |¦  «        |¦  «         ddd¦  «         dS # 1 swxY w Y   dS )zÛ
    Emit a memcpy to the builder.

    Copies each element of dst to src. Unlike the C equivalent, each element
    can be any LLVM type.

    Assumes
    -------
    * dst.type == src.type
    * count is positive
    rn  N)r   rI  rÖ   r|   rh   r™   )r   rO   rP   rA  ro  Úout_ptrÚin_ptrs          r   Úmemcpyr	     sß   € ð Œ8�s”xÒÐÐÐÝ	�7˜E¨¬
Ð	3Ñ	3Ô	3ð 5°tØ—+’+˜c D¤J <Ñ0Ô0ˆØ—’˜S 4¤: ,Ñ/Ô/ˆØ�Š�g—l’l 6Ñ*Ô*¨GÑ4Ô4Ð4ð5ð 5ð 5ñ 5ô 5ð 5ð 5ð 5ð 5ð 5ð 5ð 5øøøð 5ð 5ð 5ð 5ð 5ð 5s   ªA"BÂBÂ Bc           	      ó†  — |j         }t          |t          ¦  «        rt          j        ||¦  «        }| j                             |t          t          |g¦  «        }t          }	|  	                    ||  
                    |t          ¦  «        |  
                    |t          ¦  «        |                      ||¦  «        |	g¦  «         d S ru   )r   rY   rå   r   r,   rû   ré  rê  Ú	false_bitrë  rÌ   r�  )
r   Ú	func_namerO   rP   rA  ÚitemsizeÚalignÚsize_tr	  Úis_volatiles
             r   Ú_raw_memcpyr  5  s²   € ØŒZ€FÝ�(�CÑ Ô ð 1Ý”;˜v xÑ0Ô0ˆàŒ^×-Ò-¨iÝ/8½)ÀVÐ.LñNô N€Få€KØ‡L‚L�˜'Ÿ/š/¨#­yÑ9Ô9Ø!Ÿ/š/¨#­yÑ9Ô9Ø!Ÿ+š+ e¨XÑ6Ô6Ø%ð'ñ (ô (ð (ð (ð (r   c           	      ó,   — t          | d|||||¦  «        S )za
    Emit a raw memcpy() call for `count` items of size `itemsize`
    from `src` to `dest`.
    zllvm.memcpy©r  ©r   rO   rP   rA  r  r  s         r   Ú
raw_memcpyr  C  s   € õ
 �w ¨s°C¸ÀÈ%ÑPÔPÐPr   c           	      ó,   — t          | d|||||¦  «        S )zb
    Emit a raw memmove() call for `count` items of size `itemsize`
    from `src` to `dest`.
    zllvm.memmover  r  s         r   Úraw_memmover  K  s%   € õ
 �w °°S¸%Ø ñ(ô (ð (r   c                 ó:  — |                       ||¦  «        }|                      |d¦  «        }|                      |d¦  «        }|                      ||¦  «        }|                      |d¦  «        }|                      ||                      |d¦  «        ¦  «        }	||	fS )zq
    Compute (a * b + c) and return a (result, overflow bit) pair.
    The operands must be signed integers.
    r   r
   )Úsmul_with_overflowrz  Úsadd_with_overflowÚor_)
r   Úar0   ÚcÚpÚprodÚprod_ovfrž  rA   Úovfs
             r   Úmuladd_with_overflowr"  T  s™   € ð
 	×"Ò" 1 aÑ(Ô(€AØ× Ò   AÑ&Ô&€DØ×$Ò$ Q¨Ñ*Ô*€HØ×"Ò" 4¨Ñ+Ô+€AØ
×
Ò
  1Ñ
%Ô
%€CØ
�+Š+�h × 5Ò 5°a¸Ñ ;Ô ;Ñ
<Ô
<€CØ�ˆ8€Or   c                 óè  — t          |t          ¦  «        sJ ‚| j        }t          }t	          |dz                        d¦  «        ¦  «        }t          |d|¦  «        }t          j        t          |gd¬¦  «        }	 | 
                    d¦  «        }n'# t          $ r t          j        ||d¬¦  «        }Y nw xY w|                      ||¦  «        }	|                      ||	gt          |¦  «        z   ¦  «        S )a  
    Calls printf().
    Argument `format` is expected to be a Python string.
    Values to be printed are listed in `args`.

    Note: There is no checking to ensure there is correct number of values
    in `args` and there type matches the declaration in the format string.
    ú ÚasciiÚprintf_formatT©Úvar_argr�  r8  )rY   r<   rû   rê  r2   Úencoderô  r   ÚFunctionTyperÐ   Ú
get_globalr  r  rÌ   rë  Úlist)
r   r_   ÚargsÚmodÚcstringÚ	fmt_bytesÚ
global_fmtrü   rý   Úptr_fmts
             r   r�  r�  b  sñ   € õ �f�cÑ"Ô"Ð"Ð"Ð"Ø
Œ.€Cå€GÝ ¨¡×6Ò6°wÑ?Ô?Ñ@Ô@€IÝ   o°yÑAÔA€JÝŒ?�7 W I°tÐ<Ñ<Ô<€Dð3Ø�^Š^˜HÑ%Ô%ˆˆøÝð 3ð 3ð 3ÝŒ[˜˜d¨Ð2Ñ2Ô2ˆˆˆð3øøøð �oŠo˜j¨'Ñ2Ô2€GØ�<Š<˜˜W˜I­¨T©
¬
Ñ2Ñ3Ô3Ð3s   Á:B Â!B4Â3B4c                 ó   — t          |t          ¦  «        sJ ‚| j        }t          }t	          |dz                        d¦  «        ¦  «        }t          |d|¦  «        }t          j        t          |t          |gd¬¦  «        }	d}
t          j        rd|
z   }
	 |                     |
¦  «        }n'# t          $ r t          j        ||	|
¬¦  «        }Y nw xY w|                      ||¦  «        }|                      ||||gt%          |¦  «        z   ¦  «        S )	z8Calls libc snprintf(buffer, bufsz, format, ...args)
    r$  r%  Úsnprintf_formatTr'  Úsnprintfr5   r8  )rY   r<   rû   rê  r2   r)  rô  r   r*  rÐ   ræ   r   ÚIS_WIN32r+  r  r  rÌ   rë  r,  )r   ÚbufferÚbufszr_   r-  r.  r/  r0  r1  rü   Úsymbolrý   r2  s                r   r5  r5  |  s  € õ �f�cÑ"Ô"Ð"Ð"Ð"Ø
Œ.€Cå€GÝ ¨¡×6Ò6°wÑ?Ô?Ñ@Ô@€IÝ  Ð&7¸ÑCÔC€JÝŒ?Ý�'�6 7Ð+°Tðñ ô €Dð €FÝ„ð Ø�v‘ˆð1Ø�^Š^˜FÑ#Ô#ˆˆøÝð 1ð 1ð 1ÝŒ[˜˜d¨Ð0Ñ0Ô0ˆˆˆð1øøøð �oŠo˜j¨'Ñ2Ô2€GØ�<Š<˜˜V U¨GÐ4µt¸D±z´zÑAÑBÔBÐBs   ÂB* Â*!CÃCc                 ó  — t          |t          ¦  «        sJ ‚t          j        t          j        d¦  «        |¦  «        }t          | |d¬¦  «        }|                      |t          ¦  «        }t          | |t          |¦  «        |g|¢R Ž  |S )z{Similar to `snprintf()` but the buffer is stack allocated to size
    *bufsz*.

    Returns the buffer pointer as i8*.
    r   Trq   )
rY   rå   r   r-   r.   rs   rÌ   rê  r5  ræ   )r   r8  r_   r-  ÚspacetyÚspacer7  s          r   Úsnprintf_stackbufferr=  –  s�   € õ �e�SÑ!Ô!Ð!Ð!Ð!ÝŒl�2œ: a™=œ=¨%Ñ0Ô0€GÝ˜ °Ð5Ñ5Ô5€EØ�_Š_˜U¥IÑ.Ô.€FÝˆW�f�f U™mœm¨VÐ;°dÐ;Ð;Ð;Ð;Ø€Mr   c                 óR   — |                       d¦  «                             d¦  «        S )zk
    Normalize the given string to latin1 compatible encoding that is
    suitable for use in LLVM IR.
    Úutf8Úlatin1)r)  Údecode)Útexts    r   Únormalize_ir_textrC  ¤  s$   € ð �;Š;�vÑÔ×%Ò% hÑ/Ô/Ð/r   c                 óâ  — d}|                       |t          ¦  «        }t          | d||¦  «         t          j        d¦  «        }|                      ||                     ¦   «         ¦  «        }t          | |¦  «        5 }|                      |j	        t          |¦  «        ¦  «        }|  
                    d|t          d¦  «        ¦  «        }|                      |¦  «        5  t          | d¦  «         ddd¦  «         n# 1 swxY w Y   |                      ||j	        g¦  «        }|                      |¦  «        }	t          | d|	¦  «         ddd¦  «         n# 1 swxY w Y   t          | d¦  «         dS )	zIDebug print the memory region in *ptr* to *ptr + nbytes*
    as hex.
    é   zhexdump p=%p n=%zur   r  r   ú
Nz %02x)Úzextræ   r�  r   r.   rÌ   rg   rI  Úuremr|   r   r"  rÖ   r™   )
r   rž   ÚnbytesÚbytes_per_lineÚbyte_trã  Údiv_byÚdo_new_linerï   r}   s
             r   ÚhexdumprN  ­  sË  € ð €NØ�\Š\˜&¥&Ñ)Ô)€FÝ
ˆ7Ð(Ø�ñô ð åŒZ˜‰]Œ]€FØ
�/Š/˜#˜v×0Ò0Ñ2Ô2Ñ
3Ô
3€Cå	�7˜FÑ	#Ô	#ð & sØ—’˜cœi­°Ñ)?Ô)?Ñ@Ô@ˆØ×+Ò+¨D°&½&À¹)¼)ÑDÔDˆØ�_Š_˜[Ñ)Ô)ð 	"ð 	"Ý�7˜DÑ!Ô!Ð!ð	"ð 	"ð 	"ñ 	"ô 	"ð 	"ð 	"ð 	"ð 	"ð 	"ð 	"øøøð 	"ð 	"ð 	"ð 	"ð —’˜S 3¤9 +Ñ.Ô.ˆØ�lŠl˜6Ñ"Ô"ˆÝˆw˜ Ñ%Ô%Ð%ð&ð &ð &ñ &ô &ð &ð &ð &ð &ð &ð &øøøð &ð &ð &ð &õ ˆ7�DÑÔÐÐÐs8   Á<A"EÃC;Ã/EÃ;C?	Ã?EÄC?	ÄAEÅEÅEc                 ór   — | du p3t          | t          j        ¦  «        pt          | t          j        ¦  «        S )z returns if 'ty' is none N)rY   r   ÚNoneTypeÚOmitted©rê   s    r   Úis_nonelikerS  Ä  s8   € ð 	ˆdˆ
ð 	&Ý�2•u”~Ñ&Ô&ð	&å�2•u”}Ñ%Ô%ðr   c                 óf   — t          | t          j        ¦  «        ot          | j        ¦  «        dk    S )z# returns if 'ty' is an empty tuple r   )rY   r   ÚTupler+   rR  s    r   Úis_empty_tuplerV  Í  s-   € õ 	�2•u”{Ñ#Ô#ð 	ÝˆBŒH‰Œ˜Òðr   c                 ól   — t          j        t          j        | t          |¦  «        ¦  «        |¦  «        S )z�
    Create an LLVM-constant of a fixed-length array from Python values.

    The type provided is the type of the elements.
    )r   r,   r-   r+   )rê   r}   s     r   Úcreate_constant_arrayrX  Õ  s(   € õ Œ;•r”| B­¨C©¬Ñ1Ô1°3Ñ7Ô7Ð7r   ru   )r   )Nrá   F)rá   F)r   r°   )NT)r]  )FF)F)rð  )r
   )gr³   ÚcollectionsÚ
contextlibr   r   r¢  Úllvmliter   Ú
numba.corer   r   r   r	   Únumba.core.datamodelrZ   r.   rì  rå  rÐ   ÚMACHINE_BITSræ   rg   rê  Útrue_bitr  Ú	true_byteÚ
false_byter   r(   r2   r7   rF   rS   ÚobjectrU   r9   r:   rÈ   rs   rð   ró   rþ   r÷   r  r  r  r  r  r  r%  r'  r*  r/  Ú
namedtupler0  rI  rO  r\  rl  rg  rr  rw  r  rŠ  r™  r‡  rµ  rº  r¾  rÁ  Úis_trueÚis_falserÃ  rÇ  rÊ  rÏ  rÔ  rÖ  Ú
guard_zerorc   rÝ  rß  rƒ   rÖ   r¤  rí  rï  rô  r  r  r	  r  r  r  r"  r�  r5  r=  rC  rN  rS  rV  rX  r   r   r   ú<module>rg     sÒ  ððð ð
 Ð Ð Ð Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø Ð Ð Ð à Ð Ð Ð Ð Ð à 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ø Ð Ð Ð ð 
ˆŒ�A‰Œ€Ø	ˆŒ�A‰Œ€Ø
ˆ"Œ*�R‰.Œ.€Ø	ˆŒ�EÔ&Ñ	'Ô	'€Ø×ÒÑÔ€	àˆ6�!‰9Œ9€ØˆF�1‰IŒI€	ØˆF�1‰IŒI€	ØˆV�A‰YŒY€
ð=ð =ð =ð	ð 	ð 	ð 	ð:ð :ð :ð Ð ðð ð ð ð&ð ð ð ð"B0ð B0ð B0ð B0ð B0�6ñ B0ô B0ð B0ðJð ð ð ð �|ñ ô ð ð1ð 1ð 1ð 1ð 1�lñ 1ô 1ð 1ð g0ð g0ð g0ð g0ð g0�ñ g0ô g0ð g0ðXð ð ð ð2,ð ,ð ,ðð ð ð ðð ð ðð ð ð/ð /ð /ðAð Að Að Að
ð ð ðð ð ð2ð 2ð 2ð
2ð 2ð 2ð
/ð /ð /ð.ð .ð .ð/ð /ð /ð0ð 0ð 0ð €{Ô˜fÐ&;Ñ<Ô<€ð ð(#ð (#ð (#ñ „ð(#ðV ð6#ð 6#ð 6#ñ „ð6#ðr ðNð Nñ „ðNð: ð!ð !ð !ñ „ð!ð6 ð ð  ñ „ð ðð ð ð ðð ð ð	ð 	ð 	ð 	ð EJØ!&ð	Mð 	Mð 	Mð 	MðGð Gð Gð Gð> 5:ð72ð 72ð 72ð 72ðtð ð ðMð Mð MðOð Oð OðOð Oð Oð €Ø€ðKð Kð Kð ð# )ð #ð #ð #ñ „ð#ð6@ð @ð @ðBð Bð BðJð Jð Jð Jð ðð ð ñ „ðð €
ð,ð ,ð ,ð3ð 3ð 3ð6ð 6ð 6ð:ð :ð :ð?ð ?ð ?ð&:ð :ð :ð :ð"4ð 4ð 4ð	ð 	ð 	ðð ð ð ðð ð ð>
ð 
ð 
ð5ð 5ð 5ð*(ð (ð (ðQð Qð Qð Qð(ð (ð (ð (ðð ð ð4ð 4ð 4ð4Cð Cð Cð4ð ð ð0ð 0ð 0ðð ð ð.ð ð ðð ð ð8ð 8ð 8ð 8ð 8r   