code: def parse_instruction(string, location, tokens):
      
      prefix_str = tokens.get("prefix", None)
      mnemonic_str = tokens.get("mnemonic")
      operands = [op for op in tokens.get("operands", [])]
  
      infer_operands_size(operands)
  
      # Quick hack: Capstone returns rep instead of repe for cmps and scas
      # instructions.
      if prefix_str == "rep" and (mnemonic_str.startswith("cmps") or mnemonic_str.startswith("scas")):
          prefix_str = "repe"
  
      instr = X86Instruction(
          prefix_str,
          mnemonic_str,
          operands,
          arch_info.architecture_mode
      )
  
      return instr
docs: Parse an x86 instruction.