
    X-Ph                       U d Z ddlmZ ddlmZ ddlmZ ddlmZm	Z	m
Z
mZmZmZ ddlmZ ddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z# erddl$m%Z% dd	l&m'Z' dd
l(m)Z)m*Z*  ed          Z+ G d d          Z,dZ-de.d<   dZ/de.d<   dZ0de.d<   dZ1de.d<   dZ2de.d<   dZ3 G d d          Z4 G d de4          Z5 G d de4          Z6 G d d e4          Z7 G d! d"e4          Z8 G d# d$e8          Z9 G d% d&e9          Z: G d' d(e9          Z; G d) d*e8          Z< G d+ d,e<          Z= G d- d.e<          Z> G d/ d0e<          Z? G d1 d2e<          Z@ G d3 d4e8          ZA G d5 d6eA          ZB G d7 d8eA          ZC G d9 d:eA          ZD G d; d<eA          ZE G d= d>          ZF G d? d@eA          ZG G dA dBeA          ZH G dC dDeA          ZI G dE dFeA          ZJ G dG dHeA          ZKdIZLde.dJ<   dKZMde.dL<   dMZNde.dN<   dOZOde.dP<    G dQ dReA          ZP G dS dTeA          ZQ G dU dVeA          ZR G dW dXeA          ZS G dY dZeA          ZT G d[ d\eA          ZU G d] d^eA          ZV G d_ d`eA          ZWeeXeYeX         f         ZZ G da dbeA          Z[ G dc ddeA          Z\ G de dfeA          Z] G dg dheA          Z^ G di djeA          Z_dk e_j`        a                                D             Zbde.dl<    G dm dneA          Zc G do dpeA          Zddq edj`        a                                D             Zede.dr<    G ds dteA          Zf G du dveA          Zgdw egj`        a                                D             Zhde.dx<    G dy dzeA          Zi G d{ d|e8          Zj G d} d~eA          Zk G d deA          Zl G d deA          Zm G d deA          Zne G d de
e+                               Zo G d de          ZpdS )ax  Low-level opcodes for compiler intermediate representation (IR).

Opcodes operate on abstract values (Value) in a register machine. Each
value has a type (RType). A value can hold various things, such as:

- local variables (Register)
- intermediate values of expressions (RegisterOp subclasses)
- condition flags (true/false)
- literals (integer literals, True, False, etc.)
    )annotations)abstractmethod)Sequence)TYPE_CHECKINGFinalGeneric
NamedTupleTypeVarUnion)trait)RArray	RInstanceRTupleRTypeRVoidbit_rprimitivebool_rprimitivefloat_rprimitiveint_rprimitiveis_bit_rprimitiveis_bool_rprimitiveis_int_rprimitiveis_none_rprimitiveis_pointer_rprimitiveis_short_int_rprimitiveobject_rprimitivepointer_rprimitiveshort_int_rprimitive
void_rtype)LiteralValue)ClassIR)FuncDeclFuncIRTc                  L    e Zd ZdZdddZedd	            Zedd            ZdS )
BasicBlocka  IR basic block.

    Contains a sequence of Ops and ends with a ControlOp (Goto,
    Branch, Return or Unreachable). Only the last op can be a
    ControlOp.

    All generated Ops live in basic blocks. Basic blocks determine the
    order of evaluation and control flow within a function. A basic
    block is always associated with a single function/method (FuncIR).

    When building the IR, ops that raise exceptions can be included in
    the middle of a basic block, but the exceptions aren't checked.
    Afterwards we perform a transform that inserts explicit checks for
    all error conditions and splits basic blocks accordingly to preserve
    the invariant that a jump, branch or return can only ever appear
    as the final op in a block. Manually inserting error checking ops
    would be boring and error-prone.

    BasicBlocks have an error_handler attribute that determines where
    to jump if an error occurs. If none is specified, an error will
    propagate up out of the function. This is compiled away by the
    `exceptions` module.

    Block labels are used for pretty printing and emitting C code, and
    get filled in by those passes.

    Ops that may terminate the program aren't treated as exits.
    labelintreturnNonec                >    || _         g | _        d | _        d| _        d S NF)r(   opserror_handler
referenced)selfr(   s     L/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/mypyc/ir/ops.py__init__zBasicBlock.__init__P   s#    
04    boolc                j    t          | j                  ot          | j        d         t                    S )zDoes the block end with a jump, branch or return?

        This should always be true after the basic block has been fully built, but
        this is false during construction.
        r'   r5   r.   
isinstance	ControlOpr1   s    r2   
terminatedzBasicBlock.terminatedV   s'     DH~~E*TXb\9"E"EEr4   r9   c                    t          | j                  r t          | j        d         t                    sJ | j        d         S )z&The terminator operation of the block.r'   r7   r:   s    r2   
terminatorzBasicBlock.terminator_   s9     DH~~E*TXb\9"E"EEEEx|r4   Nr'   )r(   r)   r*   r+   r*   r5   )r*   r9   )__name__
__module____qualname____doc__r3   propertyr;   r=    r4   r2   r&   r&   2   s{         :          F F F XF    X  r4   r&   r   	ERR_NEVER   	ERR_MAGIC   	ERR_FALSE   
ERR_ALWAYS   ERR_MAGIC_OVERLAPPINGic                  B    e Zd ZU dZdZeZded<   dZe	d
d            Z
d	S )Valuea  Abstract base class for all IR values.

    These include references to registers, literals, and all
    operations (Ops), such as assignments, calls and branches.

    Values are often used as inputs of Ops. Register can be used as an
    assignment target.

    A Value is part of the IR being compiled if it's included in a BasicBlock
    that is reachable from a FuncIR (i.e., is part of a function).

    See also: Op is a subclass of Value that is the base class of all
    operations.
    r'   r   typeFr*   r5   c                6    t          | j        t                    S N)r8   rQ   r   r:   s    r2   is_voidzValue.is_void   s    $)U+++r4   Nr?   )r@   rA   rB   rC   liner   rQ   __annotations__is_borrowedrD   rT   rE   r4   r2   rP   rP   v   s[            DDK, , , X, , ,r4   rP   c                  <    e Zd ZdZdddZedd            ZddZdS )Registerav  A Register holds a value of a specific type, and it can be read and mutated.

    A Register is always local to a function. Each local variable maps
    to a Register, and they are also used for some (but not all)
    temporary values.

    Note that the term 'register' is overloaded and is sometimes used
    to refer to arbitrary Values (for example, in RegisterOp).
     Fr'   rQ   r   namestris_argr5   rU   r)   r*   r+   c                L    || _         || _        || _        || _        || _        d S rS   )rQ   r[   r]   rW   rU   )r1   rQ   r[   r]   rU   s        r2   r3   zRegister.__init__   s*    		!			r4   c                    dS r-   rE   r:   s    r2   rT   zRegister.is_void   s    ur4   c                R    d| j         dt          t          |                      dS )Nz
<Register z at >)r[   hexidr:   s    r2   __repr__zRegister.__repr__   s)    =DI==SD]]====r4   N)rZ   Fr'   )
rQ   r   r[   r\   r]   r5   rU   r)   r*   r+   r?   r*   r\   )r@   rA   rB   rC   r3   rD   rT   rd   rE   r4   r2   rY   rY      sk                 X> > > > > >r4   rY   c                  (    e Zd ZdZedfdd
ZddZdS )Integera9  Short integer literal.

    Integer literals are treated as constant values and are generally
    not included in data flow analyses and such, unlike Register and
    Op subclasses.

    Integer can represent multiple types:

     * Short tagged integers (short_int_primitive type; the tag bit is clear)
     * Ordinary fixed-width integers (e.g., int32_rprimitive)
     * Values of other unboxed primitive types that are represented as integers
       (none_rprimitive, bool_rprimitive)
     * Null pointers (value 0) of various types, including object_rprimitive
    r'   valuer)   rtyper   rU   r*   r+   c                    t          |          st          |          r|dz  | _        n|| _        || _        || _        d S NrI   )r   r   rh   rQ   rU   )r1   rh   ri   rU   s       r2   r3   zInteger.__init__   sH    "5)) 	->u-E-E 	DJJDJ				r4   c                t    t          | j                  st          | j                  r
| j        dz  S | j        S rk   )r   rQ   r   rh   r:   s    r2   numeric_valuezInteger.numeric_value   s:    "49-- 	#1B491M1M 	#:?"zr4   N)rh   r)   ri   r   rU   r)   r*   r+   )r*   r)   )r@   rA   rB   rC   r   r3   rm   rE   r4   r2   rg   rg      sT          3GTV          r4   rg   c                      e Zd ZdZddd	Zd
S )FloatzFloat literal.

    Floating point literals are treated as constant values and are generally
    not included in data flow analyses and such, unlike Register and
    Op subclasses.
    r'   rh   floatrU   r)   r*   r+   c                :    || _         t          | _        || _        d S rS   )rh   r   rQ   rU   )r1   rh   rU   s      r2   r3   zFloat.__init__   s    
$				r4   Nr>   )rh   rp   rU   r)   r*   r+   )r@   rA   rB   rC   r3   rE   r4   r2   ro   ro      s7               r4   ro   c                  z    e Zd ZdZddZddZedd
            Zedd            ZddZ	ddZ
edd            ZdS )Opa  Abstract base class for all IR operations.

    Each operation must be stored in a BasicBlock (in 'ops') to be
    active in the IR. This is different from non-Op values, including
    Register and Integer, where a reference from an active Op is
    sufficient to be considered active.

    In well-formed IR an active Op has no references to inactive ops
    or ops used in another function.
    rU   r)   r*   r+   c                    || _         d S rS   )rU   )r1   rU   s     r2   r3   zOp.__init__   s    			r4   r5   c                    dS r-   rE   r:   s    r2   	can_raisezOp.can_raise   s	     ur4   list[Value]c                    dS )zAll the values the op may read.NrE   r:   s    r2   sourcesz
Op.sources         r4   newc                    dS )zRewrite the sources of an opNrE   r1   r{   s     r2   set_sourceszOp.set_sources   rz   r4   c                    g S )z>Return arguments that have a reference count stolen by this oprE   r:   s    r2   stolenz	Op.stolen   s    	r4   c                j    g }|                                  D ]}||vr|                    |           |S rS   )ry   append)r1   resultregs      r2   unique_sourceszOp.unique_sources   sA     <<>> 	# 	#C&  c"""r4   visitorOpVisitor[T]r$   c                    d S rS   rE   r1   r   s     r2   acceptz	Op.accept   s    r4   NrU   r)   r*   r+   r?   r*   rw   r{   rw   r*   r+   r   r   r*   r$   )r@   rA   rB   rC   r3   rv   r   ry   r~   r   r   r   rE   r4   r2   rs   rs      s        	 	      
 . . . ^. + + + ^+          ^  r4   rs   c                  &     e Zd ZdZd
d fd	Z xZS )
BaseAssignz-Base class for ops that assign to a register.r'   destrY   rU   r)   r*   r+   c                X    t                                          |           || _        d S rS   )superr3   r   )r1   r   rU   	__class__s      r2   r3   zBaseAssign.__init__  s&    			r4   r>   )r   rY   rU   r)   r*   r+   )r@   rA   rB   rC   r3   __classcell__r   s   @r2   r   r     sH        77          r4   r   c                  J     e Zd ZdZeZdd fdZddZddZddZ	ddZ
 xZS )Assignz*Assign a value to a Register (dest = src).r'   r   rY   srcrP   rU   r)   r*   r+   c                Z    t                                          ||           || _        d S rS   )r   r3   r   r1   r   r   rU   r   s       r2   r3   zAssign.__init__  s(    t$$$r4   rw   c                    | j         gS rS   r   r:   s    r2   ry   zAssign.sources      zr4   r{   c                    |\  | _         d S rS   r   r}   s     r2   r~   zAssign.set_sources      r4   c                    | j         gS rS   r   r:   s    r2   r   zAssign.stolen  r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_assignr   s     r2   r   zAssign.accept      ##D)))r4   r>   )r   rY   r   rP   rU   r)   r*   r+   r   r   r   r@   rA   rB   rC   rF   
error_kindr3   ry   r~   r   r   r   r   s   @r2   r   r     s        44J               * * * * * * * *r4   r   c                  J     e Zd ZdZeZdd fdZddZddZddZ	ddZ
 xZS )AssignMultiaW  Assign multiple values to a Register (dest = src1, src2, ...).

    This is used to initialize RArray values. It's provided to avoid
    very verbose IR for common vectorcall operations.

    Note that this interacts atypically with reference counting. We
    assume that each RArray register is initialized exactly once
    with this op.
    r'   r   rY   r   rw   rU   r)   r*   r+   c                    t                                          ||           |sJ t          |j        t                    sJ |j        j        t          |          k    sJ || _        d S rS   )r   r3   r8   rQ   r   lengthlenr   r   s       r2   r3   zAssignMulti.__init__.  se    t$$$


$)V,,,,,y3s88++++r4   c                4    | j                                         S rS   r   copyr:   s    r2   ry   zAssignMulti.sources5      x}}r4   r{   c                $    |d d          | _         d S rS   r   r}   s     r2   r~   zAssignMulti.set_sources8      qqq6r4   c                    g S rS   rE   r:   s    r2   r   zAssignMulti.stolen;      	r4   r   r   r$   c                ,    |                     |           S rS   )visit_assign_multir   s     r2   r   zAssignMulti.accept>      ))$///r4   r>   )r   rY   r   rw   rU   r)   r*   r+   r   r   r   r   r   s   @r2   r   r   !  s          J               0 0 0 0 0 0 0 0r4   r   c                  "    e Zd ZdZddZdd
ZdS )r9   zControl flow operation.r*   Sequence[BasicBlock]c                    dS )z5Get all basic block targets of the control operation.rE   rE   r:   s    r2   targetszControlOp.targetsE  s    rr4   ir)   r{   r&   r+   c                .    t          d|  d| d          )zUpdate a basic block target.zInvalid set_target(z, ))AssertionErrorr1   r   r{   s      r2   
set_targetzControlOp.set_targetI  s$    ?4??1???@@@r4   Nr*   r   r   r)   r{   r&   r*   r+   )r@   rA   rB   rC   r   r   rE   r4   r2   r9   r9   B  sH        !!   A A A A A Ar4   r9   c                  Z     e Zd ZdZeZdd fd	ZddZddZddZ	ddZ
ddZddZ xZS ) GotozUnconditional jump.r'   r(   r&   rU   r)   r*   r+   c                X    t                                          |           || _        d S rS   )r   r3   r(   )r1   r(   rU   r   s      r2   r3   zGoto.__init__S  s&    


r4   r   c                    | j         fS rS   r(   r:   s    r2   r   zGoto.targetsW  s    
}r4   r   r{   c                $    |dk    sJ || _         d S )Nr   r   r   s      r2   r   zGoto.set_targetZ  s    Avvvv


r4   r\   c                     d| j         j         z  S )Nz	<Goto %s>r   r:   s    r2   rd   zGoto.__repr__^  s    TZ---r4   rw   c                    g S rS   rE   r:   s    r2   ry   zGoto.sourcesa  r   r4   c                    |rJ d S rS   rE   r}   s     r2   r~   zGoto.set_sourcesd      r4   r   r   r$   c                ,    |                     |           S rS   )
visit_gotor   s     r2   r   zGoto.acceptg      !!$'''r4   r>   )r(   r&   rU   r)   r*   r+   r   r   re   r   r   r   )r@   rA   rB   rC   rF   r   r3   r   r   rd   ry   r~   r   r   r   s   @r2   r   r   N  s        J            . . . .      ( ( ( ( ( ( ( (r4   r   c                       e Zd ZU dZeZdZded<   dZded<   	 d$dd	d% fdZ	d&dZ
d'dZd(dZd)dZd*dZd+d#Z xZS ),BranchzBranch based on a value.

    If op is BOOL, branch based on a bit/bool value:
       if [not] r1 goto L1 else goto L2

    If op is IS_ERROR, branch based on whether there is an error value:
       if [not] is_error(r1) goto L1 else goto L2
    d   r   BOOLe   IS_ERRORr'   F)rarerh   rP   
true_labelr&   false_labelopr)   rU   r   r5   r*   r+   c                   t                                          |           || _        || _        || _        || _        d| _        d | _        || _        d S r-   )	r   r3   rh   truefalser   negatedtraceback_entryr   )r1   rh   r   r   r   rU   r   r   s          r2   r3   zBranch.__init__{  sU     	
	 
7; 			r4   r   c                    | j         | j        fS rS   r   r   r:   s    r2   r   zBranch.targets  s    	4:&&r4   r   r{   c                N    |dk    s|dk    sJ |dk    r	|| _         d S || _        d S Nr   rG   r   r   s      r2   r   zBranch.set_target  s6    Avva66DIIIDJJJr4   rw   c                    | j         gS rS   rh   r:   s    r2   ry   zBranch.sources      
|r4   c                    |\  | _         d S rS   r   r}   s     r2   r~   zBranch.set_sources      r4   c                     | j          | _         d S rS   )r   r:   s    r2   invertzBranch.invert  s    <'r4   r   r   r$   c                ,    |                     |           S rS   )visit_branchr   s     r2   r   zBranch.accept  r   r4   r>   )rh   rP   r   r&   r   r&   r   r)   rU   r)   r   r5   r*   r+   r   r   r   r   r*   r+   r   )r@   rA   rB   rC   rF   r   r   rV   r   r3   r   r   ry   r~   r   r   r   r   s   @r2   r   r   k  s          JDH         6' ' ' '         ( ( ( (* * * * * * * *r4   r   c                  R     e Zd ZdZeZ	 dddd fdZddZddZddZ	ddZ
 xZS )ReturnzReturn a value from a function.r'   N)yield_targetrh   rP   rU   r)   r   BasicBlock | Noner*   r+   c               f    t                                          |           || _        || _        d S rS   )r   r3   rh   r   )r1   rh   rU   r   r   s       r2   r3   zReturn.__init__  s4     	

 )r4   rw   c                    | j         gS rS   r   r:   s    r2   ry   zReturn.sources  r   r4   r{   c                    |\  | _         d S rS   r   r}   s     r2   r~   zReturn.set_sources  r   r4   c                    | j         gS rS   r   r:   s    r2   r   zReturn.stolen  r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_returnr   s     r2   r   zReturn.accept  r   r4   r>   )rh   rP   rU   r)   r   r   r*   r+   r   r   r   r   r   s   @r2   r   r     s        ))J )+	)QU	) 	) 	) 	) 	) 	) 	) 	)         * * * * * * * *r4   r   c                  B     e Zd ZdZeZdd fdZdd	ZddZddZ	 xZ
S )Unreachablea5  Mark the end of basic block as unreachable.

    This is sometimes necessary when the end of a basic block is never
    reached. This can also be explicitly added to the end of non-None
    returning functions (in None-returning function we can just return
    None).

    Mypy statically guarantees that the end of the function is not
    unreachable if there is not a return statement.

    This prevents the block formatter from being confused due to lack
    of a leave and also leaves a nifty note in the IR. It is not
    generally processed by visitors.
    r'   rU   r)   r*   r+   c                J    t                                          |           d S rS   )r   r3   r1   rU   r   s     r2   r3   zUnreachable.__init__  s!    r4   rw   c                    g S rS   rE   r:   s    r2   ry   zUnreachable.sources  r   r4   r{   c                    |rJ d S rS   rE   r}   s     r2   r~   zUnreachable.set_sources  r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_unreachabler   s     r2   r   zUnreachable.accept      ((...r4   r>   r   r   r   r   r@   rA   rB   rC   rF   r   r3   ry   r~   r   r   r   s   @r2   r   r     s          J            / / / / / / / /r4   r   c                  @     e Zd ZU dZdZdZded<   d fd
ZddZ xZ	S )
RegisterOpa  Abstract base class for operations that can be written as r1 = f(r2, ..., rn).

    Takes some values, performs an operation, and generates an output
    (unless the 'type' attribute is void_rtype, which is the default).
    Other ops can refer to the result of the Op by referring to the Op
    instance. This doesn't do any explicit control flow, but can raise an
    error.

    Note that the operands can be arbitrary Values, not just Register
    instances, even though the naming may suggest otherwise.
    r'   NRType | None_typerU   r)   r*   r+   c                t    t                                          |           | j        dk    s
J d            d S )Nr'   zerror_kind not defined)r   r3   r   r   s     r2   r3   zRegisterOp.__init__  s=    "$$$&>$$$$$r4   r5   c                "    | j         t          k    S rS   )r   rF   r:   s    r2   rv   zRegisterOp.can_raise  s    )++r4   r   r?   )
r@   rA   rB   rC   r   r  rV   r3   rv   r   r   s   @r2   r  r    su         
 
 JE? ? ? ? ? ?, , , , , , , ,r4   r  c                  B     e Zd ZdZeZdd fd	ZddZddZddZ	 xZ
S )IncRefz'Increase reference count (inc_ref src).r'   r   rP   rU   r)   r*   r+   c                t    |j         j        sJ t                                          |           || _        d S rS   )rQ   is_refcountedr   r3   r   r1   r   rU   r   s      r2   r3   zIncRef.__init__  s7    x%%%%r4   rw   c                    | j         gS rS   r   r:   s    r2   ry   zIncRef.sources  r   r4   r{   c                    |\  | _         d S rS   r   r}   s     r2   r~   zIncRef.set_sources  r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_inc_refr   s     r2   r   zIncRef.accept      $$T***r4   r>   r   rP   rU   r)   r*   r+   r   r   r   r   r   s   @r2   r  r    s        11J      
      + + + + + + + +r4   r  c                  J     e Zd ZdZeZdd fdZddZddZddZ	ddZ
 xZS )DecRefzDecrease reference count and free object if zero (dec_ref src).

    The is_xdec flag says to use an XDECREF, which checks if the
    pointer is NULL first.
    Fr'   r   rP   is_xdecr5   rU   r)   r*   r+   c                    |j         j        sJ t                                          |           || _        || _        d S rS   )rQ   r
  r   r3   r   r  )r1   r   r  rU   r   s       r2   r3   zDecRef.__init__  s>    x%%%%r4   r\   c                J    d                     | j        rdnd| j                  S )Nz<{}DecRef {!r}>XrZ   )formatr  r   r:   s    r2   rd   zDecRef.__repr__%  s%     ''t|(CTXNNNr4   rw   c                    | j         gS rS   r   r:   s    r2   ry   zDecRef.sources(  r   r4   r{   c                    |\  | _         d S rS   r   r}   s     r2   r~   zDecRef.set_sources+  r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_dec_refr   s     r2   r   zDecRef.accept.  r  r4   )Fr'   )r   rP   r  r5   rU   r)   r*   r+   re   r   r   r   )r@   rA   rB   rC   rF   r   r3   rd   ry   r~   r   r   r   s   @r2   r  r    s          J      O O O O      + + + + + + + +r4   r  c                  <     e Zd ZdZd fd
ZddZddZddZ xZS )Callz]Native call f(arg, ...).

    The call target can be a module-level function or a class.
    fnr"   argsSequence[Value]rU   r)   r*   r+   c                \   || _         t          |          | _        t          | j                  t          |j        j                  k    sJ |j        j        | _        |j        j        }|j        st          | _	        nt          | _	        t                                          |           d S rS   )r  listr   r   sigret_typerQ   error_overlaprH   r   rN   r   r3   )r1   r  r   rU   r%  r   s        r2   r3   zCall.__init__8  s    JJ	49~~RV[!1!11111FO	6?% 	4'DOO3DOr4   rw   c                N    t          | j                                                  S rS   )r#  r   r   r:   s    r2   ry   zCall.sourcesD  s    DINN$$%%%r4   r{   c                $    |d d          | _         d S rS   r   r}   s     r2   r~   zCall.set_sourcesG      F			r4   r   r   r$   c                ,    |                     |           S rS   )
visit_callr   s     r2   r   zCall.acceptJ  r   r4   )r  r"   r   r!  rU   r)   r*   r+   r   r   r   	r@   rA   rB   rC   r3   ry   r~   r   r   r   s   @r2   r  r  2  s         

 
 
 
 
 
& & & &   ( ( ( ( ( ( ( (r4   r  c                  >     e Zd ZdZdd fdZddZddZddZ xZS )
MethodCallz'Native method call obj.method(arg, ...)r'   objrP   methodr\   r   rw   rU   r)   r*   r+   c                   || _         || _        || _        t          |j        t
                    s
J d            |j        | _        | j        j                            |          }|(J d	                    | j        j
        |                      |j        }|| _        |j        st          | _        nt          | _        t!                                          |           d S )Nz'Methods can only be called on instancesz{} doesn't have method {})r0  r1  r   r8   rQ   r   receiver_typeclass_ir
method_sigr  r[   r%  r&  rH   r   rN   r   r3   )r1   r0  r1  r   rU   	method_irr%  r   s          r2   r3   zMethodCall.__init__Q  s    	#(I..YY0YYYY X&/::6BB	$$&A&H&H#V'
 '
$$$ %	% 	4'DOO3DOr4   c                F    | j                                         | j        gz   S rS   )r   r   r0  r:   s    r2   ry   zMethodCall.sourcesc  s    y~~48*,,r4   r{   c                $    |^ | _         | _        d S rS   )r   r0  r}   s     r2   r~   zMethodCall.set_sourcesf  s    "DHHHr4   r   r   r$   c                ,    |                     |           S rS   )visit_method_callr   s     r2   r   zMethodCall.accepti  r   r4   r>   )
r0  rP   r1  r\   r   rw   rU   r)   r*   r+   r   r   r   r-  r   s   @r2   r/  r/  N  s        11      $- - - -# # # #/ / / / / / / /r4   r/  c                  "    e Zd ZdZddZddZdS ) PrimitiveDescriptiona*  Description of a primitive op.

    Primitives get lowered into lower-level ops before code generation.

    If c_function_name is provided, a primitive will be lowered into a CallC op.
    Otherwise custom logic will need to be implemented to transform the
    primitive into lower-level ops.
    r[   r\   	arg_typeslist[RType]return_typer   var_arg_typer  truncated_typec_function_name
str | Noner   r)   stealsStealsDescriptionrW   r5   orderinglist[int] | Noneextra_int_constantslist[tuple[int, RType]]priorityis_purer*   r+   c                    || _         || _        || _        || _        || _        || _        || _        || _        |	| _        |
| _	        || _
        || _        || _        |r|t          k    sJ d S d S rS   )r[   r=  r?  r@  rA  rB  r   rD  rW   rF  rH  rJ  rK  rF   )r1   r[   r=  r?  r@  rA  rB  r   rD  rW   rF  rH  rJ  rK  s                 r2   r3   zPrimitiveDescription.__init__w  s    "  	 )"-#/%3 '6!+#"-'*= ' & 	+****	+ 	+**r4   c                (    d| j         d| j         dS )Nz<PrimitiveDescription z: ra   )r[   r=  r:   s    r2   rd   zPrimitiveDescription.__repr__  s    H	HHt~HHHHr4   N)r[   r\   r=  r>  r?  r   r@  r  rA  r  rB  rC  r   r)   rD  rE  rW   r5   rF  rG  rH  rI  rJ  r)   rK  r5   r*   r+   re   )r@   rA   rB   rC   r3   rd   rE   r4   r2   r<  r<  m  sM         $+ $+ $+ $+LI I I I I Ir4   r<  c                  <    e Zd ZdZdddZddZddZddZddZdS )PrimitiveOpa  A higher-level primitive operation.

    Some of these have special compiler support. These will be lowered
    (transformed) into lower-level IR ops before code generation, and after
    reference counting op insertion. Others will be transformed into CallC
    ops.

    Tagged integer equality is a typical primitive op with non-trivial
    lowering. It gets transformed into a tag check, followed by different
    code paths for short and long representations.
    r'   r   rw   descr<  rU   r)   r*   r+   c                R    || _         |j        | _        |j        | _        || _        d S rS   )r   r?  rQ   r   rP  )r1   r   rP  rU   s       r2   r3   zPrimitiveOp.__init__  s'    	$	/			r4   c                    | j         S rS   r)  r:   s    r2   ry   zPrimitiveOp.sources  s
    yr4   r{   c                $    |d d          | _         d S rS   r)  r}   s     r2   r~   zPrimitiveOp.set_sources  r*  r4   c                    | j         j        }t          |t                    rFt	          |          t	          | j                  k    sJ d t          | j        |          D             S |sg n|                                 S )Nc                    g | ]	\  }}||
S rE   rE   .0argsteals      r2   
<listcomp>z&PrimitiveOp.stolen.<locals>.<listcomp>  s!    JJJJCEJCJJJr4   )rP  rD  r8   r#  r   r   zipry   )r1   rD  s     r2   r   zPrimitiveOp.stolen  st    !fd## 	8v;;#di..0000JJ#di*@*@JJJJ#7227r4   r   r   r$   c                ,    |                     |           S rS   )visit_primitive_opr   s     r2   r   zPrimitiveOp.accept  r   r4   Nr>   )r   rw   rP  r<  rU   r)   r*   r+   r   r   r   )	r@   rA   rB   rC   r3   ry   r~   r   r   rE   r4   r2   rO  rO    s        
 
          8 8 8 80 0 0 0 0 0r4   rO  c                  D     e Zd ZdZeZ	 dd fdZddZddZddZ	 xZ
S )LoadErrorValuezLoad an error value.

    Each type has one reserved value that signals an error (exception). This
    loads the error value for a specific type.
    r'   Fri   r   rU   r)   rW   r5   	undefinesr*   r+   c                t    t                                          |           || _        || _        || _        d S rS   )r   r3   rQ   rW   r`  )r1   ri   rU   rW   r`  r   s        r2   r3   zLoadErrorValue.__init__  s9     		& #r4   rw   c                    g S rS   rE   r:   s    r2   ry   zLoadErrorValue.sources  r   r4   r{   c                    |rJ d S rS   rE   r}   s     r2   r~   zLoadErrorValue.set_sources  r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_load_error_valuer   s     r2   r   zLoadErrorValue.accept  s    --d333r4   )r'   FF)
ri   r   rU   r)   rW   r5   r`  r5   r*   r+   r   r   r   r   r   s   @r2   r_  r_    s          J Z_	# 	# 	# 	# 	# 	# 	#      4 4 4 4 4 4 4 4r4   r_  c                  :    e Zd ZdZeZdZdd	ZddZddZ	ddZ
dS )LoadLiterala  Load a Python literal object (dest = 'foo' / b'foo' / ...).

    This is used to load a static PyObject * value corresponding to
    a literal of one of the supported types.

    Tuple / frozenset literals must contain only valid literal values as items.

    NOTE: You can use this to load boxed (Python) int objects. Use
          Integer to load unboxed, tagged integers or fixed-width,
          low-level integers.

          For int literals, both int_rprimitive (CPyTagged) and
          object_primitive (PyObject *) are supported as rtype. However,
          when using int_rprimitive, the value must *not* be small enough
          to fit in an unboxed integer.
    Trh   r    ri   r   r*   r+   c                "    || _         || _        d S rS   )rh   rQ   )r1   rh   ri   s      r2   r3   zLoadLiteral.__init__  s    
			r4   rw   c                    g S rS   rE   r:   s    r2   ry   zLoadLiteral.sources  r   r4   r{   c                    |rJ d S rS   rE   r}   s     r2   r~   zLoadLiteral.set_sources   r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_load_literalr   s     r2   r   zLoadLiteral.accept  r   r4   N)rh   r    ri   r   r*   r+   r   r   r   )r@   rA   rB   rC   rF   r   rW   r3   ry   r~   r   rE   r4   r2   rg  rg    sz         " JK         0 0 0 0 0 0r4   rg  c                  F     e Zd ZdZeZddd fdZddZddZddZ	 xZ
S )GetAttrzobj.attr (for a native object)Fborrowr0  rP   attrr\   rU   r)   rp  r5   r*   r+   c               Z   t                                          |           || _        || _        t	          |j        t                    sJ d|j        z              |j        | _        |j                            |          }|| _        |j	        rt          | _        |o|j        | _        d S )N"Attribute access not supported: %s)r   r3   r0  rq  r8   rQ   r   
class_type	attr_typer&  rN   r   r
  rW   )r1   r0  rq  rU   rp  ru  r   s         r2   r3   zGetAttr.__init__  s    	#(I..__0TWZW_0____(H&&t,,		" 	43DO!=i&=r4   rw   c                    | j         gS rS   r0  r:   s    r2   ry   zGetAttr.sources  r   r4   r{   c                    |\  | _         d S rS   rw  r}   s     r2   r~   zGetAttr.set_sources  r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_get_attrr   s     r2   r   zGetAttr.accept      %%d+++r4   )
r0  rP   rq  r\   rU   r)   rp  r5   r*   r+   r   r   r   )r@   rA   rB   rC   rH   r   r3   ry   r~   r   r   r   s   @r2   rn  rn    s        ((JKP 
> 
> 
> 
> 
> 
> 
> 
>      , , , , , , , ,r4   rn  c                  P     e Zd ZdZeZd fdZddZddZddZ	ddZ
ddZ xZS )SetAttrzKobj.attr = src (for a native object)

    Steals the reference to src.
    r0  rP   rq  r\   r   rU   r)   r*   r+   c                
   t                                          |           || _        || _        || _        t          |j        t                    sJ d|j        z              |j        | _        t          | _        d| _
        d S )Nrs  F)r   r3   r0  rq  r   r8   rQ   r   rt  r   is_init)r1   r0  rq  r   rU   r   s        r2   r3   zSetAttr.__init__*  sw    	#(I..__0TWZW_0____(#	 r4   c                D    d| _         t          | _        t          | _        d S NT)r  rF   r   r   rQ   r:   s    r2   mark_as_initializerzSetAttr.mark_as_initializer6  s    #			r4   rw   c                    | j         | j        gS rS   r0  r   r:   s    r2   ry   zSetAttr.sources;      $(##r4   r{   c                $    |\  | _         | _        d S rS   r  r}   s     r2   r~   zSetAttr.set_sources>       $(((r4   c                    | j         gS rS   r   r:   s    r2   r   zSetAttr.stolenA  r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_set_attrr   s     r2   r   zSetAttr.acceptD  r{  r4   )
r0  rP   rq  r\   r   rP   rU   r)   r*   r+   r   r   r   r   )r@   rA   rB   rC   rJ   r   r3   r  ry   r~   r   r   r   r   s   @r2   r}  r}  "  s         
 J
 
 
 
 
 
   
$ $ $ $! ! ! !   , , , , , , , ,r4   r}  staticNAMESPACE_STATICrQ   NAMESPACE_TYPEmoduleNAMESPACE_MODULEtypevarNAMESPACE_TYPE_VARc                  N     e Zd ZdZeZdZdeddfd fdZddZ	ddZ
ddZ xZS )
LoadStatica  Load a static name (name :: static).

    Load a C static variable/pointer. The namespace for statics is shared
    for the entire compilation group. You can optionally provide a module
    name and a sub-namespace identifier for additional namespacing to avoid
    name conflicts. The static namespace does not overlap with other C names,
    since the final C name will get a prefix, so conflicts only must be
    avoided with other statics.
    TNr'   rQ   r   
identifierr\   module_namerC  	namespacerU   r)   annobjectr*   r+   c                    t                                          |           || _        || _        || _        || _        || _        d S rS   )r   r3   r  r  r  rQ   r  )r1   rQ   r  r  r  rU   r  r   s          r2   r3   zLoadStatic.__init__c  sE     	$&"	r4   rw   c                    g S rS   rE   r:   s    r2   ry   zLoadStatic.sourcess  r   r4   r{   c                    |rJ d S rS   rE   r}   s     r2   r~   zLoadStatic.set_sourcesv  r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_load_staticr   s     r2   r   zLoadStatic.accepty  r   r4   )rQ   r   r  r\   r  rC  r  r\   rU   r)   r  r  r*   r+   r   r   r   )r@   rA   rB   rC   rF   r   rW   r  r3   ry   r~   r   r   r   s   @r2   r  r  U  s          JK #')             / / / / / / / /r4   r  c                  H     e Zd ZdZeZdedfd fdZddZddZ	ddZ
 xZS )
InitStaticzhstatic = value :: static

    Initialize a C static variable/pointer. See everything in LoadStatic.
    Nr'   rh   rP   r  r\   r  rC  r  rU   r)   r*   r+   c                    t                                          |           || _        || _        || _        || _        d S rS   )r   r3   r  r  r  rh   )r1   rh   r  r  r  rU   r   s         r2   r3   zInitStatic.__init__  s>     	$&"


r4   rw   c                    | j         gS rS   r   r:   s    r2   ry   zInitStatic.sources  r   r4   r{   c                    |\  | _         d S rS   r   r}   s     r2   r~   zInitStatic.set_sources  r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_init_staticr   s     r2   r   zInitStatic.accept  r   r4   )rh   rP   r  r\   r  rC  r  r\   rU   r)   r*   r+   r   r   r   )r@   rA   rB   rC   rF   r   r  r3   ry   r~   r   r   r   s   @r2   r  r  }  s         
 J #')            / / / / / / / /r4   r  c                  H     e Zd ZdZeZd fdZdd	Zdd
ZddZ	ddZ
 xZS )TupleSetz*dest = (reg, ...) (for fixed-length tuple)itemsrw   rU   r)   r*   r+   c                    t                                          |           || _        t          d |D                       | _        | j        | _        d S )Nc                R    g | ]$}t          |j                  s|j        nt          %S rE   )r   rQ   r   )rW  rX  s     r2   rZ  z%TupleSet.__init__.<locals>.<listcomp>  s=        !8 A AU~  r4   )r   r3   r  r   
tuple_typerQ   )r1   r  rU   r   s      r2   r3   zTupleSet.__init__  s`    
 !    
 
 O			r4   c                4    | j                                         S rS   r  r   r:   s    r2   ry   zTupleSet.sources      z   r4   c                4    | j                                         S rS   r  r:   s    r2   r   zTupleSet.stolen  r  r4   r{   c                $    |d d          | _         d S rS   )r  r}   s     r2   r~   zTupleSet.set_sources  s    V


r4   r   r   r$   c                ,    |                     |           S rS   )visit_tuple_setr   s     r2   r   zTupleSet.accept      &&t,,,r4   )r  rw   rU   r)   r*   r+   r   r   r   )r@   rA   rB   rC   rF   r   r3   ry   r   r~   r   r   r   s   @r2   r  r    s        44J$ $ $ $ $ $! ! ! !! ! ! !   - - - - - - - -r4   r  c                  H     e Zd ZdZeZdddd fdZddZddZddZ	 xZ
S )TupleGetz.Get item of a fixed-length tuple (src[index]).r'   Fro  r   rP   indexr)   rU   rp  r5   r*   r+   c                   t                                          |           || _        || _        t	          |j        t                    s
J d            |dk    sJ |j        j        |         | _        || _        d S )Nz TupleGet only operates on tuplesr   )	r   r3   r   r  r8   rQ   r   typesrW   )r1   r   r  rU   rp  r   s        r2   r3   zTupleGet.__init__  su    
#(F++OO-OOOOzzzzHN5)	!r4   rw   c                    | j         gS rS   r   r:   s    r2   ry   zTupleGet.sources  r   r4   r{   c                    |\  | _         d S rS   r   r}   s     r2   r~   zTupleGet.set_sources  r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_tuple_getr   s     r2   r   zTupleGet.accept  r  r4   r>   )
r   rP   r  r)   rU   r)   rp  r5   r*   r+   r   r   r   r   r   s   @r2   r  r    s        88J"QV " " " " " " " "      - - - - - - - -r4   r  c                  N     e Zd ZdZeZddd fdZddZddZddZ	ddZ
 xZS )Castzcast(type, src)

    Perform a runtime type check (no representation or value conversion).

    DO NOT increment reference counts.
    Fro  r   rP   typr   rU   r)   rp  r5   r*   r+   c               t    t                                          |           || _        || _        || _        d S rS   )r   r3   r   rQ   rW   )r1   r   r  rU   rp  r   s        r2   r3   zCast.__init__  s7    	!r4   rw   c                    | j         gS rS   r   r:   s    r2   ry   zCast.sources  r   r4   r{   c                    |\  | _         d S rS   r   r}   s     r2   r~   zCast.set_sources  r   r4   c                $    | j         rg S | j        gS rS   )rW   r   r:   s    r2   r   zCast.stolen  s     	Izr4   r   r   r$   c                ,    |                     |           S rS   )
visit_castr   s     r2   r   zCast.accept  r   r4   )
r   rP   r  r   rU   r)   rp  r5   r*   r+   r   r   r   )r@   rA   rB   rC   rH   r   r3   ry   r~   r   r   r   r   s   @r2   r  r    s          JLQ " " " " " " " "         
( ( ( ( ( ( ( (r4   r  c                  J     e Zd ZdZeZdd fd	ZddZddZddZ	ddZ
 xZS )Boxzbox(type, src)

    This converts from a potentially unboxed representation to a straight Python object.
    Only supported for types with an unboxed representation.
    r'   r   rP   rU   r)   r*   r+   c                   t                                          |           || _        t          | _        t          | j        j                  s2t          | j        j                  st          | j        j                  r	d| _        d S d S r  )	r   r3   r   r   rQ   r   r   r   rW   r  s      r2   r3   zBox.__init__  s    %	 tx}--	$!$(-00	$ !//	$
  $D	$ 	$r4   rw   c                    | j         gS rS   r   r:   s    r2   ry   zBox.sources	  r   r4   r{   c                    |\  | _         d S rS   r   r}   s     r2   r~   zBox.set_sources  r   r4   c                    | j         gS rS   r   r:   s    r2   r   z
Box.stolen  r   r4   r   r   r$   c                ,    |                     |           S rS   )	visit_boxr   s     r2   r   z
Box.accept  s      &&&r4   r>   r  r   r   r   r   r   s   @r2   r  r    s          J
$ 
$ 
$ 
$ 
$ 
$ 
$         ' ' ' ' ' ' ' 'r4   r  c                  <     e Zd ZdZd fd
ZddZddZddZ xZS )Unboxzunbox(type, src)

    This is similar to a cast, but it also changes to a (potentially) unboxed runtime
    representation. Only supported for types with an unboxed representation.
    r   rP   r  r   rU   r)   r*   r+   c                    || _         || _        |j        st          | _        nt
          | _        t                                          |           d S rS   )r   rQ   r&  rH   r   rN   r   r3   )r1   r   r  rU   r   s       r2   r3   zUnbox.__init__  sJ    	  	4'DOO3DOr4   rw   c                    | j         gS rS   r   r:   s    r2   ry   zUnbox.sources&  r   r4   r{   c                    |\  | _         d S rS   r   r}   s     r2   r~   zUnbox.set_sources)  r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_unboxr   s     r2   r   zUnbox.accept,  s    ""4(((r4   )r   rP   r  r   rU   r)   r*   r+   r   r   r   r-  r   s   @r2   r  r    s                    ) ) ) ) ) ) ) )r4   r  c                       e Zd ZU dZeZdZded<   dZded<   dZ	ded<   d	Z
ded
<   dZded<   dZded<   dZded<   d" fdZd#dZd$dZd%d!Z xZS )&RaiseStandardErrorzRaise built-in exception with an optional error string.

    We have a separate opcode for this for convenience and to
    generate smaller, more idiomatic C code.
    
ValueErrorr   VALUE_ERRORr   ASSERTION_ERRORStopIterationSTOP_ITERATIONUnboundLocalErrorUNBOUND_LOCAL_ERRORRuntimeErrorRUNTIME_ERROR	NameError
NAME_ERRORZeroDivisionErrorZERO_DIVISION_ERROR
class_namer\   rh   str | Value | NonerU   r)   r*   r+   c                ~    t                                          |           || _        || _        t          | _        d S rS   )r   r3   r  rh   r   rQ   )r1   r  rh   rU   r   s       r2   r3   zRaiseStandardError.__init__C  s4    $
#			r4   rw   c                    g S rS   rE   r:   s    r2   ry   zRaiseStandardError.sourcesI  r   r4   r{   c                    |rJ d S rS   rE   r}   s     r2   r~   zRaiseStandardError.set_sourcesL  r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_raise_standard_errorr   s     r2   r   zRaiseStandardError.acceptO  s    11$777r4   )r  r\   rh   r  rU   r)   r*   r+   r   r   r   )r@   rA   rB   rC   rJ   r   r  rV   r  r  r  r  r  r  r3   ry   r~   r   r   r   s   @r2   r  r  0  s          J%K%%%%-O----+N++++!44444)M))))#J####!44444$ $ $ $ $ $      8 8 8 8 8 8 8 8r4   r  c                  N     e Zd ZdZ	 dddd  fdZd!dZd"dZd!dZd#dZ xZ	S )$CallCzresult = function(arg0, arg1, ...)

    Call a C function that is not a compiled/native function (for
    example, a Python C API function). Use Call to call native
    functions.
    r'   F)rK  function_namer\   r   rw   r%  r   rD  rE  rW   r5   r   r)   rU   var_arg_idxrK  r*   r+   c	                   || _         t                                          |           || _        || _        || _        || _        || _        || _        |	| _	        |	r|t          k    sJ d S d S rS   )r   r   r3   r  r   rQ   rD  rW   r  rK  rF   )r1   r  r   r%  rD  rW   r   rU   r  rK  r   s             r2   r3   zCallC.__init___  s     %*		&&  	+****	+ 	+**r4   c                     | j         d d          S rS   r)  r:   s    r2   ry   zCallC.sources|  s    y|r4   r{   c                $    |d d          | _         d S rS   r)  r}   s     r2   r~   zCallC.set_sources  r*  r4   c                   t          | j        t                    rPt          | j                  t          | j                  k    sJ d t          | j        | j                  D             S | j        sg n|                                 S )Nc                    g | ]	\  }}||
S rE   rE   rV  s      r2   rZ  z CallC.stolen.<locals>.<listcomp>  s!    OOOJCOCOOOr4   )r8   rD  r#  r   r   r[  ry   r:   s    r2   r   zCallC.stolen  st    dk4(( 	=t{##s49~~5555OO#di*E*EOOOO![<22dllnn<r4   r   r   r$   c                ,    |                     |           S rS   )visit_call_cr   s     r2   r   zCallC.accept  r   r4   r>   )r  r\   r   rw   r%  r   rD  rE  rW   r5   r   r)   rU   r)   r  r)   rK  r5   r*   r+   r   r   r   )
r@   rA   rB   rC   r3   ry   r~   r   r   r   r   s   @r2   r  r  W  s           + + + + + + + + +:      = = = =* * * * * * * *r4   r  c                  J     e Zd ZdZeZdd fdZddZddZddZ	ddZ
 xZS )Truncatea   result = truncate src from src_type to dst_type

    Truncate a value from type with more bits to type with less bits.

    dst_type and src_type can be native integer types, bools or tagged
    integers. Tagged integers should have the tag bit unset.
    r'   r   rP   dst_typer   rU   r)   r*   r+   c                ~    t                                          |           || _        || _        |j        | _        d S rS   )r   r3   r   rQ   src_type)r1   r   r  rU   r   s       r2   r3   zTruncate.__init__  s6    	r4   rw   c                    | j         gS rS   r   r:   s    r2   ry   zTruncate.sources  r   r4   r{   c                    |\  | _         d S rS   r   r}   s     r2   r~   zTruncate.set_sources  r   r4   c                    g S rS   rE   r:   s    r2   r   zTruncate.stolen  r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_truncater   s     r2   r   zTruncate.accept  r{  r4   r>   )r   rP   r  r   rU   r)   r*   r+   r   r   r   r   r   s   @r2   r  r    s          J! ! ! ! ! ! !         , , , , , , , ,r4   r  c                  J     e Zd ZdZeZdd fdZddZddZddZ	ddZ
 xZS )Extendad  result = extend src from src_type to dst_type

    Extend a value from a type with fewer bits to a type with more bits.

    dst_type and src_type can be native integer types, bools or tagged
    integers. Tagged integers should have the tag bit unset.

    If 'signed' is true, perform sign extension. Otherwise, the result will be
    zero extended.
    r'   r   rP   r  r   signedr5   rU   r)   r*   r+   c                    t                                          |           || _        || _        |j        | _        || _        d S rS   )r   r3   r   rQ   r  r  )r1   r   r  r  rU   r   s        r2   r3   zExtend.__init__  s=    	r4   rw   c                    | j         gS rS   r   r:   s    r2   ry   zExtend.sources  r   r4   r{   c                    |\  | _         d S rS   r   r}   s     r2   r~   zExtend.set_sources  r   r4   c                    g S rS   rE   r:   s    r2   r   zExtend.stolen  r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_extendr   s     r2   r   zExtend.accept  r   r4   r>   )
r   rP   r  r   r  r5   rU   r)   r*   r+   r   r   r   r   r   s   @r2   r   r     s        	 	 J               * * * * * * * *r4   r   c                  F     e Zd ZdZeZdZdd fdZddZddZ	ddZ
 xZS )
LoadGlobalzLoad a low-level global variable/pointer.

    Note that can't be used to directly load Python module-level
    global variable, since they are stored in a globals dictionary
    and accessed using dictionary operations.
    Tr'   NrQ   r   r  r\   rU   r)   r  r  r*   r+   c                t    t                                          |           || _        || _        || _        d S rS   )r   r3   r  rQ   r  )r1   rQ   r  rU   r  r   s        r2   r3   zLoadGlobal.__init__  s4    $	r4   rw   c                    g S rS   rE   r:   s    r2   ry   zLoadGlobal.sources  r   r4   r{   c                    |rJ d S rS   rE   r}   s     r2   r~   zLoadGlobal.set_sources  r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_load_globalr   s     r2   r   zLoadGlobal.accept  r   r4   )r'   N)
rQ   r   r  r\   rU   r)   r  r  r*   r+   r   r   r   r@   rA   rB   rC   rF   r   rW   r3   ry   r~   r   r   r   s   @r2   r	  r	    s          JK            / / / / / / / /r4   r	  c                      e Zd ZU dZeZdZded<   dZded<   dZ	ded<   d	Z
ded
<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<   edede	de
dedededededed i
Zded!<   d6d7 fd-Zd8d/Zd9d1Zd:d5Z xZS );IntOpa  Binary arithmetic or bitwise op on integer operands (e.g., r1 = r2 + r3).

    These ops are low-level and are similar to the corresponding C
    operations.

    The left and right values must have low-level integer types with
    compatible representations. Fixed-width integers, short_int_rprimitive,
    bool_rprimitive and bit_rprimitive are supported.

    For tagged (arbitrary-precision) integer ops look at mypyc.primitives.int_ops.
    r   r   ADDrG   SUBrI   MULrK   DIVrM   MOD   AND   OR   XOR   
LEFT_SHIFT   RIGHT_SHIFT+-*/%&|^z<<z>>op_strr'   rQ   r   lhsrP   rhsr   r)   rU   r*   r+   c                    t                                          |           || _        || _        || _        || _        d S rS   )r   r3   rQ   r*  r+  r   )r1   rQ   r*  r+  r   rU   r   s         r2   r3   zIntOp.__init__  s;    	r4   rw   c                    | j         | j        gS rS   r*  r+  r:   s    r2   ry   zIntOp.sources  r  r4   r{   c                $    |\  | _         | _        d S rS   r.  r}   s     r2   r~   zIntOp.set_sources  r  r4   r   r   r$   c                ,    |                     |           S rS   )visit_int_opr   s     r2   r   zIntOp.accept  r   r4   r>   )rQ   r   r*  rP   r+  rP   r   r)   rU   r)   r*   r+   r   r   r   )r@   rA   rB   rC   rF   r   r  rV   r  r  r  r  r  r  r  r  r   r)  r3   ry   r~   r   r   r   s   @r2   r  r    sv        
 
 J CNNNNCNNNNCNNNNCNNNNCNNNN CBOOOOCJK 	SSSSSS
CSDTF          $ $ $ $! ! ! !* * * * * * * *r4   r  c                    i | ]\  }}||	S rE   rE   rW  op_idr   s      r2   
<dictcomp>r5  %  s    GGGYUBr5GGGr4   int_op_to_idc                  >    e Zd ZU dZeZdZded<   dZded<   dZ	ded<   d	Z
ded
<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<   edede	de
dededededededi
Zded<   eee	e
eedZded<   eeeeeedZded <   d3d4 fd*Zd5d,Zd6d.Zd7d2Z xZS )8ComparisonOpag  Low-level comparison op for integers and pointers.

    Both unsigned and signed comparisons are supported. Supports
    comparisons between fixed-width integer types and pointer types.
    The operands should have matching sizes.

    The result is always a bit (representing a boolean).

    Python semantics, such as calling __eq__, are not supported.
    r   r   EQr   NEQf   SLTg   SGTh   SLEi   SGEj   ULTk   UGTl   ULEm   UGE==!=<ra   <=>=r)  )rK  rL  rM  ra   rN  rO  
signed_opsunsigned_opsr'   r*  rP   r+  r   r)   rU   r*   r+   c                    t                                          |           t          | _        || _        || _        || _        d S rS   r   r3   r   rQ   r*  r+  r   r1   r*  r+  r   rU   r   s        r2   r3   zComparisonOp.__init__T  ;    "	r4   rw   c                    | j         | j        gS rS   r.  r:   s    r2   ry   zComparisonOp.sources[  r  r4   r{   c                $    |\  | _         | _        d S rS   r.  r}   s     r2   r~   zComparisonOp.set_sources^  r  r4   r   r   r$   c                ,    |                     |           S rS   )visit_comparison_opr   s     r2   r   zComparisonOp.accepta  s    **4000r4   r>   
r*  rP   r+  rP   r   r)   rU   r)   r*   r+   r   r   r   )r@   rA   rB   rC   rF   r   r9  rV   r:  r<  r>  r@  rB  rD  rF  rH  rJ  r)  rP  rQ  r3   ry   r~   r   r   r   s   @r2   r8  r8  (  s        	 	 J BOOOOCCCCCCCCC 	DTSSTTSSTTF      "3SSVWWJWWWW!#3Ss#UXYYLYYYY      $ $ $ $! ! ! !1 1 1 1 1 1 1 1r4   r8  c            
           e Zd ZU dZeZdZded<   dZded<   dZ	ded<   d	Z
ded
<   dZded<   edede	de
dediZded<   d%d& fdZd'dZd(d Zd)d$Z xZS )*FloatOpzBinary float arithmetic op (e.g., r1 = r2 + r3).

    These ops are low-level and are similar to the corresponding C
    operations (and somewhat different from Python operations).

    The left and right values must be floats.
    r   r   r  rG   r  rI   r  rK   r  rM   r  r!  r"  r#  r$  r%  r)  r'   r*  rP   r+  r   r)   rU   r*   r+   c                    t                                          |           t          | _        || _        || _        || _        d S rS   )r   r3   r   rQ   r*  r+  r   rT  s        r2   r3   zFloatOp.__init__x  s;    $	r4   rw   c                    | j         | j        gS rS   r.  r:   s    r2   ry   zFloatOp.sources  r  r4   r{   c                $    |\  | _         | _        d S rS   r.  r}   s     r2   r~   zFloatOp.set_sources      "4888r4   r   r   r$   c                ,    |                     |           S rS   )visit_float_opr   s     r2   r   zFloatOp.accept  r{  r4   r>   rZ  r   r   r   )r@   rA   rB   rC   rF   r   r  rV   r  r  r  r  r)  r3   ry   r~   r   r   r   s   @r2   r\  r\  e  s           JCNNNNCNNNNCNNNNCNNNNCNNNN#sCc3S#FFFFFF      $ $ $ $# # # #, , , , , , , ,r4   r\  c                    i | ]\  }}||	S rE   rE   r3  s      r2   r5  r5    s    KKKyubUKKKr4   float_op_to_idc                  B     e Zd ZdZeZdd fd	ZddZddZddZ	 xZ
S )FloatNegzFloat negation op (r1 = -r2).r'   r   rP   rU   r)   r*   r+   c                p    t                                          |           t          | _        || _        d S rS   )r   r3   r   rQ   r   r  s      r2   r3   zFloatNeg.__init__  s-    $	r4   rw   c                    | j         gS rS   r   r:   s    r2   ry   zFloatNeg.sources  r   r4   r{   c                    |\  | _         d S rS   r   r}   s     r2   r~   zFloatNeg.set_sources  r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_float_negr   s     r2   r   zFloatNeg.accept  r  r4   r>   r  r   r   r   r   r   s   @r2   rf  rf    s        ''J      
      - - - - - - - -r4   rf  c                       e Zd ZU dZeZdZded<   dZded<   dZ	ded<   d	Z
ded
<   dZded<   dZded<   edede	de
dedediZded<   d(d) fdZd*d!Zd+d#Zd,d'Z xZS )-FloatComparisonOpz#Low-level comparison op for floats.r  r   r9  r  r:  r  LTr  GTr  LE   GErK  rL  rM  ra   rN  rO  r)  r'   r*  rP   r+  r   r)   rU   r*   r+   c                    t                                          |           t          | _        || _        || _        || _        d S rS   rS  rT  s        r2   r3   zFloatComparisonOp.__init__  rU  r4   rw   c                    | j         | j        gS rS   r.  r:   s    r2   ry   zFloatComparisonOp.sources  r  r4   r{   c                $    |\  | _         | _        d S rS   r.  r}   s     r2   r~   zFloatComparisonOp.set_sources  r`  r4   r   r   r$   c                ,    |                     |           S rS   )visit_float_comparison_opr   s     r2   r   zFloatComparisonOp.accept  s    00666r4   r>   rZ  r   r   r   )r@   rA   rB   rC   rF   r   r9  rV   r:  rn  ro  rp  rr  r)  r3   ry   r~   r   r   r   s   @r2   rm  rm    s        --JBOOOOCBOOOOBOOOOBOOOOBOOOOsD"c2sBb$OFOOOO      $ $ $ $# # # #7 7 7 7 7 7 7 7r4   rm  c                    i | ]\  }}||	S rE   rE   r3  s      r2   r5  r5    s    #`#`#`)%B#`#`#`r4   float_comparison_op_to_idc                  B     e Zd ZdZeZdd fdZddZddZddZ	 xZ
S )LoadMemzRead a memory location: result = *(type *)src.

    Attributes:
      type: Type of the read value
      src: Pointer to memory to read
    r'   rQ   r   r   rP   rU   r)   r*   r+   c                    t                                          |           || _        t          |j                  sJ || _        d| _        d S r  )r   r3   rQ   r   r   rW   r1   rQ   r   rU   r   s       r2   r3   zLoadMem.__init__  sO    	 %SX.....r4   rw   c                    | j         gS rS   r   r:   s    r2   ry   zLoadMem.sources  r   r4   r{   c                    |\  | _         d S rS   r   r}   s     r2   r~   zLoadMem.set_sources  r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_load_memr   s     r2   r   zLoadMem.accept  r{  r4   r>   )rQ   r   r   rP   rU   r)   r*   r+   r   r   r   r   r   s   @r2   r{  r{    s          J                   , , , , , , , ,r4   r{  c                  J     e Zd ZdZeZdd fdZddZddZddZ	ddZ
 xZS )SetMemzWrite to a memory location: *(type *)dest = src

    Attributes:
      type: Type of the written value
      dest: Pointer to memory to write
      src: Source value
    r'   rQ   r   r   rP   r   rU   r)   r*   r+   c                    t                                          |           t          | _        || _        || _        || _        d S rS   )r   r3   r   rQ   	dest_typer   r   )r1   rQ   r   r   rU   r   s        r2   r3   zSetMem.__init__  s;    				r4   rw   c                    | j         | j        gS rS   r   r   r:   s    r2   ry   zSetMem.sources  s    $)$$r4   r{   c                $    |\  | _         | _        d S rS   r  r}   s     r2   r~   zSetMem.set_sources  s    !$)))r4   c                    | j         gS rS   r   r:   s    r2   r   zSetMem.stolen  r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_set_memr   s     r2   r   zSetMem.accept  r  r4   r>   )
rQ   r   r   rP   r   rP   rU   r)   r*   r+   r   r   r   r   r   s   @r2   r  r    s          J      % % % %" " " "   + + + + + + + +r4   r  c                  B     e Zd ZdZeZdd fdZddZddZddZ	 xZ
S )GetElementPtrzGet the address of a struct element.

    Note that you may need to use KeepAlive to avoid the struct
    being freed, if it's reference counted, such as PyObject *.
    r'   r   rP   r  r   fieldr\   rU   r)   r*   r+   c                    t                                          |           t          | _        || _        || _        || _        d S rS   )r   r3   r   rQ   r   r  r  )r1   r   r  r  rU   r   s        r2   r3   zGetElementPtr.__init__  s;    &	 


r4   rw   c                    | j         gS rS   r   r:   s    r2   ry   zGetElementPtr.sources  r   r4   r{   c                    |\  | _         d S rS   r   r}   s     r2   r~   zGetElementPtr.set_sources  r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_get_element_ptrr   s     r2   r   zGetElementPtr.accept  s    ,,T222r4   r>   )
r   rP   r  r   r  r\   rU   r)   r*   r+   r   r   r   r   r   s   @r2   r  r    s          J            3 3 3 3 3 3 3 3r4   r  c                  F     e Zd ZdZeZdZdd fdZddZddZ	ddZ
 xZS )LoadAddressa  Get the address of a value: result = (type)&src

    Attributes:
      type: Type of the loaded address(e.g. ptr/object_ptr)
      src: Source value (str for globals like 'PyList_Type',
           Register for temporary values or locals, LoadStatic
           for statics.)
    Tr'   rQ   r   r   str | Register | LoadStaticrU   r)   r*   r+   c                f    t                                          |           || _        || _        d S rS   )r   r3   rQ   r   r}  s       r2   r3   zLoadAddress.__init__)  s-    	r4   rw   c                J    t          | j        t                    r| j        gS g S rS   )r8   r   rY   r:   s    r2   ry   zLoadAddress.sources.  s%    dh)) 	H:Ir4   r{   c                    |rAt          |d         t                    sJ t          |          dk    sJ |d         | _        d S d S r   )r8   rY   r   r   r}   s     r2   r~   zLoadAddress.set_sources4  sP     	c!fh/////s88q====1vDHHH	 	r4   r   r   r$   c                ,    |                     |           S rS   )visit_load_addressr   s     r2   r   zLoadAddress.accept:  r   r4   r>   )rQ   r   r   r  rU   r)   r*   r+   r   r   r   r  r   s   @r2   r  r    s          JK      
      0 0 0 0 0 0 0 0r4   r  c                  D    e Zd ZdZeZdddd
ZddZddZddZ	ddZ
dS )	KeepAlivea  A no-op operation that ensures source values aren't freed.

    This is sometimes useful to avoid decref when a reference is still
    being held but not seen by the compiler.

    A typical use case is like this (C-like pseudocode):

      ptr = &x.item
      r = *ptr
      keep_alive x  # x must not be freed here
      # x may be freed here

    If we didn't have "keep_alive x", x could be freed immediately
    after taking the address of 'item', resulting in a read after free
    on the second line.

    If 'steal' is true, the value is considered to be stolen at
    this op, i.e. it won't be decref'd. You need to ensure that
    the value is freed otherwise, perhaps by using borrowing
    followed by Unborrow.

    Be careful with steal=True -- this can cause memory leaks.
    F)rY  r   rw   rY  r5   r*   r+   c               *    |sJ || _         || _        d S rS   )r   rY  )r1   r   rY  s      r2   r3   zKeepAlive.__init__Y  s    





r4   c                4    | j                                         S rS   r   r:   s    r2   ry   zKeepAlive.sources^  r   r4   c                F    | j         r| j                                        S g S rS   )rY  r   r   r:   s    r2   r   zKeepAlive.stolena  s!    : 	#8==??"	r4   r{   c                $    |d d          | _         d S rS   r   r}   s     r2   r~   zKeepAlive.set_sourcesf  r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_keep_aliver   s     r2   r   zKeepAlive.accepti  s    ''---r4   N)r   rw   rY  r5   r*   r+   r   r   r   )r@   rA   rB   rC   rF   r   r3   ry   r   r~   r   rE   r4   r2   r  r  >  s         0 J:?      
      
   . . . . . .r4   r  c                  J     e Zd ZdZeZdd fd	ZddZddZddZ	ddZ
 xZS )Unborrowa  A no-op op to create a regular reference from a borrowed one.

    Borrowed references can only be used temporarily and the reference
    counts won't be managed. This value will be refcounted normally.

    This is mainly useful if you split an aggregate value, such as
    a tuple, into components using borrowed values (to avoid increfs),
    and want to treat the components as sharing the original managed
    reference. You'll also need to use KeepAlive with steal=True to
    "consume" the original tuple reference:

      # t is a 2-tuple
      r0 = borrow t[0]
      r1 = borrow t[1]
      keep_alive steal t
      r2 = unborrow r0
      r3 = unborrow r1
      # now (r2, r3) represent the tuple as separate items, that are
      # managed again. (Note we need to steal before unborrow, to avoid
      # refcount briefly touching zero if r2 or r3 are unused.)

    Be careful with this -- this can easily cause double freeing.
    r'   r   rP   rU   r)   r*   r+   c                    t                                          |           |j        sJ || _        |j        | _        d S rS   )r   r3   rW   r   rQ   r  s      r2   r3   zUnborrow.__init__  s=    H			r4   rw   c                    | j         gS rS   r   r:   s    r2   ry   zUnborrow.sources  r   r4   r{   c                    |\  | _         d S rS   r   r}   s     r2   r~   zUnborrow.set_sources  r   r4   c                    g S rS   rE   r:   s    r2   r   zUnborrow.stolen  r   r4   r   r   r$   c                ,    |                     |           S rS   )visit_unborrowr   s     r2   r   zUnborrow.accept  r{  r4   r>   r  r   r   r   r   r   s   @r2   r  r  m  s         0 J               , , , , , , , ,r4   r  c                     e Zd ZdZedRd            ZedSd            ZedTd
            ZedUd            ZedVd            Z	edWd            Z
edXd            ZedYd            ZedZd            Zed[d            Zed\d            Zed]d            Zed^d            Zed_d             Zd`d"Zdad$Zedbd&            Zedcd(            Zeddd*            Zeded,            Zedfd.            Zedgd0            Zedhd2            Zedid4            Zedjd6            Zedkd8            Zedld:            Zedmd<            Z ednd>            Z!edod@            Z"edpdB            Z#edqdD            Z$edrdF            Z%edsdH            Z&edtdJ            Z'edudL            Z(edvdN            Z)edwdP            Z*dQS )x	OpVisitorz;Generic visitor over ops (uses the visitor design pattern).r   r   r*   r$   c                    t           rS   NotImplementedErrorr1   r   s     r2   r   zOpVisitor.visit_goto      !!r4   r   c                    t           rS   r  r  s     r2   r   zOpVisitor.visit_branch  r  r4   r   c                    t           rS   r  r  s     r2   r   zOpVisitor.visit_return  r  r4   r   c                    t           rS   r  r  s     r2   r   zOpVisitor.visit_unreachable  r  r4   r   c                    t           rS   r  r  s     r2   r   zOpVisitor.visit_assign  r  r4   r   c                    t           rS   r  r  s     r2   r   zOpVisitor.visit_assign_multi  r  r4   r_  c                    t           rS   r  r  s     r2   re  z OpVisitor.visit_load_error_value  r  r4   rg  c                    t           rS   r  r  s     r2   rl  zOpVisitor.visit_load_literal  r  r4   rn  c                    t           rS   r  r  s     r2   rz  zOpVisitor.visit_get_attr  r  r4   r}  c                    t           rS   r  r  s     r2   r  zOpVisitor.visit_set_attr  r  r4   r  c                    t           rS   r  r  s     r2   r  zOpVisitor.visit_load_static  r  r4   r  c                    t           rS   r  r  s     r2   r  zOpVisitor.visit_init_static  r  r4   r  c                    t           rS   r  r  s     r2   r  zOpVisitor.visit_tuple_get  r  r4   r  c                    t           rS   r  r  s     r2   r  zOpVisitor.visit_tuple_set  r  r4   r  c                    t           rS   r  r  s     r2   r  zOpVisitor.visit_inc_ref      !!r4   r  c                    t           rS   r  r  s     r2   r  zOpVisitor.visit_dec_ref  r  r4   r  c                    t           rS   r  r  s     r2   r,  zOpVisitor.visit_call  r  r4   r/  c                    t           rS   r  r  s     r2   r:  zOpVisitor.visit_method_call  r  r4   r  c                    t           rS   r  r  s     r2   r  zOpVisitor.visit_cast  r  r4   r  c                    t           rS   r  r  s     r2   r  zOpVisitor.visit_box  r  r4   r  c                    t           rS   r  r  s     r2   r  zOpVisitor.visit_unbox  r  r4   r  c                    t           rS   r  r  s     r2   r  z$OpVisitor.visit_raise_standard_error  r  r4   r  c                    t           rS   r  r  s     r2   r  zOpVisitor.visit_call_c  r  r4   rO  c                    t           rS   r  r  s     r2   r]  zOpVisitor.visit_primitive_op  r  r4   r  c                    t           rS   r  r  s     r2   r  zOpVisitor.visit_truncate  r  r4   r   c                    t           rS   r  r  s     r2   r  zOpVisitor.visit_extend  r  r4   r	  c                    t           rS   r  r  s     r2   r  zOpVisitor.visit_load_global  r  r4   r  c                    t           rS   r  r  s     r2   r1  zOpVisitor.visit_int_op	  r  r4   r8  c                    t           rS   r  r  s     r2   rY  zOpVisitor.visit_comparison_op  r  r4   r\  c                    t           rS   r  r  s     r2   rb  zOpVisitor.visit_float_op  r  r4   rf  c                    t           rS   r  r  s     r2   rk  zOpVisitor.visit_float_neg  r  r4   rm  c                    t           rS   r  r  s     r2   rw  z#OpVisitor.visit_float_comparison_op  r  r4   r{  c                    t           rS   r  r  s     r2   r  zOpVisitor.visit_load_mem  r  r4   r  c                    t           rS   r  r  s     r2   r  zOpVisitor.visit_set_mem!  r  r4   r  c                    t           rS   r  r  s     r2   r  zOpVisitor.visit_get_element_ptr%  r  r4   r  c                    t           rS   r  r  s     r2   r  zOpVisitor.visit_load_address)  r  r4   r  c                    t           rS   r  r  s     r2   r  zOpVisitor.visit_keep_alive-  r  r4   r  c                    t           rS   r  r  s     r2   r  zOpVisitor.visit_unborrow1  r  r4   N)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   rg  r*   r$   )r   rn  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$   )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   rO  r*   r$   )r   r  r*   r$   )r   r   r*   r$   )r   r	  r*   r$   )r   r  r*   r$   )r   r8  r*   r$   )r   r\  r*   r$   )r   rf  r*   r$   )r   rm  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@   rA   rB   rC   r   r   r   r   r   r   r   re  rl  rz  r  r  r  r  r  r  r  r,  r:  r  r  r  r  r  r]  r  r  r  r1  rY  rb  rk  rw  r  r  r  r  r  r  rE   r4   r2   r  r    s       EE" " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^"" " " "" " " " " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " " " ^" " "r4   r  c                  $    e Zd ZU ded<   ded<   dS )	DeserMapszdict[str, ClassIR]classeszdict[str, FuncIR]	functionsN)r@   rA   rB   rV   rE   r4   r2   r  r  O  s*               r4   r  N)qrC   
__future__r   abcr   collections.abcr   typingr   r   r   r	   r
   r   mypy_extensionsr   mypyc.ir.rtypesr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   mypyc.codegen.literalsr    mypyc.ir.class_irr!   mypyc.ir.func_irr"   r#   r$   r&   rF   rV   rH   rJ   rL   rN   NO_TRACEBACK_LINE_NOrP   rY   rg   ro   rs   r   r   r   r9   r   r   r   r   r  r  r  r  r/  r<  rO  r_  rg  rn  r}  r  r  r  r  r  r  r  r  r  r  r  r  r5   r#  rE  r  r  r   r	  r  r)  r  r6  r8  r\  rd  rf  rm  ry  r{  r  r  r  r  r  r  r  rE   r4   r2   <module>r     s  	 	 	 # " " " " "       $ $ $ $ $ $ L L L L L L L L L L L L L L L L ! ! ! ! ! !                                         ,  2333333))))))11111111GCLL1 1 1 1 1 1 1 1j 	    	    	    
      !           , , , , , , , ,6> > > > >u > > >4    e   <    E   ) ) ) ) ) ) ) )X       * * * * *Z * * *,0 0 0 0 0* 0 0 0B	A 	A 	A 	A 	A 	A 	A 	A( ( ( ( (9 ( ( (:?* ?* ?* ?* ?*Y ?* ?* ?*D* * * * *Y * * *:/ / / / /) / / />, , , , , , , ,2+ + + + +Z + + +(+ + + + +Z + + +8( ( ( ( (: ( ( (8/ / / / / / / />1I 1I 1I 1I 1I 1I 1I 1Ih"0 "0 "0 "0 "0* "0 "0 "0J4 4 4 4 4Z 4 4 4< 0  0  0  0  0*  0  0  0F, , , , ,j , , ,6#, #, #, #, #,j #, #, #,N #  " " " "      #  " " " " &  % % % %%/ %/ %/ %/ %/ %/ %/ %/P/ / / / / / / /@- - - - -z - - -@- - - - -z - - -0( ( ( ( (: ( ( (>' ' ' ' '* ' ' 'D) ) ) ) )J ) ) )4 8  8  8  8  8  8  8  8H $T
*+ 3* 3* 3* 3* 3*J 3* 3* 3*l, , , , ,z , , ,<* * * * *Z * * *D/ / / / / / / /68* 8* 8* 8* 8*J 8* 8* 8*z HG%,2D2D2F2FGGG G G G G:1 :1 :1 :1 :1: :1 :1 :1z!, !, !, !, !,j !, !, !,L LKGN4H4H4J4JKKK K K K K- - - - -z - - -(7 7 7 7 7
 7 7 7B $a#`?P?W?]?]?_?_#`#`#`  ` ` ` `, , , , ,j , , ,:+ + + + +R + + +>3 3 3 3 3J 3 3 340 0 0 0 0* 0 0 0D,. ,. ,. ,. ,.
 ,. ,. ,.^+, +, +, +, +,z +, +, +,\ W" W" W" W" W"
 W" W" W"f! ! ! ! !
 ! ! ! ! !r4   