# run rel0215 wave 2, lane cast-lvl16pair (sub-job 2 of 2): ov096, the POKEY
# pack -- POKEY (240, daSanbo_c), POKEY_SEGMENT (241, THE SAME CLASS under a
# second spawn entry point) and TORNADO (308, daTor_c). Level 16, Shifting Sand
# Land. Fresh per-symbol mount (port/ov096_syms.txt, which carries the whole
# derivation: the base proof, both attribution routes, THE THREE LIVE CONTESTED
# ADDRESSES and how each was settled from raw bytes, the PokeySegment identity
# proof, the two 31-slot widths of which one lies by five words, and the two
# RTTI-spelling pairs). The fills, the state seat and the seven method faces
# are hal/actor_classes_ov096.cpp.
#
# ==== THE SOURCE INVENTORY, COUNTED THREE WAYS =============================
# config/arm9/overlays/ov096/symbols.txt has 49 function rows (47 class bodies
# + 2 sinits) and config delinks.txt names 49 src TUs. Counted the three ways
# slice_vs.txt section 2 asks for:
#     delinked complete to a src TU ......... 49
#     present but NONMATCHING-bannered ....... 0
#     MISSING ................................ 0
# The sums agree with symbols.txt exactly. THIS OVERLAY IS 100% MATCHED with no
# bannered bodies at all, so the whole 49-TU ceiling is real rather than a
# target. 23 TUs are .cpp and 26 are .c, and NONE of the 26 .c files carries a
# C++ token (comment-stripped sweep over class/template/namespace/virtual/
# access-specifier/new/delete and the //cpp marker), so this slice needs no
# set_source_files_properties(... LANGUAGE CXX) row.
#
# ==== NINE TUs ARE HOST-COPIED, EACH REFUSED FOR A NAMED REASON ===========
# All nine stay BYTE-LOCKED in src/ as the matched proof; they are simply not
# listed below. Nothing is refused for being awkward -- the smallest genuinely
# unmodellable subtree, per the VS lane correction (it refused twelve wireless
# wrappers, eleven of which were leaf accessors, and its first boot crashed on
# a face returning 0 where the real body returns a pointer).
#
#  A. THE C++-MANGLING WALL (2 TUs). src/actors/daSanbo_c.cpp and
#     src/_ZN7TornadoD1Ev.cpp are REAL C++ class definitions ending
#     `virtual ~X();` with an empty body. mwccarm mangles that Itanium and
#     emits the name vtable slot 16 needs; MSVC emits ??1Pokey@@UAE@XZ and
#     NOTHING by that name, plus its own COMDAT vtable which the destructor
#     would store at this[0] over the ROM-shaped table the registry fills, plus
#     member-destructor calls under MSVC mangling this port does not define.
#     Three failures from one TU each -- the ov077 Lakitu/Spiny case exactly.
#     THE REPLACEMENT BODIES ARE RELOCATION-CONFIRMED AGAINST THE ROM, not
#     reasoned from the D0 sources: each D1 relocation list is its own D0 list
#     minus the final Memory::Deallocate call and its data_020a0eac argument,
#     in the same order.
#       PokeyD1   0x02135714 0x020373f8  WithMeshClsn dtor       (+0x180)
#                 0x0213571c 0x020149a4  MovingCylinderClsn dtor (+0x14c)
#                 0x02135724 0x02015ff8  ShadowModel dtor        (+0x124)
#                 0x0213572c 0x02016d20  Model dtor              (+0xd4)
#                 0x02135734 0x020112c8  _ZN8dActor_cD2Ev
#                 0x02135744 (load) 0x021379d8  its own table
#       TornadoD1 0x02136dc4 0x0201592c  TextureTransformer dtor (+0x328)
#                 0x02136dcc 0x0201691c  ModelAnim dtor          (+0x2c4)
#                 0x02136dd4 0x020373f8  WithMeshClsn dtor       (+0x108)
#                 0x02136ddc 0x020149a4  MovingCylinderClsn dtor (+0xd4)
#                 0x02136de4 0x020112c8  _ZN8dActor_cD2Ev
#                 0x02136df4 (load) 0x02137a90  its own table
#     The two lists CROSS-CONFIRM each other: WithMeshClsn, MovingCylinderClsn
#     and Actor D2 resolve to the same three arm9 addresses in both classes,
#     from two independently recovered destructors.
#       src/actors/daSanbo_c.cpp   -> port/unmatched/Pokey_HostSites.cpp
#       src/_ZN7TornadoD1Ev.cpp -> port/unmatched/Tornado_HostSites.cpp
#     BOTH D0s NEED NOTHING: src/actors/daSanbo_c.cpp and src/_ZN7TornadoD0Ev.cpp are
#     already plain C bodies that store their table by name and call flat
#     member destructors, so both stay below as matched source. That asymmetry
#     is the ROM recovery route, not a choice.
#
#  B. THE PMF DISEASE (2 TUs). Both form a real C++ pointer-to-member on a
#     DELIBERATELY INCOMPLETE class and call through a POINTER to one:
#         struct C; typedef void (C::*PMF)();
#         struct C { char pad[0x384]; PMF *pp; };
#         func_ov096_021368f0:  PMF *p = c->pp;     (c->**p)();   ENTER
#         func_ov096_021368b4:  PMF *p = c->pp + 1; (c->**p)();   TICK
#     MSVC "unknown inheritance" general form is 16 bytes, not the ROM 8-byte
#     {function, delta} record, so the call goes through the wrong
#     representation AND `c->pp + 1` strides by 16 where the ROM strides by 8 --
#     the tick dispatch would land in the middle of the enter record. Read off
#     the recovered sources own declarations, not inferred from a crash. The
#     SoundObject/Cap/MrBlizzard/BabyPenguin/Unagi/HootTheOwl/ov077/ov092
#     shape, ninth and tenth instances.
#       src/actors/daSanbo_c.cpp -> port/unmatched/Pokey_HostSites.cpp
#       src/actors/daSanbo_c.cpp -> port/unmatched/Pokey_HostSites.cpp
#     src/actors/daSanbo_c.cpp is NOT refused and stays in the slice: it sets
#     the cell pointer with plain integer arithmetic
#     (`*(int *)(c + 0x384) = (int)&data_ov096_02137b48 + (a << 4)`) and forms
#     no pointer-to-member at all. Its `a << 4` is what proves the cells are
#     PAIRS of 8-byte records: six states, twelve records.
#
#  C. THE ModelAnim SLOT-5 COLLISION (1 TU). hal/cxxname_bridge.cpp fills
#     _ZTV9ModelAnim in MSVC numbering, where slot 5 is Virtual18 (two
#     arguments) and NOT Render, and it cannot be dual-filled because something
#     real occupies the slot. src/_ZN7Tornado6RenderEv.cpp dispatches
#     `((Sub *)(c + 0x2c4))->g5(c + 0x80)` through a six-virtual local shadow
#     that counts in the ROM numbering, and src/_ZN7TornadoD1Ev.cpp names
#     +0x2c4 as a ModelAnim in its own member list. The Whomp/Fish/Butterfly/
#     HootTheOwl/ov077 case, measured rather than reasoned.
#       src/_ZN7Tornado6RenderEv.cpp -> port/unmatched/Tornado_HostSites.cpp
#
#  D. THE FALL-OFF-THE-END BODY (1 TU), FOUND BY THE FIRST BUILD, not by
#     reading. src/actors/daSanbo_c.cpp is declared `int` and has NO return
#     statement. mwccarm accepts it and lets r0 carry whatever the last call
#     left; MSVC refuses the translation unit with
#         error C4716: 'func_ov096_02135e2c': must return a value
#     -- a COMPILE failure, not an ABI one, and the only refusal in this
#     overlay that is a language-strictness difference rather than a codegen
#     difference. THE ROM AGREES NOTHING IS RETURNED: the tail at
#     0x02135ee4..0x02135ef8 is `add r1,sp,#0xc / add r0,r0,#4 / bl
#     SurfaceInfo::CopyNormalTo (void) / add sp,sp,#0x1c / pop {r4-r7,lr} /
#     bx lr` with no instruction setting r0, and the ONE caller,
#     src/actors/daSanbo_c.cpp:12, declares it `void` and discards the result
#     at line 47.
#       src/actors/daSanbo_c.cpp -> port/unmatched/Pokey_HostSites.cpp
#     THE CHEAPER ROUTE EXISTS AND WAS NOT TAKEN. port/tools/hostgen.py carries
#     a FALLS_OFF_RETURN table for exactly this failure, added by lane w5-c for
#     func_ov070_0211f0a4 (port/CMakeLists.txt:2421), and a two-line entry
#     there would keep this TU in the linkage count. hostgen.py is outside this
#     lane's append scope, so the TU is refused instead -- ONE of the 49, and
#     the only one given up for a reason that is not a real wall. A later lane
#     owning hostgen.py should convert it back; the host copy's header says how.
#
#  E. THE IMPLICIT r0 RIDE-THROUGH (1 TU), AND IT IS THE DANGEROUS ONE.
#     src/_ZN7Tornado8BehaviorEv.cpp dispatches its three-way state switch as
#         case 0: _ZN7Tornado6State0Ev(); break;
#         case 1: _ZN7Tornado6State1Ev(); break;
#         case 2: _ZN7Tornado6State2Ev(); break;
#     with NO ARGUMENTS, while all three bodies take a receiver
#     (void *self / char *c / Actor *thiz). It compiles clean because
#     include/decl_common.h:2927-2929 declares all three
#     `extern void func_ov096_...(void);`.
#     THE ROM PROVES THE RECEIVER RIDES IN r0, and this lane found it by
#     READING rather than by a crash (ov077 found its twin when four LAKITU
#     levels faulted). Tornado::Behavior at 0x02137448 does
#         push {r4,r5,lr} / sub sp,#4 / mov r4,r0 / ldr r5,[r4,#0x35c]
#     and then three bare `bl`s at 0x02137474, 0x0213747c and 0x02137484 with
#     NOTHING writing r0 in between -- each callee reads `this` straight out of
#     the register the caller was entered with. Hosted unpatched, MSVC emits
#     three zero-argument cdecl calls and each callee reads its receiver off an
#     uninitialised stack slot: a garbage pointer dereferenced on TORNADO's
#     first frame, on the one level that places it.
#     THE CALLER IS DISPLACED, not the callees -- the Ov007_ImplicitR0 /
#     Actor_ClosestPlayer / ov077-Lakitu idiom. All three callees are correct
#     and stay in this slice.
#       src/_ZN7Tornado8BehaviorEv.cpp -> port/unmatched/Tornado_HostSites.cpp
#     THE WHOLE LANE'S EXPOSURE TO THIS TRAP WAS SWEPT MECHANICALLY, not
#     eyeballed: every ovNNN symbol include/decl_common.h declares was compared
#     against its own body's arity across BOTH overlays this lane mounts.
#     ov092 has ZERO mismatches. ov096 has exactly these three, plus one
#     header-WIDER row (_ZN9daSanbo_c13OnYoshiTryEatEv, declared `(void*)` and defined
#     `(void)`) which is harmless on cdecl and is called that way only from
#     src/_ZN10HootTheOwl8BehaviorEv.cpp, a TU that is itself host-copied and
#     not linked.
#
#  F. THE decl_common REDECL TRAP (1 TU), a COMPILE failure.
#     src/_ZN7Tornado6State1Ev.cpp declares its own body
#     `void _ZN7Tornado6State1Ev(char *c);` inside an `extern "C"` block AND
#     includes include/decl_common.h, which declares the same C-linkage symbol
#     `extern void _ZN7Tornado6State1Ev(void);` at line 2928:
#         error C2733: '_ZN7Tornado6State1Ev': you cannot overload a function
#                      with 'extern "C"' linkage
#     mwccarm accepts it. The same wrong `(void)` declaration that hides the
#     ride-through in E, now failing the build outright rather than silently.
#     BOTH CHEAP ROUTES FAIL and were tried, not assumed: a per-source -D
#     cannot rename only the header's occurrence, and -DDECL_COMMON_H would
#     neutralise the header but this body needs func_ov002_020de328 and
#     _ZN7Tornado10UpdateSpinEi FROM it and declares neither itself.
#       src/_ZN7Tornado6State1Ev.cpp -> port/unmatched/Tornado_HostSites.cpp
#     The real fix is decomp-side, in tools/decl_headers.py or its config --
#     the known decl_common redecl class -- and correcting that one line
#     retires the copy and returns the TU.
#
#  G. THE WRONG-NAMED LEVEL-DATA REFERENCE (1 TU), and it is the ov017 trap
#     at ten-way scale. src/_ZN7Tornado13InitResourcesEv.cpp hands its texture
#     animation descriptor to TextureTransformer twice, spelled
#     `func_02112968`, and include/decl_common.h:1380 declares it
#     `extern int func_02112968[];`. THERE IS NO func_02112968 ANYWHERE IN
#     config/ -- the name is a recovery artifact. 0x02112968 is LEVEL-OVERLAY
#     data and ov096's own relocation says how badly:
#         from:0x021376b0 kind:load to:0x02112968
#             module:overlays(10,18,22,24,25,26,32,35,45,56)
#     TEN level overlays have a symbol at that address, every one `ambiguous`,
#     because on the DS the tornado reads its descriptor out of WHICHEVER LEVEL
#     OVERLAY IS RESIDENT. The ov017 data_ov055_02111a94 / data_ov056_02111a60
#     shape with ten claimants instead of two.
#     IDENTIFIED BY SHAPE, NOT BY THE NAME: ov024's bytes there are
#     `00000028 021118b4 021118ac 02111948 00000002 021118bc` and ov017's known
#     six-word file descriptor at 0x02111a60 is
#     `0000012c 021114bc 021114b8 021114dc 00000001 021114c0` -- the same
#     [count][ptr][ptr][ptr][small][ptr] layout with every pointer into its own
#     overlay's .rodata.
#     A PER-SYMBOL MOUNT WOULD BE WRONG. The descriptor carries FOUR relocated
#     pointers into ov024's .rodata, none of which port/ov024_syms.txt mounts
#     (that list is a hand-picked seven), so hosting the record by name would
#     leave four raw DS addresses in it -- the T2 shape. ov024 is also
#     whole-mounted (PORT_LEVEL_OVERLAYS, port/CMakeLists.txt:1436) and
#     `--whole` rebases the image's internal pointers, so the host copy reaches
#     the already-correct bytes through port_ov024_at(0x02112968), the accessor
#     hal/level_boot.cpp uses for exactly this. Nothing is added to another
#     lane's mount list.
#       src/_ZN7Tornado13InitResourcesEv.cpp -> port/unmatched/Tornado_HostSites.cpp
#     THE LIMITATION IS STATED, NOT HIDDEN: the binding is correct for LEVEL 16,
#     the only level this tree's census places TORNADO on. If a later lane finds
#     actor 308 on any of the other nine, that call needs a level-keyed dispatch
#     over the port_ovNNN_at family instead of one binding.
#
# ==== WHAT LOOKS LIKE A TENTH REFUSAL AND IS NOT =========================
# src/actors/daSanbo_c.cpp RIDES FROM SRC. It is the SAME six-virtual local
# shadow reaching index 5 as Tornado, and it is the opposite case: it
# dispatches on the member at +0xd4, which src/actors/daSanbo_c.cpp own member
# list names a plain **Model** (and Pokey::InitResources confirms it, calling
# ModelBase::SetFile on this+0xd4). hal/cxxname_bridge.cpp:511 DUAL-FILLS
# `_ZTV5Model[5] = mv_render` for exactly this shape, with the reason written
# beside it, and mv_render own signature takes the Vector3* this body passes.
# The ov017 ShipWater and ov092 ToxBox case. Refusing it would have cost a
# matched TU for nothing -- and two Renders sitting side by side in one
# overlay, one refused and one not, is why the +0xd4 / +0x2c4 distinction is
# spelled out here rather than assumed.
#
# Nothing else is refused. In particular:
#   * NO asm primitive, no DS thread scheduler, no card overlay loader tail, no
#     wireless manager reaches this overlay -- the comment-stripped sweep found
#     zero `asm`/`__asm` blocks in all 49 TUs.
#   * NO Actor::ClosestPlayer() no-argument r0 ride-through (the ov094
#     func_ov094_02136024 shape does not occur here); the sweep for
#     `ClosestPlayerEv()` with an empty argument list finds nothing, and
#     port/tools/closestplayer_guard.py runs before configure as the net.
#   * NO implicit-r1 ride-through: every internal call site passes the full
#     argument list its callee declares, checked call site by call site against
#     each callee own definition -- the check that found
#     Lakitu::InitResources missing state index in wave 1.
#
# ==== SEVEN METHOD FACES, NOT REFUSALS ====================================
# Seven TUs define REAL C++ METHODS against the generated class headers
# (include/Pokey.h declares five, include/Tornado.h two). mwccarm mangles those
# Itanium; MSVC mangles them ?Behavior@daSanbo_c@@QAEHXZ and so on, so nothing in
# the link answers to the flat name the vtable fills use. All seven stay in the
# slice and get a one-line face in hal/actor_classes_ov096.cpp -- the
# BabyPenguin/IceSheet/OneUpLogo/HootTheOwl/ShipWater/ToxBox recipe:
#     _ZN9daSanbo_c13InitResourcesEv     _ZN9daSanbo_c16CleanupResourcesEv
#     _ZN9daSanbo_c16OnPendingDestroyEv  _ZN9daSanbo_c6RenderEv
#     _ZN9daSanbo_c8BehaviorEv           _ZN7Tornado13InitResourcesEv
#     _ZN7Tornado8BehaviorEv
# src/_ZN7Tornado16CleanupResourcesEv.cpp is a .c file defining the FLAT name and
# needs no face; src/_ZN7Tornado6RenderEv.cpp is already `extern "C"` flat and
# its HOST COPY defines that flat name itself, so it needs none either.
#
# ==== T5 ADJUDICATION: THREE MARKER-CARRYING BODIES, ALL THREE REAL =======
# Three seated bodies carry `/* ... - recovered from vtable slot identity */`,
# the marker port/tools/inferred_stub_guard.py exists for. That marker records
# how the FUNCTION NAME was recovered, not where the BODY came from. Each was
# ruled against the ROM own bytes at base 0x02135700 out of
# extracted/overlays/overlay_0096.bin before being seated, and for the two
# eight-byte bodies the ruling is the whole function:
#
#   _ZN9daSanbo_c13OnYoshiTryEatEv  Pokey slot 18  0x8   e3a00004 e12fff1e
#                        = MOV r0,#4 ; BX lr, and the source is `return 4;`
#   _ZN9daSanbo_c16OnAimedAtWithEggEv  Pokey slot 29  0x8   e3a0090f e12fff1e
#                        = MOV r0,#0x0f ROR 18 = 0x3c000 = 245760, and the
#                        source is `return 245760;`
#   _ZN9daSanbo_c13OnTurnIntoEggER6Player  Pokey slot 19  0x40  sixteen instructions, and BOTH
#                        of its calls are RELOCATION-confirmed:
#                          0x02136cfc -> 0x0201061c
#                                        _ZN8dActor_c15GivePlayerCoinsER6Playerhj
#                          0x02136d04 -> 0x02043824
#                                        _ZN7fBase_c18MarkForDestructionEv
#                        with r2=1 r3=2 set immediately before the first,
#                        guarded by `ldrh r0,[r4,#0xc]` / `cmp r0,#0xf0` -- the
#                        actor-id test the recovered source writes as
#                        `v == 0xf0`, and 0xf0 is 240, POKEY own id. A
#                        fabricated stub does not test its own id.
# RESULT: 3 MATCH, 0 NOMATCH, 0 genuine guesses. All three are seated and each
# is recorded in port/tools/inferred_stub_adjudicated.txt with its ruling and
# its evidence reference; the guard passes with the DEBT list and the baseline
# untouched. THIS LANE DID NOT CORRECT THE THREE MARKER LINES: they live in
# src/, which the lane is not permitted to edit, so each entry still owes its
# decomp-side marker correction and retires when that line goes.
#
# ==== NO FOREIGN SPELLINGS =================================================
# The wave-1 sweep1 review flagged that ov017 InitResources spells its own
# overlay statics with ov055 and ov056 names, so every lane now sweeps.
# Sweeping all 49 ov096 TUs for `data_ovNNN_*` / `func_ovNNN_*` / `_ZTV*`
# tokens that are not ov096 own yields exactly six, and all six are correct:
#     func_ov002_020de328  func_ov002_020de33c   ov002 own, mounted and linked
#     _ZTV5Pokey  _ZTV9daSanbo_c                 this class two spellings
#     _ZTV7Tornado  _ZTV7daTor_c                 the other class two
# No -D rename is needed anywhere in this slice. The two RTTI spellings are
# handled by /alternatename in the seat file, which is a different mechanism
# for a different problem -- see hal/actor_classes_ov096.cpp.
#
# ==== THE MEASURED CLOSURE GAP =============================================
# Taken off the FIRST LINK'S OWN UNRESOLVED LIST, six rows. Four are naming
# mismatches handled by /alternatename in hal/actor_classes_ov096.cpp (two of
# this lane's own mount symbols spelled with a C++ type, one arm9 romdata
# symbol likewise, and one STATIC Actor::Spawn shadow spelling). One is the
# wrong-named level data in refusal G above. The sixth is a genuinely MISSING
# arm9 TU and is added to the list below:
#     src/func_02016aac.c   an arm9 five-line ARGUMENT-CARRYING FORWARDER.
#     It declares func_0204605c with ONE parameter and calls it with one, while
#     src/func_0204605c.c defines it with THREE -- so r1 and r2 ride through
#     untouched, and Tornado::InitResources calls func_02016aac with all three.
#     The ROM body is four instructions (0x02016aac: e92d4010 e1a04000
#     ebfffff9 ...), the shape port/tools/tailjump_guard.py exists for: MSVC
#     must compile it as a jmp so the caller's own frame is reused. The guard
#     asserts that after every link.
#
# ==== THE SLICE: 41 TUs (40 of ov096's 49, plus one arm9 closure TU) =======
src/func_02016aac.c
# QUARANTINED at the main->port sync (origin/main 9c7f38a24): main folded this
# class into one TU, and port/ host-copies bodies inside it (the slice_ov096 host copies).
# port/CMakeLists.txt's own assertion refuses the pair, because taking both is a
# duplicate symbol and taking the src one puts the host copy's reason back. The
# row returns when the host copy covers the whole consolidated TU.
#src/actors/daSanbo_c.cpp
src/d_a_tor.c
src/_ZN7Tornado16CleanupResourcesEv.cpp
src/_ZN7TornadoD0Ev.cpp
src/__sinit_ov096_0213770c.c
src/__sinit_ov096_02137894.c
src/_ZN7Tornado10UpdateSpinEi.cpp
src/_ZN7Tornado6State2Ev.cpp
src/_ZN7Tornado6State0Ev.cpp
