_ZNK8spvtools15AssemblyGrammar12lookupOpcodeEN3spv2OpEPPK17spv_opcode_desc_t:
  198|  72.7k|                                           spv_opcode_desc* desc) const {
  199|  72.7k|  return spvOpcodeTableValueLookup(target_env_, opcodeTable_, opcode, desc);
  200|  72.7k|}
_ZNK8spvtools15AssemblyGrammar13lookupOperandE18spv_operand_type_tjPPK18spv_operand_desc_t:
  211|  48.0k|                                            spv_operand_desc* desc) const {
  212|  48.0k|  return spvOperandTableValueLookup(target_env_, operandTable_, type, operand,
  213|  48.0k|                                    desc);
  214|  48.0k|}
_ZNK8spvtools15AssemblyGrammar24lookupSpecConstantOpcodeEN3spv2OpE:
  229|     55|spv_result_t AssemblyGrammar::lookupSpecConstantOpcode(spv::Op opcode) const {
  230|     55|  const auto* last = kOpSpecConstantOpcodes + kNumOpSpecConstantOpcodes;
  231|     55|  const auto* found =
  232|     55|      std::find_if(kOpSpecConstantOpcodes, last,
  233|     55|                   [opcode](const SpecConstantOpcodeEntry& entry) {
  234|     55|                     return opcode == entry.opcode;
  235|     55|                   });
  236|     55|  if (found == last) return SPV_ERROR_INVALID_LOOKUP;
  ------------------
  |  Branch (236:7): [True: 18, False: 37]
  ------------------
  237|     37|  return SPV_SUCCESS;
  238|     55|}
_ZNK8spvtools15AssemblyGrammar13lookupExtInstE19spv_ext_inst_type_tjPPK19spv_ext_inst_desc_t:
  254|  1.20k|                                            spv_ext_inst_desc* extInst) const {
  255|  1.20k|  return spvExtInstTableValueLookup(extInstTable_, type, firstWord, extInst);
  256|  1.20k|}
assembly_grammar.cpp:_ZZNK8spvtools15AssemblyGrammar24lookupSpecConstantOpcodeEN3spv2OpEENK3$_1clERKNS_12_GLOBAL__N_123SpecConstantOpcodeEntryE:
  233|  1.73k|                   [opcode](const SpecConstantOpcodeEntry& entry) {
  234|  1.73k|                     return opcode == entry.opcode;
  235|  1.73k|                   });

_ZN8spvtools15AssemblyGrammarC2EPK13spv_context_t:
   34|  3.92k|        extInstTable_(context->ext_inst_table) {}

_Z18spvBinaryHeaderGetP18spv_const_binary_t16spv_endianness_tP12spv_header_t:
   40|  3.82k|                                spv_header_t* pHeader) {
   41|  3.82k|  if (!binary->code) return SPV_ERROR_INVALID_BINARY;
  ------------------
  |  Branch (41:7): [True: 0, False: 3.82k]
  ------------------
   42|  3.82k|  if (binary->wordCount < SPV_INDEX_INSTRUCTION)
  ------------------
  |  |   39|  3.82k|#define SPV_INDEX_INSTRUCTION 5u
  ------------------
  |  Branch (42:7): [True: 0, False: 3.82k]
  ------------------
   43|      0|    return SPV_ERROR_INVALID_BINARY;
   44|  3.82k|  if (!pHeader) return SPV_ERROR_INVALID_POINTER;
  ------------------
  |  Branch (44:7): [True: 0, False: 3.82k]
  ------------------
   45|       |
   46|       |  // TODO: Validation checking?
   47|  3.82k|  pHeader->magic = spvFixWord(binary->code[SPV_INDEX_MAGIC_NUMBER], endian);
  ------------------
  |  |   34|  3.82k|#define SPV_INDEX_MAGIC_NUMBER 0u
  ------------------
   48|  3.82k|  pHeader->version = spvFixWord(binary->code[SPV_INDEX_VERSION_NUMBER], endian);
  ------------------
  |  |   35|  3.82k|#define SPV_INDEX_VERSION_NUMBER 1u
  ------------------
   49|       |  // Per 2.3.1 version's high and low bytes are 0
   50|  3.82k|  if ((pHeader->version & 0x000000ff) || pHeader->version & 0xff000000)
  ------------------
  |  Branch (50:7): [True: 9, False: 3.81k]
  |  Branch (50:42): [True: 17, False: 3.80k]
  ------------------
   51|     26|    return SPV_ERROR_INVALID_BINARY;
   52|       |  // Minimum version was 1.0 and max version is defined by SPV_VERSION.
   53|  3.80k|  if (pHeader->version < SPV_SPIRV_VERSION_WORD(1, 0) ||
  ------------------
  |  |   26|  7.60k|  ((uint32_t(uint8_t(MAJOR)) << 16) | (uint32_t(uint8_t(MINOR)) << 8))
  ------------------
  |  Branch (53:7): [True: 11, False: 3.79k]
  ------------------
   54|  3.80k|      pHeader->version > SPV_VERSION)
  ------------------
  |  |   54|  3.79k|#define SPV_VERSION 0x10600
  ------------------
  |  Branch (54:7): [True: 22, False: 3.76k]
  ------------------
   55|     33|    return SPV_ERROR_INVALID_BINARY;
   56|       |
   57|  3.76k|  pHeader->generator =
   58|  3.76k|      spvFixWord(binary->code[SPV_INDEX_GENERATOR_NUMBER], endian);
  ------------------
  |  |   36|  3.76k|#define SPV_INDEX_GENERATOR_NUMBER 2u
  ------------------
   59|  3.76k|  pHeader->bound = spvFixWord(binary->code[SPV_INDEX_BOUND], endian);
  ------------------
  |  |   37|  3.76k|#define SPV_INDEX_BOUND 3u
  ------------------
   60|  3.76k|  pHeader->schema = spvFixWord(binary->code[SPV_INDEX_SCHEMA], endian);
  ------------------
  |  |   38|  3.76k|#define SPV_INDEX_SCHEMA 4u
  ------------------
   61|  3.76k|  pHeader->instructions = &binary->code[SPV_INDEX_INSTRUCTION];
  ------------------
  |  |   39|  3.76k|#define SPV_INDEX_INSTRUCTION 5u
  ------------------
   62|       |
   63|  3.76k|  return SPV_SUCCESS;
   64|  3.80k|}
spvBinaryParse:
  815|  3.92k|                            spv_diagnostic* diagnostic) {
  816|  3.92k|  spv_context_t hijack_context = *context;
  817|  3.92k|  if (diagnostic) {
  ------------------
  |  Branch (817:7): [True: 0, False: 3.92k]
  ------------------
  818|      0|    *diagnostic = nullptr;
  819|      0|    spvtools::UseDiagnosticAsMessageConsumer(&hijack_context, diagnostic);
  820|      0|  }
  821|  3.92k|  Parser parser(&hijack_context, user_data, parsed_header, parsed_instruction);
  822|  3.92k|  return parser.parse(code, num_words, diagnostic);
  823|  3.92k|}
binary.cpp:_ZN12_GLOBAL__N_16ParserC2EPK13spv_context_tPvPF12spv_result_tS4_16spv_endianness_tjjjjjEPFS5_S4_PK24spv_parsed_instruction_tE:
   89|  3.92k|        parsed_instruction_fn_(parsed_instruction_fn) {}
binary.cpp:_ZN12_GLOBAL__N_16Parser5StateC2Ev:
  211|  7.85k|    State() : State(0, 0, nullptr) {}
binary.cpp:_ZN12_GLOBAL__N_16Parser5StateC2EPKjmPP16spv_diagnostic_t:
  204|  11.7k|          requires_endian_conversion(false) {
  205|       |      // Temporary storage for parser state within a single instruction.
  206|       |      // Most instructions require fewer than 25 words or operands.
  207|  11.7k|      operands.reserve(25);
  208|  11.7k|      endian_converted_words.reserve(25);
  209|  11.7k|      expected_operands.reserve(25);
  210|  11.7k|    }
binary.cpp:_ZN12_GLOBAL__N_16Parser5parseEPKjmPP16spv_diagnostic_t:
  240|  3.92k|                           spv_diagnostic* diagnostic_arg) {
  241|  3.92k|  _ = State(words, num_words, diagnostic_arg);
  242|       |
  243|  3.92k|  const spv_result_t result = parseModule();
  244|       |
  245|       |  // Clear the module state.  The tables might be big.
  246|  3.92k|  _ = State();
  247|       |
  248|  3.92k|  return result;
  249|  3.92k|}
binary.cpp:_ZN12_GLOBAL__N_16Parser11parseModuleEv:
  251|  3.92k|spv_result_t Parser::parseModule() {
  252|  3.92k|  if (!_.words) return diagnostic() << "Missing module.";
  ------------------
  |  Branch (252:7): [True: 3, False: 3.92k]
  ------------------
  253|       |
  254|  3.92k|  if (_.num_words < SPV_INDEX_INSTRUCTION)
  ------------------
  |  |   39|  3.92k|#define SPV_INDEX_INSTRUCTION 5u
  ------------------
  |  Branch (254:7): [True: 12, False: 3.91k]
  ------------------
  255|     12|    return diagnostic() << "Module has incomplete header: only " << _.num_words
  256|     12|                        << " words instead of " << SPV_INDEX_INSTRUCTION;
  ------------------
  |  |   39|     12|#define SPV_INDEX_INSTRUCTION 5u
  ------------------
  257|       |
  258|       |  // Check the magic number and detect the module's endianness.
  259|  3.91k|  spv_const_binary_t binary{_.words, _.num_words};
  260|  3.91k|  if (spvBinaryEndianness(&binary, &_.endian)) {
  ------------------
  |  Branch (260:7): [True: 83, False: 3.82k]
  ------------------
  261|     83|    return diagnostic() << "Invalid SPIR-V magic number '" << std::hex
  262|     83|                        << _.words[0] << "'.";
  263|     83|  }
  264|  3.82k|  _.requires_endian_conversion = !spvIsHostEndian(_.endian);
  265|       |
  266|       |  // Process the header.
  267|  3.82k|  spv_header_t header;
  268|  3.82k|  if (spvBinaryHeaderGet(&binary, _.endian, &header)) {
  ------------------
  |  Branch (268:7): [True: 59, False: 3.76k]
  ------------------
  269|       |    // It turns out there is no way to trigger this error since the only
  270|       |    // failure cases are already handled above, with better messages.
  271|     59|    return diagnostic(SPV_ERROR_INTERNAL)
  272|     59|           << "Internal error: unhandled header parse failure";
  273|     59|  }
  274|  3.76k|  if (parsed_header_fn_) {
  ------------------
  |  Branch (274:7): [True: 0, False: 3.76k]
  ------------------
  275|      0|    if (auto error = parsed_header_fn_(user_data_, _.endian, header.magic,
  ------------------
  |  Branch (275:14): [True: 0, False: 0]
  ------------------
  276|      0|                                       header.version, header.generator,
  277|      0|                                       header.bound, header.schema)) {
  278|      0|      return error;
  279|      0|    }
  280|      0|  }
  281|       |
  282|       |  // Process the instructions.
  283|  3.76k|  _.word_index = SPV_INDEX_INSTRUCTION;
  ------------------
  |  |   39|  3.76k|#define SPV_INDEX_INSTRUCTION 5u
  ------------------
  284|  73.8k|  while (_.word_index < _.num_words)
  ------------------
  |  Branch (284:10): [True: 72.7k, False: 1.12k]
  ------------------
  285|  72.7k|    if (auto error = parseInstruction()) return error;
  ------------------
  |  Branch (285:14): [True: 2.64k, False: 70.0k]
  ------------------
  286|       |
  287|       |  // Running off the end should already have been reported earlier.
  288|  1.12k|  assert(_.word_index == _.num_words);
  289|       |
  290|      0|  return SPV_SUCCESS;
  291|  3.76k|}
binary.cpp:_ZN12_GLOBAL__N_16Parser10diagnosticEv:
  151|  2.57k|  spvtools::DiagnosticStream diagnostic() {
  152|       |    // The default failure for parsing is invalid binary.
  153|  2.57k|    return diagnostic(SPV_ERROR_INVALID_BINARY);
  154|  2.57k|  }
binary.cpp:_ZN12_GLOBAL__N_16Parser10diagnosticE12spv_result_t:
  145|  2.79k|  spvtools::DiagnosticStream diagnostic(spv_result_t error) {
  146|  2.79k|    return spvtools::DiagnosticStream({0, 0, _.instruction_count}, consumer_,
  147|  2.79k|                                      "", error);
  148|  2.79k|  }
binary.cpp:_ZN12_GLOBAL__N_16Parser16parseInstructionEv:
  293|  72.7k|spv_result_t Parser::parseInstruction() {
  294|  72.7k|  _.instruction_count++;
  295|       |
  296|       |  // The zero values for all members except for opcode are the
  297|       |  // correct initial values.
  298|  72.7k|  spv_parsed_instruction_t inst = {};
  299|       |
  300|  72.7k|  const uint32_t first_word = peek();
  301|       |
  302|       |  // If the module's endianness is different from the host native endianness,
  303|       |  // then converted_words contains the endian-translated words in the
  304|       |  // instruction.
  305|  72.7k|  _.endian_converted_words.clear();
  306|  72.7k|  _.endian_converted_words.push_back(first_word);
  307|       |
  308|       |  // After a successful parse of the instruction, the inst.operands member
  309|       |  // will point to this vector's storage.
  310|  72.7k|  _.operands.clear();
  311|       |
  312|  72.7k|  assert(_.word_index < _.num_words);
  313|       |  // Decompose and check the first word.
  314|      0|  uint16_t inst_word_count = 0;
  315|  72.7k|  spvOpcodeSplit(first_word, &inst_word_count, &inst.opcode);
  316|  72.7k|  if (inst_word_count < 1) {
  ------------------
  |  Branch (316:7): [True: 33, False: 72.7k]
  ------------------
  317|     33|    return diagnostic() << "Invalid instruction word count: "
  318|     33|                        << inst_word_count;
  319|     33|  }
  320|  72.7k|  spv_opcode_desc opcode_desc;
  321|  72.7k|  if (grammar_.lookupOpcode(static_cast<spv::Op>(inst.opcode), &opcode_desc))
  ------------------
  |  Branch (321:7): [True: 70, False: 72.6k]
  ------------------
  322|     70|    return diagnostic() << "Invalid opcode: " << inst.opcode;
  323|       |
  324|       |  // Advance past the opcode word.  But remember the of the start
  325|       |  // of the instruction.
  326|  72.6k|  const size_t inst_offset = _.word_index;
  327|  72.6k|  _.word_index++;
  328|       |
  329|       |  // Maintains the ordered list of expected operand types.
  330|       |  // For many instructions we only need the {numTypes, operandTypes}
  331|       |  // entries in opcode_desc.  However, sometimes we need to modify
  332|       |  // the list as we parse the operands. This occurs when an operand
  333|       |  // has its own logical operands (such as the LocalSize operand for
  334|       |  // ExecutionMode), or for extended instructions that may have their
  335|       |  // own operands depending on the selected extended instruction.
  336|  72.6k|  _.expected_operands.clear();
  337|   231k|  for (auto i = 0; i < opcode_desc->numTypes; i++)
  ------------------
  |  Branch (337:20): [True: 158k, False: 72.6k]
  ------------------
  338|   158k|    _.expected_operands.push_back(
  339|   158k|        opcode_desc->operandTypes[opcode_desc->numTypes - i - 1]);
  340|       |
  341|   906k|  while (_.word_index < inst_offset + inst_word_count) {
  ------------------
  |  Branch (341:10): [True: 835k, False: 70.2k]
  ------------------
  342|   835k|    const uint16_t inst_word_index = uint16_t(_.word_index - inst_offset);
  343|   835k|    if (_.expected_operands.empty()) {
  ------------------
  |  Branch (343:9): [True: 233, False: 835k]
  ------------------
  344|    233|      return diagnostic() << "Invalid instruction Op" << opcode_desc->name
  345|    233|                          << " starting at word " << inst_offset
  346|    233|                          << ": expected no more operands after "
  347|    233|                          << inst_word_index
  348|    233|                          << " words, but stated word count is "
  349|    233|                          << inst_word_count << ".";
  350|    233|    }
  351|       |
  352|   835k|    spv_operand_type_t type =
  353|   835k|        spvTakeFirstMatchableOperand(&_.expected_operands);
  354|       |
  355|   835k|    if (auto error =
  ------------------
  |  Branch (355:14): [True: 2.16k, False: 833k]
  ------------------
  356|   835k|            parseOperand(inst_offset, &inst, type, &_.endian_converted_words,
  357|   835k|                         &_.operands, &_.expected_operands)) {
  358|  2.16k|      return error;
  359|  2.16k|    }
  360|   835k|  }
  361|       |
  362|  70.2k|  if (!_.expected_operands.empty() &&
  ------------------
  |  Branch (362:7): [True: 4.70k, False: 65.5k]
  ------------------
  363|  70.2k|      !spvOperandIsOptional(_.expected_operands.back())) {
  ------------------
  |  Branch (363:7): [True: 36, False: 4.66k]
  ------------------
  364|     36|    return diagnostic() << "End of input reached while decoding Op"
  365|     36|                        << opcode_desc->name << " starting at word "
  366|     36|                        << inst_offset << ": expected more operands after "
  367|     36|                        << inst_word_count << " words.";
  368|     36|  }
  369|       |
  370|  70.1k|  if ((inst_offset + inst_word_count) != _.word_index) {
  ------------------
  |  Branch (370:7): [True: 102, False: 70.0k]
  ------------------
  371|    102|    return diagnostic() << "Invalid word count: Op" << opcode_desc->name
  372|    102|                        << " starting at word " << inst_offset
  373|    102|                        << " says it has " << inst_word_count
  374|    102|                        << " words, but found " << _.word_index - inst_offset
  375|    102|                        << " words instead.";
  376|    102|  }
  377|       |
  378|       |  // Check the computed length of the endian-converted words vector against
  379|       |  // the declared number of words in the instruction.  If endian conversion
  380|       |  // is required, then they should match.  If no endian conversion was
  381|       |  // performed, then the vector only contains the initial opcode/word-count
  382|       |  // word.
  383|  70.0k|  assert(!_.requires_endian_conversion ||
  384|  70.0k|         (inst_word_count == _.endian_converted_words.size()));
  385|      0|  assert(_.requires_endian_conversion ||
  386|  70.0k|         (_.endian_converted_words.size() == 1));
  387|       |
  388|      0|  recordNumberType(inst_offset, &inst);
  389|       |
  390|  70.0k|  if (_.requires_endian_conversion) {
  ------------------
  |  Branch (390:7): [True: 7.56k, False: 62.5k]
  ------------------
  391|       |    // We must wait until here to set this pointer, because the vector might
  392|       |    // have been be resized while we accumulated its elements.
  393|  7.56k|    inst.words = _.endian_converted_words.data();
  394|  62.5k|  } else {
  395|       |    // If no conversion is required, then just point to the underlying binary.
  396|       |    // This saves time and space.
  397|  62.5k|    inst.words = _.words + inst_offset;
  398|  62.5k|  }
  399|  70.0k|  inst.num_words = inst_word_count;
  400|       |
  401|       |  // We must wait until here to set this pointer, because the vector might
  402|       |  // have been be resized while we accumulated its elements.
  403|  70.0k|  inst.operands = _.operands.data();
  404|  70.0k|  inst.num_operands = uint16_t(_.operands.size());
  405|       |
  406|       |  // Issue the callback.  The callee should know that all the storage in inst
  407|       |  // is transient, and will disappear immediately afterward.
  408|  70.0k|  if (parsed_instruction_fn_) {
  ------------------
  |  Branch (408:7): [True: 0, False: 70.0k]
  ------------------
  409|      0|    if (auto error = parsed_instruction_fn_(user_data_, &inst)) return error;
  ------------------
  |  Branch (409:14): [True: 0, False: 0]
  ------------------
  410|      0|  }
  411|       |
  412|  70.0k|  return SPV_SUCCESS;
  413|  70.0k|}
binary.cpp:_ZNK12_GLOBAL__N_16Parser4peekEv:
  171|   907k|  uint32_t peek() const { return peekAt(_.word_index); }
binary.cpp:_ZNK12_GLOBAL__N_16Parser6peekAtEm:
  174|  1.06M|  uint32_t peekAt(size_t index) const {
  175|  1.06M|    assert(index < _.num_words);
  176|      0|    return spvFixWord(_.words[index], _.endian);
  177|  1.06M|  }
binary.cpp:_ZN12_GLOBAL__N_16Parser12parseOperandEmP24spv_parsed_instruction_t18spv_operand_type_tPNSt3__16vectorIjNS4_9allocatorIjEEEEPNS5_I20spv_parsed_operand_tNS6_ISA_EEEEPNS5_IS3_NS6_IS3_EEEE:
  420|   835k|                                  spv_operand_pattern_t* expected_operands) {
  421|   835k|  const spv::Op opcode = static_cast<spv::Op>(inst->opcode);
  422|       |  // We'll fill in this result as we go along.
  423|   835k|  spv_parsed_operand_t parsed_operand;
  424|   835k|  parsed_operand.offset = uint16_t(_.word_index - inst_offset);
  425|       |  // Most operands occupy one word.  This might be be adjusted later.
  426|   835k|  parsed_operand.num_words = 1;
  427|       |  // The type argument is the one used by the grammar to parse the instruction.
  428|       |  // But it can exposes internal parser details such as whether an operand is
  429|       |  // optional or actually represents a variable-length sequence of operands.
  430|       |  // The resulting type should be adjusted to avoid those internal details.
  431|       |  // In most cases, the resulting operand type is the same as the grammar type.
  432|   835k|  parsed_operand.type = type;
  433|       |
  434|       |  // Assume non-numeric values.  This will be updated for literal numbers.
  435|   835k|  parsed_operand.number_kind = SPV_NUMBER_NONE;
  436|   835k|  parsed_operand.number_bit_width = 0;
  437|       |
  438|   835k|  if (_.word_index >= _.num_words)
  ------------------
  |  Branch (438:7): [True: 596, False: 834k]
  ------------------
  439|    596|    return exhaustedInputDiagnostic(inst_offset, opcode, type);
  440|       |
  441|   834k|  const uint32_t word = peek();
  442|       |
  443|       |  // Do the words in this operand have to be converted to native endianness?
  444|       |  // True for all but literal strings.
  445|   834k|  bool convert_operand_endianness = true;
  446|       |
  447|   834k|  switch (type) {
  448|  8.28k|    case SPV_OPERAND_TYPE_TYPE_ID:
  ------------------
  |  Branch (448:5): [True: 8.28k, False: 826k]
  ------------------
  449|  8.28k|      if (!word)
  ------------------
  |  Branch (449:11): [True: 1, False: 8.28k]
  ------------------
  450|      1|        return diagnostic(SPV_ERROR_INVALID_ID) << "Error: Type Id is 0";
  451|  8.28k|      inst->type_id = word;
  452|  8.28k|      break;
  453|       |
  454|  23.6k|    case SPV_OPERAND_TYPE_RESULT_ID:
  ------------------
  |  Branch (454:5): [True: 23.6k, False: 811k]
  ------------------
  455|  23.6k|      if (!word)
  ------------------
  |  Branch (455:11): [True: 4, False: 23.6k]
  ------------------
  456|      4|        return diagnostic(SPV_ERROR_INVALID_ID) << "Error: Result Id is 0";
  457|  23.6k|      inst->result_id = word;
  458|       |      // Save the result ID to type ID mapping.
  459|       |      // In the grammar, type ID always appears before result ID.
  460|  23.6k|      if (_.id_to_type_id.find(inst->result_id) != _.id_to_type_id.end())
  ------------------
  |  Branch (460:11): [True: 2, False: 23.6k]
  ------------------
  461|      2|        return diagnostic(SPV_ERROR_INVALID_ID)
  462|      2|               << "Id " << inst->result_id << " is defined more than once";
  463|       |      // Record it.
  464|       |      // A regular value maps to its type.  Some instructions (e.g. OpLabel)
  465|       |      // have no type Id, and will map to 0.  The result Id for a
  466|       |      // type-generating instruction (e.g. OpTypeInt) maps to itself.
  467|  23.6k|      _.id_to_type_id[inst->result_id] =
  468|  23.6k|          spvOpcodeGeneratesType(opcode) ? inst->result_id : inst->type_id;
  ------------------
  |  Branch (468:11): [True: 9.22k, False: 14.4k]
  ------------------
  469|  23.6k|      break;
  470|       |
  471|   210k|    case SPV_OPERAND_TYPE_ID:
  ------------------
  |  Branch (471:5): [True: 210k, False: 624k]
  ------------------
  472|   515k|    case SPV_OPERAND_TYPE_OPTIONAL_ID:
  ------------------
  |  Branch (472:5): [True: 305k, False: 529k]
  ------------------
  473|   515k|      if (!word) return diagnostic(SPV_ERROR_INVALID_ID) << "Id is 0";
  ------------------
  |  Branch (473:11): [True: 12, False: 515k]
  ------------------
  474|   515k|      parsed_operand.type = SPV_OPERAND_TYPE_ID;
  475|       |
  476|   515k|      if (opcode == spv::Op::OpExtInst && parsed_operand.offset == 3) {
  ------------------
  |  Branch (476:11): [True: 174k, False: 340k]
  |  Branch (476:43): [True: 1.36k, False: 173k]
  ------------------
  477|       |        // The current word is the extended instruction set Id.
  478|       |        // Set the extended instruction set type for the current instruction.
  479|  1.36k|        auto ext_inst_type_iter = _.import_id_to_ext_inst_type.find(word);
  480|  1.36k|        if (ext_inst_type_iter == _.import_id_to_ext_inst_type.end()) {
  ------------------
  |  Branch (480:13): [True: 144, False: 1.21k]
  ------------------
  481|    144|          return diagnostic(SPV_ERROR_INVALID_ID)
  482|    144|                 << "OpExtInst set Id " << word
  483|    144|                 << " does not reference an OpExtInstImport result Id";
  484|    144|        }
  485|  1.21k|        inst->ext_inst_type = ext_inst_type_iter->second;
  486|  1.21k|      }
  487|   515k|      break;
  488|       |
  489|   515k|    case SPV_OPERAND_TYPE_SCOPE_ID:
  ------------------
  |  Branch (489:5): [True: 872, False: 834k]
  ------------------
  490|  1.27k|    case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID:
  ------------------
  |  Branch (490:5): [True: 403, False: 834k]
  ------------------
  491|       |      // Check for trivially invalid values.  The operand descriptions already
  492|       |      // have the word "ID" in them.
  493|  1.27k|      if (!word) return diagnostic() << spvOperandTypeStr(type) << " is 0";
  ------------------
  |  Branch (493:11): [True: 2, False: 1.27k]
  ------------------
  494|  1.27k|      break;
  495|       |
  496|  1.27k|    case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER: {
  ------------------
  |  Branch (496:5): [True: 1.20k, False: 833k]
  ------------------
  497|  1.20k|      assert(spv::Op::OpExtInst == opcode);
  498|      0|      assert(inst->ext_inst_type != SPV_EXT_INST_TYPE_NONE);
  499|      0|      spv_ext_inst_desc ext_inst;
  500|  1.20k|      if (grammar_.lookupExtInst(inst->ext_inst_type, word, &ext_inst) ==
  ------------------
  |  Branch (500:11): [True: 783, False: 420]
  ------------------
  501|  1.20k|          SPV_SUCCESS) {
  502|       |        // if we know about this ext inst, push the expected operands
  503|    783|        spvPushOperandTypes(ext_inst->operandTypes, expected_operands);
  504|    783|      } else {
  505|       |        // if we don't know this extended instruction and the set isn't
  506|       |        // non-semantic, we cannot process further
  507|    420|        if (!spvExtInstIsNonSemantic(inst->ext_inst_type)) {
  ------------------
  |  Branch (507:13): [True: 32, False: 388]
  ------------------
  508|     32|          return diagnostic()
  509|     32|                 << "Invalid extended instruction number: " << word;
  510|    388|        } else {
  511|       |          // for non-semantic instruction sets, we know the form of all such
  512|       |          // extended instructions contains a series of IDs as parameters
  513|    388|          expected_operands->push_back(SPV_OPERAND_TYPE_VARIABLE_ID);
  514|    388|        }
  515|    420|      }
  516|  1.20k|    } break;
  517|       |
  518|  1.17k|    case SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER: {
  ------------------
  |  Branch (518:5): [True: 92, False: 834k]
  ------------------
  519|     92|      assert(spv::Op::OpSpecConstantOp == opcode);
  520|     92|      if (word > static_cast<uint32_t>(spv::Op::Max) ||
  ------------------
  |  Branch (520:11): [True: 37, False: 55]
  ------------------
  521|     92|          grammar_.lookupSpecConstantOpcode(spv::Op(word))) {
  ------------------
  |  Branch (521:11): [True: 18, False: 37]
  ------------------
  522|     55|        return diagnostic()
  523|     55|               << "Invalid " << spvOperandTypeStr(type) << ": " << word;
  524|     55|      }
  525|     37|      spv_opcode_desc opcode_entry = nullptr;
  526|     37|      if (grammar_.lookupOpcode(spv::Op(word), &opcode_entry)) {
  ------------------
  |  Branch (526:11): [True: 0, False: 37]
  ------------------
  527|      0|        return diagnostic(SPV_ERROR_INTERNAL)
  528|      0|               << "OpSpecConstant opcode table out of sync";
  529|      0|      }
  530|       |      // OpSpecConstant opcodes must have a type and result. We've already
  531|       |      // processed them, so skip them when preparing to parse the other
  532|       |      // operants for the opcode.
  533|     37|      assert(opcode_entry->hasType);
  534|      0|      assert(opcode_entry->hasResult);
  535|      0|      assert(opcode_entry->numTypes >= 2);
  536|      0|      spvPushOperandTypes(opcode_entry->operandTypes + 2, expected_operands);
  537|     37|    } break;
  538|       |
  539|  18.7k|    case SPV_OPERAND_TYPE_LITERAL_INTEGER:
  ------------------
  |  Branch (539:5): [True: 18.7k, False: 816k]
  ------------------
  540|  73.9k|    case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER:
  ------------------
  |  Branch (540:5): [True: 55.1k, False: 779k]
  ------------------
  541|       |      // These are regular single-word literal integer operands.
  542|       |      // Post-parsing validation should check the range of the parsed value.
  543|  73.9k|      parsed_operand.type = SPV_OPERAND_TYPE_LITERAL_INTEGER;
  544|       |      // It turns out they are always unsigned integers!
  545|  73.9k|      parsed_operand.number_kind = SPV_NUMBER_UNSIGNED_INT;
  546|  73.9k|      parsed_operand.number_bit_width = 32;
  547|  73.9k|      break;
  548|       |
  549|  1.22k|    case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER:
  ------------------
  |  Branch (549:5): [True: 1.22k, False: 833k]
  ------------------
  550|   153k|    case SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER:
  ------------------
  |  Branch (550:5): [True: 152k, False: 682k]
  ------------------
  551|   153k|      parsed_operand.type = SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER;
  552|   153k|      if (opcode == spv::Op::OpSwitch) {
  ------------------
  |  Branch (552:11): [True: 152k, False: 1.22k]
  ------------------
  553|       |        // The literal operands have the same type as the value
  554|       |        // referenced by the selector Id.
  555|   152k|        const uint32_t selector_id = peekAt(inst_offset + 1);
  556|   152k|        const auto type_id_iter = _.id_to_type_id.find(selector_id);
  557|   152k|        if (type_id_iter == _.id_to_type_id.end() ||
  ------------------
  |  Branch (557:13): [True: 118, False: 152k]
  |  Branch (557:13): [True: 119, False: 152k]
  ------------------
  558|   152k|            type_id_iter->second == 0) {
  ------------------
  |  Branch (558:13): [True: 1, False: 152k]
  ------------------
  559|    119|          return diagnostic() << "Invalid OpSwitch: selector id " << selector_id
  560|    119|                              << " has no type";
  561|    119|        }
  562|   152k|        uint32_t type_id = type_id_iter->second;
  563|       |
  564|   152k|        if (selector_id == type_id) {
  ------------------
  |  Branch (564:13): [True: 37, False: 152k]
  ------------------
  565|       |          // Recall that by convention, a result ID that is a type definition
  566|       |          // maps to itself.
  567|     37|          return diagnostic() << "Invalid OpSwitch: selector id " << selector_id
  568|     37|                              << " is a type, not a value";
  569|     37|        }
  570|   152k|        if (auto error = setNumericTypeInfoForType(&parsed_operand, type_id))
  ------------------
  |  Branch (570:18): [True: 55, False: 152k]
  ------------------
  571|     55|          return error;
  572|   152k|        if (parsed_operand.number_kind != SPV_NUMBER_UNSIGNED_INT &&
  ------------------
  |  Branch (572:13): [True: 147k, False: 4.85k]
  ------------------
  573|   152k|            parsed_operand.number_kind != SPV_NUMBER_SIGNED_INT) {
  ------------------
  |  Branch (573:13): [True: 1, False: 147k]
  ------------------
  574|      1|          return diagnostic() << "Invalid OpSwitch: selector id " << selector_id
  575|      1|                              << " is not a scalar integer";
  576|      1|        }
  577|   152k|      } else {
  578|  1.22k|        assert(opcode == spv::Op::OpConstant ||
  579|  1.22k|               opcode == spv::Op::OpSpecConstant);
  580|       |        // The literal number type is determined by the type Id for the
  581|       |        // constant.
  582|      0|        assert(inst->type_id);
  583|  1.22k|        if (auto error =
  ------------------
  |  Branch (583:18): [True: 199, False: 1.02k]
  ------------------
  584|  1.22k|                setNumericTypeInfoForType(&parsed_operand, inst->type_id))
  585|    199|          return error;
  586|  1.22k|      }
  587|   153k|      break;
  588|       |
  589|   153k|    case SPV_OPERAND_TYPE_LITERAL_STRING:
  ------------------
  |  Branch (589:5): [True: 11.4k, False: 823k]
  ------------------
  590|  11.6k|    case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING: {
  ------------------
  |  Branch (590:5): [True: 195, False: 834k]
  ------------------
  591|  11.6k|      const size_t max_words = _.num_words - _.word_index;
  592|  11.6k|      std::string string =
  593|  11.6k|          spvtools::utils::MakeString(_.words + _.word_index, max_words, false);
  594|       |
  595|  11.6k|      if (string.length() == max_words * 4)
  ------------------
  |  Branch (595:11): [True: 19, False: 11.5k]
  ------------------
  596|     19|        return exhaustedInputDiagnostic(inst_offset, opcode, type);
  597|       |
  598|       |      // Make sure we can record the word count without overflow.
  599|       |      //
  600|       |      // This error can't currently be triggered because of validity
  601|       |      // checks elsewhere.
  602|  11.5k|      const size_t string_num_words = string.length() / 4 + 1;
  603|  11.5k|      if (string_num_words > std::numeric_limits<uint16_t>::max()) {
  ------------------
  |  Branch (603:11): [True: 5, False: 11.5k]
  ------------------
  604|      5|        return diagnostic() << "Literal string is longer than "
  605|      5|                            << std::numeric_limits<uint16_t>::max()
  606|      5|                            << " words: " << string_num_words << " words long";
  607|      5|      }
  608|  11.5k|      parsed_operand.num_words = uint16_t(string_num_words);
  609|  11.5k|      parsed_operand.type = SPV_OPERAND_TYPE_LITERAL_STRING;
  610|       |
  611|  11.5k|      if (spv::Op::OpExtInstImport == opcode) {
  ------------------
  |  Branch (611:11): [True: 5.62k, False: 5.97k]
  ------------------
  612|       |        // Record the extended instruction type for the ID for this import.
  613|       |        // There is only one string literal argument to OpExtInstImport,
  614|       |        // so it's sufficient to guard this just on the opcode.
  615|  5.62k|        const spv_ext_inst_type_t ext_inst_type =
  616|  5.62k|            spvExtInstImportTypeGet(string.c_str());
  617|  5.62k|        if (SPV_EXT_INST_TYPE_NONE == ext_inst_type) {
  ------------------
  |  Branch (617:13): [True: 667, False: 4.95k]
  ------------------
  618|    667|          return diagnostic()
  619|    667|                 << "Invalid extended instruction import '" << string << "'";
  620|    667|        }
  621|       |        // We must have parsed a valid result ID.  It's a condition
  622|       |        // of the grammar, and we only accept non-zero result Ids.
  623|  4.95k|        assert(inst->result_id);
  624|      0|        _.import_id_to_ext_inst_type[inst->result_id] = ext_inst_type;
  625|  4.95k|      }
  626|  11.5k|    } break;
  627|       |
  628|  10.9k|    case SPV_OPERAND_TYPE_CAPABILITY:
  ------------------
  |  Branch (628:5): [True: 343, False: 834k]
  ------------------
  629|  1.52k|    case SPV_OPERAND_TYPE_SOURCE_LANGUAGE:
  ------------------
  |  Branch (629:5): [True: 1.18k, False: 833k]
  ------------------
  630|  1.95k|    case SPV_OPERAND_TYPE_EXECUTION_MODEL:
  ------------------
  |  Branch (630:5): [True: 422, False: 834k]
  ------------------
  631|  2.57k|    case SPV_OPERAND_TYPE_ADDRESSING_MODEL:
  ------------------
  |  Branch (631:5): [True: 624, False: 834k]
  ------------------
  632|  3.17k|    case SPV_OPERAND_TYPE_MEMORY_MODEL:
  ------------------
  |  Branch (632:5): [True: 603, False: 834k]
  ------------------
  633|  3.76k|    case SPV_OPERAND_TYPE_EXECUTION_MODE:
  ------------------
  |  Branch (633:5): [True: 583, False: 834k]
  ------------------
  634|  4.50k|    case SPV_OPERAND_TYPE_STORAGE_CLASS:
  ------------------
  |  Branch (634:5): [True: 747, False: 834k]
  ------------------
  635|  4.74k|    case SPV_OPERAND_TYPE_DIMENSIONALITY:
  ------------------
  |  Branch (635:5): [True: 240, False: 834k]
  ------------------
  636|  4.78k|    case SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE:
  ------------------
  |  Branch (636:5): [True: 41, False: 834k]
  ------------------
  637|  4.82k|    case SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE:
  ------------------
  |  Branch (637:5): [True: 34, False: 834k]
  ------------------
  638|  5.05k|    case SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT:
  ------------------
  |  Branch (638:5): [True: 232, False: 834k]
  ------------------
  639|  5.27k|    case SPV_OPERAND_TYPE_FP_ROUNDING_MODE:
  ------------------
  |  Branch (639:5): [True: 219, False: 834k]
  ------------------
  640|  5.47k|    case SPV_OPERAND_TYPE_LINKAGE_TYPE:
  ------------------
  |  Branch (640:5): [True: 197, False: 834k]
  ------------------
  641|  5.60k|    case SPV_OPERAND_TYPE_ACCESS_QUALIFIER:
  ------------------
  |  Branch (641:5): [True: 137, False: 834k]
  ------------------
  642|  5.61k|    case SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER:
  ------------------
  |  Branch (642:5): [True: 10, False: 834k]
  ------------------
  643|  5.81k|    case SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE:
  ------------------
  |  Branch (643:5): [True: 195, False: 834k]
  ------------------
  644|  42.6k|    case SPV_OPERAND_TYPE_DECORATION:
  ------------------
  |  Branch (644:5): [True: 36.8k, False: 798k]
  ------------------
  645|  43.0k|    case SPV_OPERAND_TYPE_BUILT_IN:
  ------------------
  |  Branch (645:5): [True: 383, False: 834k]
  ------------------
  646|  43.0k|    case SPV_OPERAND_TYPE_GROUP_OPERATION:
  ------------------
  |  Branch (646:5): [True: 22, False: 834k]
  ------------------
  647|  43.0k|    case SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS:
  ------------------
  |  Branch (647:5): [True: 0, False: 834k]
  ------------------
  648|  43.0k|    case SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO:
  ------------------
  |  Branch (648:5): [True: 0, False: 834k]
  ------------------
  649|  43.0k|    case SPV_OPERAND_TYPE_RAY_FLAGS:
  ------------------
  |  Branch (649:5): [True: 0, False: 834k]
  ------------------
  650|  43.0k|    case SPV_OPERAND_TYPE_RAY_QUERY_INTERSECTION:
  ------------------
  |  Branch (650:5): [True: 0, False: 834k]
  ------------------
  651|  43.0k|    case SPV_OPERAND_TYPE_RAY_QUERY_COMMITTED_INTERSECTION_TYPE:
  ------------------
  |  Branch (651:5): [True: 0, False: 834k]
  ------------------
  652|  43.0k|    case SPV_OPERAND_TYPE_RAY_QUERY_CANDIDATE_INTERSECTION_TYPE:
  ------------------
  |  Branch (652:5): [True: 0, False: 834k]
  ------------------
  653|  43.0k|    case SPV_OPERAND_TYPE_DEBUG_BASE_TYPE_ATTRIBUTE_ENCODING:
  ------------------
  |  Branch (653:5): [True: 10, False: 834k]
  ------------------
  654|  43.0k|    case SPV_OPERAND_TYPE_DEBUG_COMPOSITE_TYPE:
  ------------------
  |  Branch (654:5): [True: 18, False: 834k]
  ------------------
  655|  43.1k|    case SPV_OPERAND_TYPE_DEBUG_TYPE_QUALIFIER:
  ------------------
  |  Branch (655:5): [True: 21, False: 834k]
  ------------------
  656|  43.1k|    case SPV_OPERAND_TYPE_DEBUG_OPERATION:
  ------------------
  |  Branch (656:5): [True: 12, False: 834k]
  ------------------
  657|  43.1k|    case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_BASE_TYPE_ATTRIBUTE_ENCODING:
  ------------------
  |  Branch (657:5): [True: 10, False: 834k]
  ------------------
  658|  43.1k|    case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_COMPOSITE_TYPE:
  ------------------
  |  Branch (658:5): [True: 10, False: 834k]
  ------------------
  659|  43.1k|    case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_TYPE_QUALIFIER:
  ------------------
  |  Branch (659:5): [True: 19, False: 834k]
  ------------------
  660|  43.1k|    case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_OPERATION:
  ------------------
  |  Branch (660:5): [True: 10, False: 834k]
  ------------------
  661|  43.1k|    case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_IMPORTED_ENTITY:
  ------------------
  |  Branch (661:5): [True: 10, False: 834k]
  ------------------
  662|  43.3k|    case SPV_OPERAND_TYPE_FPDENORM_MODE:
  ------------------
  |  Branch (662:5): [True: 195, False: 834k]
  ------------------
  663|  43.5k|    case SPV_OPERAND_TYPE_FPOPERATION_MODE:
  ------------------
  |  Branch (663:5): [True: 199, False: 834k]
  ------------------
  664|  43.5k|    case SPV_OPERAND_TYPE_QUANTIZATION_MODES:
  ------------------
  |  Branch (664:5): [True: 0, False: 834k]
  ------------------
  665|  43.5k|    case SPV_OPERAND_TYPE_OVERFLOW_MODES:
  ------------------
  |  Branch (665:5): [True: 0, False: 834k]
  ------------------
  666|  43.5k|    case SPV_OPERAND_TYPE_PACKED_VECTOR_FORMAT:
  ------------------
  |  Branch (666:5): [True: 0, False: 834k]
  ------------------
  667|  43.5k|    case SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT: {
  ------------------
  |  Branch (667:5): [True: 19, False: 834k]
  ------------------
  668|       |      // A single word that is a plain enum value.
  669|       |
  670|       |      // Map an optional operand type to its corresponding concrete type.
  671|  43.5k|      if (type == SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER)
  ------------------
  |  Branch (671:11): [True: 10, False: 43.5k]
  ------------------
  672|     10|        parsed_operand.type = SPV_OPERAND_TYPE_ACCESS_QUALIFIER;
  673|  43.5k|      if (type == SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT)
  ------------------
  |  Branch (673:11): [True: 19, False: 43.5k]
  ------------------
  674|     19|        parsed_operand.type = SPV_OPERAND_TYPE_PACKED_VECTOR_FORMAT;
  675|       |
  676|  43.5k|      spv_operand_desc entry;
  677|  43.5k|      if (grammar_.lookupOperand(type, word, &entry)) {
  ------------------
  |  Branch (677:11): [True: 89, False: 43.4k]
  ------------------
  678|     89|        return diagnostic()
  679|     89|               << "Invalid " << spvOperandTypeStr(parsed_operand.type)
  680|     89|               << " operand: " << word;
  681|     89|      }
  682|       |      // Prepare to accept operands to this operand, if needed.
  683|  43.4k|      spvPushOperandTypes(entry->operandTypes, expected_operands);
  684|  43.4k|    } break;
  685|       |
  686|    355|    case SPV_OPERAND_TYPE_FP_FAST_MATH_MODE:
  ------------------
  |  Branch (686:5): [True: 355, False: 834k]
  ------------------
  687|    553|    case SPV_OPERAND_TYPE_FUNCTION_CONTROL:
  ------------------
  |  Branch (687:5): [True: 198, False: 834k]
  ------------------
  688|    776|    case SPV_OPERAND_TYPE_LOOP_CONTROL:
  ------------------
  |  Branch (688:5): [True: 223, False: 834k]
  ------------------
  689|    786|    case SPV_OPERAND_TYPE_IMAGE:
  ------------------
  |  Branch (689:5): [True: 10, False: 834k]
  ------------------
  690|    986|    case SPV_OPERAND_TYPE_OPTIONAL_IMAGE:
  ------------------
  |  Branch (690:5): [True: 200, False: 834k]
  ------------------
  691|  1.56k|    case SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS:
  ------------------
  |  Branch (691:5): [True: 574, False: 834k]
  ------------------
  692|  1.94k|    case SPV_OPERAND_TYPE_SELECTION_CONTROL:
  ------------------
  |  Branch (692:5): [True: 387, False: 834k]
  ------------------
  693|  1.96k|    case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_INFO_FLAGS:
  ------------------
  |  Branch (693:5): [True: 19, False: 834k]
  ------------------
  694|  1.99k|    case SPV_OPERAND_TYPE_DEBUG_INFO_FLAGS: {
  ------------------
  |  Branch (694:5): [True: 32, False: 834k]
  ------------------
  695|       |      // This operand is a mask.
  696|       |
  697|       |      // Map an optional operand type to its corresponding concrete type.
  698|  1.99k|      if (type == SPV_OPERAND_TYPE_OPTIONAL_IMAGE)
  ------------------
  |  Branch (698:11): [True: 200, False: 1.79k]
  ------------------
  699|    200|        parsed_operand.type = SPV_OPERAND_TYPE_IMAGE;
  700|  1.79k|      else if (type == SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS)
  ------------------
  |  Branch (700:16): [True: 574, False: 1.22k]
  ------------------
  701|    574|        parsed_operand.type = SPV_OPERAND_TYPE_MEMORY_ACCESS;
  702|       |
  703|       |      // Check validity of set mask bits. Also prepare for operands for those
  704|       |      // masks if they have any.  To get operand order correct, scan from
  705|       |      // MSB to LSB since we can only prepend operands to a pattern.
  706|       |      // The only case in the grammar where you have more than one mask bit
  707|       |      // having an operand is for image operands.  See SPIR-V 3.14 Image
  708|       |      // Operands.
  709|  1.99k|      uint32_t remaining_word = word;
  710|  32.2k|      for (uint32_t mask = (1u << 31); remaining_word; mask >>= 1) {
  ------------------
  |  Branch (710:40): [True: 30.3k, False: 1.89k]
  ------------------
  711|  30.3k|        if (remaining_word & mask) {
  ------------------
  |  Branch (711:13): [True: 3.58k, False: 26.7k]
  ------------------
  712|  3.58k|          spv_operand_desc entry;
  713|  3.58k|          if (grammar_.lookupOperand(type, mask, &entry)) {
  ------------------
  |  Branch (713:15): [True: 104, False: 3.48k]
  ------------------
  714|    104|            return diagnostic()
  715|    104|                   << "Invalid " << spvOperandTypeStr(parsed_operand.type)
  716|    104|                   << " operand: " << word << " has invalid mask component "
  717|    104|                   << mask;
  718|    104|          }
  719|  3.48k|          remaining_word ^= mask;
  720|  3.48k|          spvPushOperandTypes(entry->operandTypes, expected_operands);
  721|  3.48k|        }
  722|  30.3k|      }
  723|  1.89k|      if (word == 0) {
  ------------------
  |  Branch (723:11): [True: 883, False: 1.01k]
  ------------------
  724|       |        // An all-zeroes mask *might* also be valid.
  725|    883|        spv_operand_desc entry;
  726|    883|        if (SPV_SUCCESS == grammar_.lookupOperand(type, 0, &entry)) {
  ------------------
  |  Branch (726:13): [True: 883, False: 0]
  ------------------
  727|       |          // Prepare for its operands, if any.
  728|    883|          spvPushOperandTypes(entry->operandTypes, expected_operands);
  729|    883|        }
  730|    883|      }
  731|  1.89k|    } break;
  732|      0|    default:
  ------------------
  |  Branch (732:5): [True: 0, False: 834k]
  ------------------
  733|      0|      return diagnostic() << "Internal error: Unhandled operand type: " << type;
  734|   834k|  }
  735|       |
  736|   833k|  assert(spvOperandIsConcrete(parsed_operand.type));
  737|       |
  738|      0|  operands->push_back(parsed_operand);
  739|       |
  740|   833k|  const size_t index_after_operand = _.word_index + parsed_operand.num_words;
  741|       |
  742|       |  // Avoid buffer overrun for the cases where the operand has more than one
  743|       |  // word, and where it isn't a string.  (Those other cases have already been
  744|       |  // handled earlier.)  For example, this error can occur for a multi-word
  745|       |  // argument to OpConstant, or a multi-word case literal operand for OpSwitch.
  746|   833k|  if (_.num_words < index_after_operand)
  ------------------
  |  Branch (746:7): [True: 24, False: 833k]
  ------------------
  747|     24|    return exhaustedInputDiagnostic(inst_offset, opcode, type);
  748|       |
  749|   833k|  if (_.requires_endian_conversion) {
  ------------------
  |  Branch (749:7): [True: 520k, False: 313k]
  ------------------
  750|       |    // Copy instruction words.  Translate to native endianness as needed.
  751|   520k|    if (convert_operand_endianness) {
  ------------------
  |  Branch (751:9): [True: 520k, False: 0]
  ------------------
  752|   520k|      const spv_endianness_t endianness = _.endian;
  753|   520k|      std::transform(_.words + _.word_index, _.words + index_after_operand,
  754|   520k|                     std::back_inserter(*words),
  755|   520k|                     [endianness](const uint32_t raw_word) {
  756|   520k|                       return spvFixWord(raw_word, endianness);
  757|   520k|                     });
  758|   520k|    } else {
  759|      0|      words->insert(words->end(), _.words + _.word_index,
  760|      0|                    _.words + index_after_operand);
  761|      0|    }
  762|   520k|  }
  763|       |
  764|       |  // Advance past the operand.
  765|   833k|  _.word_index = index_after_operand;
  766|       |
  767|   833k|  return SPV_SUCCESS;
  768|   833k|}
binary.cpp:_ZN12_GLOBAL__N_16Parser24exhaustedInputDiagnosticEmN3spv2OpE18spv_operand_type_t:
  160|    639|                                        spv_operand_type_t type) {
  161|    639|    return diagnostic() << "End of input reached while decoding Op"
  162|    639|                        << spvOpcodeString(opcode) << " starting at word "
  163|    639|                        << inst_offset
  164|    639|                        << ((_.word_index < _.num_words) ? ": truncated "
  ------------------
  |  Branch (164:29): [True: 43, False: 596]
  ------------------
  165|    639|                                                         : ": missing ")
  166|    639|                        << spvOperandTypeStr(type) << " operand at word offset "
  167|    639|                        << _.word_index - inst_offset << ".";
  168|    639|  }
binary.cpp:_ZN12_GLOBAL__N_16Parser25setNumericTypeInfoForTypeEP20spv_parsed_operand_tj:
  771|   153k|    spv_parsed_operand_t* parsed_operand, uint32_t type_id) {
  772|   153k|  assert(type_id != 0);
  773|      0|  auto type_info_iter = _.type_id_to_number_type_info.find(type_id);
  774|   153k|  if (type_info_iter == _.type_id_to_number_type_info.end()) {
  ------------------
  |  Branch (774:7): [True: 252, False: 153k]
  ------------------
  775|    252|    return diagnostic() << "Type Id " << type_id << " is not a type";
  776|    252|  }
  777|   153k|  const NumberType& info = type_info_iter->second;
  778|   153k|  if (info.type == SPV_NUMBER_NONE) {
  ------------------
  |  Branch (778:7): [True: 2, False: 153k]
  ------------------
  779|       |    // This is a valid type, but for something other than a scalar number.
  780|      2|    return diagnostic() << "Type Id " << type_id
  781|      2|                        << " is not a scalar numeric type";
  782|      2|  }
  783|       |
  784|   153k|  parsed_operand->number_kind = info.type;
  785|   153k|  parsed_operand->number_bit_width = info.bit_width;
  786|       |  // Round up the word count.
  787|   153k|  parsed_operand->num_words = static_cast<uint16_t>((info.bit_width + 31) / 32);
  788|   153k|  return SPV_SUCCESS;
  789|   153k|}
binary.cpp:_ZZN12_GLOBAL__N_16Parser12parseOperandEmP24spv_parsed_instruction_t18spv_operand_type_tPNSt3__16vectorIjNS4_9allocatorIjEEEEPNS5_I20spv_parsed_operand_tNS6_ISA_EEEEPNS5_IS3_NS6_IS3_EEEEENK3$_0clEj:
  755|  2.30M|                     [endianness](const uint32_t raw_word) {
  756|  2.30M|                       return spvFixWord(raw_word, endianness);
  757|  2.30M|                     });
binary.cpp:_ZN12_GLOBAL__N_16Parser16recordNumberTypeEmPK24spv_parsed_instruction_t:
  792|  70.0k|                              const spv_parsed_instruction_t* inst) {
  793|  70.0k|  const spv::Op opcode = static_cast<spv::Op>(inst->opcode);
  794|  70.0k|  if (spvOpcodeGeneratesType(opcode)) {
  ------------------
  |  Branch (794:7): [True: 9.09k, False: 61.0k]
  ------------------
  795|  9.09k|    NumberType info = {SPV_NUMBER_NONE, 0};
  796|  9.09k|    if (spv::Op::OpTypeInt == opcode) {
  ------------------
  |  Branch (796:9): [True: 387, False: 8.70k]
  ------------------
  797|    387|      const bool is_signed = peekAt(inst_offset + 3) != 0;
  798|    387|      info.type = is_signed ? SPV_NUMBER_SIGNED_INT : SPV_NUMBER_UNSIGNED_INT;
  ------------------
  |  Branch (798:19): [True: 318, False: 69]
  ------------------
  799|    387|      info.bit_width = peekAt(inst_offset + 2);
  800|  8.70k|    } else if (spv::Op::OpTypeFloat == opcode) {
  ------------------
  |  Branch (800:16): [True: 262, False: 8.44k]
  ------------------
  801|    262|      info.type = SPV_NUMBER_FLOATING;
  802|    262|      info.bit_width = peekAt(inst_offset + 2);
  803|    262|    }
  804|       |    // The *result* Id of a type generating instruction is the type Id.
  805|  9.09k|    _.type_id_to_number_type_info[inst->result_id] = info;
  806|  9.09k|  }
  807|  70.0k|}

_ZN8spvtools16DiagnosticStreamD2Ev:
   87|  2.79k|DiagnosticStream::~DiagnosticStream() {
   88|  2.79k|  if (error_ != SPV_FAILED_MATCH && consumer_ != nullptr) {
  ------------------
  |  Branch (88:7): [True: 2.79k, False: 0]
  |  Branch (88:37): [True: 0, False: 2.79k]
  ------------------
   89|      0|    auto level = SPV_MSG_ERROR;
   90|      0|    switch (error_) {
   91|      0|      case SPV_SUCCESS:
  ------------------
  |  Branch (91:7): [True: 0, False: 0]
  ------------------
   92|      0|      case SPV_REQUESTED_TERMINATION:  // Essentially success.
  ------------------
  |  Branch (92:7): [True: 0, False: 0]
  ------------------
   93|      0|        level = SPV_MSG_INFO;
   94|      0|        break;
   95|      0|      case SPV_WARNING:
  ------------------
  |  Branch (95:7): [True: 0, False: 0]
  ------------------
   96|      0|        level = SPV_MSG_WARNING;
   97|      0|        break;
   98|      0|      case SPV_UNSUPPORTED:
  ------------------
  |  Branch (98:7): [True: 0, False: 0]
  ------------------
   99|      0|      case SPV_ERROR_INTERNAL:
  ------------------
  |  Branch (99:7): [True: 0, False: 0]
  ------------------
  100|      0|      case SPV_ERROR_INVALID_TABLE:
  ------------------
  |  Branch (100:7): [True: 0, False: 0]
  ------------------
  101|      0|        level = SPV_MSG_INTERNAL_ERROR;
  102|      0|        break;
  103|      0|      case SPV_ERROR_OUT_OF_MEMORY:
  ------------------
  |  Branch (103:7): [True: 0, False: 0]
  ------------------
  104|      0|        level = SPV_MSG_FATAL;
  105|      0|        break;
  106|      0|      default:
  ------------------
  |  Branch (106:7): [True: 0, False: 0]
  ------------------
  107|      0|        break;
  108|      0|    }
  109|      0|    if (disassembled_instruction_.size() > 0)
  ------------------
  |  Branch (109:9): [True: 0, False: 0]
  ------------------
  110|      0|      stream_ << std::endl << "  " << disassembled_instruction_ << std::endl;
  111|       |
  112|      0|    consumer_(level, "input", position_, stream_.str().c_str());
  113|      0|  }
  114|  2.79k|}

_ZN8spvtools16DiagnosticStreamlsIA16_cEERS0_RKT_:
   51|    105|  DiagnosticStream& operator<<(const T& val) {
   52|    105|    stream_ << val;
   53|    105|    return *this;
   54|    105|  }
_ZN8spvtools16DiagnosticStreamcv12spv_result_tEv:
   57|  2.79k|  operator spv_result_t() { return error_; }
_ZN8spvtools16DiagnosticStreamlsIA36_cEERS0_RKT_:
   51|     12|  DiagnosticStream& operator<<(const T& val) {
   52|     12|    stream_ << val;
   53|     12|    return *this;
   54|     12|  }
_ZN8spvtools16DiagnosticStreamlsImEERS0_RKT_:
   51|  1.76k|  DiagnosticStream& operator<<(const T& val) {
   52|  1.76k|    stream_ << val;
   53|  1.76k|    return *this;
   54|  1.76k|  }
_ZN8spvtools16DiagnosticStreamlsIA19_cEERS0_RKT_:
   51|  1.12k|  DiagnosticStream& operator<<(const T& val) {
   52|  1.12k|    stream_ << val;
   53|  1.12k|    return *this;
   54|  1.12k|  }
_ZN8spvtools16DiagnosticStreamlsIjEERS0_RKT_:
   51|  1.03k|  DiagnosticStream& operator<<(const T& val) {
   52|  1.03k|    stream_ << val;
   53|  1.03k|    return *this;
   54|  1.03k|  }
_ZN8spvtools16DiagnosticStreamlsIA30_cEERS0_RKT_:
   51|     85|  DiagnosticStream& operator<<(const T& val) {
   52|     85|    stream_ << val;
   53|     85|    return *this;
   54|     85|  }
_ZN8spvtools16DiagnosticStreamlsIFRNSt3__18ios_baseES4_EEERS0_RKT_:
   51|     83|  DiagnosticStream& operator<<(const T& val) {
   52|     83|    stream_ << val;
   53|     83|    return *this;
   54|     83|  }
_ZN8spvtools16DiagnosticStreamlsIA3_cEERS0_RKT_:
   51|    138|  DiagnosticStream& operator<<(const T& val) {
   52|    138|    stream_ << val;
   53|    138|    return *this;
   54|    138|  }
_ZN8spvtools16DiagnosticStreamC2E14spv_position_tRKNSt3__18functionIFv19spv_message_level_tPKcRKS1_S6_EEERKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE12spv_result_t:
   37|  2.79k|        error_(error) {}
_ZN8spvtools16DiagnosticStreamlsIA47_cEERS0_RKT_:
   51|     59|  DiagnosticStream& operator<<(const T& val) {
   52|     59|    stream_ << val;
   53|     59|    return *this;
   54|     59|  }
_ZN8spvtools16DiagnosticStreamlsIA33_cEERS0_RKT_:
   51|     33|  DiagnosticStream& operator<<(const T& val) {
   52|     33|    stream_ << val;
   53|     33|    return *this;
   54|     33|  }
_ZN8spvtools16DiagnosticStreamlsItEERS0_RKT_:
   51|    712|  DiagnosticStream& operator<<(const T& val) {
   52|    712|    stream_ << val;
   53|    712|    return *this;
   54|    712|  }
_ZN8spvtools16DiagnosticStreamlsIA17_cEERS0_RKT_:
   51|     70|  DiagnosticStream& operator<<(const T& val) {
   52|     70|    stream_ << val;
   53|     70|    return *this;
   54|     70|  }
_ZN8spvtools16DiagnosticStreamlsIA23_cEERS0_RKT_:
   51|    335|  DiagnosticStream& operator<<(const T& val) {
   52|    335|    stream_ << val;
   53|    335|    return *this;
   54|    335|  }
_ZN8spvtools16DiagnosticStreamlsIPKcEERS0_RKT_:
   51|  2.53k|  DiagnosticStream& operator<<(const T& val) {
   52|  2.53k|    stream_ << val;
   53|  2.53k|    return *this;
   54|  2.53k|  }
_ZN8spvtools16DiagnosticStreamlsIA35_cEERS0_RKT_:
   51|    233|  DiagnosticStream& operator<<(const T& val) {
   52|    233|    stream_ << val;
   53|    233|    return *this;
   54|    233|  }
_ZN8spvtools16DiagnosticStreamlsIA34_cEERS0_RKT_:
   51|    233|  DiagnosticStream& operator<<(const T& val) {
   52|    233|    stream_ << val;
   53|    233|    return *this;
   54|    233|  }
_ZN8spvtools16DiagnosticStreamlsIA2_cEERS0_RKT_:
   51|  1.53k|  DiagnosticStream& operator<<(const T& val) {
   52|  1.53k|    stream_ << val;
   53|  1.53k|    return *this;
   54|  1.53k|  }
_ZN8spvtools16DiagnosticStreamlsIA20_cEERS0_RKT_:
   51|      1|  DiagnosticStream& operator<<(const T& val) {
   52|      1|    stream_ << val;
   53|      1|    return *this;
   54|      1|  }
_ZN8spvtools16DiagnosticStreamlsIA22_cEERS0_RKT_:
   51|      4|  DiagnosticStream& operator<<(const T& val) {
   52|      4|    stream_ << val;
   53|      4|    return *this;
   54|      4|  }
_ZN8spvtools16DiagnosticStreamlsIA4_cEERS0_RKT_:
   51|      2|  DiagnosticStream& operator<<(const T& val) {
   52|      2|    stream_ << val;
   53|      2|    return *this;
   54|      2|  }
_ZN8spvtools16DiagnosticStreamlsIA27_cEERS0_RKT_:
   51|      2|  DiagnosticStream& operator<<(const T& val) {
   52|      2|    stream_ << val;
   53|      2|    return *this;
   54|      2|  }
_ZN8spvtools16DiagnosticStreamlsIA18_cEERS0_RKT_:
   51|    144|  DiagnosticStream& operator<<(const T& val) {
   52|    144|    stream_ << val;
   53|    144|    return *this;
   54|    144|  }
_ZN8spvtools16DiagnosticStreamlsIA49_cEERS0_RKT_:
   51|    144|  DiagnosticStream& operator<<(const T& val) {
   52|    144|    stream_ << val;
   53|    144|    return *this;
   54|    144|  }
_ZN8spvtools16DiagnosticStreamlsIA6_cEERS0_RKT_:
   51|      2|  DiagnosticStream& operator<<(const T& val) {
   52|      2|    stream_ << val;
   53|      2|    return *this;
   54|      2|  }
_ZN8spvtools16DiagnosticStreamlsIA38_cEERS0_RKT_:
   51|    699|  DiagnosticStream& operator<<(const T& val) {
   52|    699|    stream_ << val;
   53|    699|    return *this;
   54|    699|  }
_ZN8spvtools16DiagnosticStreamlsIA9_cEERS0_RKT_:
   51|    507|  DiagnosticStream& operator<<(const T& val) {
   52|    507|    stream_ << val;
   53|    507|    return *this;
   54|    507|  }
_ZN8spvtools16DiagnosticStreamlsIA31_cEERS0_RKT_:
   51|    162|  DiagnosticStream& operator<<(const T& val) {
   52|    162|    stream_ << val;
   53|    162|    return *this;
   54|    162|  }
_ZN8spvtools16DiagnosticStreamlsIA13_cEERS0_RKT_:
   51|    119|  DiagnosticStream& operator<<(const T& val) {
   52|    119|    stream_ << val;
   53|    119|    return *this;
   54|    119|  }
_ZN8spvtools16DiagnosticStreamlsIA24_cEERS0_RKT_:
   51|     37|  DiagnosticStream& operator<<(const T& val) {
   52|     37|    stream_ << val;
   53|     37|    return *this;
   54|     37|  }
_ZN8spvtools16DiagnosticStreamlsIA15_cEERS0_RKT_:
   51|    252|  DiagnosticStream& operator<<(const T& val) {
   52|    252|    stream_ << val;
   53|    252|    return *this;
   54|    252|  }
_ZN8spvtools16DiagnosticStreamlsIA25_cEERS0_RKT_:
   51|    640|  DiagnosticStream& operator<<(const T& val) {
   52|    640|    stream_ << val;
   53|    640|    return *this;
   54|    640|  }
_ZN8spvtools16DiagnosticStreamlsIA12_cEERS0_RKT_:
   51|      5|  DiagnosticStream& operator<<(const T& val) {
   52|      5|    stream_ << val;
   53|      5|    return *this;
   54|      5|  }
_ZN8spvtools16DiagnosticStreamlsINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEERS0_RKT_:
   51|    667|  DiagnosticStream& operator<<(const T& val) {
   52|    667|    stream_ << val;
   53|    667|    return *this;
   54|    667|  }
_ZN8spvtools16DiagnosticStreamlsIA11_cEERS0_RKT_:
   51|    193|  DiagnosticStream& operator<<(const T& val) {
   52|    193|    stream_ << val;
   53|    193|    return *this;
   54|    193|  }
_ZN8spvtools16DiagnosticStreamlsIA29_cEERS0_RKT_:
   51|    104|  DiagnosticStream& operator<<(const T& val) {
   52|    104|    stream_ << val;
   53|    104|    return *this;
   54|    104|  }
_ZN8spvtools16DiagnosticStreamlsIA39_cEERS0_RKT_:
   51|    675|  DiagnosticStream& operator<<(const T& val) {
   52|    675|    stream_ << val;
   53|    675|    return *this;
   54|    675|  }
_ZN8spvtools16DiagnosticStreamlsIA32_cEERS0_RKT_:
   51|     36|  DiagnosticStream& operator<<(const T& val) {
   52|     36|    stream_ << val;
   53|     36|    return *this;
   54|     36|  }
_ZN8spvtools16DiagnosticStreamlsIA8_cEERS0_RKT_:
   51|     48|  DiagnosticStream& operator<<(const T& val) {
   52|     48|    stream_ << val;
   53|     48|    return *this;
   54|     48|  }
_ZN8spvtools16DiagnosticStreamlsIA14_cEERS0_RKT_:
   51|    102|  DiagnosticStream& operator<<(const T& val) {
   52|    102|    stream_ << val;
   53|    102|    return *this;
   54|    102|  }

_Z18spvExtInstTableGetPPK20spv_ext_inst_table_t14spv_target_env:
   71|  3.92k|                                spv_target_env env) {
   72|  3.92k|  if (!pExtInstTable) return SPV_ERROR_INVALID_POINTER;
  ------------------
  |  Branch (72:7): [True: 0, False: 3.92k]
  ------------------
   73|       |
   74|  3.92k|  switch (env) {
   75|       |    // The extended instruction sets are all version 1.0 so far.
   76|      0|    case SPV_ENV_UNIVERSAL_1_0:
  ------------------
  |  Branch (76:5): [True: 0, False: 3.92k]
  ------------------
   77|      0|    case SPV_ENV_VULKAN_1_0:
  ------------------
  |  Branch (77:5): [True: 0, False: 3.92k]
  ------------------
   78|      0|    case SPV_ENV_UNIVERSAL_1_1:
  ------------------
  |  Branch (78:5): [True: 0, False: 3.92k]
  ------------------
   79|      0|    case SPV_ENV_UNIVERSAL_1_2:
  ------------------
  |  Branch (79:5): [True: 0, False: 3.92k]
  ------------------
   80|      0|    case SPV_ENV_OPENCL_1_2:
  ------------------
  |  Branch (80:5): [True: 0, False: 3.92k]
  ------------------
   81|      0|    case SPV_ENV_OPENCL_EMBEDDED_1_2:
  ------------------
  |  Branch (81:5): [True: 0, False: 3.92k]
  ------------------
   82|      0|    case SPV_ENV_OPENCL_2_0:
  ------------------
  |  Branch (82:5): [True: 0, False: 3.92k]
  ------------------
   83|      0|    case SPV_ENV_OPENCL_EMBEDDED_2_0:
  ------------------
  |  Branch (83:5): [True: 0, False: 3.92k]
  ------------------
   84|      0|    case SPV_ENV_OPENCL_2_1:
  ------------------
  |  Branch (84:5): [True: 0, False: 3.92k]
  ------------------
   85|      0|    case SPV_ENV_OPENCL_EMBEDDED_2_1:
  ------------------
  |  Branch (85:5): [True: 0, False: 3.92k]
  ------------------
   86|      0|    case SPV_ENV_OPENCL_2_2:
  ------------------
  |  Branch (86:5): [True: 0, False: 3.92k]
  ------------------
   87|      0|    case SPV_ENV_OPENCL_EMBEDDED_2_2:
  ------------------
  |  Branch (87:5): [True: 0, False: 3.92k]
  ------------------
   88|      0|    case SPV_ENV_OPENGL_4_0:
  ------------------
  |  Branch (88:5): [True: 0, False: 3.92k]
  ------------------
   89|  3.92k|    case SPV_ENV_OPENGL_4_1:
  ------------------
  |  Branch (89:5): [True: 3.92k, False: 0]
  ------------------
   90|  3.92k|    case SPV_ENV_OPENGL_4_2:
  ------------------
  |  Branch (90:5): [True: 0, False: 3.92k]
  ------------------
   91|  3.92k|    case SPV_ENV_OPENGL_4_3:
  ------------------
  |  Branch (91:5): [True: 0, False: 3.92k]
  ------------------
   92|  3.92k|    case SPV_ENV_OPENGL_4_5:
  ------------------
  |  Branch (92:5): [True: 0, False: 3.92k]
  ------------------
   93|  3.92k|    case SPV_ENV_UNIVERSAL_1_3:
  ------------------
  |  Branch (93:5): [True: 0, False: 3.92k]
  ------------------
   94|  3.92k|    case SPV_ENV_VULKAN_1_1:
  ------------------
  |  Branch (94:5): [True: 0, False: 3.92k]
  ------------------
   95|  3.92k|    case SPV_ENV_VULKAN_1_1_SPIRV_1_4:
  ------------------
  |  Branch (95:5): [True: 0, False: 3.92k]
  ------------------
   96|  3.92k|    case SPV_ENV_UNIVERSAL_1_4:
  ------------------
  |  Branch (96:5): [True: 0, False: 3.92k]
  ------------------
   97|  3.92k|    case SPV_ENV_UNIVERSAL_1_5:
  ------------------
  |  Branch (97:5): [True: 0, False: 3.92k]
  ------------------
   98|  3.92k|    case SPV_ENV_VULKAN_1_2:
  ------------------
  |  Branch (98:5): [True: 0, False: 3.92k]
  ------------------
   99|  3.92k|    case SPV_ENV_UNIVERSAL_1_6:
  ------------------
  |  Branch (99:5): [True: 0, False: 3.92k]
  ------------------
  100|  3.92k|    case SPV_ENV_VULKAN_1_3:
  ------------------
  |  Branch (100:5): [True: 0, False: 3.92k]
  ------------------
  101|  3.92k|      *pExtInstTable = &kTable_1_0;
  102|  3.92k|      return SPV_SUCCESS;
  103|      0|    default:
  ------------------
  |  Branch (103:5): [True: 0, False: 3.92k]
  ------------------
  104|      0|      return SPV_ERROR_INVALID_TABLE;
  105|  3.92k|  }
  106|  3.92k|}
_Z23spvExtInstImportTypeGetPKc:
  108|  5.62k|spv_ext_inst_type_t spvExtInstImportTypeGet(const char* name) {
  109|       |  // The names are specified by the respective extension instruction
  110|       |  // specifications.
  111|  5.62k|  if (!strcmp("GLSL.std.450", name)) {
  ------------------
  |  Branch (111:7): [True: 98, False: 5.52k]
  ------------------
  112|     98|    return SPV_EXT_INST_TYPE_GLSL_STD_450;
  113|     98|  }
  114|  5.52k|  if (!strcmp("OpenCL.std", name)) {
  ------------------
  |  Branch (114:7): [True: 148, False: 5.37k]
  ------------------
  115|    148|    return SPV_EXT_INST_TYPE_OPENCL_STD;
  116|    148|  }
  117|  5.37k|  if (!strcmp("SPV_AMD_shader_explicit_vertex_parameter", name)) {
  ------------------
  |  Branch (117:7): [True: 18, False: 5.35k]
  ------------------
  118|     18|    return SPV_EXT_INST_TYPE_SPV_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER;
  119|     18|  }
  120|  5.35k|  if (!strcmp("SPV_AMD_shader_trinary_minmax", name)) {
  ------------------
  |  Branch (120:7): [True: 20, False: 5.33k]
  ------------------
  121|     20|    return SPV_EXT_INST_TYPE_SPV_AMD_SHADER_TRINARY_MINMAX;
  122|     20|  }
  123|  5.33k|  if (!strcmp("SPV_AMD_gcn_shader", name)) {
  ------------------
  |  Branch (123:7): [True: 35, False: 5.30k]
  ------------------
  124|     35|    return SPV_EXT_INST_TYPE_SPV_AMD_GCN_SHADER;
  125|     35|  }
  126|  5.30k|  if (!strcmp("SPV_AMD_shader_ballot", name)) {
  ------------------
  |  Branch (126:7): [True: 20, False: 5.28k]
  ------------------
  127|     20|    return SPV_EXT_INST_TYPE_SPV_AMD_SHADER_BALLOT;
  128|     20|  }
  129|  5.28k|  if (!strcmp("DebugInfo", name)) {
  ------------------
  |  Branch (129:7): [True: 4.34k, False: 937]
  ------------------
  130|  4.34k|    return SPV_EXT_INST_TYPE_DEBUGINFO;
  131|  4.34k|  }
  132|    937|  if (!strcmp("OpenCL.DebugInfo.100", name)) {
  ------------------
  |  Branch (132:7): [True: 69, False: 868]
  ------------------
  133|     69|    return SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100;
  134|     69|  }
  135|    868|  if (!strcmp("NonSemantic.Shader.DebugInfo.100", name)) {
  ------------------
  |  Branch (135:7): [True: 15, False: 853]
  ------------------
  136|     15|    return SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100;
  137|     15|  }
  138|    853|  if (!strncmp("NonSemantic.ClspvReflection.", name, 28)) {
  ------------------
  |  Branch (138:7): [True: 18, False: 835]
  ------------------
  139|     18|    return SPV_EXT_INST_TYPE_NONSEMANTIC_CLSPVREFLECTION;
  140|     18|  }
  141|       |  // ensure to add any known non-semantic extended instruction sets
  142|       |  // above this point, and update spvExtInstIsNonSemantic()
  143|    835|  if (!strncmp("NonSemantic.", name, 12)) {
  ------------------
  |  Branch (143:7): [True: 168, False: 667]
  ------------------
  144|    168|    return SPV_EXT_INST_TYPE_NONSEMANTIC_UNKNOWN;
  145|    168|  }
  146|    667|  return SPV_EXT_INST_TYPE_NONE;
  147|    835|}
_Z23spvExtInstIsNonSemantic19spv_ext_inst_type_t:
  149|    420|bool spvExtInstIsNonSemantic(const spv_ext_inst_type_t type) {
  150|    420|  if (type == SPV_EXT_INST_TYPE_NONSEMANTIC_UNKNOWN ||
  ------------------
  |  Branch (150:7): [True: 329, False: 91]
  ------------------
  151|    420|      type == SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100 ||
  ------------------
  |  Branch (151:7): [True: 18, False: 73]
  ------------------
  152|    420|      type == SPV_EXT_INST_TYPE_NONSEMANTIC_CLSPVREFLECTION) {
  ------------------
  |  Branch (152:7): [True: 41, False: 32]
  ------------------
  153|    388|    return true;
  154|    388|  }
  155|     32|  return false;
  156|    420|}
_Z26spvExtInstTableValueLookupPK20spv_ext_inst_table_t19spv_ext_inst_type_tjPPK19spv_ext_inst_desc_t:
  192|  1.20k|                                        spv_ext_inst_desc* pEntry) {
  193|  1.20k|  if (!table) return SPV_ERROR_INVALID_TABLE;
  ------------------
  |  Branch (193:7): [True: 0, False: 1.20k]
  ------------------
  194|  1.20k|  if (!pEntry) return SPV_ERROR_INVALID_POINTER;
  ------------------
  |  Branch (194:7): [True: 0, False: 1.20k]
  ------------------
  195|       |
  196|  6.97k|  for (uint32_t groupIndex = 0; groupIndex < table->count; groupIndex++) {
  ------------------
  |  Branch (196:33): [True: 6.55k, False: 420]
  ------------------
  197|  6.55k|    const auto& group = table->groups[groupIndex];
  198|  6.55k|    if (type != group.type) continue;
  ------------------
  |  Branch (198:9): [True: 5.68k, False: 874]
  ------------------
  199|  20.2k|    for (uint32_t index = 0; index < group.count; index++) {
  ------------------
  |  Branch (199:30): [True: 20.1k, False: 91]
  ------------------
  200|  20.1k|      const auto& entry = group.entries[index];
  201|  20.1k|      if (value == entry.ext_inst) {
  ------------------
  |  Branch (201:11): [True: 783, False: 19.3k]
  ------------------
  202|    783|        *pEntry = &entry;
  203|    783|        return SPV_SUCCESS;
  204|    783|      }
  205|  20.1k|    }
  206|    874|  }
  207|       |
  208|    420|  return SPV_ERROR_INVALID_LOOKUP;
  209|  1.20k|}

_Z14spvOpcodeSplitjPtS_:
   72|  72.7k|                    uint16_t* pOpcode) {
   73|  72.7k|  if (pWordCount) {
  ------------------
  |  Branch (73:7): [True: 72.7k, False: 0]
  ------------------
   74|  72.7k|    *pWordCount = (uint16_t)((0xffff0000 & word) >> 16);
   75|  72.7k|  }
   76|  72.7k|  if (pOpcode) {
  ------------------
  |  Branch (76:7): [True: 72.7k, False: 0]
  ------------------
   77|  72.7k|    *pOpcode = 0x0000ffff & word;
   78|  72.7k|  }
   79|  72.7k|}
_Z17spvOpcodeTableGetPPK18spv_opcode_table_t14spv_target_env:
   81|  3.92k|spv_result_t spvOpcodeTableGet(spv_opcode_table* pInstTable, spv_target_env) {
   82|  3.92k|  if (!pInstTable) return SPV_ERROR_INVALID_POINTER;
  ------------------
  |  Branch (82:7): [True: 0, False: 3.92k]
  ------------------
   83|       |
   84|       |  // Descriptions of each opcode.  Each entry describes the format of the
   85|       |  // instruction that follows a particular opcode.
   86|       |
   87|  3.92k|  *pInstTable = &kOpcodeTable;
   88|  3.92k|  return SPV_SUCCESS;
   89|  3.92k|}
_Z25spvOpcodeTableValueLookup14spv_target_envPK18spv_opcode_table_tN3spv2OpEPPK17spv_opcode_desc_t:
  129|  72.7k|                                       spv_opcode_desc* pEntry) {
  130|  72.7k|  if (!table) return SPV_ERROR_INVALID_TABLE;
  ------------------
  |  Branch (130:7): [True: 0, False: 72.7k]
  ------------------
  131|  72.7k|  if (!pEntry) return SPV_ERROR_INVALID_POINTER;
  ------------------
  |  Branch (131:7): [True: 0, False: 72.7k]
  ------------------
  132|       |
  133|  72.7k|  const auto beg = table->entries;
  134|  72.7k|  const auto end = table->entries + table->count;
  135|       |
  136|  72.7k|  spv_opcode_desc_t needle = {"",    opcode, 0, nullptr, 0,   {},
  137|  72.7k|                              false, false,  0, nullptr, ~0u, ~0u};
  138|       |
  139|  72.7k|  auto comp = [](const spv_opcode_desc_t& lhs, const spv_opcode_desc_t& rhs) {
  140|  72.7k|    return lhs.opcode < rhs.opcode;
  141|  72.7k|  };
  142|       |
  143|       |  // We need to loop here because there can exist multiple symbols for the same
  144|       |  // opcode value, and they can be introduced in different target environments,
  145|       |  // which means they can have different minimal version requirements.
  146|       |  // Assumes the underlying table is already sorted ascendingly according to
  147|       |  // opcode value.
  148|  72.7k|  const auto version = spvVersionForTargetEnv(env);
  149|  72.7k|  for (auto it = std::lower_bound(beg, end, needle, comp);
  150|  72.7k|       it != end && it->opcode == opcode; ++it) {
  ------------------
  |  Branch (150:8): [True: 72.7k, False: 39]
  |  Branch (150:21): [True: 72.6k, False: 31]
  ------------------
  151|       |    // We considers the current opcode as available as long as
  152|       |    // 1. The target environment satisfies the minimal requirement of the
  153|       |    //    opcode; or
  154|       |    // 2. There is at least one extension enabling this opcode.
  155|       |    //
  156|       |    // Note that the second rule assumes the extension enabling this instruction
  157|       |    // is indeed requested in the SPIR-V code; checking that should be
  158|       |    // validator's work.
  159|  72.6k|    if ((version >= it->minVersion && version <= it->lastVersion) ||
  ------------------
  |  Branch (159:10): [True: 70.9k, False: 1.72k]
  |  Branch (159:39): [True: 70.9k, False: 0]
  ------------------
  160|  72.6k|        it->numExtensions > 0u || it->numCapabilities > 0u) {
  ------------------
  |  Branch (160:9): [True: 764, False: 960]
  |  Branch (160:35): [True: 957, False: 3]
  ------------------
  161|  72.6k|      *pEntry = it;
  162|  72.6k|      return SPV_SUCCESS;
  163|  72.6k|    }
  164|  72.6k|  }
  165|       |
  166|     70|  return SPV_ERROR_INVALID_LOOKUP;
  167|  72.7k|}
spvOpcodeString:
  186|    639|const char* spvOpcodeString(const uint32_t opcode) {
  187|    639|  const auto beg = kOpcodeTableEntries;
  188|    639|  const auto end = kOpcodeTableEntries + ARRAY_SIZE(kOpcodeTableEntries);
  ------------------
  |  |   23|    639|#define ARRAY_SIZE(A) (static_cast<uint32_t>(sizeof(A) / sizeof(A[0])))
  ------------------
  189|    639|  spv_opcode_desc_t needle = {"",    static_cast<spv::Op>(opcode),
  190|    639|                              0,     nullptr,
  191|    639|                              0,     {},
  192|    639|                              false, false,
  193|    639|                              0,     nullptr,
  194|    639|                              ~0u,   ~0u};
  195|    639|  auto comp = [](const spv_opcode_desc_t& lhs, const spv_opcode_desc_t& rhs) {
  196|    639|    return lhs.opcode < rhs.opcode;
  197|    639|  };
  198|    639|  auto it = std::lower_bound(beg, end, needle, comp);
  199|    639|  if (it != end && it->opcode == spv::Op(opcode)) {
  ------------------
  |  Branch (199:7): [True: 639, False: 0]
  |  Branch (199:20): [True: 639, False: 0]
  ------------------
  200|    639|    return it->name;
  201|    639|  }
  202|       |
  203|      0|  assert(0 && "Unreachable!");
  204|      0|  return "unknown";
  205|    639|}
_Z15spvOpcodeStringN3spv2OpE:
  207|    639|const char* spvOpcodeString(const spv::Op opcode) {
  208|    639|  return spvOpcodeString(static_cast<uint32_t>(opcode));
  209|    639|}
_Z22spvOpcodeGeneratesTypeN3spv2OpE:
  317|  93.7k|int32_t spvOpcodeGeneratesType(spv::Op op) {
  318|  93.7k|  switch (op) {
  319|    350|    case spv::Op::OpTypeVoid:
  ------------------
  |  Branch (319:5): [True: 350, False: 93.4k]
  ------------------
  320|  1.08k|    case spv::Op::OpTypeBool:
  ------------------
  |  Branch (320:5): [True: 734, False: 93.0k]
  ------------------
  321|  1.86k|    case spv::Op::OpTypeInt:
  ------------------
  |  Branch (321:5): [True: 781, False: 92.9k]
  ------------------
  322|  2.39k|    case spv::Op::OpTypeFloat:
  ------------------
  |  Branch (322:5): [True: 526, False: 93.2k]
  ------------------
  323|  2.87k|    case spv::Op::OpTypeVector:
  ------------------
  |  Branch (323:5): [True: 484, False: 93.2k]
  ------------------
  324|  3.11k|    case spv::Op::OpTypeMatrix:
  ------------------
  |  Branch (324:5): [True: 236, False: 93.5k]
  ------------------
  325|  3.58k|    case spv::Op::OpTypeImage:
  ------------------
  |  Branch (325:5): [True: 469, False: 93.3k]
  ------------------
  326|  4.33k|    case spv::Op::OpTypeSampler:
  ------------------
  |  Branch (326:5): [True: 756, False: 93.0k]
  ------------------
  327|  4.37k|    case spv::Op::OpTypeSampledImage:
  ------------------
  |  Branch (327:5): [True: 35, False: 93.7k]
  ------------------
  328|  4.45k|    case spv::Op::OpTypeArray:
  ------------------
  |  Branch (328:5): [True: 86, False: 93.6k]
  ------------------
  329|  4.49k|    case spv::Op::OpTypeRuntimeArray:
  ------------------
  |  Branch (329:5): [True: 36, False: 93.7k]
  ------------------
  330|  5.14k|    case spv::Op::OpTypeStruct:
  ------------------
  |  Branch (330:5): [True: 652, False: 93.1k]
  ------------------
  331|  5.21k|    case spv::Op::OpTypeOpaque:
  ------------------
  |  Branch (331:5): [True: 69, False: 93.7k]
  ------------------
  332|  5.92k|    case spv::Op::OpTypePointer:
  ------------------
  |  Branch (332:5): [True: 710, False: 93.0k]
  ------------------
  333|  6.15k|    case spv::Op::OpTypeFunction:
  ------------------
  |  Branch (333:5): [True: 227, False: 93.5k]
  ------------------
  334|  9.61k|    case spv::Op::OpTypeEvent:
  ------------------
  |  Branch (334:5): [True: 3.46k, False: 90.3k]
  ------------------
  335|  13.7k|    case spv::Op::OpTypeDeviceEvent:
  ------------------
  |  Branch (335:5): [True: 4.17k, False: 89.6k]
  ------------------
  336|  15.2k|    case spv::Op::OpTypeReserveId:
  ------------------
  |  Branch (336:5): [True: 1.44k, False: 92.3k]
  ------------------
  337|  16.6k|    case spv::Op::OpTypeQueue:
  ------------------
  |  Branch (337:5): [True: 1.39k, False: 92.3k]
  ------------------
  338|  16.9k|    case spv::Op::OpTypePipe:
  ------------------
  |  Branch (338:5): [True: 274, False: 93.5k]
  ------------------
  339|  17.2k|    case spv::Op::OpTypePipeStorage:
  ------------------
  |  Branch (339:5): [True: 325, False: 93.4k]
  ------------------
  340|  17.2k|    case spv::Op::OpTypeNamedBarrier:
  ------------------
  |  Branch (340:5): [True: 63, False: 93.7k]
  ------------------
  341|  17.5k|    case spv::Op::OpTypeAccelerationStructureNV:
  ------------------
  |  Branch (341:5): [True: 272, False: 93.5k]
  ------------------
  342|  17.6k|    case spv::Op::OpTypeCooperativeMatrixNV:
  ------------------
  |  Branch (342:5): [True: 66, False: 93.7k]
  ------------------
  343|       |    // case spv::Op::OpTypeAccelerationStructureKHR: covered by
  344|       |    // spv::Op::OpTypeAccelerationStructureNV
  345|  18.0k|    case spv::Op::OpTypeRayQueryKHR:
  ------------------
  |  Branch (345:5): [True: 409, False: 93.3k]
  ------------------
  346|  18.3k|    case spv::Op::OpTypeHitObjectNV:
  ------------------
  |  Branch (346:5): [True: 280, False: 93.4k]
  ------------------
  347|  18.3k|      return true;
  348|  75.4k|    default:
  ------------------
  |  Branch (348:5): [True: 75.4k, False: 18.3k]
  ------------------
  349|       |      // In particular, OpTypeForwardPointer does not generate a type,
  350|       |      // but declares a storage class for a pointer type generated
  351|       |      // by a different instruction.
  352|  75.4k|      break;
  353|  93.7k|  }
  354|  75.4k|  return 0;
  355|  93.7k|}
opcode.cpp:_ZZ25spvOpcodeTableValueLookup14spv_target_envPK18spv_opcode_table_tN3spv2OpEPPK17spv_opcode_desc_tENK3$_1clERS6_SA_:
  139|   670k|  auto comp = [](const spv_opcode_desc_t& lhs, const spv_opcode_desc_t& rhs) {
  140|   670k|    return lhs.opcode < rhs.opcode;
  141|   670k|  };
opcode.cpp:_ZZ15spvOpcodeStringENK3$_2clERK17spv_opcode_desc_tS2_:
  195|  6.04k|  auto comp = [](const spv_opcode_desc_t& lhs, const spv_opcode_desc_t& rhs) {
  196|  6.04k|    return lhs.opcode < rhs.opcode;
  197|  6.04k|  };

_Z18spvOperandTableGetPPK19spv_operand_table_t14spv_target_env:
   44|  3.92k|                                spv_target_env) {
   45|  3.92k|  if (!pOperandTable) return SPV_ERROR_INVALID_POINTER;
  ------------------
  |  Branch (45:7): [True: 0, False: 3.92k]
  ------------------
   46|       |
   47|  3.92k|  *pOperandTable = &kOperandTable;
   48|  3.92k|  return SPV_SUCCESS;
   49|  3.92k|}
_Z26spvOperandTableValueLookup14spv_target_envPK19spv_operand_table_t18spv_operand_type_tjPPK18spv_operand_desc_t:
   96|  48.0k|                                        spv_operand_desc* pEntry) {
   97|  48.0k|  if (!table) return SPV_ERROR_INVALID_TABLE;
  ------------------
  |  Branch (97:7): [True: 0, False: 48.0k]
  ------------------
   98|  48.0k|  if (!pEntry) return SPV_ERROR_INVALID_POINTER;
  ------------------
  |  Branch (98:7): [True: 0, False: 48.0k]
  ------------------
   99|       |
  100|  48.0k|  spv_operand_desc_t needle = {"", value, 0, nullptr, 0, nullptr, {}, ~0u, ~0u};
  101|       |
  102|  48.0k|  auto comp = [](const spv_operand_desc_t& lhs, const spv_operand_desc_t& rhs) {
  103|  48.0k|    return lhs.value < rhs.value;
  104|  48.0k|  };
  105|       |
  106|  1.38M|  for (uint64_t typeIndex = 0; typeIndex < table->count; ++typeIndex) {
  ------------------
  |  Branch (106:32): [True: 1.38M, False: 193]
  ------------------
  107|  1.38M|    const auto& group = table->types[typeIndex];
  108|  1.38M|    if (type != group.type) continue;
  ------------------
  |  Branch (108:9): [True: 1.33M, False: 48.0k]
  ------------------
  109|       |
  110|  48.0k|    const auto beg = group.entries;
  111|  48.0k|    const auto end = group.entries + group.count;
  112|       |
  113|       |    // We need to loop here because there can exist multiple symbols for the
  114|       |    // same operand value, and they can be introduced in different target
  115|       |    // environments, which means they can have different minimal version
  116|       |    // requirements. For example, SubgroupEqMaskKHR can exist in any SPIR-V
  117|       |    // version as long as the SPV_KHR_shader_ballot extension is there; but
  118|       |    // starting from SPIR-V 1.3, SubgroupEqMask, which has the same numeric
  119|       |    // value as SubgroupEqMaskKHR, is available in core SPIR-V without extension
  120|       |    // requirements.
  121|       |    // Assumes the underlying table is already sorted ascendingly according to
  122|       |    // opcode value.
  123|  48.0k|    const auto version = spvVersionForTargetEnv(env);
  124|  48.0k|    for (auto it = std::lower_bound(beg, end, needle, comp);
  125|  48.0k|         it != end && it->value == value; ++it) {
  ------------------
  |  Branch (125:10): [True: 47.9k, False: 155]
  |  Branch (125:23): [True: 47.8k, False: 38]
  ------------------
  126|       |      // We consider the current operand as available as long as
  127|       |      // 1. The target environment satisfies the minimal requirement of the
  128|       |      //    operand; or
  129|       |      // 2. There is at least one extension enabling this operand; or
  130|       |      // 3. There is at least one capability enabling this operand.
  131|       |      //
  132|       |      // Note that the second rule assumes the extension enabling this operand
  133|       |      // is indeed requested in the SPIR-V code; checking that should be
  134|       |      // validator's work.
  135|  47.8k|      if ((version >= it->minVersion && version <= it->lastVersion) ||
  ------------------
  |  Branch (135:12): [True: 45.7k, False: 2.09k]
  |  Branch (135:41): [True: 45.7k, False: 0]
  ------------------
  136|  47.8k|          it->numExtensions > 0u || it->numCapabilities > 0u) {
  ------------------
  |  Branch (136:11): [True: 638, False: 1.46k]
  |  Branch (136:37): [True: 1.45k, False: 4]
  ------------------
  137|  47.8k|        *pEntry = it;
  138|  47.8k|        return SPV_SUCCESS;
  139|  47.8k|      }
  140|  47.8k|    }
  141|  48.0k|  }
  142|       |
  143|    193|  return SPV_ERROR_INVALID_LOOKUP;
  144|  48.0k|}
_Z17spvOperandTypeStr18spv_operand_type_t:
  146|    889|const char* spvOperandTypeStr(spv_operand_type_t type) {
  147|    889|  switch (type) {
  148|    147|    case SPV_OPERAND_TYPE_ID:
  ------------------
  |  Branch (148:5): [True: 147, False: 742]
  ------------------
  149|    236|    case SPV_OPERAND_TYPE_OPTIONAL_ID:
  ------------------
  |  Branch (149:5): [True: 89, False: 800]
  ------------------
  150|    236|      return "ID";
  151|     20|    case SPV_OPERAND_TYPE_TYPE_ID:
  ------------------
  |  Branch (151:5): [True: 20, False: 869]
  ------------------
  152|     20|      return "type ID";
  153|     52|    case SPV_OPERAND_TYPE_RESULT_ID:
  ------------------
  |  Branch (153:5): [True: 52, False: 837]
  ------------------
  154|     52|      return "result ID";
  155|     52|    case SPV_OPERAND_TYPE_LITERAL_INTEGER:
  ------------------
  |  Branch (155:5): [True: 52, False: 837]
  ------------------
  156|     76|    case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER:
  ------------------
  |  Branch (156:5): [True: 24, False: 865]
  ------------------
  157|     76|    case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_NUMBER:
  ------------------
  |  Branch (157:5): [True: 0, False: 889]
  ------------------
  158|     76|      return "literal number";
  159|     94|    case SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER:
  ------------------
  |  Branch (159:5): [True: 94, False: 795]
  ------------------
  160|     94|      return "possibly multi-word literal integer";
  161|     17|    case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER:
  ------------------
  |  Branch (161:5): [True: 17, False: 872]
  ------------------
  162|     17|      return "possibly multi-word literal number";
  163|     16|    case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER:
  ------------------
  |  Branch (163:5): [True: 16, False: 873]
  ------------------
  164|     16|      return "extension instruction number";
  165|     55|    case SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER:
  ------------------
  |  Branch (165:5): [True: 55, False: 834]
  ------------------
  166|     55|      return "OpSpecConstantOp opcode";
  167|     37|    case SPV_OPERAND_TYPE_LITERAL_STRING:
  ------------------
  |  Branch (167:5): [True: 37, False: 852]
  ------------------
  168|     39|    case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING:
  ------------------
  |  Branch (168:5): [True: 2, False: 887]
  ------------------
  169|     39|      return "literal string";
  170|     13|    case SPV_OPERAND_TYPE_SOURCE_LANGUAGE:
  ------------------
  |  Branch (170:5): [True: 13, False: 876]
  ------------------
  171|     13|      return "source language";
  172|     10|    case SPV_OPERAND_TYPE_EXECUTION_MODEL:
  ------------------
  |  Branch (172:5): [True: 10, False: 879]
  ------------------
  173|     10|      return "execution model";
  174|     12|    case SPV_OPERAND_TYPE_ADDRESSING_MODEL:
  ------------------
  |  Branch (174:5): [True: 12, False: 877]
  ------------------
  175|     12|      return "addressing model";
  176|     11|    case SPV_OPERAND_TYPE_MEMORY_MODEL:
  ------------------
  |  Branch (176:5): [True: 11, False: 878]
  ------------------
  177|     11|      return "memory model";
  178|      1|    case SPV_OPERAND_TYPE_EXECUTION_MODE:
  ------------------
  |  Branch (178:5): [True: 1, False: 888]
  ------------------
  179|      1|      return "execution mode";
  180|      3|    case SPV_OPERAND_TYPE_STORAGE_CLASS:
  ------------------
  |  Branch (180:5): [True: 3, False: 886]
  ------------------
  181|      3|      return "storage class";
  182|      3|    case SPV_OPERAND_TYPE_DIMENSIONALITY:
  ------------------
  |  Branch (182:5): [True: 3, False: 886]
  ------------------
  183|      3|      return "dimensionality";
  184|      2|    case SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE:
  ------------------
  |  Branch (184:5): [True: 2, False: 887]
  ------------------
  185|      2|      return "sampler addressing mode";
  186|      1|    case SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE:
  ------------------
  |  Branch (186:5): [True: 1, False: 888]
  ------------------
  187|      1|      return "sampler filter mode";
  188|      2|    case SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT:
  ------------------
  |  Branch (188:5): [True: 2, False: 887]
  ------------------
  189|      2|      return "image format";
  190|      5|    case SPV_OPERAND_TYPE_FP_FAST_MATH_MODE:
  ------------------
  |  Branch (190:5): [True: 5, False: 884]
  ------------------
  191|      5|      return "floating-point fast math mode";
  192|      1|    case SPV_OPERAND_TYPE_FP_ROUNDING_MODE:
  ------------------
  |  Branch (192:5): [True: 1, False: 888]
  ------------------
  193|      1|      return "floating-point rounding mode";
  194|      4|    case SPV_OPERAND_TYPE_LINKAGE_TYPE:
  ------------------
  |  Branch (194:5): [True: 4, False: 885]
  ------------------
  195|      4|      return "linkage type";
  196|      7|    case SPV_OPERAND_TYPE_ACCESS_QUALIFIER:
  ------------------
  |  Branch (196:5): [True: 7, False: 882]
  ------------------
  197|      8|    case SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER:
  ------------------
  |  Branch (197:5): [True: 1, False: 888]
  ------------------
  198|      8|      return "access qualifier";
  199|      1|    case SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE:
  ------------------
  |  Branch (199:5): [True: 1, False: 888]
  ------------------
  200|      1|      return "function parameter attribute";
  201|      8|    case SPV_OPERAND_TYPE_DECORATION:
  ------------------
  |  Branch (201:5): [True: 8, False: 881]
  ------------------
  202|      8|      return "decoration";
  203|      1|    case SPV_OPERAND_TYPE_BUILT_IN:
  ------------------
  |  Branch (203:5): [True: 1, False: 888]
  ------------------
  204|      1|      return "built-in";
  205|     68|    case SPV_OPERAND_TYPE_SELECTION_CONTROL:
  ------------------
  |  Branch (205:5): [True: 68, False: 821]
  ------------------
  206|     68|      return "selection control";
  207|     13|    case SPV_OPERAND_TYPE_LOOP_CONTROL:
  ------------------
  |  Branch (207:5): [True: 13, False: 876]
  ------------------
  208|     13|      return "loop control";
  209|      7|    case SPV_OPERAND_TYPE_FUNCTION_CONTROL:
  ------------------
  |  Branch (209:5): [True: 7, False: 882]
  ------------------
  210|      7|      return "function control";
  211|     19|    case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID:
  ------------------
  |  Branch (211:5): [True: 19, False: 870]
  ------------------
  212|     19|      return "memory semantics ID";
  213|      2|    case SPV_OPERAND_TYPE_MEMORY_ACCESS:
  ------------------
  |  Branch (213:5): [True: 2, False: 887]
  ------------------
  214|      2|    case SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS:
  ------------------
  |  Branch (214:5): [True: 0, False: 889]
  ------------------
  215|      2|      return "memory access";
  216|      0|    case SPV_OPERAND_TYPE_FRAGMENT_SHADING_RATE:
  ------------------
  |  Branch (216:5): [True: 0, False: 889]
  ------------------
  217|      0|      return "shading rate";
  218|     46|    case SPV_OPERAND_TYPE_SCOPE_ID:
  ------------------
  |  Branch (218:5): [True: 46, False: 843]
  ------------------
  219|     46|      return "scope ID";
  220|      1|    case SPV_OPERAND_TYPE_GROUP_OPERATION:
  ------------------
  |  Branch (220:5): [True: 1, False: 888]
  ------------------
  221|      1|      return "group operation";
  222|      0|    case SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS:
  ------------------
  |  Branch (222:5): [True: 0, False: 889]
  ------------------
  223|      0|      return "kernel enqeue flags";
  224|      0|    case SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO:
  ------------------
  |  Branch (224:5): [True: 0, False: 889]
  ------------------
  225|      0|      return "kernel profiling info";
  226|     22|    case SPV_OPERAND_TYPE_CAPABILITY:
  ------------------
  |  Branch (226:5): [True: 22, False: 867]
  ------------------
  227|     22|      return "capability";
  228|      0|    case SPV_OPERAND_TYPE_RAY_FLAGS:
  ------------------
  |  Branch (228:5): [True: 0, False: 889]
  ------------------
  229|      0|      return "ray flags";
  230|      0|    case SPV_OPERAND_TYPE_RAY_QUERY_INTERSECTION:
  ------------------
  |  Branch (230:5): [True: 0, False: 889]
  ------------------
  231|      0|      return "ray query intersection";
  232|      0|    case SPV_OPERAND_TYPE_RAY_QUERY_COMMITTED_INTERSECTION_TYPE:
  ------------------
  |  Branch (232:5): [True: 0, False: 889]
  ------------------
  233|      0|      return "ray query committed intersection type";
  234|      0|    case SPV_OPERAND_TYPE_RAY_QUERY_CANDIDATE_INTERSECTION_TYPE:
  ------------------
  |  Branch (234:5): [True: 0, False: 889]
  ------------------
  235|      0|      return "ray query candidate intersection type";
  236|      1|    case SPV_OPERAND_TYPE_PACKED_VECTOR_FORMAT:
  ------------------
  |  Branch (236:5): [True: 1, False: 888]
  ------------------
  237|      1|    case SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT:
  ------------------
  |  Branch (237:5): [True: 0, False: 889]
  ------------------
  238|      1|      return "packed vector format";
  239|      6|    case SPV_OPERAND_TYPE_IMAGE:
  ------------------
  |  Branch (239:5): [True: 6, False: 883]
  ------------------
  240|      6|    case SPV_OPERAND_TYPE_OPTIONAL_IMAGE:
  ------------------
  |  Branch (240:5): [True: 0, False: 889]
  ------------------
  241|      6|      return "image";
  242|      0|    case SPV_OPERAND_TYPE_OPTIONAL_CIV:
  ------------------
  |  Branch (242:5): [True: 0, False: 889]
  ------------------
  243|      0|      return "context-insensitive value";
  244|      3|    case SPV_OPERAND_TYPE_DEBUG_INFO_FLAGS:
  ------------------
  |  Branch (244:5): [True: 3, False: 886]
  ------------------
  245|      3|      return "debug info flags";
  246|      0|    case SPV_OPERAND_TYPE_DEBUG_BASE_TYPE_ATTRIBUTE_ENCODING:
  ------------------
  |  Branch (246:5): [True: 0, False: 889]
  ------------------
  247|      0|      return "debug base type encoding";
  248|      0|    case SPV_OPERAND_TYPE_DEBUG_COMPOSITE_TYPE:
  ------------------
  |  Branch (248:5): [True: 0, False: 889]
  ------------------
  249|      0|      return "debug composite type";
  250|      1|    case SPV_OPERAND_TYPE_DEBUG_TYPE_QUALIFIER:
  ------------------
  |  Branch (250:5): [True: 1, False: 888]
  ------------------
  251|      1|      return "debug type qualifier";
  252|      1|    case SPV_OPERAND_TYPE_DEBUG_OPERATION:
  ------------------
  |  Branch (252:5): [True: 1, False: 888]
  ------------------
  253|      1|      return "debug operation";
  254|      3|    case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_INFO_FLAGS:
  ------------------
  |  Branch (254:5): [True: 3, False: 886]
  ------------------
  255|      3|      return "OpenCL.DebugInfo.100 debug info flags";
  256|      0|    case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_BASE_TYPE_ATTRIBUTE_ENCODING:
  ------------------
  |  Branch (256:5): [True: 0, False: 889]
  ------------------
  257|      0|      return "OpenCL.DebugInfo.100 debug base type encoding";
  258|      0|    case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_COMPOSITE_TYPE:
  ------------------
  |  Branch (258:5): [True: 0, False: 889]
  ------------------
  259|      0|      return "OpenCL.DebugInfo.100 debug composite type";
  260|      1|    case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_TYPE_QUALIFIER:
  ------------------
  |  Branch (260:5): [True: 1, False: 888]
  ------------------
  261|      1|      return "OpenCL.DebugInfo.100 debug type qualifier";
  262|      0|    case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_OPERATION:
  ------------------
  |  Branch (262:5): [True: 0, False: 889]
  ------------------
  263|      0|      return "OpenCL.DebugInfo.100 debug operation";
  264|      0|    case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_IMPORTED_ENTITY:
  ------------------
  |  Branch (264:5): [True: 0, False: 889]
  ------------------
  265|      0|      return "OpenCL.DebugInfo.100 debug imported entity";
  266|       |
  267|       |    // The next values are for values returned from an instruction, not actually
  268|       |    // an operand.  So the specific strings don't matter.  But let's add them
  269|       |    // for completeness and ease of testing.
  270|      0|    case SPV_OPERAND_TYPE_IMAGE_CHANNEL_ORDER:
  ------------------
  |  Branch (270:5): [True: 0, False: 889]
  ------------------
  271|      0|      return "image channel order";
  272|      0|    case SPV_OPERAND_TYPE_IMAGE_CHANNEL_DATA_TYPE:
  ------------------
  |  Branch (272:5): [True: 0, False: 889]
  ------------------
  273|      0|      return "image channel data type";
  274|       |
  275|      1|    case SPV_OPERAND_TYPE_FPDENORM_MODE:
  ------------------
  |  Branch (275:5): [True: 1, False: 888]
  ------------------
  276|      1|      return "FP denorm mode";
  277|      3|    case SPV_OPERAND_TYPE_FPOPERATION_MODE:
  ------------------
  |  Branch (277:5): [True: 3, False: 886]
  ------------------
  278|      3|      return "FP operation mode";
  279|      0|    case SPV_OPERAND_TYPE_QUANTIZATION_MODES:
  ------------------
  |  Branch (279:5): [True: 0, False: 889]
  ------------------
  280|      0|      return "quantization mode";
  281|      0|    case SPV_OPERAND_TYPE_OVERFLOW_MODES:
  ------------------
  |  Branch (281:5): [True: 0, False: 889]
  ------------------
  282|      0|      return "overflow mode";
  283|       |
  284|      0|    case SPV_OPERAND_TYPE_NONE:
  ------------------
  |  Branch (284:5): [True: 0, False: 889]
  ------------------
  285|      0|      return "NONE";
  286|      0|    default:
  ------------------
  |  Branch (286:5): [True: 0, False: 889]
  ------------------
  287|      0|      break;
  288|    889|  }
  289|      0|  return "unknown";
  290|    889|}
_Z19spvPushOperandTypesPK18spv_operand_type_tPNSt3__16vectorIS_NS2_9allocatorIS_EEEE:
  293|  48.6k|                         spv_operand_pattern_t* pattern) {
  294|  48.6k|  const spv_operand_type_t* endTypes;
  295|  66.8k|  for (endTypes = types; *endTypes != SPV_OPERAND_TYPE_NONE; ++endTypes) {
  ------------------
  |  Branch (295:26): [True: 18.1k, False: 48.6k]
  ------------------
  296|  18.1k|  }
  297|       |
  298|  66.8k|  while (endTypes-- != types) {
  ------------------
  |  Branch (298:10): [True: 18.1k, False: 48.6k]
  ------------------
  299|  18.1k|    pattern->push_back(*endTypes);
  300|  18.1k|  }
  301|  48.6k|}
spvOperandIsConcrete:
  322|   833k|bool spvOperandIsConcrete(spv_operand_type_t type) {
  323|   833k|  if (spvIsIdType(type) || spvOperandIsConcreteMask(type)) {
  ------------------
  |  Branch (323:7): [True: 548k, False: 284k]
  |  Branch (323:28): [True: 1.89k, False: 283k]
  ------------------
  324|   550k|    return true;
  325|   550k|  }
  326|   283k|  switch (type) {
  327|  73.9k|    case SPV_OPERAND_TYPE_LITERAL_INTEGER:
  ------------------
  |  Branch (327:5): [True: 73.9k, False: 209k]
  ------------------
  328|  75.0k|    case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER:
  ------------------
  |  Branch (328:5): [True: 1.17k, False: 281k]
  ------------------
  329|  75.1k|    case SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER:
  ------------------
  |  Branch (329:5): [True: 37, False: 282k]
  ------------------
  330|   228k|    case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER:
  ------------------
  |  Branch (330:5): [True: 153k, False: 129k]
  ------------------
  331|   239k|    case SPV_OPERAND_TYPE_LITERAL_STRING:
  ------------------
  |  Branch (331:5): [True: 10.9k, False: 272k]
  ------------------
  332|   240k|    case SPV_OPERAND_TYPE_SOURCE_LANGUAGE:
  ------------------
  |  Branch (332:5): [True: 1.17k, False: 281k]
  ------------------
  333|   241k|    case SPV_OPERAND_TYPE_EXECUTION_MODEL:
  ------------------
  |  Branch (333:5): [True: 412, False: 282k]
  ------------------
  334|   241k|    case SPV_OPERAND_TYPE_ADDRESSING_MODEL:
  ------------------
  |  Branch (334:5): [True: 612, False: 282k]
  ------------------
  335|   242k|    case SPV_OPERAND_TYPE_MEMORY_MODEL:
  ------------------
  |  Branch (335:5): [True: 601, False: 282k]
  ------------------
  336|   242k|    case SPV_OPERAND_TYPE_EXECUTION_MODE:
  ------------------
  |  Branch (336:5): [True: 582, False: 282k]
  ------------------
  337|   243k|    case SPV_OPERAND_TYPE_STORAGE_CLASS:
  ------------------
  |  Branch (337:5): [True: 746, False: 282k]
  ------------------
  338|   243k|    case SPV_OPERAND_TYPE_DIMENSIONALITY:
  ------------------
  |  Branch (338:5): [True: 237, False: 282k]
  ------------------
  339|   243k|    case SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE:
  ------------------
  |  Branch (339:5): [True: 39, False: 282k]
  ------------------
  340|   243k|    case SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE:
  ------------------
  |  Branch (340:5): [True: 33, False: 282k]
  ------------------
  341|   244k|    case SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT:
  ------------------
  |  Branch (341:5): [True: 230, False: 282k]
  ------------------
  342|   244k|    case SPV_OPERAND_TYPE_IMAGE_CHANNEL_ORDER:
  ------------------
  |  Branch (342:5): [True: 0, False: 283k]
  ------------------
  343|   244k|    case SPV_OPERAND_TYPE_IMAGE_CHANNEL_DATA_TYPE:
  ------------------
  |  Branch (343:5): [True: 0, False: 283k]
  ------------------
  344|   244k|    case SPV_OPERAND_TYPE_FP_ROUNDING_MODE:
  ------------------
  |  Branch (344:5): [True: 218, False: 282k]
  ------------------
  345|   244k|    case SPV_OPERAND_TYPE_LINKAGE_TYPE:
  ------------------
  |  Branch (345:5): [True: 195, False: 282k]
  ------------------
  346|   244k|    case SPV_OPERAND_TYPE_ACCESS_QUALIFIER:
  ------------------
  |  Branch (346:5): [True: 143, False: 282k]
  ------------------
  347|   244k|    case SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE:
  ------------------
  |  Branch (347:5): [True: 194, False: 282k]
  ------------------
  348|   281k|    case SPV_OPERAND_TYPE_DECORATION:
  ------------------
  |  Branch (348:5): [True: 36.8k, False: 246k]
  ------------------
  349|   282k|    case SPV_OPERAND_TYPE_BUILT_IN:
  ------------------
  |  Branch (349:5): [True: 383, False: 282k]
  ------------------
  350|   282k|    case SPV_OPERAND_TYPE_GROUP_OPERATION:
  ------------------
  |  Branch (350:5): [True: 21, False: 282k]
  ------------------
  351|   282k|    case SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS:
  ------------------
  |  Branch (351:5): [True: 0, False: 283k]
  ------------------
  352|   282k|    case SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO:
  ------------------
  |  Branch (352:5): [True: 0, False: 283k]
  ------------------
  353|   282k|    case SPV_OPERAND_TYPE_CAPABILITY:
  ------------------
  |  Branch (353:5): [True: 321, False: 282k]
  ------------------
  354|   282k|    case SPV_OPERAND_TYPE_RAY_FLAGS:
  ------------------
  |  Branch (354:5): [True: 0, False: 283k]
  ------------------
  355|   282k|    case SPV_OPERAND_TYPE_RAY_QUERY_INTERSECTION:
  ------------------
  |  Branch (355:5): [True: 0, False: 283k]
  ------------------
  356|   282k|    case SPV_OPERAND_TYPE_RAY_QUERY_COMMITTED_INTERSECTION_TYPE:
  ------------------
  |  Branch (356:5): [True: 0, False: 283k]
  ------------------
  357|   282k|    case SPV_OPERAND_TYPE_RAY_QUERY_CANDIDATE_INTERSECTION_TYPE:
  ------------------
  |  Branch (357:5): [True: 0, False: 283k]
  ------------------
  358|   282k|    case SPV_OPERAND_TYPE_DEBUG_BASE_TYPE_ATTRIBUTE_ENCODING:
  ------------------
  |  Branch (358:5): [True: 10, False: 282k]
  ------------------
  359|   282k|    case SPV_OPERAND_TYPE_DEBUG_COMPOSITE_TYPE:
  ------------------
  |  Branch (359:5): [True: 18, False: 282k]
  ------------------
  360|   282k|    case SPV_OPERAND_TYPE_DEBUG_TYPE_QUALIFIER:
  ------------------
  |  Branch (360:5): [True: 20, False: 282k]
  ------------------
  361|   282k|    case SPV_OPERAND_TYPE_DEBUG_OPERATION:
  ------------------
  |  Branch (361:5): [True: 11, False: 282k]
  ------------------
  362|   282k|    case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_BASE_TYPE_ATTRIBUTE_ENCODING:
  ------------------
  |  Branch (362:5): [True: 10, False: 282k]
  ------------------
  363|   282k|    case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_COMPOSITE_TYPE:
  ------------------
  |  Branch (363:5): [True: 10, False: 282k]
  ------------------
  364|   282k|    case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_TYPE_QUALIFIER:
  ------------------
  |  Branch (364:5): [True: 18, False: 282k]
  ------------------
  365|   282k|    case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_OPERATION:
  ------------------
  |  Branch (365:5): [True: 10, False: 282k]
  ------------------
  366|   282k|    case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_IMPORTED_ENTITY:
  ------------------
  |  Branch (366:5): [True: 10, False: 282k]
  ------------------
  367|   282k|    case SPV_OPERAND_TYPE_FPDENORM_MODE:
  ------------------
  |  Branch (367:5): [True: 194, False: 282k]
  ------------------
  368|   282k|    case SPV_OPERAND_TYPE_FPOPERATION_MODE:
  ------------------
  |  Branch (368:5): [True: 197, False: 282k]
  ------------------
  369|   282k|    case SPV_OPERAND_TYPE_QUANTIZATION_MODES:
  ------------------
  |  Branch (369:5): [True: 0, False: 283k]
  ------------------
  370|   282k|    case SPV_OPERAND_TYPE_OVERFLOW_MODES:
  ------------------
  |  Branch (370:5): [True: 0, False: 283k]
  ------------------
  371|   283k|    case SPV_OPERAND_TYPE_PACKED_VECTOR_FORMAT:
  ------------------
  |  Branch (371:5): [True: 18, False: 282k]
  ------------------
  372|   283k|      return true;
  373|      0|    default:
  ------------------
  |  Branch (373:5): [True: 0, False: 283k]
  ------------------
  374|      0|      break;
  375|   283k|  }
  376|      0|  return false;
  377|   283k|}
spvOperandIsConcreteMask:
  379|   284k|bool spvOperandIsConcreteMask(spv_operand_type_t type) {
  380|   284k|  switch (type) {
  381|    204|    case SPV_OPERAND_TYPE_IMAGE:
  ------------------
  |  Branch (381:5): [True: 204, False: 284k]
  ------------------
  382|    554|    case SPV_OPERAND_TYPE_FP_FAST_MATH_MODE:
  ------------------
  |  Branch (382:5): [True: 350, False: 284k]
  ------------------
  383|    874|    case SPV_OPERAND_TYPE_SELECTION_CONTROL:
  ------------------
  |  Branch (383:5): [True: 320, False: 284k]
  ------------------
  384|  1.08k|    case SPV_OPERAND_TYPE_LOOP_CONTROL:
  ------------------
  |  Branch (384:5): [True: 210, False: 284k]
  ------------------
  385|  1.27k|    case SPV_OPERAND_TYPE_FUNCTION_CONTROL:
  ------------------
  |  Branch (385:5): [True: 192, False: 284k]
  ------------------
  386|  1.84k|    case SPV_OPERAND_TYPE_MEMORY_ACCESS:
  ------------------
  |  Branch (386:5): [True: 572, False: 284k]
  ------------------
  387|  1.84k|    case SPV_OPERAND_TYPE_FRAGMENT_SHADING_RATE:
  ------------------
  |  Branch (387:5): [True: 0, False: 284k]
  ------------------
  388|  1.87k|    case SPV_OPERAND_TYPE_DEBUG_INFO_FLAGS:
  ------------------
  |  Branch (388:5): [True: 30, False: 284k]
  ------------------
  389|  1.89k|    case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_INFO_FLAGS:
  ------------------
  |  Branch (389:5): [True: 16, False: 284k]
  ------------------
  390|  1.89k|      return true;
  391|   283k|    default:
  ------------------
  |  Branch (391:5): [True: 283k, False: 1.89k]
  ------------------
  392|   283k|      break;
  393|   284k|  }
  394|   283k|  return false;
  395|   284k|}
_Z20spvOperandIsOptional18spv_operand_type_t:
  397|  4.70k|bool spvOperandIsOptional(spv_operand_type_t type) {
  398|  4.70k|  switch (type) {
  399|  1.10k|    case SPV_OPERAND_TYPE_OPTIONAL_ID:
  ------------------
  |  Branch (399:5): [True: 1.10k, False: 3.59k]
  ------------------
  400|  1.10k|    case SPV_OPERAND_TYPE_OPTIONAL_IMAGE:
  ------------------
  |  Branch (400:5): [True: 1, False: 4.69k]
  ------------------
  401|  1.18k|    case SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS:
  ------------------
  |  Branch (401:5): [True: 86, False: 4.61k]
  ------------------
  402|  1.19k|    case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER:
  ------------------
  |  Branch (402:5): [True: 1, False: 4.69k]
  ------------------
  403|  1.19k|    case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_NUMBER:
  ------------------
  |  Branch (403:5): [True: 0, False: 4.70k]
  ------------------
  404|  1.19k|    case SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER:
  ------------------
  |  Branch (404:5): [True: 0, False: 4.70k]
  ------------------
  405|  1.53k|    case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING:
  ------------------
  |  Branch (405:5): [True: 348, False: 4.35k]
  ------------------
  406|  1.75k|    case SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER:
  ------------------
  |  Branch (406:5): [True: 219, False: 4.48k]
  ------------------
  407|  1.75k|    case SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT:
  ------------------
  |  Branch (407:5): [True: 1, False: 4.69k]
  ------------------
  408|  1.75k|    case SPV_OPERAND_TYPE_OPTIONAL_CIV:
  ------------------
  |  Branch (408:5): [True: 0, False: 4.70k]
  ------------------
  409|  1.75k|      return true;
  410|  2.94k|    default:
  ------------------
  |  Branch (410:5): [True: 2.94k, False: 1.75k]
  ------------------
  411|  2.94k|      break;
  412|  4.70k|  }
  413|       |  // Any variable operand is also optional.
  414|  2.94k|  return spvOperandIsVariable(type);
  415|  4.70k|}
_Z20spvOperandIsVariable18spv_operand_type_t:
  417|  2.94k|bool spvOperandIsVariable(spv_operand_type_t type) {
  418|  2.94k|  switch (type) {
  419|  2.30k|    case SPV_OPERAND_TYPE_VARIABLE_ID:
  ------------------
  |  Branch (419:5): [True: 2.30k, False: 634]
  ------------------
  420|  2.89k|    case SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER:
  ------------------
  |  Branch (420:5): [True: 587, False: 2.35k]
  ------------------
  421|  2.90k|    case SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER_ID:
  ------------------
  |  Branch (421:5): [True: 9, False: 2.93k]
  ------------------
  422|  2.90k|    case SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL_INTEGER:
  ------------------
  |  Branch (422:5): [True: 2, False: 2.94k]
  ------------------
  423|  2.90k|      return true;
  424|     36|    default:
  ------------------
  |  Branch (424:5): [True: 36, False: 2.90k]
  ------------------
  425|     36|      break;
  426|  2.94k|  }
  427|     36|  return false;
  428|  2.94k|}
_Z28spvExpandOperandSequenceOnce18spv_operand_type_tPNSt3__16vectorIS_NS0_9allocatorIS_EEEE:
  431|  1.34M|                                  spv_operand_pattern_t* pattern) {
  432|  1.34M|  switch (type) {
  433|   304k|    case SPV_OPERAND_TYPE_VARIABLE_ID:
  ------------------
  |  Branch (433:5): [True: 304k, False: 1.04M]
  ------------------
  434|   304k|      pattern->push_back(type);
  435|   304k|      pattern->push_back(SPV_OPERAND_TYPE_OPTIONAL_ID);
  436|   304k|      return true;
  437|  55.1k|    case SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER:
  ------------------
  |  Branch (437:5): [True: 55.1k, False: 1.29M]
  ------------------
  438|  55.1k|      pattern->push_back(type);
  439|  55.1k|      pattern->push_back(SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER);
  440|  55.1k|      return true;
  441|   152k|    case SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER_ID:
  ------------------
  |  Branch (441:5): [True: 152k, False: 1.19M]
  ------------------
  442|       |      // Represents Zero or more (Literal number, Id) pairs,
  443|       |      // where the literal number must be a scalar integer.
  444|   152k|      pattern->push_back(type);
  445|   152k|      pattern->push_back(SPV_OPERAND_TYPE_ID);
  446|   152k|      pattern->push_back(SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER);
  447|   152k|      return true;
  448|    469|    case SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL_INTEGER:
  ------------------
  |  Branch (448:5): [True: 469, False: 1.34M]
  ------------------
  449|       |      // Represents Zero or more (Id, Literal number) pairs.
  450|    469|      pattern->push_back(type);
  451|    469|      pattern->push_back(SPV_OPERAND_TYPE_LITERAL_INTEGER);
  452|    469|      pattern->push_back(SPV_OPERAND_TYPE_OPTIONAL_ID);
  453|    469|      return true;
  454|   835k|    default:
  ------------------
  |  Branch (454:5): [True: 835k, False: 512k]
  ------------------
  455|   835k|      break;
  456|  1.34M|  }
  457|   835k|  return false;
  458|  1.34M|}
_Z28spvTakeFirstMatchableOperandPNSt3__16vectorI18spv_operand_type_tNS_9allocatorIS1_EEEE:
  461|   835k|    spv_operand_pattern_t* pattern) {
  462|   835k|  assert(!pattern->empty());
  463|      0|  spv_operand_type_t result;
  464|  1.34M|  do {
  465|  1.34M|    result = pattern->back();
  466|  1.34M|    pattern->pop_back();
  467|  1.34M|  } while (spvExpandOperandSequenceOnce(result, pattern));
  ------------------
  |  Branch (467:12): [True: 512k, False: 835k]
  ------------------
  468|   835k|  return result;
  469|   835k|}
_Z11spvIsIdType18spv_operand_type_t:
  486|   833k|bool spvIsIdType(spv_operand_type_t type) {
  487|   833k|  switch (type) {
  488|   515k|    case SPV_OPERAND_TYPE_ID:
  ------------------
  |  Branch (488:5): [True: 515k, False: 318k]
  ------------------
  489|   523k|    case SPV_OPERAND_TYPE_TYPE_ID:
  ------------------
  |  Branch (489:5): [True: 8.28k, False: 825k]
  ------------------
  490|   547k|    case SPV_OPERAND_TYPE_RESULT_ID:
  ------------------
  |  Branch (490:5): [True: 23.6k, False: 809k]
  ------------------
  491|   547k|    case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID:
  ------------------
  |  Branch (491:5): [True: 403, False: 833k]
  ------------------
  492|   548k|    case SPV_OPERAND_TYPE_SCOPE_ID:
  ------------------
  |  Branch (492:5): [True: 870, False: 832k]
  ------------------
  493|   548k|      return true;
  494|   284k|    default:
  ------------------
  |  Branch (494:5): [True: 284k, False: 548k]
  ------------------
  495|   284k|      return false;
  496|   833k|  }
  497|   833k|}
operand.cpp:_ZZ26spvOperandTableValueLookup14spv_target_envPK19spv_operand_table_t18spv_operand_type_tjPPK18spv_operand_desc_tENK3$_0clERS5_S9_:
  102|   302k|  auto comp = [](const spv_operand_desc_t& lhs, const spv_operand_desc_t& rhs) {
  103|   302k|    return lhs.value < rhs.value;
  104|   302k|  };

_Z10spvFixWordj16spv_endianness_t:
   34|  3.38M|uint32_t spvFixWord(const uint32_t word, const spv_endianness_t endian) {
   35|  3.38M|  if ((SPV_ENDIANNESS_LITTLE == endian && I32_ENDIAN_HOST == I32_ENDIAN_BIG) ||
  ------------------
  |  |   32|   404k|#define I32_ENDIAN_HOST (o32_host_order.value)
  ------------------
  |  Branch (35:8): [True: 404k, False: 2.97M]
  |  Branch (35:43): [True: 0, False: 404k]
  ------------------
   36|  3.38M|      (SPV_ENDIANNESS_BIG == endian && I32_ENDIAN_HOST == I32_ENDIAN_LITTLE)) {
  ------------------
  |  |   32|  2.97M|#define I32_ENDIAN_HOST (o32_host_order.value)
  ------------------
  |  Branch (36:8): [True: 2.97M, False: 404k]
  |  Branch (36:40): [True: 2.97M, False: 0]
  ------------------
   37|  2.97M|    return (word & 0x000000ff) << 24 | (word & 0x0000ff00) << 8 |
   38|  2.97M|           (word & 0x00ff0000) >> 8 | (word & 0xff000000) >> 24;
   39|  2.97M|  }
   40|       |
   41|   404k|  return word;
   42|  3.38M|}
_Z19spvBinaryEndiannessP18spv_const_binary_tP16spv_endianness_t:
   50|  3.91k|                                 spv_endianness_t* pEndian) {
   51|  3.91k|  if (!binary->code || !binary->wordCount) return SPV_ERROR_INVALID_BINARY;
  ------------------
  |  Branch (51:7): [True: 0, False: 3.91k]
  |  Branch (51:24): [True: 0, False: 3.91k]
  ------------------
   52|  3.91k|  if (!pEndian) return SPV_ERROR_INVALID_POINTER;
  ------------------
  |  Branch (52:7): [True: 0, False: 3.91k]
  ------------------
   53|       |
   54|  3.91k|  uint8_t bytes[4];
   55|  3.91k|  memcpy(bytes, binary->code, sizeof(uint32_t));
   56|       |
   57|  3.91k|  if (0x03 == bytes[0] && 0x02 == bytes[1] && 0x23 == bytes[2] &&
  ------------------
  |  Branch (57:7): [True: 1.94k, False: 1.96k]
  |  Branch (57:27): [True: 1.93k, False: 8]
  |  Branch (57:47): [True: 1.92k, False: 11]
  ------------------
   58|  3.91k|      0x07 == bytes[3]) {
  ------------------
  |  Branch (58:7): [True: 1.91k, False: 10]
  ------------------
   59|  1.91k|    *pEndian = SPV_ENDIANNESS_LITTLE;
   60|  1.91k|    return SPV_SUCCESS;
   61|  1.91k|  }
   62|       |
   63|  1.99k|  if (0x07 == bytes[0] && 0x23 == bytes[1] && 0x02 == bytes[2] &&
  ------------------
  |  Branch (63:7): [True: 1.94k, False: 50]
  |  Branch (63:27): [True: 1.93k, False: 13]
  |  Branch (63:47): [True: 1.92k, False: 10]
  ------------------
   64|  1.99k|      0x03 == bytes[3]) {
  ------------------
  |  Branch (64:7): [True: 1.91k, False: 10]
  ------------------
   65|  1.91k|    *pEndian = SPV_ENDIANNESS_BIG;
   66|  1.91k|    return SPV_SUCCESS;
   67|  1.91k|  }
   68|       |
   69|     83|  return SPV_ERROR_INVALID_BINARY;
   70|  1.99k|}
_Z15spvIsHostEndian16spv_endianness_t:
   72|  3.82k|bool spvIsHostEndian(spv_endianness_t endian) {
   73|  3.82k|  return ((SPV_ENDIANNESS_LITTLE == endian) &&
  ------------------
  |  Branch (73:11): [True: 1.91k, False: 1.91k]
  ------------------
   74|  3.82k|          (I32_ENDIAN_LITTLE == I32_ENDIAN_HOST)) ||
  ------------------
  |  |   32|  1.91k|#define I32_ENDIAN_HOST (o32_host_order.value)
  ------------------
  |  Branch (74:11): [True: 1.91k, False: 0]
  ------------------
   75|  3.82k|         ((SPV_ENDIANNESS_BIG == endian) &&
  ------------------
  |  Branch (75:11): [True: 1.91k, False: 0]
  ------------------
   76|  1.91k|          (I32_ENDIAN_BIG == I32_ENDIAN_HOST));
  ------------------
  |  |   32|  1.91k|#define I32_ENDIAN_HOST (o32_host_order.value)
  ------------------
  |  Branch (76:11): [True: 0, False: 1.91k]
  ------------------
   77|  3.82k|}

_Z22spvVersionForTargetEnv14spv_target_env:
   86|   120k|uint32_t spvVersionForTargetEnv(spv_target_env env) {
   87|   120k|  switch (env) {
  ------------------
  |  Branch (87:11): [True: 0, False: 120k]
  ------------------
   88|      0|    case SPV_ENV_UNIVERSAL_1_0:
  ------------------
  |  Branch (88:5): [True: 0, False: 120k]
  ------------------
   89|      0|    case SPV_ENV_VULKAN_1_0:
  ------------------
  |  Branch (89:5): [True: 0, False: 120k]
  ------------------
   90|      0|    case SPV_ENV_OPENCL_1_2:
  ------------------
  |  Branch (90:5): [True: 0, False: 120k]
  ------------------
   91|      0|    case SPV_ENV_OPENCL_EMBEDDED_1_2:
  ------------------
  |  Branch (91:5): [True: 0, False: 120k]
  ------------------
   92|      0|    case SPV_ENV_OPENCL_2_0:
  ------------------
  |  Branch (92:5): [True: 0, False: 120k]
  ------------------
   93|      0|    case SPV_ENV_OPENCL_EMBEDDED_2_0:
  ------------------
  |  Branch (93:5): [True: 0, False: 120k]
  ------------------
   94|      0|    case SPV_ENV_OPENCL_2_1:
  ------------------
  |  Branch (94:5): [True: 0, False: 120k]
  ------------------
   95|      0|    case SPV_ENV_OPENCL_EMBEDDED_2_1:
  ------------------
  |  Branch (95:5): [True: 0, False: 120k]
  ------------------
   96|      0|    case SPV_ENV_OPENGL_4_0:
  ------------------
  |  Branch (96:5): [True: 0, False: 120k]
  ------------------
   97|   120k|    case SPV_ENV_OPENGL_4_1:
  ------------------
  |  Branch (97:5): [True: 120k, False: 0]
  ------------------
   98|   120k|    case SPV_ENV_OPENGL_4_2:
  ------------------
  |  Branch (98:5): [True: 0, False: 120k]
  ------------------
   99|   120k|    case SPV_ENV_OPENGL_4_3:
  ------------------
  |  Branch (99:5): [True: 0, False: 120k]
  ------------------
  100|   120k|    case SPV_ENV_OPENGL_4_5:
  ------------------
  |  Branch (100:5): [True: 0, False: 120k]
  ------------------
  101|   120k|      return SPV_SPIRV_VERSION_WORD(1, 0);
  ------------------
  |  |   26|   120k|  ((uint32_t(uint8_t(MAJOR)) << 16) | (uint32_t(uint8_t(MINOR)) << 8))
  ------------------
  102|      0|    case SPV_ENV_UNIVERSAL_1_1:
  ------------------
  |  Branch (102:5): [True: 0, False: 120k]
  ------------------
  103|      0|      return SPV_SPIRV_VERSION_WORD(1, 1);
  ------------------
  |  |   26|      0|  ((uint32_t(uint8_t(MAJOR)) << 16) | (uint32_t(uint8_t(MINOR)) << 8))
  ------------------
  104|      0|    case SPV_ENV_UNIVERSAL_1_2:
  ------------------
  |  Branch (104:5): [True: 0, False: 120k]
  ------------------
  105|      0|    case SPV_ENV_OPENCL_2_2:
  ------------------
  |  Branch (105:5): [True: 0, False: 120k]
  ------------------
  106|      0|    case SPV_ENV_OPENCL_EMBEDDED_2_2:
  ------------------
  |  Branch (106:5): [True: 0, False: 120k]
  ------------------
  107|      0|      return SPV_SPIRV_VERSION_WORD(1, 2);
  ------------------
  |  |   26|      0|  ((uint32_t(uint8_t(MAJOR)) << 16) | (uint32_t(uint8_t(MINOR)) << 8))
  ------------------
  108|      0|    case SPV_ENV_UNIVERSAL_1_3:
  ------------------
  |  Branch (108:5): [True: 0, False: 120k]
  ------------------
  109|      0|    case SPV_ENV_VULKAN_1_1:
  ------------------
  |  Branch (109:5): [True: 0, False: 120k]
  ------------------
  110|      0|      return SPV_SPIRV_VERSION_WORD(1, 3);
  ------------------
  |  |   26|      0|  ((uint32_t(uint8_t(MAJOR)) << 16) | (uint32_t(uint8_t(MINOR)) << 8))
  ------------------
  111|      0|    case SPV_ENV_WEBGPU_0:
  ------------------
  |  Branch (111:5): [True: 0, False: 120k]
  ------------------
  112|      0|      assert(false && "Deprecated target environment value.");
  113|      0|      break;
  114|      0|    case SPV_ENV_UNIVERSAL_1_4:
  ------------------
  |  Branch (114:5): [True: 0, False: 120k]
  ------------------
  115|      0|    case SPV_ENV_VULKAN_1_1_SPIRV_1_4:
  ------------------
  |  Branch (115:5): [True: 0, False: 120k]
  ------------------
  116|      0|      return SPV_SPIRV_VERSION_WORD(1, 4);
  ------------------
  |  |   26|      0|  ((uint32_t(uint8_t(MAJOR)) << 16) | (uint32_t(uint8_t(MINOR)) << 8))
  ------------------
  117|      0|    case SPV_ENV_UNIVERSAL_1_5:
  ------------------
  |  Branch (117:5): [True: 0, False: 120k]
  ------------------
  118|      0|    case SPV_ENV_VULKAN_1_2:
  ------------------
  |  Branch (118:5): [True: 0, False: 120k]
  ------------------
  119|      0|      return SPV_SPIRV_VERSION_WORD(1, 5);
  ------------------
  |  |   26|      0|  ((uint32_t(uint8_t(MAJOR)) << 16) | (uint32_t(uint8_t(MINOR)) << 8))
  ------------------
  120|      0|    case SPV_ENV_UNIVERSAL_1_6:
  ------------------
  |  Branch (120:5): [True: 0, False: 120k]
  ------------------
  121|      0|    case SPV_ENV_VULKAN_1_3:
  ------------------
  |  Branch (121:5): [True: 0, False: 120k]
  ------------------
  122|      0|      return SPV_SPIRV_VERSION_WORD(1, 6);
  ------------------
  |  |   26|      0|  ((uint32_t(uint8_t(MAJOR)) << 16) | (uint32_t(uint8_t(MINOR)) << 8))
  ------------------
  123|      0|    case SPV_ENV_MAX:
  ------------------
  |  Branch (123:5): [True: 0, False: 120k]
  ------------------
  124|      0|      assert(false && "Invalid target environment value.");
  125|      0|      break;
  126|   120k|  }
  127|      0|  return SPV_SPIRV_VERSION_WORD(0, 0);
  ------------------
  |  |   26|      0|  ((uint32_t(uint8_t(MAJOR)) << 16) | (uint32_t(uint8_t(MINOR)) << 8))
  ------------------
  128|   120k|}
_Z13spvIsValidEnv14spv_target_env:
  320|  3.92k|bool spvIsValidEnv(spv_target_env env) {
  321|  3.92k|  switch (env) {
  ------------------
  |  Branch (321:11): [True: 0, False: 3.92k]
  ------------------
  322|      0|    case SPV_ENV_UNIVERSAL_1_0:
  ------------------
  |  Branch (322:5): [True: 0, False: 3.92k]
  ------------------
  323|      0|    case SPV_ENV_VULKAN_1_0:
  ------------------
  |  Branch (323:5): [True: 0, False: 3.92k]
  ------------------
  324|      0|    case SPV_ENV_UNIVERSAL_1_1:
  ------------------
  |  Branch (324:5): [True: 0, False: 3.92k]
  ------------------
  325|      0|    case SPV_ENV_UNIVERSAL_1_2:
  ------------------
  |  Branch (325:5): [True: 0, False: 3.92k]
  ------------------
  326|      0|    case SPV_ENV_UNIVERSAL_1_3:
  ------------------
  |  Branch (326:5): [True: 0, False: 3.92k]
  ------------------
  327|      0|    case SPV_ENV_VULKAN_1_1:
  ------------------
  |  Branch (327:5): [True: 0, False: 3.92k]
  ------------------
  328|      0|    case SPV_ENV_OPENCL_1_2:
  ------------------
  |  Branch (328:5): [True: 0, False: 3.92k]
  ------------------
  329|      0|    case SPV_ENV_OPENCL_EMBEDDED_1_2:
  ------------------
  |  Branch (329:5): [True: 0, False: 3.92k]
  ------------------
  330|      0|    case SPV_ENV_OPENCL_2_0:
  ------------------
  |  Branch (330:5): [True: 0, False: 3.92k]
  ------------------
  331|      0|    case SPV_ENV_OPENCL_EMBEDDED_2_0:
  ------------------
  |  Branch (331:5): [True: 0, False: 3.92k]
  ------------------
  332|      0|    case SPV_ENV_OPENCL_EMBEDDED_2_1:
  ------------------
  |  Branch (332:5): [True: 0, False: 3.92k]
  ------------------
  333|      0|    case SPV_ENV_OPENCL_EMBEDDED_2_2:
  ------------------
  |  Branch (333:5): [True: 0, False: 3.92k]
  ------------------
  334|      0|    case SPV_ENV_OPENCL_2_1:
  ------------------
  |  Branch (334:5): [True: 0, False: 3.92k]
  ------------------
  335|      0|    case SPV_ENV_OPENCL_2_2:
  ------------------
  |  Branch (335:5): [True: 0, False: 3.92k]
  ------------------
  336|      0|    case SPV_ENV_UNIVERSAL_1_4:
  ------------------
  |  Branch (336:5): [True: 0, False: 3.92k]
  ------------------
  337|      0|    case SPV_ENV_VULKAN_1_1_SPIRV_1_4:
  ------------------
  |  Branch (337:5): [True: 0, False: 3.92k]
  ------------------
  338|      0|    case SPV_ENV_UNIVERSAL_1_5:
  ------------------
  |  Branch (338:5): [True: 0, False: 3.92k]
  ------------------
  339|      0|    case SPV_ENV_VULKAN_1_2:
  ------------------
  |  Branch (339:5): [True: 0, False: 3.92k]
  ------------------
  340|      0|    case SPV_ENV_UNIVERSAL_1_6:
  ------------------
  |  Branch (340:5): [True: 0, False: 3.92k]
  ------------------
  341|      0|    case SPV_ENV_VULKAN_1_3:
  ------------------
  |  Branch (341:5): [True: 0, False: 3.92k]
  ------------------
  342|      0|    case SPV_ENV_OPENGL_4_0:
  ------------------
  |  Branch (342:5): [True: 0, False: 3.92k]
  ------------------
  343|  3.92k|    case SPV_ENV_OPENGL_4_1:
  ------------------
  |  Branch (343:5): [True: 3.92k, False: 0]
  ------------------
  344|  3.92k|    case SPV_ENV_OPENGL_4_2:
  ------------------
  |  Branch (344:5): [True: 0, False: 3.92k]
  ------------------
  345|  3.92k|    case SPV_ENV_OPENGL_4_3:
  ------------------
  |  Branch (345:5): [True: 0, False: 3.92k]
  ------------------
  346|  3.92k|    case SPV_ENV_OPENGL_4_5:
  ------------------
  |  Branch (346:5): [True: 0, False: 3.92k]
  ------------------
  347|  3.92k|      return true;
  348|      0|    case SPV_ENV_WEBGPU_0:
  ------------------
  |  Branch (348:5): [True: 0, False: 3.92k]
  ------------------
  349|      0|    case SPV_ENV_MAX:
  ------------------
  |  Branch (349:5): [True: 0, False: 3.92k]
  ------------------
  350|      0|      break;
  351|  3.92k|  }
  352|      0|  return false;
  353|  3.92k|}

spvContextCreate:
   19|  3.92k|spv_context spvContextCreate(spv_target_env env) {
   20|  3.92k|  switch (env) {
   21|      0|    case SPV_ENV_UNIVERSAL_1_0:
  ------------------
  |  Branch (21:5): [True: 0, False: 3.92k]
  ------------------
   22|      0|    case SPV_ENV_VULKAN_1_0:
  ------------------
  |  Branch (22:5): [True: 0, False: 3.92k]
  ------------------
   23|      0|    case SPV_ENV_UNIVERSAL_1_1:
  ------------------
  |  Branch (23:5): [True: 0, False: 3.92k]
  ------------------
   24|      0|    case SPV_ENV_OPENCL_1_2:
  ------------------
  |  Branch (24:5): [True: 0, False: 3.92k]
  ------------------
   25|      0|    case SPV_ENV_OPENCL_EMBEDDED_1_2:
  ------------------
  |  Branch (25:5): [True: 0, False: 3.92k]
  ------------------
   26|      0|    case SPV_ENV_OPENCL_2_0:
  ------------------
  |  Branch (26:5): [True: 0, False: 3.92k]
  ------------------
   27|      0|    case SPV_ENV_OPENCL_EMBEDDED_2_0:
  ------------------
  |  Branch (27:5): [True: 0, False: 3.92k]
  ------------------
   28|      0|    case SPV_ENV_OPENCL_2_1:
  ------------------
  |  Branch (28:5): [True: 0, False: 3.92k]
  ------------------
   29|      0|    case SPV_ENV_OPENCL_EMBEDDED_2_1:
  ------------------
  |  Branch (29:5): [True: 0, False: 3.92k]
  ------------------
   30|      0|    case SPV_ENV_OPENCL_2_2:
  ------------------
  |  Branch (30:5): [True: 0, False: 3.92k]
  ------------------
   31|      0|    case SPV_ENV_OPENCL_EMBEDDED_2_2:
  ------------------
  |  Branch (31:5): [True: 0, False: 3.92k]
  ------------------
   32|      0|    case SPV_ENV_OPENGL_4_0:
  ------------------
  |  Branch (32:5): [True: 0, False: 3.92k]
  ------------------
   33|  3.92k|    case SPV_ENV_OPENGL_4_1:
  ------------------
  |  Branch (33:5): [True: 3.92k, False: 0]
  ------------------
   34|  3.92k|    case SPV_ENV_OPENGL_4_2:
  ------------------
  |  Branch (34:5): [True: 0, False: 3.92k]
  ------------------
   35|  3.92k|    case SPV_ENV_OPENGL_4_3:
  ------------------
  |  Branch (35:5): [True: 0, False: 3.92k]
  ------------------
   36|  3.92k|    case SPV_ENV_OPENGL_4_5:
  ------------------
  |  Branch (36:5): [True: 0, False: 3.92k]
  ------------------
   37|  3.92k|    case SPV_ENV_UNIVERSAL_1_2:
  ------------------
  |  Branch (37:5): [True: 0, False: 3.92k]
  ------------------
   38|  3.92k|    case SPV_ENV_UNIVERSAL_1_3:
  ------------------
  |  Branch (38:5): [True: 0, False: 3.92k]
  ------------------
   39|  3.92k|    case SPV_ENV_VULKAN_1_1:
  ------------------
  |  Branch (39:5): [True: 0, False: 3.92k]
  ------------------
   40|  3.92k|    case SPV_ENV_VULKAN_1_1_SPIRV_1_4:
  ------------------
  |  Branch (40:5): [True: 0, False: 3.92k]
  ------------------
   41|  3.92k|    case SPV_ENV_UNIVERSAL_1_4:
  ------------------
  |  Branch (41:5): [True: 0, False: 3.92k]
  ------------------
   42|  3.92k|    case SPV_ENV_UNIVERSAL_1_5:
  ------------------
  |  Branch (42:5): [True: 0, False: 3.92k]
  ------------------
   43|  3.92k|    case SPV_ENV_VULKAN_1_2:
  ------------------
  |  Branch (43:5): [True: 0, False: 3.92k]
  ------------------
   44|  3.92k|    case SPV_ENV_UNIVERSAL_1_6:
  ------------------
  |  Branch (44:5): [True: 0, False: 3.92k]
  ------------------
   45|  3.92k|    case SPV_ENV_VULKAN_1_3:
  ------------------
  |  Branch (45:5): [True: 0, False: 3.92k]
  ------------------
   46|  3.92k|      break;
   47|      0|    default:
  ------------------
  |  Branch (47:5): [True: 0, False: 3.92k]
  ------------------
   48|      0|      return nullptr;
   49|  3.92k|  }
   50|       |
   51|  3.92k|  spv_opcode_table opcode_table;
   52|  3.92k|  spv_operand_table operand_table;
   53|  3.92k|  spv_ext_inst_table ext_inst_table;
   54|       |
   55|  3.92k|  spvOpcodeTableGet(&opcode_table, env);
   56|  3.92k|  spvOperandTableGet(&operand_table, env);
   57|  3.92k|  spvExtInstTableGet(&ext_inst_table, env);
   58|       |
   59|  3.92k|  return new spv_context_t{env, opcode_table, operand_table, ext_inst_table,
   60|  3.92k|                           nullptr /* a null default consumer */};
   61|  3.92k|}
spvContextDestroy:
   63|  3.92k|void spvContextDestroy(spv_context context) { delete context; }

_ZN8spvtools5utils10MakeStringEPKjmb:
  119|  11.6k|                              bool assert_found_terminating_null = true) {
  120|  11.6k|  return MakeString(words, words + num_words, assert_found_terminating_null);
  121|  11.6k|}
_ZN8spvtools5utils10MakeStringIPKjEENSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEET_SB_b:
   84|  11.6k|                              bool assert_found_terminating_null = true) {
   85|  11.6k|  std::string result;
   86|  11.6k|  constexpr size_t kCharsPerWord = sizeof(*first);
   87|  11.6k|  static_assert(kCharsPerWord == 4, "expect 4-byte word");
   88|       |
   89|  2.64M|  for (InputIt pos = first; pos != last; ++pos) {
  ------------------
  |  Branch (89:29): [True: 2.64M, False: 19]
  ------------------
   90|  2.64M|    uint32_t word = *pos;
   91|  13.1M|    for (size_t byte_index = 0; byte_index < kCharsPerWord; byte_index++) {
  ------------------
  |  Branch (91:33): [True: 10.5M, False: 2.62M]
  ------------------
   92|  10.5M|      uint32_t extracted_word = (word >> (8 * byte_index)) & 0xFF;
   93|  10.5M|      char c = static_cast<char>(extracted_word);
   94|  10.5M|      if (c == 0) {
  ------------------
  |  Branch (94:11): [True: 11.5k, False: 10.5M]
  ------------------
   95|  11.5k|        return result;
   96|  11.5k|      }
   97|  10.5M|      result += c;
   98|  10.5M|    }
   99|  2.64M|  }
  100|     19|  assert(!assert_found_terminating_null &&
  101|     19|         "Did not find terminating null for the string.");
  102|      0|  (void)assert_found_terminating_null; /* No unused parameters in release
  103|       |                                          builds. */
  104|     19|  return result;
  105|  11.6k|}

_ZN8spvtools7fuzzers15RandomGeneratorC2Em:
   84|  3.92k|RandomGenerator::RandomGenerator(uint64_t seed) : engine_(seed) {}
_ZN8spvtools7fuzzers15RandomGeneratorC2EPKhm:
   86|  3.92k|RandomGenerator::RandomGenerator(const uint8_t* data, size_t size) {
   87|  3.92k|  RandomGenerator(RandomGenerator::CalculateSeed(data, size));
   88|  3.92k|}
_ZN8spvtools7fuzzers15RandomGenerator12GetTargetEnvEv:
   90|  3.92k|spv_target_env RandomGenerator::GetTargetEnv() {
   91|  3.92k|  spv_target_env result;
   92|       |
   93|       |  // Need to check that the generated value isn't for a deprecated target env.
   94|  3.92k|  do {
   95|  3.92k|    result = static_cast<spv_target_env>(
   96|  3.92k|        RandomUInt(&engine_, 0u, static_cast<unsigned int>(SPV_ENV_MAX)));
   97|  3.92k|  } while (!spvIsValidEnv(result));
  ------------------
  |  Branch (97:12): [True: 0, False: 3.92k]
  ------------------
   98|       |
   99|  3.92k|  return result;
  100|  3.92k|}
_ZN8spvtools7fuzzers15RandomGenerator13CalculateSeedEPKhm:
  111|  3.92k|uint64_t RandomGenerator::CalculateSeed(const uint8_t* data, size_t size) {
  112|  3.92k|  assert(data != nullptr && "|data| must be !nullptr");
  113|       |
  114|       |  // Number of bytes we want to skip at the start of data for the hash.
  115|       |  // Fewer bytes may be skipped when `size` is small.
  116|       |  // Has lower precedence than kHashDesiredMinBytes.
  117|      0|  static const int64_t kHashDesiredLeadingSkipBytes = 5;
  118|       |  // Minimum number of bytes we want to use in the hash.
  119|       |  // Used for short buffers.
  120|  3.92k|  static const int64_t kHashDesiredMinBytes = 4;
  121|       |  // Maximum number of bytes we want to use in the hash.
  122|  3.92k|  static const int64_t kHashDesiredMaxBytes = 32;
  123|  3.92k|  int64_t size_i64 = static_cast<int64_t>(size);
  124|  3.92k|  int64_t hash_begin_i64 =
  125|  3.92k|      std::min(kHashDesiredLeadingSkipBytes,
  126|  3.92k|               std::max<int64_t>(size_i64 - kHashDesiredMinBytes, 0));
  127|  3.92k|  int64_t hash_end_i64 =
  128|  3.92k|      std::min(hash_begin_i64 + kHashDesiredMaxBytes, size_i64);
  129|  3.92k|  size_t hash_begin = static_cast<size_t>(hash_begin_i64);
  130|  3.92k|  size_t hash_size = static_cast<size_t>(hash_end_i64) - hash_begin;
  131|  3.92k|  return HashBuffer(data + hash_begin, hash_size);
  132|  3.92k|}
random_generator.cpp:_ZN8spvtools7fuzzers12_GLOBAL__N_110HashBufferEPKhm:
   72|  3.92k|size_t HashBuffer(const uint8_t* data, const size_t size) {
   73|  3.92k|  size_t hash =
   74|  3.92k|      static_cast<size_t>(0xCA8945571519E991);  // seed with an arbitrary prime
   75|  3.92k|  HashCombine(&hash, size);
   76|   121k|  for (size_t i = 0; i < size; i++) {
  ------------------
  |  Branch (76:22): [True: 117k, False: 3.92k]
  ------------------
   77|   117k|    HashCombine(&hash, data[i]);
   78|   117k|  }
   79|  3.92k|  return hash;
   80|  3.92k|}
random_generator.cpp:_ZN8spvtools7fuzzers12_GLOBAL__N_111HashCombineImEEvPmRKT_:
   63|  3.92k|void HashCombine(size_t* hash, const T& value) {
   64|  3.92k|  constexpr size_t offset = HashCombineOffset<sizeof(size_t)>::value();
   65|  3.92k|  *hash ^= std::hash<T>()(value) + offset + (*hash << 6) + (*hash >> 2);
   66|  3.92k|}
random_generator.cpp:_ZN8spvtools7fuzzers12_GLOBAL__N_111HashCombineIhEEvPmRKT_:
   63|   117k|void HashCombine(size_t* hash, const T& value) {
   64|   117k|  constexpr size_t offset = HashCombineOffset<sizeof(size_t)>::value();
   65|   117k|  *hash ^= std::hash<T>()(value) + offset + (*hash << 6) + (*hash >> 2);
   66|   117k|}
random_generator.cpp:_ZN8spvtools7fuzzers12_GLOBAL__N_110RandomUIntIjEET_PNSt3__123mersenne_twister_engineImLm64ELm312ELm156ELm31ELm13043109905998158313ELm29ELm6148914691236517205ELm17ELm8202884508482404352ELm37ELm18444473444759240704ELm43ELm6364136223846793005EEES3_S3_:
   32|  3.92k|I RandomUInt(std::mt19937_64* engine, I lower, I upper) {
   33|  3.92k|  assert(lower < upper && "|lower| must be stictly less than |upper|");
   34|      0|  return std::uniform_int_distribution<I>(lower, upper - 1)(*engine);
   35|  3.92k|}

_ZN8spvtools7fuzzers15RandomGeneratorD2Ev:
   38|  7.85k|  ~RandomGenerator() {}

LLVMFuzzerTestOneInput:
   21|  3.92k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   22|  3.92k|  if (size < 1) {
  ------------------
  |  Branch (22:7): [True: 0, False: 3.92k]
  ------------------
   23|      0|    return 0;
   24|      0|  }
   25|       |
   26|  3.92k|  spvtools::fuzzers::RandomGenerator random_gen(data, size);
   27|  3.92k|  const spv_context context = spvContextCreate(random_gen.GetTargetEnv());
   28|  3.92k|  if (context == nullptr) {
  ------------------
  |  Branch (28:7): [True: 0, False: 3.92k]
  ------------------
   29|      0|    return 0;
   30|      0|  }
   31|       |
   32|  3.92k|  std::vector<uint32_t> input;
   33|  3.92k|  input.resize(size >> 2);
   34|       |
   35|  3.92k|  size_t count = 0;
   36|  11.3M|  for (size_t i = 0; (i + 3) < size; i += 4) {
  ------------------
  |  Branch (36:22): [True: 11.3M, False: 3.92k]
  ------------------
   37|  11.3M|    input[count++] = data[i] | (data[i + 1] << 8) | (data[i + 2] << 16) |
   38|  11.3M|                     (data[i + 3]) << 24;
   39|  11.3M|  }
   40|       |
   41|  3.92k|  spvBinaryParse(context, nullptr, input.data(), input.size(), nullptr, nullptr,
   42|  3.92k|                 nullptr);
   43|       |
   44|  3.92k|  spvContextDestroy(context);
   45|  3.92k|  return 0;
   46|  3.92k|}

