"""DIMENSION 1 / query 5: what the client actually PUSHES to the Flash UI.

ESTABLISHED: FUN_1800147f0 builds the visible item list then, per item i, calls
FUN_180015d80(model, dataProvider, i, item) and conditionally
FUN_1800159b0(model, dataProvider, i, item). FUN_1800159b0 is the second caller
of the by-ordinal group lookup FUN_180014420.

LIVE FACT this must explain: exactly ONE 0x1a8 copy of each pack exists in the
whole 4 GiB address space and each sits in the correct group, yet the Gold group
tile renders the Premium numbers. So the wrong value is produced at push time,
not stored.

HYPOTHESIS: FUN_1800159b0 resolves the group for an item and pushes group-level
fields (price, contents) using a key that collides.

CONTROL: FUN_180015d80 is dumped in the same batch. It is the unconditional
push, so any field seen only in FUN_1800159b0 is conditional on the mypacks
test, and any field in both is not.
"""
import traceback

OUT = "/tmp/claude-1000/-home-alex-Documents-OpenFUT/8e521ca1-ca3e-4138-bb96-df1744dd1d30/scratchpad/store/q5_out.txt"
buf = []
def P(*a):
    s = " ".join(str(x) for x in a)
    buf.append(s)
    print(s)

def C(a, label, show_callers=True):
    P("=" * 78)
    P(label, hex(a))
    P("=" * 78)
    s = dec(a)
    P("len(src) =", len(s))
    P(s)
    if show_callers:
        P("--- callers ---")
        for ent, nm in callers(a):
            P("   %-30s %s" % (nm, hex(ent)))

try:
    C(0x180015d80, "*** FUN_180015d80  per-item push (CONTROL) ***")
    C(0x1800159b0, "*** FUN_1800159b0  per-item group push ***")
    C(0x18007d880, "store screen dispatcher FUN_18007d880")
    C(0x180014de0, "FUN_180014de0")
except Exception:
    P(traceback.format_exc())

open(OUT, "w").write("\n".join(buf))
print("WROTE", OUT)
