
    GJj:j                       d Z ddlmZ ddlZddlZddlZddlZddlmZ ddl	m
Z
 ej                  j                  d e ee      j                         j                                ddlmZmZ  ee      j                         j(                  d   Zedz  Zd	Zd
Zg dZddddZd dZd!dZd"dZd#dZd$dZd%dZ d&dZ!d'dZ"d(dZ#d)dZ$	 d*	 	 	 	 	 	 	 	 	 d+dZ%d,dZ&d,dZ'edfd-dZ(d.dZ)e*dk(  r e)        yy)/zHSummarize storage context for opcode 0x24 mode 1 source byte 0x0059e348.    )annotationsN)Path)Any)read_sectionsva_to_offset   outiHY zKruntime_selected_pointer_patched_public_selector_2_0_active_order_poll.json)opcode24Mode1Sourceopcode24RuntimeFlagopcode24CurrentObjectIndexz>indirect runtime producer of 0x0059e348 on a normal route pathzCopcode 0x24 mode 1 object+0x61 writes select a current-route streamz;strict map1_01a source coordinate or non-coordinate trigger)zindirect-runtime-producerzopcode24-route-stream-selectionzstrict-hotspotc                    d| dS )N0x08x values    S/home/exedev/hwanse/tools/summarize_save_selector_opcode24_mode1_runtime_context.pyhex32r   %   s    c{    c                "    t        | xs dd      S )N0   )intr   s    r   	parse_hexr   )   s    u|R  r   c                p    | j                         s|S t        j                  | j                  d            S )Nutf-8encoding)existsjsonloads	read_text)pathfallbacks     r   	load_jsonr%   -   s*    ;;=::dnngn677r   c                B    dj                  d | xs g D              xs dS )N,c              3  2   K   | ]  }t        |        y wN)str).0r   s     r   	<genexpr>zlist_text.<locals>.<genexpr>4   s     ;5CJ;s   -)join)valuess    r   	list_textr0   3   s     88;V\r;;BsBr   c                h    | D ]-  }|d   }|t        |d   |d         z   }||cxk  r	|k  s)|c S  / y )Nvasizeraw_size)max)sectionsr2   sectionstartends        r   section_for_var:   7   sP     c'&/7:+>??BN 
 r   c                   t        |t              }|s	d dd dd ddS |d   |d   z   }|d   |d   z   }t        |t              }|d uxr |t        |       k  }|r| |   nd}|rdnd	}|d
   t	        |d         t	        |d         t	        |d         t	        |      t	        |      d|t	        |      nd |t        dt        |z
        |d|d|| dS )NFzunknown-section)sectionNamemode1SourceInKnownSectionmode1SourceRawOffsetHexmode1SourceHasRawBytestaticInitialValuestaticInitialValueKindr2   r4   r3   r   zraw-file-bytezpe-zero-filled-section-tailnameTr   02x)r<   sectionVaHexsectionRawSizeHexsectionVirtualSizeHexsectionRawEndVaHexsectionVirtualEndVaHexr=   r>   r?   mode1SourceAfterRawEndBytesr@   staticInitialValueHexrA   zeroInitializedByPeLoader)r:   MODE1_SOURCEr   lenr   r5   )	exer6   r7   
raw_end_vavirtual_end_va
raw_offsethas_raw_bytestatic_valuestatic_kinds	            r   section_summaryrU   @   s   X|4G).'+%*"&&7
 	
 !44JT]WV_4Nh5JT)Cj3s8.CL&23z?L%1/7TKvgdm,"7:#67!&wv!7#J/"'"7%)8B8N5#4TX!-'*1lZ.G'H*#%l3%7!8"-)5%5 r   c                   g }| j                  d      xs g D ]  }t        |j                  d            }t        |j                  d            }||z   }|t        cxk  xr |k  nc }|j                  |j                  d      |j                  d      t	        |      |j                  d      |j                  d      |j                  d      |t        dt        |z
        t	        t        dt        |z
              d	        |S )	NsaveReadBlockstargetVaHexsizeHex	callVaHexsaveOffsetHexdescriptionr   )	rZ   rX   endVaHexr[   rY   r\   containsMode1SourcedistanceAfterEnddistanceAfterEndHex)getr   rL   appendr   r5   )save_loader_tracerowsblocktargetr3   r9   containss          r   save_block_rowsrh   c   s    D"&&'78>B 599]349-.tm\/C/;/ 99]3c
"YY7yy+ 99]3#+ #A|c'9 :#(Qs0B)C#D

 
	  Kr   c                $   i }| D ]  }|j                  d      xs i j                         D ]s  \  }}|t        vr|j                  |i       }|xs g D ]J  }|j                  d      }||j                  |d      t	        |j                  d      xs d      z   ||<   L u  t        |j                               D 	ci c]8  \  }}|t        |j                         d       D 	cg c]
  \  }}	||	d c}	}: c}	}}}S c c}	}w c c}	}}}w )NuniqueWatchValuesvalueHexr   countc                    | d    | d   fS )Nr   r   r   )items    r   <lambda>z(aggregate_watch_values.<locals>.<lambda>   s    RVWXRYQY[_`a[bPc r   )key)rk   rl   )ra   itemsDIAGNOSTIC_WATCH_NAMES
setdefaultr   sorted)
rd   	aggregaterowrB   r/   rf   	value_row	value_hex
value_rowsrl   s
             r   aggregate_watch_valuesrz   x   s1   +-I 	` WW%89?RFFH 	`LD&11))$3F#\r `	%MM*5	$$*JJy!$<s9==QXCYC^]^?_$_y!	`		`	` !'y'8 9 
 D*	 	$*:+;+;+=Cc$d
 	5 #U3
 	
 
s   (D

)D8D

D

c                    | j                  |      xs g }t        |      dk7  ry |d   j                  d      |k7  ry |d   j                  d      S )Nr   r   rl   rk   )ra   rM   )watch_valuessample_countrB   rd   s       r   stable_watch_hexr~      sP    D!'RD
4yA~Aw{{7|+7;;z""r   c           	     ^   | xs i } | s
dt         ddS | j                  d      xs g }|D cg c]  }|j                  d      s| }}|s-dt         d| j                  d      | j                  d      ddd	d
S t        d |D              t        |      t	        d      }t	        d      }t	        d      }i dddt         ddd| j                  d      d| j                  d      ddt        |      d|D cg c]%  }|j                  d      s|j                  d      ' c}d| j                  d      xs g d| j                  d      d| j                  d      d|d|d|d t        fd!t        D              d"|d#k(  d$|d#k(  |d#k(  ddd%d&S c c}w c c}w )'NFT)	available
sourcePolldiagnosticOnlyrd   reachedRouteSelectorContextsampleCountsequenceCountr   zmissing-route-row)r   r   r   totalSampleCounttotalSequenceCountrouteSampleCountrouteSequenceCountpromotionStatusc              3  X   K   | ]"  }t        |j                  d       xs d       $ yw)r   r   N)r   ra   r+   rv   s     r   r,   z1build_diagnostic_runtime_watch.<locals>.<genexpr>   s#     T#S!7!<1=Ts   (*r
   r   r   r   r   r   r   r   r   r   routeSequenceNamesrB   observedSelectorsreachedCurrentRootanyReachedCurrentRootreachedRouteSelectoranyReachedRouteSelectorContextmode1SourceValueHexruntimeFlagValueHexcurrentObjectIndexValueHexallWatchedValuesStablec              3  <   K   | ]  }t        |      d u  y wr)   )r~   )r+   rB   route_sample_countr|   s     r   r,   z1build_diagnostic_runtime_watch.<locals>.<genexpr>   s(      &
 \+=tDDP&
s   $runtimeFlagStaysDisabledInDiagnostic0x00 mode1SourceStaysZeroInDiagnosticzdiagnostic-only)'currentObjectIndexStaysZeroInDiagnosticnormalRouteProofnotRoutePromotionProofr   )DIAGNOSTIC_WATCH_POLLra   sumrz   r~   rM   allrr   )	active_order_pollall_rowsrv   
route_rowsmode1_sourceruntime_flagcurrent_object_indexr   r|   s	          @@r   build_diagnostic_runtime_watchr      s_   )/R/"
 	

 !$$V,2H!)T#SWW5R-S#TJT/" 1 5 5m D"3"7"7"H !"#2	
 		
 TTT)*5L#L2DF[\L#L2DF[\L+L:LNjkT+ 	$ 	-11-@	
 	/33OD 	. 	c*o 	*X3PVswwvX 	.223FGM2 	/334KL 	 1 5 56V W 	| 	| 	%&: 	!# &
.&
 #
& 	/0F'( 	+LF,B)* 4H63Q!"&,1 # U2 Ys   F%F%F*F*c                :   t        |       }t        | |      }t        |      }|D cg c]
  }|d   s	| }}|j                  dd      |j                  dd      |j                  dd      |j                  dd      |j                  dd      d}	| }
|	d   dk(  xr |	d   dk(  xr |	d   dk(  }t	        |      }d	}d
dgddg dddt
         g dddg dddg dddg dddg dddg dddg dddg ddg
}t        t              }|D cg c]  }t        |    }}i dt        t              d |d|d!t        |      d"|	d#|
d$|d%|j                  d&      dk(  d'|d(d)d*d)d+d)d,d)d-|d.|d/d0d1g d2|t        |      |d3S c c}w c c}w )4Nr^   exactMode1RefCountr   coveringWriteCountindexedWriteCandidateCountaddressProducerCandidateCountstaticProducerCandidateCount)r   r   r   r   r   a  Opcode 0x24 mode 1 source byte 0x0059e348 lives in the zero-filled tail of the .data section: there is no raw file byte for it, so its static process-start value is 0. It is also outside all three save-loader read blocks, and the direct/static producer scan found no writer. This rules out treating 0x0059e348 as a savedata-backed selector or static leaf chooser for map1_01a->map2_02d; in the current static evidence it is not a savedata-backed selector. The patched selector 2:0 diagnostic route row also keeps 0x0059e348 at 0x00, so that constructed run does not reveal an indirect producer. It may still be mutated indirectly on a normal route path, so promotion remains blocked without a runtime producer trace or equivalent proof.zout/save_loader_trace.jsonrW   )r#   fieldsz3out/save_selector_opcode24_mode1_source_writes.json)rd   r   r   r   r   r   r   zout/)rd   r   r   r   r   r   r   z6out/save_selector_opcode24_mode1_indirect_context.json)mode1DirectRefsglobalBaseDirectRefs!basePlusMode1OffsetCandidateCount"baseWindowMode1WriteCandidateCount(nearbyBaseWindowMode1WriteCandidateCountnoStaticBaseIndirectCandidater   z7out/save_selector_opcode24_mode1_file_read_context.json)globalDestinationReadFileRowsmode1FileReadCandidatesreadFileCallCountmode1FileReadCandidateCountmode1FileReadProducerFoundz2out/save_selector_opcode24_mode1_block_writes.json)rd   addressLikeCoveringBasesdirectCoveringWritesblockWriteCandidatesblockWriteCandidateCountz4out/save_selector_opcode24_mode1_default_effect.json)object61ConsumerGroupsbranchOperandremainingProofsrouteOperandRowCountstaticDefaultPromotesRouteruntimeProducerRequiredr   z7out/save_selector_opcode24_runtime_enabled_context.json)runtimeEnabledFlagHex"modeDispatchRequiresRuntimeFlagOnedirectWriteCount staticEvidenceProvesModeDispatchr   r   z&out/runtime_opcode24_flag_context.json)classification	pollCountruntimeFlagOneCountmode1SourceNonzeroObservedselectedRootExecutionProofFoundroutePromotionEvidenceFoundz&out/runtime_trace_execution_probe.json)canCaptureTraceNowblockersprobesqemuI386BinfmtrelocationContextr   mode1SourceHexstorage saveReadBlockContainsMode1SourcedirectProducerSummarynotSavedataBackednoStaticProducerstaticInitialZeror@   diagnosticRuntimeWatch
proofFoundF!opcode24RuntimeProducerProofFound&opcode24RouteStreamSelectionProofFoundstrictHotspotFound$failedOpcode24RuntimeProducerGateIdsmissingEvidencer   blockedr   )z>find an indirect runtime producer of 0x0059e348, if one existsz`prove opcode 0x24 mode 1 object+0x61 writes select a current-route stream, not only object statezBfind a strict map1_01a source coordinate or non-coordinate trigger)evidenceRefsevidenceRefCount
conclusion)r   rU   rh   ra   r   r   list2OPCODE24_RUNTIME_PRODUCER_MISSING_EVIDENCE_BY_GATEr   rL   boolrM   )rN   rc   mode1_source_writesr   r6   r   blocksrv   containing_blocksdirectnot_savedata_backedno_static_producerdiagnostic_watchr   evidence_refsfailed_gate_idsgate_idmissing_evidences                     r   build_summaryr      s    S!Hc8,G./F(.M#6K2LMM1556JAN1556JAN&9&=&=>Z\]&^)<)@)@A`bc)d(;(?(?@^`a(bF 0/#$) 	9/0A5	923q8 
 66GH	.  1 	
 J	
 012	
 M	
 N		
 I		
 K	
 N
	
 =
	
 =
	
ClMZ MNO ' 	;7C %-7 	& 	+D1B,C	
 	  	0 	. 	W[[)=>!C 	!"2 	e 	,U 	1% 	e 	/ 	+  	9!" 	 
#, &. 1 W NNs   
FFFc                   | d   }| d   }| j                  d      xs i }dj                  |j                  d      xs g       xs d}dj                  |j                  d      xs g       xs d}dd	d
| d    dd|j                  d       dd|j                  d       dd|j                  d       dd|j                  d       d|j                  d       d|j                  d       dd| d    d|d    d|d    d |d!    d"|d#    d$| d%    d&| j                  d'       d(| j                  d)       d*| j                  d+       d,| j                  d-       d.t        | j                  d/             dd0t        | j                  d1      xs g        d2| d3    dd	| d4   d	d5d	g| j                  d1      xs g D cg c]  }d6| 	 c}d	d7d	d8d9}| j                  d:      xs g D ]A  }|j	                  d;|j                  d<       d=t        |j                  d>             d?       C |j                  d	d@d	dAd9dB|j                  dC       d?dD|j                  dE       d?dF|j                  dG       d?dH|j                  dI       dJ|j                  dK       dLdM|j                  dN       dJ|j                  dO       dPdQ| d?dR| d?dS|j                  dT       d?dU|j                  dV       d?dW|j                  dX       d?dY|j                  dZ       d?d[|j                  d\       d?d]|j                  d3       d?d	d^d	d_d`g       | da   D ]  }	|j	                  d;|	j                  db       d=|	j                  dc       d=|	j                  dd       d=|	j                  de       d=|	j                  df       dg|	j                  dh       di|	j                  dj       dg|	j                  dk      xs d dl        |j                  g dm       |j                  dn | do   D               |j	                  d	       dpj                  |      S c c}w )qNr   r   r   , r   r-   r   z1# Save Selector Opcode 0x24 Mode1 Runtime Context z- mode1 source: `r   `z- section: `r<   z- section raw end: `rG   z- section virtual end: `rH   z- has raw file byte: r?   z- static initial value: `rJ   z` (rA   )z+- save loader block contains mode1 source: r   z&- direct/static producers: exact refs=r   , covering writes=r   , indexed writes=r   , address producers=r   z- evidence refs: r   z- proofFound: r   z)- opcode24 runtime producer proof found: r   z/- opcode24 route-stream selection proof found: r   z- strict hotspot found: r   z+- failed opcode24 runtime producer gates: `r   z- missing evidence count: r   z- promotion status: `r   r   z## Missing Evidence- z## Evidence Refsz| path | fields |z| --- | --- |r   z| `r#   z` | `r   z` |z## Diagnostic Runtime Watchz| field | value |z| source poll | `r   z| available | `r   z| diagnostic only | `r   z| route samples | `r   z
` across `r   z` route-reaching sequence(s) |z| total samples | `r   r   z` sequence(s) |z| route sequence names | `z| observed selectors | `z| mode1 source | `r   z| runtime flag | `r   z| current object index | `r   z| all watched values stable | `r   z| normal route proof | `r   z| promotion status | `z## Save Read BlockszZ| call | target | end | save offset | size | contains | distance after end | description |z2| --- | --- | --- | --- | --- | --- | ---: | --- |rW   rZ   rX   r]   r[   rY   z` | r^   z | `r`   r\   z |)r   z## Remaining Proofsr   c              3  &   K   | ]	  }d |   yw)r   Nr   r+   rn   s     r   r,   zmarkdown.<locals>.<genexpr>  s     D2dVDs   r   
)ra   r.   r0   rM   rb   extend)
summaryr   r   
diagnosticobserved_selectorsroute_sequencesrn   linesrefrv   s
             r   markdownr  |  s   i G,-F56<"J:>>2E#F#L"MTQTii
/C D JKRsO;

G$456a8
w{{=12!4
w{{+?@AC
"7;;/G#H"IK
,C DEF
#GKK0G$H#IW[[YqMrLsstu
5g>`6a5bc
08L1M0NN`agh|a}`~  P  QW  Xt  Qu  Pv  vJ  KQ  Rq  Kr  Js  	t
G$6789
\234
3GKK@c4d3ef
9'++Fn:o9pq
"7;;/C#D"EF
5iLr@s6t5uuvw
$S5F)G)M2%N$OP
(9 :;1=


/0 #*++.?"@"FB	G$Btf+	G12 	34 	56 	78 	9: 	;E> {{>*0b 
#''&/"%	#''(2C(D'ESI	

 
LL
%

JNN<89=
*..56c:

/? @AE
jnn-?@AJNN[oLpKq  rP  	Q
jnn-?@AJNN[oLpKq  rA  	B
$_$5S9
"#5"6c:
Z^^,ABC3G
Z^^,ABC3G
$Z^^4P%Q$RRUV
)*..9Q*R)SSVW
":>>2D#E"FcJ
 0A!B C3G

d</ 2 '( 
#''+&'uSWW]-C,DE#''R\J]I^ _()swwy/A.B$swwOdGeFf g-./tCGGM4J4Qc3RRTV	

 
LL01	LLD1B)CDD	LL99U[ 
Hs   Qc                V   | d   }| d   }| j                  d      xs i }dj                  |j                  d      xs g       xs d}dj                  |j                  d      xs g       xs d}dj                  d	 | d
   D              }dj                  d | d   D              }dj                  d | j                  d      xs g D              xs d}dj                  d | j                  d      xs g D              xs d}	dj                  dt        j                  t	        |j                  d                   ddt        j                  t	        |j                  d                   ddt        j                  t	        |j                  d                   ddt        j                  t	        |j                  d                   dt        j                  t	        |j                  d                   ddt        j                  t	        |j                  d                    dt        j                  t	        |j                  d!                   d"d#t        j                  |       dd$t        j                  |       dd%t        j                  t	        |j                  d&                   dd't        j                  t	        |j                  d(                   dd)t        j                  t	        |j                  d*                   dd+t        j                  t	        |j                  d,                   dd-t        j                  t	        |j                  d.                   dd/t        j                  t	        |j                  d0                   dg      }
dj                  g d1d2d3d4d5t        j                  | d6          d7d8t        j                  t	        |j                  d9                   d7d:t        j                  t	        |j                  d;                   d7d<t        j                  t	        |j                  d=                   d7d>|j                  d?       d@dAt        j                  t	        |j                  dB                   dCt        j                  t	        |j                  dD                   d@dE| dF    d@dG|dH    dI|dJ    dK|dL    dM|dN    d@	dO| j                  dP       d@dQ| j                  dR       d@dS| j                  dT       d@dU| j                  dV       d@dW| j                  dX       d@dYt        j                  t        | j                  dZ                   d7d[t        | j                  d      xs g        d@d\t        j                  | d0          d7d]d^t        j                  | d_          d`da|d]dbdc|	dddedf|
dddgdh|dddi|d]      S )jNr   r   r   r   r   r-   r   r   c              3    K   | ]`  }d t        j                  t        |j                  d                   dt        j                  t        |j                  d                   dt        j                  t        |j                  d                   dt        j                  t        |j                  d                   dt        j                  t        |j                  d                   d|j                  d       d	t        j                  t        |j                  d
                   dt        j                  t        |j                  d      xs d             d c yw)<tr><td><code>rZ   </code></td><td><code>rX   r]   r[   rY   z</code></td><td>r^   z</td><td><code>r`   r\   r-   z
</td></tr>N)htmlescaper*   ra   r   s     r   r,   zhtml_page.<locals>.<genexpr>  s+      	[[SWW[%9!:;< =[[SWW]%;!<=> ?[[SWWZ%8!9:; <[[SWW_%=!>?@ A[[SWWY%7!89: ;ww,-. /[[SWW-B%C!DEF G{{3sww}5<=>? @		s   E'E)rW   c              3  N   K   | ]  }d t        j                  |       d  ywz<li></li>Nr  r  r   s     r   r,   zhtml_page.<locals>.<genexpr>  s#     ^4dkk$/06^   #%r   c              3  N   K   | ]  }d t        j                  |       d  ywr  r  r   s     r   r,   zhtml_page.<locals>.<genexpr>  s(      ,0$t{{4 !'r  r   z
<li>-</li>c              3     K   | ]^  }d t        j                  |j                  d      xs d       dt        j                  t        |j                  d                   d ` yw)r  r#   r-   r  r   </code></td></tr>N)r  r  ra   r0   )r+   r  s     r   r,   zhtml_page.<locals>.<genexpr>  sc      "
 		[[!7C89 :[[3778+<!=>? @	"s   A$A&r   z8<tr><td colspan="2">No evidence refs recorded.</td></tr>z"<tr><th>source poll</th><td><code>r   r  z <tr><th>available</th><td><code>r   z&<tr><th>diagnostic only</th><td><code>r   z$<tr><th>route samples</th><td><code>r   z</code> across <code>r   z,</code> route-reaching sequence(s)</td></tr>z$<tr><th>total samples</th><td><code>r   r   z</code> sequence(s)</td></tr>z+<tr><th>route sequence names</th><td><code>z)<tr><th>observed selectors</th><td><code>z#<tr><th>mode1 source</th><td><code>r   z#<tr><th>runtime flag</th><td><code>r   z+<tr><th>current object index</th><td><code>r   z0<tr><th>all watched values stable</th><td><code>r   z)<tr><th>normal route proof</th><td><code>r   z'<tr><th>promotion status</th><td><code>r   zc<!doctype html><meta charset="utf-8"><title>Save Selector Opcode 0x24 Mode1 Runtime Context</title>z<style>body{font-family:system-ui,sans-serif;background:#111;color:#eee}table{border-collapse:collapse}td,th{border:1px solid #444;padding:6px 8px;vertical-align:top}code{color:#9bd4ff}</style>z8<h1>Save Selector Opcode 0x24 Mode1 Runtime Context</h1>z<ul>z<li>mode1 source: <code>r   z</code></li>z<li>section: <code>r<   z<li>section raw end: <code>rG   z<li>section virtual end: <code>rH   z<li>has raw file byte: r?   r  z <li>static initial value: <code>rJ   z	</code> (rA   z-<li>save loader block contains mode1 source: r   z(<li>direct/static producers: exact refs=r   r   r   r   r   r   r   z<li>evidence refs: r   z<li>proofFound: r   z+<li>opcode24 runtime producer proof found: r   z1<li>opcode24 route-stream selection proof found: r   z<li>strict hotspot found: r   z2<li>failed opcode24 runtime producer gates: <code>r   z<li>missing evidence count: z<li>promotion status: <code>z</ul>z<p>r   z</p>z<h2>Missing Evidence</h2><ul>z<h2>Evidence Refs</h2>zB<table><thead><tr><th>path</th><th>fields</th></tr></thead><tbody>z</tbody></table>z!<h2>Diagnostic Runtime Watch</h2>z<table><tbody>z<h2>Save Read Blocks</h2>z<table><thead><tr><th>call</th><th>target</th><th>end</th><th>save offset</th><th>size</th><th>contains</th><th>distance after end</th><th>description</th></tr></thead><tbody>z<h2>Remaining Proofs</h2><ul>)ra   r.   r  r  r*   r0   rM   )r  r   r   r  r  r  
block_rowsproofsmissing_itemsevidence_ref_rowsdiagnostic_rowss              r   	html_pager    s   i G,-F56<"J:>>2E#F#L"MTQTii
/C D JKRsO  +, J YY^7K\C]^^FII 4;KK@Q4R4XVX  	  		 "
 ;;~.4""  D 
D  ii
,T[[Z^^L=Y9Z-[,\\mn
*4;;s:>>+;V7W+X*YYjk
0SP`Aa=b1c0dduv
.t{{3z~~N`?a;b/c.ddyz~  {F  {F  GJ  KU  KY  KY  Zn  Ko  Gp  {q  zr  r^  	_
.t{{3z~~N`?a;b/c.ddyz~  {F  {F  GJ  KU  KY  KY  Zn  Ko  Gp  {q  zr  rO  	P
5dkk/6R5SSde
3DKK@R4S3TTef
-dkk#jnnMb>c:d.e-ffwx
-dkk#jnnMb>c:d.e-ffwx
5dkk#jnnUqFrBs6t5u  vG  	H
:4;;s:>>ZrKsGt;u:v  wH  	I
3DKKJNNSeDf@g4h3iiz{
1$++c*..QbBc>d2e1ffwx! O 99 )o) 	L) 	C) 		)
 #4;;w7G/H#I"J,W) dkk#gkk-.H*IJK<X) &dkk#gkkBV6W2X&Y%ZZfg) *$++c'++F^:_6`*a)bbno) "'++.E"F!GuM) +4;;s7;;G^;_7`+a*bbklplwlwx{  }D  }H  }H  Ia  }b  yc  md  le  ej  	k) 8@b8c7ddij) 36:N3O2PPbcij~c  cA  AR  SY  Zv  Sw  Rx  xL  MS  Ts  Mt  Lu  uz  	{) gkk*<=>eD) 7;;|45U;) 6gkkBe6f5gglm)  <GKKHp<q;rrwx!)" %W[[1E%F$GuM#)$ =T[[SZS^S^  `F  TG  JH  >I  =J  JV  	W%)& 's7;;7H+I+OR'P&QQVW')( 't{{7;L3M'N&O|\))* 	+), dkk',/016-). 	(/)0 	1)2 	3)4 	!5)6 	M7)8 	9): 	;)< 	,=)> 	?)@ 	A)B 	C)D 	$E)F 	zG)H 	I)J 	K)L 	(M)N 	O)P 	Q) ) )r   c                   |j                  dd       |dz  }|j                  t        j                  | dd      dz   d	       |9|j                  j                  dd       |j                  t        |       d	       |S )
NT)parentsexist_okz1save_selector_opcode24_mode1_runtime_context.jsonF   )ensure_asciiindentr   r   r   )mkdir
write_textr    dumpsparentr  )r  out_dirhtml_outjson_outs       r   write_outputsr*  #  s    MM$M.LLH

7q9D@   dT:Ig.AOr   c            	        t        j                  t              } | j                  dt        t
        dz         | j                  dt        t        dz         | j                  dt        t        dz         | j                  d	t        t        t        z         | j                  d
t        t               | j                  dt               | j                         }t        |j                  j                         t        |j                  i       t        |j                  i       t        |j                  i             }t!        ||j"                  |j$                        }t'        d|        y )N)r\   z--exezHwanse2.exe)typedefaultz--save-loader-tracezsave_loader_trace.jsonz--mode1-source-writesz/save_selector_opcode24_mode1_source_writes.jsonz--diagnostic-pollz	--out-dirz
--html-out)r,  z(wrote opcode24 mode1 runtime context -> )argparseArgumentParser__doc__add_argumentr   ROOTOUTr   
parse_argsr   rN   
read_bytesr%   rc   r   diagnostic_pollr*  r'  r(  print)parserargsr  r)  s       r   mainr:  0  s(   $$9F
dD=4HI
-D#H`B`a
/dCJ{D{|
+$F[@[\
$<
40D$(("-$**B/$&&+	G WdllDMMBH	4XJ
?@r   __main__)r   r   returnr*   )r   
str | Noner<  r   )r#   r   r$   r   r<  r   )r/   zlist[Any] | Noner<  r*   )r6   
list[dict]r2   r   r<  dict | None)rN   bytesr6   r>  r<  dict)rc   rA  r<  r>  )rd   r>  r<  dict[str, list[dict[str, Any]]])r|   rB  r}   r   rB   r*   r<  r=  )r   r?  r<  rA  r)   )
rN   r@  rc   rA  r   rA  r   r?  r<  rA  )r  rA  r<  r*   )r  rA  r'  r   r(  zPath | Noner<  r   )r<  None)+r0  
__future__r   r.  r  r    syspathlibr   typingr   r#   insertr*   __file__resolver&  probe_exe_scene_tablesr   r   r  r2  r3  rL   r   rr   r   r   r   r%   r0   r:   rU   rh   rz   r~   r   r   r  r  r*  r:  __name__r   r   r   <module>rM     sD   N "    
   3tH~--/667 8 > H~''*
Ule   	I 	NS6 2!8C F**#3t &*	m	mm m #	m
 
m`K\Vr 25d 
A& zF r   