
    UHjAg                       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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g dZddddddddddddgZdZdZdZdZ dZ!dZ"dZ#dddd d!d"d#d$d%d%d&d"d'dd(d)d*d"d+dd,d-d.d"d/dd0d1d2d"d3dd4d5d6d"d7d$d%d%d8d"d9Z$dNd:Z%dNd;Z&dOd<Z'dPd=Z(dQd>Z)dRd?Z*dSd@Z+dTdAZ,dUdBZ-dVdCZ.dVdDZ/dWdEZ0dXdFZ1dYdGZ2	 	 	 dZ	 	 	 	 	 	 	 	 	 d[dHZ3d\dIZ4d\dJZ5efd]dKZ6d^dLZ7e8dMk(  r e7        yy)_zDSummarize opcode 0x20 nested script paths that can set context+0xa8.    )annotationsN)Path)Any)read_sectionsva_to_offset   outmap1_01amap2_02d)zruntime-object-script-selectionzgate-time-context-a8-basezgate-offset-fallthrough-proofzstrict-source-hotspot)z4runtime object script selected by opcode 0x20 mode 0z2context+0xa8 base value at the 0xe8/0xea gate timezVcontrol-flow proof that the inherited gate offsets fall through to the frontier readerzstrict map1_01a source hotspotHwanse2.exezCopcode 0x20 handler, nested runner, and general handler table bytes)pathdescriptionz+out/save_selector_current_writer_paths.jsonz0current opcode 0x20 activation row at 0x005428a8z*out/save_selector_gate_offset_sources.jsonz+0xe8/0xea gate offset source classificationz-out/save_selector_selection_buffer_bases.jsonz@context+0xa8 base candidates and unresolved runtime pointer modei D i8D i(T i(T i@ i!#@ i`#@ z'save/load selection-buffer base pointerTzdword[0x0059dd70 + stream[2]*4]
0x0040575azfmode 1 restores context+0xa8 from the saved pointer table; mode 0 stores context+0x58 into that table.)namewritesContextA8baseExpressionevidenceVaHexmeaningzcall stream+4 helperF-zpasses dword [stream+4] to 0x00423a2f; this handler is adjacent to the base-mode group but does not directly write context+0xa8.zselect global selection buffer
0x0059e310
0x00406405z1sets context+0xa8 to the global selection buffer.zselect indexed save blockz0x00457750 + stream[1] * 0xd8
0x0040643dz6computes a save/runtime block slot base from stream+1.zselect runtime object pointerzFdword[0x0059db30 + context[0xf2]*4] or dword[0x0059db30 + stream[2]*4]z0x00406480, 0x004064a0zKselects an object pointer table entry either from context+0xf2 or stream+2.zselect save/runtime block base
0x004576d8
0x004064dez1sets context+0xa8 to the save/runtime block base.zruntime setup helperzgcalls 0x00421509 and may call 0x0041b579; it does not directly write context+0xa8 in this handler body.)(   ?   @   A   B   C   D   c                    d| dS )N0x08x values    O/home/exedev/hwanse/tools/summarize_save_selector_opcode20_nested_base_modes.pyhex32r)   r       c{    c                    d| dS )Nr#   02xr%   r&   s    r(   hex8r.   v   r*   r+   c                p    | j                         s|S t        j                  | j                  d            S )Nutf-8encoding)existsjsonloads	read_text)r   fallbacks     r(   	load_jsonr8   z   s*    ;;=::dnngn677r+   c                v    t        ||      }||dz   t        |       kD  ry t        j                  d| |      d   S )N   z<Ir   )r   lenstructunpack_from)exesectionsvaoffsets       r(   dword_atrB      s?    (B'F~!c#h.dC033r+   c                R    t        ||      }|||z   t        |       kD  ry| |||z    S )Nr+   )r   r;   )r>   r?   r@   sizerA   s        r(   bytes_atrE      s6    (B'F~$S1vv}%%r+   c                \    |y | D ]$  }|d   }||d   z   }||cxk  r|k  sn |d   c S  y )Nr@   raw_sizer   r%   )r?   r@   sectionstartends        r(   section_name_for_varK      sM    	z #gj))B6?"	#
 r+   c                    ||dz  z   }t        || |      }|t        |      t        |      |t        |      nd t        | |      dS )Nr:   )opcode	opcodeHex
entryVaHexhandlerVaHexhandlerSection)rB   r.   r)   rK   )r?   r>   table_varM   entry_va
handler_vas         r(   table_handlerrU      sR    &1*$H#x2J&\Ho-7-Cj)-h
C r+   c                    | t        |       | dz  t        | dz        | dz	  dz  t        | dz	  dz        | dz	  dz  t        | dz	  dz        | dz	  dz  t        | dz	  dz        d
S )N            )
r'   valueHexrM   rN   streamPlus1streamPlus1HexstreamPlus2streamPlus2HexstreamPlus3streamPlus3Hex)r)   r.   r&   s    r(   decode_stream_valuerb      s    %L$,%$,'
d*
d23t+t34t+t34 r+   c                   | D ]  }|j                  d      t        t              k7  r%|j                  d      xs i j                  d      xs g }|D ]s  }|j                  d      t        t              k(  s%|j                  d      |j                  d      |j                  d      xs g |j                  d      xs g |dc c S   y )	NwriterVaHexactivationContextcontextRowsvaHexrootHex
rootLabelsrootFieldMaps)rd   rh   ri   rj   activationRow)getr)   CURRENT_WRITER_VACURRENT_OPCODE20_VA)current_writer_pathsrowcontext_rowscontext_rows       r(   "current_opcode20_from_writer_pathsrs      s    # 77=!U+<%== 34:??NTRT' 	Kw'51D+EE#&77=#9"wwy1"%'',"7"=2%(WW_%=%C%0 		 r+   c           
        t        | |t        d      }dt        j                  d      fdt        j                  d      fdt        j                  d      fdt        j                  d	      fd
t        j                  d      fdt        j                  d      fdt        j                  d      fg}t	        |      |D cg c]  \  }}|||v d c}}dS c c}}w )N   zreads stream+1 mode8a4801z loops save slot count 0x004576e8
a0e8764500z9loads slot descriptor pointer from 0x00457750 + slot*0xd88b84c050774500z&mode 0 uses descriptor+4 nested stream8b4004zcalls nested runner 0x00402360
e8145fffffz&mode 1 uses descriptor+0 nested stream8b00z"advances save-selector stream by 483404004)labelfound)handlerBytesScannedsignatureMatches)rE   OPCODE20_HANDLERbytesfromhexr;   )r>   r?   code
signaturesr}   patterns         r(   opcode20_signature_summaryr      s    C#3T:D	h 78	+U]]<-HI	DemmTdFef	15==3JK	)5==+FG	15==3HI	-u}}Z/HIJ  #4y #-

 w  D
	 	
s   >Cc           	        t        | |t        d      }t        | |t        d      }t        t              t        t              t        t              t
        j                  d      |v |j                  t
        j                  d            dk\  ddS )Nr   ff148d38054400894140   z0x00402360 saves context+0x40, runs the nested stream through dispatcher 0x00402321, then restores context+0x40. The dispatcher uses handler table 0x00440538, not the save-selector table.)nestedRunnerVaHexnestedDispatcherVaHexnestedHandlerTableVaHexdispatcherUsesGeneralTable#runnerTemporarilySwapsContextStreamr   )rE   NESTED_DISPATCHERNESTED_RUNNERr)   GENERAL_HANDLER_TABLEr   r   count)r>   r?   
dispatcherrunners       r(   nested_runner_summaryr      sz    #x):DAJc8]D9F"=1!&'8!9#()>#?&+mm4D&E&S/5||EMM(<S/TXY/Yu
 
r+   c                 f    dddddddt        t              dd		d
ddddddt        t              dd		gS )Nr   0x00T
0x004576e8z0x00457750 + slot * 0xd8zdword[dword[slotBase] + 4]
0x0040c447zTruns each active save/object slot's secondary script pointer stored at descriptor+4.)	modemodeHexcurrentModeslotCountSourceHexslotBaseExpressionnestedStreamExpression	callVaHexrunnerVaHexr   r   0x01Fz/0x00457750 + slot * 0xd8 plus dword[0x00442da1]z=dword[dword[0x00442da1] + 4], then dword[dword[slotBase] + 0]z0x0040c466, 0x0040c4a4zbruns a party/runtime script first, then each slot's primary script pointer stored at descriptor+0.)r)   r   r%   r+   r(   	mode_rowsr      sZ     "."<&B% /m
	
  "."S&e1 /{
	
 r+   c                    g }t         j                         D ]9  \  }}t        || t        |      }|j	                  |       |j                  |       ; |S )N)GENERAL_HANDLER_NOTESitemsrU   r   updateappend)r>   r?   rowsrM   noterp   s         r(   general_handler_rowsr     sS    D-335 Hc+@&I

4C Kr+   c           
        | j                  d      xs g }|D cg c]h  }|j                  d      dv rS|j                  d      |j                  d      |j                  d      |j                  d      |j                  d      dj }}| j                  d	      | j                  d
      | j                  d      xs g |dS c c}w )NgatesselectionBufferOffsetHex>   0xe80xea	gateVaHex currentRootWriterBeforeGateCountglobalWriterCountsourceClassification)r   r   r   r   r   controlPathGateStatuscontrolPathProofStatusgateOffsetsHex)r   r   r   r   rl   )gate_offset_sourcesr   rp   	gate_rowss       r(   gate_summaryr     s    ##G,2E 
 77-.2BB -(+0J(K038Z0[!$)<!=$'GG,B$C	

I 
 "5!8!89P!Q"5"9"9:R"S-112BCIr	 
s   A-Cc                t   t        |       }||nt        t        dz  g       }||nt        t        dz  i       }||nt        t        dz  i       }t        | |t              }|t        dt        t                     t        |      }|d   dk7  rt        t        t               d      t        || t        d      }t        |      }t        | |      }	|	D 
cg c]  }
|
j                  d      d	u s|
 }}
|d
   t        fdt               D              }t        |      }|j                  d      }d}i dt         dt"        dt        t$              dt        t              d|d   d|d   d|d   d|d   dd dt'              ddk(  d|j                  d       d!|j                  d       t        t(              k(  d"|j                  d#      d$t+        | |      d%t-        | |      d&t               i d'|d(t        t.              d)|	d*t1        |      d+d	d,|j                  d-      xs d.d/|j                  d/      d0|j                  d0      xs g d1|j                  d2      xs g d3|d4|d5d6d7d6d8t2        d9t4        d:t6        d;t1        t6              d.|d<S c c}
w )=Nz'save_selector_current_writer_paths.jsonz&save_selector_gate_offset_sources.jsonz)save_selector_selection_buffer_bases.jsonz'cannot read current opcode 0x20 row at rM       z is not opcode 0x20r   Tr\   c              3  4   K   | ]  }|d    k(  s|  yw)r   Nr%   ).0rp   current_modes     r(   	<genexpr>z build_summary.<locals>.<genexpr>E  s     VC#f+:UCVs   #knownStaticGateOffsetDirectRefCounta<  The current activation row at 0x005428a8 is save-selector opcode 0x20 with mode 0. Mode 0 does not directly choose map1_01a -> map2_02d; it iterates runtime save/object slots, calls nested runner 0x00402360 with descriptor+4 script pointers, and those nested scripts dispatch through general handler table 0x00440538. Several general handlers can replace context+0xa8 with different selection-buffer bases. Because the actual runtime object scripts and selected base before the 0xe8/0xea gates are still not proven, this narrows the blocker but does not promote the route.sourcetargetcurrentWriterVaHexcurrentOpcode20VaHexcurrentOpcode20ValueHexr[   currentOpcode20OpcodeHexrN   currentOpcode20StreamPlus1Hexr]   currentOpcode20StreamPlus2Hexr_   r   zmode currentModeHexcurrentModeIsNestedObjectPlus4r    saveSelectorOpcode20HandlerVaHexrP   *saveSelectorOpcode20HandlerMatchesExpected"saveSelectorOpcode20HandlerSectionrQ   opcode20SignatureSummarynestedRunnermodescurrentModeRowgeneralHandlerTableVaHexgeneralHandlerRowsdirectContextA8SetterCountruntimePointerModeStillRequiredgateOffsetProofStatusr   blockedr   r   gateRowsr   staticGateOffsetDirectRefCountre   
proofFoundFopcode20NestedBaseProofFoundfailedOpcode20NestedBaseGateIdsmissingEvidenceevidenceRefsevidenceRefCount)promotionStatus
conclusion)r   r8   OUTrB   rn   
ValueErrorr)   rb   rU   SAVE_SELECTOR_HANDLER_TABLErs   r   rl   nextr   r   SOURCETARGETrm   r.   r   r   r   r   r;   $FAILED_OPCODE20_NESTED_BASE_GATE_IDS%OPCODE20_NESTED_BASE_MISSING_EVIDENCE"OPCODE20_NESTED_BASE_EVIDENCE_REFS)r>   ro   r   selection_buffer_basesr?   current_valuecurrent_decodedsave_handlercurrent_contextgeneral_rowsrp   direct_base_setterscurrent_mode_row	gate_infostatic_direct_ref_countr   r   s                   @r(   build_summaryr   %  s    S!H3G3S/Yb77
Z 2E1P-V_66
W 8N7Y3_h99
`
 S(,?@MB5I\C]B^_``)-8Ox D(E"5677JKLL 30KTRL89MNO'X6L*6]3#''BS:TX\:\3]]"=1LV9;VV01I4889^_	_ %&%&% 	e$56% 	&9 :	%
 	"?:#>% 	#OK$@% 	(9I)J% 	(9I)J% 	|n-% 	$|,% 	),!*;% 	+L,<,<^,L% 	5l6F6F~6VZ_`pZq6q% 	-l.>.>?O.P% 	#$>sH$M%  	-c8<!%" 	#%$ 	*%%& 	#E*?$@'%( 	l)%* 	%c*=&>+%, 	*4-%. 	 /G!H!UI/%0 	 /F!G1%2 	)--(89?R3%4 	IMM'*0b5%6 	)*A7%8 	_9%: 	e;%< 	'=%> 	*+O?%@ 	@A%B 	:C%D 	C BCE%F % I% % ^s   J54J5c                   | d   j                  d      xs g }t        d |D              }| d   }ddd| d    d	| d
    d| d    dd| d    d| d    dd| d    d| d    dd| d    dd| dt        |       d|d    dd|d    d|d     d!| d"    dd#| d$    d%d&j                  d' | d(   D              xs d) d*| d+    dd,| d-    d.| d/    dd0| d1    dd2| d3    dd| d4   dd5dg}|j	                  d6 | d7   D               |j	                  g d8       |j	                  d9 | d:   D               |j	                  g d;       |j	                  d< | d=   D               |j	                  g d>       | d?   D ]>  }|j                  d@|dA    dB|d    dC|dD    dE|dF    dE|dG    dE|dH    dB|dI    dJ       @ |j	                  g dK       |D ]   }|j                  dL|dM    dN|dO    dJ       " |j	                  ddPddQ|d    ddR|dS    ddT|dU    ddV|d    dW|d     dX|dI    g	       |j	                  g dY       | dZ   D ]8  }|j                  d@|d[    dE|d\    dB|d]    dC|d^    dE|d_    dB|dI    dJ       : |j	                  g d`       | da   D ]2  }|j                  d@|db    dE|dc    dB|dd    dN|de    dN|df    dJ       4 |j                  d       dgj                  |      S )hNr   r   c              3  D   K   | ]  }|j                  d       sd  yw)r~   r   Nr   r   rp   s     r(   r   zmarkdown.<locals>.<genexpr>|  s     Sc#'''BRSs     r   z-# Save Selector Opcode 0x20 Nested Base Modes z	- route: r   z -> r   z- current writer: `r   `z- current opcode 0x20 row: `r   z	` value `r   z- stream+1 mode: `r   z` (r   )z- save-selector handler: `r   z(- opcode 0x20 handler signatures found: /z- nested runner: `r   z0- nested dispatcher uses general handler table: r   z/- nested runner swaps/restores context stream: r   z- nested dispatcher table: `r   z:- direct context+0xa8 setter count in nested table slice: r   z- gate offsets: z, c              3  (   K   | ]
  }d | d   yw)r   Nr%   r   items     r(   r   zmarkdown.<locals>.<genexpr>  s     $WTqa[$W   r   r   z- gate offset proof status: `r   z'- runtime pointer mode still required: r   z- proofFound: `r   z!- opcode20NestedBaseProofFound: `r   z- promotion status: `r   r   z## Failed Gatesc              3  (   K   | ]
  }d | d  yw)- `r   Nr%   r  s     r(   r   zmarkdown.<locals>.<genexpr>  s     V43tfAVr  r   )r   z## Missing Evidencer   c              3  &   K   | ]	  }d |   yw)z- Nr%   r  s     r(   r   zmarkdown.<locals>.<genexpr>  s     D2dVDs   r   )r   z## Evidence Refsr   c              3  8   K   | ]  }d |d    d|d      yw)r  r   z`: r   Nr%   r   s     r(   r   zmarkdown.<locals>.<genexpr>  s/       c&k]#c-012s   r   )r   z## Opcode 0x20 Modesr   zL| mode | current | slot count | slot base | nested stream | call | meaning |z+| --- | --- | --- | --- | --- | --- | --- |r   z| `r   z` | z | `r   z` | `r   r   r   r   z |)r   z## Handler Signaturesr   z| signature | found |z| --- | --- |z| r}   z | r~   z## Nested Runnerz- runner: `z- dispatcher: `r   z- general handler table: `r   z!- dispatcher uses general table: z+- runner temporarily swaps context stream: z- meaning: )r   z## Nested General Handlersr   zQ| opcode | handler | writes context+0xa8 | base expression | evidence | meaning |z%| --- | --- | --- | --- | --- | --- |r   rN   rP   r   r   r   )r   z## Gate Rowsr   zN| gate | offset | current-root writers before gate | global writers | source |z!| --- | --- | ---: | ---: | --- |r   r   r   r   r   r   
)rl   sumr;   joinextendr   )summarysignature_matchessignature_found_countnested_runnerlinesrp   s         r(   markdownr  z  s    :;??@RSYWYS->SSN+M7

GH%&d78+<*=>
g&:;<A>
&w/E'F&GyQXYrQsPttuv
W%DEFc'R_J`Iaabc
$W-O%P$QQRS
23H2I3O`KaJbc
]+>?@B
:=Ie;f:gh
9-Hm:n9op
&w/I'J&K1M
DWMiEjDkl
499$WWEU=V$WW^[^_`
'0G(H'IK
1':[2\1]^
',/02
+G4R,S+TTUV
(9 :;1=


1E4 
LLV73T+UVV	LL  
 
LLD1B)CDD	LL  
 
LL >*  
LL   w 
#i.!c-&8%9cBV>W=X Y()*%4L0M/N OK !c)n%5R9	

 
LL   ! =r#g,s3w<.;<=	LL


m$789;
-(?@AC
$]3L%M$NaP
+M:V,W+XY
5mDi6j5kl
mI./0
 
 
LL   +, 
#k"#5^)<(=T#FWBXAY Z$%&eC,@+Ac)nEUUWY	


 
LL   z" 
#k"#5-G)H(I567s3?R;S:TTW)*+2/	

 
LL99Ur+   c                   dj                  d | d   D              }dj                  d | d   D              }dj                  d | d   D              }g }| d   D ]  }|j                  d	t        j                  |d
          d|d    dt        j                  |d          dt        j                  |d          dt        j                  |d          dt        j                  |d          dt        j                  |d          d        g }| d   D ]  }|j                  d	t        j                  |d          dt        j                  |d   xs d       d|d    dt        j                  |d          dt        j                  |d          dt        j                  |d          d        g }| d   D ]w  }|j                  d	t        j                  |d   xs d       dt        j                  |d   xs d       d|d    d |d!    d t        j                  |d"   xs d       d       y g }| d#   d$   D ]3  }|j                  d%t        j                  |d&          d |d'    d       5 d(j                  g d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=t        j                  | d>          d?t        j                  | d@          dAt        j                  | dB          dCt        j                  | dD          dEt        j                  | dF          dGt        j                  | dH   dI          dJt        j                  | dK          dLt        j                  | dM          dN| dO    dP| dQ    dRt        j                  | dS          dTdUt        j                  | dV          dWdXdY| dZd[dY| dZd\dY| dZd]d^|d_d`da|d_dbdc|d_ddde|d_dfdgd      S )hNr   c              3  N   K   | ]  }d t        j                  |       d  yw)
<li><code>z</code></li>Nhtmlescaper  s     r(   r   zhtml_page.<locals>.<genexpr>  s+       T[[&'|4   #%r   c              3  N   K   | ]  }d t        j                  |       d  yw)z<li></li>Nr  r  s     r(   r   zhtml_page.<locals>.<genexpr>  s+       t{{4 !'r  r   c              3     K   | ]9  }d t        j                  |d          dt        j                  |d          d ; yw)r  r   z	</code>: r   r  Nr  r   s     r(   r   zhtml_page.<locals>.<genexpr>  sE       T[[V-.iCDV8W7XX]^s   ?Ar   r   z<tr><td><code>r   z</code></td><td>r   z</td><td><code>r   z</code></td><td><code>r   r   r   r   z
</td></tr>r   rN   rP   r   r   r   r   r   r   r   r   z	</td><td>r   r   r   r   z<tr><td>r}   r~   r	  z<!doctype html>z<html lang="en">z<head>z  <meta charset="utf-8">zF  <meta name="viewport" content="width=device-width, initial-scale=1">z<  <title>Save Selector Opcode 0x20 Nested Base Modes</title>z	  <style>zg    :root { color-scheme: dark; font-family: system-ui, sans-serif; background: #101010; color: #eee; }z&    body { margin: 0; padding: 24px; }z,    h1 { margin: 0 0 8px; font-size: 24px; }z/    h2 { margin: 24px 0 8px; font-size: 18px; }z<    p { max-width: 1120px; color: #bbb; line-height: 1.45; }z[    table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 13px; }zi    th, td { border-bottom: 1px solid #303030; padding: 7px 8px; text-align: left; vertical-align: top; }zF    th { position: sticky; top: 0; background: #181818; color: #ddd; }z    code { color: #d7f0ff; }z
  </style>z</head>z<body>z6  <h1>Save Selector Opcode 0x20 Nested Base Modes</h1>z  <p>route r   z -&gt; r   z; current row <code>r   z</code> value <code>r   z</code>; stream+1 mode <code>r   z</code>; nested runner <code>r   r   z</code>; handler table <code>r   z(</code>; gate offset proof status <code>r   z.</code>; runtime pointer mode still required: r   z; proofFound <code>r   z </code>; promotion status <code>r   z</code>.</p>z  <p>r   z</p>z  <h2>Failed Gates</h2>z  <ul>z</ul>z  <h2>Missing Evidence</h2>z  <h2>Evidence Refs</h2>z  <h2>Opcode 0x20 Modes</h2>z  <table><thead><tr><th>mode</th><th>current</th><th>slot count</th><th>slot base</th><th>nested stream</th><th>call</th><th>meaning</th></tr></thead><tbody>z  </tbody></table>z"  <h2>Nested General Handlers</h2>z  <table><thead><tr><th>opcode</th><th>handler</th><th>writes context+0xa8</th><th>base expression</th><th>evidence</th><th>meaning</th></tr></thead><tbody>z  <h2>Gate Rows</h2>z  <table><thead><tr><th>gate</th><th>offset</th><th>root writers before gate</th><th>global writers</th><th>source</th></tr></thead><tbody>z  <h2>Signatures</h2>zH  <table><thead><tr><th>signature</th><th>found</th></tr></thead><tbody>z</body>z</html>)r  r   r  r  )	r  failed_gatesmissing_evidenceevidence_refsmode_rows_htmlrp   handler_rows_htmlgate_rows_htmlsignature_rows_htmls	            r(   	html_pager$    s   77 => L ww -.  GG >* M Nw 
S^45 6}%& 'S)=%>?@ AS)=%>?@ AS)A%BCD ES%567 8;;s9~./ 0
	

 +, 

  S%567 8S%8%?C@A B()* +S)9%:;< =S%9:; <;;s9~./ 0		


 Nz" 	
S%5%<=> ?S)C%D%KLM N9:; <*+, -;;s#9:AcBC D	
	
 123EF 
"";;s7|,- .w<. !	

 99 000 	0 	#	0
 	Q0 	G0 	0 	r0 	10 	70 	:0 	G0 	f0 	t0 	Q0  	'!0" 	#0$ 	%0& 	'0( 	A)0* dkk'("345WT[[QYIZ=[<\\pquq|q|  ~E  F\  ~]  r^  q_  _s  tx  t  t  @G  Ha  @b  tc  sd  dA  BF  BM  BM  NU  Vu  Nv  Bw  Ax  xU  VZ  Va  Va  bi  jx  by  zM  bN  VO  UP  Pm  nr  ny  ny  zA  B\  z]  n^  m_  _G  HL  HS  HS  T[  \s  Tt  Hu  Gv  vd	  e	l	  m	N
  e	O
  d	P
  P
c
  d
k
  l
x
  d
y
  c
z
  z
Z  [_  [f  [f  gn  o@  gA  [B  ZC  CO  	P+0, GL12348-0. 	"/00 e$102 	&304 !"%(506 	#708 u%90: 	';0< 	h=0> 
?0@ 	A0B 	-C0D 	gE0F 
G0H 	I0J 	K0L 	VM0N 
O0P 	Q0R 	 S0T 	SU0V 
W0X 	Y0Z 	[0\ 	]0^ 	_0 0 0r+   c                    |j                  dd       |dz  j                  t        j                  | dd      dz   d	       |d
z  j                  t	        |       d	       y )NT)parentsexist_okz-save_selector_opcode20_nested_base_modes.jsonFr   )ensure_asciiindentr	  r0   r1   -save_selector_opcode20_nested_base_modes.html)mkdir
write_textr4   dumpsr$  )r  out_dirs     r(   write_outputsr/  S  sf    MM$M.>>JJ

7q9D@ K  >>JJ9U\K]hoJpr+   c                 v   t        j                  t              } | j                  dt        t
        dz         | j                  dt        t               | j                         }t        |j                  j                               }t        ||j                         t        d|j                  dz          y )N)r   z--exer   )typedefaultz	--out-dirz5wrote save selector opcode 0x20 nested base modes -> r*  )argparseArgumentParser__doc__add_argumentr   ROOTr   
parse_argsr   r>   
read_bytesr/  r.  print)parserargsr  s      r(   mainr=  \  s    $$9F
dD=4HI
$<DDHH//12G'4<<(	A$,,  RA  CA  BB  C  Dr+   __main__)r'   intreturnstr)r   r   r7   r   r@  r   )r>   r   r?   
list[dict]r@   r?  r@  
int | None)
r>   r   r?   rB  r@   r?  rD   r?  r@  r   )r?   rB  r@   rC  r@  z
str | None)
r?   rB  r>   r   rR   r?  rM   r?  r@  dict)r'   r?  r@  rD  )ro   rB  r@  dict | None)r>   r   r?   rB  r@  rD  )r@  rB  )r>   r   r?   rB  r@  rB  )r   rD  r@  rD  )NNN)
r>   r   ro   zlist[dict] | Noner   rE  r   rE  r@  rD  )r  rD  r@  rA  )r  rD  r.  r   r@  None)r@  rF  )9r5  
__future__r   r3  r  r4   r<   syspathlibr   typingr   r   insertrA  __file__resolveparentprobe_exe_scene_tablesr   r   r&  r7  r   r   r   r   r   r   r   r   rn   rm   r   r   r   r   r)   r.   r8   rB   rE   rK   rU   rb   rs   r   r   r   r   r   r   r  r$  r/  r=  __name__r%   r+   r(   <module>rQ     s\   J "     
   3tH~--/667 8 > H~''*
Ul		( $) % \
 >I
 =D
 @Y& "& ) "       :;%{ '  V 1&%F ,9%K 0b1` 1&%F ' |W2 j84&	". 6. /3'+*.	R	R+R %R (	R
 
RjiXjZ 25 qD zF r+   