"""Q8: the cardtype-9 arms inside the shared item deserializer.

Q7: FUN_1800d8330 has exactly ONE caller, FUN_18013fe00, and the decompile has
`if (local_13c == 9)` at line 729 and `if ((int)local_138 == 9)` at line 754, where
local_138 is the cardsubtypeid fed to the classifier and local_13c is the cardtype.

Print lines 640..900 of that decompile verbatim (no truncation claim will be made
from a window: the window is stated as a window). Also print lines 380..470 which
contain the itemState conversion calls, and the function tail (last 80 lines),
because the brief warns that locals that look dead are often copied out at the tail.
"""
import traceback

try:
    src = dec(0x18013FE00)
    lines = src.splitlines()
    print("total lines=%d chars=%d" % (len(lines), len(src)))
    for lo, hi, tag in [(380, 470, "itemState region"),
                        (640, 900, "cardtype-9 region"),
                        (len(lines) - 90, len(lines), "tail")]:
        print("=" * 70)
        print("--- %s: lines %d..%d ---" % (tag, lo, hi))
        for i in range(max(0, lo), min(len(lines), hi)):
            print("%5d: %s" % (i, lines[i]))
except Exception:
    traceback.print_exc()
