Qfv  ddlZddlZddlZddlZddlddlmZmZmZm Z m Z m Z m Z m Z gdezZ[ejejej eeefZedZdedfedfed ffZed Zd Zed Zed ZedZedZ edZ!edZ"edZ#edZ$edZ%edZ&edZ'edZ(e)e*Z+e,eZ-e.e+Dcgc]\}}|j_ds|c}}Z0e1e0e D]\Z2Z3e3e+e2<e2e-e3<e jhDcic]\}}|D]}||c}}}Z5dZ6ddddddddZ7dddddddZ8dd d!d"d#d$d%d&d'd(d) Z9d*Z:Gd+d,Z;e;Zd/Z?d0Z@d1ZAdd2d3ZBejd4gd5dgd6z7ZDejd8gd9dg7ZEd:eEjT_Fd;eEj_FdeEj_Fd?eEj_Fd@eEj_FdAeEj_FdBeEj_FejdCdDZNdEZOdFZPGdGdHeEZQddddIdJZRdKZSdLZTdMZUdNZVdOZWdPZX dedRZYdfdddddSZZddddddTZ[ dgdddQdddUdVZ\dWZ]eZZ^dXZ_dYe_dZz zZ`d[Zad\Zbd]Zcd^Zdd_ZeGd`daZfdbZgehdck(regyycc}}wcc}}}w)hN)*)__all__ _cache_format_inline_cache_entries_nb_ops_intrinsic_1_descs_intrinsic_2_descs_specializations_specialized_instructions) code_infodis disassembledistbdiscofindlinestarts findlabels show_codeget_instructions InstructionBytecode FORMAT_VALUENstrreprascii MAKE_FUNCTION)defaults kwdefaults annotationsclosure LOAD_CONST RETURN_CONST LOAD_GLOBAL BINARY_OP JUMP_BACKWARDFOR_ITERSEND LOAD_ATTRLOAD_SUPER_ATTRCALL_INTRINSIC_1CALL_INTRINSIC_2CACHEcZ |a ttdrtjj}ntj}|jr|j}|jrt|jj|j|||y#t $r t ddwxYw)Nlast_excz no last traceback to disassembler>) rHsysrZ __traceback__last_tracebackAttributeError RuntimeErrortb_nextrtb_framef_codetb_lasti)tbr9r;r<s r6rrzs< z MsJ'\\//''jjrzz"bjj ""BKKd ^fg MAB L Ms ;BB* OPTIMIZED NEWLOCALSVARARGS VARKEYWORDSNESTED GENERATORNOFREE COROUTINEITERABLE_COROUTINEASYNC_GENERATOR)  @ic  g}tdD]D}d|z}||zs|jtj|t |||z}|rDn|jt |dj |S)Nrtro, )rangeappendCOMPILER_FLAG_NAMESgethexjoin)flagsnamesiflags r6 pretty_flagsrsv5 E 2Y!t 4< LL,00s4yA B TME   SZ 99U ceZdZdZy)_Unknowncy)Nz selfs r6__repr__z_Unknown.__repr__srN)rU __module__ __qualname__rrrr6rrsrrc t|dr |j}t|dr |j}nJt|dr |j}n1t|dr |j}nt|dr |j }t |tr t|d}t|dr|Stdt|jz) Nr?r@rArBrCz rFrG) rHr?r@rArBrCrKrr7rNrTrUrVs r6_get_code_objectrsNq* JJq* JJ I  II I  II I  II!S O ,q) >G$$% &&rcHt|}|tvrtt|S|SN) _all_opnamedeoptmap _all_opmap)opr5s r6_deoptoprs& r?D)-)9:htn %ArArc6|r |jS|jSr)_co_code_adaptiverF)cor<s r6_get_code_arrayrs#+2  ;;rc, tt|Sr)_format_code_inforrs r6r r s; -a0 11rcg}|jd|jz|jd|jz|jd|jz|jd|jz|jd|j z|jd|j z|jd|jz|jdt|jz|jr?|jd t|jD]}|jd |z|jr?|jd t|jD]}|jd |z|jr?|jd t|jD]}|jd |z|jr?|jdt|jD]}|jd |z|jr?|jdt|jD]}|jd |zdj!|S)NzName: %szFilename: %szArgument count: %szPositional-only arguments: %szKw-only arguments: %szNumber of locals: %szStack size: %szFlags: %sz Constants:z%4d: %rzNames:z%4d: %szVariable names:zFree variables:zCell variables: )r{co_name co_filename co_argcountco_posonlyargcountco_kwonlyargcount co_nlocals co_stacksizerco_flags co_consts enumerateco_names co_varnames co_freevars co_cellvarsr)rlinesi_ci_ns r6rrs E LL(2::56 LL(2>>9: LL(2>>9: LL023H3HHI LL(2+?+??@ LL(2==89 LL(2??:; LL(< +DDE || \"R\\*C LLS )+ {{ XR[[)C LLS )* ~~ &'R^^,C LLS )- ~~ &'R^^,C LLS )- ~~ &'R^^,C LLS )- 99U rrEc2 tt||y)NrE)rMr )rr9s r6rrs )B-d#r Positions)lineno end_lineno col_offsetend_col_offsetrq)r _Instruction) opnameopcodeargargvalargreproffset starts_lineis_jump_target positionsz!Human readable name for operationzNumeric code for operationz6Numeric argument to operation (if any), otherwise Nonez4Resolved arg value (if known), otherwise same as argz0Human readable description of operation argumentz1Start index of operation within bytecode sequencez4Line started by this opcode (if any), otherwise Nonez1True if other code jumps to here, otherwise FalsezPdis.Positions object holding the span of source code covered by this instruction_ExceptionTableEntryzstart end target depth lasticeZdZ ddZy)rc g}|rD|j$d|z}|j||jzn|jd|z|r|jdn|jd|jr|jdn|jd|jt|jj ||j|j jt|jd|jt|jj t|jr!|jd|jzdzdj|jS) Nz%%%dd z-->z z>> ())rr{rrrrjustrljust _OPNAME_WIDTHr _OPARG_WIDTHrrrstrip)r lineno_widthmark_as_current offset_widthfields lineno_fmts r6 _disassemblezInstruction._disassemble0s(  +$|3  j4+;+;;< cL01  MM% MM%    MM$  MM$  d4;;'--l;< dkk'' 67 88  MM$txx...|< =|| cDLL0367xx&&((rN)Frq)rUrrrrrr6rr s  #)rr) first_liner;r<c  t|}tt|}|||jz }nd}t t |||j |j|j|||j|S)Nr) co_positionsr;) rdictrco_firstlineno_get_instructions_bytesr_varname_from_opargrrr)rVrr;r<r linestarts line_offsets r6rrVs{  ! BnR()J 2#4#44  "?2x#@#%#9#9#%;; #-{020A/:  <z*_get_instructions_bytes..s($52P$!Q'*ad|%&2Psrz: r-F)2r __getitem__setrrzadd_unpack_opargsr}rrrrhasconstrhasnamer$rr)r*hasjabsrhasjrelrhaslocalhasfree hascomparecmp_oprFORMAT_VALUE_CONVERTERSrrrrMAKE_FUNCTION_FLAGSr%rr+rr,r rrrrrJint from_bytesr[ byteorderr-)rvarname_from_opargrrrrexception_entriesrr;rlabelsrrr_rrrrrrrrdeopcaches signed_argr5sizedatars @r6rrs  +48L}t%*;*;H D! "F$5 sFAquc"A JJv #%6K)$/C  !$..6K&{* 6)tL"56 |&t, ? Fx"1$Y"G;&&4S!VX&FOFGaW"+g"5Y&&4S!VX&FOFGaW"07":_,&4S!VX&FOFGaW"07":&4S(&COFGQ$v,.%6t%U0sNNc  tt|}t|}tt ||||j |j |j||||j| y)N)r9rrr;) rrrrRrrrrr)rrr9r;r<rrs r6rrs\$nR()J.r2r84b44{{BLL*4):$&OO$5; Prct||||||dkDrS||dz }|jD]<}t|dst|td|d|t |||||>yy) Nr>rrorFrEzDisassembly of :r8)rrrHrMrO)rr9r:r;r<rVs r6rOrO)sp;J }  AIEAq)$4 a1=&D;QY "r)r9rrrr;c Dt|} | r9t|j|z} | dk\rtt | } nd} nd} t|dz }|dk\rtt |}nd}t |||||||| |  D]}| xr|j duxr|jdkD}|r t|| r|j|k(}nD|j|cxkxr/|jdtt|jzzknc}t|j| ||||rntd ||D][}|jrd nd }|jdz }td |jd |d|j d|j"d| |]yy)Nirrrpi'rqrrrr;rEzExceptionTable:z lastirrz to z -> z [])rmaxvalueslenrrrrrMrrrrrrrrr:)rrrrrrr9rrrr; show_lineno maxlinenor maxoffsetrinstrnew_source_lineis_current_instrentryrs r6rRrR6s z"K ))+,{:  s9~.LL D A IE3y>*  (/A5)2J5@;L6B5@ B ', ,,D8, <)rOr7)r4kwargss r6rSrScsF<8CFCrrtrproc#Kd}d}tdt|dD]g}|r|dz} ||}t|}t|}|tvr1||dz|z}|t k(r|dznd}|t k\r|dt zz}nd}d}|||fiyw)Nrrprorr)rzr*rrhasarg EXTENDED_ARG _INT_OVERFLOW)r extended_argrrrrrs r6r r osL F 1c$i #  aKF  !W|&t, 6>qs)l*C)-)=C1H1L},M 11 CL"cl'$sBBc g}t|D]l\}}}| t|}t|}|tvr"t |r| }|dz|dzz}|d|zz }n|t vr|dz}nW||vs\|j |n|S)Nrp)r rrrrrr{)rrrrrrrlabels r6rrs F)$/C ?B-> >D r 23 !,!7!;&  rc |j}tt||j|j|j |j |j|j|j|j|j S)Nr&) rRrrr<rrrrTrSrrr;)rrs r6__iter__zBytecode.__iter__sk \\&r4=='I')'='='){{BLL'+'7'7373D3D9=9O9O46OO4E373C3CE Ercbdj|jj|jS)Nz{}({!r}))format __class__rUrUrs r6rzBytecode.__repr__s*  !8!8!%!6!68 8r)r;r<c |jr|j}|jr||jj|j||S)N)rPr;r<)r`rarbrc)clsrdr;r<s r6from_tracebackzBytecode.from_tracebacksC=jjBjj KK  r{{ ^f  rc. t|jSr)rrRrs r6infoz Bytecode.infosA ..rc |j}|j |j}nd}tj5}t t ||j |j|j|j|j|j|||j|j|j |jcdddS#1swYyxYw)N) rrrrrr9rrrr;)rRrPioStringIOrRrr<rrrrTrSrrr;getvalue)rrroutputs r6r z Bytecode.dissA \\    *((FF [[]f r4==A242H2H%'[[BLL*.*:*:+/+<+<$*%+151G1G,.OO,=+/+;+; =??$ % %]]s BCC) rUrrrVrXr classmethodr^r`r rrr6rrsF)-Tu_d ! E8/4u  /%rrcNddl}|j}|jd|jddd|j }|j 5}|j }dddt|j jd}t|y#1swY6xYw)Nrinfilerb?-)rTnargsdefaultr1) argparseArgumentParser add_argumentFileType parse_argsrireadr2r5r )roparserargsrir4rs r6mainrws  $ $ &F x'8'8'>cSVW    D   64;;++V 4DI s BB$__main__r)NNNNrrNF)rb)rbNNNN)ir[types collectionsrcrr _opcodes_allrrrrr r r MethodType FunctionTypeCodeTyperg staticmethodrTrLrArrrrrrrr"r#r$r%r&r'r(r)r*r+r,r-listrrrrr startswith _empty_slotzipspec_op specializedrJrr7r rr|rrrrrrr rr namedtuplerr__doc__rrrrrrrrrrrrrrrrrrrrrOrRrSr _INT_BITSr7r rrrIrNrrwrU)slotr5basefamilyrs00000r6rs@6      :B+c#b$(e+cZD   i!m$ 00  6,  E%E%P  zF]V  sK("K(K.