code: def main():
      mapfile = open_mapping_file(
          "python-mappings/CP949.TXT", MAPPINGS_CP949
      )
      print("Loading Mapping File...")
      decmap = loadmap(mapfile)
      uhcdecmap, ksx1001decmap, cp949encmap = {}, {}, {}
      for c1, c2map in decmap.items():
          for c2, code in c2map.items():
              if c1 >= 0xA1 and c2 >= 0xA1:
                  ksx1001decmap.setdefault(c1 & 0x7F, {})
                  ksx1001decmap[c1 & 0x7F][c2 & 0x7F] = c2map[c2]
                  cp949encmap.setdefault(code >> 8, {})
                  cp949encmap[code >> 8][code & 0xFF] = (
                      c1 << 8 | c2
                  ) & 0x7F7F
              else:
                  # uhc
                  uhcdecmap.setdefault(c1, {})
                  uhcdecmap[c1][c2] = c2map[c2]
                  cp949encmap.setdefault(code >> 8, {})  # MSB set
                  cp949encmap[code >> 8][code & 0xFF] = c1 << 8 | c2
  
      with open("mappings_kr.h", "w") as fp:
          print_autogen(fp, os.path.basename(__file__))
  
          print("Generating KS X 1001 decode map...")
          writer = DecodeMapWriter(fp, "ksx1001", ksx1001decmap)
          writer.update_decode_map(KSX1001_C1, KSX1001_C2)
          writer.generate()
  
          print("Generating UHC decode map...")
          writer = DecodeMapWriter(fp, "cp949ext", uhcdecmap)
          writer.update_decode_map(UHCL1_C1, UHCL1_C2)
          writer.update_decode_map(UHCL2_C1, UHCL2_C2)
          writer.generate()
  
          print("Generating CP949 (includes KS X 1001) encode map...")
          writer = EncodeMapWriter(fp, "cp949", cp949encmap)
          writer.generate()
  
      print("Done!")
  
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types