+
    :i0                     
   R t ^ RIt^ RIHtHt ^ RIt^ RIHt ^ RIH	t	H
t
HtHt ^ RIt]P                  ! ^4      t]P                  ! ^4      t]P                  ! ^ 4      t]P                  ! ]	P&                  4      t]P+                  4       t]! ^4      t]! ^ 4      t]! ^4      t]! ^ 4      tR tRPR ltR t/ tRQR ltRPR	 lt  ! R
 R]!4      t" ! R R]"4      t# ! R R]"4      t$ ! R R]!4      t%RRR lt&R t'RSR lt(R t)R t*R t+RTR lt,R t-R t.R t/R t0R t1R t2R t3R  t4]Pj                  ! R!RU4      t6]RVR" l4       t7]RWR# l4       t8]R$ 4       t9]RXR% l4       t:]R& 4       t;RPR' lt<R( t=RPR) lt>RYR* lt?RPR+ lt@RYR, ltAR- tBR. tCR/ tDR0 tE]DtF]CtGR1 tH]R2 R3 l4       tIR4 tJR5 tKRPR6 ltL]RZR7 l4       tM]KtNR8 tOR9 tPR: tQR; tRR< tSRPR= ltTR> tUR? tVR[R@ ltWRA tXRB tYRC tZRD t[R\RE lt\R\RF lt]RG t^RH t_RI t`RJ taRK tbRL tcRM tdRN teRO tfR# )]z+
Generic helpers for LLVM code generation.
N)contextmanager	ExitStack)ir)utilstypesconfig	debuginfoc                 D    V P                  R WP                  ^ 4      4      # !=)icmp_unsignedtypebuildervalues   &&P/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/core/cgutils.pyas_bool_bitr      s      ujjm<<    c                    Vf0   \         P                  ! V Uu. uF  q3P                  NK  	  up4      pV! \         P                  4      p\	        V4       F  w  rSV P                  WCV4      pK  	  V# u upi )z@
Create an anonymous struct containing the given LLVM *values*.
r   LiteralStructTyper   	Undefined	enumerateinsert_value)r   valuesstruct_typev
struct_valis   &&&   r   make_anonymous_structr       sh     **F+CFqFFF+CDR\\*J&!))*;
 "	 ,Ds   A2c                    \        V 4      p\        V4      p\        P                  ! \        P                  ! \        P
                  ! ^4      V4      V4      # )z(
Make a byte array constant from *buf*.
)	bytearraylenr   Constant	ArrayTypeIntType)bufbns   &  r   make_bytearrayr)   ,   s:     	#AAA;;r||BJJqM15q99r   c                    W3p\         P                  V4      pVf]   R\        R\        /V,          pVP                  R,           \        V 4      ,           pV3p\        V R7      p\        WVV4      pV\         V&   V# )zC
Returns a specialized StructProxy subclass for the given fe_type.
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_proxyr=   8   s     I

!
!)
,C
{) --#%G47+
7:.),I&Jr   c                   Vf   / pVP                  4       pVP                  P                   F*  pVP                  V\	        W4      4      p\        WV4       K,  	  VP                  4        F  w  r4\        WV4       K  	  V # )zB
Copy structure from *src* to *dst* with replacement from *repl*.
)copy
_datamodel_fieldspopgetattrsetattritems)dstsrcreplkr   s   &&&  r   copy_structrJ   K   sn     |99;D^^##HHQ( $ 

 Jr   c                      a a ] tR t^\t oRtRtRR ltR tR tR t	R t
R tR	 tR
 tV 3R ltR tR tR tR tR tR tRtVtV ;t# )_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                   Wn         V P                   P                  V P                  ,          V n        \	        V P                  \
        P                  P                  P                  4      '       g%   \        R P                  V P                  4      4      hW n        V P                  V P                  4      V n        \        V P                  4      '       d   Q hV P                  V4      w  rTVP                   P"                  V P                  8w  d6   \%        RV P                  P'                  4       : RVP                   : 24      hVer   VP                   VP                   P"                  8w  d2   \%        RVP                   P"                  : RVP                   : 24      hV P                  P)                  W54       W@n        WPn        R# )zNot a structure model: {0}zbad ref type: expected z, got Nzbad value type: expected )_contextdata_model_managerr-   r@   
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___StructProxy.__init__e   sF   --::4==I$//5::+?+?+K+KLL,33DOODF F))$//:dmm,,,,-	88t}}, $(MM$<$<$>"J K K zzY^^333$(1(>(>

&L M MMM1#r   c                T    Vf#   \        V P                  V P                  RR7      pW3# )zy
Return an (outer ref, value ref) pair.  By default, these are
the same pointers, but a derived class may override this.
Tzfill)alloca_oncerW   rY   )rb   rd   s   &&r   r[   _StructProxy._make_refs~   s&    
 ;dmmT]]$GCxr   c                    \         hNNotImplementedErrorrb   rS   s   &&r   rX   _StructProxy._get_be_type       !!r   c                    \         hrn   ro   rb   indexvals   &&&r   _cast_member_to_value"_StructProxy._cast_member_to_value   rs   r   c                    \         hrn   ro   ru   s   &&&r   _cast_member_from_value$_StructProxy._cast_member_from_value   rs   r   c                F    \        V P                  V P                  ^ V4      #     )gep_inboundsrW   r`   rb   rv   s   &&r   _get_ptr_by_index_StructProxy._get_ptr_by_index   s    DMM4;;5AAr   c                Z    V P                   P                  V4      pV P                  V4      # rn   )r@   get_field_positionr   )rb   attrnamerv   s   && r   _get_ptr_by_name_StructProxy._get_ptr_by_name   s'    228<%%e,,r   c                    VP                  R4      '       g"   W P                  P                  V4      ,          # \        V4      hz+
Load the LLVM value of the named *field*.
r,   )
startswithr@   r   AttributeErrorrb   fields   &&r   __getattr___StructProxy.__getattr__   s8     $$::5ABB ''r   c                   < VP                  R4      '       d   \        \        V `  W4      # W V P                  P                  V4      &   R# z0
Store the LLVM *value* into the named *field*.
r,   N)r   superrL   __setattr__r@   r   rb   r   r   	__class__s   &&&r   r   _StructProxy.__setattr__   s?     C  t8FF:?T__//67r   c                x    V P                   P                  V P                  V4      4      pV P                  W4      # z.
Load the LLVM value of the field at *index*.
)rW   loadr   rx   )rb   rv   
member_vals   && r   __getitem___StructProxy.__getitem__   s4     ]]''(>(>u(EF
))%<<r   c           	        V P                  V4      pV P                  W4      pVP                  VP                  P                  8w  d   \	        VP                  4      '       d   \	        VP                  P                  4      '       d   VP                  P                  VP                  P                  P                  8X  dG   V P
                  P                  V P                  VVP                  P                  P                  4      pM\        RP                  W#V VR7      4      hV P                  P                  W#4       R# )3
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   ptrrb   rv   N)r   r{   r   r\   rZ   rN   addrspacecastrW   	addrspacerU   rV   r_   )rb   rv   r   r   s   &&& r   __setitem___StructProxy.__setitem__   s     $$U+,,U:::)))5::&&:chh6F6F+G+G

**chh.>.>.F.FF 33DMM4947HH4D4D4N4NP   !D "(e4.3 "( "5	6 6 	E'r   c                .    V P                   P                  # z
Return the number of fields.
)r@   field_countrb   s   &r   __len___StructProxy.__len__   s     ***r   c                    V P                   # z6
Return the LLVM pointer to the underlying structure.
)ra   r   s   &r   _getpointer_StructProxy._getpointer   s     r   c                L    V P                   P                  V P                  4      # z=
Load and return the value of the underlying LLVM structure.
)rW   r   ra   r   s   &r   	_getvalue_StructProxy._getvalue   s     }}!!$//22r   c                    \        VP                  4      '       d   Q hVP                  V P                  8X  g   Q VP                  V P                  34       hV P                  P	                  WP
                  4       R# )z$
Store the value in this structure.
N)rZ   r   rY   rW   r_   r`   rb   r   s   &&r   	_setvalue_StructProxy._setvalue   sW     ejj))))zzT]]*GUZZ,GG*E;;/r   )rY   rW   rN   r@   ra   r`   NN)r2   
__module____qualname____firstlineno____doc__r-   rf   r[   rX   rx   r{   r   r   r   r   r   r   r   r   r   r   __static_attributes____classdictcell____classcell__r   __classdict__s   @@r   rL   rL   \   sc      H$2"""B-(@=(.+30 0r   rL   c                   6   a  ] tR t^t o RtR tR tR tRtV t	R# )r0   z`
Create a StructProxy suitable for accessing regular values
(e.g. LLVM values or alloca slots).
c                "    VP                  4       # rn   )get_value_typerq   s   &&r   rX   ValueStructProxy._get_be_type   s    ''))r   c                    V# rn    ru   s   &&&r   rx   &ValueStructProxy._cast_member_to_value       
r   c                    V# rn   r   ru   s   &&&r   r{   (ValueStructProxy._cast_member_from_value   r   r   r   N
r2   r   r   r   r   rX   rx   r{   r   r   r   s   @r   r0   r0      s     * r   r0   c                   6   a  ] tR t^t o RtR tR tR tRtV t	R# )r1   zG
Create a StructProxy suitable for accessing data persisted in memory.
c                "    VP                  4       # rn   )get_data_typerq   s   &&r   rX   DataStructProxy._get_be_type   s    &&((r   c                p    V P                   P                  V4      pVP                  V P                  V4      # rn   )r@   	get_model	from_datarW   rb   rv   rw   models   &&& r   rx   %DataStructProxy._cast_member_to_value   s+    ))%0t}}c22r   c                p    V P                   P                  V4      pVP                  V P                  V4      # rn   )r@   r   as_datarW   r   s   &&& r   r{   'DataStructProxy._cast_member_from_value   s+    ))%0}}T]]C00r   r   Nr   r   s   @r   r1   r1      s     )31 1r   r1   c                   v   a a ] tR tRt oRtRR ltR tR tR tV 3R lt	R t
R	 tR
 tR tR tR tRtVtV ;t# )	Structure   zg
A high-level object wrapping a alloca'ed LLVM structure, including
named fields and attribute access.
c                   VP                  V 4      V n        Wn        W n        Vf   \	        W P                  RR7      V n        Veq   \        VP                  4      '       d   Q hVP                  V P                  8X  g   Q VP                  V P                  34       hVP                  W0P
                  4       MVe   Q h\        VP                  4      '       g   Q hV P                  VP                  P                  8w  dd   V'       d+   VP                  W@P                  P                  4       4      pM1\        RVP                  P                  : RV P                  : 24      hW@n        / V n        . V n        . V n        \!        ^ 4      p\#        V P$                  4       FW  w  pw  rWpP                  V&   V P                  P'                  V\!        V4      34       V P                  P'                  V	4       KY  	  R # )NTri   zmismatching pointer type: got z, expected )get_struct_type_typerN   rW   rk   r`   rZ   r   r_   r\   bitcastr^   rU   _namemap_fdmap_typemapint32_tr   rA   append)
rb   rc   r   r   rd   cast_refr9   r   rI   tps
   &&&&&&    r   rf   Structure.__init__  sx   ,,T2
;%gzzFDK %ejj1111zzTZZ/I%**djj1II/e[[1= =chh''''zzSXX---!//#zz/D/D/FGC#88++TZZ9: : Kqz#DLL1JAw MM!KKgaj12MM  $ 2r   c                x    V P                   P                  V P                  V P                  V,          R R7      pV# )T)inbounds)rW   gepr`   r   )rb   rv   r   s   && r   r   Structure._get_ptr_by_index&  s/    mmT[[-?$O
r   c                F    V P                  V P                  V,          4      # rn   )r   r   )rb   r   s   &&r   r   Structure._get_ptr_by_name*  s    %%dmmH&=>>r   c                x    VP                  R4      '       g   W P                  V,          ,          # \        V4      hr   )r   r   r   r   s   &&r   r   Structure.__getattr__-  s2     $$e,-- ''r   c                   < VP                  R4      '       d   \        \        V `  W4      # W V P                  V,          &   R# r   )r   r   r   r   r   r   s   &&&r   r   Structure.__setattr__6  s9     C  D5eCC%*T]]5!"r   c                V    V P                   P                  V P                  V4      4      # r   )rW   r   r   r   s   &&r   r   Structure.__getitem__>  s$    
 }}!!$"8"8"?@@r   c                4   V P                  V4      pVP                  P                  VP                  8w  dG   Rp\        WA\	        VP                  P                  4      \	        VP                  4      3,          4      hV P
                  P                  W#4       R# )r   z:Type mismatch: __setitem__(%d, ...) expected %r but got %rN)r   r   r\   r]   r3   rW   r_   )rb   rv   r   r   fmts   &&&  r   r   Structure.__setitem__E  sy     $$U+88uzz)NC (+CHH,<,<(=(+EJJ(9 "9 : : 	E'r   c                ,    \        V P                  4      # r   )r"   r   r   s   &r   r   Structure.__len__Q  s     4==!!r   c                    V P                   # r   )r`   r   s   &r   r   Structure._getpointerW  s     {{r   c                L    V P                   P                  V P                  4      # r   )rW   r   r`   r   s   &r   r   Structure._getvalue]  s     }}!!$++..r   c                    \        VP                  4      '       d   Q hVP                  V P                  8X  g   Q VP                  V P                  34       hV P                  P	                  WP
                  4       R# )z!Store the value in this structureN)rZ   r   r   rW   r_   r`   r   s   &&r   r   Structure._setvaluec  sU    ejj))))zzTZZ'A%**djj)AA'E;;/r   )rW   rN   r   r   r   r   r`   )NNF)r2   r   r   r   r   rf   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s   @@r   r   r      sG     %>?(+A
("/0 0r   r   c           
        \        V\        4      '       d   \        P                  ! \        V4      p\
        P                  ! V 4      ;_uu_ 4        V P                  4       ;_uu_ 4        V P                  WVR7      pV P                  V! R4      V4       RRR4       V'       d,   V P                  XP                  P                  R4      V4       XuuRRR4       #   + '       g   i     LO; i  + '       g   i     R# ; i)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)rP   intr   r#   intp_tr   suspend_emissiongoto_entry_blockallocar_   r   r\   )r   tyr  r  rj   r   s   &&&&& r   rk   rk   l  s     ${{64( 
	#	#G	,	,%%''..T.:CMM"T(C( (
 MM#((**40#6 
-	,'' 
-	,	,s*   C/),C	C/%,C/C,'C//D 	c                t    V! R4      pVP                  \        ^4      .4      pV P                  V\        4      # )zCompute sizeof using GEP
    N)r   r   ptrtointr  )r   ptr_typenulloffsets   &&  r   sizeofr    s4     D>DXXwqzl#FFF++r   c                V    \        WP                  VR7      pV P                  W4       V# )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.
ri   )rk   r   r_   )r   r   r  rj   storages   &&&& r   alloca_once_valuer    s%     '::U;GMM%!Nr   c                    \        WV4      pVP                  P                  R4       VP                  P                  R4       V# )zS
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    s9    
 
 d	3BMMj!MMj!Ir   c                t    V P                   P                  VR4      pVf   \        P                  ! WV4      pV# )za
Get the function named *name* with type *fnty* from *module*, or insert it
if it doesn't exist.
N)globalsr/   r   Functionr  s   &&& r   r  r    s4    
 
		D$	'B	z[[t,Ir   c                 j     V P                  V4      #   \         d    T P                  T4      u # i ; irn   )get_named_metadataKeyErroradd_named_metadata)r  r  s   &&r   get_or_insert_named_metadatar$    s8    /((.. /((../s    22c                 R    V P                  V4      p\        P                  ! WWC4      # rn   )get_unique_namer   GlobalVariable)r  r  r  r   unique_names   &&&& r   add_global_variabler)    s%    ((.KV@@r   c                 `    V P                   pVP                  f   V P                  V4       R # R # rn   )basic_block
terminatorbranch)r   bbendbbs   && r   	terminater0    s(    			B	}}u r   c                     V ! R 4      # rn   r   )ltypes   &r   get_null_valuer3    s    ;r   c                 P    \        VP                  4      pV P                  R W!4      # )==r3  r   r   r   rw   r  s   && r   is_nullr8    #    #((#D  t11r   c                 P    \        VP                  4      pV P                  R W!4      # r
   r6  r7  s   && r   is_not_nullr;    r9  r   c                 (    V P                  VR R7      # )Flikelyif_thenr   preds   &&r   if_unlikelyrC    s    ??4?..r   c                 (    V P                  VR R7      # )Tr=  r?  rA  s   &&r   	if_likelyrE    s    ??4?--r   c                 B    V P                  V P                  V4      4      # rn   )r@  not_rA  s   &&r   ifnotrH    s    ??7<<-..r   c                L    VP                  ^4      pV P                  WR.R7      # )z
Increment an index *val*.
nsw)flags)r   r  )r   rw   ones   && r   increment_indexrM    s(     ((1+C ;;sw;//r   Loopc              #  
  a a"   Vf   VP                   pVf	   V! ^ 4      pTpS P                  R4      pS P                  R4      pS P                  R4      oVV 3R lpS P                  pS P                  V4       S P	                  V4      ;_uu_ 4        S P                  VRR7      p	S P                  RW4      p
S P                  WS4       RRR4       S P	                  V4      ;_uu_ 4        \        X	V4      x  S P                  p\        S V	4      p\        S V4       RRR4       X	P                  W(4       V	P                  XV4       S P                  S4       R#   + '       g   i     L; i  + '       g   i     LY; i5i)	z
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
Nfor.condfor.bodyfor.endc                  *   < SP                  S 4       R # rn   )r-  )r.  r   s   r   do_breakfor_range.<locals>.do_break  s    ur   
loop.indexr  <)r   append_basic_blockr+  r-  
goto_blockphiicmp_signedcbranchrN  rM  r0  add_incomingposition_at_end)r   countstartintpstopbbcondbbbodyrT  bbstartrv   rB  incrr.  s   f&&&        @r   	for_rangerh    sD     |zz}QD''
3F''
3F&&y1E !!GNN6			F	#	#D|4""34e, 
$
 
		F	#	#5(##$$w.'6" 
$ 
u&	tV$E" 
$	#
 
$	#s6   BF8E!F,3E0>FE-	(F0F 	;Fc              #    "   Vf   VP                   pV P                  R4      pV P                  R4      pV P                  R4      pV P                  p	V P                  V4       V P	                  V4      ;_uu_ 4        V P                  VRR7      p
V P                  VRR7      pV'       d   V P                  RW4      pMV P                  R	W4      pV P                  WV4       RRR4       V P	                  V4      ;_uu_ 4        X
X3x  V P                  pV P                  W4      p\        W4      p\        W4       RRR4       X
P                  W4       V
P                  XV4       XP                  \        P                  ! V^ 4      V	4       VP                  XV4       V P                  V4       R#   + '       g   i     L; i  + '       g   i     L; i5i)
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
NrP  rQ  rR  rV  rW  z
loop.countrX  >)r   rY  r+  r-  rZ  r[  r\  r]  r  rM  r0  r^  r   r#   r_  )r   ra  rc  steprb  incrd  re  r.  rf  rv   r`  rB  rg  
next_counts   &&&&&&         r   for_range_slicern    s    4 |zz''
3F''
3F&&y1E!!GNN6			F	#	#D|4D|4&&sE8D&&sE8De, 
$ 
		F	#	#Ul$${{5'$W4
'" 
$ 
u&	tV$	r{{4+W5	z6*E") 
$	# 
$	#s8   A:G<A&F4"!G:G=A7G4G	?GG	Gc           	   #  b  "   VP                   pV P                  RV\        P                  ! V^ 4      4      p\	        WW#VRR7      p\	        WW#VRR7      p\
        R 4       pV P                  VRR7      ;_uu_ 4       w  rV! W4      V! W4      3x  RRR4       R#   + '       g   i     R# ; i5i)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):
            ...
>=T)rl  Fc           	   3      "   T ;_uu_ 4        V;_uu_ 4       pVx  R R R 4       R R R 4       R #   + '       g   i     L; i  + '       g   i     R # ; i5irn   r   )condinner_cmr   s   && r   cm_cond(for_range_slice_generic.<locals>.cm_condb  s1     TU  T TTs-   AA/	A
A?AA		Ar=  N)r   r\  r   r#   rn  r   if_else)r   ra  rc  rk  rb  is_pos_steppos_for_rangeneg_for_rangert  then	otherwises   &&&&       r   for_range_slice_genericr|  N  s      ::D%%dD"++dA2FGK#GD$OM#GD%PM 
 
T	2	26Gtd*GI,MMM 
3	2	2	2s   A:B/<B
B/B,	&	B/c              #    "   VR9   g   Q hV'       g   Rx  R# VR8X  d   R pMR p\        W! V4      V4      ;_uu_ 4       p\        V4      \        V4      8X  g   Q hV! V4      x  RRR4       R#   + '       g   i     R# ; i5i)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.
CFFc                     V R R R1,          # )Nr   xs   &r   <lambda>loop_nest.<locals>.<lambda>  s    a"gr   c                     V # rn   r   r  s   &r   r  r    s    ar   Nr   )
_loop_nestr"   )r   shaperb  order_swapindicess   &&&&  r   	loop_nestr  l  so      D==C<%EEut44w<3u:---.  5444s"   B.B&A2(
B2B	=	Bc           	   #   Z  "   \        W^ ,          VR7      ;_uu_ 4       p\        V4      ^8  d<   \        WR,          V4      ;_uu_ 4       pVP                  3V,           x  RRR4       MVP                  3x  RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i5i)r   rb     NNN)rh  r"   r  rv   )r   r  rb  loopr  s   &&&  r   r  r    sw     	7!H4	0	0Du:>G2Y55zzmg-- 65 ::- 
1	055 
1	0	0s4   B+,BB	"B:
B+BBB(	"	B+c                    \        V4      pVf   V^ ,          P                  p\        P                  ! W#4      ! \        P                  4      p\        V4       F  w  rVV P                  WFV4      pK  	  V# )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.
)r"   r   r   r$   r   r   r   )r   r   r  r(   aryr   r   s   &&&    r   
pack_arrayr    s^     	FA	zAY^^
,,r
bll
+C&!""31- "Jr   c                    \         P                  ! V Uu. uF  q"P                  NK  	  up4      pV! \         P                  4      p\	        V4       F  w  rRV P                  WBV4      pK  	  V# u upi )z/
Pack a sequence of values into a LLVM struct.
r   )r   r   r   structtystr   s   &&    r   pack_structr    s`     ##V$<VVVV$<=H	",,	B&!!!"+ "I	 %=s   A.c                    Vf    \        VP                  P                  4      p\        V4       Uu. uF  pV P	                  W4      NK  	  ppV# u upi )z@
Unpack an array or structure of values, return a Python tuple.
)r"   r   elementsrangeextract_value)r   tupr`  r   valss   &&&  r   unpack_tupler    sV     }CHH%%&5\#! !!#)! 	 #K#s   Ac                     \        WP                  VP                  R 7      p\        WP                  VP                  R 7      p\	        WVP
                  VWP                  VWVR7	      # ))r`  )r+   r  strideslayoutinds
wraparoundboundscheck)r  r  ndimr  get_item_pointer2r+   r  )	rc   r   arytyr  r  r  r  shapesr  s	   &&&&&&&  r   get_item_pointerr    sQ    
 '99EJJ?F7KKuzzBGWCHHF%,\\(2M Mr   c                 L  aaaa VVVV3R  lpRpSP                  RSS4      p\        SV4      ;_uu_ 4        \        P                  '       d   V! 4        V P                  P                  S\        V34       RRR4       SP                  RSSP                  ^ 4      4      p\        SV4      ;_uu_ 4        \        P                  '       d   V! 4        V P                  P                  S\        V34       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)c                     < S eG   \        S \        4      '       d    \        SRP                  S 4      SS4       R # \        SRSS S4       R # \        SRSS4       R # )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
)rP   r  printfrV   )axisr   dimleninds   r   _dbgdo_boundscheck.<locals>._dbg  sb     $$$w !44:F4L#vO w !458$ 7O r   zindex is out of boundsrp  NrX  )r\  rC  r   FULL_TRACEBACKS	call_convreturn_user_exc
IndexErrorr   )	rc   r   r  r  r  r  msgout_of_bounds_upperout_of_bounds_lowers	   &ffff    r   do_boundscheckr    s         #C!--dC@	W1	2	2!!!F))':vF 
3 "--c3D	W1	2	2!!!F))':vF 
3	2 
3	2
 
3	2	2s   A C?5A D?D	D#	c	                    V'       dm   . p	\        Wc4       FZ  w  rVP                  R WP                  ^ 4      4      pVP                  W4      pVP	                  WV
4      pV	P                  V4       K\  	  MTp	V'       d.   \        \        W4      4       F  w  pw  r\        WWV4       K  	  V	'       g   VP                  V\        ^ 4      .4      # V	^ ,          P                  pVR9   Ed    . pVR8X  d[   \        \        V4      4       FA  pV! ^4      pVV^,           R  F  pVP                  VV4      pK  	  VP                  V4       KC  	  MeVR8X  dT   \        \        V4      4       F:  pV! ^4      pVRV  F  pVP                  VV4      pK  	  VP                  V4       K<  	  M\        R4      hV! ^ 4      p\        V	V4       F*  w  ppVP                  VV4      pVP                  VV4      pK,  	  VP                  VV.4      pV# \        WI4       UUu. uF  w  ppVP                  VV4      NK  	  ppp\        P                  ! VP                  V4      p\!        WV4      # u uppi )rX  r~  CNr  unreachable)zipr\  r   r  selectr   r   r  r   r   r  r"   mul	Exception	functoolsreducepointer_add)rc   r   r+   r  r  r  r  r  r  r  r  r  negativewrappedselectedr  rb  stepsr   lastjlocstmpr   dimoffsr  s   &&&&&&&&&                  r   r  r    s'   
 t+KC**3XXa[AHkk&.G~~h=HNN8$	 , #,S-@#AD-37S$? $B {{4'!*..1:??D~S=3u:&Awq1uvA";;tQ/D 'T"	 '
 s]3u:&AwrA";;tQ/D #T"	 ' M** 1g'DAq++a#C++c3'C ( kk$&
 25W1FG1FA7;;q!$1FG!!'++w77&11 Hs   I&c                 Z   VP                  ^ 4      p\        VP                   \        P                  \        P                  34      '       d   V! W4      pV# \        VP                   \        P
                  4      '       d   V P                  W1V4      pV# \        RVP                   : 24      h)r   zunexpected value type )r   rP   r   	FloatType
DoubleTyper%   r\  rU   )r   r   fpredicondnullvalisnulls   &&&&  r   _scalar_pred_against_zeror    s    jjmG%**r||R]];<<u&
 M	 
EJJ

	+	+$$U7; M ejjBCCr   c                Z    \        W\        P                  ! V P                  R4      R4      # )zC
Return a predicate representing whether *value* is equal to zero.
r5  r  r  partialfcmp_orderedr   s   &&r   is_scalar_zeror  '  s-     %	))'*>*>EtM Mr   c                Z    \        W\        P                  ! V P                  R4      R4      # )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  /  -    
 %	))'*@*@$GO Or   c                Z    \        W\        P                  ! V P                  R4      R4      # )zQ
Return a predicate representing whether *value* is equal to either zero
or NaN.
r5  r  r   s   &&r   is_scalar_zero_or_nanr  8  r  r   c                Z    \        W\        P                  ! V P                  R4      R4      # )z2
Is *value* negative?  Assumes *value* is signed.
rX  r  r   s   &&r   is_scalar_negr  E  s-     %	))'*>*>DcK Kr   c                $    V ^8  d   QhR\         /# )   stack)r   )rV   s   "r   __annotate__r  N  s     # #) #r   c              #     "   VP                  V P                  VRR7      4      w  r4V;_uu_ 4        Rx  RRR4       VP                  V4       R#   + '       g   i     L#; i5i)ah  
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  rr  rz  r{  s   &&&  r   early_exit_ifr  M  sH     , ))'//$u/*MNOD	 
		" 
s   /A$AA$A!	A$c                ,    \        W\        W4      4      # )z
A convenience wrapper for :func:`early_exit_if`, for the common case where
the CPython API indicates an error by returning ``NULL``.
)r  r8  )r   r  objs   &&&r   early_exit_if_nullr  i  s    
 )>??r   c                    VP                  \        W4      RR7      ;_uu_ 4        V^ ,          pVR,          ;'       g    RpV P                  P                  WV4       RRR4       R#   + '       g   i     R# ; i)zi
Guard against *value* being null or zero.
*exc_tuple* should be a (exception type, arguments...) tuple.
Fr=  r  N)r@  r  r  r  )rc   r   r   	exc_tupleexcexc_argss   &&&&  r   
guard_nullr  q  s\    
 
7	F	FlR=((D))'A 
G	F	F	Fs   9A((A9	c                Z   \        VP                  \        P                  4      '       g   Q VP                  4       hV'       d   V3MRpVP	                  \        W4      RR7      ;_uu_ 4        V P                  P                  V\        V4       RRR4       R#   + '       g   i     R# ; i)z?
Guard against *pointer* being NULL (and raise a MemoryError).
Fr=  Nr   )	rP   r   r   PointerTyper@  r8  r  r  MemoryError)rc   r   pointerr  r  s   &&&& r   guard_memory_errorr  |  ss     gllBNN33AW\\A3v"H	25	A	A))';I 
B	A	A	As   -"BB*	c              #     "   V P                  \        W4      VR7      ;_uu_ 4        Rx  RRR4       R#   + '       g   i     R# ; i5i)z6
Execute the given block if the scalar value is zero.
r=  N)r@  r  )r   r   r>  s   &&&r   if_zeror    s1     
 
7	G	G 
H	G	G	Gs   %A
6
A
A		A
c                6    \        V \        P                  4      # )z/
Whether the LLVM type *typ* is a struct type.
)rP   r   r  )ltyps   &r   rZ   rZ     s     dBNN++r   c                     \        W^ V4      p\        VP                  P                  4      '       d   Q hV P	                  WCP                  4       4      # r~   )r   rZ   r   r\   r   r^   )r   recordr  typpvals   &&&& r   get_record_memberr    sA    F3D$))++,,,,??4!122r   c                 D    V P                  R WP                  ^ 4      4      # )rX  )r\  r   )r   rw   s   &&r   
is_neg_intr    s    sC!55r   c                $    \        W.VO5RR/VB # )z0
Same as *gep*, but add the `inbounds` keyword.
r   T)r   )r   r   r  kwss   &&*,r   r   r     s     w9d9T9S99r   c                   VP                  RR4      pVP                  RR4      pV'       d   Q h. pV F8  p\        V\        4      '       d   \        V4      pMTpVP	                  V4       K:  	  V P                  WWER7      # )z}
Emit a getelementptr instruction for the given pointer and indices.
The indices can be LLVM values or Python int constants.
r   r   F)r  r   )rB   rP   r  r   r   r   )	r   r   r  r  r  r   idxr   r  s	   &&*,     r   r   r     su    
 7762Dwwz5)HN7
Ca!*CC

3  ;;sd;>>r   c                    V P                  V\        4      p\        V\        4      '       d   \        V4      pV P	                  WB4      pT P                  YC;'       g    VP                  4      # )z
Add an integral *offset* to pointer *ptr*, and return a pointer
of *return_type* (or, if omitted, the same type as *ptr*).

Note the computation is done in bytes, and ignores the width of
the pointed item type.
)r
  r  rP   r  r  inttoptrr   )r   r   r  return_typeintptrs   &&&& r   r  r    sW     c6*F&#[[(FF$;$;388<<r   c           	        V P                   P                  R\        VP                  34      pV P	                  V\        4      p\        V\        4      '       d   \        V4      pV P                  WAW2\        ^ 4      .4       R# )z5
Fill *size* bytes starting from *ptr* with *value*.
zllvm.memsetN)
r  declare_intrinsic	voidptr_tr   r   rP   r  int8_tcallbool_t)r   r   r  r   r  s   &&&& r   memsetr    s`     
	)	)-)TYY9O	PB
//#y
)C%uLL5q	23r   c                    V P                  V4      p\        W\        WP                  4      ^ 4       V P	                  W!4       R# )z/
Fill padding bytes of the pointee with zeros.
N)r   r  r  r   r_   )r   r   rw   s   && r   memset_paddingr    s3    
 ,,s
C
72A6MM#r   c                    \        V \        P                  4      '       d   T pMV P                  p\	        WBP
                  V4      pW5n        RVn        W%n        V# )zG
Get or create a (LLVM module-)global constant with *name* or *value*.
T)	rP   r   Moduler  r)  r   linkageglobal_constantinitializer)builder_or_moduler  r   r  r  r+   s   &&&&  r   r  r    sN     #RYY//""))vzz48DLDKr   c           
        V^ 8  g   Q hVP                  V4      pVP                  ^4      p\        WP                   4      pV P                  \        W4      4      ;_uu_ 4       w  rVV;_uu_ 4        V P	                  W4      pV P                  Wt4       RRR4       V;_uu_ 4        V P                  W4      pV P	                  W4      pV P                  V P                  Ws4      V4       RRR4       RRR4       V P                  V4      pV P                  WP                  Wr4      4      p	Wy3#   + '       g   i     L; i  + '       g   i     L_; i  + '       g   i     Lj; i)z
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*.
N)
r   rk   rv  r  sdivr_   r  subr   r  )
r   rw   divisorrL  quotif_negif_posquot_valval_plus_onerem_vals
   &&&       r   divmod_by_constantr&    s    Q;;hhwG
((1+Cw)D	G1	2	26FvV||C1HMM()  V";;s0L||L:HMM'++h4d;	  
3 ||D!Hkk#{{8=>G V V 
3	2s=   #E0#D-	E%AE 	)E-D=8E EEE#	c                n    V P                  R4      pV P                  WV4       V P                  V4       V# )zy
Branch conditionally or continue.

Note: a new block is created and builder is moved to the end of the new
      block.
z	.continue)rY  r]  r_  )r   rr  bbtruebbconts   &&& r   cbranch_or_continuer*    s5     ''4FOOD&)F#Mr   c                j   VP                   VP                   8X  g   Q h\        WVP                   R7      ;_uu_ 4       pV P                  WP                  .4      pV P                  W$P                  .4      pV P	                  V P                  V4      V4       RRR4       R#   + '       g   i     R# ; i)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
r  N)r   rh  r   rv   r_   r   )r   rF   rG   r`  r  out_ptrin_ptrs   &&&&   r   memcpyr.    s{     88sxx	7

	3	3t++cJJ<0S::,/gll6*G4 
4	3	3	3s   AB!!B2	c           	      h   VP                   p\        V\        4      '       d   \        P                  ! Wu4      pV P
                  P                  V\        \        V.4      p\        p	V P                  WP                  V\        4      V P                  V\        4      V P                  WE4      V	.4       R # rn   )r   rP   r  r   r#   r  r  r  	false_bitr  r   r  )
r   	func_namerF   rG   r`  itemsizealignsize_tr.  is_volatiles
   &&&&&&&   r   _raw_memcpyr6  3  s    ZZF(C  ;;v0^^--i/8)V.LNFKLL//#y9!//#y9!++e6%' (r   c           	          \        V RWW4V4      # )zU
Emit a raw memcpy() call for `count` items of size `itemsize`
from `src` to `dest`.
zllvm.memcpyr6  r   rF   rG   r`  r2  r3  s   &&&&&&r   
raw_memcpyr:  A  s    
 ws%PPr   c           	          \        V RWVWE4      # )zV
Emit a raw memmove() call for `count` items of size `itemsize`
from `src` to `dest`.
zllvm.memmover8  r9  s   &&&&&&r   raw_memmover<  I  s    
 w%( (r   c                    V P                  W4      pV P                  V^ 4      pV P                  V^4      pV P                  WS4      pV P                  V^ 4      pV P                  W`P                  V^4      4      p	W3# )ze
Compute (a * b + c) and return a (result, overflow bit) pair.
The operands must be signed integers.
)smul_with_overflowr  sadd_with_overflowor_)
r   ar'   cpprodprod_ovfr  r8   ovfs
   &&&&      r   muladd_with_overflowrG  R  s|    
 	""1(A  A&D$$Q*H""4+A


1
%C
++h 5 5a ;
<C8Or   c                   \        V\        4      '       g   Q hV P                  p\        p\	        VR,           P                  R4      4      p\        VRV4      p\        P                  ! \        V.RR7      p VP                  R4      pV P                  Wd4      p	V P                  W.\        V4      ,           4      #   \         d    \        P                  ! Y7RR7      p LXi ; i)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  rW  )rP   r3   r  r  r)   encoder  r   FunctionTyper   
get_globalr"  r  r   r  list)
r   rV   argsmodcstring	fmt_bytes
global_fmtr  r  ptr_fmts
   &&*       r   r  r  `  s     fc""""
..CG66w?@I oyAJ??7WIt<D3^^H% ooj2G<<IT
233	  3[[23s   8B< <#C"!C"c                   \        V\        4      '       g   Q hV P                  p\        p\	        VR,           P                  R4      4      p\        VRV4      p\        P                  ! \        V\        V.RR7      p	Rp
\        P                  '       d
   RV
,           p
 VP                  V
4      pV P!                  W4      pV P#                  WW,.\%        V4      ,           4      #   \         d    \        P                  ! YYT
R7      p LYi ; i)	z8Calls libc snprintf(buffer, bufsz, format, ...args)
    rI  rJ  snprintf_formatTrL  snprintfr,   rW  )rP   r3   r  r  r)   rN  r  r   rO  r   r  r   IS_WIN32rP  r"  r  r   r  rQ  )r   bufferbufszrV   rR  rS  rT  rU  rV  r  symbolr  rW  s   &&&&*        r   rZ  rZ  z  s     fc""""
..CG66w?@I &7CJ??'67+TD Fv1^^F# ooj2G<<U4tDzABB	  1[[01s   C$ $#D
	D
c                   \        V\        4      '       g   Q h\        P                  ! \        P                  ! ^4      V4      p\        WRR7      pV P                  V\        4      p\        W\        V4      V.VO5!   V# )zoSimilar to `snprintf()` but the buffer is stack allocated to size
*bufsz*.

Returns the buffer pointer as i8*.
Tri   )
rP   r  r   r$   r%   rk   r   r  rZ  r  )r   r]  rV   rR  spacetyspacer\  s   &&&*   r   snprintf_stackbufferrb    se     eS!!!!ll2::a=%0G5E__UI.FWfUmV;d;Mr   c                B    V P                  R4      P                  R4      # )z_
Normalize the given string to latin1 compatible encoding that is
suitable for use in LLVM IR.
utf8latin1)rN  decode)texts   &r   normalize_ir_textrh    s     ;;v%%h//r   c           	        ^pV P                  V\        4      p\        V RW4       \        P                  ! ^4      pV P                  WP                  4       4      p\        W4      ;_uu_ 4       pV P                  VP                  \        V4      4      pV P                  RV\        ^ 4      4      pV P                  V4      ;_uu_ 4        \        V R4       RRR4       V P                  WP                  .4      pV P                  V4      p	\        V RV	4       RRR4       \        V R4       R#   + '       g   i     L`; i  + '       g   i     L1; i)zADebug print the memory region in *ptr* to *ptr + nbytes*
as hex.
zhexdump p=%p n=%zur5  
Nz %02x)zextr  r  r   r%   r   r^   rh  uremrv   r   r@  r   r   )
r   r   nbytesbytes_per_linebyte_tr  div_bydo_new_liner  rw   s
   &&&       r   hexdumprr    s     N\\&&)F
7(ZZ]F
//#002
3C	7	#	#scii)?@++D&&)D__[))7D! * S99+.ll6"w% 
$ 7D *) 
$	#s&   .AE	D.	AE.D>9EE	c                    V RJ ;'       g=    \        V \        P                  4      ;'       g    \        V \        P                  4      # )zreturns if 'ty' is none N)rP   r   NoneTypeOmittedr  s   &r   is_nonelikerw    s@     	d
 	& 	&2u~~&	& 	&2u}}%r   c                v    \        V \        P                  4      ;'       d    \        V P                  4      ^ 8H  # )z"returns if 'ty' is an empty tuple )rP   r   Tupler"   rv  s   &r   is_empty_tuplerz    s1     	2u{{# 	 	BHHr   c                l    \         P                  ! \         P                  ! V \        V4      4      V4      # )zu
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  rw   s   &&r   create_constant_arrayr|    s$     ;;r||BC1377r   rn   )r   )Nr  F)r  Fr~   )rv   rT  r   )NT)r  )FF)F)internal)r  )gr   collections
contextlibr   r   r  llvmliter   
numba.corer   r   r   r   numba.core.datamodelrQ   r%   r  r  r   MACHINE_BITSr  r^   r  true_bitr0  	true_byte
false_byter   r   r)   r.   r=   rJ   objectrL   r0   r1   r   rk   r  r  r  r  r$  r)  r0  r3  r8  r;  rC  rE  rH  rM  
namedtuplerN  rh  rn  r|  r  r  r  r  r  r  r  r  r  r  r  r  is_trueis_falser  r  r  r  r  r  
guard_zerorZ   r  r  r   r   r  r  r  r  r&  r*  r.  r6  r:  r<  rG  r  rZ  rb  rh  rr  rw  rz  r|  r   r   r   <module>r     s  
  0   6 6  
A	A
**R.	E&&	'	!91I	1I	AY
=	:  &"B06 B0J| 1l 1 g0 g0X2,/A
2
2
/./0 f&;< (# (#V 6# 6#r N N: ! !6    		MG<72tMOO K # #6@BJ   
,36:?&=4	>
5*(Q(44C40.8r   