
    J/Ph2                       d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZmZm	Z	 d dl
mZmZmZ d dlmZmZ d dlmZmZmZ d dlmZmZmZmZ d dlmZ d dlmZ ed	v rd d
lmZ nedv rn e e           G d de!          Z" ej#        e$          Z% G d de!          Z&d Z'd Z(d Z)d Z*d Z+d Z,d Z-d Z.d Z/d Z0d Z1 G d de!          Z2ed	v r G d de3          Z4dS edv rdS  e e          )    N)errorsirconfig)NotDefinedErrorUnsupportedBytecodeErrorerror_extras)get_definitionguard)	PYVERSIONBINOPS_TO_OPERATORSINPLACE_BINOPS_TO_OPERATORS)FlowAdaptDFAAdaptCFA	BlockKind)eh)unpack_single_tuple      r      )CALL_INTRINSIC_1_Operandr   
   r      c                       e Zd ZdZd Zd ZdS )_UNKNOWN_VALUEzNRepresents an unknown value, this is for ease of debugging purposes only.
    c                     || _         d S N)_varname)selfvarnames     V/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/numba/core/interpreter.py__init__z_UNKNOWN_VALUE.__init__#   s        c                 6    d                     | j                  S )Nz_UNKNOWN_VALUE({}))formatr$   r%   s    r'   __repr__z_UNKNOWN_VALUE.__repr__&   s    #**4=999r)   N)__name__
__module____qualname____doc__r(   r-    r)   r'   r!   r!      s<              : : : : :r)   r!   c                   $    e Zd ZdZd Zd Zd ZdS )Assignera  
    This object keeps track of potential assignment simplifications
    inside a code block.
    For example `$O.1 = x` followed by `y = $0.1` can be simplified
    into `y = x`, but it's not possible anymore if we have `x = z`
    in-between those two instructions.

    NOTE: this is not only an optimization, but is actually necessary
    due to certain limitations of Numba - such as only accepting the
    returning of an array passed as function argument.
    c                 v    i | _         t          j        t                    | _        t                      | _        d S r#   )dest_to_srccollectionsdefaultdictlistsrc_invalidatesetunused_destsr,   s    r'   r(   zAssigner.__init__:   s1     *5d;;EEr)   c                 d   |j         }|j         }|| j        v r7| j                            |          D ]}| j                            |           || j        v r| j        |         }|j        rD|| j        |<   | j        |                             |           | j                            |           |S )z
        Assign *srcvar* to *destvar*. Return either *srcvar* or a possible
        simplified assignment source (earlier assigned to *srcvar*).
        )namer:   popr6   is_tempappendr<   add)r%   srcvardestvarsrcnamedestnameds         r'   assignzAssigner.assignB   s    
 +<t*** (,,X66 ( ( $$Q''''d&&&%g.F? 	,)/DX&(//999!!(+++r)   c                 f    || j         v r| j         |         S | j                            |           dS )zu
        Get a possible assignment source (a ir.Var instance) to replace
        *destname*, otherwise None.
        N)r6   r<   discard)r%   rF   s     r'   get_assignment_sourcezAssigner.get_assignment_sourceV   s<    
 t'''#H--!!(+++tr)   N)r.   r/   r0   r1   r(   rH   rK   r2   r)   r'   r4   r4   -   sK        
 
" " "  (    r)   r4   c                    | |         j         j        }| |         j        }||j        |         v r=|j        |                             |           ||                             |           dS |||         vrt          d          dS )a  
    Deletes the definition defined for old_body at index idx
    from func_ir. We assume this stmt will be deleted from
    new_body.

    In some optimizations we may update the same variable multiple times.
    In this situation, we only need to delete a particular definition once,
    this is tracked in already_deleted_def, which is a map from
    assignment name to the set of values that have already been
    deleted.
    zInconsistency found in the definitions while executing a peephole optimization. This suggests an internal error or inconsistency elsewhere in the compiler.N)targetr>   value_definitionsremoverB   r   )old_bodyidxfunc_iralready_deleted_defslhsrhss         r'   _remove_assignment_definitionrW   a   s     3-

#C
3-
C
g"3'''S!((---S!%%c*****	(-	-	-&A
 
 	
 
.	-r)   c                     |j                                         }|j        }|                                 D ]\  }}	|||	         d         f||	<   d||<   t          | |||           |S )a  
    Extracts the kws args passed as varkwarg
    for CALL_FUNCTION_EX. This pass is taken when
    n_kws <= 15 and the bytecode looks like:

        # Start for each argument
        LOAD_FAST  # Load each argument.
        # End for each argument
        ...
        BUILD_CONST_KEY_MAP # Build a map

    In the generated IR, the varkwarg refers
    to a single build_map that contains all of the
    kws. In addition to returning the kws, this
    function updates new_body to remove all usage
    of the map.
       N)itemscopyvalue_indexesrW   )
rQ   keyword_exprnew_bodybuildmap_idxrS   rT   kwsr\   keyindexs
             r'   #_call_function_ex_replace_kws_smallrc   z   s    2 

!
!
#
#C !.M#))++ * *
U3u:a=)E

 "H\!,)=   Jr)   c                    d||<   t          | |||           g }|dz   }	|	|k    r7| |	         }
t          |
t          j                  rt          |
j        t          j                  st          |          |
j        j        }|
j        j        }|	dz  }	d}|	|k    r|s| |	         }t          |t          j                  rWt          |j        t          j	                  r8|j        j
        dk    r(|j        j        j        |k    r|j        j        dk    rd}n|	dz  }	|	|k    r||r|	|k    rt          |          | |	dz            }t          |t          j                  rt          |j        t          j	                  rg|j        j
        dk    rW|j        j        j        |j        j        k    r8t          |j        j                  dk    r|j        j        d	         j        |k    st          |          |j        j        d         }|                    ||f           d||	<   d||	dz   <   t          | |	||           t          | |	dz   ||           |	dz  }	|	|k    7|S )
a  
    Extracts the kws args passed as varkwarg
    for CALL_FUNCTION_EX. This pass is taken when
    n_kws > 15 and the bytecode looks like:

        BUILD_MAP # Construct the map
        # Start for each argument
        LOAD_CONST # Load a constant for the name of the argument
        LOAD_FAST  # Load each argument.
        MAP_ADD # Append the (key, value) pair to the map
        # End for each argument

    In the IR generated, the initial build map is empty and a series
    of setitems are applied afterwards. THE IR looks like:

        $build_map_var = build_map(items=[])
        $constvar = const(str, ...) # create the const key
        # CREATE THE ARGUMENT, This may take multiple lines.
        $created_arg = ...
        $var = getattr(
            value=$build_map_var,
            attr=__setitem__,
        )
        $unused_var = call $var($constvar, $created_arg)

    We iterate through the IR, deleting all usages of the buildmap
    from the new_body, and adds the kws to a new kws list.
    NrY   Fgetattr__setitem__Tcall   r   )rW   
isinstancer   AssignrN   Constr   rM   r>   ExpropattrfunclenargsrA   )rQ   buildmap_namer_   
search_endr^   rS   errmsgrT   r`   search_start
const_stmtkey_var_namekey_valfound_getattrgetattr_stmtsetitem_stmtarg_vars                    r'   #_call_function_ex_replace_kws_larger}      s   N "H\!,)=   C!#L
*
$
$l+
z29--	3:+RX66	3 +6222!(-"(J&&! ' $L1L<33"|127;;" !&)Y66 &,1$% % !&+}<< $$ !A J&&! 'D 	3z)) +6222q 01|RY//	3<-rw77	3 "%//"',&+, , L&+,,11"'*/    +6222$)!,

GW%&&&!%%)!"%lG-A	
 	
 	
 	&lQ&1E	
 	
 	
 	s *
$
$t Jr)   c                 >    d||<   t          | |||           |j        S )a  
    Extracts the args passed as vararg
    for CALL_FUNCTION_EX. This pass is taken when
    n_args <= 30 and the bytecode looks like:

        # Start for each argument
        LOAD_FAST  # Load each argument.
        # End for each argument
        ...
        BUILD_TUPLE # Create a tuple of the arguments

    In the IR generated, the vararg refer
    to a single build_tuple that contains all of the
    args. In addition to returning the args, this
    function updates new_body to remove all usage
    of the tuple.
    N)rW   rZ   )rQ   
tuple_exprr^   buildtuple_idxrS   rT   s         r'   $_call_function_ex_replace_args_smallr   .  s5    4  $H^!.'+?   r)   c                 ~   d}g }t          |t          j                  rHt          |j        t          j                  r)|j        j        }	d||<   t          | |||           |dz  }nt          d          ||k    r| |         }
t          |
t          j                  rd|
j        j        |	k    rTt          |
j        t          j	                  r5|
j        j
        dk    r%|
j        j        sd||<   t          | |||           n||k    sst          |
t          j                  rY|
j        j        |	k    rIt          |
j        t          j	                  r*|
j        j
        dk    r|
j        j        t          j        k    st          |          |
j        j        j        }|
j        j        j        }| |dz
           }t          |t          j                  rLt          |j        t          j	                  r-|j        j
        dk    rt%          |j        j                  dk    st          |          |j        j        |k    rt          d          |j        j        |k    r|}	nt          |          |                    |j        j        d                    d||<   d||dz
  <   t          | |||           t          | |dz
  ||           |dz  }d}||k    rD|rB| |         }t          |t          j                  r|j        j        |	k    rd	}n|dz  }||k    r|B||k    ||k    rt          |          |ddd
         S )a  
    Extracts the args passed as vararg
    for CALL_FUNCTION_EX. This pass is taken when
    n_args > 30 and the bytecode looks like:

        BUILD_TUPLE # Create a list to append to
        # Start for each argument
        LOAD_FAST  # Load each argument.
        LIST_APPEND # Add the argument to the list
        # End for each argument
        ...
        LIST_TO_TUPLE # Convert the args to a tuple.

    In the IR generated, the tuple is created by concatenating
    together several 1 element tuples to an initial empty tuple.
    We traverse backwards in the IR, collecting args, until we
    find the original empty tuple. For example, the IR might
    look like:

        $orig_tuple = build_tuple(items=[])
        $first_var = build_tuple(items=[Var(arg0, test.py:6)])
        $next_tuple = $orig_tuple + $first_var
        ...
        $final_var = build_tuple(items=[Var(argn, test.py:6)])
        $final_tuple = $prev_tuple + $final_var
        $varargs_var = $final_tuple
    r   NrY   unreachablebuild_tuplebinoprh   TF)ri   r   rj   rN   Varr>   rW   AssertionErrorrM   rl   rm   rZ   fnoperatorrB   r   rU   rV   rp   rA   )rQ   vararg_stmtr^   rs   rS   rt   rT   ru   
total_argstarget_nameconcat_stmtlhs_namerhs_namearg_tuple_stmtkeep_looking	next_stmts                   r'   $_call_function_ex_replace_args_larger   Q  s   L LJ;	**,{("&11, "',#%j'+?	
 	
 	
 	a


 ]+++ 
$
$z*{BI..e	$"';66;,bg66 7!$55%+ 6 $(HZ )*g/C    l**;	22 +  &+"# # %rw #  %(G33%(HL88 /v666"(,1H"(,1H &j1n5N>29557"("' 7 #(+$% % ,233q88 /v666$)X55$]333&+x77& /v666$*1-   $(HZ '+HZ!^$)*g/C   **q.'3G   !OJL,,,$Z0	y")44$ "(-&' ' $)LL( !OJ; ,,,U 
$
$P \!! 'v...dddr)   c                 	   t          j        d          }t          j        t                    }| j                                        D ]v}d}g }t          |j                  D ]\  }}t          |t          j                  rt          |j        t          j                  r|j        j        dk    r|j        j        d}|j        }|j        }	|j        }
|j        }|j        }|dz
  }|}d}d}|dk    rN|sL|j        |         }t          |t          j                  r|j        j        |j        k    rd}n|dz  }|dk    r|L|
s1|r/t          |j        t          j                  r|j        j        dk    st+          |          |j        j        rt/          |j        |j        ||| |          }
n#t1          |j        |j        ||dz
  || ||          }
|}|"|	rt+          |          |}d}d}|dk    rN|sL|j        |         }t          |t          j                  r|j        j        |j        k    rd}n|dz  }|dk    r|L|st+          |          t          |j        t          j                  r/|j        j        d	k    rt3          |j        |j        ||| |          }	nXt          |j        t          j                  r|j        j        d
k    rt+          |          t5          |j        |||| ||          }	t          j                            |j        |	|
|j        |j                  }t=          |j        || |           t          j        ||j        |j                  }| j        |j        j                                      |           nt          |t          j                  rt          |j        t          j                  r|j        j        dk    r|j        j        |j        }|j        j        }|| j        v retC          | j        |                   dk    rG| j        |         d         }t          |t          j                  r|j        d
k    rt+          |          |                     |           |r=|j        "                                 |j        #                    d |D                        x| S )a_  
    This peephole rewrites a bytecode sequence unique to Python 3.10
    where CALL_FUNCTION_EX is used instead of CALL_FUNCTION_KW because of
    stack limitations set by CPython. This limitation is imposed whenever
    a function call has too many arguments or keyword arguments.

    https://github.com/python/cpython/blob/a58ebcc701dd6c43630df941481475ff0f615a81/Python/compile.c#L55
    https://github.com/python/cpython/blob/a58ebcc701dd6c43630df941481475ff0f615a81/Python/compile.c#L4442

    In particular, this change is imposed whenever (n_args / 2) + n_kws > 15.

    Different bytecode is generated for args depending on if n_args > 30
    or n_args <= 30 and similarly if n_kws > 15 or n_kws <= 15.

    This function unwraps the *args and **kwargs in the function call
    and places these values directly into the args and kwargs of the call.
    a  
        CALL_FUNCTION_EX with **kwargs not supported.
        If you are not using **kwargs this may indicate that
        you have a large number of kwargs and are using inlined control
        flow. You can resolve this issue by moving the control flow out of
        the function call. For example, if you have

            f(a=1 if flag else 0, ...)

        Replace that with:

            a_val = 1 if flag else 0
            f(a=a_val, ...)Frg   NTrY   r   	build_mapr   list_to_tuple)rM   c                     g | ]}||S r#   r2   .0xs     r'   
<listcomp>zBpeep_hole_call_function_ex_to_call_function_kw.<locals>.<listcomp>      BBB1AMQMMMr)   )$textwrapdedentr7   r8   r;   blocksvalues	enumeratebodyri   r   rj   rN   rl   rm   varkwargrq   r`   varargrM   r>   r   rZ   rc   r}   r   r   rg   ro   locrW   rO   rA   rp   clearextend)rS   rt   rT   blkblk_changedr^   istmtrg   rq   r`   r   r   start_searchvarkwarg_lockeyword_deffound
vararg_locargs_defnew_callvararg_nameexprs                         r'   .peep_hole_call_function_ex_to_call_function_kwr     s"   ( _     F '2377~$$&& WD WD ** P	" P	"GAt4++M?tz2733M? JMV++J'3"zyh = 1u+""a'''"%(<"8K";	::*'.3x}DD $$) #a''' ; ; #;#4bg>>	;
 (-0K?? 36:::$* + >#) $, CC* > $A ,	 	C  ,% ? 7v>>>!-J#H!E$//%/#&8J#7&x;;, ( 4 C C$(EE&!OJ %//%/ ! ? 7v>>>"8>27;;<$N->>  DH$N$&#0    #8>27;;'$N-@@
 7v>>>0  DH$$&#"0    7<<ItS$(4; (   .Ha*>   y4;AA$T[%56==hGGGG4++?tz2733? JMV++J%1
 z"k.7#777G0=>>!CC #/<Q?D!$00 ?TW5O5O6v>>>OOD!!!! 	DHNNHOOBBBBBCCCNr)   c           	          d} j                                         D ]\  }	 fd} |            }|j        |d         d         |d         d                  }|r2t          d           |D ]}t          |           t          d           g }g }|d         d         }	|	j        j        }
|D ]}t          |t          j                  rt          |j	        t          j
                  rz|j	        }|j        d	k    rh|j	        j        |
k    rX|j        d
k    r |                    |j        j                   |j        dk    r |                    |j        j                   J g  fd}|	j        }|r#t          d                                            |d         d         }|}|D ];}t          |t          j                  rt          |j	        t          j
                  r|j	        }|j        d	k    rW|j        j        |v s|j        j        |v r% j                            |j        j                                       |           |j        dk    r|j        j        }||v s||v r|j        d         }t          |t          j                  r|d|j        }||v r't          j
                            |g|j                  }nt          j        dt.          |j                  }|j                            d|j                  }                    t          j        |||j                             t          j
                            ||fd|j                  }t          j        |j        ||j                  }t          j        |||j                  } ||           |}t          j
                            t8          j        |||j                  }t          j        ||j        |j                  } ||           |j        }o                    |           |j        dk    rg|j        j        |
k    rWt          j
                            |j        |j                  }t          j        ||j        |j                  } ||                               |                               |           &                    |           = |t          j        ||j        |j                             |r#t          d           D ]}t          |           j        dd         }|d|d         d                  }j        |d         d         dz   d         }|z   |z   }j                                         j                            |           |r#t          d                                            nnĉ S )a  
    This peephole rewrites a bytecode sequence new to Python 3.9 that looks
    like e.g.:

    def foo(a):
        return (*a,)

    41          0 BUILD_LIST               0
                2 LOAD_FAST                0 (a)
                4 LIST_EXTEND              1
                6 LIST_TO_TUPLE
                8 RETURN_VAL

    essentially, the unpacking of tuples is written as a list which is appended
    to/extended and then "magicked" into a tuple by the new LIST_TO_TUPLE
    opcode.

    This peephole repeatedly analyses the bytecode in a block looking for a
    window between a `LIST_TO_TUPLE` and `BUILD_LIST` and...

    1. Turns the BUILD_LIST into a BUILD_TUPLE
    2. Sets an accumulator's initial value as the target of the BUILD_TUPLE
    3. Searches for 'extend' on the original list and turns these into binary
       additions on the accumulator.
    4. Searches for 'append' on the original list and turns these into a
       `BUILD_TUPLE` which is then appended via binary addition to the
       accumulator.
    5. Assigns the accumulator to the variable that exits the peephole and the
       rest of the block/code refers to as the result of the unpack operation.
    6. Patches up
    FTc                     d} t          t          t          j                                      D ]}j        |         }t	          |t
          j                  r?|j        }t	          |t
          j                  r|j	        dk    r|j
        d         }d} ||f}| r4t	          |t
          j                  r|j        j        |k    r
|||ff}|c S d S )NFr   r   T)reversedrangerp   r   ri   r   rj   rN   rl   rm   inforM   r>   )r   rR   r   rN   target_listbtregionr   s          r'   find_postive_regionz4peep_hole_list_to_tuple.<locals>.find_postive_region$  s    #E#ch--$8$899 . .C8C=D!$	22 - $
&ubg66 - %O ; ;*/*Q-K$(E"%tB .%dBI66 .#{/;>>*,sDk):'-. .r)   NrY   r   z
WINDOW: re   r   rA   c                 \                        |            | j        j        j        v rSt	          j        | j        j                           dk    sJ j        | j        j                                                  j        | j        j                                      | j                   dS )z. Adds to the new_hole and fixes up definitionsrY   N)rA   rM   r>   rO   rp   r   rN   )r   rS   new_holes    r'   append_and_fixz/peep_hole_list_to_tuple.<locals>.append_and_fixW  s    OOA&&&x}(<<<  #7#7#FGG1LLLL,QX];AACCC(7>>qwGGGGGr)   z
BLOCK:rg   _var_tupler>   rN   r   $_list_extend_gv_tupler   )rM   rN   r   r2   r   rU   rV   r   
build_listz

NEW HOLE:z
DUMP post hole:) r   rZ   r   printrM   r>   ri   r   rj   rN   rl   rm   rn   rA   dumprO   r?   ro   rq   r   r   r   Globalr   scoperedefinerg   r   r   rB   r   r   )rS   _DEBUGoffsetr   r   	peep_holer   appendsextendsinit
const_listr   r   the_build_listt2l_agnaccfnameargtmp_namer   gv_tuple	tuple_varvarasgnnewcpyheadtailtmpr   r   s   `                            @@r'   peep_hole_list_to_tupler     sZ   @ F ~++-- v vt	. . . . ." )(**F!HVAYq\F1IaL%@A	 +&&&& ! !a"IIIay|![-
 # - -A!!RY// -%agrw77 -#$7D $9 4 4$(JOz$A$A $(9#8#8$+NN18=$A$A$A$A%)Y(%:%:$+NN18=$A$A$A$A$,H	H 	H 	H 	H 	H 	H "&  *%%%HHJJJ !)A,$" M+ M+A!!RY// L+%agrw77 G/#$7D#w)33$%HMW$<$<()(@(@ %,$8$<$<QX]$K$K$K$, %-OOA$6$6$6$6!%F!2!2(,	#(G#3#3u7G7G*.)A,C'1#rv'>'> %2BG%%BE((4L+0G+;+;131D1DcVEIX2O 2OBB 8:y5<E48H8. 8. 8.H 9<	8J8J0H48H 9K 9. 9.I -5OO02	;D:B8<12 12 12-. -. -. 2409C6248H 2> 2. 2.B /1fSY59X/? /?/1yS$(/K/K(6t(<(<(<.1 +-'--8<<?<?<=E +8 +C +CC ,.9S!(DH+M+MD$2N4$8$8$8*.+CC %-OOA$6$6$6$6"&'\"9"9$%HMZ$?$?&(g&9&9$*dh&O&O')yah'I'I .t 4 4 4 4 ( 2 2 2 2$OOA.... !**** rygn)7); =  = > > > !-(((% ! !a hqqqk=F1IaL=)xq	!q 0 1 12Xo,   $$$ -...HHJJJ it	h Nr)   c                 ~   t                      }| j                                        D ]}|j        D ]}t          |                                          }|D ]1}|j                            d          r|                    |           2||z  r4t          |t          j
                  r|                    |j                   g }|j        D ];}t          |                                          |z  s|                    |           <|j                                         |j                            |           | S )zh
    This rewrite removes variables used to store the `__exit__` function
    loaded by SETUP_WITH.
    z$setup_with_exitfn)r;   r   r   r   	list_varsr>   
startswithrB   ri   r   rj   rM   rA   r   r   )rS   	dead_varsr   r   usedvr^   s          r'   peep_hole_delete_with_exitr     s=   
 I~$$&& " "H 	/ 	/D t~~''((D % %6$$%9:: %MM!$$$ i /dBI.. /MM$+...H 	& 	&D(())I5 &%%%!!!!Nr)   c           
      	   t          j        d          }t          j        t                    }| j                                        D ]B}g }i }t          j        t                    }i }d}t          |j	                  D ]\  }	}
|
}d}t          |
t          j                  rt          |
j        t          j                  r|
j        j        dk    rm|
j        j        }|	||
j        j        <   ||
j        j                                     |	           |
j        j                                        ||
j        j        <   nE|
j        j        dk    r4|	dk    r-|
j        j        j        }|j	        |	dz
           }|
j        j        }t          |t          j                  r|j        j        |k    rt          |j        t          j                  r|j        j        dk    r|j        j        d	v r|j        j        j        }|j        j        }|d
k    rA||v r=||                             |           ||                             |	dz
  |	g           n0|dk    r)|d         j        }||v r||v r||                             ||                    ||                             ||                    ||                             |	dz
             ||         D ]}t3          |j	        || |           d||<   ||= ||= ||= t3          |j	        |	| |           t5          | ||j	        ||         ||                   }||                                          ||                             |	           d}nt9          |          t          |
t          j                  rPt          |
j        t          j                  r1|
j        j        dk    r!|
j        j        j        |v r|
j        j        d	v sC|
                                D ].}|j        |v r#|j        |k    r||j        = ||j        = ||j        = /|                    |           |r=|j	                                         |j	                            d |D                        D| S )a  
    This rewrite removes d1._update_from_bytecode(d2)
    calls that are between two dictionaries, d1 and d2,
    in the same basic block. This pattern can appear as a
    result of Python 3.10 bytecode emission changes, which
    prevent large constant literal dictionaries
    (> 15 elements) from being constant. If both dictionaries
    are constant dictionaries defined in the same block and
    neither is used between the update call, then we replace d1
    with a new definition that combines the two dictionaries. At
    the bytecode translation stage we convert DICT_UPDATE into
    _update_from_bytecode, so we know that _update_from_bytecode
    always comes from the bytecode change and not user code.

    Python 3.10 may also rewrite the individual dictionaries
    as an empty build_map + many map_add. Here we again look
    for an _update_from_bytecode, and if so we replace these
    with a single constant dictionary.

    When running this algorithm we can always safely remove d2.

    This is the relevant section of the CPython 3.10 that causes
    this bytecode change:
    https://github.com/python/cpython/blob/3.10/Python/compile.c#L4048
    a  
        A DICT_UPDATE op-code was encountered that could not be replaced.
        If you have created a large constant dictionary, this may
        be an an indication that you are using inlined control
        flow. You can resolve this issue by moving the control flow out of
        the dicitonary constructor. For example, if you have

            d = {a: 1 if flag else 0, ...)

        Replace that with:

            a_val = 1 if flag else 0
            d = {a: a_val, ...)FNr   rg   r   rY   re   )rf   _update_from_bytecoderf   r   Tc                     g | ]}||S r#   r2   r   s     r'   r   z3peep_hole_fuse_dict_add_updates.<locals>.<listcomp>  r   r)   )r   r   r7   r8   r;   r   r   r9   r   r   ri   r   rj   rN   rl   rm   rM   r>   rA   rZ   r[   ro   rq   rn   r   rW   _build_new_build_mapr   r   r   )rS   rt   rT   r   r^   lit_map_def_idxlit_map_use_idxmap_updatesr   r   r   new_inststmt_build_map_out	func_namerz   rq   update_map_namern   d2_map_namelinenumr   s                        r'   peep_hole_fuse_dict_add_updatesr     s   D _ # $ $F '2377~$$&& HD HD
 &1$77 ** v	& v	&GAtH "&$	** UGz$*bg/N/N UG:=K//)-)9& 9:ODK$45#DK$45<<Q???48J4D4I4I4K4KK 011Z]f,,Q !%
 4I $'8AE?L:?D"<;;DG(/4	AA&|'927CC B(.1Y>>(.3 8   +7*<*B*G+16 M11./AA'8??EEE ,O<CCQUAJOOOO!%<<<*.q',K /? B B#./#A#A !,O < C C$/$<!" !" !" !0 @ G G$3K$@!" !" !" !0 @ G GA N N N/>/O 	!= 	!=G$A(+(/(/(<	%& %& %& 9=HW$5$5$3K$@$3K$@$/$< !>$'Ha:N!" !" !" ,@$+$3$'H$3O$D$/$@," ," !0 @ F F H H H / @ G G J J J.2 '?v&F&F F 4++2tz27332 JMY..J$)_<<JO'OOO>>++ 
2 
2C
 O33H(:::+CH5+CH5'1 OOH%%%% 	DHNNHOOBBBBBCCCNr)   c                    i }t          | j                                                  }t          |          D ]\  }\  }}g }t          |j                  D ]4\  }}t          |t          j                  r|                    |           5|rg }	|D ]}t          j	        |j
        |j                  }
|
j                            |j        d|                    |	                    |
           t          j	        |j
        |j                  }|j                            |j        |                    |	                    |           |}|	D ]A}|||<   |dz   }|j                            t          j        ||j                             |}B|dz   t          |          k     r)|||dz            d         k    rt          j        d          t          j	        |j
        |j                  }|j                            |j        |d         dz   d                    |||<   | j                            |           | S )z
    Split blocks that contain ir.PopBlock.

    This rewrite restores the IR structure to pre 3.11 so that withlifting
    can work correctly.
    r   NrY   r   zPOP_BLOCK peephole failedr   )sortedr   rZ   r   r   ri   r   PopBlockrA   Blockr   r   r   Jumprp   r   InternalErrorupdate)rS   new_block_mapsorted_blocksblk_idxlabelr   pop_block_locsr   inst
new_blocks
before_blk
popblk_blk
prev_labelnewblk
next_labeltail_blks                   r'   peep_hole_split_at_pop_blockr    sF    M7>//1122M!*=!9!9 "1 "1% ** 	) 	)GAt$,, )%%a((( 	1J# . .XciSW===
&&sx|444!!*---XciSW===
&&sx{333!!*----J$ ( (,2j)'!^
""27:37#C#C#CDDD'

{S////w{!;A!>>> !./JKKKx	sw777HM  .*<q*@*A*A!BCCC(0M*%N-(((Nr)   c                    ||         }|j         }|j        }g }g }	|D ]}
|
\  }}t          t          | |          }t	          |t
          j        t
          j        t
          j        f          r|	                    |j                   t          t          | |          }t	          |t
          j        t
          j        t
          j        f          r|		                    |j                   |		                    t          |j                             i }t          |          t          |          k    r5d t          ||	          D             }t          |          D ]
\  }}|||<   nd}t
          j                            |t          |          |||j                  }| j        |         	                    |           t          j        |t          j        |j        ||j                  |j                  S )zg
    Create a new build_map with a new set of key/value items
    but all the other info the same.
    c                     i | ]\  }}||	S r2   r2   r   r   ys      r'   
<dictcomp>z(_build_new_build_map.<locals>.<dictcomp>%  s    DDD$!QADDDr)   NrZ   sizeliteral_valuer\   r   )rM   rN   r
   r	   ri   r   rk   r   FreeVarrA   r!   r>   rp   zipr   rl   r   r   rO   rj   r   r   )rS   r>   rQ   
old_lineno	new_items
old_assign
old_targetold_bmliteral_keysr   pairkr   key_def	value_defr\   r  r   new_bms                      r'   r   r   	  s   
 *%J"JFL F 
2 
2133g")RZ@AA 	/....'155	i"(BIrz!BCC 	2MM)/**** MM.001111M
<C	NN**DD#lF*C*CDDDl++ 	! 	!DAq M!	!  W^^##J   F %%f--- 9z'z~>>
  r)   c                   $   e 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ddZd Zd Zd Zd Zd Zd Zd Zd Zd Zed             Zed             Zed             Zed             Zed             Zed             Zd ZddZ d Z!dd 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/e0d.v rd/ Z1ne0d0v rn e2e0          e0d.v rd1 Z3ne0d0v rn e2e0          d2 Z4d3 Z5d4 Z6d5 Z7d6 Z8d7 Z9d8 Z:d9 Z;d: Z<d; Z=d< Z>d= Z?d> Z@e0d?v rdd@ZAne@ZAe0d?v r
dA ZBdB ZCdC ZDne0dDv rn e2e0          e0d.v reAZEdE ZFne0d0v rn e2e0          dF ZGdG ZHdH ZIeIZJeIZKdI ZLdJ ZMdK ZNdL ZOe0dMv rdN ZPne0dOv rdP ZPn e2e0          dQ ZQe0dMv rdR ZRne0dOv rdS ZRn e2e0          e0dMv rdT ZSe0dMv rdU ZTne0dOv rdV ZTn e2e0          dW ZUddXZVdY ZWdZ ZXd[ ZYd\ ZZd] Z[d^ Z\d_ Z]d` Z^e0d?v rda Z_ne0dbk     sJ dc Z`dd Zade Zbdf Zcdg Zddh Zedi Zfdj Zgdk Zhdl Zidm Zjdn Zkdo Zldp Zmdq Zndr Zods Zpdt Zqdu Zrdv Zsdw Ztdx Zudy Zvdz Zwd{ Zxd| Zyd} Zzd~ Z{d Z|d Z}d Z~d Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZeZddZd Ze0d.v rd Zne0d0v rn e2e0          e0d?v rd Zne0dDv rn e2e0          d Zd Zd ZddZd Zd Zd Zd Zd Zd Ze0d.v rd Zd Zne0d0v rn e2e0          d Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Ze0dMv rd Zne0dOv rd Zn e2e0          d Zd Zd ZdÄ ZdĄ Zdń Ze0d.v rdƄ ZdS e0d0v rdS  e2e0          )Interpreterz2A bytecode interpreter that builds up the IR.
    Fc                 X   || _         | j        rt          |j                   |j        | _        |j        | _        t          j                            |          x| _	        | _
        |j        | _        i | _        t          j        t                    | _        t#                      | _        d S r#   )func_id_DEBUG_PRINTr   ro   	arg_count	arg_namesr   Locfrom_function_idr   	first_locis_generatorr   r7   r8   r9   definitionsr;   _exception_vars)r%   r)  s     r'   r(   zInterpreter.__init__D  s     	 ', * *$&F$;$;G$D$DD4>#0 &2488  #uur)   c           	          | _         g  _        t          j        d j                  } j                            |           t          |          }|                                 t          |           _	        t          |           _        t          j        r j                                         d _        d _        d} j        j                                        D ].\  }}|j        r"t)          |t)          |j                            }/| _        t,          dv r+t/           fd j         j        D                        _        nt,          dv rnt5          t,                    g  _        d _         j                            t          j         j         j                                                              D ]\  }}                     ||           t,          dv r                                   nt,          dv rnt5          t,                     !                                 t          j"         j         j#         j$         j%         j&         j'         j(                  }	tR          *                    |	+                                           g }
t,          dv r|
                    tX                     t,          d	v r|
                    tZ                     |
                    t\                     t,          d	v r4|
                    t^                     |
                    t`                      1                    |
|	          }|S )
z0
        Generate IR for this bytecode.
        N)parentr   r   r   c                 4    g | ]}|j         j        k     |S r2   )startlast_active_offset)r   entryr%   s     r'   r   z)Interpreter.interpret.<locals>.<listcomp>r  s2     ; ; ;5K$"999 999r)   r   r   r   r   r   )r   r   r   r   )2bytecodescopesr   Scoper   rA   r   runr   dfar   cfar   DUMP_CFGr   current_blockcurrent_block_offsetr   rZ   r   maxr7  r   r   exception_entriesactive_exception_entriesNotImplementedErrorsyntax_blocksdfainfocurrent_scope
_iter_inst	_dispatch_end_try_blocks_legalize_exception_vars
FunctionIRr0  r)  r/  r1  r+  r,  _loggerdebugdump_to_stringr  r   r   r   r   post_process)r%   r;  global_scopeflowr7  _inst_blocksr  r`   rS   	peepholespost_processed_irs   `           r'   	interpretzInterpreter.interpretU  s,    !xt:::<(((H~~


D>>D>>? 	HMMOOO "$(!"ho3355 	@ 	@NA{ @%();),[-=)>)>&@ &@""4***,1; ; ; ;DM$C ; ; ;-< -<D)) ,,,%i000284+=48LLLMMM ** 	& 	&ID#NN4%%%%333  """"*$$%i000%%'''-T-> $0@ $@ @ 	g,,../// 	3339:::<<<45553444<<<
 KLLL<=== --iAA  r)   c                 &    |D ]} ||          }|S r#   r2   )r%   rX  rS   peeps       r'   rS  zInterpreter.post_process  s%     	$ 	$Dd7mmGGr)   c           	          t           dv sJ  j        j        } j                                        D ]\  } j        j        |         j        }|                    |          D ]\  }} j        j        |         j        }t          t          ||                    D ]\  }\  }}	||	k    r n+t          t          |          t          |                    } fd}
 |
t          ||d                             r ndS )a=  Closes all try blocks by inserting the required marker at the
        exception handler

        This is only needed for py3.11 because of the changes in exception
        handling. This merely maps the new py3.11 semantics back to the old way.

        What the code does:

        - For each block, compute the difference of blockstack to its incoming
          blocks' blockstack.
        - If the incoming blockstack has an extra TRY, the current block must
          be the EXCEPT block and we need to insert a marker.

        See also: _insert_try_block_end
        r9  c                 6   | r|                                  }|d         t          d          k    rd_        t          j                  }j                                                                          j                            |           dS | d S d S )NkindTRYT)r?   r   rB  r9   r   r   _insert_try_block_endr   )remainentoldbodyblockr%   s      r'   	do_changez.Interpreter._end_try_blocks.<locals>.do_change  s      	($jjllv;)E*:*:::16D.&*5:&6&6G!J,,... 66888!J--g666#'4 ! 	( 	( 	( 	( 	(r)   N)r   r@  graphr   rZ   r?  infos
blockstackpredecessorsr   r  minrp   r9   )r%   rg  r   cur_bsincrV  inc_bsr   r   r  rf  re  s   `          @r'   rM  zInterpreter._end_try_blocks  s7     77777![..00 	 	MFEX^F+6F,,V44  Q,7 "+3vv+>+>!?!? 6 6IAv1Avv  CKKV55A
( 
( 
( 
( 
( 
( 9T&*--.. E5	 	r)   c                    | j                                         }| j                                        D ]D\  }}|D ]<}t	          |t
          j                  r |j        }||v r|                    |           =Et          t          d |                    }|rR|d         }| j                            |          j        }d}	t          j        |	                    |          |          dS )zsSearch for unsupported use of exception variables.
        Note, they cannot be stored into user variable.
        c                 .    |                      d           S )N$)r   )r   s    r'   <lambda>z6Interpreter._legalize_exception_vars.<locals>.<lambda>  s    ALL,=,=(= r)   r   z5Exception object cannot be stored into variable ({}).r   N)r2  r[   r1  rZ   ri   r   r   r>   rB   r9   filterrJ  getr   r   r   r+   )
r%   excvarsr&   defnvarsr   r"  uservarfirstr   msgs
             r'   rN  z$Interpreter._legalize_exception_vars  s   
 &++--!%!1!7!7!9!9 	- 	-GX - -a(( -AG||G,,,	- v==wGGHH 	NAJE$((//3CIC1#**U2C2CMMMM	N 	Nr)   c                     t          | j                  D ]7\  }}t          j        ||| j                  }|                     ||           8d S )N)rb   r>   r   )r   r,  r   Argr   store)r%   rb   r>   vals       r'   init_first_blockzInterpreter.init_first_block  sX    $T^44 	" 	"KE4&u4TX>>>CJJsD!!!!	" 	"r)   c              #   *  K   t          | j                                                  D ]\  }}| j        |j                 }|j        dk    r| j        |j                 }| j                            |j	                  | _        | 
                    |j                   |dk    r|                                  | j        j        D ]<\  }}| j        |         }| j                            |j	                  | _        ||fV  =|                                  d S )NEND_FORr   )r   r@  iterliveblocksr;  r   opnamenextr   with_linenolineno_start_new_blockr~  rI  insts_end_current_block)r%   blkctre  	firstinstr   r`   r  s          r'   rK  zInterpreter._iter_inst  s     %dh&=&=&?&?@@ 	& 	&LE5el3I
 9,, M).9	x++I,<==DH!!%,///zz%%'''#|1    }V,8//<<Ci##%%%%#	& 	&r)   c                 \   | j         }|                     |           | j        r| j        j        nd }||j        s|r|d         | j        j                                        v rLt          j	        | 
                    d          |d         || j                  }|                    |           n0t          j        || j                  }|                    |           | j        j        | j                 | _        t#                      | _        t&          dv r| j        r|| j        d         j        k    re| j                                        }t/          |t          j                  r1| j                             t          j        | j                             nn| j        | j        j        }|||ur|                                  d S d S d S t&          dv rD| j        r;|| j        d         j        k    r| j                                         nd S | j        9d S d S t7          t&                    )Nend$exception_checkcondtruebrfalsebrr   r   r9  r   r:  )rB  insert_blockrI  active_try_blockis_terminatedr@  rg  nodesr   Branchrt  r   rA   r   r?  rh  rC  r4   assignerr   rH  exitr?   ri   Withr   _insert_try_block_beginrG  )r%   r   oldblocktryblkbranchjmpsynblk	newtryblks           r'   r  zInterpreter._start_new_block  sG   %&!!!26,H..D(> !fUmtx~7K7K7M7M&M&M "455!%="	   '''' gf$(333$$$ x~d&?@ 

333$ T/3888!/3355F!&"'22 I*11"+dh2G2GHHH $  5I$F**0022222 %$***$$$ T/3888&**,,,,E	 $      &i000r)   c                     | j         j        s"| j        j        }||                                  |                                  |                                  d S r#   )rB  r  rI  r  _insert_exception_check_remove_unused_temporaries_insert_outgoing_phis)r%   r  s     r'   r  zInterpreter._end_current_block:  s\    !/ 	/\2F!,,...'')))""$$$$$r)   Nc                 B   t          j        ||| j                  }|                     ||d           t           j                            |                     |          dd| j                  }|pd                    |          }|                     ||d           dS )a  A helper function to inject a call to *func* which is a python
        function.
        Parameters
        ----------
        func : callable
            The function object to be called.
        gv_name : str
            The variable name to be used to store the function object.
        res_name : str; optional
            The variable name to be used to store the call result.
            If ``None``, a name is created automatically.
        r   TrN   r>   r   r2   z$callres_{}N)r   r   r   r|  rl   rg   rt  r+   )r%   ro   gv_nameres_namegv_fncallress         r'   _inject_callzInterpreter._inject_callD  s     	'4TX666

Wt
<<<',,txx00"bdh,GG<}33G<<

x$
?????r)   c                 F    |                      t          j        d           dS )z<Insert IR-nodes to mark the start of a `try` block.
        mark_try_blockN)r  r   r  r,   s    r'   r  z#Interpreter._insert_try_block_beginW  s$     	"+-=>>>>>r)   c                 F    |                      t          j        d           dS )z:Insert IR-nodes to mark the end of a `try` block.
        end_try_blockN)r  r   r  r,   s    r'   ra  z!Interpreter._insert_try_block_end\  s#     	"*O<<<<<r)   c                 F   | j         j        }|d         }| j         j                            |          }|rit	          j        d| j                  }|D ]M}|| j        v rt          d          | 	                    ||           | j
                            |           LdS dS )z?Insert IR-nodes to initialize the exception variables.
        r  NrN   r   z2exception variable CANNOT be defined by other coderN   r>   )rI  r  outgoing_edgepushedrt  r   rk   r   r1  r   r|  r2  rB   )r%   r  endblk
edgepushed
const_noner   s         r'   _insert_exception_variablesz'Interpreter._insert_exception_variablesa  s     .\599&AA
  		.$(;;;J! . .$***(L   

#
666$((----		. 		.. .r)   c                 p    |                                   |                     t          j        dd           dS )zECalled before the end of a block to inject checks if raised.
        exception_checkr  N)r  r  r   r  r,   s    r'   r  z#Interpreter._insert_exception_checku  sC     	((***",.?,	. 	. 	. 	. 	.r)   c                    g }i }| j         j        D ]}t          |t          j        t          j        f          r'|j        j        |v r||j        j                 |_        nHt          |t          j                  r-|j	        j
        r|j	        j        | j        j        v rt          |j        t          j                  r;|j        j        |v r-||j        j                 |_        |                    |           t          |j        t          j                  r[|j        j        dk    rK|j        j        j        |v r8||j        j        j                 |j        _        |                    |           dt          |j        t          j                  r|j        j
        r|rt          |d         t          j                  r|d         }|j	        j        |j        j        k    r|                     |j	        j        |j                  s|j	        ||j        j        <   |j	        |_	        | j        |j	        j                                     |j                   | j        |j	        j                                     | j                            |j        j                             |                    |           || j         _        dS )zb
        Remove assignments to unused temporary variables from the
        current block.
        exhaust_iterr   N)rB  r   ri   r   SetItemSetAttrrN   r>   rj   rM   r@   r  r<   r   rA   rl   rm   _var_used_in_binopr1  rP   r   r?   )r%   r^   replaced_varr  prev_assigns        r'   r  z&Interpreter._remove_unused_temporaries}  s   
 &+ 2	" 2	"D 4"*bj!9:: ,!
<77)$*/:

D"),, )!K'  K,0JJJ tz2622  JO|;;!-djo!>DJOOD))) tz2733  JM^;; J,1\AA'3DJ4D4I'JDJ$OOD))) tz2622 !tz7I !$!)3HRL"))L)L!"*2,K $*/4:?BB$($;$; $ 0+2C%E %E C 9=TZ_5-1[*()9:AA$*MMM()9:AA ,00AA   !OOD!!!!"*r)   c                     t          |t          j                  o(|j        dv o||j        j        k    p||j        j        k    S )zhreturn True if 'expr' is a binary expression and 'varname' is used
        in it as an argument
        )r   inplace_binop)ri   r   rl   rm   rU   r>   rV   )r%   r&   r   s      r'   r  zInterpreter._var_used_in_binop  sJ     4)) KG99K-IDHM1I	Lr)   c                 V   | j         j                                        D ]\  }}| j                            || j                  }	 |                     |          }nC# t          j        $ r1 t          dv s
J d            t          j
        d| j                  }Y nw xY wt          j        ||| j                  }| j        |j                                     |j                   | j        j        s| j                            |           | j                            |           
dS )zd
        Add assignments to forward requested outgoing values
        to subsequent blocks.
        r   r9  zunexpected missing definitionNr  rN   rM   r   )rI  outgoing_phisrZ   rJ  get_or_definer   rt  r   r   r   rk   rj   r1  r>   rA   rN   rB  r  insert_before_terminator)r%   phinamer&   rM   r}  r   s         r'   r  z!Interpreter._insert_outgoing_phis  sO   
 !% : @ @ B B 	B 	BGW'55g:>( 6 D DF9hhw''% 9 9 9 $????6 @??hTtx888	9
 93v!%+ + +DV[)00<<<%3 B"))$////";;DAAAA!	B 	Bs   A=BBc                     	 | j         j        j        |         S # t          $ r# t	          t
          |t          j                  cY S w xY w)z
        Get a global value from the func_global (first) or
        as a builtins (second).  If both failed, return a ir.UNDEFINED.
        )r)  ro   __globals__KeyErrorre   builtinsr   	UNDEFINED)r%   r>   s     r'   get_global_valuezInterpreter.get_global_value  sO    
	9<$066 	9 	9 	98T2<88888	9s    *AAc                 x    | j         j        j        |         }	 |j        S # t          $ r t
          j        cY S w xY w)z|
        Get a value from the cell contained in this function's closure.
        If not set, return a ir.UNDEFINED.
        )r)  ro   __closure__cell_contents
ValueErrorr   r  )r%   rb   cells      r'   get_closure_valuezInterpreter.get_closure_value  sM    
 | ,U3	 %% 	  	  	 <	 s     99c                     | j         d         S )Nr   )r<  r,   s    r'   rJ  zInterpreter.current_scope  s    {2r)   c                     | j         j        S r#   )r;  	co_constsr,   s    r'   code_constszInterpreter.code_consts  s    }&&r)   c                     | j         j        S r#   )r;  co_varnamesr,   s    r'   code_localszInterpreter.code_locals      }((r)   c                     | j         j        S r#   )r;  co_namesr,   s    r'   
code_nameszInterpreter.code_names  s    }%%r)   c                     | j         j        S r#   )r;  co_cellvarsr,   s    r'   code_cellvarszInterpreter.code_cellvars  r  r)   c                     | j         j        S r#   )r;  co_freevarsr,   s    r'   code_freevarszInterpreter.code_freevars  r  r)   c                    | j         rt          |           | j        J t          dv r| j        r| j        d         }t          |t          j                  r[|j        |j	        k    rK| j        
                    t          j        | j                             | j                                         nt          dv rnt          t                    d|j                            dd          z  }	 t#          | |          }	  ||fi |S # t$          j        $ r}|j        | j        }n|j        }t%          j        |j        |          }t*          j        s|d d| d	|j         }	|                    |	           |                    | j                                                   |d }~ww xY w# t4          $ r t          |          w xY w)
Nr9  r   r   r:  zop_%s+rV  zhandling op: z | offset: )r*  r   rB  r   rH  ri   r   r  r   r  rA   r   r   r?   rG  r  replacere   r   r   r>   r   FULL_TRACEBACKSadd_contextr;  r   AttributeError)
r%   r  r`   topr   r   er   errms
             r'   rL  zInterpreter._dispatch  s    	$KKK!---333! 1(,c27++ 1{ch..*11"+$(2K2K2KLLL*..000*$$%i000$+--c3777	u%%Br$#&)   5=(CC%C,QV===- 4'FFFFFAOOA&&&OODM$6$6$8$8999I  	, 	, 	,%d+++	,s%   0F1 D
 
F.BF))F.1Gc                    |s| j         | j        j        v r,|| j        v}| j                            || j        |          }n!| j                            || j                  }t          |t          j
                  r| j                            ||          }t          j        ||| j                  }| j                            |           | j        |j                                     |           |S )z
        Store *value* (a Expr or Var instance) into the variable named *name*
        (a str object). Returns the target variable.
        )r   renamer   r  )rC  r@  backboner  rJ  r   r   r  ri   r   r   r  rH   rj   rB  rA   r1  r>   )r%   rN   r>   r   r  rM   r   s          r'   r|  zInterpreter.store/  s    
  	Jt0DH4EEE$"44F'00488> 1 @ @FF '55d5IIFeRV$$ 	8M((77EyuVBBB!!$'''%,,U333r)   c                     |d         dk    r9|dd                                          rd                    |dd                   }| j                            |          }|| j                            |          }|S )zJ
        Get the variable (a Var instance) with the given *name*.
        r   .rY   Nz
implicit{})isdigitr+   r  rK   rJ  rt  )r%   r>   r   s      r'   rt  zInterpreter.getA  s{     7c>>d122h..00>&&tABBx00D m11$77;$((..C
r)   c                     |p| j         }|p| j        }t          j        ||          }|| j        |<   || _        || _        |S )N)r   r   )rJ  r   r   r   r   rB  rC  )r%   r   r   r   r   s        r'   r  zInterpreter.insert_blockS  sO    ++oTXhU,,,!F $*!
r)   c                     d S r#   r2   r%   r  s     r'   op_NOPzInterpreter.op_NOP^      r)   c                     d S r#   r2   r  s     r'   	op_RESUMEzInterpreter.op_RESUMEa  r  r)   c                     d S r#   r2   r  s     r'   op_CACHEzInterpreter.op_CACHEd  r  r)   c                     d S r#   r2   r  s     r'   
op_PRECALLzInterpreter.op_PRECALLg  r  r)   c                     d S r#   r2   r  s     r'   op_PUSH_NULLzInterpreter.op_PUSH_NULLj  r  r)   c                     d S r#   r2   r  s     r'   op_RETURN_GENERATORzInterpreter.op_RETURN_GENERATORm  r  r)   c                 F   |                      |          }t          j        dt          | j                  }|                     ||           t          j                            |                      |          |fd| j                  }|                     ||           d S Nr   r   r  r2   )rt  r   r   r   r   r|  rl   rg   )r%   r  itemprintvarresprintgvrg   s          r'   op_PRINT_ITEMzInterpreter.op_PRINT_ITEMp  s    xx~~)GU999

x
000w||DHHX..|JJ

C
(((((r)   c                    t          j        dt          | j                  }|                     ||           t           j                            |                     |          dd| j                  }|                     ||           d S r  )r   r   r   r   r|  rl   rg   rt  )r%   r  r  r	  r
  rg   s         r'   op_PRINT_NEWLINEzInterpreter.op_PRINT_NEWLINEw  su    )GU999

x
000w||DHHX..BDH|EE

C
(((((r)   c                    t          |          }t          j                            |                     |          | j        |          }|                     ||           t          |          D ]V\  }}t          j                            |                     |          |d | j                  }	|                     |	|           Wd S )N)rN   r   count)r>   rN   )rb   	index_varr   )	rp   r   rl   r  rt  r   r|  r   static_getitem)
r%   r  iterablestorestupleobjr  tupr   str   s
             r'   op_UNPACK_SEQUENCEzInterpreter.op_UNPACK_SEQUENCE}  s    Fg""(););). # 0 0


,,, v&& 	! 	!EAr7))$((8*<*<01T.2h * 8 8D JJtR    		! 	!r)   c                 2    |                      ||||          S r#   )op_FORMAT_VALUE)r%   r  rN   r	  strvars        r'   op_FORMAT_SIMPLEzInterpreter.op_FORMAT_SIMPLE  s    ##D%f===r)   c                 F   |                      |          }t          j        dt          | j                  }|                     ||           t          j                            |                      |          |fd| j                  }|                     ||           dS )z
        FORMAT_VALUE(flags): flags argument specifies format spec which is not
        supported yet. Currently, str() is simply called on the value.
        https://docs.python.org/3/library/dis.html#opcode-FORMAT_VALUE
        strr   r  r2   N)rt  r   r   r  r   r|  rl   rg   )r%   r  rN   r	  r  strgvrg   s          r'   r  zInterpreter.op_FORMAT_VALUE  s     	%$(333

V
,,,w||DHHV,,uh|II

C
(((((r)   c                    |j         }|dk    r9t          j        d| j                  }|                     ||d                    dS |                     |d                   }t          |dd         |          D ]w\  }}|                     |          }t          j                            t          j
        ||| j                  }	|                     |	|           |                     |          }xdS )z
        BUILD_STRING(count): Concatenates count strings.
        Required for supporting f-strings.
        https://docs.python.org/3/library/dis.html#opcode-BUILD_STRING
        r   r   r   r   NrY   rU   rV   r   )r   r   rk   r   r|  rt  r  rl   r   r   rB   )
r%   r  stringstmpsr  constprevotherr   r   s
             r'   op_BUILD_STRINGzInterpreter.op_BUILD_STRING  s     A::HRTX...EJJud2h'''Fxx
##gabbk400 	! 	!JE3HHUOOE7==$Etx !  D JJtS!!!88C==DD	! 	!r)   c                    |                      |          }|                      |          }t          j        dt          | j                  }|                     ||           |>t          j                            |                      |          ||fd| j                  }nS|                      |          }t          j                            |                      |          |||fd| j                  }|                     ||           d S Nslicer   r  r2   )rt  r   r   r)  r   r|  rl   rg   )	r%   r  r6  stopstepr	  slicevarslicegv	sliceinsts	            r'   op_BUILD_SLICEzInterpreter.op_BUILD_SLICE  s    xx~~)GU999

x
000<TXXh%7%7%)- % 3 3II 88D>>DTXXh%7%7%t9L%'TX % 7 7I


-----r)   r   c                 @   |                      |          }|                      |          }t          j        dt          | j                  }|                     ||           t          j                            |                      |          ||fd| j                  }	|                     |	|           |                      |          }
|                      |          }t          j                            ||
| j                  }|                     ||           d S )Nr)  r   r  r2   rb   r   	rt  r   r   r)  r   r|  rl   rg   getitem)r%   r  r6  r  	containerr	  r,  temp_resr-  r.  rb   rM   r   s                r'   op_BINARY_SLICEzInterpreter.op_BINARY_SLICE  s    HHUOOE((3--CiDH===GJJW8J444TXXh%7%7%r)- % 3 3IJJYXJ666HHX&&EXXi((F7??6DH?EEDJJtS!!!!!r)   r   c                 ^   |                      |          }|                      |          }t          j        dt          | j                  }|                     ||           t          j                            |                      |          ||fd| j                  }	|                     |	|           |                      |          }
|                      |          }|                      |          }t          j        ||
|| j                  }| j	        
                    |           d S )Nr)  r   r  r2   rM   rb   rN   r   rt  r   r   r)  r   r|  rl   rg   r  rB  rA   )r%   r  r6  r  r4  rN   r	  r,  r-  r.  rb   rM   r   s                r'   op_STORE_SLICEzInterpreter.op_STORE_SLICE  s   HHUOOE((3--CiDH===GJJW8J444TXXh%7%7%r)- % 3 3IJJYSJ111HHSMMEXXi((FHHUOOE:V5"&(, , ,D%%d+++++r)   c                 x   |                      |          }t          j        dt          | j                  }|                     ||           t          j        d | j                  }|                     ||           |                      |          }	t          j                            |                      |          |	|	fd| j                  }
|                     |
|           t          j        	                    ||                      |          | j                  }|                     ||           d S r(  )
rt  r   r   r)  r   r|  rk   rl   rg   r3  )r%   r  baser	  r,  indexvarnonevarr-  nonegvnonerb   r   s               r'   
op_SLICE_0zInterpreter.op_SLICE_0  s   xx~~)GU999

x
000$DH---

g
...xx  TXXh//$rtxPP

X
...wtTXXh%7%7TXFF

C
(((((r)   c                    |                      |          }|                      |          }t          j        d | j                  }|                     ||           |                      |          }	t          j        dt          | j                  }
|                     |
|           t          j                            |                      |          ||	fd| j                  }|                     ||           t          j        	                    ||                      |          | j                  }|                     ||           d S Nr   r  r)  r2   
rt  r   rk   r   r|  r   r)  rl   rg   r3  )r%   r  r<  r6  r>  r	  r,  r=  r?  r@  r-  rb   r   s                r'   
op_SLICE_1zInterpreter.op_SLICE_1  s   xx~~$DH---

g
...xx  )GU999

x
000TXXh//%!%  + +

X
...wtTXXh%7%7TXFF

C
(((((r)   c                    |                      |          }|                      |          }t          j        d | j                  }|                     ||           |                      |          }	t          j        dt          | j                  }
|                     |
|           t          j                            |                      |          |	|fd| j                  }|                     ||           t          j        	                    ||                      |          | j                  }|                     ||           d S rC  rD  )r%   r  r<  r>  r*  r	  r,  r=  r?  r@  r-  rb   r   s                r'   
op_SLICE_2zInterpreter.op_SLICE_2  s   xx~~xx~~$DH---

g
...xx  )GU999

x
000TXXh//$!%  + +

X
...wtTXXh%7%7TXFF

C
(((((r)   c                 >   |                      |          }|                      |          }|                      |          }t          j        dt          | j                  }|                     ||           t          j                            |                      |          ||fd| j                  }	|                     |	|           t          j                            ||                      |          | j                  }
|                     |
|           d S r(  r2  )r%   r  r<  r6  r*  r	  r,  r=  r-  rb   r   s              r'   
op_SLICE_3zInterpreter.op_SLICE_3  s    xx~~xx~~)GU999

x
000TXXh//%!%  + +

X
...wtTXXh%7%7TXFF

C
(((((r)   c                    |                      |          }t          j        dt          | j                  }|                     ||           t          j        d | j                  }|                     ||           |                      |          }	t          j                            |                      |          |	|	fd| j                  }
|                     |
|           t          j	        ||                      |          |                      |          | j                  }| j
                            |           d S r(  )rt  r   r   r)  r   r|  rk   rl   rg   r  rB  rA   )r%   r  r<  rN   r,  r=  r>  r-  r?  r@  rb   r   s               r'   op_STORE_SLICE_0zInterpreter.op_STORE_SLICE_0-  s   xx~~)GU999

x
000$DH---

g
...xx  TXXh//$rtxPP

X
...z$ 2 2DHHUOO"h( ( (!!$'''''r)   c                    |                      |          }|                      |          }t          j        d | j                  }|                     ||           |                      |          }	t          j        dt          | j                  }
|                     |
|           t          j                            |                      |          ||	fd| j                  }|                     ||           t          j	        ||                      |          |                      |          | j                  }| j
                            |           d S rC  rt  r   rk   r   r|  r   r)  rl   rg   r  rB  rA   )r%   r  r<  r6  r>  rN   r,  r=  r?  r@  r-  rb   r   s                r'   op_STORE_SLICE_1zInterpreter.op_STORE_SLICE_1>  s*   xx~~$DH---

g
...xx  )GU999

x
000TXXh//%!%  + +

X
...z$ 2 2DHHUOO"h( ( (!!$'''''r)   c                    |                      |          }|                      |          }t          j        d | j                  }|                     ||           |                      |          }	t          j        dt          | j                  }
|                     |
|           t          j                            |                      |          |	|fd| j                  }|                     ||           t          j	        ||                      |          |                      |          | j                  }| j
                            |           d S rC  rM  )r%   r  r<  r>  r*  rN   r,  r=  r?  r@  r-  rb   r   s                r'   op_STORE_SLICE_2zInterpreter.op_STORE_SLICE_2R  s*   xx~~xx~~$DH---

g
...xx  )GU999

x
000TXXh//$!%  + +

X
...z$ 2 2DHHUOO"h( ( (!!$'''''r)   c                 V   |                      |          }|                      |          }|                      |          }t          j        dt          | j                  }|                     ||           t          j                            |                      |          ||fd| j                  }	|                     |	|           t          j        ||                      |          |                      |          | j                  }
| j	        
                    |
           d S r(  r9  )r%   r  r<  r6  r*  rN   r,  r=  r-  rb   r   s              r'   op_STORE_SLICE_3zInterpreter.op_STORE_SLICE_3f  s    xx~~xx~~)GU999

x
000TXXh//%!%  + +

X
...z$ 2 2DHHUOO"h( ( (!!$'''''r)   c                 h   |                      |          }t          j        dt          | j                  }|                     ||           t          j        d | j                  }|                     ||           |                      |          }t          j                            |                      |          ||fd| j                  }	|                     |	|           t          j	        ||                      |          | j                  }
| j
                            |
           d S r(  )rt  r   r   r)  r   r|  rk   rl   rg   DelItemrB  rA   )r%   r  r<  r,  r=  r>  r-  r?  r@  rb   r   s              r'   op_DELETE_SLICE_0zInterpreter.op_DELETE_SLICE_0v  s    xx~~)GU999

x
000$DH---

g
...xx  TXXh//$rtxPP

X
...z$ 2 2AAA!!$'''''r)   c                    |                      |          }|                      |          }t          j        d | j                  }|                     ||           |                      |          }t          j        dt          | j                  }	|                     |	|           t          j                            |                      |          ||fd| j                  }
|                     |
|           t          j	        ||                      |          | j                  }| j
                            |           d S rC  rt  r   rk   r   r|  r   r)  rl   rg   rT  rB  rA   )r%   r  r<  r6  r>  r,  r=  r?  r@  r-  rb   r   s               r'   op_DELETE_SLICE_1zInterpreter.op_DELETE_SLICE_1  s   xx~~$DH---

g
...xx  )GU999

x
000TXXh//%!%  + +

X
...z$ 2 2AAA!!$'''''r)   c                    |                      |          }|                      |          }t          j        d | j                  }|                     ||           |                      |          }t          j        dt          | j                  }	|                     |	|           t          j                            |                      |          ||fd| j                  }
|                     |
|           t          j	        ||                      |          | j                  }| j
                            |           d S rC  rW  )r%   r  r<  r>  r*  r,  r=  r?  r@  r-  rb   r   s               r'   op_DELETE_SLICE_2zInterpreter.op_DELETE_SLICE_2  s   xx~~xx~~$DH---

g
...xx  )GU999

x
000TXXh//$!%  + +

X
...z$ 2 2AAA!!$'''''r)   c                 .   |                      |          }|                      |          }|                      |          }t          j        dt          | j                  }|                     ||           t          j                            |                      |          ||fd| j                  }|                     ||           t          j        ||                      |          | j                  }	| j	        
                    |	           d S r(  )rt  r   r   r)  r   r|  rl   rg   rT  rB  rA   )
r%   r  r<  r6  r*  r,  r=  r-  rb   r   s
             r'   op_DELETE_SLICE_3zInterpreter.op_DELETE_SLICE_3  s    xx~~xx~~)GU999

x
000TXXh//%!%  + +

X
...z$ 2 2AAA!!$'''''r)   c                 ~    | j         |j                 }|                     |                     |          |           d S Nr  )r  r   r|  rt  )r%   r  r	  rE   s       r'   _op_LOAD_FASTzInterpreter._op_LOAD_FAST  s9    "48,

'**
55555r)   r   c                 f    |r|                      ||           d S |                     ||           d S r#   )op_LOAD_DEREFr_  )r%   r  r	  as_load_derefs       r'   op_LOAD_FASTzInterpreter.op_LOAD_FAST  sB     .""4-----""4-----r)   c                    |j         }|dz	  }|dz  }|                     | j        |                   }|                     | j        |                   }|                     ||           |                     ||           d S N      r  )r   rt  r  r|  )	r%   r  res1res2opargoparg1oparg2src1src2s	            r'   op_LOAD_FAST_LOAD_FASTz"Interpreter.op_LOAD_FAST_LOAD_FAST  s    HEaZFRZF88D,V455D88D,V455DJJTJ---JJTJ-----r)   c                    |j         }|dz	  }|dz  }| j        |         }|                     |          }|                     ||           |                     | j        |                   }	|                     |	|           d S rf  )r   r  rt  r|  )
r%   r  store_valueload_resrk  rl  rm  dstname	dst_value	src_values
             r'   op_STORE_FAST_LOAD_FASTz#Interpreter.op_STORE_FAST_LOAD_FAST  s    HEaZFRZF&v.G--IJJYWJ555!1&!9::IJJYXJ66666r)   c                    |j         }|dz	  }|dz  }| j        |         }|                     |                     |          |           | j        |         }|                     |                     |          |           d S rf  )r   r  r|  rt  )r%   r  value1value2rk  rl  rm  rt  s           r'   op_STORE_FAST_STORE_FASTz$Interpreter.op_STORE_FAST_STORE_FAST  s    HEaZFRZF&v.GJJTXXf--GJ<<<&v.GJJTXXf--GJ<<<<<r)   )r   r   r   c                    	 | j         |j                 }|                     |                     |          |           d S # t          $ r@ t
          j                            | j                  }|                     ||           Y d S w xY w)Nr  r   r>   )	r  r   r|  rt  r   r   rl   undefr   )r%   r  r	  rE   r~  s        r'   op_LOAD_FAST_AND_CLEARz"Interpreter.op_LOAD_FAST_AND_CLEAR  s    ,*484

'!2!2
=====" , , ,$(33

5s
++++++,s   <A   AB
	B
c                     | j         |j                 }|                     |          }|                     ||           d S r^  )r  r   rt  r|  )r%   r  rN   rt  s       r'   op_STORE_FASTzInterpreter.op_STORE_FAST  s<    "48,

W
-----r)   c                     | j         |j                 }| j                            t	          j        || j                             d S Nr   )r  r   rB  rA   r   Delr   )r%   r  rt  s      r'   op_DELETE_FASTzInterpreter.op_DELETE_FAST	  s?    "48,!!"&dh"?"?"?@@@@@r)   c                     t          ||          D ]/\  }}|                     |                     |          |           0d S r^  )r  r|  rt  )r%   r  origdupedsrcdsts         r'   op_DUP_TOPXzInterpreter.op_DUP_TOPX	  sL    D%(( 	6 	6HCJJTXXc]]J5555	6 	6r)   c                     | j         |j                 }t          j        |                     |          |                     |          || j                  }| j                            |           d S )N)rM   rN   rn   r   )r  r   r   r  rt  r   rB  rA   )r%   r  rM   rN   rn   sas         r'   op_STORE_ATTRzInterpreter.op_STORE_ATTR	  sd    tx(Ztxx//txx!tx1 1 1!!"%%%%%r)   c                     | j         |j                 }t          j        |                     |          || j                  }| j                            |           d S )N)rM   rn   r   )r  r   r   DelAttrrt  r   rB  rA   )r%   r  rM   rn   r  s        r'   op_DELETE_ATTRzInterpreter.op_DELETE_ATTR	  sQ    tx(Ztxx//dIII!!"%%%%%r)   c                 H   |                      |          }t          dv r| j        |j        dz	           }n0t          dv r| j        |j                 }nt	          t                    t
          j                            ||| j                  }| 	                    ||           d S )Nr   rY   r   r   )
rt  r   r  r   rG  r   rl   re   r   r|  )r%   r  r  r	  rn   re   s         r'   op_LOAD_ATTRzInterpreter.op_LOAD_ATTR	  s    xx~~***?48q=1DD,,,?48,DD%i000'//$$(/;;

7C     r)   c                     | j         |j                 }t          |t                    rg }|D ]\}dt	          |          z  }t          j        || j                  }|                     ||d          }|	                    |           ]t
          j
                            || j                  }	nt          |t                    rg }|D ]\}dt	          |          z  }t          j        || j                  }|                     ||d          }|	                    |           ]t
          j
                            || j                  }	nt          j        || j                  }	|                     |	|           d S )Nz	$const_%sr   T)r>   r   )r  r   ri   r   r  r   rk   r   r|  rA   rl   r   	frozenset	build_set)
r%   r  r	  rN   r  r   nm	val_constrM   r#  s
             r'   op_LOAD_CONSTzInterpreter.op_LOAD_CONST#	  sm    *eU## 	2B " " 3q66)HQDH555	IBFF		&!!!!G'''99EEy)) 		2B " " 3q66)HQDH555	IBFF		&!!!!G%%bdh%77EEHU111E

5#r)   r9  c                     | j         |         }|                     |          }t          j        ||| j                  }|                     ||           d S r  )r  r  r   r   r   r|  )r%   r  rR   r	  r>   rN   gls          r'   op_LOAD_GLOBALzInterpreter.op_LOAD_GLOBAL:	  sS    ?3'D))$//E4DH555BJJr3r)   r:  c                     | j         |j                 }|                     |          }t          j        ||| j                  }|                     ||           d S r  )r  r   r  r   r   r   r|  )r%   r  r	  r>   rN   r  s         r'   r  zInterpreter.op_LOAD_GLOBAL@	  sU    ?48,D))$//E4DH555BJJr3r)   c                     d S r#   r2   r  s     r'   op_COPY_FREE_VARSzInterpreter.op_COPY_FREE_VARSH	  r  r)   c                    | j         j        j                            |j                  }|| j        v r6	 |                     |          }nt# t          $ r d}t          |          w xY w|| j	        v rL| j	        
                    |          }|                     |          }t          j        |||| j                  }|                     ||           d S N,Unsupported use of cell variable encounteredr   r)  ro   __code___varname_from_opargr   r  rt  r   rG  r  rb   r  r   r  r   r|  r%   r  r	  r>   r  ry  rR   rN   s           r'   rb  zInterpreter.op_LOAD_DEREFL	  s    <$-AA$(KKDt)))3$BB& 3 3 3HC-c2223 +++(..t44..s33ZT5dh???JJr3   A
 
A&c                 R   t          | j                  }|j        |k     r(| j        |j                 }|                     |          }nI|j        |z
  }| j        |         }|                     |          }t          j        |||| j                  }| 	                    ||           d S r  )
rp   r  r   rt  r  r  r   r  r   r|  )r%   r  r	  
n_cellvarsr>   r  rR   rN   s           r'   rb  zInterpreter.op_LOAD_DEREFZ	  s    T/00Jx*$$)$(3XXd^^h+)#...s33ZT5dh???JJr3r)   c                     d S r#   r2   r  s     r'   op_MAKE_CELLzInterpreter.op_MAKE_CELLi	  s    Dr)   c                     | j         j        j                            |j                  }|                     |          }|                     ||           d S r^  )r)  ro   r  r  r   rt  r|  )r%   r  rN   r>   s       r'   op_STORE_DEREFzInterpreter.op_STORE_DEREFm	  sJ    <$-AA$(KKDHHUOOEJJUJ.....r)   c                     t          | j                  }|j        |k     r| j        |j                 }n| j        |j        |z
           }|                     |          }|                     ||           d S r^  )rp   r  r   r  rt  r|  )r%   r  rN   r  rt  s        r'   r  zInterpreter.op_STORE_DEREFr	  so    T/00Jx*$$,TX6,TX
-BCHHUOOEJJUJ11111r)   c                     | j         |j                 | j        u sJ t          j        |j        |j        |j        z             }| j                            |           d S )Nr  )	r   r   rB  r   Loopr  r   rH  rA   )r%   r  loops      r'   op_SETUP_LOOPzInterpreter.op_SETUP_LOOP}	  s[    {4;'4+=====wt{$)dh*>@@@!!$'''''r)   c                    | j         |j                 | j        u sJ |j        |j        z   }t          j        |j        |          }| j                            |           | 	                    |          }| j                            t          j
        ||j        || j                             t          j        d | j                  }|                     ||           d S )Nr  contextmanagerbeginr  r   r   r  )r   r   rB  r  r   r   r  rH  rA   rt  	EnterWithr   rk   r|  )r%   r  r  exitfnexitptwthctxmgrexit_fn_objs           r'   op_SETUP_WITHzInterpreter.op_SETUP_WITH	  s    {4;'4+=====TX%gdk///!!#&&&.))!!",f59[39tx#J #J #J 	K 	K 	K
 ht222

6
22222r)   c                 P   | j         |j                 | j        u sJ t          dv r,| j        k    r t          fd| j        D                       nt          dv rnt          t                    t          j	        |j                  }| j
                            |           |                     |          }| j                            t          j        ||j        | j                             t          j        d | j                  }|                     ||           d S )Nr   c                 4    g | ]}|j         k    |j        S r2   )rM   r  )r   exr  s     r'   r   z.Interpreter.op_BEFORE_WITH.<locals>.<listcomp>	  s1     0 0 0b i3.. 6...r)   r   r  r  r   r  )r   r   rB  r   r7  rD  rF  rG  r   r  rH  rA   rt  r  r   rk   r|  )r%   r  r  r  r  r  r  r  s       `   r'   op_BEFORE_WITHzInterpreter.op_BEFORE_WITH	  sC   {4;'4+=====***T,,, 0 0 0 0D,I 0 0 0 1 1,,,%i000gdk,,,!!#&&&.))!!",f59[36DH#G #G #G 	H 	H 	H
 ht222

6
22222r)   c                 .    |                                   d S r#   )r  r  s     r'   op_SETUP_FINALLYzInterpreter.op_SETUP_FINALLY	  s    $$&&&&&r)   c                     dS zno-opNr2   r  s     r'   op_WITH_CLEANUPzInterpreter.op_WITH_CLEANUP	        r)   c                     dS r  r2   r  s     r'   op_WITH_CLEANUP_STARTz!Interpreter.op_WITH_CLEANUP_START	  r  r)   c                     dS r  r2   r  s     r'   op_WITH_CLEANUP_FINISHz"Interpreter.op_WITH_CLEANUP_FINISH	  r  r)   c                     dS r  r2   r  s     r'   op_END_FINALLYzInterpreter.op_END_FINALLY	  r  r)   c                     t          j        d | j                  }|D ]3}|                     ||           | j                            |           4d S )Nr   r}  )r   rk   r   r|  r2  rB   )r%   r  tempsr  r   s        r'   op_BEGIN_FINALLYzInterpreter.op_BEGIN_FINALLY	  sa    Xd111
 	* 	*CJJzJ,,, $$S))))	* 	*r)   c           	                                |          } fd|D             }|ft          dk     sJ  j        |         }t          t	          ||t          |           d                              }|d t          |                    }nd}t          j                            ||| j	                  } 
                    ||           d S )Nc                 :    g | ]}                     |          S r2   rt  r   r   r%   s     r'   r   z'Interpreter.op_CALL.<locals>.<listcomp>	  #    ******r)   r   r2   r   )rt  r   r  r9   r  rp   r   rl   rg   r   r|  )	r%   r  ro   rq   kw_namesr	  nameskwargsr   s	   `        r'   op_CALLzInterpreter.op_CALL	  s    xx~~****T***w&&&&$X.E#eT3u::+,,%78899F#e**%DDFw||D$DH|==

4r)   c           	                                |          } fd|D             }t          |                    dd          d                   } j        |         }t	          t          ||t          |           d                              }|d t          |                    }t          j        	                    ||| j
                  }	                     |	|           d S )Nc                 :    g | ]}                     |          S r2   r  r  s     r'   r   z*Interpreter.op_CALL_KW.<locals>.<listcomp>	  s#    ...ADHHQKK...r)   r  rh   r   r   )rt  intrsplitr  r9   r  rp   r   rl   rg   r   r|  )
r%   r  ro   rq   r  r	  constir  r  r   s
   `         r'   
op_CALL_KWzInterpreter.op_CALL_KW	  s    88D>>D.......Da00455F$V,E#eT3u::+,,%78899F#e**%D7<<dF<AADJJtS!!!!!r)   r   c                                            |          } fd|D             }t          j                            ||d j                  }                     ||           d S )Nc                 :    g | ]}                     |          S r2   r  r  s     r'   r   z0Interpreter.op_CALL_FUNCTION.<locals>.<listcomp>	  r  r)   r2   r   rt  r   rl   rg   r   r|  )r%   r  ro   rq   r	  r   s   `     r'   op_CALL_FUNCTIONzInterpreter.op_CALL_FUNCTION	  sb    xx~~****T***w||D$|99

4r)   c                                           |          } fd|D             }                      |          } j        j        D ]}t          |t          j                  r|j        |u r j                            |           g }|j        j	        D ]`} j        j        d d d         D ]H}||j        k    r; j                            |           |
                    |j        j                    nIa|}	 nt          |	          }
|d |
          }||
 d          }t          t          |	|                    }t          j                            ||| j                  }                     ||           d S )Nc                 :    g | ]}                     |          S r2   r  r  s     r'   r   z3Interpreter.op_CALL_FUNCTION_KW.<locals>.<listcomp>	  r  r)   r   r   )rt  rB  r   ri   r   rj   rM   rP   rN   rZ   rA   rp   r9   r  rl   rg   r   r|  )r%   r  ro   rq   r  r	  named_itemsr   r  keysnkeysposvalskwvals	keyvaluesr   s   `              r'   op_CALL_FUNCTION_KWzInterpreter.op_CALL_FUNCTION_KW	  s   xx~~****T***&+ 	 	D$	** t{e/C/C"))$/// !) " "A!/4TTrT: " "== .55a888'..qw}===!E ) #D		ww-ufggT6**++	w||D'9$(|CC

4r)   c                    |                      |          }|                      |          }||                      |          }t          j                            |g g | j        ||          }|                     ||           d S )N)r   r   r   r  )r%   r  ro   r   r   r	  r   s          r'   op_CALL_FUNCTION_EXzInterpreter.op_CALL_FUNCTION_EX	  s~    xx~~&!!xx))Hw||"bdhv  
 
 	

4r)   c                    |                      |d                   }|rd}t          j        |t          | j                  }|                     ||d           t          j                            |                      |          |fd| j                  }|                     ||d                    d S | j        }	t          t          | j         |dd                    |          D ]\  }
}t          j        d	t          |	
          }|                     |dd          }t          j                            ||
fd|	          }|                     |dd          }t          j                            t          j        ||                      |j                  | j                  }|                     ||           |                      |          }d S )Nr   r   r   Tr  r2   rq   r`   r   rY   r   r   r   )r   z	$_tuplifyr   )rt  r   r   r   r   r|  rl   rg   r  mapr   r   r   rB   r>   )r%   r  tuplesr  	is_assignrx  r  r  excr   r%  r   r   r   tuplify_valtuplify_varouts                    r'   _build_tuple_unpackzInterpreter._build_tuple_unpack
  s   ##  	& ,GIg':JJJEJJU4J@@@',,txx00xR#'8  . .CJJsE!H%%%%%(C!#dhqrr
";";UCC & &
s9    !JJ6 '  	 !gllx +   #jjk26 ) 8 8gmm|DHH[=M4N4N $   

3$$$)& &r)   c                 6    |                      ||||           d S r#   r  r%   r  r  r  r  s        r'   op_BUILD_TUPLE_UNPACK_WITH_CALLz+Interpreter.op_BUILD_TUPLE_UNPACK_WITH_CALL,
  s"      vui@@@@@r)   c                 6    |                      ||||           d S r#   r  r  s        r'   op_BUILD_TUPLE_UNPACKz!Interpreter.op_BUILD_TUPLE_UNPACK0
  s"      vui@@@@@r)   c                     t           j                            d|f| j                  }|                     ||           d S )Nr   r   )r   rl   dummyr   r|  )r%   r  r   r	  r   s        r'   op_LIST_TO_TUPLEzInterpreter.op_LIST_TO_TUPLE3
  s9    w}}_zm}JJ

4r)   c           	      ,                          |          } j        j        D ]}t          |t          j                  r|j        |u r j                            |           g }|j        j	        D ]`} j        j        d d d         D ]H}	||	j        k    r; j                            |	           |
                    |	j        j                    nIa|}
 nt          |
          t          |          k    sJ  fd|
D             }t          ||          D ]\  }}                     ||           t          t          t           j         |          t           j         |                              }g }|D ]b} j        |         }t          |          dk    r n?|d         }t          |t          j                  s n|
                    |j                   c fdt          |          t          |          k    rfdt          |
|          D             }nd t          |
|          D             }i }t%          |
          D ]
\  }}|||<   t          j                            |d|| j        	          }                     ||           d S )
Nr   c                 F    g | ]}t          j        |j                   S )r  )r   rk   r   r  s     r'   r   z6Interpreter.op_BUILD_CONST_KEY_MAP.<locals>.<listcomp>K
  s*    EEERXA48444EEEr)   rY   r   c                 2   j         |          }t          |          dk    r't                              |           j                  S |d         }t          |t          j                  s't                              |           j                  S |j        S )NrY   r   )	r1  rp   r!   rt  r>   ri   r   rk   rN   )r   defnsdefnr%   s      r'   resolve_constz9Interpreter.op_BUILD_CONST_KEY_MAP.<locals>.resolve_const[
  sz    $Q'E5zzQ%dhhqkk&67778DdBH-- 8%dhhqkk&6777:r)   c                 .    i | ]\  }}| |          S r2   r2   )r   r   r  r  s      r'   r  z6Interpreter.op_BUILD_CONST_KEY_MAP.<locals>.<dictcomp>e
  s5     1 1 1DAqA}}Q// 1 1 1r)   c                     i | ]\  }}||	S r2   r2   r  s      r'   r  z6Interpreter.op_BUILD_CONST_KEY_MAP.<locals>.<dictcomp>h
  s    GGGDAqAaGGGr)   rh   r  )rt  rB  r   ri   r   rj   rM   rP   rN   rZ   rA   rp   r  r|  r9   r  r1  rk   r   rl   r   r   )r%   r  r  keytmpsr   r	  keyvarr  r   r  keytup	keyconstskvalr   rZ   literal_itemsr   r  r  literal_dictr\   r   r"  r   r  s   `                       @r'   op_BUILD_CONST_KEY_MAPz"Interpreter.op_BUILD_CONST_KEY_MAP7
  s    $&+ 	 	D$	** t{f/D/D"))$/// !) " "A!/4TTrT: " "== .55a888'..qw}===!E ) %6{{c&kk))))EEEEfEEE	Y00 	" 	"ID#JJtS!!!!STXw//TXv1F1FGGHH  	- 	-A$Q'E5zzQ8DdBH--   ,,,,	 	 	 	 	 }V,,1 1 1 1//1 1 1LL HGC,F,FGGGL f%% 	! 	!DAq M!w  u&'/;/<%)X	 ! / / 	

4r)   c                     t           j                            |                     |          | j                  }|                     ||           d S )Nr  )r   rl   getiterrt  r   r|  r%   r  rN   r	  r   s        r'   op_GET_ITERzInterpreter.op_GET_ITERz
  s?    wTXXe__$(CC

4r)   c                    |j         | j        v s
J d            |                     |          }t          j                            || j                  }|                     ||           t          j                            |                     |          | j                  }|                     ||           t          j        	                    |                     |          | j                  }	|                     |	|           t          j
        |                     |          |j        |                                | j                  }
| j                            |
           dS )z:
        Assign new block other this instruction.
        zFOR_ITER must be block headr  r  N)r   r   rt  r   rl   iternextr   r|  
pair_firstpair_secondr  r  get_jump_targetrB  rA   )r%   r  iteratorr!  indvalpredr}  pairvalr  isvalidbrs              r'   op_FOR_ITERzInterpreter.op_FOR_ITER~
  s4    {dk)))+H))) hhx  '""$(";;

7D!!!7%%DHHTNN%II

8V$$$'%%DHHTNN%II

7D!!! YDHHTNN49#33558% % % 	!!"%%%%%r)   c                     |                      |          }|                      |          }t          j                            ||| j                  }|                     ||           d S )Nr1  )rt  r   rl   r3  r   r|  )r%   r  rM   rb   r	  r   s         r'   op_BINARY_SUBSCRzInterpreter.op_BINARY_SUBSCR
  sW    &!!wvUAA

4r)   c                     |                      |          }|                      |          }|                      |          }t          j        |||| j                  }| j                            |           d S )Nr8  )rt  r   r  r   rB  rA   )r%   r  rM   rb   rN   r   s         r'   op_STORE_SUBSCRzInterpreter.op_STORE_SUBSCR
  so    &!!zuE"h( ( (!!$'''''r)   c                     |                      |          }|                      |          }t          j        ||| j                  }| j                            |           d S )N)rM   rb   r   )rt  r   rT  r   rB  rA   )r%   r  rM   rb   r   s        r'   op_DELETE_SUBSCRzInterpreter.op_DELETE_SUBSCR
  sW    &!!zu$(CCC!!$'''''r)   c                      t           j                             fd|D              j                  }                     ||           d S )Nc                 :    g | ]}                     |          S r2   r  r  s     r'   r   z.Interpreter.op_BUILD_TUPLE.<locals>.<listcomp>
  s#    )E)E)E!$((1++)E)E)Er)   rZ   r   )r   rl   r   r   r|  r%   r  rZ   r	  r   s   `    r'   op_BUILD_TUPLEzInterpreter.op_BUILD_TUPLE
  sU    w"")E)E)E)Eu)E)E)E'+x # 1 1

4r)   c                      t           j                             fd|D              j                  }                     ||           d S )Nc                 :    g | ]}                     |          S r2   r  r  s     r'   r   z-Interpreter.op_BUILD_LIST.<locals>.<listcomp>
  s#    (D(D(D!(D(D(Dr)   r+  )r   rl   r   r   r|  r,  s   `    r'   op_BUILD_LISTzInterpreter.op_BUILD_LIST
  sU    w!!(D(D(D(De(D(D(D&*h " 0 0

4r)   c                      t           j                             fd|D              j                  }                     ||           d S )Nc                 :    g | ]}                     |          S r2   r  r  s     r'   r   z,Interpreter.op_BUILD_SET.<locals>.<listcomp>
  s#    'C'C'C'C'C'Cr)   r+  )r   rl   r  r   r|  r,  s   `    r'   op_BUILD_SETzInterpreter.op_BUILD_SET
  sU    w  'C'C'C'CU'C'C'C%)X ! / /

4r)   c                 |   |                      |          }|                      |          }t          j                            |d| j                  }|                     ||           t          j                            |                      |          |fd| j                  }|                     ||           d S )Nr  r   r  r2   rt  r   rl   re   r   r|  rg   r%   r  rM   rN   	updatevarr	  
updateattr
updateinsts           r'   op_SET_UPDATEzInterpreter.op_SET_UPDATE
      &!!W__VX48_DD


)
444W\\$((9"5"5x&*h " 0 0


#
.....r)   c                 |   |                      |          }|                      |          }t          j                            |d| j                  }|                     ||           t          j                            |                      |          |fd| j                  }|                     ||           d S )Nr   r   r  r2   r5  r6  s           r'   op_DICT_UPDATEzInterpreter.op_DICT_UPDATE
  s    &!! W__+ % 
 

 	

)
444W\\$((9"5"5x&*h " 0 0


#
.....r)   c                 l     fd|D             } fd} |d |D                       } |d |D                       }t          |          t          |          k    }	t          |          t          |          k    }
i }|	s|
sd }nm|	r7|
s5d t          ||          D             }t          |          D ]
\  }}|||<   n4d t          ||          D             }t          |          D ]
\  }}|||<   t          j                            |||| j                  }                     ||           d S )Nc                 j    g | ]/\  }}                     |                               |          f0S r2   r  )r   r"  r   r%   s      r'   r   z,Interpreter.op_BUILD_MAP.<locals>.<listcomp>
  s6    BBBDAqdhhqkk488A;;/BBBr)   c                     g }fd| D             }|D ]g}j         |j                 }t          |          dk    r n?|d         }t          |t          j                  s n|                    |j                   h|S )Nc                 D    g | ]}                     |j                  S r2   )rt  r>   )r   r   r%   s     r'   r   zBInterpreter.op_BUILD_MAP.<locals>.get_literals.<locals>.<listcomp>
  s'    7771dhhqv&&777r)   rY   r   )r1  r>   rp   ri   r   rk   rA   rN   )rM   r  r   r   r  r  r%   s         r'   get_literalsz.Interpreter.op_BUILD_MAP.<locals>.get_literals
  s    M7777777F 1 1(0u::??EQx!$11 E$$TZ0000  r)   c              3   &   K   | ]}|d          V  dS )r   Nr2   r   s     r'   	<genexpr>z+Interpreter.op_BUILD_MAP.<locals>.<genexpr>
  s&      #<#<QAaD#<#<#<#<#<#<r)   c              3   &   K   | ]}|d          V  dS )rY   Nr2   r   s     r'   rD  z+Interpreter.op_BUILD_MAP.<locals>.<genexpr>
  s&      %>%>qad%>%>%>%>%>%>r)   c                 @    i | ]\  }}|t          |d                    S )rY   )r!   r  s      r'   r  z,Interpreter.op_BUILD_MAP.<locals>.<dictcomp>
  s6     : : :1A~ad33 : : :r)   c                     i | ]\  }}||	S r2   r2   r  s      r'   r  z,Interpreter.op_BUILD_MAP.<locals>.<dictcomp>
  s    OOOTQAqOOOr)   r  )rp   r  r   r   rl   r   r   r|  )r%   r  rZ   r  r	  	got_itemsrB  r   literal_valueshas_literal_keyshas_literal_valuesr\   r  r   r"  r   s   `               r'   op_BUILD_MAPzInterpreter.op_BUILD_MAP
  s   BBBBEBBB	
	! 	! 	! 	! 	! $|#<#<)#<#<#<<<%%>%>I%>%>%>>>|,,I> 00C	NNB 
	%(: 
	%LL 	%&8 	%: :i88: : :L!,// % %1#$a  % POS~-N-NOOOL!,// % %1#$a  w  yt/;/<%)X ! / / 	

4r)   c                     t          j        |                     |          |                     |          |                     |          | j                  }| j                            |           d S )N)dctra   rN   r   )r   StoreMaprt  r   rB  rA   )r%   r  rN  ra   rN   r   s         r'   op_STORE_MAPzInterpreter.op_STORE_MAP
  sa    {txx}}$((3--!%%dh@ @ @!!$'''''r)   c                     |                      |          }t          j                            d|| j                  }|                     ||          S )N-r  rt  r   rl   unaryr   r|  r  s        r'   op_UNARY_NEGATIVEzInterpreter.op_UNARY_NEGATIVE  @    w}}S48}<<zz$$$$r)   c                     |                      |          }t          j                            d|| j                  }|                     ||          S )Nr  r  rS  r  s        r'   op_UNARY_POSITIVEzInterpreter.op_UNARY_POSITIVE  rV  r)   c                     |                      |          }t          j                            d|| j                  }|                     ||          S )N~r  rS  r  s        r'   op_UNARY_INVERTzInterpreter.op_UNARY_INVERT  rV  r)   c                     |                      |          }t          j                            d|| j                  }|                     ||          S )Nnotr  rS  r  s        r'   op_UNARY_NOTzInterpreter.op_UNARY_NOT  s@    w}}U%TX}>>zz$$$$r)   c                     t           |         }|                     |          }|                     |          }t          j                            |||| j                  }|                     ||           d S )Nr   )r   rt  r   rl   r   r   r|  )r%   rm   rU   rV   r	  r   s         r'   _binopzInterpreter._binop  sa     $hhsmmhhsmmw}}RSctx}@@

4r)   c                    t           |         }t          |dz            }|                     |          }|                     |          }t          j                            ||||| j                  }|                     ||           d S )N=r   )r   r   rt  r   rl   r  r   r|  )r%   rm   rU   rV   r	  immuopr   s          r'   _inplace_binopzInterpreter._inplace_binop  s{    $R((c2hhsmmhhsmmw$$RSc)- % 3 3

4r)   c                     d|v r"|                      |d d         |||           d S |                     ||||           d S )Nrb  r   )rd  r`  )r%   r  rm   rU   rV   r	  s         r'   op_BINARY_OPzInterpreter.op_BINARY_OP'  sQ    "993B3c377777KKCc*****r)   c                 6    |                      d|||           d S Nr  r`  r%   r  rU   rV   r	  s        r'   op_BINARY_ADDzInterpreter.op_BINARY_ADD-       Cc3'''''r)   c                 6    |                      d|||           d S NrR  ri  rj  s        r'   op_BINARY_SUBTRACTzInterpreter.op_BINARY_SUBTRACT0  rl  r)   c                 6    |                      d|||           d S N*ri  rj  s        r'   op_BINARY_MULTIPLYzInterpreter.op_BINARY_MULTIPLY3  rl  r)   c                 6    |                      d|||           d S Nz/?ri  rj  s        r'   op_BINARY_DIVIDEzInterpreter.op_BINARY_DIVIDE6       D#sC(((((r)   c                 6    |                      d|||           d S N/ri  rj  s        r'   op_BINARY_TRUE_DIVIDEz!Interpreter.op_BINARY_TRUE_DIVIDE9  rl  r)   c                 6    |                      d|||           d S Nz//ri  rj  s        r'   op_BINARY_FLOOR_DIVIDEz"Interpreter.op_BINARY_FLOOR_DIVIDE<  rw  r)   c                 6    |                      d|||           d S N%ri  rj  s        r'   op_BINARY_MODULOzInterpreter.op_BINARY_MODULO?  rl  r)   c                 6    |                      d|||           d S Nz**ri  rj  s        r'   op_BINARY_POWERzInterpreter.op_BINARY_POWERB  rw  r)   c                 6    |                      d|||           d S N@ri  rj  s        r'   op_BINARY_MATRIX_MULTIPLYz%Interpreter.op_BINARY_MATRIX_MULTIPLYE  rl  r)   c                 6    |                      d|||           d S Nz<<ri  rj  s        r'   op_BINARY_LSHIFTzInterpreter.op_BINARY_LSHIFTH  rw  r)   c                 6    |                      d|||           d S Nz>>ri  rj  s        r'   op_BINARY_RSHIFTzInterpreter.op_BINARY_RSHIFTK  rw  r)   c                 6    |                      d|||           d S N&ri  rj  s        r'   op_BINARY_ANDzInterpreter.op_BINARY_ANDN  rl  r)   c                 6    |                      d|||           d S N|ri  rj  s        r'   op_BINARY_ORzInterpreter.op_BINARY_ORQ  rl  r)   c                 6    |                      d|||           d S N^ri  rj  s        r'   op_BINARY_XORzInterpreter.op_BINARY_XORT  rl  r)   c                 6    |                      d|||           d S rh  rd  rj  s        r'   op_INPLACE_ADDzInterpreter.op_INPLACE_ADDW  "    Cc3/////r)   c                 6    |                      d|||           d S rn  r  rj  s        r'   op_INPLACE_SUBTRACTzInterpreter.op_INPLACE_SUBTRACTZ  r  r)   c                 6    |                      d|||           d S rq  r  rj  s        r'   op_INPLACE_MULTIPLYzInterpreter.op_INPLACE_MULTIPLY]  r  r)   c                 6    |                      d|||           d S ru  r  rj  s        r'   op_INPLACE_DIVIDEzInterpreter.op_INPLACE_DIVIDE`  "    D#sC00000r)   c                 6    |                      d|||           d S ry  r  rj  s        r'   op_INPLACE_TRUE_DIVIDEz"Interpreter.op_INPLACE_TRUE_DIVIDEc  r  r)   c                 6    |                      d|||           d S r}  r  rj  s        r'   op_INPLACE_FLOOR_DIVIDEz#Interpreter.op_INPLACE_FLOOR_DIVIDEf  r  r)   c                 6    |                      d|||           d S r  r  rj  s        r'   op_INPLACE_MODULOzInterpreter.op_INPLACE_MODULOi  r  r)   c                 6    |                      d|||           d S r  r  rj  s        r'   op_INPLACE_POWERzInterpreter.op_INPLACE_POWERl  r  r)   c                 6    |                      d|||           d S r  r  rj  s        r'   op_INPLACE_MATRIX_MULTIPLYz&Interpreter.op_INPLACE_MATRIX_MULTIPLYo  r  r)   c                 6    |                      d|||           d S r  r  rj  s        r'   op_INPLACE_LSHIFTzInterpreter.op_INPLACE_LSHIFTr  r  r)   c                 6    |                      d|||           d S r  r  rj  s        r'   op_INPLACE_RSHIFTzInterpreter.op_INPLACE_RSHIFTu  r  r)   c                 6    |                      d|||           d S r  r  rj  s        r'   op_INPLACE_ANDzInterpreter.op_INPLACE_ANDx  r  r)   c                 6    |                      d|||           d S r  r  rj  s        r'   op_INPLACE_ORzInterpreter.op_INPLACE_OR{  r  r)   c                 6    |                      d|||           d S r  r  rj  s        r'   op_INPLACE_XORzInterpreter.op_INPLACE_XOR~  r  r)   c                     t          j        |                                | j                  }| j                            |           d S r  r   r   r  r   rB  rA   r%   r  r  s      r'   op_JUMP_ABSOLUTEzInterpreter.op_JUMP_ABSOLUTE  A    gd**,,$(;;;!!#&&&&&r)   c                     t          j        |                                | j                  }| j                            |           d S r  r  r  s      r'   op_JUMP_FORWARDzInterpreter.op_JUMP_FORWARD  r  r)   c                     t          j        |                                | j                  }| j                            |           d S r  r  r  s      r'   op_JUMP_BACKWARDzInterpreter.op_JUMP_BACKWARD  r  r)   c                     || j                                          d S |dk    r6t          j        | j                  }| j                            |           d S |dk    r|                                  d S d S )Nwithr   try)rH  r?   r   r   r   rB  rA   ra  )r%   r  r_  rG   s       r'   op_POP_BLOCKzInterpreter.op_POP_BLOCK  s    <""$$$$$V^^)))A%%a(((((U]]&&((((( ]r)   c                 0   |                      t          j                            |                     |          | j                  |           t          j        |                     |          | j                  }| j                            |           d S r  )	r|  r   rl   castrt  r   ReturnrB  rA   )r%   r  retvalcastvalrets        r'   op_RETURN_VALUEzInterpreter.op_RETURN_VALUE  su    

27<< 0 0dh<??IIIi))tx888!!#&&&&&r)   c                    | j         |j                 }t          j        || j                  }|                     ||           |                     t          j                            |                     |          | j                  |           t          j	        |                     |          | j                  }| j
                            |           d S r  )r  r   r   rk   r   r|  rl   r  rt  r  rB  rA   )r%   r  r  r  rN   r#  r  s          r'   op_RETURN_CONSTzInterpreter.op_RETURN_CONST  s    $TX.EHU111EJJuf%%%JJrw||DHHV$4$4$(|CCWMMM)DHHW--48<<<C%%c*****r)   c                 X    |                      |                     |          |           d S r#   )r|  rt  )r%   r  r}  r	  s       r'   
op_TO_BOOLzInterpreter.op_TO_BOOL  s&    JJtxx}}c*****r)   c                    t           dv rt          j        |j        dz	           }nYt           dv rt          j        |j        dz	           }n5t           dv rt          j        |j                 }nt	          t                     |dk    s|dk    r||}}|dk    rl|                     d|||           |                     |          }t          j        	                    d|| j
        	          }|                     ||           d S |d
k    rt          j        dt          j        | j
                  }d}	|                     ||	d           |                     |          }|                     |          }t          j                            |                     |	          ||fd| j
                  }
|                     |
|           d S |                     ||||           d S )Nr`     )r   rg  r   inznot inr]  r  zexception matchexception_matchr   
$exc_matchTr  r2   r  )r   discmp_opr   rG  r`  rt  r   rl   rT  r   r|  r   r   r  rg   )r%   r  rU   rV   r	  rm   r   r  r  exc_match_namer  s              r'   op_COMPARE_OPzInterpreter.op_COMPARE_OP  s   
""DHM*BB*$$DHM*BB,,,DH%BB%i000::xCC>>KKc3,,,((3--C'--Sdh-??CJJsC     $$$I!2#548  E *NJJU$JGGG((3--C((3--C',,((Szrtx   C JJsC     KKCc*****r)   c                 T    |j         dk    rdnd}|                     ||||           d S )NrY   is notis)r   r`  )r%   r  rU   rV   r	  rm   s         r'   op_IS_OPzInterpreter.op_IS_OP  s3    QXXDBS#&&&&&r)   c                     ||}}|                      d|||           |j        dk    rT|                     |          }t          j                            d|| j                  }|                     ||           d S d S )Nr  rY   r]  r  )r`  r   rt  r   rl   rT  r   r|  )r%   r  rU   rV   r	  r   r  s          r'   op_CONTAINS_OPzInterpreter.op_CONTAINS_OP  sy    SD#sC(((8q==((3--C'--Sdh-??CJJsC      =r)   c                     |0| j         d         }t          |t          j                  sJ |j        }t          j        || j                  }| j                            |           d S )Nr   )rM   r   )	rH  ri   r   r  r  r   r   rB  rA   )r%   r  r  r  r  s        r'   op_BREAK_LOOPzInterpreter.op_BREAK_LOOP  sf    ;%b)DdBG,,,,,)CgSdh///!!#&&&&&r)   c                 2   |                                 |j        d}||         }||          }d|j        z  }t          j        dt
          | j                  }|                     ||           t          j        	                    | 
                    |          | 
                    |          fd| j                  }	d|j        z  }
|                     |	|
          }t          j        |||| j                  }| j                            |           d S )	N)TFzbool%sboolr   r  r2   z$%spredr  )r  r  r   r   r   r  r   r|  rl   rg   rt  r  rB  rA   )r%   r  r  iftruebrsr  r  r>   r  r  pname	predicatebras                r'   _op_JUMP_IFzInterpreter._op_JUMP_IF  s   &&((9
 
 V&j/4;'	&$DH555

T
***',,txx~~/@"#'8  - - T[)JJW5J99	iYvw H& & &!!#&&&&&r)   c                 6    |                      ||d           d S NFr  r  r  r%   r  r  s      r'   op_JUMP_IF_FALSEzInterpreter.op_JUMP_IF_FALSE  #    D77777r)   c                 6    |                      ||d           d S NTr  r  r  s      r'   op_JUMP_IF_TRUEzInterpreter.op_JUMP_IF_TRUE  #    D66666r)   c                 t   |j         }|                                }|st          d         }nt          d         }|                     t	          j        d | j                  d|j                   }|                     |          }t          j	        
                    |||| j                  }	d|j         }
|                     |	|
           d|j         }t	          j        d	t          | j                  }|                     ||           t          j	                            |                     |          |                     |
          fd
| j                  }d|j         }|                     ||          }t	          j        |||| j                  }| j                            |           d S )Nr  r  r   z
$constNoner  r   z
$maybeNonez$boolr  r2   z$predr  )r  r  r   r|  r   rk   r   r   rt  rl   r   r   r  rg   r  rB  rA   )r%   r  r  r  r  r  rm   rV   rU   isnone	maybeNoner>   r  r  r  r  r  s                    r'   _jump_if_nonezInterpreter._jump_if_none  s   &&((  	/$T*BB$X.Bjjrx$(;;;84;88  : :hhtnnrsBB...	

i
000$t{$$	&$DH555

T
***',,txx~~0C0C/Er#'8  - - &%%JJW5J99		"(#*#x) ) ) 	!!&)))))r)   c                 4    |                      ||d           d S NTr  r  s      r'   op_POP_JUMP_FORWARD_IF_NONEz'Interpreter.op_POP_JUMP_FORWARD_IF_NONE'       4t,,,,,r)   c                 4    |                      ||d           d S NFr  r  s      r'   op_POP_JUMP_FORWARD_IF_NOT_NONEz+Interpreter.op_POP_JUMP_FORWARD_IF_NOT_NONE*       4u-----r)   c                 4    |                      ||d           d S r  r  r  s      r'   op_POP_JUMP_IF_NONEzInterpreter.op_POP_JUMP_IF_NONE.  s     tT400000r)   c                 4    |                      ||d           d S r  r  r  s      r'   op_POP_JUMP_IF_NOT_NONEz#Interpreter.op_POP_JUMP_IF_NOT_NONE1  s     tT511111r)   c                 4    |                      ||d           d S r  r  r  s      r'   op_POP_JUMP_BACKWARD_IF_NONEz(Interpreter.op_POP_JUMP_BACKWARD_IF_NONE8  r  r)   c                 4    |                      ||d           d S r  r  r  s      r'    op_POP_JUMP_BACKWARD_IF_NOT_NONEz,Interpreter.op_POP_JUMP_BACKWARD_IF_NOT_NONE;  r  r)   c                 6    |                      ||d           d S r  r  r  s      r'   op_POP_JUMP_FORWARD_IF_FALSEz(Interpreter.op_POP_JUMP_FORWARD_IF_FALSE>  r  r)   c                 6    |                      ||d           d S r  r  r  s      r'   op_POP_JUMP_FORWARD_IF_TRUEz'Interpreter.op_POP_JUMP_FORWARD_IF_TRUEA  r  r)   c                 6    |                      ||d           d S r  r  r  s      r'   op_POP_JUMP_BACKWARD_IF_FALSEz)Interpreter.op_POP_JUMP_BACKWARD_IF_FALSED  r  r)   c                 6    |                      ||d           d S r  r  r  s      r'   op_POP_JUMP_BACKWARD_IF_TRUEz(Interpreter.op_POP_JUMP_BACKWARD_IF_TRUEG  r  r)   c                 6    |                      ||d           d S r  r  r  s      r'   op_POP_JUMP_IF_FALSEz Interpreter.op_POP_JUMP_IF_FALSEJ  r  r)   c                 6    |                      ||d           d S r  r  r  s      r'   op_POP_JUMP_IF_TRUEzInterpreter.op_POP_JUMP_IF_TRUEM  r  r)   c                 6    |                      ||d           d S r  r  r  s      r'   op_JUMP_IF_FALSE_OR_POPz#Interpreter.op_JUMP_IF_FALSE_OR_POPP  r  r)   c                 6    |                      ||d           d S r  r  r  s      r'   op_JUMP_IF_TRUE_OR_POPz"Interpreter.op_JUMP_IF_TRUE_OR_POPS  r  r)   c                    t          j        dt          j        | j                  }d}|                     ||d           |                     |          }|                     |          }t           j                            |                     |          ||fd| j                  }	|                     |	|           d S )Nr  r   r  Tr  r2   r  )	r   r   r   r  r   r|  rt  rl   rg   )
r%   r  r  tostos1r  r  rU   rV   r  s
             r'   op_CHECK_EXC_MATCHzInterpreter.op_CHECK_EXC_MATCHV  s    	r1tx
 
 
 &

^d
CCChhtnnhhsmmgllHH^$$C:248  
 
 	

3r)   c                 $   |j         }|                                }t          j        dt          j        | j                  }d}|                     ||d           |                     |          }	|                     |          }
t          j	        
                    |                     |          |	|
fd| j                  }|                     ||          }t          j        |||| j                  }| j                            |           d S )	Nr  r   r  Tr  r2   r  r  )r  r  r   r   r   r  r   r|  rt  rl   rg   r  rB  rA   )r%   r  r  r  r  r  r  r  r  rU   rV   r  r  r  s                 r'   op_JUMP_IF_NOT_EXC_MATCHz$Interpreter.op_JUMP_IF_NOT_EXC_MATCHc  s   &&((	r1tx
 
 
 &

^d
CCChhtnnhhsmmgllHH^$$C:248  
 
 JJsD))	iYvw H& & &!!#&&&&&r)   c                    | j         j        }|t          j        d | j                  }| j                            |           |                                  | j                            t          j        |d         | j                             d S dt          d          }t          j
        t          |f| j                  }| j                            |           d S )N	exceptionr   r  r   z8Unreachable condition reached (op code RERAISE executed)
reportable)rI  r  r   TryRaiser   rB  rA   ra  r   r   StaticRaiser   )r%   r  r  r  r   ry  s         r'   
op_RERAISEzInterpreter.op_RERAISEu  s    .;48<<<D%%d+++&&(((%%bgfUm&J&J&JKKKKK3"<03 3C>.3&$(CCD%%d+++++r)   c                    ||                      |          }| j        j        }|t          j        || j                  }| j                            |           |                                  | j                            t          j	        |d         | j                             d S t          j
        || j                  }| j                            |           d S )Nr#  r  r   )rt  rI  r  r   r&  r   rB  rA   ra  r   Raise)r%   r  r  r  r   s        r'   op_RAISE_VARARGSzInterpreter.op_RAISE_VARARGS  s    ?((3--C.;$(;;;D%%d+++&&(((%%bgfUm&J&J&JKKKKK 8ctx888D%%d+++++r)   c                     d }t          j        |                     |          || j                  }|                     ||          S )N)rN   rb   r   )r   Yieldrt  r   r|  )r%   r  rN   r	  rb   s        r'   op_YIELD_VALUEzInterpreter.op_YIELD_VALUE  s=    xdhhuooUIIIzz$$$$r)   c	                 8    |d}	t          |	          |rFt          |t                    rt           fd|D                       }n                     |          } j        |         d         }
t          |
t
          j                  sd}	t          j        |	 j	                  |
j
        }|r                     |          }|r                     |          }t
          j                            |||| j	                  }                     ||           d S )Nz3op_MAKE_FUNCTION with kwdefaults is not implementedc                 :    g | ]}                     |          S r2   r  )r   r>   r%   s     r'   r   z0Interpreter.op_MAKE_FUNCTION.<locals>.<listcomp>  s#    !F!F!FT$((4..!F!F!Fr)   r   z_Unsupported use of closure. Probably caused by complex control-flow constructs; e.g. try-exceptr   )rG  ri   r   rt  r1  r   rk   r   r   r   rN   rl   make_functionr|  )r%   r  r>   codeclosureannotations
kwdefaultsdefaultsr	  ry  assume_code_constfcoder   s   `            r'   op_MAKE_FUNCTIONzInterpreter.op_MAKE_FUNCTION  s+    !GC%c*** 	.(E** . !F!F!F!FX!F!F!FGG88H-- ,T215+RX66 	E" 
 1#48DDDD!' 	"88D>>D 	(hhw''Gw$$T5'8TXNN

4r)   c	           
      >    |                      ||||||||           d S r#   )r9  )	r%   r  r>   r2  r3  r4  r5  r6  r	  s	            r'   op_MAKE_CLOSUREzInterpreter.op_MAKE_CLOSURE  s5    dD$((C	9 	9 	9 	9 	9r)   c                    | j         j        j                            |j                  }|| j        v r6	 |                     |          }n# t          $ r d}t          |          w xY w|| j	        v rM| j	        
                    |          }|                     |          }t          j        |||| j                  }n
J d            |                     ||           d S )Nr  r   r   r   r  r  s           r'   op_LOAD_CLOSUREzInterpreter.op_LOAD_CLOSURE  s    <$-AA$(KKDt)))3$BB& 3 3 3HC-c2223 +++(..t44..s33ZT5dh???'-'''JJr3r  c                    t          | j                  }|j        |k     rH| j        |j                 }	 |                     |          }nh# t          $ r d}t          |          w xY w|j        |z
  }| j        |         }|                     |          }t          j	        |||| j
                  }|                     ||           d S r  )rp   r  r   rt  r   rG  r  r  r   r  r   r|  )	r%   r  r	  r  r>   r  ry  rR   rN   s	            r'   r=  zInterpreter.op_LOAD_CLOSURE  s    T/00Jx*$$)$(33$BB& 3 3 3HC-c2223 h+)#...s33ZT5dh???JJr3s   A	 	A%c                 |   |                      |          }|                      |          }t          j                            |d| j                  }|                     ||           t          j                            |                      |          |fd| j                  }|                     ||           d S )NrA   r   r  r2   r5  )r%   r  rM   rN   	appendvarr	  
appendattr
appendinsts           r'   op_LIST_APPENDzInterpreter.op_LIST_APPEND  r;  r)   c                    |                      |          }|                      |          }d}| j        j        st          j        |          | j        j        d         }t          |j        t          j                  o|j        j	        dk    }d }	|rt          | j        j        d d                   D ]}}t          |t          j                  sd} n^t          |j        t          j                  r@t          |j        t          j                  r|j        |k    r|}	|j        j         } nd} |r|	t          j        |          |ru| j        j        }
| j        j        d         }|
                    |
                    |
                    |	                               |j        }|	j        }|j        |_        d S t          j                            |d| j                  }|                     ||           t          j                            |                      |          |fd| j                  }|                     ||           d S )	NzAn unsupported bytecode sequence has been encountered: op_LIST_EXTEND at the start of a block.

This could be due to the use of a branch in a tuple unpacking statement.r   r   Fr   r   r  r2   )rt  rB  r   r   r   ri   rN   r   rl   rm   r   rj   rk   rM   rZ   rA   r?   rb   re   r   r|  rg   )r%   r  rM   rN   	extendvarr	  ry  r   okbuild_empty_liststmtsbuild_tuple_asgnr   r   
extendattr
extendinsts                   r'   op_LIST_EXTENDzInterpreter.op_LIST_EXTEND  sD   &!!L !& 	71#666 !&r*
BG,,O-1O   	 !3!8"!=>>  !$	22 BE dj"(33   
BG44 9N9N'+$ "Z--BEB 	7"*1#666 	3&+E#16r:LL5;;/?#@#@AABBB*0K)/J*0J txHHJJJZiJ888dhhy&9&9E8R*.( & 4 4JJJZcJ22222r)   c                    |                      |          }|                      |          }|                      |          }t          j                            |d| j                  }|                     ||           t          j                            |                      |          ||fd| j                  }|                     ||           d S )Nrf   r   r  r2   r5  )	r%   r  rM   ra   rN   
setitemvarr	  setitemattrrB  s	            r'   
op_MAP_ADDzInterpreter.op_MAP_ADD)  s    &!!hhsmmgoofmoJJ

:
666W\\$((:"6"6er&*h " 0 0


#
.....r)   c                 v    t          j        dt          | j                  }|                     ||           d S )Nr   r   r  )r   r   r   r   r|  )r%   r  r	  r  s       r'   op_LOAD_ASSERTION_ERRORz#Interpreter.op_LOAD_ASSERTION_ERROR3  s7    	*NIII

S
)))))r)   c                       | j         |i | d S r#   )r  r%   rq   r`   s      r'   op_LOAD_METHODzInterpreter.op_LOAD_METHOD?  s     4'3'''''r)   c                       | j         |i | d S r#   )r  rT  s      r'   op_CALL_METHODzInterpreter.op_CALL_METHODB  s     t+s+++++r)   c                 8   |t           j        k    r<t          j        t          d| j                  }| j                            |           d S |t           j        k    r | j        |fi | d S |t           j	        k    r | j
        |fi | d S t          |          )Nr2   )ci1opINTRINSIC_STOPITERATION_ERRORr   r'  r   rB  rA   UNARY_POSITIVErX  INTRINSIC_LIST_TO_TUPLEr  rG  )r%   r  operandr  r   s        r'   op_CALL_INTRINSIC_1zInterpreter.op_CALL_INTRINSIC_1F  s    %===~&CR&*h0 0"))$///E000&&t66v666E999%%d55f555)'222r)   r#   )F)NN)r.   r/   r0   r1   r*  r(   rZ  rS  rM  rN  r~  rK  r  r  r  r  ra  r  r  r  r  r  r  r  propertyrJ  r  r  r  r  r  rL  r|  rt  r  r  r  r  r   r  r  r  r  r  r  r  r&  r/  r   r6  rG  r:  rA  rE  rG  rI  rK  rN  rP  rR  rU  rX  rZ  r\  r_  rd  rp  rw  r{  op_LOAD_FAST_CHECKr  r  r  r  
op_DUP_TOPop_DUP_TOP_TWOr  r  r  r  r  r  rb  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r"  r$  r&  r(  r-  r0  r3  r:  r=  rL  rP  rU  rX  r[  r^  r`  rd  rf  rk  ro  rs  rv  r{  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  op_JUMP_BACKWARD_NO_INTERRUPTr  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r	  r  r  r  r  r  r  r  r  r  r  r!  r(  r+  r.  r9  r;  r=  rC  rL  rP  rR  rU  rW  r^  r2   r)   r'   r'  r'  >  s         L% % %"K! K! K!Z  
- - -^N N N," " "& & &(21 21 21h% % %@ @ @ @&? ? ?
= = =
. . .(. . .;+ ;+ ;+zL L LB B B.9 9 9	  	  	    X ' ' X' ) ) X) & & X& ) ) X) ) ) X)% % %R   $  $               ) ) )) ) )! ! !> > >
) 
) 
)! ! !,. . .  &&&	" 	" 	" 	" 
(	(	(!!),,,&&&	, 	, 	, 	,  
(	(	(!!),,,) ) ) ) ) )$) ) )$) ) )( ( ("( ( ((( ( ((( ( ( ( ( ( ( ( ($( ( ($( ( (6 6 6 K	. 	. 	. 	. 	. %J	. 	. 	.
	7 
	7 
	7	= 	= 	= 	= 
1	1	1!!),,,&&&)	, 	, 	, 	, 
(	(	(!!),,,. . .
A A A6 6 6 J N& & && & &
	! 	! 	!  , ///	  	  	  	 
 
j	 	 	  	  	  	  "!),,,   ///	  	  	  	  
j	 	 
	  
	  
	  
	  "!),,,///	 	 	 ///	/ 	/ 	/ 	/ 
j	 	 	2 	2 	2 	2 "!),,,( ( (
3 3 3 3 3 3 30' ' '        * * *   J	" 	" 	" 	" 7""""    8  "& "& "&HA A AA A A  A A AF  & & &0  ( ( (( ( (  
  
  
/ / // / / * * *X( ( (
% % %
% % %
% % %
% % %
    + + +( ( (( ( (( ( () ) )( ( () ) )( ( () ) )( ( () ) )) ) )( ( (( ( (( ( (0 0 00 0 00 0 01 1 10 0 01 1 10 0 01 1 10 0 01 1 11 1 10 0 00 0 00 0 0' ' '' ' '' ' ' %5!) ) ) )' ' '
 &&&	+ 	+ 	+ 	+ 
(	(	(!!),,,J	+ 	+ 	+ 	+ 
1	1	1!!),,,+ + +B' ' '
! ! !' ' ' '' ' '*8 8 87 7 7 *  *  *D- - -. . . &&&	1 	1 	1	2 	2 	2 	2	(	(	(!!),,,- - -. . .8 8 87 7 78 8 87 7 78 8 87 7 78 8 87 7 7  ' ' '$, , ,, , ,% % %  :9 9 9
 ///	  	  	  	   
j	 	 	  	  	  	   "!),,,/ / /?3 ?3 ?3B/ / /* * *( ( (, , , &&&	3 	3 	3 	3 	3 
(	(	(!!),,,r)   r'  c                       e Zd ZdS )rZ  N)r.   r/   r0   r2   r)   r'   rZ  rZ  [  s        r)   rZ  )5r  r7   r  r   loggingr   
numba.corer   r   r   numba.core.errorsr   r   r   numba.core.ir_utilsr	   r
   numba.core.utilsr   r   r   numba.core.byteflowr   r   r   r   numba.core.unsafer   numba.cpython.unsafe.tupler   r   rY  rG  objectr!   	getLoggerr.   rP  r4   rW   rc   r}   r   r   r   r   r   r   r  r   r'  r   rZ  r2   r)   r'   <module>ro     s$        



    ) ) ) ) ) ) ) ) ) )         
 6 5 5 5 5 5 5 5< < < < < < < < < < C C C C C C C C C C C C             : : : : : : """EEEEEEE$$$

i
(
((: : : : :V : : : '
H
%
%1 1 1 1 1v 1 1 1h
 
 
2& & &RH H HV     Fi i iX| | |~[ [ [|  @[ [ [|. . .b2 2 2jY - Y - Y - Y - Y -& Y - Y - Y -x@ """         $$$D

i
(
((r)   