code: def desugar_inst(
      inst: parser.InstDef,
      instructions: dict[str, Instruction],
      uops: dict[str, Uop],
  ) -> None:
      assert inst.kind == "inst"
      name = inst.name
      op_inputs: list[parser.InputEffect] = []
      parts: list[Part] = []
      uop_index = -1
      # Move unused cache entries to the Instruction, removing them from the Uop.
      for input in inst.inputs:
          if (
              isinstance(input, parser.CacheEffect)
              and input.name == "unused"
          ):
              parts.append(Skip(input.size))
          else:
              op_inputs.append(input)
              if uop_index < 0:
                  uop_index = len(parts)
                  # Place holder for the uop.
                  parts.append(Skip(0))
      uop = make_uop("_" + inst.name, inst, op_inputs)
      uop.implicitly_created = True
      uops[inst.name] = uop
      if uop_index < 0:
          parts.append(uop)
      else:
          parts[uop_index] = uop
      add_instruction(name, parts, instructions)
  
imports: from dataclasses import dataclass, field
  import lexer
  import parser
  from typing import Optional
label_desc: Use image node_id 16 for calling a global function with example usage: desugar_inst(inst, instructions, uops) without return types