
    sh                     `    S r SSKJrJr  SSKJr  SSKJr  \S 5       r\S 5       r	\S 5       r
g)	z>This module provides the unsafe things for targets/numbers.py
    )typeserrors)	intrinsic)irc                   ^ UR                   n[        UR                  [        R                  5      (       a  [
        R                  " U5      mOa[        UR                  [        R                  5      (       a1  US:X  a  [
        R                  " 5       O[
        R                  " 5       mO S5       eU4S jnUR                  nU" X5      nXd4$ )z3Bitcast a scalar 'val' to the given type 'viewty'.     unreachablec                 2   > US   nUR                  UT5      $ )Nr   )bitcast)cgctxbuildertypargsflt	bitcasttys        p/Users/tiagomarins/Projetos/claudeai/copy_bank/venv/lib/python3.13/site-packages/numba/cpython/unsafe/numbers.pycodegenviewer.<locals>.codegen   s    1gsI..    )
bitwidth
isinstancedtyper   Integerr   IntTypeFloat	FloatType
DoubleType)tyctxvalviewtybitsr   rettysigr   s          @r   viewerr$   	   s     <<D&,,..JJt$		FLL%++	.	.&*bjBLLNbmmo	-q/ LLE

C<r   c                     [        U[        R                  5      (       d  SU S3n[        R                  " U5      eS nU" U5      U4$ )zACounts trailing zeros in the binary representation of an integer.zCtrailing_zeros is only defined for integers, but value passed was ''.c                     Uu  nUR                  U[        R                  " [        R                  " S5      S5      5      $ N   r   )cttzr   Constantr   contextr   	signaturer   srcs        r   r   trailing_zeros.<locals>.codegen$   -    ||CRZZ]A!>??r   r   r   r   r   NumbaTypeError
typeingctxr/   msgr   s       r   trailing_zerosr7      P     c5==))e2##C((@ s8Wr   c                     [        U[        R                  5      (       d  SU S3n[        R                  " U5      eS nU" U5      U4$ )z@Counts leading zeros in the binary representation of an integer.zBleading_zeros is only defined for integers, but value passed was 'r&   c                     Uu  nUR                  U[        R                  " [        R                  " S5      S5      5      $ r(   )ctlzr   r+   r   r,   s        r   r   leading_zeros.<locals>.codegen2   r1   r   r2   r4   s       r   leading_zerosr=   *   r8   r   N)__doc__
numba.corer   r   numba.core.extendingr   llvmliter   r$   r7   r=    r   r   <module>rC      sO    $ *   $ 
 
 
 
r   