
    J/Ph                    8   d dl mZmZ d dlZd dlZd dlmZ d dlZd dlm	Z	m
Z
 d dlmZmZmZmZmZmZmZmZmZmZmZmZ d dlmZmZmZmZmZmZ d dlm Z  d dl!m"Z" d d	l#m$Z$m%Z% d d
l&m'Z' d dl(m)Z)  edd          Z* G d de+          Z, G d de,          Z-d Z.dS )    )
namedtupledefaultdictN)partial)Constant	IRBuilder)typingutilstypesir	debuginfofuncdesc
generatorsconfigir_utilscgutilsremoverefctpasstargetconfig)LoweringErrornew_error_contextTypingErrorLiteralTypingErrorUnsupportedErrorNumbaDebugInfoWarning)default_mangler)Environment)compute_use_defsmust_use_alloca)get_func_body_first_lineno)get_registered_loc_notify_VarArgItem)varargindexc                       e Zd ZdZddZed             Zd Zd Zd Z	d Z
d	 Zd
 Zd ZddZd dZd dZd Zd Zd Zd Zd Zd Zd!dZd Zd Zd Zdej        ddfdZd Zd ZdS )"	BaseLowerz
    Lower IR to LLVM
    Nc                    || _         || _        t          j        |j                                                  | _        || _        |j        | _        || _        t          j
                                        | _        | j                             | j        j                  | _        t!          j        | j                  | _        i | _        i | _        i | _        t-          | j                                                  | _        d| _        |                    | j        | j                  | _        | j        j        r| j        j        nt<          j        }|                                  | _!        | j        j"        } || j        |j        j#        ||          | _        tI                      | _%        | &                                 d S )N)environmentfndesc)modulefilepathcgctxdirectives_only)'libraryr(   r	   	SortedMapblocksitemsfunc_irgenerator_infometadatar   ConfigStacktop_or_noneflagscreate_ir_moduleunique_namer)   r   from_fndescenvblkmappending_phisvarmapminkeysfirstblkloc	subtargetcontextenable_debuginfo	DIBuilderr   DummyDIBuilder_compute_def_locationdefn_locdbg_directives_onlyfilenamer   _loc_notify_registryinit)selfrC   r-   r(   r1   r3   dibuilderclsr,   s           S/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/numba/core/lowering.py__init__zBaseLower.__init__   s   ogn&:&:&<&<==%4 !-99;;
 l33DK4KLL *4;77 DK,,..//
 ((TX04 ) = =
  <86..&5 	
 2244*8%T[/6{/C,36EG G G %>$?$?! 			    c                     | j         j        S N)rC   	call_convrM   s    rO   rT   zBaseLower.call_convO   s    |%%rQ   c                     d S rS    rU   s    rO   rL   zBaseLower.initS   s    rQ   c                     | j         dS | j                            | j                  | _         | j                            | j                  | _        | j        j        | _        | j        j        | _        dS )ze
        Init the Python API and Environment Manager for the function being
        lowered.
        N)	pyapirC   get_python_apibuilderget_env_managerenv_managerenv_bodyenv_ptrenvargrU   s    rO   
init_pyapizBaseLower.init_pyapiV   sd    
 :!F\00>>
  <77EE(1&.rQ   c                 z   | j         j                            | j         j        j        dz             }| j        j        r}| j         j        j        }t          |          }|%|dz
  }| j         j                            |          }n6d| j         j        j         d}t          j
        t          |                     |S )N   z$Could not find source for function: z+. Debug line information may be inaccurate.)r1   rA   with_linenolinerC   rD   func_idfuncr   warningswarnr   )rM   rH   fnoptional_lnooffsetmsgs         rO   rG   zBaseLower._compute_def_locationd   s     <#//0@0E0IJJ<( 	:%*B5b99L'%)<+77??,,.3, , , 3C88999rQ   c                 H   d| _         | j                            | j        j        | j        j        | j        j        | j        j        | j	        j
                   | j        j        j        }| j        j        o| j        j         }|rd|vr|                    d           dS dS dS )z4
        Called before lowering all blocks.
        N)functionqualnameargnamesargtypesre   alwaysinlinenoinline)rY   r   mark_subprogramr[   ro   r(   rp   argsrr   rH   re   
attributesr6   rI   add)rM   rw   
full_debugs      rO   	pre_lowerzBaseLower.pre_lowerw   s     
&&0E040D040@040D,0M,>	 	' 	@ 	@ 	@ \*5
Z)P$*2P.P
 	'.
::NN:&&&&&	' 	'::rQ   c                 t    | j                                          | j        D ]}|                                 dS )z5
        Called after all blocks are lowered
        N)r   finalizerK   close)rM   notifys     rO   
post_lowerzBaseLower.post_lower   sC     	!!!/ 	 	FLLNNNN	 	rQ   c                     dS )z1
        Called before lowering a block.
        NrW   rM   blocks     rO   	pre_blockzBaseLower.pre_block         rQ   c                     dS )z0
        Called after lowering a block.
        NrW   r   s     rO   
post_blockzBaseLower.post_block   r   rQ   c                 n    | j                             | j        ||||| j        j        j                   d S )NrA   	func_name)rT   return_dynamic_user_excr[   r1   rf   r   )rM   	exc_classexc_argsnb_typesrA   s        rO   return_dynamic_exceptionz"BaseLower.return_dynamic_exception   sC    ..L)Xxt|3= 	/ 	
 	
 	
 	
 	
rQ   c                 l    | j                             | j        |||| j        j        j                   dS )z+Propagate exception to the caller.
        r   N)rT   return_user_excr[   r1   rf   r   rM   r   r   rA   s       rO   return_exceptionzBaseLower.return_exception   sC     	&&L)Xt|3= 	' 	
 	
 	
 	
 	
rQ   c                 l    | j                             | j        |||| j        j        j                   dS )z5Set exception state in the current function.
        r   N)rT   set_static_user_excr[   r1   rf   r   r   s       rO   set_exceptionzBaseLower.set_exception   sC     	**L)Xt|3= 	+ 	
 	
 	
 	
 	
rQ   c                     | j                             | j                  }| j                             | j        |           dS )z7Emit a pointer to hold the Environment object.
        N)rC   get_env_namer(   declare_env_globalr)   )rM   envnames     rO   emit_environment_objectz!BaseLower.emit_environment_object   s;     ,++DK88''W=====rQ   c                    |                                   | j        "d | _        |                     | j                   n|                     |           | _        | j        j        | _        | j                            |            | j                            |            | j        j	        r| j        
                    |            t          j        rt          j        | j        | j                   | j        j        r-| j        &t%          j        | j        | j        | j                   | j                            | j        | j                   | j                            | j                   d S )N)rC   r(   )r   r2   genlowerlower_normal_functionr(   GeneratorLowergentypelower_init_funclower_next_funchas_finalizerlower_finalize_funcr   	DUMP_LLVMr	   	dump_llvmr)   rC   
enable_nrtr   remove_unnecessary_nrt_usagero   post_loweringr-   add_ir_modulerU   s    rO   lowerzBaseLower.lower   sP   $$&&&& DM&&t{3333 //55DM=0DLM))$///M))$///|) 811$777 	6ODK555 <" 	Mt':'B8AE@DM M M M
 	""4;=== 	""4;/////rQ   c                 z    | j                             | j        | j        j        | j                  | _        | j        S rS   )rT   decode_argumentsr[   r(   rr   ro   fnargsrU   s    rO   extract_function_argumentsz$BaseLower.extract_function_arguments   s8    n55dl6:k6J6:mE E {rQ   c                 l   |                      |           |                                  |                                 }t          j        | j                  5  | j                            |           | j                            | j        | j	                            ddd           dS # 1 swxY w Y   dS )z/
        Lower non-generator *fndesc*.
        N)
setup_functionr   lower_function_bodyr   suspend_emissionr[   position_at_endbranchr;   r@   )rM   r(   entry_block_tails      rO   r   zBaseLower.lower_normal_function   s     	F### 	'')))3355
 '55 	< 	<L(()9:::LDM :;;;	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	<s   AB))B-0B-c                 4   | j         D ])}d|z  }| j                            |          | j        |<   *|                                  | j        j        }|                     d                    | j	        j
                             t          | j                                                   D ]Y\  }}| j        |         }| j                            |           |                     d|            |                     |           Z|                                  |S )zP
        Lower the current function's body, and return the entry block.
        zB%sz# function begin: {0}z# lower block: )r/   ro   append_basic_blockr;   rz   r[   basic_blockdebug_printformatr(   r8   sortedr0   r   lower_blockr   )rM   rl   bnamer   r   bbs         rO   r   zBaseLower.lower_function_body   s$   
 k 	J 	JFFNE"&-"B"B5"I"IDK<3077K#% % 	& 	& 	& $DK$5$5$7$788 	$ 	$MFEV$BL((,,,7v77888U####rQ   c                 F   |                      |           |j        D ]n}|j        | _        t          t          | j                  }t          d|| j        |          5  |                     |           ddd           n# 1 swxY w Y   o|                     |           dS )z(
        Lower the given block.
        rA   zlowering "{inst}" at {loc})instrA   errcls_N)r   bodyrA   r   r   r   
lower_instr   )rM   r   r   defaulterrclss       rO   r   zBaseLower.lower_block
  s     	uJ 	& 	&DxDH#Mtx@@@M"#?d'+xH H H & &%%%& & & & & & & & & & & & & & & 	s   B  B	B	Fc                     | j         r8| j                            | j        | j         j        | j        | j        |           | j                            | j        | j        | j        | j        |           dS )zP
        Create CPython wrapper(s) around this function (or generator).
        )release_gilN)r   rC   create_cpython_wrapperr-   gendescr:   call_helperr(   )rM   r   s     rO   r   z BaseLower.create_cpython_wrapper  s     = 	IL//040E04$:J<G 0 I I I 	++DL$+,0Hd6F8C 	, 	E 	E 	E 	E 	ErQ   c                     | j         rt          d          | j                            | j        | j        | j        | j                   dS )z8
        Create C wrapper around this function.
        z(generator as a first-class function typeN)r   r   rC   create_cfunc_wrapperr-   r(   r:   r   rU   s    rO   r   zBaseLower.create_cfunc_wrapper$  sY     = 	O"#MNNN))$,*.(D4D	F 	F 	F 	F 	FrQ   c                    | j                             | j        |          | _        | j        j        r:| j        j        }d|vr*|                    d           |                    d           | j                            d          | _	        t          | j	                  | _        | j                            | j                  | _        d S )Nrs   optnonert   entry)rC   declare_functionr)   ro   r6   dbg_optnonerw   rx   r   entry_blockr   r[   rT   init_call_helperr   )rM   r(   attrsets      rO   r   zBaseLower.setup_function-  s    55dk6JJ:! 	(m.GW,,I&&&J'''=;;GDD !122>::4<HHrQ   c                 &    | j         j        |         S rS   )r(   typemap)rM   varnames     rO   typeofzBaseLower.typeof9  s    {"7++rQ   rA   returnc                 D    | j         D ]}|                    |           dS )z[Called when a new instruction with the given `loc` is about to be
        lowered.
        N)rK   r~   )rM   rA   
notify_objs      rO   
notify_loczBaseLower.notify_loc<  s7     3 	# 	#Jc""""	# 	#rQ   c                     t           j        r2| j                            | j        d| j        j         d|            d S d S )Nz
DEBUGJIT [z]: )r   	DEBUG_JITrC   r   r[   r(   rp   )rM   rm   s     rO   r   zBaseLower.debug_printC  s`     	KL$$I4;+?IICIIK K K K K	K 	KrQ   c                 H   t          j        |          | j        j        |         f}| j                                        |                     |          f}t          j        t           j	        g|R  }| j        
                    t          |          } || j        |           dS )zHelper to emit ``print(msg, varname)`` for debugging.

        Parameters
        ----------
        msg : str
            Literal string to be printed.
        varname : str
            A variable name whose value will be printed.
        N)r
   literalr(   r   rC   get_dummy_valueloadvarr   	signaturenoneget_functionprintr[   )rM   rm   r   argtysrv   sigimpls          rO   print_variablezBaseLower.print_variableH  s     M#K(

 L((**LL!!
 uz3F333|((44T\4     rQ   rS   )NN)F) __name__
__module____qualname____doc__rP   propertyrT   rL   ra   rG   rz   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Locr   r   r   rW   rQ   rO   r$   r$      s        / / / /b & & X&  / / /  &' ' ',    
  

 
 
 

 
 
 

 
 
 
> > >0 0 0<  < < <"     2  E E E EF F F
I 
I 
I, , ,#bf # # # # #K K K
! ! ! ! !rQ   r$   c                       e Zd Zej        Z fdZed             Zd Z fdZ	d Z
d Zd Zd Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d Z"d Z#d Z$d'd!Z%d" Z&d# Z'd'd$Z(d% Z)d& Z* xZ+S )(Lowerc                 p    t                                                       |                                  d S rS   )superrL   _find_singly_assigned_variable)rM   	__class__s    rO   rL   z
Lower.initc  s,    ++-----rQ   c                 F    | j         dS | j         j        o| j         j         S )a  Flags that the SROA like optimisation that Numba performs (which
        prevent alloca and subsequent load/store for locals) should be disabled.
        Currently, this is conditional solely on the presence of a request for
        the emission of debug information.NF)r6   r   rI   rU   s    rO   _disable_sroa_like_optzLower._disable_sroa_like_opth  s)     :5z#JDJ,J(JJrQ   c                 R   | j         }|j        }t                      }| j         j        j        sit          |          }t          |          }t          t                    }|j        	                                D ]%\  }}|D ]|         
                    |           &t          t                    }	|j        	                                D ]%\  }}|D ]|	         
                    |           &|D ]|vrt          |                   dk    rt          |	                   dk    rj|         \  }
| j        |
                             t          j                  }fd|D             }t          |          dk    r|
                               || _        i | _        d S )Nrc   r   c                 4    g | ]}|j         j        k    |S rW   )targetname).0stmtvars     rO   
<listcomp>z8Lower._find_singly_assigned_variable.<locals>.<listcomp>  s2     #? #? #?D&*k&6#&=&= $(&=&=&=rQ   )r1   r/   setrf   is_generatorr   r   r   defmapr0   rx   usemaplen
find_instsr   Assign_singly_assigned_vars_blk_local_varmap)rM   r1   r/   savuse_defsalloca_varsvar_assign_mapblkvlvar_use_mapdefblkassign_stmtsassignsr   s                @rO   r   z$Lower._find_singly_assigned_variables  s   ,ee|#0 	)'//H)&11K )--N#?0022 1 1R 1 1C"3'++C00001 &c**K#?0022 . .R . .C$((----. & ) )k))c.2E.F.F!.K.K;s+,,11 $2##6'+{6':'E'Ebi'P'P#? #? #? #?L #? #? #?w<<1,,GGCLLL%("!#rQ   c                    ddl m} t          t          |                               |           || _        || j        k    r| j        | j                 }| j        	                    |           t                      }| j                                        D ]G}|                    t          j                  D ]%}|j        |vr|                    |j                   &H|D ]-}|                     |          }|                     ||           .|                    d          D ]}t+          j        t*          j        | j        |j                  }	|	ot5          |	t          j                  rU|	j        |j        u rGt5          |j        t          j                  r(| j        |j        j                 }
d|
i| j        _          d S d S )Nr   )ehcall)opr   )!numba.core.unsafer  r   r   r   _cur_ir_blockr@   r;   r[   r   r  r/   valuesr  r   Delvaluerx   r   _alloca_var
find_exprsr   guardget_definitionr1   rg   
isinstanceGlobalexception_check
terminatorBranchtruebr_in_try_block)rM   r   r  r   	all_namesxr   fetyper  defn	targetblkr   s              rO   r   zLower.pre_block  s   ((((((eT$$U+++"DM!!
 T]+BL((,,,I++-- / /))"&11 / /Awi//!ag.../ " / /T**  v.... $$$// 	 	D>'ty D JtRY$?$?:!333!%"2BI>> $(K0@0G$H	 7?	5J2	 	rQ   c                 8    	 | j         `d S # t          $ r Y d S w xY wrS   )r[   r'  AttributeErrorr   s     rO   r   zLower.post_block  s7    	*** 	 	 	DD	s    
c                    | j                             | j        | j        j                   |                     | j                   |                     t          |                     t          |t          j
                  r|                     |j        j                  }|                     ||          }d }t          |j        t          j                  r9| j                             | j        | j        j                   |j        j        dz   }|                     ||j        j        |           d S t          |t          j                  r|                     |j        j                  }| j        |j                 }| j        |j                 }|                     |j        j                  }| j                            | j        ||t8          j                  }	|	j        t>          j	                             d          k    sJ d|	j        z              | j        !                    |	||           d S t          |t          j"                  r.| j        |j                 }
| j        #                    |
           d S t          |t          j$                  r| j%        r| j&        '                    |            d S |                     |j        j                  }|                     |j        j                  }| j(        j)        }t          |t8          j*                  r$| j+        ,                    | j        |||           d S ||k    sJ d-                    ||                      | j        .                    | j        ||          }| j+        /                    | j        |           d S t          |t          j0                  rd S t          |t          j1                  r| j(        j2        |         }|J 	 | j        3                    d|          }|                     |j        j                  }
|                     |j        j                  }|                     |j        j                  }| j                            | j        |||j4        d                   } || j        |
|j        |f          S # tj          $ r* | 6                    |j        |j7        |j        |          cY S w xY wt          |t          j8                  r| 9                    |           d S t          |t          j:                  r=| j(        j2        |         }|J | 6                    |j        |j        |j        |          S t          |t          j;                  r=| j(        j2        |         }|J | 6                    |j<        |j=        |j        |          S t          |t          j>                  rQ|                     |j        j                  }
|                     |j        j                  }|                     |j        j                  }|                     |j        j                  }| j(        j2        |         }|J t~          j@        }| j        jA        B                    |          }|C                    | j        jA        |j4        i           }| j        3                    ||          }||j4        d         k    sJ | j                            | j        |||j4        d                   } || j        |
|f          S t          |t          jD                  r| E                    |j                   d S t          |t          jF                  r|                     |j        j                  }
|                     |j        j                  }| j(        j2        |         }|                     |j        j                  }|                     |j        j                  }|J |j4        d         |k    sJ | j        G                    |jH        |          }| j                            | j        |||j4        d                   } || j        |
|f          S t          |t          jI                  r| J                    |           d S t          |t          jK                  r| L                    |           d S t          |t          jM                  r| N                    |           d S t          |t          jO                  r| P                    |           d S tk          t=          |                    )Nrc   )argidxzcond is not i1: %sz)type '{}' does not match return type '{}'static_setitem   r   )Qr   mark_locationr[   rA   re   r   r   strr!  r   r  r   r   r   lower_assignr  ArgrH   r"   storevarr%  r   condr;   r&  falsebrrC   castr
   booleantypellvmliteIntTypecbranchJumpr   Returnr2   r   return_from_generatorr(   restypeOptionalrT   return_optional_valuer   get_return_valuereturn_valuePopBlockStaticSetItem	calltypesr   rv   NotImplementedErrorlower_setitem	index_varPrintlower_printSetItemStoreMapdctkeyDelItemoperatordelitemtyping_contextresolve_value_typeget_call_typer  delvarSetAttrget_setattrattrDynamicRaiselower_dynamic_raiseDynamicTryRaiselower_try_dynamic_raiseStaticRaiselower_static_raiseStaticTryRaiselower_static_try_raise)rM   r   tyvalr0  r8  trflcondtypredr   otyretvalr   r   r  valuetyr"   targettyindextyr  fnopcallsigs                          rO   r   zLower.lower_inst  sh   $$T\48=AAA!!!T###dBI&& E	2T[-..B##B--CF $*bf-- .,,T\4=;MNNN)A-MM#t{/M?????bi(( y	2<<	//DT[)BT\*B[[00F<$$T\4OOD9 3 3A 6 6666%	1 766L  r2.....bg&& n	2[-FL'''''bi(( j	2" 33D999,,tz//C++djo..C$B"en-- 44T\2sCPPP999;BB3KK 99\224<SIIFN''f=====bk** Y	2Db.// V	2-d3I(((G|001A9MM
 dk&677TZ_55++djo66))$,w*3.*;= =tDL64:u*EFFF ' A A A))$+t~*.*iA A A A AA bh'' F	2T"""""bj)) C	2-d3I(((%%dk4:tz&/1 1 1 bk** =	2-d3I(((%%dh$*iPPPbj)) 8	2\\$+"233FLL11E{{4;#344Hkk$*/22G-d3I(((!B<.AA"EED((+Y^R G <,,T7;;Dy~a00000L%%dlE7&/nQ&79 9E 4vuo666bf%% !	2KK
#####bj)) 	2\\$+"233FLL11E-d3I{{4;#344Hkk$*/22G(((>!$0000<++DIyAAD L%%dlE7&/nQ&79 9E 4vuo666bo.. 	2$$T*****b011 
	2((.....bn-- 	2##D)))))b/00 	2''----- &d4jj111s   7R5 51S)(S)c                    |                      |j                  }|                      |j                  }|                      |j                  }|                     |j                  }|                     |j                  }	|                     |j                  }
t          j        }| j        j                            |          }|                    | j        j        |j	        i           }| j        
                    ||          }t          |t          j                  r(| j                            | j        |||j                  }n1t          j        } ||           ||j	        d                   k    sJ | j                            | j        ||
|j	        d                   }| j                            | j        ||	|j	        d                   } || j        |||f          S )Nr   rc   r2  )r   r   r   rU  setitemrC   rW  rX  rY  rv   r   r!  r
   rD  r:  r[   r<  	unliteral)rM   
target_varrM  	value_varr   r   r  r"   ro  rn  rp  r  rq  rr  r   uls                   rO   rL  zLower.lower_setitemS  s   jo..Y^,,Y^,,;;z//++in--++in--|*==bAA$$L'
 
 |((w77 h// 	9\&&t|VX'/}6 6FF B2h<<22inQ&7#8#88888!!$,w"+."35 5!!$,w"+."35 5 tDL65%"8999rQ   c                 0    |                      |           d S rS   )re  rM   r   s     rO   ra  zLower.lower_try_dynamic_raiser  s     	##D)))))rQ   c                    |j         }g }g }|D ]}t          |t          j                  rK|                     |j                  }|                     |j                  }|                     ||           nd }|}|                    |           |                    |           | 	                    |j
        t          |          t          |          | j                   d S Nr   )r   r!  r   Varr   r   r   increfappendr   r   tuplerA   )rM   r   r   rv   r   exc_argtyprg  s           rO   r_  zLower.lower_dynamic_raisew  s    = 
	 
	G'26** kk',//ll7<00C%%%%OOC   KK%%dneDkk&+Hoo48 	& 	E 	E 	E 	E 	ErQ   c                     |j         |                     d | j                   d S |                     |j         |j        | j                   d S r|  )r   r   rA   r   rz  s     rO   rc  zLower.lower_static_raise  sR    >!!!$DH!55555!!$.$-TX!NNNNNrQ   c                     |j         |                     d | j                   d S |                     |j         |j        | j                   d S r|  )r   r   rA   r   rz  s     rO   re  zLower.lower_static_try_raise  sR    >!t22222t~t}$(KKKKKrQ   c                    |j         }t          |t          j        t          j        t          j        f          r>| j                            | j        ||j                   }| 	                    ||           |S t          |t          j
                  r|                     ||          S t          |t          j                  rn|                     |j                  }|                     |j                  }| j                            | j        |||          }| 	                    ||           |S t          |t          j                  r!t%          j        | j                  5  |                     d|j        z             }t          |t(          j                  rl|j         }| j        j        }	|	                    |          }
| j                            | j        |
|          }| j                            | j        ||
|          }n4| j        |j                 }| j                            | j        |||          }| 	                    ||           |cd d d            S # 1 swxY w Y   nHt          |t          j                  r.|                     ||          }| 	                    ||           |S t9          t;          |          |          )Nzarg.)r  r!  r   Constr"  FreeVarrC   get_constant_genericr[   r~  Expr
lower_exprr}  r   r   r   r:  r6  r   r   r
   OmittedrW  !resolve_value_type_prefer_literalr   r"   Yieldlower_yieldrK  r<  )rM   rf  r   r  resrg  rl  argtypyvaltyctxvaltyconsts               rO   r5  zLower.lower_assign  s   
ebh	2:>?? +	,33DL"49KA ACKKC   Jrw'' %	??2u---rv&& "	,,uz**C++ej))C,##DL#sB??CKKC   Jrv&& 	 +DL99   FUZ$788eU]33 J!KE L7E!CCEJJE L==eU E ,++DL%KKCC+ek2C,++DL#ubIICB$$$%                ( rx(( 	""2u--CKKC   J!$u++u555s   #C/II#&I#c                 h   | j         j        |j                 }|j        |u sJ t	          j        | ||j                  }|                                 |                     |j	        j
                  }|                     |j	        j
                  }| j        j        }| j                            | j        |||          }| j                            | j        ||          }	| j                            | j        |	           |                                 | j                            | j        |d           S rS   )r2   yield_pointsr"   r   r   
LowerYield	live_varslower_yield_suspendr   r  r   r   r   
yield_typerC   r:  r[   rF  rT   rG  lower_yield_resumer  )
rM   rettyr   ypyrg  r  actual_rettypyretrm  s
             rO   r  zLower.lower_yield  s    -dj9w$!$BL99	ll4:?++kk$*/**/ |  sCGG ..L-
 

 	##DL&999 	
|00udKKKrQ   c                      j         j                                      |j        }|j        }|j        }|j        }                     |j                  }                     |j                  }	 	                    |j                  } 	                    |j                  } j
        j        |          j                              j        ||j        d                   } j                              j        ||	j        d                   } fd}
 fd} |t          |          t          |          f||f          }| |
|          S  |t          |          |	f||f          }| |
|          S  ||t          |          f||f          }| |
|          S                      j         j        j        i           } j                             |          } | j        ||f          } |
|          S )Nr   rc   c                 R    j                             j        | j                  S rS   )rC   r:  r[   return_type)r  restyrM   r   s    rO   cast_resultz&Lower.lower_binop.<locals>.cast_result  s.    <$$T\3%.%:EC C CrQ   c                    t          d |D                       rd S 	 t          t          j                  r"                    j        j        | i           }nt          j        j	        g| R  }n# t          $ r Y d S w xY w	 j                            |          } |j        |          S # t          $ r Y d S w xY w)Nc              3   2   K   | ]}|t           j        u V  d S rS   )r   	UNDEFINEDr   as     rO   	<genexpr>z=Lower.lower_binop.<locals>.try_static_impl.<locals>.<genexpr>  s)      331$333333rQ   )anyr!  r
   FunctionrY  rC   rW  r   r   r  r   r   r[   rK  )tysrv   
static_sigstatic_implr  rM   r   s       rO   try_static_implz*Lower.lower_binop.<locals>.try_static_impl  s    33d33333 tb%.11 O!#!1!1$,2M25r"; ";JJ "(!1)2G!N#!N!N!NJ   tt"l77JGG"{4<666&   tts$   AA2 2
B ?B +B0 0
B>=B>)rC   rW  rX  lhsrhs
static_lhs
static_rhsr   r   r   r(   rJ  r:  r[   rv   _lit_or_omittedrY  r   )rM   r  exprr  r  r  r  r  ltyrtyr  r  r  r   r   r   s   `` `           @rO   lower_binopzLower.lower_binop  sV    \(;;B??hh_
_
kk#(##kk#(##ll38$$ll38$$ K)$/	lc3	q8IJJlc3	q8IJJ	C 	C 	C 	C 	C 	C 	C
	 	 	 	 	 	 	" oZ((/**E*EF$
 
 ?;s###oZ((#.
 
 ?;s###o/*--.*
 
 ?;s### t|:INBOO|((S11d4<#s,,{3rQ   c                 h                          |j                  }                      |j                  }t          j        } j        j                            |          }	|	                     j        j        |j        i           }
 j        	                    |	|
          }||f} 
                    |j                   
                    |j                  f} fdt          |||j                  D             } | j        |          } j                             j        ||j        |          S )Nc                 \    g | ](\  }}}j                             j        |||          )S rW   rC   r:  r[   )r   avatftrM   s       rO   r   z'Lower.lower_getitem.<locals>.<listcomp>8  sG     ; ; ;"B L%%dlBB?? ; ; ;rQ   )r   r   rU  getitemrC   rW  rX  rY  rv   r   r   zipr[   r:  r  )rM   r  r  r  r"   r   basevalindexvalr  rq  rr  r   argvalsargtypscastvalsr  s   `               rO   lower_getitemzLower.lower_getitem*  s1   ,,uz**<<
++|*==bAA$$L'
 
 |((w77H%;;uz**;;uz**,; ; ; ;&)'7*3.': ':; ; ; d4<**|  s!*!6!&( ( 	(rQ   c                    t          |t                    rh|                     |j        j                  |j                 }| j                            |                     |j        j                  |j                  }n4|                     |j                  }|                     |j                  }| j	        
                    | j        |||          S )zh
        Cast a Numba IR variable to the given Numba type, returning a
        low-level value.
        )r!  r    r   r!   r   r"   r[   extract_valuer   rC   r:  )rM   r   rf  vartyrg  s        rO   	_cast_varzLower._cast_var@  s    
 c;'' 	)KK
00;E,,,T\\#*/-J-J-0Y8 8CC KK))E,,sx((C|  sE2>>>rQ   c                     ra                      j                  }t          |t          j                  sJ |fdt          t          |                    D             z   }j        }|6|rt          d|           fdt          |j
                  D             }n8 fd}	 fd}
 fd}t          j        ||t          |          |	|
|          }|S )Nc                 0    g | ]}t          |          S rW   )r    )r   ir!   s     rO   r   z(Lower.fold_call_args.<locals>.<listcomp>T  s9     #C #C #C'( $/vq#9#9 #C #C #CrQ   z+unsupported keyword arguments when calling c                 B    g | ]\  }}                     ||          S rW   r  r   r   sigtyrM   s      rO   r   z(Lower.fold_call_args.<locals>.<listcomp>]  sA     H H H%3 ~~c511 H H HrQ   c                 F                         |j        |                    S rS   )r  rv   )r"   paramr   rM   r   s      rO   normal_handlerz,Lower.fold_call_args.<locals>.normal_handler`  s    ~~c9>%+@AAArQ   c                 \    j                             j        j        |          |          S rS   )rC   r  r[   rv   )r"   r  defaultrM   r   s      rO   default_handlerz-Lower.fold_call_args.<locals>.default_handlerc  s0    |88L)."7B B BrQ   c                     j         |          }t          |t          j                  s
J |            fdt	          ||          D             }t          j        j        |          S )Nc                 B    g | ]\  }}                     ||          S rW   r  r  s      rO   r   zALower.fold_call_args.<locals>.stararg_handler.<locals>.<listcomp>j  sA     C C C(c5 ..e44 C C CrQ   )rv   r!  r
   	BaseTupler  r   make_anonymous_structr[   )r"   r  vars
stararg_tyr  rM   r   s        rO   stararg_handlerz-Lower.fold_call_args.<locals>.stararg_handlerg  s}    &^E2
!*eo>>JJ
JJJC C C C,/j,A,AC C C4T\6JJJrQ   )r   r   r!  r
   r  ranger  pysigrK  r  rv   r   fold_argumentsdict)rM   fntyr   pos_argsr!   kw_args	tp_varargr  r  r  r  r  s   ` ` `       rO   fold_call_argszLower.fold_call_argsN  s    	C FK00Ii99999 #C #C #C #C,1#i..,A,A#C #C #C CH = G))?Ct+F G G GH H H H),Xy~)F)FH H HGGB B B B B BB B B B B BK K K K K K +E,4d7mm,:,;,;	= =G
 rQ   c                    | j         j        |         }|j        t          j        k    sJ | j        j                            t                    }t          |j
                  }t          |j
                  }t          t          |                    D ]D}||j        v r9|j        |         }t          |t                    rt          j        |          ||<   Et#          j        |j        g|R  }|                    |j                  }|                     ||||j        i           }	| j                            t          |          }
 |
| j        |	           dS )z$
        Lower a ir.Print()
        )r  N)r(   rJ  r  r
   r   rC   rW  rX  r   listrv   r  r  constsr!  r4  r   r   r   replacer  r  r!   r   r[   )rM   r   r   r  pos_tysr  r  r  	fixed_sigr  r   s              rO   rO  zLower.lower_printu  s7    k#D)%*,,,,|*==eDD sx..	??s8}}%% 	6 	6ADKAeS)) 6!&u!5!5GAJ$S_?w???	%%CI%66	%%dC4;KK|((	::T\7#####rQ   c                 "   | j         j        |         }|                     d                    |                     t	          |j        t          j                  r| j        	                                S | 
                    |j        j                  }t	          |t          j                  r|                     |||          }nt	          |t          j                  r|                     |||          }nt	          |t          j                  r|                     |||          }n{t	          |t          j                  r|                     |||          }nIt	          |t          j                  r|                     |||          }n|                     |||          }|E|j        t          j        k    r| j        	                                }nt3          d| j                  | j                            | j        ||j        |          S )Nz# lower_call: expr = {0}z2non-void function returns None from implementation)rm   rA   )r(   rJ  r   r   r!  r  r
   PhantomrC   r   r   rg   r   ObjModeDispatcher_lower_call_ObjModeDispatcherExternalFunction_lower_call_ExternalFunctionExternalFunctionPointer#_lower_call_ExternalFunctionPointerRecursiveCall_lower_call_RecursiveCallFunctionType_lower_call_FunctionType_lower_call_normalvoidr   rA   r:  r[   )rM   r  r  r   r  r  s         rO   
lower_callzLower.lower_call  s   K)$/	3::4@@AAAi+U];; 	2<//111{{49>**dE344 	A44T4KKCCe455 	A33D$	JJCCe;<< 	A::dI' 'CC e122 	A00tYGGCCe011 	A//dIFFCC ))$i@@C
 ;$
22l2244#L   
 |  sI4I!&( ( 	(rQ   c                     ddl m}                                    j                                        }d |j        D             } fd|D             } fd|D             }t          ||          D ]\  }	}
                     |
|	            fdt          ||          D             } | j                                      ||          } j        	                    ||          }t          j         j        |          } j                            |          5 \  }}|5  |D ]} j                            |            j                            |            j                             j                   d d d            n# 1 swxY w Y   |5   j                            |j        j        |          }|j        } j                            |           |D ]} j                            |           t-          |j                  r|                                  j                            |            j                            |j                  5   j                             j                   d d d            n# 1 swxY w Y   |cd d d            cd d d            S # 1 swxY w Y   	 d d d            d S # 1 swxY w Y   d S )Nr   )ObjModeUtilsc                     g | ]	}|j         
S rW   r   r  s     rO   r   z7Lower._lower_call_ObjModeDispatcher.<locals>.<listcomp>  s    ...qAF...rQ   c                 :    g | ]}                     |          S rW   )r   r   r  rM   s     rO   r   z7Lower._lower_call_ObjModeDispatcher.<locals>.<listcomp>  s#    555qDKKNN555rQ   c                 :    g | ]}                     |          S rW   )r   r  s     rO   r   z7Lower._lower_call_ObjModeDispatcher.<locals>.<listcomp>  s#    777T\\!__777rQ   c                 X    g | ]&\  }}j                             ||j                  'S rW   )rY   from_native_valuer]   )r   atypavalrM   s      rO   r   z7Lower._lower_call_ObjModeDispatcher.<locals>.<listcomp>  sK     ? ? ?!tT ://d040@B B ? ? ?rQ   )numba.core.pythonapir   ra   rY   
gil_ensurerv   r  r~  load_dispatchercall_function_objargsr   is_nullr[   if_elsedecrefgil_releaserT   
return_excto_native_value
dispatcheroutput_typesr  callablecleanupif_thenis_error)rM   r  r  r   r   	gil_staterq   rr   	argvaluesvrf  argobjscalleeret_objhas_exceptionthenorelseobjnativeoutputs   `                   rO   r  z#Lower._lower_call_ObjModeDispatcher  s!   555555J))++	..DI...5555H5557777h777	H-- 	 	EArKKA? ? ? ?%(9%=%=? ? ?
 dj))99$II*2267CCg>>]""=11 '	^dF  	8 	8" + +CJ%%c**** 
&&y111 ))$,777	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8   33O0    
!!'***" + +CJ%%c**** FN++ %NN$$$ 
&&y111 \))&/:: < <N--dl;;;< < < < < < < < < < < < < < < 1      '	 '	 '	 '	 '	 '	 '	 '	        '	 '	 '	 '	 '	 '	 '	 '	 '	 '	 '	 '	 '	 '	 '	 '	 '	 '	s   K#AF<KF	KF	KCJ- J<J-JJ-JJ-K-J1	1K4J1	5KK
K
c                 r   |                      d           |                     |||j        |j        |j                  }t          j        |j        |j        j	        |j        j                  }| j
                            | j        j        |          }| j
                            | j        ||j        |          S )Nz# external function)r   r  rv   r!   kwsr   ExternalFunctionDescriptorsymbolr   r  rC   declare_external_functionr[   r)   call_external_functionrr   )rM   r  r  r   r  r(   rg   s          rO   r  z"Lower._lower_call_ExternalFunction  s    .///%%)TYTX
 
 4K-tx}> >|55L) )|22L$
 
 	
rQ   c                    |                      d           |                     |||j        |j        |j                  }|                     |j        j                  }|j        r@| 	                                 | j
                                        }g }g }t          |j        j        |j        |          D ]\  }	}
}|	t          j        k    rb|                     |
|           | j
                            |
|| j                  }|                    |           |                    |           x|                    |           | j                            | j        |||j                  }|D ]}| j
                            |           | j
                            |           n'| j                            | j        |||j                  }|S )Nz## calling external function pointer)r   r  rv   r!   r'  r   rg   r   requires_gilra   rY   r  r  r   r
   ffi_forced_objectr~  r  r]   r  rC   call_function_pointerr[   cconvr  r  )rM   r  r  r   r  pointerr  
newargvalspyvalsexptypgottypr	  r#  r  s                 rO   r  z)Lower._lower_call_ExternalFunctionPointer
  s   >???%%)TYTX
 
 ,,ty~.. "	OO
--//IJF(+DHM9>,3)5 )5 , ,$ U444KK---*66d&6 C %%c***MM#&&&&%%d++++ ,44gz4: C  ' '
!!#&&&& J""9---- ,44gw
 C 
rQ   c                    |                      |||j        |j        |j                  }|                    |j                  }| j        j        pt          }| j        j	        } ||j
        |j        ||j                  }| j        j        j                            |          r(| j                            | j        | j        ||          }	n"| j                            | j        |||          }	|	S )N)abi_tagsuid)r  rv   r!   r'  get_overloadsrC   manglerr   r(   r7  rp   r8  r[   ro   r   
startswithcall_internalcall_unresolved)
rM   r  r  r   r  rec_ovr:  r7  mangled_namer  s
             rO   r  zLower._lower_call_RecursiveCall7  s    %%)TYTX
 
 ##IN33,&9/;'wv	(0fjB B B < %00>> 	,,,dk9g CC ,..lIw C 
rQ   c                 j   |                      d           t          j        |          }|                    |          s't	          d| dt          j        |                     |                     |||j        |j        |j	                  }| 
                    |j        |j        j        ||          S )Nz## calling first-class function typez%mismatch of function types: expected z	 but got )r   r
   ru  check_signaturer   r  r  rv   r!   r'  )_Lower__call_first_class_function_pointerftyperg   r   )rM   r  r  r   r   r  s         rO   r  zLower._lower_call_FunctionTypeL  s    >???oi((##I.. 	G"F!F F,1,>s,C,CF FG G G %%#ty$+tx
 
 77J	W
 
 	
rQ   c           	         | j         }| j        }|                     |          } t          j        |                     |                    |||          }|j        }	d| |	_        |}
t          j        ||
	                    |j
                            }|                    t          j        ||	          d          }|5 \  }}|5  |                     |||          }|                    ||          }|                    ||           ddd           n# 1 swxY w Y   |5  |
j                            |j
        |j                                                  }|                    |	|          }|
j                            |||j
        |j        |          \  }}t          j        ||j                  5  |j                            ||           ddd           n# 1 swxY w Y   |                    ||           ddd           n# 1 swxY w Y   ddd           n# 1 swxY w Y   |                    |          S )a  
        Calls a first-class function pointer.

        This function is responsible for calling a first-class function pointer,
        which can either be a JIT-compiled function or a Python function. It
        determines if a JIT address is available, and if so, calls the function
        using the JIT address. Otherwise, it calls the function using a function
        pointer obtained from the `__get_first_class_function_pointer` method.

        Args:
            ftype: The type of the function.
            fname: The name of the function.
            sig: The signature of the function.
            argvals: The argument values to pass to the function.

        Returns:
            The result of calling the function.
        r  jit_addr_of_FlikelyN)rC   r[   r   r   create_struct_proxyr   jit_addrr   alloca_onceget_value_typer  r  r  (_Lower__get_first_class_function_pointerr  storerT   get_function_typerv   
as_pointerbitcastcall_functionif_unlikelyr  return_status_propagateload)rM   rC  fnamer   r  rC   r[   fstructstructrJ  ctxres_slotif_jit_addr_is_nullr!  r"  func_ptrr  lltystatuss                      rO   #__call_first_class_function_pointerz)Lower.__call_first_class_function_pointer[  sO   & ,,,,u%%@,T[[-?-?@@WG
 
 
 ?.u..&w'*'9'9#/'J'JL L &ooOGX.. . 
 
 ! 	-NT6 - -BB5#' 'll8W55c8,,,	- - - - - - - - - - - - - - -  - -}66OH  *,,  #??8T::!m99Xs'  (&/BB O O%==gvNNNO O O O O O O O O O O O O O Oc8,,,- - - - - - - - - - - - - - -	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	-( ||H%%%s   H%	ADH%D	H% D	!H%&BH9G!H!G%%H(G%)HH%H	H%H	H%%H),H)c           	      B   ddl m} | j                            |          }|                     |          }| j                            |dd|z            }t          j        | j        |d|z            }| j        	                    t          j
        | j        |          d          5 \  }	}
|	5  |                                  | j                                        }| j                            |dd	|z            } || j        | j        ||d
          }| j                            t          j
        | j        |          d          5  |                     t           | df| j                   d d d            n# 1 swxY w Y   | j                            |          }| j                            | j                            ||          |           | j                            |           | j                            |           d d d            n# 1 swxY w Y   |
5  | j                            | j                            ||          |           d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   | j                            |          S )Nr   )lower_get_wrapper_addressz
addr_of_%sr  z
fptr_of_%sFrG  rc   zpyaddr_of_%signore)failure_modez function address is null)r   rA   ) numba.experimental.function_typera  rC   rL  r   r[   r  r   rK  r  r  ra   rY   r  r  r   RuntimeErrorrA   long_as_voidptrrN  rQ  r  r  rU  )rM   rC  rV  r   ra  r]  rW  addrfptrr!  r"  r  pyaddraddr1addr2s                  rO   "__get_first_class_function_pointerz(Lower.__get_first_class_function_pointer  s   NNNNNN|**511,,u%%|))'1/;u/E * G G "4<(4(>@ @ @\!!d33 "   	K!/$ 2 2!!! J1133	33Q'51 4 3 3 21L$,!)+ + + \))e<<U * L L & &))$%*"E"E"E!G H * & & && & & & & & & & & & & & & & & 
22599""4<#7#7t#D#DdKKK
!!%(((
&&y111-2 2 2 2 2 2 2 2 2 2 2 2 2 2 2.  K K""4<#7#7d#C#CTJJJK K K K K K K K K K K K K K K5	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K8 |  &&&s   )I</BH'E>2H>FHFBHI<H	I<H	I<$5I%I<%I)	)I<,I)	-I<<J J c                    |                      d                    |                     |                      d                    |                     t          |t          j                  r|j        j        }n(|                     |||j        |j        |j	                  }|j
        }|4ddlm}  ||          }|j        j        }|                    ||          }	n| j                            ||          }	|j        r2|                     |j        j                  }
|
gt)          |          z   } |	| j        || j                  }|S )Nz# calling normal function: {0}z# signature: {0}r   )resolve_dispatcher_from_str)r   r   r!  r
   r  rg   rv   r  r!   r'  r   numba.core.target_extensionrn  targetdescrtarget_contextr   rC   recvrr   r   r  r[   rA   )rM   r  r  r   r  tnamern  disphw_ctxr   the_selfr  s               rO   r  zLower._lower_call_normal  sG   9@@FFGGG+229==>>>dE344 	inGG))iDK G OOOOOO..u55D%4F&&tY77DD<,,T9==D? 	1 ||DIN33Hj4==0Gd4<$(33
rQ   c                     |j         dk    r                     ||j                  S |j         dk    r^                     |j        j                  }|j        r                     ||j                  S                      ||j                  S |j         dk    r                     |j	        j                  }                     |j	        j                  } j
        j                            |j                  } j        j        |         } j
                            ||          } j
                             j        |||j        d                   } | j        |g          }	 j
                             j        |	|j                  }	|	S |j         dk    r                     |          }	|	S |j         dk    rw                     |j	        j                  }                     |j	        j                  }
 j
                             j        ||
          }	                     |	           |	S |j         dk    rw                     |j	        j                  }                     |j	        j                  }
 j
                             j        ||
          }	                     |	           |	S |j         dv r։                     |j	        j                  }                     |j	        j                  }
 j        j        |         } j
                            |j         |          }|j        \  } j
                             j        ||
|          } | j        |f          }	 j
                             j        |	|j                  }	|	S |j         d	k    r                     |j	        j                  }                     |j	        j                  }
t1          |
t2          j                  r. j
                             j        ||
|
j                  }|
j        }
t1          |
t2          j                  r |
k    sJ                      |
|           |S |
j        j        } j
                                      }t3          j         |t2          j!                  }tE          j#        |
j        |
          } j
                            d
|          }tE          j#        ||
j                  } j
                            d|          } | j        |f          }tI          |j%                  D ]} | j        |f          } j
                             j        ||          }tM          j'         j         j        (                    |                    5   )                    tT           j+                   d d d            n# 1 swxY w Y    j
                             j        ||          } j        ,                    |||          } | j        |f          } j
                             j        ||          }tM          j'         j        |          5   )                    tT           j+                   d d d            n# 1 swxY w Y    -                    |
j        |           |S |j         dk    r_                     |j	        j                  }                     |j	        j                  }
t1          t2          j.                  re j
                             j        ||
j/                  } j
        0                     j        |j/                  }	                     |	           |	S  j
        1                    |
|j2                  } j
        j        3                    |
|j2                  }| j
        4                                S  | j
         j        |
||j2                  }	 j
                             j        |	|          }	|	S |j         dk    rtE          j#                             |j	        j                  tk          |j6                            }	  j
                            d|          } | j                             |j	        j                  |j6        f          S # tn          $ r@ |j8          j        j        |         } 9                    ||j	        |j8        |          cY S w xY w|j         dk    rtE          j#                             |j	        j                                       |j6        j                            } j
                            d|          } | j                             |j	        j                                       |j6        j                  f          S |j         dk    r5 j        j        |         } 9                    ||j	        |j6        |          S |j         dk    r| fd|j:        D             } fd|j:        D             } fdtw          ||          D             } j
        <                     j        |          }                     |           |S |j         dk    r fd|j:        D             } fd|j:        D             }t1          t2          j=                  rr fdtw          |j        |          D             } j
        <                     j        t3          j>        j                  |          }                     |           |S  fdtw          ||          D             } j
        ?                     j        |          S |j         dk    rj|j:        d d d         } fd|D             } fd|D             } fdtw          ||          D             } j
        @                     j        |          S |j         dk    r+|j:        }g g } }g g }"}!|D ]\  }#}$                     |#j                  }%                     |#j                  }&                     |$j                  }                     |$j                  }'|A                    |%           | A                    |           |!A                    |&           |"A                    |'            j
        B                     j        t          tw          |!|"                    t          tw          ||                               S |j         d k    rx                     |j	        j                  }                     |j	        j                  }
 j
                             j        ||
          }                     |           |S |j         d!k    rt          d"          |j         d#k    r j
        E                              S |j         d$k    r j
        E                              S |j          j
        jF        v r#  j
        jF        |j                   |          }	|	S to          |          )%Nbinopinplace_binopunaryr   r  
pair_firstpair_second)getiteriternextexhaust_iterr}  r~  r   getattrstatic_getitemtyped_getitemr  build_tuplec                 D    g | ]}                     |j                  S rW   r   r   r   r  rM   s     rO   r   z$Lower.lower_expr.<locals>.<listcomp>  '    AAAQV,,AAArQ   c                 D    g | ]}                     |j                  S rW   r   r   r  s     rO   r   z$Lower.lower_expr.<locals>.<listcomp>  '    ???qt{{16**???rQ   c                 \    g | ](\  }}}j                             j        |||          )S rW   r  r   rg  totyfromtyrM   s       rO   r   z$Lower.lower_expr.<locals>.<listcomp>  sM     P P P-Cv ))$,VTJJ P P PrQ   
build_listc                 D    g | ]}                     |j                  S rW   r  r  s     rO   r   z$Lower.lower_expr.<locals>.<listcomp>  r  rQ   c                 D    g | ]}                     |j                  S rW   r  r  s     rO   r   z$Lower.lower_expr.<locals>.<listcomp>  r  rQ   c                 \    g | ](\  }}}j                             j        |||          )S rW   r  r  s       rO   r   z$Lower.lower_expr.<locals>.<listcomp>  sM     C C C 1T6 !L--dlCNN C C CrQ   c                 d    g | ],\  }}j                             j        ||j                  -S rW   rC   r:  r[   dtyper   rg  r  r  rM   s      rO   r   z$Lower.lower_expr.<locals>.<listcomp>  sR     G G G +V !L--dlC.3k; ; G G GrQ   	build_setr&   c                 D    g | ]}                     |j                  S rW   r  r  s     rO   r   z$Lower.lower_expr.<locals>.<listcomp>  s'    <<<QV,,<<<rQ   c                 D    g | ]}                     |j                  S rW   r  r  s     rO   r   z$Lower.lower_expr.<locals>.<listcomp>  s'    :::qt{{16**:::rQ   c                 d    g | ],\  }}j                             j        ||j                  -S rW   r  r  s      rO   r   z$Lower.lower_expr.<locals>.<listcomp>  sR     C C C'C ))$,V*/+7 7 C C CrQ   	build_mapr:  phizPHI not strippednullundef)Gr  r  rj   r   r  r   mutableimmutable_fnr   r  rC   rW  rX  r(   rJ  r   r:  r[   rv   r  r  r{  r~  r|  r!  r
   rD  r<  r  iterator_typer  get_constant_undefPairr;  r   r   r  countr   rS  not_r   
ValueErrorrA   insert_valuer  BoundFunctionthisget_bound_functionget_getattrr]  resolve_getattrr   r  r"   rK  rM  r  r0   r  
make_tupleLiteralListTupler  r  r  r  r  r   get_constant_nullspecial_ops)(rM   r  r  r  rg  r  func_tyr   r   r  rf  ftycastvalitemtytuppairtygetiter_siggetiter_impliternext_sigiternext_impliterobjr  pairis_validitemcastedattrtyitemvalsitemtysr  r0   r?   r  	key_typesvalue_typeskr  rS  keytypevaltypes(   ``                                      rO   r  zLower.lower_expr  s   7g##E4999W''++dhm,,C{ H''tTW=== ''tT5FGGGW,,tz//C++djo..Cl1DDTWMMG-d3I<,,Wi@@D,##DL#sIN1<MNNC$t|cU++C,##DL#$-$95B BCJW//%..CJW$$,,tz//CTZ_--B,))$,R@@CKKs###JW%%,,tz//CTZ_--B,**4<bAACKKs###JW///,,tz//CTZ_--B-d3I<,,TWi@@DNESl''c2sCCG$t|gZ00C,##DL#y7L$)+ +CJW&&,,tz//CTZ_--B"en-- l''c2rwGGW "eo.. U{{{{B$$$
%0F,11%88CZ66F *2+;R@@K<44Y5@B BL!+FB4DEEL L55j6BD DM"l4<#88G4:&& 	> 	>$}T\G:>><33DL48&B B()-):):8)D)DF F D D))*$()CCCD D D D D D D D D D D D D D D |..t|/3V= =l//T1== !=z::D|//04f> >H$T\8<< @ @%%jdh%???@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ KK('222JW	!!,,tz//CTZ_--B%!455  **4<b%*MMl55dlF6;jB BE3'''
|//DI>>4DDREIYP P <<77999$t|T\2sDINNC l''c65II
W((((DJO,,
++ I
E |001A9MMtDL!\\$*/::DJGI I I& E E E>) !K1$7	))%tz*..)E E E E EE W''(DJO,,DJO,, I
 <,,_iHHD4t||DJO'D'DTZ_55'7 8 8 8W	!!-d3I%%eT4:tz&/1 1 1 W%%AAAAdjAAAH????DJ???GP P P P14Xug1N1NP P PH,))$,xHHCKKs###JW$$AAAAdjAAAH????DJ???G%!233 NC C C C585;9@6B 6BC C C l--dl.3k%+.F.F.68 8 E3'''
G G G G G/28W/E/EG G G |..t|UHMMMW##Jttt$E<<<<e<<<H::::E:::GC C C C C+.x+A+AC C CH <))$,xHHHW##JEr&D%'{I , ,1ll16**++af--ll16**++af--C   c"""  )))""7++++<))$,*.s9k/J/J*K*K*.s4/@/@*A*AC C C W,,tz//CTZ_--Bl''c2uEEGKKw'''NW 2333W<11%888W <11%888W0003$,*473D$??CJ!$'''s8   #"WW	W	'"ZZZ9Ac	 	Addc                     || j         v rdS || j        vs| j        r"|                     ||          }|| j         |<   dS dS )zT
        Ensure the given variable has an allocated stack slot (if needed).
        N)r=   r  r   alloca)rM   r   r*  ptrs       rO   r  zLower._alloca_var  s`     4;F 333+ 4 ++dF++C #DK 43rQ   c                     | j         s|| j        vsJ || j        vsJ || j        vr)|                     ||                     |                     | j        |         S )z=
        Get a pointer to the given variable's slot.
        )r   r	  r  r=   r  r   )rM   r   s     rO   getvarzLower.getvar  su     * 	:t55555t99999t{"" T4;;t#4#4555{4  rQ   c                 P   || j         v r| j        s| j         |         S |                     |          }|| j        j        v rMt          j        | j                  5  | j                            |          cddd           S # 1 swxY w Y   dS | j                            |          S )z2
        Load the given variable's value.
        N)	r	  r   r  r1   	arg_namesr   r   r[   rU  )rM   r   r  s      rO   r   zLower.loadvar  s     4)))$2M))$//kk$ 4<)))+DL99 . .|((--. . . . . . . . . . . . . . . . . . <$$S)))s   BBBNc           
      Z   |                      |          }|                     ||           || j        v r| j        s|| j        |<   dS |+|                     |          }|                     ||           |                     |          }|j        |j        j	        k    r(d
                    ||||          }t          |          |t          j        | j                  5  | j                            ||           ddd           n# 1 swxY w Y   | j        }| j                            |          }	| j                            |	          }
| j        j        |         }| j                            | j        |||	|
|j        ||           dS | j                            ||           dS )z:
        Store the value into the given variable.
        NzNStoring {value.type} to ptr of {ptr.type.pointee} ('{name}'). FE type {fetype})r  r  r*  r   )r   lltypesizere   	datamodelr0  )r   r  r  r   r	  r   r  r  r<  pointeer   AssertionErrorr   r   r[   rN  rH   rC   rL  get_abi_sizeofdata_model_managermark_variablere   )rM   r  r   r0  r*  oldr  rm   rA   r  sizeofr  s               rO   r7  zLower.storevar  s    T""v&&& D.../ /+0D"4(((~ ll4((FC((( ++d##CzSX---67=vEBEEKCG 8> 8I 8I 
 %S)))
 !/== 3 3L&&uc2223 3 3 3 3 3 3 3 3 3 3 3 3 3 3m44V<<44V<< L;FC	,,T\3T4:25(i4: - < < < < <
 ""5#.....s   "D

DDc                    |                      |          }|| j        vr*| j        s#|| j        v r| j                            |           |                     ||           || j        v r,| j        s%| j        |         }|                     ||           dS |                     |          }|                     || j        	                    |                     | j        
                    t          |j        j        d          |           dS )z,
        Delete the given variable.
        N)r   r	  r   r  discardr  r  r  r[   rU  rN  r   r<  r  )rM   r   r*  llvalr  s        rO   rZ  zLower.delvar*  s    T"" .../ /t111*224888 	v&&&4)))$2M)*40EKK&&&&&++d##CKK 1 1# 6 6777Lx(8$??EEEEErQ   c                     | j                             |          }| j         j        |         }|                     |||          S )N)r  )rC   rL  r  alloca_lltype)rM   r   r<  r  r  s        rO   r  zLower.allocaC  sA    ,,T22L3D9	!!$)!DDDrQ   c           	          |                     d           }t          j        | j        ||d          }|rX|| j        j        vrJ| j                            |          }| j        	                    | j        ||||| j
        j        |           |S )N$F)r   zfill)r   r  r  re   r  )r;  r   rK  r[   r1   r  rC   r  r   r  rA   re   )rM   r   r  r  
is_uservaraptrr  s          rO   r  zLower.alloca_lltypeH  s    ---
"4<(,E; ; ;  		C 4<11144V<<,,T\4d4:26(-7@ - C C C rQ   c                 n    | j         j        sd S | j         j                            | j        ||           d S rS   )rC   r   nrtr~  r[   rM   r  rg  s      rO   r~  zLower.incref\  s9    |& 	Fc377777rQ   c                     | j         j        sd S t          j        | j                  5  | j         j                            | j        ||           d d d            d S # 1 swxY w Y   d S rS   )rC   r   r   r   r[   r  r  r  s      rO   r  zLower.decrefb  s    |& 	F
 '55 	< 	<L##DL#s;;;	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	<s   'AA #A rS   ),r   r   r   r   r   rL   r   r   r   r   r   r   rL  ra  r_  rc  re  r5  r  r  r  r  r  rO  r  r  r  r  r  r  rB  rM  r  r  r  r  r   r7  rZ  r  r  r~  r  __classcell__)r   s   @rO   r   r   `  s       .N. . . . .
 K K XK%$ %$ %$N$ $ $ $ $L  J2 J2 J2X: : :>* * *
E E E&O O OL L L06 06 06dL L L4D  D  D L( ( (,? ? ?% % %N$ $ $:(( (( ((T> > >@
 
 
+ + +Z  *
 
 
9& 9& 9&v&' &' &'P  8p( p( p(d$ $ $ ! ! !* * *$,/ ,/ ,/ ,/\F F F2E E E
   (8 8 8< < < < < < <rQ   r   c                 t    	 t          j        |           S # t          $ r t          j        |           cY S w xY w)zjReturns a Literal instance if the type of value is supported;
    otherwise, return `Omitted(value)`.
    )r
   r   r   r  rE  s    rO   r  r  m  sH    $}U### $ $ $}U#####$s    77)/collectionsr   r   rU  rh   	functoolsr   llvmlite.irr=  r   r   
numba.corer   r	   r
   r   r   r   r   r   r   r   r   r   numba.core.errorsr   r   r   r   r   r   numba.core.funcdescr   numba.core.environmentr   numba.core.analysisr   r   numba.misc.firstlinefinderr   numba.misc.coverage_supportr   r    objectr$   r   r  rW   rQ   rO   <module>r     s6   / / / / / / / /             + + + + + + + +& & & & & & & & & & & & & & & & & & & & & & & & & & & &6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 0 / / / / / . . . . . . A A A A A A A A A A A A A A A A A A A A j(;<<D! D! D! D! D! D! D! D!N
J< J< J< J< J<I J< J< J<Z($ $ $ $ $rQ   