"""BATCH 10: disassemble the undefined thunk at 0x18011c670 (slot +0x270 of the
0xed84b12 service = the second gate on TO_TRADE_PILE)."""
import traceback
OUT = "/tmp/claude-1000/-home-alex-Documents-OpenFUT/8e521ca1-ca3e-4138-bb96-df1744dd1d30/scratchpad/cards/adv2/q10_raw.txt"
try:
    f = open(OUT, "w")
    def P(*a): f.write(" ".join(str(x) for x in a) + "\n")
    P("bytes at 0x18011c670:", read_bytes(0x18011C670, 64).hex())
    it = listing.getInstructions(addr(0x18011C670), True)
    n = 0
    while it.hasNext() and n < 40:
        i = it.next(); a = int(i.getAddress().getOffset())
        if a > 0x18011C6F0: break
        P("  %#x  %s" % (a, i)); n += 1
    P()
    for t in (0x18011C4C0, 0x18011C500):
        P("### %#x" % t); P(dec(t)); P()
    f.close(); print("WROTE", OUT)
except Exception:
    traceback.print_exc()
