U
    {±Ëh†  ã                   @   s   ddd„Z ddd„ZdS )	Údigitsúunsigned longc                    s2   d| d  d  ‡ ‡fdd„t| d ddƒD ƒ¡ S )z¤
    Generate an unrolled shift-then-or loop over the first 'count' digits.
    Assumes that they fit into 'join_type'.

    (((d[2] << n) | d[1]) << n) | d[0]
    ú(é   ú | c                 3   s&   | ]}d ˆˆ ||rdndf V  qdS )z(%s)%s[%d])%s)z << PyLong_SHIFTÚ N© )Ú.0Z_i©Ú
digits_ptrÚ	join_typer   ú;/tmp/pip-unpacked-wheel-fhl22ezh/Cython/Utility/__init__.pyÚ	<genexpr>   s   ÿzpylong_join.<locals>.<genexpr>é   éÿÿÿÿ©ÚjoinÚrange©Úcountr
   r   r   r	   r   Úpylong_join   s    þr   c                    s8   ‡fdd„‰dd  ‡ ‡‡fdd„t| d ddƒD ƒ¡ S )	z 
    Generate an or-ed series of shifts for the first 'count' digits.
    Assumes that they fit into 'join_type'.

    (d[2] << 2*n) | (d[1] << 1*n) | d[0]
    c                    s   | rd| ˆ | f S dS )Nz@ << (%d * PyLong_SHIFT < 8 * sizeof(%s) ? %d * PyLong_SHIFT : 0)r   r   )Ún)r   r   r   Úshift   s    z_pylong_join.<locals>.shiftz(%s)r   c                 3   s"   | ]}d ˆˆ |ˆ|ƒf V  qdS )z(((%s)%s[%d])%s)Nr   )r   Úi©r
   r   r   r   r   r      s   ÿz_pylong_join.<locals>.<genexpr>r   r   r   r   r   r   r   Ú_pylong_join   s    þr   N)r   r   )r   r   )r   r   r   r   r   r   Ú<module>   s   
