import re
c = dec(0x18013c6d0)
open("/tmp/gf_unserved_settings.c", "w").write(c)
print("settings deser len", len(c))
cases = re.findall(r"case (0x[0-9a-f]+):|if \(iVar2 == (0x[0-9a-f]+)\)", c)
ids = sorted({int(a or b, 16) for a, b in cases})
print("switch atoms (%d):" % len(ids), " ".join(hex(i) for i in ids))

for a, nm in ((0x18012b083, "/stats/staff caller"),
              (0x180163583, "/counts caller"),
              (0x18016fa33, "/squadBuildingSets caller"),
              (0x18017a980, "/sets caller"),
              (0x180151610, "/objective/ caller A"),
              (0x180147780, "/objective/ caller B"),
              (0x18016ef23, "/totw caller"),
              (0x18014dda3, "/loan/players caller"),
              (0x18016d813, "/tutorialpopups caller"),
              (0x18016f5f3, "/storymode/progress caller")):
    d = dec(a)
    open("/tmp/gf_unserved_%x.c" % a, "w").write(d)
    print("\n" + "=" * 70)
    print("### %s @%#x  (len %d)" % (nm, a, len(d)))
    print(d[:3500])
