_Z14limited_mallocm:
   12|  65.2M|void *limited_malloc(size_t size) {
   13|  65.2M|    if (size + allocated_mem > kMemoryLimit) {
  ------------------
  |  Branch (13:9): [True: 58, False: 65.2M]
  ------------------
   14|     58|        return nullptr;
   15|     58|    }
   16|  65.2M|    if (size == 0) {
  ------------------
  |  Branch (16:9): [True: 68, False: 65.2M]
  ------------------
   17|     68|        return nullptr;
   18|     68|    }
   19|  65.2M|    void* m = malloc(size);
   20|  65.2M|    if (m != nullptr) {
  ------------------
  |  Branch (20:9): [True: 65.2M, False: 0]
  ------------------
   21|  65.2M|        allocated_mem += size;
   22|  65.2M|        allocated_len_map[m] = size;
   23|  65.2M|    }
   24|  65.2M|    return m;
   25|  65.2M|}
_Z12limited_freePv:
   27|  65.8M|void limited_free(void *ptr) {
   28|  65.8M|    if (ptr != NULL && allocated_len_map.find(ptr) == allocated_len_map.end()) {
  ------------------
  |  Branch (28:9): [True: 65.2M, False: 580k]
  |  Branch (28:9): [True: 0, False: 65.8M]
  |  Branch (28:24): [True: 0, False: 65.2M]
  ------------------
   29|      0|        abort();
   30|      0|    }
   31|  65.8M|    free(ptr);
   32|  65.8M|    if (ptr != NULL) {
  ------------------
  |  Branch (32:9): [True: 65.2M, False: 580k]
  ------------------
   33|  65.2M|        allocated_mem -= allocated_len_map[ptr];
   34|  65.2M|        allocated_len_map.erase(ptr);
   35|  65.2M|    }
   36|  65.8M|}
_Z15limited_reallocPvm:
   38|  1.80M|void *limited_realloc(void *ptr, size_t size) {
   39|  1.80M|    if (ptr != NULL && allocated_len_map.find(ptr) == allocated_len_map.end()) {
  ------------------
  |  Branch (39:9): [True: 1.16M, False: 634k]
  |  Branch (39:9): [True: 0, False: 1.80M]
  |  Branch (39:24): [True: 0, False: 1.16M]
  ------------------
   40|      0|        abort();
   41|      0|    }
   42|  1.80M|    if (ptr == NULL) {
  ------------------
  |  Branch (42:9): [True: 634k, False: 1.16M]
  ------------------
   43|   634k|        return limited_malloc(size);
   44|   634k|    }
   45|  1.16M|    long delta = (long) size - allocated_len_map[ptr];
   46|  1.16M|    if (delta + allocated_mem > kMemoryLimit) {
  ------------------
  |  Branch (46:9): [True: 1, False: 1.16M]
  ------------------
   47|      1|        return nullptr;
   48|      1|    }
   49|  1.16M|    void* new_ptr = realloc(ptr, size);
   50|  1.16M|    if (size > 0 && new_ptr == nullptr) {
  ------------------
  |  Branch (50:9): [True: 1.16M, False: 0]
  |  Branch (50:21): [True: 0, False: 1.16M]
  ------------------
   51|      0|        return nullptr;
   52|      0|    }
   53|  1.16M|    allocated_mem += delta;
   54|  1.16M|    allocated_len_map.erase(ptr);
   55|  1.16M|    if (size > 0) {
  ------------------
  |  Branch (55:9): [True: 1.16M, False: 0]
  ------------------
   56|  1.16M|        allocated_len_map[new_ptr] = size;
   57|  1.16M|    }
   58|  1.16M|    return new_ptr;
   59|  1.16M|}
LLVMFuzzerTestOneInput:
   71|  3.44k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
   72|  3.44k|    cbor_load_result result;
   73|  3.44k|    cbor_item_t *item = cbor_load(Data, Size, &result);
   74|  3.44k|    if (result.error.code == CBOR_ERR_NONE) {
  ------------------
  |  Branch (74:9): [True: 1.07k, False: 2.36k]
  ------------------
   75|  1.07k|        cbor_describe(item, kState.fout);
   76|  1.07k|        unsigned char *buffer;
   77|  1.07k|        size_t buffer_size;
   78|  1.07k|        cbor_serialize_alloc(item, &buffer, &buffer_size);
   79|  1.07k|        free(buffer);
   80|  1.07k|        cbor_item_t *copied = cbor_copy(item);
   81|  1.07k|        cbor_decref(&copied);
   82|  1.07k|        cbor_decref(&item);
   83|  1.07k|    }
   84|  3.44k|    return 0;
   85|  3.44k|}
_ZN5StateC2Ev:
   64|      2|    State() : fout(fopen("/dev/null", "w")) {
   65|      2|        cbor_set_allocs(limited_malloc, limited_realloc, limited_free);
   66|      2|    }

cbor_set_allocs:
   15|      2|                     _cbor_realloc_t custom_realloc, _cbor_free_t custom_free) {
   16|      2|  _cbor_malloc = custom_malloc;
   17|      2|  _cbor_realloc = custom_realloc;
   18|      2|  _cbor_free = custom_free;
   19|      2|}

cbor_load:
   17|  3.44k|                       struct cbor_load_result* result) {
   18|       |  /* Context stack */
   19|  3.44k|  static struct cbor_callbacks callbacks = {
   20|  3.44k|      .uint8 = &cbor_builder_uint8_callback,
   21|  3.44k|      .uint16 = &cbor_builder_uint16_callback,
   22|  3.44k|      .uint32 = &cbor_builder_uint32_callback,
   23|  3.44k|      .uint64 = &cbor_builder_uint64_callback,
   24|       |
   25|  3.44k|      .negint8 = &cbor_builder_negint8_callback,
   26|  3.44k|      .negint16 = &cbor_builder_negint16_callback,
   27|  3.44k|      .negint32 = &cbor_builder_negint32_callback,
   28|  3.44k|      .negint64 = &cbor_builder_negint64_callback,
   29|       |
   30|  3.44k|      .byte_string = &cbor_builder_byte_string_callback,
   31|  3.44k|      .byte_string_start = &cbor_builder_byte_string_start_callback,
   32|       |
   33|  3.44k|      .string = &cbor_builder_string_callback,
   34|  3.44k|      .string_start = &cbor_builder_string_start_callback,
   35|       |
   36|  3.44k|      .array_start = &cbor_builder_array_start_callback,
   37|  3.44k|      .indef_array_start = &cbor_builder_indef_array_start_callback,
   38|       |
   39|  3.44k|      .map_start = &cbor_builder_map_start_callback,
   40|  3.44k|      .indef_map_start = &cbor_builder_indef_map_start_callback,
   41|       |
   42|  3.44k|      .tag = &cbor_builder_tag_callback,
   43|       |
   44|  3.44k|      .null = &cbor_builder_null_callback,
   45|  3.44k|      .undefined = &cbor_builder_undefined_callback,
   46|  3.44k|      .boolean = &cbor_builder_boolean_callback,
   47|  3.44k|      .float2 = &cbor_builder_float2_callback,
   48|  3.44k|      .float4 = &cbor_builder_float4_callback,
   49|  3.44k|      .float8 = &cbor_builder_float8_callback,
   50|  3.44k|      .indef_break = &cbor_builder_indef_break_callback};
   51|       |
   52|  3.44k|  if (source_size == 0) {
  ------------------
  |  Branch (52:7): [True: 0, False: 3.44k]
  ------------------
   53|      0|    result->error.code = CBOR_ERR_NODATA;
   54|      0|    return NULL;
   55|      0|  }
   56|  3.44k|  struct _cbor_stack stack = _cbor_stack_init();
   57|       |
   58|       |  /* Target for callbacks */
   59|  3.44k|  struct _cbor_decoder_context context = (struct _cbor_decoder_context){
   60|  3.44k|      .stack = &stack, .creation_failed = false, .syntax_error = false};
   61|  3.44k|  struct cbor_decoder_result decode_result;
   62|  3.44k|  *result =
   63|  3.44k|      (struct cbor_load_result){.read = 0, .error = {.code = CBOR_ERR_NONE}};
   64|       |
   65|  25.9M|  do {
   66|  25.9M|    if (source_size > result->read) { /* Check for overflows */
  ------------------
  |  Branch (66:9): [True: 25.9M, False: 1.37k]
  ------------------
   67|  25.9M|      decode_result =
   68|  25.9M|          cbor_stream_decode(source + result->read, source_size - result->read,
   69|  25.9M|                             &callbacks, &context);
   70|  25.9M|    } else {
   71|  1.37k|      result->error = (struct cbor_error){.code = CBOR_ERR_NOTENOUGHDATA,
   72|  1.37k|                                          .position = result->read};
   73|  1.37k|      goto error;
   74|  1.37k|    }
   75|       |
   76|  25.9M|    switch (decode_result.status) {
  ------------------
  |  Branch (76:13): [True: 25.9M, False: 0]
  ------------------
   77|  25.9M|      case CBOR_DECODER_FINISHED:
  ------------------
  |  Branch (77:7): [True: 25.9M, False: 631]
  ------------------
   78|       |        /* Everything OK */
   79|  25.9M|        {
   80|  25.9M|          result->read += decode_result.read;
   81|  25.9M|          break;
   82|      0|        }
   83|    552|      case CBOR_DECODER_NEDATA:
  ------------------
  |  Branch (83:7): [True: 552, False: 25.9M]
  ------------------
   84|       |        /* Not enough data to complete the current item */
   85|    552|        {
   86|    552|          result->error.code = CBOR_ERR_NOTENOUGHDATA;
   87|    552|          goto error;
   88|      0|        }
   89|     79|      case CBOR_DECODER_ERROR:
  ------------------
  |  Branch (89:7): [True: 79, False: 25.9M]
  ------------------
   90|       |        /* Reserved/malformed item */
   91|     79|        {
   92|     79|          result->error.code = CBOR_ERR_MALFORMATED;
   93|     79|          goto error;
   94|      0|        }
   95|  25.9M|    }
   96|       |
   97|  25.9M|    if (context.creation_failed) {
  ------------------
  |  Branch (97:9): [True: 263, False: 25.9M]
  ------------------
   98|       |      /* Most likely unsuccessful allocation - our callback has failed */
   99|    263|      result->error.code = CBOR_ERR_MEMERROR;
  100|    263|      goto error;
  101|  25.9M|    } else if (context.syntax_error) {
  ------------------
  |  Branch (101:16): [True: 96, False: 25.9M]
  ------------------
  102|     96|      result->error.code = CBOR_ERR_SYNTAXERROR;
  103|     96|      goto error;
  104|     96|    }
  105|  25.9M|  } while (stack.size > 0);
  ------------------
  |  Branch (105:12): [True: 25.9M, False: 1.07k]
  ------------------
  106|       |
  107|  1.07k|  return context.root;
  108|       |
  109|  2.36k|error:
  110|  2.36k|  result->error.position = result->read;
  111|       |  // debug_print("Failed with decoder error %d at %d\n", result->error.code,
  112|       |  // result->error.position); cbor_describe(stack.top->item, stdout);
  113|       |  /* Free the stack */
  114|   128k|  while (stack.size > 0) {
  ------------------
  |  Branch (114:10): [True: 125k, False: 2.36k]
  ------------------
  115|   125k|    cbor_decref(&stack.top->item);
  116|   125k|    _cbor_stack_pop(&stack);
  117|   125k|  }
  118|       |  return NULL;
  119|  3.44k|}
cbor_copy:
  166|  12.2M|cbor_item_t* cbor_copy(cbor_item_t* item) {
  167|  12.2M|  CBOR_ASSERT_VALID_TYPE(cbor_typeof(item));
  ------------------
  |  |   82|  12.2M|  CBOR_ASSERT(item_type >= CBOR_TYPE_UINT && item_type <= CBOR_TYPE_FLOAT_CTRL);
  |  |  ------------------
  |  |  |  |   64|  12.2M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  |  |  ------------------
  ------------------
  |  Branch (167:3): [True: 12.2M, False: 0]
  |  Branch (167:3): [True: 12.2M, False: 0]
  |  Branch (167:3): [True: 0, False: 12.2M]
  ------------------
  168|  12.2M|  switch (cbor_typeof(item)) {
  169|  5.02M|    case CBOR_TYPE_UINT:
  ------------------
  |  Branch (169:5): [True: 5.02M, False: 7.18M]
  ------------------
  170|  5.02M|      return _cbor_copy_int(item, false);
  171|  1.54M|    case CBOR_TYPE_NEGINT:
  ------------------
  |  Branch (171:5): [True: 1.54M, False: 10.6M]
  ------------------
  172|  1.54M|      return _cbor_copy_int(item, true);
  173|   523k|    case CBOR_TYPE_BYTESTRING:
  ------------------
  |  Branch (173:5): [True: 523k, False: 11.6M]
  ------------------
  174|   523k|      if (cbor_bytestring_is_definite(item)) {
  ------------------
  |  Branch (174:11): [True: 522k, False: 875]
  ------------------
  175|   522k|        return cbor_build_bytestring(cbor_bytestring_handle(item),
  176|   522k|                                     cbor_bytestring_length(item));
  177|   522k|      } else {
  178|    875|        cbor_item_t* res = cbor_new_indefinite_bytestring();
  179|    875|        if (res == NULL) {
  ------------------
  |  Branch (179:13): [True: 0, False: 875]
  ------------------
  180|      0|          return NULL;
  181|      0|        }
  182|       |
  183|   480k|        for (size_t i = 0; i < cbor_bytestring_chunk_count(item); i++) {
  ------------------
  |  Branch (183:28): [True: 479k, False: 875]
  ------------------
  184|   479k|          cbor_item_t* chunk_copy =
  185|   479k|              cbor_copy(cbor_bytestring_chunks_handle(item)[i]);
  186|   479k|          if (chunk_copy == NULL) {
  ------------------
  |  Branch (186:15): [True: 0, False: 479k]
  ------------------
  187|      0|            cbor_decref(&res);
  188|      0|            return NULL;
  189|      0|          }
  190|   479k|          if (!cbor_bytestring_add_chunk(res, chunk_copy)) {
  ------------------
  |  Branch (190:15): [True: 0, False: 479k]
  ------------------
  191|      0|            cbor_decref(&chunk_copy);
  192|      0|            cbor_decref(&res);
  193|      0|            return NULL;
  194|      0|          }
  195|   479k|          cbor_decref(&chunk_copy);
  196|   479k|        }
  197|    875|        return res;
  198|    875|      }
  199|   457k|    case CBOR_TYPE_STRING:
  ------------------
  |  Branch (199:5): [True: 457k, False: 11.7M]
  ------------------
  200|   457k|      if (cbor_string_is_definite(item)) {
  ------------------
  |  Branch (200:11): [True: 454k, False: 2.24k]
  ------------------
  201|   454k|        return cbor_build_stringn((const char*)cbor_string_handle(item),
  202|   454k|                                  cbor_string_length(item));
  203|   454k|      } else {
  204|  2.24k|        cbor_item_t* res = cbor_new_indefinite_string();
  205|  2.24k|        if (res == NULL) {
  ------------------
  |  Branch (205:13): [True: 0, False: 2.24k]
  ------------------
  206|      0|          return NULL;
  207|      0|        }
  208|       |
  209|   261k|        for (size_t i = 0; i < cbor_string_chunk_count(item); i++) {
  ------------------
  |  Branch (209:28): [True: 259k, False: 2.24k]
  ------------------
  210|   259k|          cbor_item_t* chunk_copy =
  211|   259k|              cbor_copy(cbor_string_chunks_handle(item)[i]);
  212|   259k|          if (chunk_copy == NULL) {
  ------------------
  |  Branch (212:15): [True: 0, False: 259k]
  ------------------
  213|      0|            cbor_decref(&res);
  214|      0|            return NULL;
  215|      0|          }
  216|   259k|          if (!cbor_string_add_chunk(res, chunk_copy)) {
  ------------------
  |  Branch (216:15): [True: 0, False: 259k]
  ------------------
  217|      0|            cbor_decref(&chunk_copy);
  218|      0|            cbor_decref(&res);
  219|      0|            return NULL;
  220|      0|          }
  221|   259k|          cbor_decref(&chunk_copy);
  222|   259k|        }
  223|  2.24k|        return res;
  224|  2.24k|      }
  225|  4.16M|    case CBOR_TYPE_ARRAY: {
  ------------------
  |  Branch (225:5): [True: 4.16M, False: 8.04M]
  ------------------
  226|  4.16M|      cbor_item_t* res;
  227|  4.16M|      if (cbor_array_is_definite(item)) {
  ------------------
  |  Branch (227:11): [True: 3.92M, False: 241k]
  ------------------
  228|  3.92M|        res = cbor_new_definite_array(cbor_array_size(item));
  229|  3.92M|      } else {
  230|   241k|        res = cbor_new_indefinite_array();
  231|   241k|      }
  232|  4.16M|      if (res == NULL) {
  ------------------
  |  Branch (232:11): [True: 0, False: 4.16M]
  ------------------
  233|      0|        return NULL;
  234|      0|      }
  235|       |
  236|  13.8M|      for (size_t i = 0; i < cbor_array_size(item); i++) {
  ------------------
  |  Branch (236:26): [True: 9.66M, False: 4.16M]
  ------------------
  237|  9.66M|        cbor_item_t* entry_copy = cbor_copy(cbor_move(cbor_array_get(item, i)));
  238|  9.66M|        if (entry_copy == NULL) {
  ------------------
  |  Branch (238:13): [True: 0, False: 9.66M]
  ------------------
  239|      0|          cbor_decref(&res);
  240|      0|          return NULL;
  241|      0|        }
  242|  9.66M|        if (!cbor_array_push(res, entry_copy)) {
  ------------------
  |  Branch (242:13): [True: 0, False: 9.66M]
  ------------------
  243|      0|          cbor_decref(&entry_copy);
  244|      0|          cbor_decref(&res);
  245|      0|          return NULL;
  246|      0|        }
  247|  9.66M|        cbor_decref(&entry_copy);
  248|  9.66M|      }
  249|  4.16M|      return res;
  250|  4.16M|    }
  251|  34.3k|    case CBOR_TYPE_MAP: {
  ------------------
  |  Branch (251:5): [True: 34.3k, False: 12.1M]
  ------------------
  252|  34.3k|      cbor_item_t* res;
  253|  34.3k|      if (cbor_map_is_definite(item)) {
  ------------------
  |  Branch (253:11): [True: 32.5k, False: 1.83k]
  ------------------
  254|  32.5k|        res = cbor_new_definite_map(cbor_map_size(item));
  255|  32.5k|      } else {
  256|  1.83k|        res = cbor_new_indefinite_map();
  257|  1.83k|      }
  258|  34.3k|      if (res == NULL) {
  ------------------
  |  Branch (258:11): [True: 0, False: 34.3k]
  ------------------
  259|      0|        return NULL;
  260|      0|      }
  261|       |
  262|  34.3k|      struct cbor_pair* it = cbor_map_handle(item);
  263|   835k|      for (size_t i = 0; i < cbor_map_size(item); i++) {
  ------------------
  |  Branch (263:26): [True: 801k, False: 34.3k]
  ------------------
  264|   801k|        cbor_item_t* key_copy = cbor_copy(it[i].key);
  265|   801k|        if (key_copy == NULL) {
  ------------------
  |  Branch (265:13): [True: 0, False: 801k]
  ------------------
  266|      0|          cbor_decref(&res);
  267|      0|          return NULL;
  268|      0|        }
  269|   801k|        cbor_item_t* value_copy = cbor_copy(it[i].value);
  270|   801k|        if (value_copy == NULL) {
  ------------------
  |  Branch (270:13): [True: 0, False: 801k]
  ------------------
  271|      0|          cbor_decref(&res);
  272|      0|          cbor_decref(&key_copy);
  273|      0|          return NULL;
  274|      0|        }
  275|   801k|        if (!cbor_map_add(res, (struct cbor_pair){.key = key_copy,
  ------------------
  |  Branch (275:13): [True: 0, False: 801k]
  ------------------
  276|   801k|                                                  .value = value_copy})) {
  277|      0|          cbor_decref(&res);
  278|      0|          cbor_decref(&key_copy);
  279|      0|          cbor_decref(&value_copy);
  280|      0|          return NULL;
  281|      0|        }
  282|   801k|        cbor_decref(&key_copy);
  283|   801k|        cbor_decref(&value_copy);
  284|   801k|      }
  285|  34.3k|      return res;
  286|  34.3k|    }
  287|   213k|    case CBOR_TYPE_TAG: {
  ------------------
  |  Branch (287:5): [True: 213k, False: 12.0M]
  ------------------
  288|   213k|      cbor_item_t* item_copy = cbor_copy(cbor_move(cbor_tag_item(item)));
  289|   213k|      if (item_copy == NULL) {
  ------------------
  |  Branch (289:11): [True: 0, False: 213k]
  ------------------
  290|      0|        return NULL;
  291|      0|      }
  292|   213k|      cbor_item_t* tag = cbor_build_tag(cbor_tag_value(item), item_copy);
  293|   213k|      cbor_decref(&item_copy);
  294|   213k|      return tag;
  295|   213k|    }
  296|   248k|    case CBOR_TYPE_FLOAT_CTRL:
  ------------------
  |  Branch (296:5): [True: 248k, False: 11.9M]
  ------------------
  297|   248k|      return _cbor_copy_float_ctrl(item);
  298|      0|    default:  // LCOV_EXCL_START
  ------------------
  |  Branch (298:5): [True: 0, False: 12.2M]
  ------------------
  299|      0|      _CBOR_UNREACHABLE;
  ------------------
  |  |  111|      0|#define _CBOR_UNREACHABLE __builtin_unreachable()
  ------------------
  300|      0|      return NULL;  // LCOV_EXCL_STOP
  301|  12.2M|  }
  302|  12.2M|}
cbor_describe:
  583|  1.07k|void cbor_describe(cbor_item_t* item, FILE* out) {
  584|  1.07k|  _cbor_nested_describe(item, out, 0);
  585|  1.07k|}
cbor.c:_cbor_copy_int:
  121|  6.57M|static cbor_item_t* _cbor_copy_int(cbor_item_t* item, bool negative) {
  122|  6.57M|  CBOR_ASSERT(cbor_isa_uint(item) || cbor_isa_negint(item));
  ------------------
  |  |   64|  6.57M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (122:3): [True: 5.02M, False: 1.54M]
  |  Branch (122:3): [True: 1.54M, False: 0]
  |  Branch (122:3): [True: 0, False: 6.57M]
  ------------------
  123|  6.57M|  CBOR_ASSERT(cbor_int_get_width(item) >= CBOR_INT_8 &&
  ------------------
  |  |   64|  6.57M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (123:3): [True: 6.57M, False: 0]
  |  Branch (123:3): [True: 6.57M, False: 0]
  |  Branch (123:3): [True: 0, False: 6.57M]
  ------------------
  124|  6.57M|              cbor_int_get_width(item) <= CBOR_INT_64);
  125|  6.57M|  cbor_item_t* res = NULL;
  126|  6.57M|  switch (cbor_int_get_width(item)) {
  ------------------
  |  Branch (126:11): [True: 6.57M, False: 0]
  ------------------
  127|  6.32M|    case CBOR_INT_8:
  ------------------
  |  Branch (127:5): [True: 6.32M, False: 247k]
  ------------------
  128|  6.32M|      res = cbor_build_uint8(cbor_get_uint8(item));
  129|  6.32M|      break;
  130|  21.0k|    case CBOR_INT_16:
  ------------------
  |  Branch (130:5): [True: 21.0k, False: 6.55M]
  ------------------
  131|  21.0k|      res = cbor_build_uint16(cbor_get_uint16(item));
  132|  21.0k|      break;
  133|   213k|    case CBOR_INT_32:
  ------------------
  |  Branch (133:5): [True: 213k, False: 6.35M]
  ------------------
  134|   213k|      res = cbor_build_uint32(cbor_get_uint32(item));
  135|   213k|      break;
  136|  12.7k|    case CBOR_INT_64:
  ------------------
  |  Branch (136:5): [True: 12.7k, False: 6.55M]
  ------------------
  137|  12.7k|      res = cbor_build_uint64(cbor_get_uint64(item));
  138|  12.7k|      break;
  139|  6.57M|  }
  140|       |
  141|  6.57M|  if (res == NULL) return NULL;
  ------------------
  |  Branch (141:7): [True: 0, False: 6.57M]
  ------------------
  142|  6.57M|  if (negative) cbor_mark_negint(res);
  ------------------
  |  Branch (142:7): [True: 1.54M, False: 5.02M]
  ------------------
  143|       |
  144|  6.57M|  return res;
  145|  6.57M|}
cbor.c:_cbor_copy_float_ctrl:
  147|   248k|static cbor_item_t* _cbor_copy_float_ctrl(cbor_item_t* item) {
  148|   248k|  CBOR_ASSERT(cbor_isa_float_ctrl(item));
  ------------------
  |  |   64|   248k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (148:3): [True: 0, False: 248k]
  |  Branch (148:3): [True: 248k, False: 0]
  ------------------
  149|   248k|  CBOR_ASSERT(cbor_float_get_width(item) >= CBOR_FLOAT_0 &&
  ------------------
  |  |   64|   248k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (149:3): [True: 248k, False: 0]
  |  Branch (149:3): [True: 248k, False: 0]
  |  Branch (149:3): [True: 0, False: 248k]
  ------------------
  150|   248k|              cbor_float_get_width(item) <= CBOR_FLOAT_64);
  151|   248k|  switch (cbor_float_get_width(item)) {
  152|   186k|    case CBOR_FLOAT_0:
  ------------------
  |  Branch (152:5): [True: 186k, False: 61.6k]
  ------------------
  153|   186k|      return cbor_build_ctrl(cbor_ctrl_value(item));
  154|  38.1k|    case CBOR_FLOAT_16:
  ------------------
  |  Branch (154:5): [True: 38.1k, False: 210k]
  ------------------
  155|  38.1k|      return cbor_build_float2(cbor_float_get_float2(item));
  156|  9.11k|    case CBOR_FLOAT_32:
  ------------------
  |  Branch (156:5): [True: 9.11k, False: 239k]
  ------------------
  157|  9.11k|      return cbor_build_float4(cbor_float_get_float4(item));
  158|  14.3k|    case CBOR_FLOAT_64:
  ------------------
  |  Branch (158:5): [True: 14.3k, False: 233k]
  ------------------
  159|  14.3k|      return cbor_build_float8(cbor_float_get_float8(item));
  160|      0|    default:  // LCOV_EXCL_START
  ------------------
  |  Branch (160:5): [True: 0, False: 248k]
  ------------------
  161|      0|      _CBOR_UNREACHABLE;
  ------------------
  |  |  111|      0|#define _CBOR_UNREACHABLE __builtin_unreachable()
  ------------------
  162|      0|      return NULL;  // LCOV_EXCL_START
  163|   248k|  }
  164|   248k|}
cbor.c:_cbor_nested_describe:
  468|  12.2M|static void _cbor_nested_describe(cbor_item_t* item, FILE* out, int indent) {
  469|  12.2M|  CBOR_ASSERT(cbor_typeof(item) >= CBOR_TYPE_UINT &&
  ------------------
  |  |   64|  12.2M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (469:3): [True: 12.2M, False: 0]
  |  Branch (469:3): [True: 12.2M, False: 0]
  |  Branch (469:3): [True: 0, False: 12.2M]
  ------------------
  470|  12.2M|              cbor_typeof(item) <= CBOR_TYPE_FLOAT_CTRL);
  471|  12.2M|  const int indent_offset = 4;
  472|  12.2M|  switch (cbor_typeof(item)) {
  ------------------
  |  Branch (472:11): [True: 12.2M, False: 0]
  ------------------
  473|  5.02M|    case CBOR_TYPE_UINT: {
  ------------------
  |  Branch (473:5): [True: 5.02M, False: 7.18M]
  ------------------
  474|  5.02M|      _cbor_type_marquee(out, "CBOR_TYPE_UINT", indent);
  475|  5.02M|      fprintf(out, "Width: %dB, ", _pow(2, cbor_int_get_width(item)));
  476|  5.02M|      fprintf(out, "Value: %" PRIu64 "\n", cbor_get_int(item));
  477|  5.02M|      break;
  478|      0|    }
  479|  1.54M|    case CBOR_TYPE_NEGINT: {
  ------------------
  |  Branch (479:5): [True: 1.54M, False: 10.6M]
  ------------------
  480|  1.54M|      _cbor_type_marquee(out, "CBOR_TYPE_NEGINT", indent);
  481|  1.54M|      fprintf(out, "Width: %dB, ", _pow(2, cbor_int_get_width(item)));
  482|  1.54M|      fprintf(out, "Value: -%" PRIu64 " - 1\n", cbor_get_int(item));
  483|  1.54M|      break;
  484|      0|    }
  485|   523k|    case CBOR_TYPE_BYTESTRING: {
  ------------------
  |  Branch (485:5): [True: 523k, False: 11.6M]
  ------------------
  486|   523k|      _cbor_type_marquee(out, "CBOR_TYPE_BYTESTRING", indent);
  487|   523k|      if (cbor_bytestring_is_indefinite(item)) {
  ------------------
  |  Branch (487:11): [True: 875, False: 522k]
  ------------------
  488|    875|        fprintf(out, "Indefinite, Chunks: %zu, Chunk data:\n",
  489|    875|                cbor_bytestring_chunk_count(item));
  490|   480k|        for (size_t i = 0; i < cbor_bytestring_chunk_count(item); i++)
  ------------------
  |  Branch (490:28): [True: 479k, False: 875]
  ------------------
  491|   479k|          _cbor_nested_describe(cbor_bytestring_chunks_handle(item)[i], out,
  492|   479k|                                indent + indent_offset);
  493|   522k|      } else {
  494|   522k|        const unsigned char* data = cbor_bytestring_handle(item);
  495|   522k|        fprintf(out, "Definite, Length: %zuB, Data:\n",
  496|   522k|                cbor_bytestring_length(item));
  497|   522k|        fprintf(out, "%*s", indent + indent_offset, " ");
  498|  2.45M|        for (size_t i = 0; i < cbor_bytestring_length(item); i++)
  ------------------
  |  Branch (498:28): [True: 1.93M, False: 522k]
  ------------------
  499|  1.93M|          fprintf(out, "%02x", (int)(data[i] & 0xff));
  500|   522k|        fprintf(out, "\n");
  501|   522k|      }
  502|   523k|      break;
  503|      0|    }
  504|   457k|    case CBOR_TYPE_STRING: {
  ------------------
  |  Branch (504:5): [True: 457k, False: 11.7M]
  ------------------
  505|   457k|      _cbor_type_marquee(out, "CBOR_TYPE_STRING", indent);
  506|   457k|      if (cbor_string_is_indefinite(item)) {
  ------------------
  |  Branch (506:11): [True: 2.24k, False: 454k]
  ------------------
  507|  2.24k|        fprintf(out, "Indefinite, Chunks: %zu, Chunk data:\n",
  508|  2.24k|                cbor_string_chunk_count(item));
  509|   261k|        for (size_t i = 0; i < cbor_string_chunk_count(item); i++)
  ------------------
  |  Branch (509:28): [True: 259k, False: 2.24k]
  ------------------
  510|   259k|          _cbor_nested_describe(cbor_string_chunks_handle(item)[i], out,
  511|   259k|                                indent + indent_offset);
  512|   454k|      } else {
  513|   454k|        fprintf(out, "Definite, Length: %zuB, Codepoints: %zu, Data:\n",
  514|   454k|                cbor_string_length(item), cbor_string_codepoint_count(item));
  515|   454k|        fprintf(out, "%*s", indent + indent_offset, " ");
  516|       |        // Note: The string is not escaped, whitespace and control character
  517|       |        // will be printed in verbatim and take effect.
  518|   454k|        fwrite(cbor_string_handle(item), sizeof(unsigned char),
  519|   454k|               cbor_string_length(item), out);
  520|   454k|        fprintf(out, "\n");
  521|   454k|      }
  522|   457k|      break;
  523|      0|    }
  524|  4.16M|    case CBOR_TYPE_ARRAY: {
  ------------------
  |  Branch (524:5): [True: 4.16M, False: 8.04M]
  ------------------
  525|  4.16M|      _cbor_type_marquee(out, "CBOR_TYPE_ARRAY", indent);
  526|  4.16M|      if (cbor_array_is_definite(item)) {
  ------------------
  |  Branch (526:11): [True: 3.92M, False: 241k]
  ------------------
  527|  3.92M|        fprintf(out, "Definite, Size: %zu, Contents:\n", cbor_array_size(item));
  528|  3.92M|      } else {
  529|   241k|        fprintf(out, "Indefinite, Size: %zu, Contents:\n",
  530|   241k|                cbor_array_size(item));
  531|   241k|      }
  532|       |
  533|  13.8M|      for (size_t i = 0; i < cbor_array_size(item); i++)
  ------------------
  |  Branch (533:26): [True: 9.66M, False: 4.16M]
  ------------------
  534|  9.66M|        _cbor_nested_describe(cbor_array_handle(item)[i], out,
  535|  9.66M|                              indent + indent_offset);
  536|  4.16M|      break;
  537|      0|    }
  538|  34.3k|    case CBOR_TYPE_MAP: {
  ------------------
  |  Branch (538:5): [True: 34.3k, False: 12.1M]
  ------------------
  539|  34.3k|      _cbor_type_marquee(out, "CBOR_TYPE_MAP", indent);
  540|  34.3k|      if (cbor_map_is_definite(item)) {
  ------------------
  |  Branch (540:11): [True: 32.5k, False: 1.83k]
  ------------------
  541|  32.5k|        fprintf(out, "Definite, Size: %zu, Contents:\n", cbor_map_size(item));
  542|  32.5k|      } else {
  543|  1.83k|        fprintf(out, "Indefinite, Size: %zu, Contents:\n", cbor_map_size(item));
  544|  1.83k|      }
  545|       |
  546|       |      // TODO: Label and group keys and values
  547|   835k|      for (size_t i = 0; i < cbor_map_size(item); i++) {
  ------------------
  |  Branch (547:26): [True: 801k, False: 34.3k]
  ------------------
  548|   801k|        fprintf(out, "%*sMap entry %zu\n", indent + indent_offset, " ", i);
  549|   801k|        _cbor_nested_describe(cbor_map_handle(item)[i].key, out,
  550|   801k|                              indent + 2 * indent_offset);
  551|   801k|        _cbor_nested_describe(cbor_map_handle(item)[i].value, out,
  552|   801k|                              indent + 2 * indent_offset);
  553|   801k|      }
  554|  34.3k|      break;
  555|      0|    }
  556|   213k|    case CBOR_TYPE_TAG: {
  ------------------
  |  Branch (556:5): [True: 213k, False: 12.0M]
  ------------------
  557|   213k|      _cbor_type_marquee(out, "CBOR_TYPE_TAG", indent);
  558|   213k|      fprintf(out, "Value: %" PRIu64 "\n", cbor_tag_value(item));
  559|   213k|      _cbor_nested_describe(cbor_move(cbor_tag_item(item)), out,
  560|   213k|                            indent + indent_offset);
  561|   213k|      break;
  562|      0|    }
  563|   248k|    case CBOR_TYPE_FLOAT_CTRL: {
  ------------------
  |  Branch (563:5): [True: 248k, False: 11.9M]
  ------------------
  564|   248k|      _cbor_type_marquee(out, "CBOR_TYPE_FLOAT_CTRL", indent);
  565|   248k|      if (cbor_float_ctrl_is_ctrl(item)) {
  ------------------
  |  Branch (565:11): [True: 186k, False: 61.6k]
  ------------------
  566|   186k|        if (cbor_is_bool(item))
  ------------------
  |  Branch (566:13): [True: 113k, False: 73.1k]
  ------------------
  567|   113k|          fprintf(out, "Bool: %s\n", cbor_get_bool(item) ? "true" : "false");
  ------------------
  |  Branch (567:38): [True: 78.1k, False: 35.2k]
  ------------------
  568|  73.1k|        else if (cbor_is_undef(item))
  ------------------
  |  Branch (568:18): [True: 24.9k, False: 48.1k]
  ------------------
  569|  24.9k|          fprintf(out, "Undefined\n");
  570|  48.1k|        else if (cbor_is_null(item))
  ------------------
  |  Branch (570:18): [True: 48.1k, False: 0]
  ------------------
  571|  48.1k|          fprintf(out, "Null\n");
  572|      0|        else
  573|      0|          fprintf(out, "Simple value: %d\n", cbor_ctrl_value(item));
  574|   186k|      } else {
  575|  61.6k|        fprintf(out, "Width: %dB, ", _pow(2, cbor_float_get_width(item)));
  576|  61.6k|        fprintf(out, "Value: %lf\n", cbor_float_get_float(item));
  577|  61.6k|      }
  578|   248k|      break;
  579|      0|    }
  580|  12.2M|  }
  581|  12.2M|}
cbor.c:_cbor_type_marquee:
  464|  12.2M|static void _cbor_type_marquee(FILE* out, char* label, int indent) {
  465|  12.2M|  fprintf(out, "%*.*s[%s] ", indent, indent, " ", label);
  466|  12.2M|}
cbor.c:_pow:
  457|  6.63M|static int _pow(int b, int ex) {
  458|  6.63M|  if (ex == 0) return 1;
  ------------------
  |  Branch (458:7): [True: 6.32M, False: 308k]
  ------------------
  459|   308k|  int res = b;
  460|   585k|  while (--ex > 0) res *= b;
  ------------------
  |  Branch (460:10): [True: 276k, False: 308k]
  ------------------
  461|   308k|  return res;
  462|  6.63M|}

cbor_array_size:
   13|  71.7M|size_t cbor_array_size(const cbor_item_t* item) {
   14|  71.7M|  CBOR_ASSERT(cbor_isa_array(item));
  ------------------
  |  |   64|  71.7M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (14:3): [True: 0, False: 71.7M]
  |  Branch (14:3): [True: 71.7M, False: 0]
  ------------------
   15|  71.7M|  return item->metadata.array_metadata.end_ptr;
   16|  71.7M|}
cbor_array_get:
   23|  9.66M|cbor_item_t* cbor_array_get(const cbor_item_t* item, size_t index) {
   24|  9.66M|  CBOR_ASSERT(cbor_isa_array(item));
  ------------------
  |  |   64|  9.66M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (24:3): [True: 0, False: 9.66M]
  |  Branch (24:3): [True: 9.66M, False: 0]
  ------------------
   25|  9.66M|  if (index >= item->metadata.array_metadata.end_ptr) {
  ------------------
  |  Branch (25:7): [True: 0, False: 9.66M]
  ------------------
   26|      0|    return NULL;
   27|      0|  }
   28|  9.66M|  return cbor_incref(((cbor_item_t**)item->data)[index]);
   29|  9.66M|}
cbor_array_push:
   49|  29.9M|bool cbor_array_push(cbor_item_t* array, cbor_item_t* pushee) {
   50|  29.9M|  CBOR_ASSERT(cbor_isa_array(array));
  ------------------
  |  |   64|  29.9M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (50:3): [True: 0, False: 29.9M]
  |  Branch (50:3): [True: 29.9M, False: 0]
  ------------------
   51|  29.9M|  struct _cbor_array_metadata* metadata =
   52|  29.9M|      (struct _cbor_array_metadata*)&array->metadata;
   53|  29.9M|  cbor_item_t** data = (cbor_item_t**)array->data;
   54|  29.9M|  if (cbor_array_is_definite(array)) {
  ------------------
  |  Branch (54:7): [True: 14.3M, False: 15.5M]
  ------------------
   55|       |    /* Do not reallocate definite arrays */
   56|  14.3M|    if (metadata->end_ptr >= metadata->allocated) {
  ------------------
  |  Branch (56:9): [True: 0, False: 14.3M]
  ------------------
   57|      0|      return false;
   58|      0|    }
   59|  14.3M|    data[metadata->end_ptr++] = pushee;
   60|  15.5M|  } else {
   61|       |    /* Exponential realloc */
   62|  15.5M|    if (metadata->end_ptr >= metadata->allocated) {
  ------------------
  |  Branch (62:9): [True: 1.79M, False: 13.7M]
  ------------------
   63|       |      // Check for overflows first
   64|  1.79M|      if (!_cbor_safe_to_multiply(CBOR_BUFFER_GROWTH, metadata->allocated)) {
  ------------------
  |  |    8|  1.79M|#define CBOR_BUFFER_GROWTH 2
  ------------------
  |  Branch (64:11): [True: 0, False: 1.79M]
  ------------------
   65|      0|        return false;
   66|      0|      }
   67|       |
   68|  1.79M|      size_t new_allocation = metadata->allocated == 0
  ------------------
  |  Branch (68:31): [True: 631k, False: 1.16M]
  ------------------
   69|  1.79M|                                  ? 1
   70|  1.79M|                                  : CBOR_BUFFER_GROWTH * metadata->allocated;
  ------------------
  |  |    8|  1.16M|#define CBOR_BUFFER_GROWTH 2
  ------------------
   71|       |
   72|  1.79M|      unsigned char* new_data = _cbor_realloc_multiple(
   73|  1.79M|          array->data, sizeof(cbor_item_t*), new_allocation);
   74|  1.79M|      if (new_data == NULL) {
  ------------------
  |  Branch (74:11): [True: 1, False: 1.79M]
  ------------------
   75|      1|        return false;
   76|      1|      }
   77|       |
   78|  1.79M|      array->data = new_data;
   79|  1.79M|      metadata->allocated = new_allocation;
   80|  1.79M|    }
   81|  15.5M|    ((cbor_item_t**)array->data)[metadata->end_ptr++] = pushee;
   82|  15.5M|  }
   83|  29.9M|  cbor_incref(pushee);
   84|  29.9M|  return true;
   85|  29.9M|}
cbor_array_is_definite:
   87|  71.0M|bool cbor_array_is_definite(const cbor_item_t* item) {
   88|  71.0M|  CBOR_ASSERT(cbor_isa_array(item));
  ------------------
  |  |   64|  71.0M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (88:3): [True: 0, False: 71.0M]
  |  Branch (88:3): [True: 71.0M, False: 0]
  ------------------
   89|  71.0M|  return item->metadata.array_metadata.type == _CBOR_METADATA_DEFINITE;
   90|  71.0M|}
cbor_array_is_indefinite:
   92|   857k|bool cbor_array_is_indefinite(const cbor_item_t* item) {
   93|   857k|  CBOR_ASSERT(cbor_isa_array(item));
  ------------------
  |  |   64|   857k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (93:3): [True: 0, False: 857k]
  |  Branch (93:3): [True: 857k, False: 0]
  ------------------
   94|   857k|  return item->metadata.array_metadata.type == _CBOR_METADATA_INDEFINITE;
   95|   857k|}
cbor_array_handle:
   97|  32.0M|cbor_item_t** cbor_array_handle(const cbor_item_t* item) {
   98|  32.0M|  CBOR_ASSERT(cbor_isa_array(item));
  ------------------
  |  |   64|  32.0M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (98:3): [True: 0, False: 32.0M]
  |  Branch (98:3): [True: 32.0M, False: 0]
  ------------------
   99|  32.0M|  return (cbor_item_t**)item->data;
  100|  32.0M|}
cbor_new_definite_array:
  102|  13.4M|cbor_item_t* cbor_new_definite_array(size_t size) {
  103|  13.4M|  cbor_item_t* item = _cbor_malloc(sizeof(cbor_item_t));
  104|  13.4M|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|  13.4M|  do {                           \
  |  |  127|  13.4M|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 13.4M]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|  13.4M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 13.4M]
  |  |  ------------------
  ------------------
  105|  13.4M|  cbor_item_t** data = _cbor_alloc_multiple(sizeof(cbor_item_t*), size);
  106|  13.4M|  _CBOR_DEPENDENT_NOTNULL(item, data);
  ------------------
  |  |  135|  13.4M|  do {                                              \
  |  |  136|  13.4M|    if (pointer == NULL) {                          \
  |  |  ------------------
  |  |  |  Branch (136:9): [True: 82, False: 13.4M]
  |  |  ------------------
  |  |  137|     82|      _cbor_free(cbor_item);                        \
  |  |  138|     82|      return NULL;                                  \
  |  |  139|     82|    }                                               \
  |  |  140|  13.4M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (140:12): [Folded, False: 13.4M]
  |  |  ------------------
  ------------------
  107|       |
  108|  2.73G|  for (size_t i = 0; i < size; i++) {
  ------------------
  |  Branch (108:22): [True: 2.72G, False: 13.4M]
  ------------------
  109|  2.72G|    data[i] = NULL;
  110|  2.72G|  }
  111|       |
  112|  13.4M|  *item = (cbor_item_t){
  113|  13.4M|      .refcount = 1,
  114|  13.4M|      .type = CBOR_TYPE_ARRAY,
  115|  13.4M|      .metadata = {.array_metadata = {.type = _CBOR_METADATA_DEFINITE,
  116|  13.4M|                                      .allocated = size,
  117|  13.4M|                                      .end_ptr = 0}},
  118|  13.4M|      .data = (unsigned char*)data};
  119|       |
  120|  13.4M|  return item;
  121|  13.4M|}
cbor_new_indefinite_array:
  123|   637k|cbor_item_t* cbor_new_indefinite_array(void) {
  124|   637k|  cbor_item_t* item = _cbor_malloc(sizeof(cbor_item_t));
  125|   637k|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|   637k|  do {                           \
  |  |  127|   637k|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 637k]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|   637k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 637k]
  |  |  ------------------
  ------------------
  126|       |
  127|   637k|  *item = (cbor_item_t){
  128|   637k|      .refcount = 1,
  129|   637k|      .type = CBOR_TYPE_ARRAY,
  130|   637k|      .metadata = {.array_metadata = {.type = _CBOR_METADATA_INDEFINITE,
  131|   637k|                                      .allocated = 0,
  132|   637k|                                      .end_ptr = 0}},
  133|       |      .data = NULL /* Can be safely realloc-ed */
  134|   637k|  };
  135|   637k|  return item;
  136|   637k|}

cbor_bytestring_length:
   12|  5.58M|size_t cbor_bytestring_length(const cbor_item_t* item) {
   13|  5.58M|  CBOR_ASSERT(cbor_isa_bytestring(item));
  ------------------
  |  |   64|  5.58M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (13:3): [True: 0, False: 5.58M]
  |  Branch (13:3): [True: 5.58M, False: 0]
  ------------------
   14|  5.58M|  return item->metadata.bytestring_metadata.length;
   15|  5.58M|}
cbor_bytestring_handle:
   17|  1.56M|unsigned char* cbor_bytestring_handle(const cbor_item_t* item) {
   18|  1.56M|  CBOR_ASSERT(cbor_isa_bytestring(item));
  ------------------
  |  |   64|  1.56M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (18:3): [True: 0, False: 1.56M]
  |  Branch (18:3): [True: 1.56M, False: 0]
  ------------------
   19|  1.56M|  return item->data;
   20|  1.56M|}
cbor_bytestring_is_definite:
   22|  12.9M|bool cbor_bytestring_is_definite(const cbor_item_t* item) {
   23|  12.9M|  CBOR_ASSERT(cbor_isa_bytestring(item));
  ------------------
  |  |   64|  12.9M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (23:3): [True: 0, False: 12.9M]
  |  Branch (23:3): [True: 12.9M, False: 0]
  ------------------
   24|  12.9M|  return item->metadata.bytestring_metadata.type == _CBOR_METADATA_DEFINITE;
   25|  12.9M|}
cbor_bytestring_is_indefinite:
   27|  6.63M|bool cbor_bytestring_is_indefinite(const cbor_item_t* item) {
   28|  6.63M|  return !cbor_bytestring_is_definite(item);
   29|  6.63M|}
cbor_new_definite_bytestring:
   31|  1.68M|cbor_item_t* cbor_new_definite_bytestring(void) {
   32|  1.68M|  cbor_item_t* item = _cbor_malloc(sizeof(cbor_item_t));
   33|  1.68M|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|  1.68M|  do {                           \
  |  |  127|  1.68M|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 1.68M]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|  1.68M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 1.68M]
  |  |  ------------------
  ------------------
   34|  1.68M|  *item = (cbor_item_t){
   35|  1.68M|      .refcount = 1,
   36|  1.68M|      .type = CBOR_TYPE_BYTESTRING,
   37|  1.68M|      .metadata = {.bytestring_metadata = {.type = _CBOR_METADATA_DEFINITE,
   38|  1.68M|                                           .length = 0}}};
   39|  1.68M|  return item;
   40|  1.68M|}
cbor_new_indefinite_bytestring:
   42|  2.53k|cbor_item_t* cbor_new_indefinite_bytestring(void) {
   43|  2.53k|  cbor_item_t* item = _cbor_malloc(sizeof(cbor_item_t));
   44|  2.53k|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|  2.53k|  do {                           \
  |  |  127|  2.53k|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 2.53k]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|  2.53k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 2.53k]
  |  |  ------------------
  ------------------
   45|  2.53k|  *item = (cbor_item_t){
   46|  2.53k|      .refcount = 1,
   47|  2.53k|      .type = CBOR_TYPE_BYTESTRING,
   48|  2.53k|      .metadata = {.bytestring_metadata = {.type = _CBOR_METADATA_INDEFINITE,
   49|  2.53k|                                           .length = 0}},
   50|  2.53k|      .data = _cbor_malloc(sizeof(struct cbor_indefinite_string_data))};
   51|  2.53k|  _CBOR_DEPENDENT_NOTNULL(item, item->data);
  ------------------
  |  |  135|  2.53k|  do {                                              \
  |  |  136|  2.53k|    if (pointer == NULL) {                          \
  |  |  ------------------
  |  |  |  Branch (136:9): [True: 0, False: 2.53k]
  |  |  ------------------
  |  |  137|      0|      _cbor_free(cbor_item);                        \
  |  |  138|      0|      return NULL;                                  \
  |  |  139|      0|    }                                               \
  |  |  140|  2.53k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (140:12): [Folded, False: 2.53k]
  |  |  ------------------
  ------------------
   52|  2.53k|  *((struct cbor_indefinite_string_data*)item->data) =
   53|  2.53k|      (struct cbor_indefinite_string_data){
   54|  2.53k|          .chunk_count = 0,
   55|  2.53k|          .chunk_capacity = 0,
   56|       |          .chunks = NULL,
   57|  2.53k|      };
   58|  2.53k|  return item;
   59|  2.53k|}
cbor_build_bytestring:
   61|   522k|cbor_item_t* cbor_build_bytestring(cbor_data handle, size_t length) {
   62|   522k|  cbor_item_t* item = cbor_new_definite_bytestring();
   63|   522k|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|   522k|  do {                           \
  |  |  127|   522k|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 522k]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|   522k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 522k]
  |  |  ------------------
  ------------------
   64|   522k|  void* content = _cbor_malloc(length);
   65|   522k|  _CBOR_DEPENDENT_NOTNULL(item, content);
  ------------------
  |  |  135|   522k|  do {                                              \
  |  |  136|   522k|    if (pointer == NULL) {                          \
  |  |  ------------------
  |  |  |  Branch (136:9): [True: 0, False: 522k]
  |  |  ------------------
  |  |  137|      0|      _cbor_free(cbor_item);                        \
  |  |  138|      0|      return NULL;                                  \
  |  |  139|      0|    }                                               \
  |  |  140|   522k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (140:12): [Folded, False: 522k]
  |  |  ------------------
  ------------------
   66|   522k|  memcpy(content, handle, length);
   67|   522k|  cbor_bytestring_set_handle(item, content, length);
   68|   522k|  return item;
   69|   522k|}
cbor_bytestring_set_handle:
   73|  1.68M|                                size_t length) {
   74|  1.68M|  CBOR_ASSERT(cbor_isa_bytestring(item));
  ------------------
  |  |   64|  1.68M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (74:3): [True: 0, False: 1.68M]
  |  Branch (74:3): [True: 1.68M, False: 0]
  ------------------
   75|  1.68M|  CBOR_ASSERT(cbor_bytestring_is_definite(item));
  ------------------
  |  |   64|  1.68M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (75:3): [True: 0, False: 1.68M]
  |  Branch (75:3): [True: 1.68M, False: 0]
  ------------------
   76|  1.68M|  item->data = data;
   77|  1.68M|  item->metadata.bytestring_metadata.length = length;
   78|  1.68M|}
cbor_bytestring_chunks_handle:
   80|   963k|cbor_item_t** cbor_bytestring_chunks_handle(const cbor_item_t* item) {
   81|   963k|  CBOR_ASSERT(cbor_isa_bytestring(item));
  ------------------
  |  |   64|   963k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (81:3): [True: 0, False: 963k]
  |  Branch (81:3): [True: 963k, False: 0]
  ------------------
   82|   963k|  CBOR_ASSERT(cbor_bytestring_is_indefinite(item));
  ------------------
  |  |   64|   963k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (82:3): [True: 0, False: 963k]
  |  Branch (82:3): [True: 963k, False: 0]
  ------------------
   83|   963k|  return ((struct cbor_indefinite_string_data*)item->data)->chunks;
   84|   963k|}
cbor_bytestring_chunk_count:
   86|  2.83M|size_t cbor_bytestring_chunk_count(const cbor_item_t* item) {
   87|  2.83M|  CBOR_ASSERT(cbor_isa_bytestring(item));
  ------------------
  |  |   64|  2.83M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (87:3): [True: 0, False: 2.83M]
  |  Branch (87:3): [True: 2.83M, False: 0]
  ------------------
   88|  2.83M|  CBOR_ASSERT(cbor_bytestring_is_indefinite(item));
  ------------------
  |  |   64|  2.83M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (88:3): [True: 0, False: 2.83M]
  |  Branch (88:3): [True: 2.83M, False: 0]
  ------------------
   89|  2.83M|  return ((struct cbor_indefinite_string_data*)item->data)->chunk_count;
   90|  2.83M|}
cbor_bytestring_add_chunk:
   92|  1.39M|bool cbor_bytestring_add_chunk(cbor_item_t* item, cbor_item_t* chunk) {
   93|  1.39M|  CBOR_ASSERT(cbor_isa_bytestring(item));
  ------------------
  |  |   64|  1.39M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (93:3): [True: 0, False: 1.39M]
  |  Branch (93:3): [True: 1.39M, False: 0]
  ------------------
   94|  1.39M|  CBOR_ASSERT(cbor_bytestring_is_indefinite(item));
  ------------------
  |  |   64|  1.39M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (94:3): [True: 0, False: 1.39M]
  |  Branch (94:3): [True: 1.39M, False: 0]
  ------------------
   95|  1.39M|  CBOR_ASSERT(cbor_isa_bytestring(chunk));
  ------------------
  |  |   64|  1.39M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (95:3): [True: 0, False: 1.39M]
  |  Branch (95:3): [True: 1.39M, False: 0]
  ------------------
   96|  1.39M|  CBOR_ASSERT(cbor_bytestring_is_definite(chunk));
  ------------------
  |  |   64|  1.39M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (96:3): [True: 0, False: 1.39M]
  |  Branch (96:3): [True: 1.39M, False: 0]
  ------------------
   97|  1.39M|  struct cbor_indefinite_string_data* data =
   98|  1.39M|      (struct cbor_indefinite_string_data*)item->data;
   99|  1.39M|  if (data->chunk_count == data->chunk_capacity) {
  ------------------
  |  Branch (99:7): [True: 1.98k, False: 1.39M]
  ------------------
  100|  1.98k|    if (!_cbor_safe_to_multiply(CBOR_BUFFER_GROWTH, data->chunk_capacity)) {
  ------------------
  |  |    8|  1.98k|#define CBOR_BUFFER_GROWTH 2
  ------------------
  |  Branch (100:9): [True: 0, False: 1.98k]
  ------------------
  101|      0|      return false;
  102|      0|    }
  103|       |
  104|  1.98k|    size_t new_chunk_capacity =
  105|  1.98k|        data->chunk_capacity == 0 ? 1
  ------------------
  |  Branch (105:9): [True: 671, False: 1.31k]
  ------------------
  106|  1.98k|                                  : CBOR_BUFFER_GROWTH * (data->chunk_capacity);
  ------------------
  |  |    8|  1.31k|#define CBOR_BUFFER_GROWTH 2
  ------------------
  107|       |
  108|  1.98k|    cbor_item_t** new_chunks_data = _cbor_realloc_multiple(
  109|  1.98k|        data->chunks, sizeof(cbor_item_t*), new_chunk_capacity);
  110|       |
  111|  1.98k|    if (new_chunks_data == NULL) {
  ------------------
  |  Branch (111:9): [True: 0, False: 1.98k]
  ------------------
  112|      0|      return false;
  113|      0|    }
  114|  1.98k|    data->chunk_capacity = new_chunk_capacity;
  115|  1.98k|    data->chunks = new_chunks_data;
  116|  1.98k|  }
  117|  1.39M|  data->chunks[data->chunk_count++] = cbor_incref(chunk);
  118|  1.39M|  return true;
  119|  1.39M|}

cbor_typeof:
   22|   702M|cbor_type cbor_typeof(const cbor_item_t* item) {
   23|   702M|  CBOR_ASSERT(item != NULL);
  ------------------
  |  |   64|   702M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (23:3): [True: 0, False: 702M]
  |  Branch (23:3): [True: 702M, False: 0]
  ------------------
   24|   702M|  CBOR_ASSERT_VALID_TYPE(item->type);
  ------------------
  |  |   82|   702M|  CBOR_ASSERT(item_type >= CBOR_TYPE_UINT && item_type <= CBOR_TYPE_FLOAT_CTRL);
  |  |  ------------------
  |  |  |  |   64|   702M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  |  |  ------------------
  ------------------
  |  Branch (24:3): [True: 702M, False: 0]
  |  Branch (24:3): [True: 702M, False: 0]
  |  Branch (24:3): [True: 0, False: 702M]
  ------------------
   25|   702M|  return item->type;
   26|   702M|}
cbor_isa_uint:
   28|   212M|bool cbor_isa_uint(const cbor_item_t* item) {
   29|   212M|  return cbor_typeof(item) == CBOR_TYPE_UINT;
   30|   212M|}
cbor_isa_negint:
   32|  42.6M|bool cbor_isa_negint(const cbor_item_t* item) {
   33|  42.6M|  return cbor_typeof(item) == CBOR_TYPE_NEGINT;
   34|  42.6M|}
cbor_isa_bytestring:
   36|  30.1M|bool cbor_isa_bytestring(const cbor_item_t* item) {
   37|  30.1M|  return cbor_typeof(item) == CBOR_TYPE_BYTESTRING;
   38|  30.1M|}
cbor_isa_string:
   40|  17.4M|bool cbor_isa_string(const cbor_item_t* item) {
   41|  17.4M|  return cbor_typeof(item) == CBOR_TYPE_STRING;
   42|  17.4M|}
cbor_isa_array:
   44|   219M|bool cbor_isa_array(const cbor_item_t* item) {
   45|   219M|  return cbor_typeof(item) == CBOR_TYPE_ARRAY;
   46|   219M|}
cbor_isa_map:
   48|  21.9M|bool cbor_isa_map(const cbor_item_t* item) {
   49|  21.9M|  return cbor_typeof(item) == CBOR_TYPE_MAP;
   50|  21.9M|}
cbor_isa_tag:
   52|  2.44M|bool cbor_isa_tag(const cbor_item_t* item) {
   53|  2.44M|  return cbor_typeof(item) == CBOR_TYPE_TAG;
   54|  2.44M|}
cbor_isa_float_ctrl:
   56|  11.8M|bool cbor_isa_float_ctrl(const cbor_item_t* item) {
   57|  11.8M|  return cbor_typeof(item) == CBOR_TYPE_FLOAT_CTRL;
   58|  11.8M|}
cbor_is_int:
   60|   200M|bool cbor_is_int(const cbor_item_t* item) {
   61|   200M|  return cbor_isa_uint(item) || cbor_isa_negint(item);
  ------------------
  |  Branch (61:10): [True: 160M, False: 39.6M]
  |  Branch (61:33): [True: 39.6M, False: 0]
  ------------------
   62|   200M|}
cbor_is_bool:
   64|   300k|bool cbor_is_bool(const cbor_item_t* item) {
   65|   300k|  return cbor_isa_float_ctrl(item) && cbor_float_ctrl_is_ctrl(item) &&
  ------------------
  |  Branch (65:10): [True: 300k, False: 0]
  |  Branch (65:39): [True: 300k, False: 0]
  ------------------
   66|   300k|         (cbor_ctrl_value(item) == CBOR_CTRL_FALSE ||
  ------------------
  |  Branch (66:11): [True: 70.5k, False: 229k]
  ------------------
   67|   229k|          cbor_ctrl_value(item) == CBOR_CTRL_TRUE);
  ------------------
  |  Branch (67:11): [True: 156k, False: 73.1k]
  ------------------
   68|   300k|}
cbor_is_null:
   70|  48.1k|bool cbor_is_null(const cbor_item_t* item) {
   71|  48.1k|  return cbor_isa_float_ctrl(item) && cbor_float_ctrl_is_ctrl(item) &&
  ------------------
  |  Branch (71:10): [True: 48.1k, False: 0]
  |  Branch (71:39): [True: 48.1k, False: 0]
  ------------------
   72|  48.1k|         cbor_ctrl_value(item) == CBOR_CTRL_NULL;
  ------------------
  |  Branch (72:10): [True: 48.1k, False: 0]
  ------------------
   73|  48.1k|}
cbor_is_undef:
   75|  73.1k|bool cbor_is_undef(const cbor_item_t* item) {
   76|  73.1k|  return cbor_isa_float_ctrl(item) && cbor_float_ctrl_is_ctrl(item) &&
  ------------------
  |  Branch (76:10): [True: 73.1k, False: 0]
  |  Branch (76:39): [True: 73.1k, False: 0]
  ------------------
   77|  73.1k|         cbor_ctrl_value(item) == CBOR_CTRL_UNDEF;
  ------------------
  |  Branch (77:10): [True: 24.9k, False: 48.1k]
  ------------------
   78|  73.1k|}
cbor_is_float:
   80|   343k|bool cbor_is_float(const cbor_item_t* item) {
   81|   343k|  return cbor_isa_float_ctrl(item) && !cbor_float_ctrl_is_ctrl(item);
  ------------------
  |  Branch (81:10): [True: 343k, False: 0]
  |  Branch (81:39): [True: 343k, False: 0]
  ------------------
   82|   343k|}
cbor_incref:
   84|  48.1M|cbor_item_t* cbor_incref(cbor_item_t* item) {
   85|  48.1M|  item->refcount++;
   86|  48.1M|  return item;
   87|  48.1M|}
cbor_decref:
   89|  75.4M|void cbor_decref(cbor_item_t** item_ref) {
   90|  75.4M|  cbor_item_t* item = *item_ref;
   91|  75.4M|  CBOR_ASSERT(item->refcount > 0);
  ------------------
  |  |   64|  75.4M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (91:3): [True: 0, False: 75.4M]
  |  Branch (91:3): [True: 75.4M, False: 0]
  ------------------
   92|  75.4M|  if (--item->refcount == 0) {
  ------------------
  |  Branch (92:7): [True: 37.8M, False: 37.6M]
  ------------------
   93|  37.8M|    switch (item->type) {
  ------------------
  |  Branch (93:13): [True: 37.8M, False: 0]
  ------------------
   94|  13.9M|      case CBOR_TYPE_UINT:
  ------------------
  |  Branch (94:7): [True: 13.9M, False: 23.8M]
  ------------------
   95|       |        /* Fallthrough */
   96|  18.3M|      case CBOR_TYPE_NEGINT:
  ------------------
  |  Branch (96:7): [True: 4.38M, False: 33.4M]
  ------------------
   97|       |        /* Combined allocation, freeing the item suffices */
   98|  18.3M|        { break; }
   99|  1.69M|      case CBOR_TYPE_BYTESTRING: {
  ------------------
  |  Branch (99:7): [True: 1.69M, False: 36.1M]
  ------------------
  100|  1.69M|        if (cbor_bytestring_is_definite(item)) {
  ------------------
  |  Branch (100:13): [True: 1.68M, False: 2.53k]
  ------------------
  101|  1.68M|          _cbor_free(item->data);
  102|  1.68M|        } else {
  103|       |          /* We need to decref all chunks */
  104|  2.53k|          cbor_item_t** handle = cbor_bytestring_chunks_handle(item);
  105|  1.39M|          for (size_t i = 0; i < cbor_bytestring_chunk_count(item); i++)
  ------------------
  |  Branch (105:30): [True: 1.39M, False: 2.53k]
  ------------------
  106|  1.39M|            cbor_decref(&handle[i]);
  107|  2.53k|          _cbor_free(((struct cbor_indefinite_string_data*)item->data)->chunks);
  108|  2.53k|          _cbor_free(item->data);
  109|  2.53k|        }
  110|  1.69M|        break;
  111|  13.9M|      }
  112|  1.26M|      case CBOR_TYPE_STRING: {
  ------------------
  |  Branch (112:7): [True: 1.26M, False: 36.5M]
  ------------------
  113|  1.26M|        if (cbor_string_is_definite(item)) {
  ------------------
  |  Branch (113:13): [True: 1.26M, False: 7.43k]
  ------------------
  114|  1.26M|          _cbor_free(item->data);
  115|  1.26M|        } else {
  116|       |          /* We need to decref all chunks */
  117|  7.43k|          cbor_item_t** handle = cbor_string_chunks_handle(item);
  118|   635k|          for (size_t i = 0; i < cbor_string_chunk_count(item); i++)
  ------------------
  |  Branch (118:30): [True: 628k, False: 7.43k]
  ------------------
  119|   628k|            cbor_decref(&handle[i]);
  120|  7.43k|          _cbor_free(((struct cbor_indefinite_string_data*)item->data)->chunks);
  121|  7.43k|          _cbor_free(item->data);
  122|  7.43k|        }
  123|  1.26M|        break;
  124|  13.9M|      }
  125|  14.0M|      case CBOR_TYPE_ARRAY: {
  ------------------
  |  Branch (125:7): [True: 14.0M, False: 23.7M]
  ------------------
  126|       |        /* Get all items and decref them */
  127|  14.0M|        cbor_item_t** handle = cbor_array_handle(item);
  128|  14.0M|        size_t size = cbor_array_size(item);
  129|  44.0M|        for (size_t i = 0; i < size; i++)
  ------------------
  |  Branch (129:28): [True: 29.9M, False: 14.0M]
  ------------------
  130|  29.9M|          if (handle[i] != NULL) cbor_decref(&handle[i]);
  ------------------
  |  Branch (130:15): [True: 29.9M, False: 0]
  ------------------
  131|  14.0M|        _cbor_free(item->data);
  132|  14.0M|        break;
  133|  13.9M|      }
  134|   120k|      case CBOR_TYPE_MAP: {
  ------------------
  |  Branch (134:7): [True: 120k, False: 37.6M]
  ------------------
  135|   120k|        struct cbor_pair* handle = cbor_map_handle(item);
  136|  2.70M|        for (size_t i = 0; i < item->metadata.map_metadata.end_ptr;
  ------------------
  |  Branch (136:28): [True: 2.58M, False: 120k]
  ------------------
  137|  2.58M|             i++, handle++) {
  138|  2.58M|          cbor_decref(&handle->key);
  139|  2.58M|          if (handle->value != NULL) cbor_decref(&handle->value);
  ------------------
  |  Branch (139:15): [True: 2.58M, False: 1.44k]
  ------------------
  140|  2.58M|        }
  141|   120k|        _cbor_free(item->data);
  142|   120k|        break;
  143|  13.9M|      }
  144|   558k|      case CBOR_TYPE_TAG: {
  ------------------
  |  Branch (144:7): [True: 558k, False: 37.2M]
  ------------------
  145|   558k|        if (item->metadata.tag_metadata.tagged_item != NULL)
  ------------------
  |  Branch (145:13): [True: 531k, False: 27.3k]
  ------------------
  146|   531k|          cbor_decref(&item->metadata.tag_metadata.tagged_item);
  147|   558k|        _cbor_free(item->data);
  148|   558k|        break;
  149|  13.9M|      }
  150|  1.79M|      case CBOR_TYPE_FLOAT_CTRL: {
  ------------------
  |  Branch (150:7): [True: 1.79M, False: 36.0M]
  ------------------
  151|       |        /* Floats have combined allocation */
  152|  1.79M|        break;
  153|  13.9M|      }
  154|  37.8M|    }
  155|  37.8M|    _cbor_free(item);
  156|       |    *item_ref = NULL;
  157|  37.8M|  }
  158|  75.4M|}
cbor_move:
  164|  10.5M|cbor_item_t* cbor_move(cbor_item_t* item) {
  165|  10.5M|  if (item == NULL) return NULL;
  ------------------
  |  Branch (165:7): [True: 0, False: 10.5M]
  ------------------
  166|  10.5M|  item->refcount--;
  167|  10.5M|  return item;
  168|  10.5M|}

cbor_encode_uint8:
   15|  4.80M|                         size_t buffer_size) {
   16|  4.80M|  return _cbor_encode_uint8(value, buffer, buffer_size, 0x00);
   17|  4.80M|}
cbor_encode_uint16:
   20|  4.48k|                          size_t buffer_size) {
   21|  4.48k|  return _cbor_encode_uint16(value, buffer, buffer_size, 0x00);
   22|  4.48k|}
cbor_encode_uint32:
   25|   205k|                          size_t buffer_size) {
   26|   205k|  return _cbor_encode_uint32(value, buffer, buffer_size, 0x00);
   27|   205k|}
cbor_encode_uint64:
   30|  11.7k|                          size_t buffer_size) {
   31|  11.7k|  return _cbor_encode_uint64(value, buffer, buffer_size, 0x00);
   32|  11.7k|}
cbor_encode_negint8:
   40|  1.51M|                           size_t buffer_size) {
   41|  1.51M|  return _cbor_encode_uint8(value, buffer, buffer_size, 0x20);
   42|  1.51M|}
cbor_encode_negint16:
   45|  16.5k|                            size_t buffer_size) {
   46|  16.5k|  return _cbor_encode_uint16(value, buffer, buffer_size, 0x20);
   47|  16.5k|}
cbor_encode_negint32:
   50|  7.65k|                            size_t buffer_size) {
   51|  7.65k|  return _cbor_encode_uint32(value, buffer, buffer_size, 0x20);
   52|  7.65k|}
cbor_encode_negint64:
   55|  1.04k|                            size_t buffer_size) {
   56|  1.04k|  return _cbor_encode_uint64(value, buffer, buffer_size, 0x20);
   57|  1.04k|}
cbor_encode_bytestring_start:
   65|   522k|                                    size_t buffer_size) {
   66|   522k|  return _cbor_encode_uint((size_t)length, buffer, buffer_size, 0x40);
   67|   522k|}
_cbor_encode_byte:
   70|   492k|                         size_t buffer_size) {
   71|   492k|  if (buffer_size >= 1) {
  ------------------
  |  Branch (71:7): [True: 492k, False: 0]
  ------------------
   72|   492k|    buffer[0] = value;
   73|   492k|    return 1;
   74|   492k|  } else
   75|      0|    return 0;
   76|   492k|}
cbor_encode_indef_bytestring_start:
   79|    875|                                          size_t buffer_size) {
   80|    875|  return _cbor_encode_byte(0x5F, buffer, buffer_size);
   81|    875|}
cbor_encode_string_start:
   84|   454k|                                size_t buffer_size) {
   85|   454k|  return _cbor_encode_uint((size_t)length, buffer, buffer_size, 0x60);
   86|   454k|}
cbor_encode_indef_string_start:
   89|  2.24k|                                      size_t buffer_size) {
   90|  2.24k|  return _cbor_encode_byte(0x7F, buffer, buffer_size);
   91|  2.24k|}
cbor_encode_array_start:
   94|  3.92M|                               size_t buffer_size) {
   95|  3.92M|  return _cbor_encode_uint((size_t)length, buffer, buffer_size, 0x80);
   96|  3.92M|}
cbor_encode_indef_array_start:
   99|   241k|                                     size_t buffer_size) {
  100|   241k|  return _cbor_encode_byte(0x9F, buffer, buffer_size);
  101|   241k|}
cbor_encode_map_start:
  104|  32.5k|                             size_t buffer_size) {
  105|  32.5k|  return _cbor_encode_uint((size_t)length, buffer, buffer_size, 0xA0);
  106|  32.5k|}
cbor_encode_indef_map_start:
  108|  1.83k|size_t cbor_encode_indef_map_start(unsigned char* buffer, size_t buffer_size) {
  109|  1.83k|  return _cbor_encode_byte(0xBF, buffer, buffer_size);
  110|  1.83k|}
cbor_encode_tag:
  113|   213k|                       size_t buffer_size) {
  114|   213k|  return _cbor_encode_uint(value, buffer, buffer_size, 0xC0);
  115|   213k|}
cbor_encode_half:
  131|  38.1k|                        size_t buffer_size) {
  132|       |  // TODO: Broken on systems that do not use IEEE 754
  133|       |  /* Assuming value is normalized */
  134|  38.1k|  uint32_t val = ((union _cbor_float_helper){.as_float = value}).as_uint;
  135|  38.1k|  uint16_t res;
  136|  38.1k|  uint8_t exp = (uint8_t)((val & 0x7F800000u) >>
  137|  38.1k|                          23u); /* 0b0111_1111_1000_0000_0000_0000_0000_0000 */
  138|  38.1k|  uint32_t mant =
  139|  38.1k|      val & 0x7FFFFFu; /* 0b0000_0000_0111_1111_1111_1111_1111_1111 */
  140|  38.1k|  if (exp == 0xFF) {   /* Infinity or NaNs */
  ------------------
  |  Branch (140:7): [True: 3.55k, False: 34.5k]
  ------------------
  141|  3.55k|    if (isnan(value)) {
  ------------------
  |  Branch (141:9): [True: 2.70k, False: 855]
  ------------------
  142|       |      /* Preserve the sign bit and NaN payload. The top 10 bits of the 23-bit
  143|       |       * single-precision mantissa map directly onto the 10-bit half-precision
  144|       |       * mantissa. If the payload fits entirely in the bottom 13 bits (which
  145|       |       * cannot be represented in half precision), fall back to a quiet NaN
  146|       |       * to avoid accidentally producing an infinity encoding (mantissa == 0).
  147|       |       * Note: signaling NaN payloads are preserved on a best-effort basis;
  148|       |       * some CPUs canonicalize them to quiet NaNs when loaded into registers.
  149|       |       * See https://github.com/PJK/libcbor/issues/215 */
  150|  2.70k|      uint16_t half_mant = (uint16_t)(mant >> 13u);
  151|  2.70k|      if (half_mant == 0) half_mant = 0x0200u; /* quiet NaN fallback */
  ------------------
  |  Branch (151:11): [True: 0, False: 2.70k]
  ------------------
  152|  2.70k|      res = (uint16_t)((val & 0x80000000u) >> 16u | 0x7C00u | half_mant);
  153|  2.70k|    } else {
  154|       |      // If the mantissa is non-zero, we have a NaN, but those are handled
  155|       |      // above. See
  156|       |      // https://en.wikipedia.org/wiki/Half-precision_floating-point_format
  157|    855|      CBOR_ASSERT(mant == 0u);
  ------------------
  |  |   64|    855|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (157:7): [True: 0, False: 855]
  |  Branch (157:7): [True: 855, False: 0]
  ------------------
  158|    855|      res = (uint16_t)((val & 0x80000000u) >> 16u | 0x7C00u);
  159|    855|    }
  160|  34.5k|  } else if (exp == 0x00) { /* Zeroes or subnorms */
  ------------------
  |  Branch (160:14): [True: 721, False: 33.8k]
  ------------------
  161|    721|    res = (uint16_t)((val & 0x80000000u) >> 16u | mant >> 13u);
  162|  33.8k|  } else { /* Normal numbers */
  163|  33.8k|    int8_t logical_exp = (int8_t)(exp - 127);
  164|  33.8k|    CBOR_ASSERT(logical_exp == exp - 127);
  ------------------
  |  |   64|  33.8k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (164:5): [True: 0, False: 33.8k]
  |  Branch (164:5): [True: 33.8k, False: 0]
  ------------------
  165|       |
  166|       |    // Now we know that 2^exp <= 0 logically
  167|  33.8k|    if (logical_exp < -24) {
  ------------------
  |  Branch (167:9): [True: 0, False: 33.8k]
  ------------------
  168|       |      /* Too small to represent even as a half-precision subnormal; round to
  169|       |       * zero. The sign bit is preserved so that small negative values round
  170|       |       * to negative zero rather than positive zero. */
  171|      0|      res = (uint16_t)((val & 0x80000000u) >> 16u);
  172|  33.8k|    } else if (logical_exp < -14) {
  ------------------
  |  Branch (172:16): [True: 11.0k, False: 22.8k]
  ------------------
  173|       |      /* Offset the remaining decimal places by shifting the significand, the
  174|       |         value is lost. This is an implementation decision that works around the
  175|       |         absence of standard half-float in the language. */
  176|  11.0k|      res = (uint16_t)((val & 0x80000000u) >> 16u) |  // Extract sign bit
  177|  11.0k|            ((uint16_t)(1u << (24u + logical_exp)) +
  178|  11.0k|             (uint16_t)(((mant >> (-logical_exp - 2)) + 1) >>
  179|  11.0k|                        1));  // Round half away from zero for simplicity
  180|  22.8k|    } else {
  181|  22.8k|      res = (uint16_t)((val & 0x80000000u) >> 16u |
  182|  22.8k|                       ((((uint8_t)logical_exp) + 15u) << 10u) |
  183|  22.8k|                       (uint16_t)(mant >> 13u));
  184|  22.8k|    }
  185|  33.8k|  }
  186|  38.1k|  return _cbor_encode_uint16(res, buffer, buffer_size, 0xE0);
  187|  38.1k|}
cbor_encode_single:
  190|  9.11k|                          size_t buffer_size) {
  191|       |  // Note: Values of signaling NaNs are discarded. There is no standard
  192|       |  // way to extract it without assumptions about the internal float
  193|       |  // representation.
  194|  9.11k|  if (isnan(value)) {
  ------------------
  |  Branch (194:7): [True: 424, False: 8.68k]
  ------------------
  195|    424|    return _cbor_encode_uint32((uint32_t)0x7FC0 << 16, buffer, buffer_size,
  196|    424|                               0xE0);
  197|    424|  }
  198|       |  // TODO: Broken on systems that do not use IEEE 754
  199|  8.68k|  return _cbor_encode_uint32(
  200|  8.68k|      ((union _cbor_float_helper){.as_float = value}).as_uint, buffer,
  201|  8.68k|      buffer_size, 0xE0);
  202|  9.11k|}
cbor_encode_double:
  205|  14.3k|                          size_t buffer_size) {
  206|       |  // Note: Values of signaling NaNs are discarded. See `cbor_encode_single`.
  207|  14.3k|  if (isnan(value)) {
  ------------------
  |  Branch (207:7): [True: 2.28k, False: 12.0k]
  ------------------
  208|  2.28k|    return _cbor_encode_uint64((uint64_t)0x7FF8 << 48, buffer, buffer_size,
  209|  2.28k|                               0xE0);
  210|  2.28k|  }
  211|       |  // TODO: Broken on systems that do not use IEEE 754
  212|  12.0k|  return _cbor_encode_uint64(
  213|  12.0k|      ((union _cbor_double_helper){.as_double = value}).as_uint, buffer,
  214|  12.0k|      buffer_size, 0xE0);
  215|  14.3k|}
cbor_encode_break:
  217|   246k|size_t cbor_encode_break(unsigned char* buffer, size_t buffer_size) {
  218|   246k|  return _cbor_encode_byte(0xFF, buffer, buffer_size);
  219|   246k|}
cbor_encode_ctrl:
  222|   186k|                        size_t buffer_size) {
  223|   186k|  return _cbor_encode_uint8(value, buffer, buffer_size, 0xE0);
  224|   186k|}

cbor_float_get_width:
   12|  6.68M|cbor_float_width cbor_float_get_width(const cbor_item_t* item) {
   13|  6.68M|  CBOR_ASSERT(cbor_isa_float_ctrl(item));
  ------------------
  |  |   64|  6.68M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (13:3): [True: 0, False: 6.68M]
  |  Branch (13:3): [True: 6.68M, False: 0]
  ------------------
   14|  6.68M|  return item->metadata.float_ctrl_metadata.width;
   15|  6.68M|}
cbor_ctrl_value:
   17|  1.21M|uint8_t cbor_ctrl_value(const cbor_item_t* item) {
   18|  1.21M|  CBOR_ASSERT(cbor_isa_float_ctrl(item));
  ------------------
  |  |   64|  1.21M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (18:3): [True: 0, False: 1.21M]
  |  Branch (18:3): [True: 1.21M, False: 0]
  ------------------
   19|  1.21M|  CBOR_ASSERT(cbor_float_get_width(item) == CBOR_FLOAT_0);
  ------------------
  |  |   64|  1.21M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (19:3): [True: 0, False: 1.21M]
  |  Branch (19:3): [True: 1.21M, False: 0]
  ------------------
   20|  1.21M|  return item->metadata.float_ctrl_metadata.ctrl;
   21|  1.21M|}
cbor_float_ctrl_is_ctrl:
   23|  1.01M|bool cbor_float_ctrl_is_ctrl(const cbor_item_t* item) {
   24|  1.01M|  CBOR_ASSERT(cbor_isa_float_ctrl(item));
  ------------------
  |  |   64|  1.01M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (24:3): [True: 0, False: 1.01M]
  |  Branch (24:3): [True: 1.01M, False: 0]
  ------------------
   25|  1.01M|  return cbor_float_get_width(item) == CBOR_FLOAT_0;
   26|  1.01M|}
cbor_float_get_float2:
   28|   114k|float cbor_float_get_float2(const cbor_item_t* item) {
   29|   114k|  CBOR_ASSERT(cbor_is_float(item));
  ------------------
  |  |   64|   114k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (29:3): [True: 0, False: 114k]
  |  Branch (29:3): [True: 114k, False: 0]
  ------------------
   30|   114k|  CBOR_ASSERT(cbor_float_get_width(item) == CBOR_FLOAT_16);
  ------------------
  |  |   64|   114k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (30:3): [True: 0, False: 114k]
  |  Branch (30:3): [True: 114k, False: 0]
  ------------------
   31|   114k|  return *(float*)item->data;
   32|   114k|}
cbor_float_get_float4:
   34|  27.3k|float cbor_float_get_float4(const cbor_item_t* item) {
   35|  27.3k|  CBOR_ASSERT(cbor_is_float(item));
  ------------------
  |  |   64|  27.3k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (35:3): [True: 0, False: 27.3k]
  |  Branch (35:3): [True: 27.3k, False: 0]
  ------------------
   36|  27.3k|  CBOR_ASSERT(cbor_float_get_width(item) == CBOR_FLOAT_32);
  ------------------
  |  |   64|  27.3k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (36:3): [True: 0, False: 27.3k]
  |  Branch (36:3): [True: 27.3k, False: 0]
  ------------------
   37|  27.3k|  return *(float*)item->data;
   38|  27.3k|}
cbor_float_get_float8:
   40|  43.1k|double cbor_float_get_float8(const cbor_item_t* item) {
   41|  43.1k|  CBOR_ASSERT(cbor_is_float(item));
  ------------------
  |  |   64|  43.1k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (41:3): [True: 0, False: 43.1k]
  |  Branch (41:3): [True: 43.1k, False: 0]
  ------------------
   42|  43.1k|  CBOR_ASSERT(cbor_float_get_width(item) == CBOR_FLOAT_64);
  ------------------
  |  |   64|  43.1k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (42:3): [True: 0, False: 43.1k]
  |  Branch (42:3): [True: 43.1k, False: 0]
  ------------------
   43|  43.1k|  return *(double*)item->data;
   44|  43.1k|}
cbor_float_get_float:
   46|  61.6k|double cbor_float_get_float(const cbor_item_t* item) {
   47|  61.6k|  CBOR_ASSERT(cbor_isa_float_ctrl(item));
  ------------------
  |  |   64|  61.6k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (47:3): [True: 0, False: 61.6k]
  |  Branch (47:3): [True: 61.6k, False: 0]
  ------------------
   48|  61.6k|  CBOR_ASSERT(cbor_float_get_width(item) >= CBOR_FLOAT_0 &&
  ------------------
  |  |   64|  61.6k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (48:3): [True: 61.6k, False: 0]
  |  Branch (48:3): [True: 61.6k, False: 0]
  |  Branch (48:3): [True: 0, False: 61.6k]
  ------------------
   49|  61.6k|              cbor_float_get_width(item) <= CBOR_FLOAT_64);
   50|  61.6k|  switch (cbor_float_get_width(item)) {
   51|      0|    case CBOR_FLOAT_0:
  ------------------
  |  Branch (51:5): [True: 0, False: 61.6k]
  ------------------
   52|      0|      return NAN;
   53|  38.1k|    case CBOR_FLOAT_16:
  ------------------
  |  Branch (53:5): [True: 38.1k, False: 23.4k]
  ------------------
   54|  38.1k|      return cbor_float_get_float2(item);
   55|  9.11k|    case CBOR_FLOAT_32:
  ------------------
  |  Branch (55:5): [True: 9.11k, False: 52.5k]
  ------------------
   56|  9.11k|      return cbor_float_get_float4(item);
   57|  14.3k|    case CBOR_FLOAT_64:
  ------------------
  |  Branch (57:5): [True: 14.3k, False: 47.2k]
  ------------------
   58|  14.3k|      return cbor_float_get_float8(item);
   59|      0|    default:  // LCOV_EXCL_START
  ------------------
  |  Branch (59:5): [True: 0, False: 61.6k]
  ------------------
   60|      0|      _CBOR_UNREACHABLE;
  ------------------
  |  |  111|      0|#define _CBOR_UNREACHABLE __builtin_unreachable()
  ------------------
   61|      0|      return 0;  // LCOV_EXCL_STOP
   62|  61.6k|  }
   63|  61.6k|}
cbor_get_bool:
   65|   113k|bool cbor_get_bool(const cbor_item_t* item) {
   66|   113k|  CBOR_ASSERT(cbor_is_bool(item));
  ------------------
  |  |   64|   113k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (66:3): [True: 0, False: 113k]
  |  Branch (66:3): [True: 113k, False: 0]
  ------------------
   67|   113k|  return item->metadata.float_ctrl_metadata.ctrl == CBOR_CTRL_TRUE;
   68|   113k|}
cbor_set_float2:
   70|  93.3k|void cbor_set_float2(cbor_item_t* item, float value) {
   71|  93.3k|  CBOR_ASSERT(cbor_is_float(item));
  ------------------
  |  |   64|  93.3k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (71:3): [True: 0, False: 93.3k]
  |  Branch (71:3): [True: 93.3k, False: 0]
  ------------------
   72|  93.3k|  CBOR_ASSERT(cbor_float_get_width(item) == CBOR_FLOAT_16);
  ------------------
  |  |   64|  93.3k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (72:3): [True: 0, False: 93.3k]
  |  Branch (72:3): [True: 93.3k, False: 0]
  ------------------
   73|  93.3k|  *((float*)item->data) = value;
   74|  93.3k|}
cbor_set_float4:
   76|  20.7k|void cbor_set_float4(cbor_item_t* item, float value) {
   77|  20.7k|  CBOR_ASSERT(cbor_is_float(item));
  ------------------
  |  |   64|  20.7k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (77:3): [True: 0, False: 20.7k]
  |  Branch (77:3): [True: 20.7k, False: 0]
  ------------------
   78|  20.7k|  CBOR_ASSERT(cbor_float_get_width(item) == CBOR_FLOAT_32);
  ------------------
  |  |   64|  20.7k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (78:3): [True: 0, False: 20.7k]
  |  Branch (78:3): [True: 20.7k, False: 0]
  ------------------
   79|  20.7k|  *((float*)item->data) = value;
   80|  20.7k|}
cbor_set_float8:
   82|  44.7k|void cbor_set_float8(cbor_item_t* item, double value) {
   83|  44.7k|  CBOR_ASSERT(cbor_is_float(item));
  ------------------
  |  |   64|  44.7k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (83:3): [True: 0, False: 44.7k]
  |  Branch (83:3): [True: 44.7k, False: 0]
  ------------------
   84|  44.7k|  CBOR_ASSERT(cbor_float_get_width(item) == CBOR_FLOAT_64);
  ------------------
  |  |   64|  44.7k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (84:3): [True: 0, False: 44.7k]
  |  Branch (84:3): [True: 44.7k, False: 0]
  ------------------
   85|  44.7k|  *((double*)item->data) = value;
   86|  44.7k|}
cbor_set_ctrl:
   88|  1.63M|void cbor_set_ctrl(cbor_item_t* item, uint8_t value) {
   89|  1.63M|  CBOR_ASSERT(cbor_isa_float_ctrl(item));
  ------------------
  |  |   64|  1.63M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (89:3): [True: 0, False: 1.63M]
  |  Branch (89:3): [True: 1.63M, False: 0]
  ------------------
   90|  1.63M|  CBOR_ASSERT(cbor_float_get_width(item) == CBOR_FLOAT_0);
  ------------------
  |  |   64|  1.63M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (90:3): [True: 0, False: 1.63M]
  |  Branch (90:3): [True: 1.63M, False: 0]
  ------------------
   91|  1.63M|  item->metadata.float_ctrl_metadata.ctrl = value;
   92|  1.63M|}
cbor_new_ctrl:
  100|  1.63M|cbor_item_t* cbor_new_ctrl(void) {
  101|  1.63M|  cbor_item_t* item = _cbor_malloc(sizeof(cbor_item_t));
  102|  1.63M|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|  1.63M|  do {                           \
  |  |  127|  1.63M|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 1.63M]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|  1.63M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 1.63M]
  |  |  ------------------
  ------------------
  103|       |
  104|  1.63M|  *item = (cbor_item_t){
  105|  1.63M|      .type = CBOR_TYPE_FLOAT_CTRL,
  106|       |      .data = NULL,
  107|  1.63M|      .refcount = 1,
  108|  1.63M|      .metadata = {.float_ctrl_metadata = {.width = CBOR_FLOAT_0,
  109|  1.63M|                                           .ctrl = CBOR_CTRL_NONE}}};
  110|  1.63M|  return item;
  111|  1.63M|}
cbor_new_float2:
  113|  93.3k|cbor_item_t* cbor_new_float2(void) {
  114|  93.3k|  cbor_item_t* item = _cbor_malloc(sizeof(cbor_item_t) + 4);
  115|  93.3k|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|  93.3k|  do {                           \
  |  |  127|  93.3k|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 93.3k]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|  93.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 93.3k]
  |  |  ------------------
  ------------------
  116|       |
  117|  93.3k|  *item = (cbor_item_t){
  118|  93.3k|      .type = CBOR_TYPE_FLOAT_CTRL,
  119|  93.3k|      .data = (unsigned char*)item + sizeof(cbor_item_t),
  120|  93.3k|      .refcount = 1,
  121|  93.3k|      .metadata = {.float_ctrl_metadata = {.width = CBOR_FLOAT_16}}};
  122|  93.3k|  return item;
  123|  93.3k|}
cbor_new_float4:
  125|  20.7k|cbor_item_t* cbor_new_float4(void) {
  126|  20.7k|  cbor_item_t* item = _cbor_malloc(sizeof(cbor_item_t) + 4);
  127|  20.7k|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|  20.7k|  do {                           \
  |  |  127|  20.7k|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 20.7k]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|  20.7k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 20.7k]
  |  |  ------------------
  ------------------
  128|       |
  129|  20.7k|  *item = (cbor_item_t){
  130|  20.7k|      .type = CBOR_TYPE_FLOAT_CTRL,
  131|  20.7k|      .data = (unsigned char*)item + sizeof(cbor_item_t),
  132|  20.7k|      .refcount = 1,
  133|  20.7k|      .metadata = {.float_ctrl_metadata = {.width = CBOR_FLOAT_32}}};
  134|  20.7k|  return item;
  135|  20.7k|}
cbor_new_float8:
  137|  44.7k|cbor_item_t* cbor_new_float8(void) {
  138|  44.7k|  cbor_item_t* item = _cbor_malloc(sizeof(cbor_item_t) + 8);
  139|  44.7k|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|  44.7k|  do {                           \
  |  |  127|  44.7k|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 44.7k]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|  44.7k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 44.7k]
  |  |  ------------------
  ------------------
  140|       |
  141|  44.7k|  *item = (cbor_item_t){
  142|  44.7k|      .type = CBOR_TYPE_FLOAT_CTRL,
  143|  44.7k|      .data = (unsigned char*)item + sizeof(cbor_item_t),
  144|  44.7k|      .refcount = 1,
  145|  44.7k|      .metadata = {.float_ctrl_metadata = {.width = CBOR_FLOAT_64}}};
  146|  44.7k|  return item;
  147|  44.7k|}
cbor_new_null:
  149|   600k|cbor_item_t* cbor_new_null(void) {
  150|   600k|  cbor_item_t* item = cbor_new_ctrl();
  151|   600k|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|   600k|  do {                           \
  |  |  127|   600k|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 600k]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|   600k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 600k]
  |  |  ------------------
  ------------------
  152|   600k|  cbor_set_ctrl(item, CBOR_CTRL_NULL);
  153|   600k|  return item;
  154|   600k|}
cbor_new_undef:
  156|  31.0k|cbor_item_t* cbor_new_undef(void) {
  157|  31.0k|  cbor_item_t* item = cbor_new_ctrl();
  158|  31.0k|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|  31.0k|  do {                           \
  |  |  127|  31.0k|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 31.0k]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|  31.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 31.0k]
  |  |  ------------------
  ------------------
  159|  31.0k|  cbor_set_ctrl(item, CBOR_CTRL_UNDEF);
  160|  31.0k|  return item;
  161|  31.0k|}
cbor_build_bool:
  163|   814k|cbor_item_t* cbor_build_bool(bool value) {
  164|   814k|  return cbor_build_ctrl(value ? CBOR_CTRL_TRUE : CBOR_CTRL_FALSE);
  ------------------
  |  Branch (164:26): [True: 757k, False: 57.1k]
  ------------------
  165|   814k|}
cbor_build_float2:
  167|  38.1k|cbor_item_t* cbor_build_float2(float value) {
  168|  38.1k|  cbor_item_t* item = cbor_new_float2();
  169|  38.1k|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|  38.1k|  do {                           \
  |  |  127|  38.1k|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 38.1k]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|  38.1k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 38.1k]
  |  |  ------------------
  ------------------
  170|  38.1k|  cbor_set_float2(item, value);
  171|  38.1k|  return item;
  172|  38.1k|}
cbor_build_float4:
  174|  9.11k|cbor_item_t* cbor_build_float4(float value) {
  175|  9.11k|  cbor_item_t* item = cbor_new_float4();
  176|  9.11k|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|  9.11k|  do {                           \
  |  |  127|  9.11k|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 9.11k]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|  9.11k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 9.11k]
  |  |  ------------------
  ------------------
  177|  9.11k|  cbor_set_float4(item, value);
  178|  9.11k|  return item;
  179|  9.11k|}
cbor_build_float8:
  181|  14.3k|cbor_item_t* cbor_build_float8(double value) {
  182|  14.3k|  cbor_item_t* item = cbor_new_float8();
  183|  14.3k|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|  14.3k|  do {                           \
  |  |  127|  14.3k|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 14.3k]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|  14.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 14.3k]
  |  |  ------------------
  ------------------
  184|  14.3k|  cbor_set_float8(item, value);
  185|  14.3k|  return item;
  186|  14.3k|}
cbor_build_ctrl:
  188|  1.00M|cbor_item_t* cbor_build_ctrl(uint8_t value) {
  189|  1.00M|  cbor_item_t* item = cbor_new_ctrl();
  190|  1.00M|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|  1.00M|  do {                           \
  |  |  127|  1.00M|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 1.00M]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|  1.00M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 1.00M]
  |  |  ------------------
  ------------------
  191|  1.00M|  cbor_set_ctrl(item, value);
  192|  1.00M|  return item;
  193|  1.00M|}

_cbor_builder_append:
   25|  24.1M|                          struct _cbor_decoder_context* ctx) {
   26|  24.1M|  if (ctx->stack->size == 0) {
  ------------------
  |  Branch (26:7): [True: 1.07k, False: 24.1M]
  ------------------
   27|       |    /* Top level item */
   28|  1.07k|    ctx->root = item;
   29|  1.07k|    return;
   30|  1.07k|  }
   31|       |  /* Part of a bigger structure */
   32|  24.1M|  switch (ctx->stack->top->item->type) {
   33|       |    // Handle Arrays and Maps since they can contain subitems of any type.
   34|       |    // Byte/string construction from chunks is handled in the respective chunk
   35|       |    // handlers.
   36|  20.2M|    case CBOR_TYPE_ARRAY: {
  ------------------
  |  Branch (36:5): [True: 20.2M, False: 3.88M]
  ------------------
   37|  20.2M|      if (cbor_array_is_definite(ctx->stack->top->item)) {
  ------------------
  |  Branch (37:11): [True: 10.0M, False: 10.2M]
  ------------------
   38|       |        // We don't need an explicit check for whether the item still belongs
   39|       |        // into this array because if there are extra items, they will cause a
   40|       |        // syntax error when decoded.
   41|  10.0M|        CBOR_ASSERT(ctx->stack->top->subitems > 0);
  ------------------
  |  |   64|  10.0M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (41:9): [True: 0, False: 10.0M]
  |  Branch (41:9): [True: 10.0M, False: 0]
  ------------------
   42|       |        // This should never happen since the definite array should be
   43|       |        // preallocated for the expected number of items.
   44|  10.0M|        if (!cbor_array_push(ctx->stack->top->item, item)) {
  ------------------
  |  Branch (44:13): [True: 0, False: 10.0M]
  ------------------
   45|      0|          ctx->creation_failed = true;
   46|      0|          cbor_decref(&item);
   47|      0|          break;
   48|      0|        }
   49|  10.0M|        cbor_decref(&item);
   50|  10.0M|        ctx->stack->top->subitems--;
   51|  10.0M|        if (ctx->stack->top->subitems == 0) {
  ------------------
  |  Branch (51:13): [True: 9.46M, False: 617k]
  ------------------
   52|  9.46M|          cbor_item_t* stack_item = ctx->stack->top->item;
   53|  9.46M|          _cbor_stack_pop(ctx->stack);
   54|  9.46M|          _cbor_builder_append(stack_item, ctx);
   55|  9.46M|        }
   56|  10.2M|      } else {
   57|       |        /* Indefinite array, don't bother with subitems */
   58|  10.2M|        if (!cbor_array_push(ctx->stack->top->item, item)) {
  ------------------
  |  Branch (58:13): [True: 1, False: 10.2M]
  ------------------
   59|      1|          ctx->creation_failed = true;
   60|      1|        }
   61|  10.2M|        cbor_decref(&item);
   62|  10.2M|      }
   63|  20.2M|      break;
   64|  20.2M|    }
   65|  20.2M|    case CBOR_TYPE_MAP: {
  ------------------
  |  Branch (65:5): [True: 3.57M, False: 20.6M]
  ------------------
   66|       |      // Handle both definite and indefinite maps the same initially.
   67|       |      // Note: We use 0 and 1 subitems to distinguish between keys and values in
   68|       |      // indefinite items
   69|  3.57M|      if (ctx->stack->top->subitems % 2) {
  ------------------
  |  Branch (69:11): [True: 1.78M, False: 1.78M]
  ------------------
   70|       |        // Odd record, this is a value.
   71|  1.78M|        ctx->creation_failed =
   72|  1.78M|            !_cbor_map_add_value(ctx->stack->top->item, item);
   73|       |        // Adding a value never fails since the memory is allocated when the
   74|       |        // key is added
   75|  1.78M|        CBOR_ASSERT(!ctx->creation_failed);
  ------------------
  |  |   64|  1.78M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (75:9): [True: 0, False: 1.78M]
  |  Branch (75:9): [True: 1.78M, False: 0]
  ------------------
   76|  1.78M|      } else {
   77|       |        // Even record, this is a key.
   78|  1.78M|        if (!_cbor_map_add_key(ctx->stack->top->item, item)) {
  ------------------
  |  Branch (78:13): [True: 0, False: 1.78M]
  ------------------
   79|      0|          ctx->creation_failed = true;
   80|      0|          cbor_decref(&item);
   81|      0|          break;
   82|      0|        }
   83|  1.78M|      }
   84|  3.57M|      cbor_decref(&item);
   85|  3.57M|      if (cbor_map_is_definite(ctx->stack->top->item)) {
  ------------------
  |  Branch (85:11): [True: 1.29M, False: 2.27M]
  ------------------
   86|  1.29M|        CBOR_ASSERT(ctx->stack->top->subitems > 0);
  ------------------
  |  |   64|  1.29M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (86:9): [True: 0, False: 1.29M]
  |  Branch (86:9): [True: 1.29M, False: 0]
  ------------------
   87|  1.29M|        ctx->stack->top->subitems--;
   88|  1.29M|        if (ctx->stack->top->subitems == 0) {
  ------------------
  |  Branch (88:13): [True: 49.6k, False: 1.24M]
  ------------------
   89|  49.6k|          cbor_item_t* map_entry = ctx->stack->top->item;
   90|  49.6k|          _cbor_stack_pop(ctx->stack);
   91|  49.6k|          _cbor_builder_append(map_entry, ctx);
   92|  49.6k|        }
   93|  2.27M|      } else {
   94|  2.27M|        ctx->stack->top->subitems ^=
   95|  2.27M|            1; /* Flip the indicator for indefinite items */
   96|  2.27M|      }
   97|  3.57M|      break;
   98|  3.57M|    }
   99|  3.57M|    case CBOR_TYPE_TAG: {
  ------------------
  |  Branch (99:5): [True: 317k, False: 23.8M]
  ------------------
  100|   317k|      CBOR_ASSERT(ctx->stack->top->subitems == 1);
  ------------------
  |  |   64|   317k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (100:7): [True: 0, False: 317k]
  |  Branch (100:7): [True: 317k, False: 0]
  ------------------
  101|   317k|      cbor_tag_set_item(ctx->stack->top->item, item);
  102|   317k|      cbor_decref(&item); /* Give up on our reference */
  103|   317k|      cbor_item_t* tagged_item = ctx->stack->top->item;
  104|   317k|      _cbor_stack_pop(ctx->stack);
  105|   317k|      _cbor_builder_append(tagged_item, ctx);
  106|   317k|      break;
  107|   317k|    }
  108|       |    // We have an item to append but nothing to append it to.
  109|     66|    default: {
  ------------------
  |  Branch (109:5): [True: 66, False: 24.1M]
  ------------------
  110|     66|      cbor_decref(&item);
  111|     66|      ctx->syntax_error = true;
  112|     66|    }
  113|  24.1M|  }
  114|  24.1M|}
cbor_builder_uint8_callback:
  144|  8.57M|void cbor_builder_uint8_callback(void* context, uint8_t value) {
  145|  8.57M|  struct _cbor_decoder_context* ctx = context;
  146|  8.57M|  cbor_item_t* res = cbor_new_int8();
  147|  8.57M|  CHECK_RES(ctx, res);
  ------------------
  |  |  117|  8.57M|  do {                             \
  |  |  118|  8.57M|    if (res == NULL) {             \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 1, False: 8.57M]
  |  |  ------------------
  |  |  119|      1|      ctx->creation_failed = true; \
  |  |  120|      1|      return;                      \
  |  |  121|      1|    }                              \
  |  |  122|  8.57M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (122:12): [Folded, False: 8.57M]
  |  |  ------------------
  ------------------
  148|  8.57M|  cbor_mark_uint(res);
  149|  8.57M|  cbor_set_uint8(res, value);
  150|  8.57M|  _cbor_builder_append(res, ctx);
  151|  8.57M|}
cbor_builder_uint16_callback:
  153|  6.62k|void cbor_builder_uint16_callback(void* context, uint16_t value) {
  154|  6.62k|  struct _cbor_decoder_context* ctx = context;
  155|  6.62k|  cbor_item_t* res = cbor_new_int16();
  156|  6.62k|  CHECK_RES(ctx, res);
  ------------------
  |  |  117|  6.62k|  do {                             \
  |  |  118|  6.62k|    if (res == NULL) {             \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 0, False: 6.62k]
  |  |  ------------------
  |  |  119|      0|      ctx->creation_failed = true; \
  |  |  120|      0|      return;                      \
  |  |  121|      0|    }                              \
  |  |  122|  6.62k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (122:12): [Folded, False: 6.62k]
  |  |  ------------------
  ------------------
  157|  6.62k|  cbor_mark_uint(res);
  158|  6.62k|  cbor_set_uint16(res, value);
  159|  6.62k|  _cbor_builder_append(res, ctx);
  160|  6.62k|}
cbor_builder_uint32_callback:
  162|   304k|void cbor_builder_uint32_callback(void* context, uint32_t value) {
  163|   304k|  struct _cbor_decoder_context* ctx = context;
  164|   304k|  cbor_item_t* res = cbor_new_int32();
  165|   304k|  CHECK_RES(ctx, res);
  ------------------
  |  |  117|   304k|  do {                             \
  |  |  118|   304k|    if (res == NULL) {             \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 0, False: 304k]
  |  |  ------------------
  |  |  119|      0|      ctx->creation_failed = true; \
  |  |  120|      0|      return;                      \
  |  |  121|      0|    }                              \
  |  |  122|   304k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (122:12): [Folded, False: 304k]
  |  |  ------------------
  ------------------
  166|   304k|  cbor_mark_uint(res);
  167|   304k|  cbor_set_uint32(res, value);
  168|   304k|  _cbor_builder_append(res, ctx);
  169|   304k|}
cbor_builder_uint64_callback:
  171|  13.6k|void cbor_builder_uint64_callback(void* context, uint64_t value) {
  172|  13.6k|  struct _cbor_decoder_context* ctx = context;
  173|  13.6k|  cbor_item_t* res = cbor_new_int64();
  174|  13.6k|  CHECK_RES(ctx, res);
  ------------------
  |  |  117|  13.6k|  do {                             \
  |  |  118|  13.6k|    if (res == NULL) {             \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 0, False: 13.6k]
  |  |  ------------------
  |  |  119|      0|      ctx->creation_failed = true; \
  |  |  120|      0|      return;                      \
  |  |  121|      0|    }                              \
  |  |  122|  13.6k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (122:12): [Folded, False: 13.6k]
  |  |  ------------------
  ------------------
  175|  13.6k|  cbor_mark_uint(res);
  176|  13.6k|  cbor_set_uint64(res, value);
  177|  13.6k|  _cbor_builder_append(res, ctx);
  178|  13.6k|}
cbor_builder_negint8_callback:
  180|  2.79M|void cbor_builder_negint8_callback(void* context, uint8_t value) {
  181|  2.79M|  struct _cbor_decoder_context* ctx = context;
  182|  2.79M|  cbor_item_t* res = cbor_new_int8();
  183|  2.79M|  CHECK_RES(ctx, res);
  ------------------
  |  |  117|  2.79M|  do {                             \
  |  |  118|  2.79M|    if (res == NULL) {             \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 3, False: 2.79M]
  |  |  ------------------
  |  |  119|      3|      ctx->creation_failed = true; \
  |  |  120|      3|      return;                      \
  |  |  121|      3|    }                              \
  |  |  122|  2.79M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (122:12): [Folded, False: 2.79M]
  |  |  ------------------
  ------------------
  184|  2.79M|  cbor_mark_negint(res);
  185|  2.79M|  cbor_set_uint8(res, value);
  186|  2.79M|  _cbor_builder_append(res, ctx);
  187|  2.79M|}
cbor_builder_negint16_callback:
  189|  27.7k|void cbor_builder_negint16_callback(void* context, uint16_t value) {
  190|  27.7k|  struct _cbor_decoder_context* ctx = context;
  191|  27.7k|  cbor_item_t* res = cbor_new_int16();
  192|  27.7k|  CHECK_RES(ctx, res);
  ------------------
  |  |  117|  27.7k|  do {                             \
  |  |  118|  27.7k|    if (res == NULL) {             \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 0, False: 27.7k]
  |  |  ------------------
  |  |  119|      0|      ctx->creation_failed = true; \
  |  |  120|      0|      return;                      \
  |  |  121|      0|    }                              \
  |  |  122|  27.7k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (122:12): [Folded, False: 27.7k]
  |  |  ------------------
  ------------------
  193|  27.7k|  cbor_mark_negint(res);
  194|  27.7k|  cbor_set_uint16(res, value);
  195|  27.7k|  _cbor_builder_append(res, ctx);
  196|  27.7k|}
cbor_builder_negint32_callback:
  198|  11.8k|void cbor_builder_negint32_callback(void* context, uint32_t value) {
  199|  11.8k|  struct _cbor_decoder_context* ctx = context;
  200|  11.8k|  cbor_item_t* res = cbor_new_int32();
  201|  11.8k|  CHECK_RES(ctx, res);
  ------------------
  |  |  117|  11.8k|  do {                             \
  |  |  118|  11.8k|    if (res == NULL) {             \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 0, False: 11.8k]
  |  |  ------------------
  |  |  119|      0|      ctx->creation_failed = true; \
  |  |  120|      0|      return;                      \
  |  |  121|      0|    }                              \
  |  |  122|  11.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (122:12): [Folded, False: 11.8k]
  |  |  ------------------
  ------------------
  202|  11.8k|  cbor_mark_negint(res);
  203|  11.8k|  cbor_set_uint32(res, value);
  204|  11.8k|  _cbor_builder_append(res, ctx);
  205|  11.8k|}
cbor_builder_negint64_callback:
  207|  3.97k|void cbor_builder_negint64_callback(void* context, uint64_t value) {
  208|  3.97k|  struct _cbor_decoder_context* ctx = context;
  209|  3.97k|  cbor_item_t* res = cbor_new_int64();
  210|  3.97k|  CHECK_RES(ctx, res);
  ------------------
  |  |  117|  3.97k|  do {                             \
  |  |  118|  3.97k|    if (res == NULL) {             \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 0, False: 3.97k]
  |  |  ------------------
  |  |  119|      0|      ctx->creation_failed = true; \
  |  |  120|      0|      return;                      \
  |  |  121|      0|    }                              \
  |  |  122|  3.97k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (122:12): [Folded, False: 3.97k]
  |  |  ------------------
  ------------------
  211|  3.97k|  cbor_mark_negint(res);
  212|  3.97k|  cbor_set_uint64(res, value);
  213|  3.97k|  _cbor_builder_append(res, ctx);
  214|  3.97k|}
cbor_builder_byte_string_callback:
  217|  1.16M|                                       uint64_t length) {
  218|  1.16M|  struct _cbor_decoder_context* ctx = context;
  219|  1.16M|  CHECK_LENGTH(ctx, length);
  ------------------
  |  |  129|  1.16M|  do {                             \
  |  |  130|  1.16M|    if (length > SIZE_MAX) {       \
  |  |  ------------------
  |  |  |  Branch (130:9): [True: 0, False: 1.16M]
  |  |  ------------------
  |  |  131|      0|      ctx->creation_failed = true; \
  |  |  132|      0|      return;                      \
  |  |  133|      0|    }                              \
  |  |  134|  1.16M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (134:12): [Folded, False: 1.16M]
  |  |  ------------------
  ------------------
  220|  1.16M|  unsigned char* new_handle = _cbor_malloc(length);
  221|  1.16M|  if (new_handle == NULL) {
  ------------------
  |  Branch (221:7): [True: 30, False: 1.16M]
  ------------------
  222|     30|    ctx->creation_failed = true;
  223|     30|    return;
  224|     30|  }
  225|       |
  226|  1.16M|  memcpy(new_handle, data, length);
  227|  1.16M|  cbor_item_t* new_chunk = cbor_new_definite_bytestring();
  228|       |
  229|  1.16M|  if (new_chunk == NULL) {
  ------------------
  |  Branch (229:7): [True: 0, False: 1.16M]
  ------------------
  230|      0|    _cbor_free(new_handle);
  231|      0|    ctx->creation_failed = true;
  232|      0|    return;
  233|      0|  }
  234|       |
  235|  1.16M|  cbor_bytestring_set_handle(new_chunk, new_handle, length);
  236|       |
  237|       |  // If an indef bytestring is on the stack, extend it (if it were closed, it
  238|       |  // would have been popped). Handle any syntax errors upstream.
  239|  1.16M|  if (ctx->stack->size > 0 && cbor_isa_bytestring(ctx->stack->top->item) &&
  ------------------
  |  Branch (239:7): [True: 1.16M, False: 17]
  |  Branch (239:31): [True: 914k, False: 251k]
  ------------------
  240|   914k|      cbor_bytestring_is_indefinite(ctx->stack->top->item)) {
  ------------------
  |  Branch (240:7): [True: 914k, False: 0]
  ------------------
  241|   914k|    if (!cbor_bytestring_add_chunk(ctx->stack->top->item, new_chunk)) {
  ------------------
  |  Branch (241:9): [True: 0, False: 914k]
  ------------------
  242|      0|      ctx->creation_failed = true;
  243|      0|    }
  244|   914k|    cbor_decref(&new_chunk);
  245|   914k|  } else {
  246|   251k|    _cbor_builder_append(new_chunk, ctx);
  247|   251k|  }
  248|  1.16M|}
cbor_builder_byte_string_start_callback:
  250|  1.66k|void cbor_builder_byte_string_start_callback(void* context) {
  251|  1.66k|  struct _cbor_decoder_context* ctx = context;
  252|  1.66k|  cbor_item_t* res = cbor_new_indefinite_bytestring();
  253|  1.66k|  CHECK_RES(ctx, res);
  ------------------
  |  |  117|  1.66k|  do {                             \
  |  |  118|  1.66k|    if (res == NULL) {             \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 0, False: 1.66k]
  |  |  ------------------
  |  |  119|      0|      ctx->creation_failed = true; \
  |  |  120|      0|      return;                      \
  |  |  121|      0|    }                              \
  |  |  122|  1.66k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (122:12): [Folded, False: 1.66k]
  |  |  ------------------
  ------------------
  254|  1.66k|  PUSH_CTX_STACK(ctx, res, 0);
  ------------------
  |  |  137|  1.66k|  do {                                                         \
  |  |  138|  1.66k|    if (_cbor_stack_push(ctx->stack, res, subitems) == NULL) { \
  |  |  ------------------
  |  |  |  Branch (138:9): [True: 1, False: 1.66k]
  |  |  ------------------
  |  |  139|      1|      cbor_decref(&res);                                       \
  |  |  140|      1|      ctx->creation_failed = true;                             \
  |  |  141|      1|    }                                                          \
  |  |  142|  1.66k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (142:12): [Folded, False: 1.66k]
  |  |  ------------------
  ------------------
  255|  1.66k|}
cbor_builder_string_callback:
  258|   807k|                                  uint64_t length) {
  259|   807k|  struct _cbor_decoder_context* ctx = context;
  260|   807k|  CHECK_LENGTH(ctx, length);
  ------------------
  |  |  129|   807k|  do {                             \
  |  |  130|   807k|    if (length > SIZE_MAX) {       \
  |  |  ------------------
  |  |  |  Branch (130:9): [True: 0, False: 807k]
  |  |  ------------------
  |  |  131|      0|      ctx->creation_failed = true; \
  |  |  132|      0|      return;                      \
  |  |  133|      0|    }                              \
  |  |  134|   807k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (134:12): [Folded, False: 807k]
  |  |  ------------------
  ------------------
  261|       |
  262|   807k|  unsigned char* new_handle = _cbor_malloc(length);
  263|   807k|  if (new_handle == NULL) {
  ------------------
  |  Branch (263:7): [True: 30, False: 807k]
  ------------------
  264|     30|    ctx->creation_failed = true;
  265|     30|    return;
  266|     30|  }
  267|       |
  268|   807k|  memcpy(new_handle, data, length);
  269|   807k|  cbor_item_t* new_chunk = cbor_new_definite_string();
  270|   807k|  if (new_chunk == NULL) {
  ------------------
  |  Branch (270:7): [True: 0, False: 807k]
  ------------------
  271|      0|    _cbor_free(new_handle);
  272|      0|    ctx->creation_failed = true;
  273|      0|    return;
  274|      0|  }
  275|   807k|  cbor_string_set_handle(new_chunk, new_handle, length);
  276|       |
  277|       |  // If an indef string is on the stack, extend it (if it were closed, it would
  278|       |  // have been popped). Handle any syntax errors upstream.
  279|   807k|  if (ctx->stack->size > 0 && cbor_isa_string(ctx->stack->top->item) &&
  ------------------
  |  Branch (279:7): [True: 807k, False: 17]
  |  Branch (279:31): [True: 368k, False: 438k]
  ------------------
  280|   368k|      cbor_string_is_indefinite(ctx->stack->top->item)) {
  ------------------
  |  Branch (280:7): [True: 368k, False: 0]
  ------------------
  281|   368k|    if (!cbor_string_add_chunk(ctx->stack->top->item, new_chunk)) {
  ------------------
  |  Branch (281:9): [True: 0, False: 368k]
  ------------------
  282|      0|      ctx->creation_failed = true;
  283|      0|    }
  284|   368k|    cbor_decref(&new_chunk);
  285|   438k|  } else {
  286|   438k|    _cbor_builder_append(new_chunk, ctx);
  287|   438k|  }
  288|   807k|}
cbor_builder_string_start_callback:
  290|  5.18k|void cbor_builder_string_start_callback(void* context) {
  291|  5.18k|  struct _cbor_decoder_context* ctx = context;
  292|  5.18k|  cbor_item_t* res = cbor_new_indefinite_string();
  293|  5.18k|  CHECK_RES(ctx, res);
  ------------------
  |  |  117|  5.18k|  do {                             \
  |  |  118|  5.18k|    if (res == NULL) {             \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 0, False: 5.18k]
  |  |  ------------------
  |  |  119|      0|      ctx->creation_failed = true; \
  |  |  120|      0|      return;                      \
  |  |  121|      0|    }                              \
  |  |  122|  5.18k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (122:12): [Folded, False: 5.18k]
  |  |  ------------------
  ------------------
  294|  5.18k|  PUSH_CTX_STACK(ctx, res, 0);
  ------------------
  |  |  137|  5.18k|  do {                                                         \
  |  |  138|  5.18k|    if (_cbor_stack_push(ctx->stack, res, subitems) == NULL) { \
  |  |  ------------------
  |  |  |  Branch (138:9): [True: 1, False: 5.18k]
  |  |  ------------------
  |  |  139|      1|      cbor_decref(&res);                                       \
  |  |  140|      1|      ctx->creation_failed = true;                             \
  |  |  141|      1|    }                                                          \
  |  |  142|  5.18k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (142:12): [Folded, False: 5.18k]
  |  |  ------------------
  ------------------
  295|  5.18k|}
cbor_builder_array_start_callback:
  297|  9.50M|void cbor_builder_array_start_callback(void* context, uint64_t size) {
  298|  9.50M|  struct _cbor_decoder_context* ctx = context;
  299|  9.50M|  CHECK_LENGTH(ctx, size);
  ------------------
  |  |  129|  9.50M|  do {                             \
  |  |  130|  9.50M|    if (length > SIZE_MAX) {       \
  |  |  ------------------
  |  |  |  Branch (130:9): [True: 0, False: 9.50M]
  |  |  ------------------
  |  |  131|      0|      ctx->creation_failed = true; \
  |  |  132|      0|      return;                      \
  |  |  133|      0|    }                              \
  |  |  134|  9.50M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (134:12): [Folded, False: 9.50M]
  |  |  ------------------
  ------------------
  300|  9.50M|  cbor_item_t* res = cbor_new_definite_array(size);
  301|  9.50M|  CHECK_RES(ctx, res);
  ------------------
  |  |  117|  9.50M|  do {                             \
  |  |  118|  9.50M|    if (res == NULL) {             \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 82, False: 9.50M]
  |  |  ------------------
  |  |  119|     82|      ctx->creation_failed = true; \
  |  |  120|     82|      return;                      \
  |  |  121|     82|    }                              \
  |  |  122|  9.50M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (122:12): [Folded, False: 9.50M]
  |  |  ------------------
  ------------------
  302|  9.50M|  if (size > 0) {
  ------------------
  |  Branch (302:7): [True: 9.50M, False: 0]
  ------------------
  303|  9.50M|    PUSH_CTX_STACK(ctx, res, size);
  ------------------
  |  |  137|  9.50M|  do {                                                         \
  |  |  138|  9.50M|    if (_cbor_stack_push(ctx->stack, res, subitems) == NULL) { \
  |  |  ------------------
  |  |  |  Branch (138:9): [True: 8, False: 9.50M]
  |  |  ------------------
  |  |  139|      8|      cbor_decref(&res);                                       \
  |  |  140|      8|      ctx->creation_failed = true;                             \
  |  |  141|      8|    }                                                          \
  |  |  142|  9.50M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (142:12): [Folded, False: 9.50M]
  |  |  ------------------
  ------------------
  304|  9.50M|  } else {
  305|      0|    _cbor_builder_append(res, ctx);
  306|      0|  }
  307|  9.50M|}
cbor_builder_indef_array_start_callback:
  309|   396k|void cbor_builder_indef_array_start_callback(void* context) {
  310|   396k|  struct _cbor_decoder_context* ctx = context;
  311|   396k|  cbor_item_t* res = cbor_new_indefinite_array();
  312|   396k|  CHECK_RES(ctx, res);
  ------------------
  |  |  117|   396k|  do {                             \
  |  |  118|   396k|    if (res == NULL) {             \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 0, False: 396k]
  |  |  ------------------
  |  |  119|      0|      ctx->creation_failed = true; \
  |  |  120|      0|      return;                      \
  |  |  121|      0|    }                              \
  |  |  122|   396k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (122:12): [Folded, False: 396k]
  |  |  ------------------
  ------------------
  313|   396k|  PUSH_CTX_STACK(ctx, res, 0);
  ------------------
  |  |  137|   396k|  do {                                                         \
  |  |  138|   396k|    if (_cbor_stack_push(ctx->stack, res, subitems) == NULL) { \
  |  |  ------------------
  |  |  |  Branch (138:9): [True: 1, False: 396k]
  |  |  ------------------
  |  |  139|      1|      cbor_decref(&res);                                       \
  |  |  140|      1|      ctx->creation_failed = true;                             \
  |  |  141|      1|    }                                                          \
  |  |  142|   396k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (142:12): [Folded, False: 396k]
  |  |  ------------------
  ------------------
  314|   396k|}
cbor_builder_indef_map_start_callback:
  316|  7.45k|void cbor_builder_indef_map_start_callback(void* context) {
  317|  7.45k|  struct _cbor_decoder_context* ctx = context;
  318|  7.45k|  cbor_item_t* res = cbor_new_indefinite_map();
  319|  7.45k|  CHECK_RES(ctx, res);
  ------------------
  |  |  117|  7.45k|  do {                             \
  |  |  118|  7.45k|    if (res == NULL) {             \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 0, False: 7.45k]
  |  |  ------------------
  |  |  119|      0|      ctx->creation_failed = true; \
  |  |  120|      0|      return;                      \
  |  |  121|      0|    }                              \
  |  |  122|  7.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (122:12): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  320|  7.45k|  PUSH_CTX_STACK(ctx, res, 0);
  ------------------
  |  |  137|  7.45k|  do {                                                         \
  |  |  138|  7.45k|    if (_cbor_stack_push(ctx->stack, res, subitems) == NULL) { \
  |  |  ------------------
  |  |  |  Branch (138:9): [True: 2, False: 7.45k]
  |  |  ------------------
  |  |  139|      2|      cbor_decref(&res);                                       \
  |  |  140|      2|      ctx->creation_failed = true;                             \
  |  |  141|      2|    }                                                          \
  |  |  142|  7.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (142:12): [Folded, False: 7.45k]
  |  |  ------------------
  ------------------
  321|  7.45k|}
cbor_builder_map_start_callback:
  323|  78.9k|void cbor_builder_map_start_callback(void* context, uint64_t size) {
  324|  78.9k|  struct _cbor_decoder_context* ctx = context;
  325|  78.9k|  CHECK_LENGTH(ctx, size);
  ------------------
  |  |  129|  78.9k|  do {                             \
  |  |  130|  78.9k|    if (length > SIZE_MAX) {       \
  |  |  ------------------
  |  |  |  Branch (130:9): [True: 0, False: 78.9k]
  |  |  ------------------
  |  |  131|      0|      ctx->creation_failed = true; \
  |  |  132|      0|      return;                      \
  |  |  133|      0|    }                              \
  |  |  134|  78.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (134:12): [Folded, False: 78.9k]
  |  |  ------------------
  ------------------
  326|       |  // Each map entry requires two subitems (key + value). Guard against
  327|       |  // overflow in size * 2 before it is used as the subitems count.
  328|  78.9k|  if (size > SIZE_MAX / 2) {
  ------------------
  |  Branch (328:7): [True: 57, False: 78.9k]
  ------------------
  329|     57|    ctx->creation_failed = true;
  330|     57|    return;
  331|     57|  }
  332|  78.9k|  cbor_item_t* res = cbor_new_definite_map(size);
  333|  78.9k|  CHECK_RES(ctx, res);
  ------------------
  |  |  117|  78.9k|  do {                             \
  |  |  118|  78.9k|    if (res == NULL) {             \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 42, False: 78.8k]
  |  |  ------------------
  |  |  119|     42|      ctx->creation_failed = true; \
  |  |  120|     42|      return;                      \
  |  |  121|     42|    }                              \
  |  |  122|  78.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (122:12): [Folded, False: 78.8k]
  |  |  ------------------
  ------------------
  334|  78.8k|  if (size > 0) {
  ------------------
  |  Branch (334:7): [True: 78.8k, False: 0]
  ------------------
  335|  78.8k|    PUSH_CTX_STACK(ctx, res, size * 2);
  ------------------
  |  |  137|  78.8k|  do {                                                         \
  |  |  138|  78.8k|    if (_cbor_stack_push(ctx->stack, res, subitems) == NULL) { \
  |  |  ------------------
  |  |  |  Branch (138:9): [True: 2, False: 78.8k]
  |  |  ------------------
  |  |  139|      2|      cbor_decref(&res);                                       \
  |  |  140|      2|      ctx->creation_failed = true;                             \
  |  |  141|      2|    }                                                          \
  |  |  142|  78.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (142:12): [Folded, False: 78.8k]
  |  |  ------------------
  ------------------
  336|  78.8k|  } else {
  337|      0|    _cbor_builder_append(res, ctx);
  338|      0|  }
  339|  78.8k|}
_cbor_is_indefinite:
  344|   382k|bool _cbor_is_indefinite(cbor_item_t* item) {
  345|   382k|  switch (item->type) {
  346|  1.04k|    case CBOR_TYPE_BYTESTRING:
  ------------------
  |  Branch (346:5): [True: 1.04k, False: 381k]
  ------------------
  347|  1.04k|      return cbor_bytestring_is_indefinite(item);
  348|  4.52k|    case CBOR_TYPE_STRING:
  ------------------
  |  Branch (348:5): [True: 4.52k, False: 378k]
  ------------------
  349|  4.52k|      return cbor_string_is_indefinite(item);
  350|   374k|    case CBOR_TYPE_ARRAY:
  ------------------
  |  Branch (350:5): [True: 374k, False: 8.51k]
  ------------------
  351|   374k|      return cbor_array_is_indefinite(item);
  352|  2.94k|    case CBOR_TYPE_MAP:
  ------------------
  |  Branch (352:5): [True: 2.94k, False: 379k]
  ------------------
  353|  2.94k|      return cbor_map_is_indefinite(item);
  354|      4|    default:
  ------------------
  |  Branch (354:5): [True: 4, False: 382k]
  ------------------
  355|       |      // Should never happen since a non-nested item cannot be on top of the
  356|       |      // stack.
  357|      4|      return false;
  358|   382k|  }
  359|   382k|}
cbor_builder_indef_break_callback:
  361|   382k|void cbor_builder_indef_break_callback(void* context) {
  362|   382k|  struct _cbor_decoder_context* ctx = context;
  363|       |  /* There must be an item to break out of*/
  364|   382k|  if (ctx->stack->size > 0) {
  ------------------
  |  Branch (364:7): [True: 382k, False: 1]
  ------------------
  365|   382k|    cbor_item_t* item = ctx->stack->top->item;
  366|   382k|    if (_cbor_is_indefinite(
  ------------------
  |  Branch (366:9): [True: 382k, False: 22]
  ------------------
  367|   382k|            item) && /* Only indefinite items can be terminated by 0xFF */
  368|       |        /* Special case: we cannot append up if an indefinite map is incomplete
  369|       |           (we are expecting a value). */
  370|   382k|        (item->type != CBOR_TYPE_MAP || ctx->stack->top->subitems % 2 == 0)) {
  ------------------
  |  Branch (370:10): [True: 379k, False: 2.93k]
  |  Branch (370:41): [True: 2.93k, False: 7]
  ------------------
  371|   382k|      _cbor_stack_pop(ctx->stack);
  372|   382k|      _cbor_builder_append(item, ctx);
  373|   382k|      return;
  374|   382k|    }
  375|   382k|  }
  376|       |
  377|     30|  ctx->syntax_error = true;
  378|     30|}
cbor_builder_float2_callback:
  380|  55.1k|void cbor_builder_float2_callback(void* context, float value) {
  381|  55.1k|  struct _cbor_decoder_context* ctx = context;
  382|  55.1k|  cbor_item_t* res = cbor_new_float2();
  383|  55.1k|  CHECK_RES(ctx, res);
  ------------------
  |  |  117|  55.1k|  do {                             \
  |  |  118|  55.1k|    if (res == NULL) {             \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 0, False: 55.1k]
  |  |  ------------------
  |  |  119|      0|      ctx->creation_failed = true; \
  |  |  120|      0|      return;                      \
  |  |  121|      0|    }                              \
  |  |  122|  55.1k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (122:12): [Folded, False: 55.1k]
  |  |  ------------------
  ------------------
  384|  55.1k|  cbor_set_float2(res, value);
  385|  55.1k|  _cbor_builder_append(res, ctx);
  386|  55.1k|}
cbor_builder_float4_callback:
  388|  11.6k|void cbor_builder_float4_callback(void* context, float value) {
  389|  11.6k|  struct _cbor_decoder_context* ctx = context;
  390|  11.6k|  cbor_item_t* res = cbor_new_float4();
  391|  11.6k|  CHECK_RES(ctx, res);
  ------------------
  |  |  117|  11.6k|  do {                             \
  |  |  118|  11.6k|    if (res == NULL) {             \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 0, False: 11.6k]
  |  |  ------------------
  |  |  119|      0|      ctx->creation_failed = true; \
  |  |  120|      0|      return;                      \
  |  |  121|      0|    }                              \
  |  |  122|  11.6k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (122:12): [Folded, False: 11.6k]
  |  |  ------------------
  ------------------
  392|  11.6k|  cbor_set_float4(res, value);
  393|  11.6k|  _cbor_builder_append(res, ctx);
  394|  11.6k|}
cbor_builder_float8_callback:
  396|  30.4k|void cbor_builder_float8_callback(void* context, double value) {
  397|  30.4k|  struct _cbor_decoder_context* ctx = context;
  398|  30.4k|  cbor_item_t* res = cbor_new_float8();
  399|  30.4k|  CHECK_RES(ctx, res);
  ------------------
  |  |  117|  30.4k|  do {                             \
  |  |  118|  30.4k|    if (res == NULL) {             \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 0, False: 30.4k]
  |  |  ------------------
  |  |  119|      0|      ctx->creation_failed = true; \
  |  |  120|      0|      return;                      \
  |  |  121|      0|    }                              \
  |  |  122|  30.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (122:12): [Folded, False: 30.4k]
  |  |  ------------------
  ------------------
  400|  30.4k|  cbor_set_float8(res, value);
  401|  30.4k|  _cbor_builder_append(res, ctx);
  402|  30.4k|}
cbor_builder_null_callback:
  404|   600k|void cbor_builder_null_callback(void* context) {
  405|   600k|  struct _cbor_decoder_context* ctx = context;
  406|   600k|  cbor_item_t* res = cbor_new_null();
  407|   600k|  CHECK_RES(ctx, res);
  ------------------
  |  |  117|   600k|  do {                             \
  |  |  118|   600k|    if (res == NULL) {             \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 0, False: 600k]
  |  |  ------------------
  |  |  119|      0|      ctx->creation_failed = true; \
  |  |  120|      0|      return;                      \
  |  |  121|      0|    }                              \
  |  |  122|   600k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (122:12): [Folded, False: 600k]
  |  |  ------------------
  ------------------
  408|   600k|  _cbor_builder_append(res, ctx);
  409|   600k|}
cbor_builder_undefined_callback:
  411|  31.0k|void cbor_builder_undefined_callback(void* context) {
  412|  31.0k|  struct _cbor_decoder_context* ctx = context;
  413|  31.0k|  cbor_item_t* res = cbor_new_undef();
  414|  31.0k|  CHECK_RES(ctx, res);
  ------------------
  |  |  117|  31.0k|  do {                             \
  |  |  118|  31.0k|    if (res == NULL) {             \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 0, False: 31.0k]
  |  |  ------------------
  |  |  119|      0|      ctx->creation_failed = true; \
  |  |  120|      0|      return;                      \
  |  |  121|      0|    }                              \
  |  |  122|  31.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (122:12): [Folded, False: 31.0k]
  |  |  ------------------
  ------------------
  415|  31.0k|  _cbor_builder_append(res, ctx);
  416|  31.0k|}
cbor_builder_boolean_callback:
  418|   814k|void cbor_builder_boolean_callback(void* context, bool value) {
  419|   814k|  struct _cbor_decoder_context* ctx = context;
  420|   814k|  cbor_item_t* res = cbor_build_bool(value);
  421|   814k|  CHECK_RES(ctx, res);
  ------------------
  |  |  117|   814k|  do {                             \
  |  |  118|   814k|    if (res == NULL) {             \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 0, False: 814k]
  |  |  ------------------
  |  |  119|      0|      ctx->creation_failed = true; \
  |  |  120|      0|      return;                      \
  |  |  121|      0|    }                              \
  |  |  122|   814k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (122:12): [Folded, False: 814k]
  |  |  ------------------
  ------------------
  422|   814k|  _cbor_builder_append(res, ctx);
  423|   814k|}
cbor_builder_tag_callback:
  425|   345k|void cbor_builder_tag_callback(void* context, uint64_t value) {
  426|   345k|  struct _cbor_decoder_context* ctx = context;
  427|   345k|  cbor_item_t* res = cbor_new_tag(value);
  428|   345k|  CHECK_RES(ctx, res);
  ------------------
  |  |  117|   345k|  do {                             \
  |  |  118|   345k|    if (res == NULL) {             \
  |  |  ------------------
  |  |  |  Branch (118:9): [True: 0, False: 345k]
  |  |  ------------------
  |  |  119|      0|      ctx->creation_failed = true; \
  |  |  120|      0|      return;                      \
  |  |  121|      0|    }                              \
  |  |  122|   345k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (122:12): [Folded, False: 345k]
  |  |  ------------------
  ------------------
  429|   345k|  PUSH_CTX_STACK(ctx, res, 1);
  ------------------
  |  |  137|   345k|  do {                                                         \
  |  |  138|   345k|    if (_cbor_stack_push(ctx->stack, res, subitems) == NULL) { \
  |  |  ------------------
  |  |  |  Branch (138:9): [True: 2, False: 345k]
  |  |  ------------------
  |  |  139|      2|      cbor_decref(&res);                                       \
  |  |  140|      2|      ctx->creation_failed = true;                             \
  |  |  141|      2|    }                                                          \
  |  |  142|   345k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (142:12): [Folded, False: 345k]
  |  |  ------------------
  ------------------
  430|   345k|}

_cbor_encode_uint8:
   13|  11.6M|                          size_t buffer_size, uint8_t offset) {
   14|  11.6M|  if (value <= 23) {
  ------------------
  |  Branch (14:7): [True: 11.6M, False: 24.9k]
  ------------------
   15|  11.6M|    if (buffer_size >= 1) {
  ------------------
  |  Branch (15:9): [True: 11.6M, False: 0]
  ------------------
   16|  11.6M|      buffer[0] = value + offset;
   17|  11.6M|      return 1;
   18|  11.6M|    }
   19|  11.6M|  } else {
   20|  24.9k|    if (buffer_size >= 2) {
  ------------------
  |  Branch (20:9): [True: 24.9k, False: 0]
  ------------------
   21|  24.9k|      buffer[0] = 0x18 + offset;
   22|  24.9k|      buffer[1] = value;
   23|  24.9k|      return 2;
   24|  24.9k|    }
   25|  24.9k|  }
   26|      0|  return 0;
   27|  11.6M|}
_cbor_encode_uint16:
   30|  60.6k|                           size_t buffer_size, uint8_t offset) {
   31|  60.6k|  if (buffer_size < 3) {
  ------------------
  |  Branch (31:7): [True: 0, False: 60.6k]
  ------------------
   32|      0|    return 0;
   33|      0|  }
   34|  60.6k|  buffer[0] = 0x19 + offset;
   35|       |
   36|       |#ifdef IS_BIG_ENDIAN
   37|       |  memcpy(buffer + 1, &value, 2);
   38|       |#else
   39|  60.6k|  buffer[1] = (unsigned char)(value >> 8);
   40|  60.6k|  buffer[2] = (unsigned char)value;
   41|  60.6k|#endif
   42|       |
   43|  60.6k|  return 3;
   44|  60.6k|}
_cbor_encode_uint32:
   47|   231k|                           size_t buffer_size, uint8_t offset) {
   48|   231k|  if (buffer_size < 5) {
  ------------------
  |  Branch (48:7): [True: 0, False: 231k]
  ------------------
   49|      0|    return 0;
   50|      0|  }
   51|   231k|  buffer[0] = 0x1A + offset;
   52|       |
   53|       |#ifdef IS_BIG_ENDIAN
   54|       |  memcpy(buffer + 1, &value, 4);
   55|       |#else
   56|   231k|  buffer[1] = (unsigned char)(value >> 24);
   57|   231k|  buffer[2] = (unsigned char)(value >> 16);
   58|   231k|  buffer[3] = (unsigned char)(value >> 8);
   59|   231k|  buffer[4] = (unsigned char)value;
   60|   231k|#endif
   61|       |
   62|   231k|  return 5;
   63|   231k|}
_cbor_encode_uint64:
   66|  29.7k|                           size_t buffer_size, uint8_t offset) {
   67|  29.7k|  if (buffer_size >= 9) {
  ------------------
  |  Branch (67:7): [True: 29.7k, False: 0]
  ------------------
   68|  29.7k|    buffer[0] = 0x1B + offset;
   69|       |
   70|       |#ifdef IS_BIG_ENDIAN
   71|       |    memcpy(buffer + 1, &value, 8);
   72|       |#else
   73|  29.7k|    buffer[1] = (unsigned char)(value >> 56);
   74|  29.7k|    buffer[2] = (unsigned char)(value >> 48);
   75|  29.7k|    buffer[3] = (unsigned char)(value >> 40);
   76|  29.7k|    buffer[4] = (unsigned char)(value >> 32);
   77|  29.7k|    buffer[5] = (unsigned char)(value >> 24);
   78|  29.7k|    buffer[6] = (unsigned char)(value >> 16);
   79|  29.7k|    buffer[7] = (unsigned char)(value >> 8);
   80|  29.7k|    buffer[8] = (unsigned char)value;
   81|  29.7k|#endif
   82|       |
   83|  29.7k|    return 9;
   84|  29.7k|  } else
   85|      0|    return 0;
   86|  29.7k|}
_cbor_encode_uint:
   89|  5.14M|                         size_t buffer_size, uint8_t offset) {
   90|  5.14M|  if (value <= UINT16_MAX)
  ------------------
  |  Branch (90:7): [True: 5.13M, False: 11.7k]
  ------------------
   91|  5.13M|    if (value <= UINT8_MAX)
  ------------------
  |  Branch (91:9): [True: 5.13M, False: 1.42k]
  ------------------
   92|  5.13M|      return _cbor_encode_uint8((uint8_t)value, buffer, buffer_size, offset);
   93|  1.42k|    else
   94|  1.42k|      return _cbor_encode_uint16((uint16_t)value, buffer, buffer_size, offset);
   95|  11.7k|  else if (value <= UINT32_MAX)
  ------------------
  |  Branch (95:12): [True: 9.13k, False: 2.60k]
  ------------------
   96|  9.13k|    return _cbor_encode_uint32((uint32_t)value, buffer, buffer_size, offset);
   97|  2.60k|  else
   98|  2.60k|    return _cbor_encode_uint64((uint64_t)value, buffer, buffer_size, offset);
   99|  5.14M|}

_cbor_load_uint8:
   12|  23.2M|uint8_t _cbor_load_uint8(cbor_data source) { return (uint8_t)*source; }
_cbor_load_uint16:
   14|  51.9k|uint16_t _cbor_load_uint16(const unsigned char* source) {
   15|       |#ifdef IS_BIG_ENDIAN
   16|       |  uint16_t result;
   17|       |  memcpy(&result, source, 2);
   18|       |  return result;
   19|       |#else
   20|  51.9k|  return ((uint16_t) * (source + 0) << 8) + (uint8_t) * (source + 1);
   21|  51.9k|#endif
   22|  51.9k|}
_cbor_load_uint32:
   24|   341k|uint32_t _cbor_load_uint32(const unsigned char* source) {
   25|       |#ifdef IS_BIG_ENDIAN
   26|       |  uint32_t result;
   27|       |  memcpy(&result, source, 4);
   28|       |  return result;
   29|       |#else
   30|   341k|  return ((uint32_t) * (source + 0) << 0x18) +
   31|   341k|         ((uint32_t) * (source + 1) << 0x10) +
   32|   341k|         ((uint16_t) * (source + 2) << 0x08) + (uint8_t) * (source + 3);
   33|   341k|#endif
   34|   341k|}
_cbor_load_uint64:
   36|  53.6k|uint64_t _cbor_load_uint64(const unsigned char* source) {
   37|       |#ifdef IS_BIG_ENDIAN
   38|       |  uint64_t result;
   39|       |  memcpy(&result, source, 8);
   40|       |  return result;
   41|       |#else
   42|  53.6k|  return ((uint64_t) * (source + 0) << 0x38) +
   43|  53.6k|         ((uint64_t) * (source + 1) << 0x30) +
   44|  53.6k|         ((uint64_t) * (source + 2) << 0x28) +
   45|  53.6k|         ((uint64_t) * (source + 3) << 0x20) +
   46|  53.6k|         ((uint32_t) * (source + 4) << 0x18) +
   47|  53.6k|         ((uint32_t) * (source + 5) << 0x10) +
   48|  53.6k|         ((uint16_t) * (source + 6) << 0x08) + (uint8_t) * (source + 7);
   49|  53.6k|#endif
   50|  53.6k|}
_cbor_decode_half:
   53|  55.1k|float _cbor_decode_half(unsigned char* halfp) {
   54|       |  // TODO: Broken if we are not on IEEE 754
   55|       |  // (https://github.com/PJK/libcbor/issues/336)
   56|  55.1k|  int half = (halfp[0] << 8) + halfp[1];
   57|  55.1k|  int exp = (half >> 10) & 0x1f;
   58|  55.1k|  int mant = half & 0x3ff;
   59|  55.1k|  if (exp == 31 && mant != 0) {
  ------------------
  |  Branch (59:7): [True: 4.81k, False: 50.3k]
  |  Branch (59:20): [True: 3.84k, False: 971]
  ------------------
   60|       |    /* NaN: reconstruct as a single-precision NaN, preserving the sign bit and
   61|       |     * the 10-bit half-precision payload by placing it in the top 10 bits of
   62|       |     * the 23-bit single-precision mantissa. This ensures round-trip fidelity
   63|       |     * with cbor_encode_half's NaN encoding. */
   64|  3.84k|    union _cbor_float_helper helper = {
   65|  3.84k|        .as_uint = ((uint32_t)(half & 0x8000) << 16) | /* sign */
   66|  3.84k|                   0x7F800000u |                       /* exponent (all 1s) */
   67|  3.84k|                   ((uint32_t)mant << 13)};            /* payload */
   68|  3.84k|    return helper.as_float;
   69|  3.84k|  }
   70|  51.3k|  double val;
   71|  51.3k|  if (exp == 0)
  ------------------
  |  Branch (71:7): [True: 17.7k, False: 33.5k]
  ------------------
   72|  17.7k|    val = ldexp(mant, -24);
   73|  33.5k|  else if (exp != 31)
  ------------------
  |  Branch (73:12): [True: 32.6k, False: 971]
  ------------------
   74|  32.6k|    val = ldexp(mant + 1024, exp - 25);
   75|    971|  else
   76|    971|    val = INFINITY; /* exp == 31, mant == 0: the NaN case is handled above */
   77|  51.3k|  return (float)(half & 0x8000 ? -val : val);
  ------------------
  |  Branch (77:18): [True: 25.8k, False: 25.4k]
  ------------------
   78|  55.1k|}
_cbor_load_half:
   80|  55.1k|float _cbor_load_half(cbor_data source) {
   81|       |  /* Discard const */
   82|  55.1k|  return _cbor_decode_half((unsigned char*)source);
   83|  55.1k|}
_cbor_load_float:
   85|  11.6k|float _cbor_load_float(cbor_data source) {
   86|       |  // TODO: Broken if we are not on IEEE 754
   87|       |  // (https://github.com/PJK/libcbor/issues/336)
   88|  11.6k|  union _cbor_float_helper helper = {.as_uint = _cbor_load_uint32(source)};
   89|  11.6k|  return helper.as_float;
   90|  11.6k|}
_cbor_load_double:
   92|  30.4k|double _cbor_load_double(cbor_data source) {
   93|       |  // TODO: Broken if we are not on IEEE 754
   94|       |  // (https://github.com/PJK/libcbor/issues/336)
   95|  30.4k|  union _cbor_double_helper helper = {.as_uint = _cbor_load_uint64(source)};
   96|  30.4k|  return helper.as_double;
   97|  30.4k|}

_cbor_highest_bit:
   15|  4.02M|size_t _cbor_highest_bit(size_t number) {
   16|  4.02M|  size_t bit = 0;
   17|  16.7M|  while (number != 0) {
  ------------------
  |  Branch (17:10): [True: 12.7M, False: 4.02M]
  ------------------
   18|  12.7M|    bit++;
   19|  12.7M|    number >>= 1;
   20|  12.7M|  }
   21|       |
   22|  4.02M|  return bit;
   23|  4.02M|}
_cbor_safe_to_multiply:
   25|  17.1M|bool _cbor_safe_to_multiply(size_t a, size_t b) {
   26|  17.1M|  if (a <= 1 || b <= 1) return true;
  ------------------
  |  Branch (26:7): [True: 0, False: 17.1M]
  |  Branch (26:17): [True: 15.1M, False: 2.01M]
  ------------------
   27|  2.01M|  return _cbor_highest_bit(a) + _cbor_highest_bit(b) <= sizeof(size_t) * 8;
   28|  17.1M|}
_cbor_safe_to_add:
   30|  13.1M|bool _cbor_safe_to_add(size_t a, size_t b) {
   31|       |  // Unsigned integer overflow doesn't constitute UB
   32|  13.1M|  size_t sum = a + b;
   33|  13.1M|  return sum >= a && sum >= b;
  ------------------
  |  Branch (33:10): [True: 13.1M, False: 0]
  |  Branch (33:22): [True: 13.1M, False: 0]
  ------------------
   34|  13.1M|}
_cbor_safe_signaling_add:
   36|  13.1M|size_t _cbor_safe_signaling_add(size_t a, size_t b) {
   37|  13.1M|  if (a == 0 || b == 0) return 0;
  ------------------
  |  Branch (37:7): [True: 0, False: 13.1M]
  |  Branch (37:17): [True: 0, False: 13.1M]
  ------------------
   38|  13.1M|  if (_cbor_safe_to_add(a, b)) return a + b;
  ------------------
  |  Branch (38:7): [True: 13.1M, False: 0]
  ------------------
   39|      0|  return 0;
   40|  13.1M|}
_cbor_alloc_multiple:
   42|  13.5M|void* _cbor_alloc_multiple(size_t item_size, size_t item_count) {
   43|  13.5M|  if (_cbor_safe_to_multiply(item_size, item_count)) {
  ------------------
  |  Branch (43:7): [True: 13.5M, False: 62]
  ------------------
   44|  13.5M|    return _cbor_malloc(item_size * item_count);
   45|  13.5M|  } else {
   46|       |    return NULL;
   47|     62|  }
   48|  13.5M|}
_cbor_realloc_multiple:
   51|  1.80M|                             size_t item_count) {
   52|  1.80M|  if (_cbor_safe_to_multiply(item_size, item_count)) {
  ------------------
  |  Branch (52:7): [True: 1.80M, False: 0]
  ------------------
   53|  1.80M|    return _cbor_realloc(pointer, item_size * item_count);
   54|  1.80M|  } else {
   55|       |    return NULL;
   56|      0|  }
   57|  1.80M|}

_cbor_stack_init:
   10|  3.44k|struct _cbor_stack _cbor_stack_init(void) {
   11|       |  return (struct _cbor_stack){.top = NULL, .size = 0};
   12|  3.44k|}
_cbor_stack_pop:
   14|  10.3M|void _cbor_stack_pop(struct _cbor_stack* stack) {
   15|  10.3M|  struct _cbor_stack_record* top = stack->top;
   16|  10.3M|  stack->top = stack->top->lower;
   17|  10.3M|  _cbor_free(top);
   18|  10.3M|  stack->size--;
   19|  10.3M|}
_cbor_stack_push:
   23|  10.3M|                                            size_t subitems) {
   24|  10.3M|  if (stack->size == CBOR_MAX_STACK_SIZE) return NULL;
  ------------------
  |  |    9|  10.3M|#define CBOR_MAX_STACK_SIZE 2048
  ------------------
  |  Branch (24:7): [True: 17, False: 10.3M]
  ------------------
   25|  10.3M|  struct _cbor_stack_record* new_top =
   26|  10.3M|      _cbor_malloc(sizeof(struct _cbor_stack_record));
   27|  10.3M|  if (new_top == NULL) return NULL;
  ------------------
  |  Branch (27:7): [True: 0, False: 10.3M]
  ------------------
   28|       |
   29|  10.3M|  *new_top = (struct _cbor_stack_record){stack->top, item, subitems};
   30|  10.3M|  stack->top = new_top;
   31|  10.3M|  stack->size++;
   32|  10.3M|  return new_top;
   33|  10.3M|}

_cbor_unicode_decode:
   59|  2.71M|uint32_t _cbor_unicode_decode(uint32_t* state, uint32_t* codep, uint32_t byte) {
   60|  2.71M|  uint32_t type = utf8d[byte];
   61|       |
   62|  2.71M|  *codep = (*state != UTF8_ACCEPT) ? (byte & 0x3fu) | (*codep << 6)
  ------------------
  |  |   11|  2.71M|#define UTF8_ACCEPT 0
  ------------------
  |  Branch (62:12): [True: 20.0k, False: 2.69M]
  ------------------
   63|  2.71M|                                   : (0xff >> type) & (byte);
   64|       |
   65|  2.71M|  *state = utf8d[256 + *state * 16 + type];
   66|  2.71M|  return *state;
   67|  2.71M|}
_cbor_unicode_codepoint_count:
   70|  1.26M|                                     struct _cbor_unicode_status* status) {
   71|  1.26M|  *status =
   72|  1.26M|      (struct _cbor_unicode_status){.location = 0, .status = _CBOR_UNICODE_OK};
   73|  1.26M|  uint32_t codepoint, state = UTF8_ACCEPT, res;
  ------------------
  |  |   11|  1.26M|#define UTF8_ACCEPT 0
  ------------------
   74|  1.26M|  size_t pos = 0, count = 0;
   75|       |
   76|  3.94M|  for (; pos < source_length; pos++) {
  ------------------
  |  Branch (76:10): [True: 2.71M, False: 1.22M]
  ------------------
   77|  2.71M|    res = _cbor_unicode_decode(&state, &codepoint, source[pos]);
   78|       |
   79|  2.71M|    if (res == UTF8_ACCEPT) {
  ------------------
  |  |   11|  2.71M|#define UTF8_ACCEPT 0
  ------------------
  |  Branch (79:9): [True: 2.65M, False: 59.9k]
  ------------------
   80|  2.65M|      count++;
   81|  2.65M|    } else if (res == UTF8_REJECT) {
  ------------------
  |  |   12|  59.9k|#define UTF8_REJECT 1
  ------------------
  |  Branch (81:16): [True: 36.4k, False: 23.5k]
  ------------------
   82|  36.4k|      goto error;
   83|  36.4k|    }
   84|  2.71M|  }
   85|       |
   86|       |  /* Unfinished multibyte codepoint */
   87|  1.22M|  if (state != UTF8_ACCEPT) goto error;
  ------------------
  |  |   11|  1.22M|#define UTF8_ACCEPT 0
  ------------------
  |  Branch (87:7): [True: 3.47k, False: 1.22M]
  ------------------
   88|       |
   89|  1.22M|  return count;
   90|       |
   91|  39.9k|error:
   92|  39.9k|  *status = (struct _cbor_unicode_status){.location = pos,
   93|  39.9k|                                          .status = _CBOR_UNICODE_BADCP};
   94|  39.9k|  return 0;
   95|  1.22M|}

cbor_int_get_width:
   10|   129M|cbor_int_width cbor_int_get_width(const cbor_item_t* item) {
   11|   129M|  CBOR_ASSERT(cbor_is_int(item));
  ------------------
  |  |   64|   129M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (11:3): [True: 0, False: 129M]
  |  Branch (11:3): [True: 129M, False: 0]
  ------------------
   12|   129M|  return item->metadata.int_metadata.width;
   13|   129M|}
cbor_get_uint8:
   15|  25.3M|uint8_t cbor_get_uint8(const cbor_item_t* item) {
   16|  25.3M|  CBOR_ASSERT(cbor_is_int(item));
  ------------------
  |  |   64|  25.3M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (16:3): [True: 0, False: 25.3M]
  |  Branch (16:3): [True: 25.3M, False: 0]
  ------------------
   17|  25.3M|  CBOR_ASSERT(cbor_int_get_width(item) == CBOR_INT_8);
  ------------------
  |  |   64|  25.3M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (17:3): [True: 0, False: 25.3M]
  |  Branch (17:3): [True: 25.3M, False: 0]
  ------------------
   18|  25.3M|  return *item->data;
   19|  25.3M|}
cbor_get_uint16:
   21|  63.0k|uint16_t cbor_get_uint16(const cbor_item_t* item) {
   22|  63.0k|  CBOR_ASSERT(cbor_is_int(item));
  ------------------
  |  |   64|  63.0k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (22:3): [True: 0, False: 63.0k]
  |  Branch (22:3): [True: 63.0k, False: 0]
  ------------------
   23|  63.0k|  CBOR_ASSERT(cbor_int_get_width(item) == CBOR_INT_16);
  ------------------
  |  |   64|  63.0k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (23:3): [True: 0, False: 63.0k]
  |  Branch (23:3): [True: 63.0k, False: 0]
  ------------------
   24|  63.0k|  return *(uint16_t*)item->data;
   25|  63.0k|}
cbor_get_uint32:
   27|   640k|uint32_t cbor_get_uint32(const cbor_item_t* item) {
   28|   640k|  CBOR_ASSERT(cbor_is_int(item));
  ------------------
  |  |   64|   640k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (28:3): [True: 0, False: 640k]
  |  Branch (28:3): [True: 640k, False: 0]
  ------------------
   29|   640k|  CBOR_ASSERT(cbor_int_get_width(item) == CBOR_INT_32);
  ------------------
  |  |   64|   640k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (29:3): [True: 0, False: 640k]
  |  Branch (29:3): [True: 640k, False: 0]
  ------------------
   30|   640k|  return *(uint32_t*)item->data;
   31|   640k|}
cbor_get_uint64:
   33|  38.2k|uint64_t cbor_get_uint64(const cbor_item_t* item) {
   34|  38.2k|  CBOR_ASSERT(cbor_is_int(item));
  ------------------
  |  |   64|  38.2k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (34:3): [True: 0, False: 38.2k]
  |  Branch (34:3): [True: 38.2k, False: 0]
  ------------------
   35|  38.2k|  CBOR_ASSERT(cbor_int_get_width(item) == CBOR_INT_64);
  ------------------
  |  |   64|  38.2k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (35:3): [True: 0, False: 38.2k]
  |  Branch (35:3): [True: 38.2k, False: 0]
  ------------------
   36|  38.2k|  return *(uint64_t*)item->data;
   37|  38.2k|}
cbor_get_int:
   39|  6.57M|uint64_t cbor_get_int(const cbor_item_t* item) {
   40|  6.57M|  CBOR_ASSERT(cbor_is_int(item));
  ------------------
  |  |   64|  6.57M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (40:3): [True: 0, False: 6.57M]
  |  Branch (40:3): [True: 6.57M, False: 0]
  ------------------
   41|  6.57M|  CBOR_ASSERT(cbor_int_get_width(item) >= CBOR_INT_8 &&
  ------------------
  |  |   64|  6.57M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (41:3): [True: 6.57M, False: 0]
  |  Branch (41:3): [True: 6.57M, False: 0]
  |  Branch (41:3): [True: 0, False: 6.57M]
  ------------------
   42|  6.57M|              cbor_int_get_width(item) <= CBOR_INT_64);
   43|  6.57M|  switch (cbor_int_get_width(item)) {
   44|  6.32M|    case CBOR_INT_8:
  ------------------
  |  Branch (44:5): [True: 6.32M, False: 247k]
  ------------------
   45|  6.32M|      return cbor_get_uint8(item);
   46|  21.0k|    case CBOR_INT_16:
  ------------------
  |  Branch (46:5): [True: 21.0k, False: 6.55M]
  ------------------
   47|  21.0k|      return cbor_get_uint16(item);
   48|   213k|    case CBOR_INT_32:
  ------------------
  |  Branch (48:5): [True: 213k, False: 6.35M]
  ------------------
   49|   213k|      return cbor_get_uint32(item);
   50|  12.7k|    case CBOR_INT_64:
  ------------------
  |  Branch (50:5): [True: 12.7k, False: 6.55M]
  ------------------
   51|  12.7k|      return cbor_get_uint64(item);
   52|      0|    default:  // LCOV_EXCL_START
  ------------------
  |  Branch (52:5): [True: 0, False: 6.57M]
  ------------------
   53|      0|      _CBOR_UNREACHABLE;
  ------------------
  |  |  111|      0|#define _CBOR_UNREACHABLE __builtin_unreachable()
  ------------------
   54|      0|      return 0;  // LCOV_EXCL_STOP
   55|  6.57M|  }
   56|  6.57M|}
cbor_set_uint8:
   58|  17.6M|void cbor_set_uint8(cbor_item_t* item, uint8_t value) {
   59|  17.6M|  CBOR_ASSERT(cbor_is_int(item));
  ------------------
  |  |   64|  17.6M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (59:3): [True: 0, False: 17.6M]
  |  Branch (59:3): [True: 17.6M, False: 0]
  ------------------
   60|  17.6M|  CBOR_ASSERT(cbor_int_get_width(item) == CBOR_INT_8);
  ------------------
  |  |   64|  17.6M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (60:3): [True: 0, False: 17.6M]
  |  Branch (60:3): [True: 17.6M, False: 0]
  ------------------
   61|  17.6M|  *item->data = value;
   62|  17.6M|}
cbor_set_uint16:
   64|  55.3k|void cbor_set_uint16(cbor_item_t* item, uint16_t value) {
   65|  55.3k|  CBOR_ASSERT(cbor_is_int(item));
  ------------------
  |  |   64|  55.3k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (65:3): [True: 0, False: 55.3k]
  |  Branch (65:3): [True: 55.3k, False: 0]
  ------------------
   66|  55.3k|  CBOR_ASSERT(cbor_int_get_width(item) == CBOR_INT_16);
  ------------------
  |  |   64|  55.3k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (66:3): [True: 0, False: 55.3k]
  |  Branch (66:3): [True: 55.3k, False: 0]
  ------------------
   67|  55.3k|  *(uint16_t*)item->data = value;
   68|  55.3k|}
cbor_set_uint32:
   70|   529k|void cbor_set_uint32(cbor_item_t* item, uint32_t value) {
   71|   529k|  CBOR_ASSERT(cbor_is_int(item));
  ------------------
  |  |   64|   529k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (71:3): [True: 0, False: 529k]
  |  Branch (71:3): [True: 529k, False: 0]
  ------------------
   72|   529k|  CBOR_ASSERT(cbor_int_get_width(item) == CBOR_INT_32);
  ------------------
  |  |   64|   529k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (72:3): [True: 0, False: 529k]
  |  Branch (72:3): [True: 529k, False: 0]
  ------------------
   73|   529k|  *(uint32_t*)item->data = value;
   74|   529k|}
cbor_set_uint64:
   76|  30.4k|void cbor_set_uint64(cbor_item_t* item, uint64_t value) {
   77|  30.4k|  CBOR_ASSERT(cbor_is_int(item));
  ------------------
  |  |   64|  30.4k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (77:3): [True: 0, False: 30.4k]
  |  Branch (77:3): [True: 30.4k, False: 0]
  ------------------
   78|  30.4k|  CBOR_ASSERT(cbor_int_get_width(item) == CBOR_INT_64);
  ------------------
  |  |   64|  30.4k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (78:3): [True: 0, False: 30.4k]
  |  Branch (78:3): [True: 30.4k, False: 0]
  ------------------
   79|  30.4k|  *(uint64_t*)item->data = value;
   80|  30.4k|}
cbor_mark_uint:
   82|  15.4M|void cbor_mark_uint(cbor_item_t* item) {
   83|  15.4M|  CBOR_ASSERT(cbor_is_int(item));
  ------------------
  |  |   64|  15.4M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (83:3): [True: 0, False: 15.4M]
  |  Branch (83:3): [True: 15.4M, False: 0]
  ------------------
   84|  15.4M|  item->type = CBOR_TYPE_UINT;
   85|  15.4M|}
cbor_mark_negint:
   87|  4.38M|void cbor_mark_negint(cbor_item_t* item) {
   88|  4.38M|  CBOR_ASSERT(cbor_is_int(item));
  ------------------
  |  |   64|  4.38M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (88:3): [True: 0, False: 4.38M]
  |  Branch (88:3): [True: 4.38M, False: 0]
  ------------------
   89|  4.38M|  item->type = CBOR_TYPE_NEGINT;
   90|  4.38M|}
cbor_new_int8:
   92|  17.6M|cbor_item_t* cbor_new_int8(void) {
   93|  17.6M|  cbor_item_t* item = _cbor_malloc(sizeof(cbor_item_t) + 1);
   94|  17.6M|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|  17.6M|  do {                           \
  |  |  127|  17.6M|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 4, False: 17.6M]
  |  |  ------------------
  |  |  128|      4|      return NULL;               \
  |  |  129|      4|    }                            \
  |  |  130|  17.6M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 17.6M]
  |  |  ------------------
  ------------------
   95|  17.6M|  *item = (cbor_item_t){.data = (unsigned char*)item + sizeof(cbor_item_t),
   96|  17.6M|                        .refcount = 1,
   97|  17.6M|                        .metadata = {.int_metadata = {.width = CBOR_INT_8}},
   98|  17.6M|                        .type = CBOR_TYPE_UINT};
   99|  17.6M|  return item;
  100|  17.6M|}
cbor_new_int16:
  102|  55.3k|cbor_item_t* cbor_new_int16(void) {
  103|  55.3k|  cbor_item_t* item = _cbor_malloc(sizeof(cbor_item_t) + 2);
  104|  55.3k|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|  55.3k|  do {                           \
  |  |  127|  55.3k|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 55.3k]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|  55.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 55.3k]
  |  |  ------------------
  ------------------
  105|  55.3k|  *item = (cbor_item_t){.data = (unsigned char*)item + sizeof(cbor_item_t),
  106|  55.3k|                        .refcount = 1,
  107|  55.3k|                        .metadata = {.int_metadata = {.width = CBOR_INT_16}},
  108|  55.3k|                        .type = CBOR_TYPE_UINT};
  109|  55.3k|  return item;
  110|  55.3k|}
cbor_new_int32:
  112|   529k|cbor_item_t* cbor_new_int32(void) {
  113|   529k|  cbor_item_t* item = _cbor_malloc(sizeof(cbor_item_t) + 4);
  114|   529k|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|   529k|  do {                           \
  |  |  127|   529k|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 529k]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|   529k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 529k]
  |  |  ------------------
  ------------------
  115|   529k|  *item = (cbor_item_t){.data = (unsigned char*)item + sizeof(cbor_item_t),
  116|   529k|                        .refcount = 1,
  117|   529k|                        .metadata = {.int_metadata = {.width = CBOR_INT_32}},
  118|   529k|                        .type = CBOR_TYPE_UINT};
  119|   529k|  return item;
  120|   529k|}
cbor_new_int64:
  122|  30.4k|cbor_item_t* cbor_new_int64(void) {
  123|  30.4k|  cbor_item_t* item = _cbor_malloc(sizeof(cbor_item_t) + 8);
  124|  30.4k|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|  30.4k|  do {                           \
  |  |  127|  30.4k|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 30.4k]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|  30.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 30.4k]
  |  |  ------------------
  ------------------
  125|  30.4k|  *item = (cbor_item_t){.data = (unsigned char*)item + sizeof(cbor_item_t),
  126|  30.4k|                        .refcount = 1,
  127|  30.4k|                        .metadata = {.int_metadata = {.width = CBOR_INT_64}},
  128|  30.4k|                        .type = CBOR_TYPE_UINT};
  129|  30.4k|  return item;
  130|  30.4k|}
cbor_build_uint8:
  132|  6.32M|cbor_item_t* cbor_build_uint8(uint8_t value) {
  133|  6.32M|  cbor_item_t* item = cbor_new_int8();
  134|  6.32M|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|  6.32M|  do {                           \
  |  |  127|  6.32M|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 6.32M]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|  6.32M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 6.32M]
  |  |  ------------------
  ------------------
  135|  6.32M|  cbor_set_uint8(item, value);
  136|  6.32M|  cbor_mark_uint(item);
  137|  6.32M|  return item;
  138|  6.32M|}
cbor_build_uint16:
  140|  21.0k|cbor_item_t* cbor_build_uint16(uint16_t value) {
  141|  21.0k|  cbor_item_t* item = cbor_new_int16();
  142|  21.0k|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|  21.0k|  do {                           \
  |  |  127|  21.0k|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 21.0k]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|  21.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 21.0k]
  |  |  ------------------
  ------------------
  143|  21.0k|  cbor_set_uint16(item, value);
  144|  21.0k|  cbor_mark_uint(item);
  145|  21.0k|  return item;
  146|  21.0k|}
cbor_build_uint32:
  148|   213k|cbor_item_t* cbor_build_uint32(uint32_t value) {
  149|   213k|  cbor_item_t* item = cbor_new_int32();
  150|   213k|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|   213k|  do {                           \
  |  |  127|   213k|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 213k]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|   213k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 213k]
  |  |  ------------------
  ------------------
  151|   213k|  cbor_set_uint32(item, value);
  152|   213k|  cbor_mark_uint(item);
  153|   213k|  return item;
  154|   213k|}
cbor_build_uint64:
  156|  12.7k|cbor_item_t* cbor_build_uint64(uint64_t value) {
  157|  12.7k|  cbor_item_t* item = cbor_new_int64();
  158|  12.7k|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|  12.7k|  do {                           \
  |  |  127|  12.7k|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 12.7k]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|  12.7k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 12.7k]
  |  |  ------------------
  ------------------
  159|  12.7k|  cbor_set_uint64(item, value);
  160|  12.7k|  cbor_mark_uint(item);
  161|  12.7k|  return item;
  162|  12.7k|}

cbor_map_size:
   11|  2.64M|size_t cbor_map_size(const cbor_item_t* item) {
   12|  2.64M|  CBOR_ASSERT(cbor_isa_map(item));
  ------------------
  |  |   64|  2.64M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (12:3): [True: 0, False: 2.64M]
  |  Branch (12:3): [True: 2.64M, False: 0]
  ------------------
   13|  2.64M|  return item->metadata.map_metadata.end_ptr;
   14|  2.64M|}
cbor_new_definite_map:
   21|   111k|cbor_item_t* cbor_new_definite_map(size_t size) {
   22|   111k|  cbor_item_t* item = _cbor_malloc(sizeof(cbor_item_t));
   23|   111k|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|   111k|  do {                           \
  |  |  127|   111k|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 111k]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|   111k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 111k]
  |  |  ------------------
  ------------------
   24|       |
   25|   111k|  *item = (cbor_item_t){
   26|   111k|      .refcount = 1,
   27|   111k|      .type = CBOR_TYPE_MAP,
   28|   111k|      .metadata = {.map_metadata = {.allocated = size,
   29|   111k|                                    .type = _CBOR_METADATA_DEFINITE,
   30|   111k|                                    .end_ptr = 0}},
   31|   111k|      .data = _cbor_alloc_multiple(sizeof(struct cbor_pair), size)};
   32|   111k|  _CBOR_DEPENDENT_NOTNULL(item, item->data);
  ------------------
  |  |  135|   111k|  do {                                              \
  |  |  136|   111k|    if (pointer == NULL) {                          \
  |  |  ------------------
  |  |  |  Branch (136:9): [True: 42, False: 111k]
  |  |  ------------------
  |  |  137|     42|      _cbor_free(cbor_item);                        \
  |  |  138|     42|      return NULL;                                  \
  |  |  139|     42|    }                                               \
  |  |  140|   111k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (140:12): [Folded, False: 111k]
  |  |  ------------------
  ------------------
   33|       |
   34|   111k|  return item;
   35|   111k|}
cbor_new_indefinite_map:
   37|  9.28k|cbor_item_t* cbor_new_indefinite_map(void) {
   38|  9.28k|  cbor_item_t* item = _cbor_malloc(sizeof(cbor_item_t));
   39|  9.28k|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|  9.28k|  do {                           \
  |  |  127|  9.28k|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 9.28k]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|  9.28k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 9.28k]
  |  |  ------------------
  ------------------
   40|       |
   41|  9.28k|  *item = (cbor_item_t){
   42|  9.28k|      .refcount = 1,
   43|  9.28k|      .type = CBOR_TYPE_MAP,
   44|  9.28k|      .metadata = {.map_metadata = {.allocated = 0,
   45|  9.28k|                                    .type = _CBOR_METADATA_INDEFINITE,
   46|  9.28k|                                    .end_ptr = 0}},
   47|  9.28k|      .data = NULL};
   48|       |
   49|  9.28k|  return item;
   50|  9.28k|}
_cbor_map_add_key:
   52|  2.58M|bool _cbor_map_add_key(cbor_item_t* item, cbor_item_t* key) {
   53|  2.58M|  CBOR_ASSERT(cbor_isa_map(item));
  ------------------
  |  |   64|  2.58M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (53:3): [True: 0, False: 2.58M]
  |  Branch (53:3): [True: 2.58M, False: 0]
  ------------------
   54|  2.58M|  struct _cbor_map_metadata* metadata =
   55|  2.58M|      (struct _cbor_map_metadata*)&item->metadata;
   56|  2.58M|  if (cbor_map_is_definite(item)) {
  ------------------
  |  Branch (56:7): [True: 1.05M, False: 1.53M]
  ------------------
   57|  1.05M|    struct cbor_pair* data = cbor_map_handle(item);
   58|  1.05M|    if (metadata->end_ptr >= metadata->allocated) {
  ------------------
  |  Branch (58:9): [True: 0, False: 1.05M]
  ------------------
   59|       |      /* Don't realloc definite preallocated map */
   60|      0|      return false;
   61|      0|    }
   62|       |
   63|  1.05M|    data[metadata->end_ptr].key = key;
   64|  1.05M|    data[metadata->end_ptr++].value = NULL;
   65|  1.53M|  } else {
   66|  1.53M|    if (metadata->end_ptr >= metadata->allocated) {
  ------------------
  |  Branch (66:9): [True: 4.36k, False: 1.53M]
  ------------------
   67|       |      /* Exponential realloc */
   68|       |      // Check for overflows first
   69|  4.36k|      if (!_cbor_safe_to_multiply(CBOR_BUFFER_GROWTH, metadata->allocated)) {
  ------------------
  |  |    8|  4.36k|#define CBOR_BUFFER_GROWTH 2
  ------------------
  |  Branch (69:11): [True: 0, False: 4.36k]
  ------------------
   70|      0|        return false;
   71|      0|      }
   72|       |
   73|  4.36k|      size_t new_allocation = metadata->allocated == 0
  ------------------
  |  Branch (73:31): [True: 1.51k, False: 2.85k]
  ------------------
   74|  4.36k|                                  ? 1
   75|  4.36k|                                  : CBOR_BUFFER_GROWTH * metadata->allocated;
  ------------------
  |  |    8|  2.85k|#define CBOR_BUFFER_GROWTH 2
  ------------------
   76|       |
   77|  4.36k|      unsigned char* new_data = _cbor_realloc_multiple(
   78|  4.36k|          item->data, sizeof(struct cbor_pair), new_allocation);
   79|       |
   80|  4.36k|      if (new_data == NULL) {
  ------------------
  |  Branch (80:11): [True: 0, False: 4.36k]
  ------------------
   81|      0|        return false;
   82|      0|      }
   83|       |
   84|  4.36k|      item->data = new_data;
   85|  4.36k|      metadata->allocated = new_allocation;
   86|  4.36k|    }
   87|  1.53M|    struct cbor_pair* data = cbor_map_handle(item);
   88|  1.53M|    data[metadata->end_ptr].key = key;
   89|  1.53M|    data[metadata->end_ptr++].value = NULL;
   90|  1.53M|  }
   91|  2.58M|  cbor_incref(key);
   92|  2.58M|  return true;
   93|  2.58M|}
_cbor_map_add_value:
   95|  2.58M|bool _cbor_map_add_value(cbor_item_t* item, cbor_item_t* value) {
   96|  2.58M|  CBOR_ASSERT(cbor_isa_map(item));
  ------------------
  |  |   64|  2.58M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (96:3): [True: 0, False: 2.58M]
  |  Branch (96:3): [True: 2.58M, False: 0]
  ------------------
   97|  2.58M|  cbor_incref(value);
   98|  2.58M|  cbor_map_handle(item)[
   99|       |      /* Move one back since we are assuming _add_key (which increased the ptr)
  100|       |       * was the previous operation on this object */
  101|  2.58M|      item->metadata.map_metadata.end_ptr - 1]
  102|  2.58M|      .value = value;
  103|  2.58M|  return true;
  104|  2.58M|}
cbor_map_add:
  107|   801k|bool cbor_map_add(cbor_item_t* item, struct cbor_pair pair) {
  108|   801k|  CBOR_ASSERT(cbor_isa_map(item));
  ------------------
  |  |   64|   801k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (108:3): [True: 0, False: 801k]
  |  Branch (108:3): [True: 801k, False: 0]
  ------------------
  109|   801k|  if (!_cbor_map_add_key(item, pair.key)) return false;
  ------------------
  |  Branch (109:7): [True: 0, False: 801k]
  ------------------
  110|   801k|  return _cbor_map_add_value(item, pair.value);
  111|   801k|}
cbor_map_is_definite:
  113|  6.33M|bool cbor_map_is_definite(const cbor_item_t* item) {
  114|  6.33M|  CBOR_ASSERT(cbor_isa_map(item));
  ------------------
  |  |   64|  6.33M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (114:3): [True: 0, False: 6.33M]
  |  Branch (114:3): [True: 6.33M, False: 0]
  ------------------
  115|  6.33M|  return item->metadata.map_metadata.type == _CBOR_METADATA_DEFINITE;
  116|  6.33M|}
cbor_map_is_indefinite:
  118|  6.61k|bool cbor_map_is_indefinite(const cbor_item_t* item) {
  119|  6.61k|  return !cbor_map_is_definite(item);
  120|  6.61k|}
cbor_map_handle:
  122|  6.99M|struct cbor_pair* cbor_map_handle(const cbor_item_t* item) {
  123|  6.99M|  CBOR_ASSERT(cbor_isa_map(item));
  ------------------
  |  |   64|  6.99M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (123:3): [True: 0, False: 6.99M]
  |  Branch (123:3): [True: 6.99M, False: 0]
  ------------------
  124|  6.99M|  return (struct cbor_pair*)item->data;
  125|  6.99M|}

cbor_serialize:
   21|  11.4M|                      size_t buffer_size) {
   22|  11.4M|  CBOR_ASSERT_VALID_TYPE(cbor_typeof(item));
  ------------------
  |  |   82|  11.4M|  CBOR_ASSERT(item_type >= CBOR_TYPE_UINT && item_type <= CBOR_TYPE_FLOAT_CTRL);
  |  |  ------------------
  |  |  |  |   64|  11.4M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  |  |  ------------------
  ------------------
  |  Branch (22:3): [True: 11.4M, False: 0]
  |  Branch (22:3): [True: 11.4M, False: 0]
  |  Branch (22:3): [True: 0, False: 11.4M]
  ------------------
   23|  11.4M|  switch (cbor_typeof(item)) {
   24|  5.02M|    case CBOR_TYPE_UINT:
  ------------------
  |  Branch (24:5): [True: 5.02M, False: 6.44M]
  ------------------
   25|  5.02M|      return cbor_serialize_uint(item, buffer, buffer_size);
   26|  1.54M|    case CBOR_TYPE_NEGINT:
  ------------------
  |  Branch (26:5): [True: 1.54M, False: 9.93M]
  ------------------
   27|  1.54M|      return cbor_serialize_negint(item, buffer, buffer_size);
   28|  43.5k|    case CBOR_TYPE_BYTESTRING:
  ------------------
  |  Branch (28:5): [True: 43.5k, False: 11.4M]
  ------------------
   29|  43.5k|      return cbor_serialize_bytestring(item, buffer, buffer_size);
   30|   197k|    case CBOR_TYPE_STRING:
  ------------------
  |  Branch (30:5): [True: 197k, False: 11.2M]
  ------------------
   31|   197k|      return cbor_serialize_string(item, buffer, buffer_size);
   32|  4.16M|    case CBOR_TYPE_ARRAY:
  ------------------
  |  Branch (32:5): [True: 4.16M, False: 7.30M]
  ------------------
   33|  4.16M|      return cbor_serialize_array(item, buffer, buffer_size);
   34|  34.3k|    case CBOR_TYPE_MAP:
  ------------------
  |  Branch (34:5): [True: 34.3k, False: 11.4M]
  ------------------
   35|  34.3k|      return cbor_serialize_map(item, buffer, buffer_size);
   36|   213k|    case CBOR_TYPE_TAG:
  ------------------
  |  Branch (36:5): [True: 213k, False: 11.2M]
  ------------------
   37|   213k|      return cbor_serialize_tag(item, buffer, buffer_size);
   38|   248k|    case CBOR_TYPE_FLOAT_CTRL:
  ------------------
  |  Branch (38:5): [True: 248k, False: 11.2M]
  ------------------
   39|   248k|      return cbor_serialize_float_ctrl(item, buffer, buffer_size);
   40|      0|    default:  // LCOV_EXCL_START
  ------------------
  |  Branch (40:5): [True: 0, False: 11.4M]
  ------------------
   41|      0|      _CBOR_UNREACHABLE;
  ------------------
  |  |  111|      0|#define _CBOR_UNREACHABLE __builtin_unreachable()
  ------------------
   42|      0|      return 0;  // LCOV_EXCL_STOP
   43|  11.4M|  }
   44|  11.4M|}
_cbor_encoded_header_size:
   51|  5.33M|size_t _cbor_encoded_header_size(uint64_t size) {
   52|  5.33M|  if (size <= kMaxEmbeddedInt)
  ------------------
  |  Branch (52:7): [True: 5.31M, False: 20.5k]
  ------------------
   53|  5.31M|    return 1;
   54|  20.5k|  else if (size <= UINT8_MAX)
  ------------------
  |  Branch (54:12): [True: 7.35k, False: 13.1k]
  ------------------
   55|  7.35k|    return 2;
   56|  13.1k|  else if (size <= UINT16_MAX)
  ------------------
  |  Branch (56:12): [True: 1.42k, False: 11.7k]
  ------------------
   57|  1.42k|    return 3;
   58|  11.7k|  else if (size <= UINT32_MAX)
  ------------------
  |  Branch (58:12): [True: 9.13k, False: 2.60k]
  ------------------
   59|  9.13k|    return 5;
   60|  2.60k|  else
   61|  2.60k|    return 9;
   62|  5.33M|}
cbor_serialized_size:
   64|  12.2M|size_t cbor_serialized_size(const cbor_item_t* item) {
   65|  12.2M|  CBOR_ASSERT_VALID_TYPE(cbor_typeof(item));
  ------------------
  |  |   82|  12.2M|  CBOR_ASSERT(item_type >= CBOR_TYPE_UINT && item_type <= CBOR_TYPE_FLOAT_CTRL);
  |  |  ------------------
  |  |  |  |   64|  12.2M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  |  |  ------------------
  ------------------
  |  Branch (65:3): [True: 12.2M, False: 0]
  |  Branch (65:3): [True: 12.2M, False: 0]
  |  Branch (65:3): [True: 0, False: 12.2M]
  ------------------
   66|  12.2M|  switch (cbor_typeof(item)) {
   67|  5.02M|    case CBOR_TYPE_UINT:
  ------------------
  |  Branch (67:5): [True: 5.02M, False: 7.18M]
  ------------------
   68|  6.57M|    case CBOR_TYPE_NEGINT:
  ------------------
  |  Branch (68:5): [True: 1.54M, False: 10.6M]
  ------------------
   69|  6.57M|      CBOR_ASSERT(cbor_int_get_width(item) >= CBOR_INT_8 &&
  ------------------
  |  |   64|  6.57M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (69:7): [True: 6.57M, False: 0]
  |  Branch (69:7): [True: 6.57M, False: 0]
  |  Branch (69:7): [True: 0, False: 6.57M]
  ------------------
   70|  6.57M|                  cbor_int_get_width(item) <= CBOR_INT_64);
   71|  6.57M|      switch (cbor_int_get_width(item)) {
   72|  6.32M|        case CBOR_INT_8:
  ------------------
  |  Branch (72:9): [True: 6.32M, False: 247k]
  ------------------
   73|  6.32M|          if (cbor_get_uint8(item) <= kMaxEmbeddedInt) return 1;
  ------------------
  |  Branch (73:15): [True: 6.30M, False: 17.5k]
  ------------------
   74|  17.5k|          return 2;
   75|  21.0k|        case CBOR_INT_16:
  ------------------
  |  Branch (75:9): [True: 21.0k, False: 6.55M]
  ------------------
   76|  21.0k|          return 3;
   77|   213k|        case CBOR_INT_32:
  ------------------
  |  Branch (77:9): [True: 213k, False: 6.35M]
  ------------------
   78|   213k|          return 5;
   79|  12.7k|        case CBOR_INT_64:
  ------------------
  |  Branch (79:9): [True: 12.7k, False: 6.55M]
  ------------------
   80|  12.7k|          return 9;
   81|      0|        default:  // LCOV_EXCL_START
  ------------------
  |  Branch (81:9): [True: 0, False: 6.57M]
  ------------------
   82|      0|          _CBOR_UNREACHABLE;
  ------------------
  |  |  111|      0|#define _CBOR_UNREACHABLE __builtin_unreachable()
  ------------------
   83|      0|          return 0;  // LCOV_EXCL_STOP
   84|  6.57M|      }
   85|       |    // Note: We do not _cbor_safe_signaling_add zero-length definite strings,
   86|       |    // they would cause zeroes to propagate. All other items are at least one
   87|       |    // byte.
   88|   523k|    case CBOR_TYPE_BYTESTRING: {
  ------------------
  |  Branch (88:5): [True: 523k, False: 11.6M]
  ------------------
   89|   523k|      if (cbor_bytestring_is_definite(item)) {
  ------------------
  |  Branch (89:11): [True: 522k, False: 875]
  ------------------
   90|   522k|        size_t header_size =
   91|   522k|            _cbor_encoded_header_size(cbor_bytestring_length(item));
   92|   522k|        if (cbor_bytestring_length(item) == 0) return header_size;
  ------------------
  |  Branch (92:13): [True: 0, False: 522k]
  ------------------
   93|   522k|        return _cbor_safe_signaling_add(header_size,
   94|   522k|                                        cbor_bytestring_length(item));
   95|   522k|      }
   96|    875|      size_t indef_bytestring_size = 2;  // Leading byte + break
   97|    875|      cbor_item_t** chunks = cbor_bytestring_chunks_handle(item);
   98|   480k|      for (size_t i = 0; i < cbor_bytestring_chunk_count(item); i++) {
  ------------------
  |  Branch (98:26): [True: 479k, False: 875]
  ------------------
   99|   479k|        indef_bytestring_size = _cbor_safe_signaling_add(
  100|   479k|            indef_bytestring_size, cbor_serialized_size(chunks[i]));
  101|   479k|      }
  102|    875|      return indef_bytestring_size;
  103|   523k|    }
  104|   457k|    case CBOR_TYPE_STRING: {
  ------------------
  |  Branch (104:5): [True: 457k, False: 11.7M]
  ------------------
  105|   457k|      if (cbor_string_is_definite(item)) {
  ------------------
  |  Branch (105:11): [True: 454k, False: 2.24k]
  ------------------
  106|   454k|        size_t header_size =
  107|   454k|            _cbor_encoded_header_size(cbor_string_length(item));
  108|   454k|        if (cbor_string_length(item) == 0) return header_size;
  ------------------
  |  Branch (108:13): [True: 0, False: 454k]
  ------------------
  109|   454k|        return _cbor_safe_signaling_add(header_size, cbor_string_length(item));
  110|   454k|      }
  111|  2.24k|      size_t indef_string_size = 2;  // Leading byte + break
  112|  2.24k|      cbor_item_t** chunks = cbor_string_chunks_handle(item);
  113|   261k|      for (size_t i = 0; i < cbor_string_chunk_count(item); i++) {
  ------------------
  |  Branch (113:26): [True: 259k, False: 2.24k]
  ------------------
  114|   259k|        indef_string_size = _cbor_safe_signaling_add(
  115|   259k|            indef_string_size, cbor_serialized_size(chunks[i]));
  116|   259k|      }
  117|  2.24k|      return indef_string_size;
  118|   457k|    }
  119|  4.16M|    case CBOR_TYPE_ARRAY: {
  ------------------
  |  Branch (119:5): [True: 4.16M, False: 8.04M]
  ------------------
  120|  4.16M|      size_t array_size = cbor_array_is_definite(item)
  ------------------
  |  Branch (120:27): [True: 3.92M, False: 241k]
  ------------------
  121|  4.16M|                              ? _cbor_encoded_header_size(cbor_array_size(item))
  122|  4.16M|                              : 2;  // Leading byte + break
  123|  4.16M|      cbor_item_t** items = cbor_array_handle(item);
  124|  13.8M|      for (size_t i = 0; i < cbor_array_size(item); i++) {
  ------------------
  |  Branch (124:26): [True: 9.66M, False: 4.16M]
  ------------------
  125|  9.66M|        array_size = _cbor_safe_signaling_add(array_size,
  126|  9.66M|                                              cbor_serialized_size(items[i]));
  127|  9.66M|      }
  128|  4.16M|      return array_size;
  129|   457k|    }
  130|  34.3k|    case CBOR_TYPE_MAP: {
  ------------------
  |  Branch (130:5): [True: 34.3k, False: 12.1M]
  ------------------
  131|  34.3k|      size_t map_size = cbor_map_is_definite(item)
  ------------------
  |  Branch (131:25): [True: 32.5k, False: 1.83k]
  ------------------
  132|  34.3k|                            ? _cbor_encoded_header_size(cbor_map_size(item))
  133|  34.3k|                            : 2;  // Leading byte + break
  134|  34.3k|      struct cbor_pair* items = cbor_map_handle(item);
  135|   835k|      for (size_t i = 0; i < cbor_map_size(item); i++) {
  ------------------
  |  Branch (135:26): [True: 801k, False: 34.3k]
  ------------------
  136|   801k|        map_size = _cbor_safe_signaling_add(
  137|   801k|            map_size,
  138|   801k|            _cbor_safe_signaling_add(cbor_serialized_size(items[i].key),
  139|   801k|                                     cbor_serialized_size(items[i].value)));
  140|   801k|      }
  141|  34.3k|      return map_size;
  142|   457k|    }
  143|   213k|    case CBOR_TYPE_TAG: {
  ------------------
  |  Branch (143:5): [True: 213k, False: 12.0M]
  ------------------
  144|   213k|      cbor_item_t* tagged = cbor_tag_item(item);
  145|   213k|      if (tagged == NULL) return 0;
  ------------------
  |  Branch (145:11): [True: 0, False: 213k]
  ------------------
  146|   213k|      return _cbor_safe_signaling_add(
  147|   213k|          _cbor_encoded_header_size(cbor_tag_value(item)),
  148|   213k|          cbor_serialized_size(cbor_move(tagged)));
  149|   213k|    }
  150|   248k|    case CBOR_TYPE_FLOAT_CTRL:
  ------------------
  |  Branch (150:5): [True: 248k, False: 11.9M]
  ------------------
  151|   248k|      CBOR_ASSERT(cbor_float_get_width(item) >= CBOR_FLOAT_0 &&
  ------------------
  |  |   64|   248k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (151:7): [True: 248k, False: 0]
  |  Branch (151:7): [True: 248k, False: 0]
  |  Branch (151:7): [True: 0, False: 248k]
  ------------------
  152|   248k|                  cbor_float_get_width(item) <= CBOR_FLOAT_64);
  153|   248k|      switch (cbor_float_get_width(item)) {
  154|   186k|        case CBOR_FLOAT_0:
  ------------------
  |  Branch (154:9): [True: 186k, False: 61.6k]
  ------------------
  155|   186k|          return _cbor_encoded_header_size(cbor_ctrl_value(item));
  156|  38.1k|        case CBOR_FLOAT_16:
  ------------------
  |  Branch (156:9): [True: 38.1k, False: 210k]
  ------------------
  157|  38.1k|          return 3;
  158|  9.11k|        case CBOR_FLOAT_32:
  ------------------
  |  Branch (158:9): [True: 9.11k, False: 239k]
  ------------------
  159|  9.11k|          return 5;
  160|  14.3k|        case CBOR_FLOAT_64:
  ------------------
  |  Branch (160:9): [True: 14.3k, False: 233k]
  ------------------
  161|  14.3k|          return 9;
  162|      0|        default:  // LCOV_EXCL_START
  ------------------
  |  Branch (162:9): [True: 0, False: 248k]
  ------------------
  163|      0|          _CBOR_UNREACHABLE;
  ------------------
  |  |  111|      0|#define _CBOR_UNREACHABLE __builtin_unreachable()
  ------------------
  164|      0|          return 0;  // LCOV_EXCL_STOP
  165|   248k|      }
  166|      0|    default:  // LCOV_EXCL_START
  ------------------
  |  Branch (166:5): [True: 0, False: 12.2M]
  ------------------
  167|      0|      _CBOR_UNREACHABLE;
  ------------------
  |  |  111|      0|#define _CBOR_UNREACHABLE __builtin_unreachable()
  ------------------
  168|      0|      return 0;  // LCOV_EXCL_STOP
  169|  12.2M|  }
  170|  12.2M|}
cbor_serialize_alloc:
  173|  1.07k|                            size_t* buffer_size) {
  174|  1.07k|  *buffer = NULL;
  175|  1.07k|  size_t serialized_size = cbor_serialized_size(item);
  176|  1.07k|  if (serialized_size == 0) {
  ------------------
  |  Branch (176:7): [True: 0, False: 1.07k]
  ------------------
  177|      0|    if (buffer_size != NULL) *buffer_size = 0;
  ------------------
  |  Branch (177:9): [True: 0, False: 0]
  ------------------
  178|      0|    return 0;
  179|      0|  }
  180|  1.07k|  *buffer = _cbor_malloc(serialized_size);
  181|  1.07k|  if (*buffer == NULL) {
  ------------------
  |  Branch (181:7): [True: 0, False: 1.07k]
  ------------------
  182|      0|    if (buffer_size != NULL) *buffer_size = 0;
  ------------------
  |  Branch (182:9): [True: 0, False: 0]
  ------------------
  183|      0|    return 0;
  184|      0|  }
  185|       |
  186|  1.07k|  size_t written = cbor_serialize(item, *buffer, serialized_size);
  187|  1.07k|  CBOR_ASSERT(written == serialized_size);
  ------------------
  |  |   64|  1.07k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (187:3): [True: 0, False: 1.07k]
  |  Branch (187:3): [True: 1.07k, False: 0]
  ------------------
  188|  1.07k|  if (buffer_size != NULL) *buffer_size = serialized_size;
  ------------------
  |  Branch (188:7): [True: 1.07k, False: 0]
  ------------------
  189|  1.07k|  return written;
  190|  1.07k|}
cbor_serialize_uint:
  193|  5.02M|                           size_t buffer_size) {
  194|  5.02M|  CBOR_ASSERT(cbor_isa_uint(item));
  ------------------
  |  |   64|  5.02M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (194:3): [True: 0, False: 5.02M]
  |  Branch (194:3): [True: 5.02M, False: 0]
  ------------------
  195|  5.02M|  CBOR_ASSERT(cbor_int_get_width(item) >= CBOR_INT_8 &&
  ------------------
  |  |   64|  5.02M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (195:3): [True: 5.02M, False: 0]
  |  Branch (195:3): [True: 5.02M, False: 0]
  |  Branch (195:3): [True: 0, False: 5.02M]
  ------------------
  196|  5.02M|              cbor_int_get_width(item) <= CBOR_INT_64);
  197|       |  // cppcheck-suppress missingReturn
  198|  5.02M|  switch (cbor_int_get_width(item)) {
  199|  4.80M|    case CBOR_INT_8:
  ------------------
  |  Branch (199:5): [True: 4.80M, False: 222k]
  ------------------
  200|  4.80M|      return cbor_encode_uint8(cbor_get_uint8(item), buffer, buffer_size);
  201|  4.48k|    case CBOR_INT_16:
  ------------------
  |  Branch (201:5): [True: 4.48k, False: 5.02M]
  ------------------
  202|  4.48k|      return cbor_encode_uint16(cbor_get_uint16(item), buffer, buffer_size);
  203|   205k|    case CBOR_INT_32:
  ------------------
  |  Branch (203:5): [True: 205k, False: 4.82M]
  ------------------
  204|   205k|      return cbor_encode_uint32(cbor_get_uint32(item), buffer, buffer_size);
  205|  11.7k|    case CBOR_INT_64:
  ------------------
  |  Branch (205:5): [True: 11.7k, False: 5.01M]
  ------------------
  206|  11.7k|      return cbor_encode_uint64(cbor_get_uint64(item), buffer, buffer_size);
  207|      0|    default:  // LCOV_EXCL_START
  ------------------
  |  Branch (207:5): [True: 0, False: 5.02M]
  ------------------
  208|      0|      _CBOR_UNREACHABLE;
  ------------------
  |  |  111|      0|#define _CBOR_UNREACHABLE __builtin_unreachable()
  ------------------
  209|      0|      return 0;  // LCOV_EXCL_STOP
  210|  5.02M|  }
  211|  5.02M|}
cbor_serialize_negint:
  214|  1.54M|                             size_t buffer_size) {
  215|  1.54M|  CBOR_ASSERT(cbor_isa_negint(item));
  ------------------
  |  |   64|  1.54M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (215:3): [True: 0, False: 1.54M]
  |  Branch (215:3): [True: 1.54M, False: 0]
  ------------------
  216|  1.54M|  CBOR_ASSERT(cbor_int_get_width(item) >= CBOR_INT_8 &&
  ------------------
  |  |   64|  1.54M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (216:3): [True: 1.54M, False: 0]
  |  Branch (216:3): [True: 1.54M, False: 0]
  |  Branch (216:3): [True: 0, False: 1.54M]
  ------------------
  217|  1.54M|              cbor_int_get_width(item) <= CBOR_INT_64);
  218|       |  // cppcheck-suppress missingReturn
  219|  1.54M|  switch (cbor_int_get_width(item)) {
  220|  1.51M|    case CBOR_INT_8:
  ------------------
  |  Branch (220:5): [True: 1.51M, False: 25.2k]
  ------------------
  221|  1.51M|      return cbor_encode_negint8(cbor_get_uint8(item), buffer, buffer_size);
  222|  16.5k|    case CBOR_INT_16:
  ------------------
  |  Branch (222:5): [True: 16.5k, False: 1.52M]
  ------------------
  223|  16.5k|      return cbor_encode_negint16(cbor_get_uint16(item), buffer, buffer_size);
  224|  7.65k|    case CBOR_INT_32:
  ------------------
  |  Branch (224:5): [True: 7.65k, False: 1.53M]
  ------------------
  225|  7.65k|      return cbor_encode_negint32(cbor_get_uint32(item), buffer, buffer_size);
  226|  1.04k|    case CBOR_INT_64:
  ------------------
  |  Branch (226:5): [True: 1.04k, False: 1.54M]
  ------------------
  227|  1.04k|      return cbor_encode_negint64(cbor_get_uint64(item), buffer, buffer_size);
  228|      0|    default:  // LCOV_EXCL_START
  ------------------
  |  Branch (228:5): [True: 0, False: 1.54M]
  ------------------
  229|      0|      _CBOR_UNREACHABLE;
  ------------------
  |  |  111|      0|#define _CBOR_UNREACHABLE __builtin_unreachable()
  ------------------
  230|      0|      return 0;  // LCOV_EXCL_STOP
  231|  1.54M|  }
  232|  1.54M|}
cbor_serialize_bytestring:
  235|   523k|                                 size_t buffer_size) {
  236|   523k|  CBOR_ASSERT(cbor_isa_bytestring(item));
  ------------------
  |  |   64|   523k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (236:3): [True: 0, False: 523k]
  |  Branch (236:3): [True: 523k, False: 0]
  ------------------
  237|   523k|  if (cbor_bytestring_is_definite(item)) {
  ------------------
  |  Branch (237:7): [True: 522k, False: 875]
  ------------------
  238|   522k|    size_t length = cbor_bytestring_length(item);
  239|   522k|    size_t written = cbor_encode_bytestring_start(length, buffer, buffer_size);
  240|   522k|    if (written > 0 && (buffer_size - written >= length)) {
  ------------------
  |  Branch (240:9): [True: 522k, False: 0]
  |  Branch (240:24): [True: 522k, False: 0]
  ------------------
  241|   522k|      memcpy(buffer + written, cbor_bytestring_handle(item), length);
  242|   522k|      return written + length;
  243|   522k|    }
  244|      0|    return 0;
  245|   522k|  } else {
  246|    875|    CBOR_ASSERT(cbor_bytestring_is_indefinite(item));
  ------------------
  |  |   64|    875|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (246:5): [True: 0, False: 875]
  |  Branch (246:5): [True: 875, False: 0]
  ------------------
  247|    875|    size_t chunk_count = cbor_bytestring_chunk_count(item);
  248|    875|    size_t written = cbor_encode_indef_bytestring_start(buffer, buffer_size);
  249|    875|    if (written == 0) return 0;
  ------------------
  |  Branch (249:9): [True: 0, False: 875]
  ------------------
  250|       |
  251|    875|    cbor_item_t** chunks = cbor_bytestring_chunks_handle(item);
  252|   480k|    for (size_t i = 0; i < chunk_count; i++) {
  ------------------
  |  Branch (252:24): [True: 479k, False: 875]
  ------------------
  253|   479k|      size_t chunk_written = cbor_serialize_bytestring(
  254|   479k|          chunks[i], buffer + written, buffer_size - written);
  255|   479k|      if (chunk_written == 0) return 0;
  ------------------
  |  Branch (255:11): [True: 0, False: 479k]
  ------------------
  256|   479k|      written += chunk_written;
  257|   479k|    }
  258|       |
  259|    875|    size_t break_written =
  260|    875|        cbor_encode_break(buffer + written, buffer_size - written);
  261|    875|    if (break_written == 0) return 0;
  ------------------
  |  Branch (261:9): [True: 0, False: 875]
  ------------------
  262|    875|    return written + break_written;
  263|    875|  }
  264|   523k|}
cbor_serialize_string:
  267|   457k|                             size_t buffer_size) {
  268|   457k|  CBOR_ASSERT(cbor_isa_string(item));
  ------------------
  |  |   64|   457k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (268:3): [True: 0, False: 457k]
  |  Branch (268:3): [True: 457k, False: 0]
  ------------------
  269|   457k|  if (cbor_string_is_definite(item)) {
  ------------------
  |  Branch (269:7): [True: 454k, False: 2.24k]
  ------------------
  270|   454k|    size_t length = cbor_string_length(item);
  271|   454k|    size_t written = cbor_encode_string_start(length, buffer, buffer_size);
  272|   454k|    if (written && (buffer_size - written >= length)) {
  ------------------
  |  Branch (272:9): [True: 454k, False: 0]
  |  Branch (272:20): [True: 454k, False: 0]
  ------------------
  273|   454k|      memcpy(buffer + written, cbor_string_handle(item), length);
  274|   454k|      return written + length;
  275|   454k|    }
  276|      0|    return 0;
  277|   454k|  } else {
  278|  2.24k|    CBOR_ASSERT(cbor_string_is_indefinite(item));
  ------------------
  |  |   64|  2.24k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (278:5): [True: 0, False: 2.24k]
  |  Branch (278:5): [True: 2.24k, False: 0]
  ------------------
  279|  2.24k|    size_t chunk_count = cbor_string_chunk_count(item);
  280|  2.24k|    size_t written = cbor_encode_indef_string_start(buffer, buffer_size);
  281|  2.24k|    if (written == 0) return 0;
  ------------------
  |  Branch (281:9): [True: 0, False: 2.24k]
  ------------------
  282|       |
  283|  2.24k|    cbor_item_t** chunks = cbor_string_chunks_handle(item);
  284|   261k|    for (size_t i = 0; i < chunk_count; i++) {
  ------------------
  |  Branch (284:24): [True: 259k, False: 2.24k]
  ------------------
  285|   259k|      size_t chunk_written = cbor_serialize_string(chunks[i], buffer + written,
  286|   259k|                                                   buffer_size - written);
  287|   259k|      if (chunk_written == 0) return 0;
  ------------------
  |  Branch (287:11): [True: 0, False: 259k]
  ------------------
  288|   259k|      written += chunk_written;
  289|   259k|    }
  290|       |
  291|  2.24k|    size_t break_written =
  292|  2.24k|        cbor_encode_break(buffer + written, buffer_size - written);
  293|  2.24k|    if (break_written == 0) return 0;
  ------------------
  |  Branch (293:9): [True: 0, False: 2.24k]
  ------------------
  294|  2.24k|    return written + break_written;
  295|  2.24k|  }
  296|   457k|}
cbor_serialize_array:
  299|  4.16M|                            size_t buffer_size) {
  300|  4.16M|  CBOR_ASSERT(cbor_isa_array(item));
  ------------------
  |  |   64|  4.16M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (300:3): [True: 0, False: 4.16M]
  |  Branch (300:3): [True: 4.16M, False: 0]
  ------------------
  301|  4.16M|  size_t size = cbor_array_size(item), written = 0;
  302|  4.16M|  cbor_item_t** handle = cbor_array_handle(item);
  303|  4.16M|  if (cbor_array_is_definite(item)) {
  ------------------
  |  Branch (303:7): [True: 3.92M, False: 241k]
  ------------------
  304|  3.92M|    written = cbor_encode_array_start(size, buffer, buffer_size);
  305|  3.92M|  } else {
  306|   241k|    CBOR_ASSERT(cbor_array_is_indefinite(item));
  ------------------
  |  |   64|   241k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (306:5): [True: 0, False: 241k]
  |  Branch (306:5): [True: 241k, False: 0]
  ------------------
  307|   241k|    written = cbor_encode_indef_array_start(buffer, buffer_size);
  308|   241k|  }
  309|  4.16M|  if (written == 0) return 0;
  ------------------
  |  Branch (309:7): [True: 0, False: 4.16M]
  ------------------
  310|       |
  311|  13.8M|  for (size_t i = 0; i < size; i++) {
  ------------------
  |  Branch (311:22): [True: 9.66M, False: 4.16M]
  ------------------
  312|  9.66M|    size_t item_written =
  313|  9.66M|        cbor_serialize(*(handle++), buffer + written, buffer_size - written);
  314|  9.66M|    if (item_written == 0) return 0;
  ------------------
  |  Branch (314:9): [True: 0, False: 9.66M]
  ------------------
  315|  9.66M|    written += item_written;
  316|  9.66M|  }
  317|       |
  318|  4.16M|  if (cbor_array_is_definite(item)) {
  ------------------
  |  Branch (318:7): [True: 3.92M, False: 241k]
  ------------------
  319|  3.92M|    return written;
  320|  3.92M|  } else {
  321|   241k|    CBOR_ASSERT(cbor_array_is_indefinite(item));
  ------------------
  |  |   64|   241k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (321:5): [True: 0, False: 241k]
  |  Branch (321:5): [True: 241k, False: 0]
  ------------------
  322|   241k|    size_t break_written =
  323|   241k|        cbor_encode_break(buffer + written, buffer_size - written);
  324|   241k|    if (break_written == 0) return 0;
  ------------------
  |  Branch (324:9): [True: 0, False: 241k]
  ------------------
  325|   241k|    return written + break_written;
  326|   241k|  }
  327|  4.16M|}
cbor_serialize_map:
  330|  34.3k|                          size_t buffer_size) {
  331|  34.3k|  CBOR_ASSERT(cbor_isa_map(item));
  ------------------
  |  |   64|  34.3k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (331:3): [True: 0, False: 34.3k]
  |  Branch (331:3): [True: 34.3k, False: 0]
  ------------------
  332|  34.3k|  size_t size = cbor_map_size(item), written = 0;
  333|  34.3k|  struct cbor_pair* handle = cbor_map_handle(item);
  334|       |
  335|  34.3k|  if (cbor_map_is_definite(item)) {
  ------------------
  |  Branch (335:7): [True: 32.5k, False: 1.83k]
  ------------------
  336|  32.5k|    written = cbor_encode_map_start(size, buffer, buffer_size);
  337|  32.5k|  } else {
  338|  1.83k|    CBOR_ASSERT(cbor_map_is_indefinite(item));
  ------------------
  |  |   64|  1.83k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (338:5): [True: 0, False: 1.83k]
  |  Branch (338:5): [True: 1.83k, False: 0]
  ------------------
  339|  1.83k|    written = cbor_encode_indef_map_start(buffer, buffer_size);
  340|  1.83k|  }
  341|  34.3k|  if (written == 0) return 0;
  ------------------
  |  Branch (341:7): [True: 0, False: 34.3k]
  ------------------
  342|       |
  343|   835k|  for (size_t i = 0; i < size; i++) {
  ------------------
  |  Branch (343:22): [True: 801k, False: 34.3k]
  ------------------
  344|   801k|    size_t item_written =
  345|   801k|        cbor_serialize(handle->key, buffer + written, buffer_size - written);
  346|   801k|    if (item_written == 0) {
  ------------------
  |  Branch (346:9): [True: 0, False: 801k]
  ------------------
  347|      0|      return 0;
  348|      0|    }
  349|   801k|    written += item_written;
  350|   801k|    item_written = cbor_serialize((handle++)->value, buffer + written,
  351|   801k|                                  buffer_size - written);
  352|   801k|    if (item_written == 0) return 0;
  ------------------
  |  Branch (352:9): [True: 0, False: 801k]
  ------------------
  353|   801k|    written += item_written;
  354|   801k|  }
  355|       |
  356|  34.3k|  if (cbor_map_is_definite(item)) {
  ------------------
  |  Branch (356:7): [True: 32.5k, False: 1.83k]
  ------------------
  357|  32.5k|    return written;
  358|  32.5k|  } else {
  359|  1.83k|    CBOR_ASSERT(cbor_map_is_indefinite(item));
  ------------------
  |  |   64|  1.83k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (359:5): [True: 0, False: 1.83k]
  |  Branch (359:5): [True: 1.83k, False: 0]
  ------------------
  360|  1.83k|    size_t break_written =
  361|  1.83k|        cbor_encode_break(buffer + written, buffer_size - written);
  362|  1.83k|    if (break_written == 0) return 0;
  ------------------
  |  Branch (362:9): [True: 0, False: 1.83k]
  ------------------
  363|  1.83k|    return written + break_written;
  364|  1.83k|  }
  365|  34.3k|}
cbor_serialize_tag:
  368|   213k|                          size_t buffer_size) {
  369|   213k|  CBOR_ASSERT(cbor_isa_tag(item));
  ------------------
  |  |   64|   213k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (369:3): [True: 0, False: 213k]
  |  Branch (369:3): [True: 213k, False: 0]
  ------------------
  370|   213k|  size_t written = cbor_encode_tag(cbor_tag_value(item), buffer, buffer_size);
  371|   213k|  if (written == 0) return 0;
  ------------------
  |  Branch (371:7): [True: 0, False: 213k]
  ------------------
  372|       |
  373|   213k|  cbor_item_t* tagged = cbor_tag_item(item);
  374|   213k|  if (tagged == NULL) return 0;
  ------------------
  |  Branch (374:7): [True: 0, False: 213k]
  ------------------
  375|   213k|  size_t item_written = cbor_serialize(cbor_move(tagged), buffer + written,
  376|   213k|                                       buffer_size - written);
  377|   213k|  if (item_written == 0) return 0;
  ------------------
  |  Branch (377:7): [True: 0, False: 213k]
  ------------------
  378|   213k|  return written + item_written;
  379|   213k|}
cbor_serialize_float_ctrl:
  382|   248k|                                 size_t buffer_size) {
  383|   248k|  CBOR_ASSERT(cbor_isa_float_ctrl(item));
  ------------------
  |  |   64|   248k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (383:3): [True: 0, False: 248k]
  |  Branch (383:3): [True: 248k, False: 0]
  ------------------
  384|   248k|  CBOR_ASSERT(cbor_float_get_width(item) >= CBOR_FLOAT_0 &&
  ------------------
  |  |   64|   248k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (384:3): [True: 248k, False: 0]
  |  Branch (384:3): [True: 248k, False: 0]
  |  Branch (384:3): [True: 0, False: 248k]
  ------------------
  385|   248k|              cbor_float_get_width(item) <= CBOR_FLOAT_64);
  386|       |  // cppcheck-suppress missingReturn
  387|   248k|  switch (cbor_float_get_width(item)) {
  388|   186k|    case CBOR_FLOAT_0:
  ------------------
  |  Branch (388:5): [True: 186k, False: 61.6k]
  ------------------
  389|       |      /* CTRL - special treatment */
  390|   186k|      return cbor_encode_ctrl(cbor_ctrl_value(item), buffer, buffer_size);
  391|  38.1k|    case CBOR_FLOAT_16:
  ------------------
  |  Branch (391:5): [True: 38.1k, False: 210k]
  ------------------
  392|  38.1k|      return cbor_encode_half(cbor_float_get_float2(item), buffer, buffer_size);
  393|  9.11k|    case CBOR_FLOAT_32:
  ------------------
  |  Branch (393:5): [True: 9.11k, False: 239k]
  ------------------
  394|  9.11k|      return cbor_encode_single(cbor_float_get_float4(item), buffer,
  395|  9.11k|                                buffer_size);
  396|  14.3k|    case CBOR_FLOAT_64:
  ------------------
  |  Branch (396:5): [True: 14.3k, False: 233k]
  ------------------
  397|  14.3k|      return cbor_encode_double(cbor_float_get_float8(item), buffer,
  398|  14.3k|                                buffer_size);
  399|      0|    default:  // LCOV_EXCL_START
  ------------------
  |  Branch (399:5): [True: 0, False: 248k]
  ------------------
  400|      0|      _CBOR_UNREACHABLE;
  ------------------
  |  |  111|      0|#define _CBOR_UNREACHABLE __builtin_unreachable()
  ------------------
  401|      0|      return 0;  // LCOV_EXCL_STOP
  402|   248k|  }
  403|   248k|}

cbor_stream_decode:
   51|  25.9M|    const struct cbor_callbacks* callbacks, void* context) {
   52|       |  // Attempt to claim the initial MTB byte
   53|  25.9M|  struct cbor_decoder_result result = {.status = CBOR_DECODER_FINISHED};
   54|  25.9M|  if (!claim_bytes(1, source_size, &result)) {
  ------------------
  |  Branch (54:7): [True: 0, False: 25.9M]
  ------------------
   55|      0|    return result;
   56|      0|  }
   57|       |
   58|  25.9M|  switch (*source) {
   59|  7.84M|    case 0x00: /* Fallthrough */
  ------------------
  |  Branch (59:5): [True: 7.84M, False: 18.1M]
  ------------------
   60|  7.86M|    case 0x01: /* Fallthrough */
  ------------------
  |  Branch (60:5): [True: 21.6k, False: 25.9M]
  ------------------
   61|  7.89M|    case 0x02: /* Fallthrough */
  ------------------
  |  Branch (61:5): [True: 24.4k, False: 25.9M]
  ------------------
   62|  7.90M|    case 0x03: /* Fallthrough */
  ------------------
  |  Branch (62:5): [True: 7.24k, False: 25.9M]
  ------------------
   63|  7.90M|    case 0x04: /* Fallthrough */
  ------------------
  |  Branch (63:5): [True: 8.63k, False: 25.9M]
  ------------------
   64|  7.97M|    case 0x05: /* Fallthrough */
  ------------------
  |  Branch (64:5): [True: 65.9k, False: 25.9M]
  ------------------
   65|  7.98M|    case 0x06: /* Fallthrough */
  ------------------
  |  Branch (65:5): [True: 14.5k, False: 25.9M]
  ------------------
   66|  8.00M|    case 0x07: /* Fallthrough */
  ------------------
  |  Branch (66:5): [True: 18.0k, False: 25.9M]
  ------------------
   67|  8.02M|    case 0x08: /* Fallthrough */
  ------------------
  |  Branch (67:5): [True: 17.1k, False: 25.9M]
  ------------------
   68|  8.06M|    case 0x09: /* Fallthrough */
  ------------------
  |  Branch (68:5): [True: 37.5k, False: 25.9M]
  ------------------
   69|  8.07M|    case 0x0A: /* Fallthrough */
  ------------------
  |  Branch (69:5): [True: 16.9k, False: 25.9M]
  ------------------
   70|  8.08M|    case 0x0B: /* Fallthrough */
  ------------------
  |  Branch (70:5): [True: 2.08k, False: 25.9M]
  ------------------
   71|  8.09M|    case 0x0C: /* Fallthrough */
  ------------------
  |  Branch (71:5): [True: 11.4k, False: 25.9M]
  ------------------
   72|  8.21M|    case 0x0D: /* Fallthrough */
  ------------------
  |  Branch (72:5): [True: 126k, False: 25.8M]
  ------------------
   73|  8.22M|    case 0x0E: /* Fallthrough */
  ------------------
  |  Branch (73:5): [True: 5.24k, False: 25.9M]
  ------------------
   74|  8.22M|    case 0x0F: /* Fallthrough */
  ------------------
  |  Branch (74:5): [True: 4.05k, False: 25.9M]
  ------------------
   75|  8.32M|    case 0x10: /* Fallthrough */
  ------------------
  |  Branch (75:5): [True: 97.0k, False: 25.8M]
  ------------------
   76|  8.35M|    case 0x11: /* Fallthrough */
  ------------------
  |  Branch (76:5): [True: 27.8k, False: 25.9M]
  ------------------
   77|  8.37M|    case 0x12: /* Fallthrough */
  ------------------
  |  Branch (77:5): [True: 19.1k, False: 25.9M]
  ------------------
   78|  8.38M|    case 0x13: /* Fallthrough */
  ------------------
  |  Branch (78:5): [True: 10.2k, False: 25.9M]
  ------------------
   79|  8.41M|    case 0x14: /* Fallthrough */
  ------------------
  |  Branch (79:5): [True: 34.8k, False: 25.9M]
  ------------------
   80|  8.52M|    case 0x15: /* Fallthrough */
  ------------------
  |  Branch (80:5): [True: 110k, False: 25.8M]
  ------------------
   81|  8.55M|    case 0x16: /* Fallthrough */
  ------------------
  |  Branch (81:5): [True: 25.6k, False: 25.9M]
  ------------------
   82|  8.56M|    case 0x17:
  ------------------
  |  Branch (82:5): [True: 8.12k, False: 25.9M]
  ------------------
   83|       |      /* Embedded one byte unsigned integer */
   84|  8.56M|      {
   85|  8.56M|        callbacks->uint8(context, _cbor_load_uint8(source));
   86|  8.56M|        return result;
   87|  8.55M|      }
   88|  11.3k|    case 0x18:
  ------------------
  |  Branch (88:5): [True: 11.3k, False: 25.9M]
  ------------------
   89|       |      /* One byte unsigned integer */
   90|  11.3k|      {
   91|  11.3k|        if (claim_bytes(1, source_size, &result)) {
  ------------------
  |  Branch (91:13): [True: 11.3k, False: 2]
  ------------------
   92|  11.3k|          callbacks->uint8(context, _cbor_load_uint8(source + 1));
   93|  11.3k|        }
   94|  11.3k|        return result;
   95|  8.55M|      }
   96|  6.63k|    case 0x19:
  ------------------
  |  Branch (96:5): [True: 6.63k, False: 25.9M]
  ------------------
   97|       |      /* Two bytes unsigned integer */
   98|  6.63k|      {
   99|  6.63k|        if (claim_bytes(2, source_size, &result)) {
  ------------------
  |  Branch (99:13): [True: 6.62k, False: 1]
  ------------------
  100|  6.62k|          callbacks->uint16(context, _cbor_load_uint16(source + 1));
  101|  6.62k|        }
  102|  6.63k|        return result;
  103|  8.55M|      }
  104|   304k|    case 0x1A:
  ------------------
  |  Branch (104:5): [True: 304k, False: 25.6M]
  ------------------
  105|       |      /* Four bytes unsigned integer */
  106|   304k|      {
  107|   304k|        if (claim_bytes(4, source_size, &result)) {
  ------------------
  |  Branch (107:13): [True: 304k, False: 3]
  ------------------
  108|   304k|          callbacks->uint32(context, _cbor_load_uint32(source + 1));
  109|   304k|        }
  110|   304k|        return result;
  111|  8.55M|      }
  112|  13.6k|    case 0x1B:
  ------------------
  |  Branch (112:5): [True: 13.6k, False: 25.9M]
  ------------------
  113|       |      /* Eight bytes unsigned integer */
  114|  13.6k|      {
  115|  13.6k|        if (claim_bytes(8, source_size, &result)) {
  ------------------
  |  Branch (115:13): [True: 13.6k, False: 5]
  ------------------
  116|  13.6k|          callbacks->uint64(context, _cbor_load_uint64(source + 1));
  117|  13.6k|        }
  118|  13.6k|        return result;
  119|  8.55M|      }
  120|      1|    case 0x1C: /* Fallthrough */
  ------------------
  |  Branch (120:5): [True: 1, False: 25.9M]
  ------------------
  121|      2|    case 0x1D: /* Fallthrough */
  ------------------
  |  Branch (121:5): [True: 1, False: 25.9M]
  ------------------
  122|      3|    case 0x1E: /* Fallthrough */
  ------------------
  |  Branch (122:5): [True: 1, False: 25.9M]
  ------------------
  123|      5|    case 0x1F:
  ------------------
  |  Branch (123:5): [True: 2, False: 25.9M]
  ------------------
  124|       |      /* Reserved */
  125|      5|      { return (struct cbor_decoder_result){.status = CBOR_DECODER_ERROR}; }
  126|  5.03k|    case 0x20: /* Fallthrough */
  ------------------
  |  Branch (126:5): [True: 5.03k, False: 25.9M]
  ------------------
  127|  7.00k|    case 0x21: /* Fallthrough */
  ------------------
  |  Branch (127:5): [True: 1.96k, False: 25.9M]
  ------------------
  128|  8.37k|    case 0x22: /* Fallthrough */
  ------------------
  |  Branch (128:5): [True: 1.36k, False: 25.9M]
  ------------------
  129|  16.3k|    case 0x23: /* Fallthrough */
  ------------------
  |  Branch (129:5): [True: 8.00k, False: 25.9M]
  ------------------
  130|  25.5k|    case 0x24: /* Fallthrough */
  ------------------
  |  Branch (130:5): [True: 9.20k, False: 25.9M]
  ------------------
  131|   282k|    case 0x25: /* Fallthrough */
  ------------------
  |  Branch (131:5): [True: 257k, False: 25.7M]
  ------------------
  132|   485k|    case 0x26: /* Fallthrough */
  ------------------
  |  Branch (132:5): [True: 202k, False: 25.7M]
  ------------------
  133|   487k|    case 0x27: /* Fallthrough */
  ------------------
  |  Branch (133:5): [True: 1.87k, False: 25.9M]
  ------------------
  134|  2.03M|    case 0x28: /* Fallthrough */
  ------------------
  |  Branch (134:5): [True: 1.54M, False: 24.4M]
  ------------------
  135|  2.04M|    case 0x29: /* Fallthrough */
  ------------------
  |  Branch (135:5): [True: 13.7k, False: 25.9M]
  ------------------
  136|  2.05M|    case 0x2A: /* Fallthrough */
  ------------------
  |  Branch (136:5): [True: 966, False: 25.9M]
  ------------------
  137|  2.12M|    case 0x2B: /* Fallthrough */
  ------------------
  |  Branch (137:5): [True: 72.3k, False: 25.9M]
  ------------------
  138|  2.19M|    case 0x2C: /* Fallthrough */
  ------------------
  |  Branch (138:5): [True: 66.8k, False: 25.9M]
  ------------------
  139|  2.20M|    case 0x2D: /* Fallthrough */
  ------------------
  |  Branch (139:5): [True: 19.0k, False: 25.9M]
  ------------------
  140|  2.25M|    case 0x2E: /* Fallthrough */
  ------------------
  |  Branch (140:5): [True: 42.6k, False: 25.9M]
  ------------------
  141|  2.25M|    case 0x2F: /* Fallthrough */
  ------------------
  |  Branch (141:5): [True: 7.91k, False: 25.9M]
  ------------------
  142|  2.41M|    case 0x30: /* Fallthrough */
  ------------------
  |  Branch (142:5): [True: 151k, False: 25.8M]
  ------------------
  143|  2.44M|    case 0x31: /* Fallthrough */
  ------------------
  |  Branch (143:5): [True: 28.6k, False: 25.9M]
  ------------------
  144|  2.49M|    case 0x32: /* Fallthrough */
  ------------------
  |  Branch (144:5): [True: 52.9k, False: 25.9M]
  ------------------
  145|  2.55M|    case 0x33: /* Fallthrough */
  ------------------
  |  Branch (145:5): [True: 64.6k, False: 25.9M]
  ------------------
  146|  2.57M|    case 0x34: /* Fallthrough */
  ------------------
  |  Branch (146:5): [True: 12.8k, False: 25.9M]
  ------------------
  147|  2.65M|    case 0x35: /* Fallthrough */
  ------------------
  |  Branch (147:5): [True: 80.0k, False: 25.8M]
  ------------------
  148|  2.72M|    case 0x36: /* Fallthrough */
  ------------------
  |  Branch (148:5): [True: 72.7k, False: 25.9M]
  ------------------
  149|  2.77M|    case 0x37:
  ------------------
  |  Branch (149:5): [True: 51.6k, False: 25.9M]
  ------------------
  150|       |      /* Embedded one byte negative integer */
  151|  2.77M|      {
  152|  2.77M|        callbacks->negint8(context,
  153|  2.77M|                           _cbor_load_uint8(source) - 0x20); /* 0x20 offset */
  154|  2.77M|        return result;
  155|  2.72M|      }
  156|  20.1k|    case 0x38:
  ------------------
  |  Branch (156:5): [True: 20.1k, False: 25.9M]
  ------------------
  157|       |      /* One byte negative integer */
  158|  20.1k|      {
  159|  20.1k|        if (claim_bytes(1, source_size, &result)) {
  ------------------
  |  Branch (159:13): [True: 20.1k, False: 3]
  ------------------
  160|  20.1k|          callbacks->negint8(context, _cbor_load_uint8(source + 1));
  161|  20.1k|        }
  162|  20.1k|        return result;
  163|  2.72M|      }
  164|  27.7k|    case 0x39:
  ------------------
  |  Branch (164:5): [True: 27.7k, False: 25.9M]
  ------------------
  165|       |      /* Two bytes negative integer */
  166|  27.7k|      {
  167|  27.7k|        if (claim_bytes(2, source_size, &result)) {
  ------------------
  |  Branch (167:13): [True: 27.7k, False: 5]
  ------------------
  168|  27.7k|          callbacks->negint16(context, _cbor_load_uint16(source + 1));
  169|  27.7k|        }
  170|  27.7k|        return result;
  171|  2.72M|      }
  172|  11.8k|    case 0x3A:
  ------------------
  |  Branch (172:5): [True: 11.8k, False: 25.9M]
  ------------------
  173|       |      /* Four bytes negative integer */
  174|  11.8k|      {
  175|  11.8k|        if (claim_bytes(4, source_size, &result)) {
  ------------------
  |  Branch (175:13): [True: 11.8k, False: 2]
  ------------------
  176|  11.8k|          callbacks->negint32(context, _cbor_load_uint32(source + 1));
  177|  11.8k|        }
  178|  11.8k|        return result;
  179|  2.72M|      }
  180|  3.97k|    case 0x3B:
  ------------------
  |  Branch (180:5): [True: 3.97k, False: 25.9M]
  ------------------
  181|       |      /* Eight bytes negative integer */
  182|  3.97k|      {
  183|  3.97k|        if (claim_bytes(8, source_size, &result)) {
  ------------------
  |  Branch (183:13): [True: 3.97k, False: 3]
  ------------------
  184|  3.97k|          callbacks->negint64(context, _cbor_load_uint64(source + 1));
  185|  3.97k|        }
  186|  3.97k|        return result;
  187|  2.72M|      }
  188|      1|    case 0x3C: /* Fallthrough */
  ------------------
  |  Branch (188:5): [True: 1, False: 25.9M]
  ------------------
  189|      3|    case 0x3D: /* Fallthrough */
  ------------------
  |  Branch (189:5): [True: 2, False: 25.9M]
  ------------------
  190|      4|    case 0x3E: /* Fallthrough */
  ------------------
  |  Branch (190:5): [True: 1, False: 25.9M]
  ------------------
  191|      7|    case 0x3F:
  ------------------
  |  Branch (191:5): [True: 3, False: 25.9M]
  ------------------
  192|       |      /* Reserved */
  193|      7|      { return (struct cbor_decoder_result){.status = CBOR_DECODER_ERROR}; }
  194|      8|    case 0x40: /* Fallthrough */
  ------------------
  |  Branch (194:5): [True: 8, False: 25.9M]
  ------------------
  195|  1.13M|    case 0x41: /* Fallthrough */
  ------------------
  |  Branch (195:5): [True: 1.13M, False: 24.8M]
  ------------------
  196|  1.13M|    case 0x42: /* Fallthrough */
  ------------------
  |  Branch (196:5): [True: 441, False: 25.9M]
  ------------------
  197|  1.13M|    case 0x43: /* Fallthrough */
  ------------------
  |  Branch (197:5): [True: 474, False: 25.9M]
  ------------------
  198|  1.14M|    case 0x44: /* Fallthrough */
  ------------------
  |  Branch (198:5): [True: 12.6k, False: 25.9M]
  ------------------
  199|  1.14M|    case 0x45: /* Fallthrough */
  ------------------
  |  Branch (199:5): [True: 732, False: 25.9M]
  ------------------
  200|  1.15M|    case 0x46: /* Fallthrough */
  ------------------
  |  Branch (200:5): [True: 4.25k, False: 25.9M]
  ------------------
  201|  1.15M|    case 0x47: /* Fallthrough */
  ------------------
  |  Branch (201:5): [True: 371, False: 25.9M]
  ------------------
  202|  1.15M|    case 0x48: /* Fallthrough */
  ------------------
  |  Branch (202:5): [True: 979, False: 25.9M]
  ------------------
  203|  1.15M|    case 0x49: /* Fallthrough */
  ------------------
  |  Branch (203:5): [True: 443, False: 25.9M]
  ------------------
  204|  1.15M|    case 0x4A: /* Fallthrough */
  ------------------
  |  Branch (204:5): [True: 544, False: 25.9M]
  ------------------
  205|  1.15M|    case 0x4B: /* Fallthrough */
  ------------------
  |  Branch (205:5): [True: 808, False: 25.9M]
  ------------------
  206|  1.15M|    case 0x4C: /* Fallthrough */
  ------------------
  |  Branch (206:5): [True: 364, False: 25.9M]
  ------------------
  207|  1.15M|    case 0x4D: /* Fallthrough */
  ------------------
  |  Branch (207:5): [True: 2.48k, False: 25.9M]
  ------------------
  208|  1.15M|    case 0x4E: /* Fallthrough */
  ------------------
  |  Branch (208:5): [True: 736, False: 25.9M]
  ------------------
  209|  1.15M|    case 0x4F: /* Fallthrough */
  ------------------
  |  Branch (209:5): [True: 449, False: 25.9M]
  ------------------
  210|  1.15M|    case 0x50: /* Fallthrough */
  ------------------
  |  Branch (210:5): [True: 288, False: 25.9M]
  ------------------
  211|  1.16M|    case 0x51: /* Fallthrough */
  ------------------
  |  Branch (211:5): [True: 1.69k, False: 25.9M]
  ------------------
  212|  1.16M|    case 0x52: /* Fallthrough */
  ------------------
  |  Branch (212:5): [True: 282, False: 25.9M]
  ------------------
  213|  1.16M|    case 0x53: /* Fallthrough */
  ------------------
  |  Branch (213:5): [True: 264, False: 25.9M]
  ------------------
  214|  1.16M|    case 0x54: /* Fallthrough */
  ------------------
  |  Branch (214:5): [True: 2.62k, False: 25.9M]
  ------------------
  215|  1.16M|    case 0x55: /* Fallthrough */
  ------------------
  |  Branch (215:5): [True: 721, False: 25.9M]
  ------------------
  216|  1.16M|    case 0x56: /* Fallthrough */
  ------------------
  |  Branch (216:5): [True: 502, False: 25.9M]
  ------------------
  217|  1.16M|    case 0x57:
  ------------------
  |  Branch (217:5): [True: 281, False: 25.9M]
  ------------------
  218|       |      /* Embedded length byte string */
  219|  1.16M|      {
  220|  1.16M|        uint64_t length = _cbor_load_uint8(source) - 0x40; /* 0x40 offset */
  221|  1.16M|        CLAIM_BYTES_AND_INVOKE(byte_string, length, 0);
  ------------------
  |  |   33|  1.16M|  do {                                                                     \
  |  |   34|  1.16M|    if (claim_bytes(length, source_size, &result)) {                       \
  |  |  ------------------
  |  |  |  Branch (34:9): [True: 1.16M, False: 184]
  |  |  ------------------
  |  |   35|  1.16M|      callbacks->callback_name(context, source + 1 + source_extra_offset,  \
  |  |   36|  1.16M|                               length);                                    \
  |  |   37|  1.16M|    }                                                                      \
  |  |   38|  1.16M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (38:12): [Folded, False: 1.16M]
  |  |  ------------------
  ------------------
  222|  1.16M|        return result;
  223|  1.16M|      }
  224|    820|    case 0x58:
  ------------------
  |  Branch (224:5): [True: 820, False: 25.9M]
  ------------------
  225|       |      /* One byte length byte string */
  226|    820|      READ_CLAIM_INVOKE(byte_string, _cbor_load_uint8, 1);
  ------------------
  |  |   41|    820|  do {                                                                \
  |  |   42|    820|    if (claim_bytes(length_bytes, source_size, &result)) {            \
  |  |  ------------------
  |  |  |  Branch (42:9): [True: 818, False: 2]
  |  |  ------------------
  |  |   43|    818|      uint64_t length = length_reader(source + 1);                    \
  |  |   44|    818|      CLAIM_BYTES_AND_INVOKE(callback_name, length, length_bytes);    \
  |  |  ------------------
  |  |  |  |   33|    818|  do {                                                                     \
  |  |  |  |   34|    818|    if (claim_bytes(length, source_size, &result)) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (34:9): [True: 816, False: 2]
  |  |  |  |  ------------------
  |  |  |  |   35|    816|      callbacks->callback_name(context, source + 1 + source_extra_offset,  \
  |  |  |  |   36|    816|                               length);                                    \
  |  |  |  |   37|    816|    }                                                                      \
  |  |  |  |   38|    818|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (38:12): [Folded, False: 818]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|    818|    }                                                                 \
  |  |   46|    820|    return result;                                                    \
  |  |   47|    820|  } while (0)
  |  |  ------------------
  |  |  |  Branch (47:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  227|    243|    case 0x59:
  ------------------
  |  Branch (227:5): [True: 243, False: 25.9M]
  ------------------
  228|       |      /* Two bytes length byte string */
  229|    243|      READ_CLAIM_INVOKE(byte_string, _cbor_load_uint16, 2);
  ------------------
  |  |   41|    243|  do {                                                                \
  |  |   42|    243|    if (claim_bytes(length_bytes, source_size, &result)) {            \
  |  |  ------------------
  |  |  |  Branch (42:9): [True: 242, False: 1]
  |  |  ------------------
  |  |   43|    242|      uint64_t length = length_reader(source + 1);                    \
  |  |   44|    242|      CLAIM_BYTES_AND_INVOKE(callback_name, length, length_bytes);    \
  |  |  ------------------
  |  |  |  |   33|    242|  do {                                                                     \
  |  |  |  |   34|    242|    if (claim_bytes(length, source_size, &result)) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (34:9): [True: 235, False: 7]
  |  |  |  |  ------------------
  |  |  |  |   35|    235|      callbacks->callback_name(context, source + 1 + source_extra_offset,  \
  |  |  |  |   36|    235|                               length);                                    \
  |  |  |  |   37|    235|    }                                                                      \
  |  |  |  |   38|    242|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (38:12): [Folded, False: 242]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|    242|    }                                                                 \
  |  |   46|    243|    return result;                                                    \
  |  |   47|    243|  } while (0)
  |  |  ------------------
  |  |  |  Branch (47:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  230|    246|    case 0x5A:
  ------------------
  |  Branch (230:5): [True: 246, False: 25.9M]
  ------------------
  231|       |      /* Four bytes length byte string */
  232|    246|      READ_CLAIM_INVOKE(byte_string, _cbor_load_uint32, 4);
  ------------------
  |  |   41|    246|  do {                                                                \
  |  |   42|    246|    if (claim_bytes(length_bytes, source_size, &result)) {            \
  |  |  ------------------
  |  |  |  Branch (42:9): [True: 242, False: 4]
  |  |  ------------------
  |  |   43|    242|      uint64_t length = length_reader(source + 1);                    \
  |  |   44|    242|      CLAIM_BYTES_AND_INVOKE(callback_name, length, length_bytes);    \
  |  |  ------------------
  |  |  |  |   33|    242|  do {                                                                     \
  |  |  |  |   34|    242|    if (claim_bytes(length, source_size, &result)) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (34:9): [True: 228, False: 14]
  |  |  |  |  ------------------
  |  |  |  |   35|    228|      callbacks->callback_name(context, source + 1 + source_extra_offset,  \
  |  |  |  |   36|    228|                               length);                                    \
  |  |  |  |   37|    228|    }                                                                      \
  |  |  |  |   38|    242|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (38:12): [Folded, False: 242]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|    242|    }                                                                 \
  |  |   46|    246|    return result;                                                    \
  |  |   47|    246|  } while (0)
  |  |  ------------------
  |  |  |  Branch (47:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  233|    238|    case 0x5B:
  ------------------
  |  Branch (233:5): [True: 238, False: 25.9M]
  ------------------
  234|       |      /* Eight bytes length byte string */
  235|    238|      READ_CLAIM_INVOKE(byte_string, _cbor_load_uint64, 8);
  ------------------
  |  |   41|    238|  do {                                                                \
  |  |   42|    238|    if (claim_bytes(length_bytes, source_size, &result)) {            \
  |  |  ------------------
  |  |  |  Branch (42:9): [True: 237, False: 1]
  |  |  ------------------
  |  |   43|    237|      uint64_t length = length_reader(source + 1);                    \
  |  |   44|    237|      CLAIM_BYTES_AND_INVOKE(callback_name, length, length_bytes);    \
  |  |  ------------------
  |  |  |  |   33|    237|  do {                                                                     \
  |  |  |  |   34|    237|    if (claim_bytes(length, source_size, &result)) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (34:9): [True: 205, False: 32]
  |  |  |  |  ------------------
  |  |  |  |   35|    205|      callbacks->callback_name(context, source + 1 + source_extra_offset,  \
  |  |  |  |   36|    205|                               length);                                    \
  |  |  |  |   37|    205|    }                                                                      \
  |  |  |  |   38|    237|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (38:12): [Folded, False: 237]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|    237|    }                                                                 \
  |  |   46|    238|    return result;                                                    \
  |  |   47|    238|  } while (0)
  |  |  ------------------
  |  |  |  Branch (47:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  236|      1|    case 0x5C: /* Fallthrough */
  ------------------
  |  Branch (236:5): [True: 1, False: 25.9M]
  ------------------
  237|      2|    case 0x5D: /* Fallthrough */
  ------------------
  |  Branch (237:5): [True: 1, False: 25.9M]
  ------------------
  238|      3|    case 0x5E:
  ------------------
  |  Branch (238:5): [True: 1, False: 25.9M]
  ------------------
  239|       |      /* Reserved */
  240|      3|      { return (struct cbor_decoder_result){.status = CBOR_DECODER_ERROR}; }
  241|  1.66k|    case 0x5F:
  ------------------
  |  Branch (241:5): [True: 1.66k, False: 25.9M]
  ------------------
  242|       |      /* Indefinite byte string */
  243|  1.66k|      {
  244|  1.66k|        callbacks->byte_string_start(context);
  245|  1.66k|        return result;
  246|      2|      }
  247|      8|    case 0x60: /* Fallthrough */
  ------------------
  |  Branch (247:5): [True: 8, False: 25.9M]
  ------------------
  248|   742k|    case 0x61: /* Fallthrough */
  ------------------
  |  Branch (248:5): [True: 742k, False: 25.2M]
  ------------------
  249|   743k|    case 0x62: /* Fallthrough */
  ------------------
  |  Branch (249:5): [True: 532, False: 25.9M]
  ------------------
  250|   755k|    case 0x63: /* Fallthrough */
  ------------------
  |  Branch (250:5): [True: 11.5k, False: 25.9M]
  ------------------
  251|   755k|    case 0x64: /* Fallthrough */
  ------------------
  |  Branch (251:5): [True: 447, False: 25.9M]
  ------------------
  252|   755k|    case 0x65: /* Fallthrough */
  ------------------
  |  Branch (252:5): [True: 350, False: 25.9M]
  ------------------
  253|   756k|    case 0x66: /* Fallthrough */
  ------------------
  |  Branch (253:5): [True: 354, False: 25.9M]
  ------------------
  254|   757k|    case 0x67: /* Fallthrough */
  ------------------
  |  Branch (254:5): [True: 1.74k, False: 25.9M]
  ------------------
  255|   759k|    case 0x68: /* Fallthrough */
  ------------------
  |  Branch (255:5): [True: 1.10k, False: 25.9M]
  ------------------
  256|   760k|    case 0x69: /* Fallthrough */
  ------------------
  |  Branch (256:5): [True: 1.91k, False: 25.9M]
  ------------------
  257|   764k|    case 0x6A: /* Fallthrough */
  ------------------
  |  Branch (257:5): [True: 3.30k, False: 25.9M]
  ------------------
  258|   765k|    case 0x6B: /* Fallthrough */
  ------------------
  |  Branch (258:5): [True: 865, False: 25.9M]
  ------------------
  259|   766k|    case 0x6C: /* Fallthrough */
  ------------------
  |  Branch (259:5): [True: 1.54k, False: 25.9M]
  ------------------
  260|   766k|    case 0x6D: /* Fallthrough */
  ------------------
  |  Branch (260:5): [True: 237, False: 25.9M]
  ------------------
  261|   767k|    case 0x6E: /* Fallthrough */
  ------------------
  |  Branch (261:5): [True: 496, False: 25.9M]
  ------------------
  262|   767k|    case 0x6F: /* Fallthrough */
  ------------------
  |  Branch (262:5): [True: 265, False: 25.9M]
  ------------------
  263|   771k|    case 0x70: /* Fallthrough */
  ------------------
  |  Branch (263:5): [True: 3.84k, False: 25.9M]
  ------------------
  264|   772k|    case 0x71: /* Fallthrough */
  ------------------
  |  Branch (264:5): [True: 1.39k, False: 25.9M]
  ------------------
  265|   773k|    case 0x72: /* Fallthrough */
  ------------------
  |  Branch (265:5): [True: 428, False: 25.9M]
  ------------------
  266|   773k|    case 0x73: /* Fallthrough */
  ------------------
  |  Branch (266:5): [True: 494, False: 25.9M]
  ------------------
  267|   797k|    case 0x74: /* Fallthrough */
  ------------------
  |  Branch (267:5): [True: 23.3k, False: 25.9M]
  ------------------
  268|   798k|    case 0x75: /* Fallthrough */
  ------------------
  |  Branch (268:5): [True: 1.32k, False: 25.9M]
  ------------------
  269|   799k|    case 0x76: /* Fallthrough */
  ------------------
  |  Branch (269:5): [True: 689, False: 25.9M]
  ------------------
  270|   799k|    case 0x77:
  ------------------
  |  Branch (270:5): [True: 419, False: 25.9M]
  ------------------
  271|       |      /* Embedded one byte length string */
  272|   799k|      {
  273|   799k|        uint64_t length = _cbor_load_uint8(source) - 0x60; /* 0x60 offset */
  274|   799k|        CLAIM_BYTES_AND_INVOKE(string, length, 0);
  ------------------
  |  |   33|   799k|  do {                                                                     \
  |  |   34|   799k|    if (claim_bytes(length, source_size, &result)) {                       \
  |  |  ------------------
  |  |  |  Branch (34:9): [True: 799k, False: 189]
  |  |  ------------------
  |  |   35|   799k|      callbacks->callback_name(context, source + 1 + source_extra_offset,  \
  |  |   36|   799k|                               length);                                    \
  |  |   37|   799k|    }                                                                      \
  |  |   38|   799k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (38:12): [Folded, False: 799k]
  |  |  ------------------
  ------------------
  275|   799k|        return result;
  276|   799k|      }
  277|  6.72k|    case 0x78:
  ------------------
  |  Branch (277:5): [True: 6.72k, False: 25.9M]
  ------------------
  278|       |      /* One byte length string */
  279|  6.72k|      READ_CLAIM_INVOKE(string, _cbor_load_uint8, 1);
  ------------------
  |  |   41|  6.72k|  do {                                                                \
  |  |   42|  6.72k|    if (claim_bytes(length_bytes, source_size, &result)) {            \
  |  |  ------------------
  |  |  |  Branch (42:9): [True: 6.72k, False: 1]
  |  |  ------------------
  |  |   43|  6.72k|      uint64_t length = length_reader(source + 1);                    \
  |  |   44|  6.72k|      CLAIM_BYTES_AND_INVOKE(callback_name, length, length_bytes);    \
  |  |  ------------------
  |  |  |  |   33|  6.72k|  do {                                                                     \
  |  |  |  |   34|  6.72k|    if (claim_bytes(length, source_size, &result)) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (34:9): [True: 6.72k, False: 4]
  |  |  |  |  ------------------
  |  |  |  |   35|  6.72k|      callbacks->callback_name(context, source + 1 + source_extra_offset,  \
  |  |  |  |   36|  6.72k|                               length);                                    \
  |  |  |  |   37|  6.72k|    }                                                                      \
  |  |  |  |   38|  6.72k|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (38:12): [Folded, False: 6.72k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|  6.72k|    }                                                                 \
  |  |   46|  6.72k|    return result;                                                    \
  |  |   47|  6.72k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (47:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  280|    522|    case 0x79:
  ------------------
  |  Branch (280:5): [True: 522, False: 25.9M]
  ------------------
  281|       |      /* Two bytes length string */
  282|    522|      READ_CLAIM_INVOKE(string, _cbor_load_uint16, 2);
  ------------------
  |  |   41|    522|  do {                                                                \
  |  |   42|    522|    if (claim_bytes(length_bytes, source_size, &result)) {            \
  |  |  ------------------
  |  |  |  Branch (42:9): [True: 519, False: 3]
  |  |  ------------------
  |  |   43|    519|      uint64_t length = length_reader(source + 1);                    \
  |  |   44|    519|      CLAIM_BYTES_AND_INVOKE(callback_name, length, length_bytes);    \
  |  |  ------------------
  |  |  |  |   33|    519|  do {                                                                     \
  |  |  |  |   34|    519|    if (claim_bytes(length, source_size, &result)) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (34:9): [True: 506, False: 13]
  |  |  |  |  ------------------
  |  |  |  |   35|    506|      callbacks->callback_name(context, source + 1 + source_extra_offset,  \
  |  |  |  |   36|    506|                               length);                                    \
  |  |  |  |   37|    506|    }                                                                      \
  |  |  |  |   38|    519|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (38:12): [Folded, False: 519]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|    519|    }                                                                 \
  |  |   46|    522|    return result;                                                    \
  |  |   47|    522|  } while (0)
  |  |  ------------------
  |  |  |  Branch (47:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  283|    320|    case 0x7A:
  ------------------
  |  Branch (283:5): [True: 320, False: 25.9M]
  ------------------
  284|       |      /* Four bytes length string */
  285|    320|      READ_CLAIM_INVOKE(string, _cbor_load_uint32, 4);
  ------------------
  |  |   41|    320|  do {                                                                \
  |  |   42|    320|    if (claim_bytes(length_bytes, source_size, &result)) {            \
  |  |  ------------------
  |  |  |  Branch (42:9): [True: 319, False: 1]
  |  |  ------------------
  |  |   43|    319|      uint64_t length = length_reader(source + 1);                    \
  |  |   44|    319|      CLAIM_BYTES_AND_INVOKE(callback_name, length, length_bytes);    \
  |  |  ------------------
  |  |  |  |   33|    319|  do {                                                                     \
  |  |  |  |   34|    319|    if (claim_bytes(length, source_size, &result)) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (34:9): [True: 307, False: 12]
  |  |  |  |  ------------------
  |  |  |  |   35|    307|      callbacks->callback_name(context, source + 1 + source_extra_offset,  \
  |  |  |  |   36|    307|                               length);                                    \
  |  |  |  |   37|    307|    }                                                                      \
  |  |  |  |   38|    319|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (38:12): [Folded, False: 319]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|    319|    }                                                                 \
  |  |   46|    320|    return result;                                                    \
  |  |   47|    320|  } while (0)
  |  |  ------------------
  |  |  |  Branch (47:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  286|    369|    case 0x7B:
  ------------------
  |  Branch (286:5): [True: 369, False: 25.9M]
  ------------------
  287|       |      /* Eight bytes length string */
  288|    369|      READ_CLAIM_INVOKE(string, _cbor_load_uint64, 8);
  ------------------
  |  |   41|    369|  do {                                                                \
  |  |   42|    369|    if (claim_bytes(length_bytes, source_size, &result)) {            \
  |  |  ------------------
  |  |  |  Branch (42:9): [True: 367, False: 2]
  |  |  ------------------
  |  |   43|    367|      uint64_t length = length_reader(source + 1);                    \
  |  |   44|    367|      CLAIM_BYTES_AND_INVOKE(callback_name, length, length_bytes);    \
  |  |  ------------------
  |  |  |  |   33|    367|  do {                                                                     \
  |  |  |  |   34|    367|    if (claim_bytes(length, source_size, &result)) {                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (34:9): [True: 350, False: 17]
  |  |  |  |  ------------------
  |  |  |  |   35|    350|      callbacks->callback_name(context, source + 1 + source_extra_offset,  \
  |  |  |  |   36|    350|                               length);                                    \
  |  |  |  |   37|    350|    }                                                                      \
  |  |  |  |   38|    367|  } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (38:12): [Folded, False: 367]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|    367|    }                                                                 \
  |  |   46|    369|    return result;                                                    \
  |  |   47|    369|  } while (0)
  |  |  ------------------
  |  |  |  Branch (47:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  289|      1|    case 0x7C: /* Fallthrough */
  ------------------
  |  Branch (289:5): [True: 1, False: 25.9M]
  ------------------
  290|      3|    case 0x7D: /* Fallthrough */
  ------------------
  |  Branch (290:5): [True: 2, False: 25.9M]
  ------------------
  291|      4|    case 0x7E:
  ------------------
  |  Branch (291:5): [True: 1, False: 25.9M]
  ------------------
  292|       |      /* Reserved */
  293|      4|      { return (struct cbor_decoder_result){.status = CBOR_DECODER_ERROR}; }
  294|  5.18k|    case 0x7F:
  ------------------
  |  Branch (294:5): [True: 5.18k, False: 25.9M]
  ------------------
  295|       |      /* Indefinite length string */
  296|  5.18k|      {
  297|  5.18k|        callbacks->string_start(context);
  298|  5.18k|        return result;
  299|      3|      }
  300|      3|    case 0x80: /* Fallthrough */
  ------------------
  |  Branch (300:5): [True: 3, False: 25.9M]
  ------------------
  301|  9.40M|    case 0x81: /* Fallthrough */
  ------------------
  |  Branch (301:5): [True: 9.40M, False: 16.5M]
  ------------------
  302|  9.41M|    case 0x82: /* Fallthrough */
  ------------------
  |  Branch (302:5): [True: 13.7k, False: 25.9M]
  ------------------
  303|  9.42M|    case 0x83: /* Fallthrough */
  ------------------
  |  Branch (303:5): [True: 10.1k, False: 25.9M]
  ------------------
  304|  9.45M|    case 0x84: /* Fallthrough */
  ------------------
  |  Branch (304:5): [True: 26.3k, False: 25.9M]
  ------------------
  305|  9.45M|    case 0x85: /* Fallthrough */
  ------------------
  |  Branch (305:5): [True: 4.76k, False: 25.9M]
  ------------------
  306|  9.45M|    case 0x86: /* Fallthrough */
  ------------------
  |  Branch (306:5): [True: 506, False: 25.9M]
  ------------------
  307|  9.46M|    case 0x87: /* Fallthrough */
  ------------------
  |  Branch (307:5): [True: 698, False: 25.9M]
  ------------------
  308|  9.46M|    case 0x88: /* Fallthrough */
  ------------------
  |  Branch (308:5): [True: 7.06k, False: 25.9M]
  ------------------
  309|  9.47M|    case 0x89: /* Fallthrough */
  ------------------
  |  Branch (309:5): [True: 3.06k, False: 25.9M]
  ------------------
  310|  9.47M|    case 0x8A: /* Fallthrough */
  ------------------
  |  Branch (310:5): [True: 304, False: 25.9M]
  ------------------
  311|  9.47M|    case 0x8B: /* Fallthrough */
  ------------------
  |  Branch (311:5): [True: 340, False: 25.9M]
  ------------------
  312|  9.47M|    case 0x8C: /* Fallthrough */
  ------------------
  |  Branch (312:5): [True: 2.83k, False: 25.9M]
  ------------------
  313|  9.47M|    case 0x8D: /* Fallthrough */
  ------------------
  |  Branch (313:5): [True: 1.25k, False: 25.9M]
  ------------------
  314|  9.47M|    case 0x8E: /* Fallthrough */
  ------------------
  |  Branch (314:5): [True: 3.67k, False: 25.9M]
  ------------------
  315|  9.47M|    case 0x8F: /* Fallthrough */
  ------------------
  |  Branch (315:5): [True: 650, False: 25.9M]
  ------------------
  316|  9.48M|    case 0x90: /* Fallthrough */
  ------------------
  |  Branch (316:5): [True: 1.17k, False: 25.9M]
  ------------------
  317|  9.48M|    case 0x91: /* Fallthrough */
  ------------------
  |  Branch (317:5): [True: 1.90k, False: 25.9M]
  ------------------
  318|  9.48M|    case 0x92: /* Fallthrough */
  ------------------
  |  Branch (318:5): [True: 734, False: 25.9M]
  ------------------
  319|  9.48M|    case 0x93: /* Fallthrough */
  ------------------
  |  Branch (319:5): [True: 702, False: 25.9M]
  ------------------
  320|  9.48M|    case 0x94: /* Fallthrough */
  ------------------
  |  Branch (320:5): [True: 365, False: 25.9M]
  ------------------
  321|  9.49M|    case 0x95: /* Fallthrough */
  ------------------
  |  Branch (321:5): [True: 14.3k, False: 25.9M]
  ------------------
  322|  9.50M|    case 0x96: /* Fallthrough */
  ------------------
  |  Branch (322:5): [True: 3.95k, False: 25.9M]
  ------------------
  323|  9.50M|    case 0x97:
  ------------------
  |  Branch (323:5): [True: 1.53k, False: 25.9M]
  ------------------
  324|       |      /* Embedded one byte length array */
  325|  9.50M|      {
  326|  9.50M|        callbacks->array_start(
  327|  9.50M|            context, _cbor_load_uint8(source) - 0x80); /* 0x40 offset */
  328|  9.50M|        return result;
  329|  9.50M|      }
  330|    397|    case 0x98:
  ------------------
  |  Branch (330:5): [True: 397, False: 25.9M]
  ------------------
  331|       |      /* One byte length array */
  332|    397|      {
  333|    397|        if (claim_bytes(1, source_size, &result)) {
  ------------------
  |  Branch (333:13): [True: 394, False: 3]
  ------------------
  334|    394|          callbacks->array_start(context, _cbor_load_uint8(source + 1));
  335|    394|        }
  336|    397|        return result;
  337|  9.50M|      }
  338|    345|    case 0x99:
  ------------------
  |  Branch (338:5): [True: 345, False: 25.9M]
  ------------------
  339|       |      /* Two bytes length array */
  340|    345|      {
  341|    345|        if (claim_bytes(2, source_size, &result)) {
  ------------------
  |  Branch (341:13): [True: 343, False: 2]
  ------------------
  342|    343|          callbacks->array_start(context, _cbor_load_uint16(source + 1));
  343|    343|        }
  344|    345|        return result;
  345|  9.50M|      }
  346|    424|    case 0x9A:
  ------------------
  |  Branch (346:5): [True: 424, False: 25.9M]
  ------------------
  347|       |      /* Four bytes length array */
  348|    424|      {
  349|    424|        if (claim_bytes(4, source_size, &result)) {
  ------------------
  |  Branch (349:13): [True: 422, False: 2]
  ------------------
  350|    422|          callbacks->array_start(context, _cbor_load_uint32(source + 1));
  351|    422|        }
  352|    424|        return result;
  353|  9.50M|      }
  354|    278|    case 0x9B:
  ------------------
  |  Branch (354:5): [True: 278, False: 25.9M]
  ------------------
  355|       |      /* Eight bytes length array */
  356|    278|      {
  357|    278|        if (claim_bytes(8, source_size, &result)) {
  ------------------
  |  Branch (357:13): [True: 276, False: 2]
  ------------------
  358|    276|          callbacks->array_start(context, _cbor_load_uint64(source + 1));
  359|    276|        }
  360|    278|        return result;
  361|  9.50M|      }
  362|      3|    case 0x9C: /* Fallthrough */
  ------------------
  |  Branch (362:5): [True: 3, False: 25.9M]
  ------------------
  363|      4|    case 0x9D: /* Fallthrough */
  ------------------
  |  Branch (363:5): [True: 1, False: 25.9M]
  ------------------
  364|      6|    case 0x9E:
  ------------------
  |  Branch (364:5): [True: 2, False: 25.9M]
  ------------------
  365|       |      /* Reserved */
  366|      6|      { return (struct cbor_decoder_result){.status = CBOR_DECODER_ERROR}; }
  367|   396k|    case 0x9F:
  ------------------
  |  Branch (367:5): [True: 396k, False: 25.5M]
  ------------------
  368|       |      /* Indefinite length array */
  369|   396k|      {
  370|   396k|        callbacks->indef_array_start(context);
  371|   396k|        return result;
  372|      4|      }
  373|      3|    case 0xA0: /* Fallthrough */
  ------------------
  |  Branch (373:5): [True: 3, False: 25.9M]
  ------------------
  374|  5.73k|    case 0xA1: /* Fallthrough */
  ------------------
  |  Branch (374:5): [True: 5.72k, False: 25.9M]
  ------------------
  375|  8.82k|    case 0xA2: /* Fallthrough */
  ------------------
  |  Branch (375:5): [True: 3.09k, False: 25.9M]
  ------------------
  376|  9.24k|    case 0xA3: /* Fallthrough */
  ------------------
  |  Branch (376:5): [True: 424, False: 25.9M]
  ------------------
  377|  15.5k|    case 0xA4: /* Fallthrough */
  ------------------
  |  Branch (377:5): [True: 6.31k, False: 25.9M]
  ------------------
  378|  18.6k|    case 0xA5: /* Fallthrough */
  ------------------
  |  Branch (378:5): [True: 3.09k, False: 25.9M]
  ------------------
  379|  19.7k|    case 0xA6: /* Fallthrough */
  ------------------
  |  Branch (379:5): [True: 1.11k, False: 25.9M]
  ------------------
  380|  22.1k|    case 0xA7: /* Fallthrough */
  ------------------
  |  Branch (380:5): [True: 2.33k, False: 25.9M]
  ------------------
  381|  22.9k|    case 0xA8: /* Fallthrough */
  ------------------
  |  Branch (381:5): [True: 809, False: 25.9M]
  ------------------
  382|  23.3k|    case 0xA9: /* Fallthrough */
  ------------------
  |  Branch (382:5): [True: 479, False: 25.9M]
  ------------------
  383|  24.2k|    case 0xAA: /* Fallthrough */
  ------------------
  |  Branch (383:5): [True: 887, False: 25.9M]
  ------------------
  384|  24.5k|    case 0xAB: /* Fallthrough */
  ------------------
  |  Branch (384:5): [True: 312, False: 25.9M]
  ------------------
  385|  25.3k|    case 0xAC: /* Fallthrough */
  ------------------
  |  Branch (385:5): [True: 713, False: 25.9M]
  ------------------
  386|  25.5k|    case 0xAD: /* Fallthrough */
  ------------------
  |  Branch (386:5): [True: 264, False: 25.9M]
  ------------------
  387|  26.2k|    case 0xAE: /* Fallthrough */
  ------------------
  |  Branch (387:5): [True: 688, False: 25.9M]
  ------------------
  388|  26.8k|    case 0xAF: /* Fallthrough */
  ------------------
  |  Branch (388:5): [True: 592, False: 25.9M]
  ------------------
  389|  55.7k|    case 0xB0: /* Fallthrough */
  ------------------
  |  Branch (389:5): [True: 28.8k, False: 25.9M]
  ------------------
  390|  56.5k|    case 0xB1: /* Fallthrough */
  ------------------
  |  Branch (390:5): [True: 809, False: 25.9M]
  ------------------
  391|  57.9k|    case 0xB2: /* Fallthrough */
  ------------------
  |  Branch (391:5): [True: 1.46k, False: 25.9M]
  ------------------
  392|  60.4k|    case 0xB3: /* Fallthrough */
  ------------------
  |  Branch (392:5): [True: 2.45k, False: 25.9M]
  ------------------
  393|  60.7k|    case 0xB4: /* Fallthrough */
  ------------------
  |  Branch (393:5): [True: 271, False: 25.9M]
  ------------------
  394|  62.1k|    case 0xB5: /* Fallthrough */
  ------------------
  |  Branch (394:5): [True: 1.45k, False: 25.9M]
  ------------------
  395|  62.9k|    case 0xB6: /* Fallthrough */
  ------------------
  |  Branch (395:5): [True: 811, False: 25.9M]
  ------------------
  396|  63.3k|    case 0xB7:
  ------------------
  |  Branch (396:5): [True: 418, False: 25.9M]
  ------------------
  397|       |      /* Embedded one byte length map */
  398|  63.3k|      {
  399|  63.3k|        callbacks->map_start(context,
  400|  63.3k|                             _cbor_load_uint8(source) - 0xA0); /* 0xA0 offset */
  401|  63.3k|        return result;
  402|  62.9k|      }
  403|  1.51k|    case 0xB8:
  ------------------
  |  Branch (403:5): [True: 1.51k, False: 25.9M]
  ------------------
  404|       |      /* One byte length map */
  405|  1.51k|      {
  406|  1.51k|        if (claim_bytes(1, source_size, &result)) {
  ------------------
  |  Branch (406:13): [True: 1.51k, False: 1]
  ------------------
  407|  1.51k|          callbacks->map_start(context, _cbor_load_uint8(source + 1));
  408|  1.51k|        }
  409|  1.51k|        return result;
  410|  62.9k|      }
  411|  13.2k|    case 0xB9:
  ------------------
  |  Branch (411:5): [True: 13.2k, False: 25.9M]
  ------------------
  412|       |      /* Two bytes length map */
  413|  13.2k|      {
  414|  13.2k|        if (claim_bytes(2, source_size, &result)) {
  ------------------
  |  Branch (414:13): [True: 13.2k, False: 2]
  ------------------
  415|  13.2k|          callbacks->map_start(context, _cbor_load_uint16(source + 1));
  416|  13.2k|        }
  417|  13.2k|        return result;
  418|  62.9k|      }
  419|    436|    case 0xBA:
  ------------------
  |  Branch (419:5): [True: 436, False: 25.9M]
  ------------------
  420|       |      /* Four bytes length map */
  421|    436|      {
  422|    436|        if (claim_bytes(4, source_size, &result)) {
  ------------------
  |  Branch (422:13): [True: 429, False: 7]
  ------------------
  423|    429|          callbacks->map_start(context, _cbor_load_uint32(source + 1));
  424|    429|        }
  425|    436|        return result;
  426|  62.9k|      }
  427|    371|    case 0xBB:
  ------------------
  |  Branch (427:5): [True: 371, False: 25.9M]
  ------------------
  428|       |      /* Eight bytes length map */
  429|    371|      {
  430|    371|        if (claim_bytes(8, source_size, &result)) {
  ------------------
  |  Branch (430:13): [True: 368, False: 3]
  ------------------
  431|    368|          callbacks->map_start(context, _cbor_load_uint64(source + 1));
  432|    368|        }
  433|    371|        return result;
  434|  62.9k|      }
  435|      2|    case 0xBC: /* Fallthrough */
  ------------------
  |  Branch (435:5): [True: 2, False: 25.9M]
  ------------------
  436|      4|    case 0xBD: /* Fallthrough */
  ------------------
  |  Branch (436:5): [True: 2, False: 25.9M]
  ------------------
  437|      7|    case 0xBE:
  ------------------
  |  Branch (437:5): [True: 3, False: 25.9M]
  ------------------
  438|       |      /* Reserved */
  439|      7|      { return (struct cbor_decoder_result){.status = CBOR_DECODER_ERROR}; }
  440|  7.45k|    case 0xBF:
  ------------------
  |  Branch (440:5): [True: 7.45k, False: 25.9M]
  ------------------
  441|       |      /* Indefinite length map */
  442|  7.45k|      {
  443|  7.45k|        callbacks->indef_map_start(context);
  444|  7.45k|        return result;
  445|      4|      }
  446|       |      /* See https://www.iana.org/assignments/cbor-tags/cbor-tags.xhtml for tag
  447|       |       * assignment. All well-formed tags are processed regardless of validity
  448|       |       * since maintaining the known mapping would be impractical.
  449|       |       *
  450|       |       * Moreover, even tags in the reserved "standard" range are not assigned
  451|       |       * but may get assigned in the future (see e.g.
  452|       |       * https://github.com/PJK/libcbor/issues/307), so processing all tags
  453|       |       * improves forward compatibility.
  454|       |       */
  455|  88.5k|    case 0xC0: /* Fallthrough */
  ------------------
  |  Branch (455:5): [True: 88.5k, False: 25.8M]
  ------------------
  456|   103k|    case 0xC1: /* Fallthrough */
  ------------------
  |  Branch (456:5): [True: 14.9k, False: 25.9M]
  ------------------
  457|   123k|    case 0xC2: /* Fallthrough */
  ------------------
  |  Branch (457:5): [True: 19.7k, False: 25.9M]
  ------------------
  458|   135k|    case 0xC3: /* Fallthrough */
  ------------------
  |  Branch (458:5): [True: 12.1k, False: 25.9M]
  ------------------
  459|   138k|    case 0xC4: /* Fallthrough */
  ------------------
  |  Branch (459:5): [True: 2.71k, False: 25.9M]
  ------------------
  460|   170k|    case 0xC5: /* Fallthrough */
  ------------------
  |  Branch (460:5): [True: 32.1k, False: 25.9M]
  ------------------
  461|   171k|    case 0xC6: /* Fallthrough */
  ------------------
  |  Branch (461:5): [True: 841, False: 25.9M]
  ------------------
  462|   187k|    case 0xC7: /* Fallthrough */
  ------------------
  |  Branch (462:5): [True: 16.0k, False: 25.9M]
  ------------------
  463|   187k|    case 0xC8: /* Fallthrough */
  ------------------
  |  Branch (463:5): [True: 471, False: 25.9M]
  ------------------
  464|   188k|    case 0xC9: /* Fallthrough */
  ------------------
  |  Branch (464:5): [True: 780, False: 25.9M]
  ------------------
  465|   191k|    case 0xCA: /* Fallthrough */
  ------------------
  |  Branch (465:5): [True: 2.93k, False: 25.9M]
  ------------------
  466|   192k|    case 0xCB: /* Fallthrough */
  ------------------
  |  Branch (466:5): [True: 836, False: 25.9M]
  ------------------
  467|   196k|    case 0xCC: /* Fallthrough */
  ------------------
  |  Branch (467:5): [True: 4.11k, False: 25.9M]
  ------------------
  468|   197k|    case 0xCD: /* Fallthrough */
  ------------------
  |  Branch (468:5): [True: 1.53k, False: 25.9M]
  ------------------
  469|   220k|    case 0xCE: /* Fallthrough */
  ------------------
  |  Branch (469:5): [True: 22.5k, False: 25.9M]
  ------------------
  470|   223k|    case 0xCF: /* Fallthrough */
  ------------------
  |  Branch (470:5): [True: 2.59k, False: 25.9M]
  ------------------
  471|   229k|    case 0xD0: /* Fallthrough */
  ------------------
  |  Branch (471:5): [True: 5.96k, False: 25.9M]
  ------------------
  472|   230k|    case 0xD1: /* Fallthrough */
  ------------------
  |  Branch (472:5): [True: 1.41k, False: 25.9M]
  ------------------
  473|   232k|    case 0xD2: /* Fallthrough */
  ------------------
  |  Branch (473:5): [True: 1.84k, False: 25.9M]
  ------------------
  474|   233k|    case 0xD3: /* Fallthrough */
  ------------------
  |  Branch (474:5): [True: 773, False: 25.9M]
  ------------------
  475|   234k|    case 0xD4: /* Fallthrough */
  ------------------
  |  Branch (475:5): [True: 1.49k, False: 25.9M]
  ------------------
  476|   235k|    case 0xD5: /* Fallthrough */
  ------------------
  |  Branch (476:5): [True: 768, False: 25.9M]
  ------------------
  477|   239k|    case 0xD6: /* Fallthrough */
  ------------------
  |  Branch (477:5): [True: 4.53k, False: 25.9M]
  ------------------
  478|   322k|    case 0xD7: /* Fallthrough */
  ------------------
  |  Branch (478:5): [True: 82.5k, False: 25.8M]
  ------------------
  479|   322k|    {
  480|   322k|      callbacks->tag(context, (uint64_t)(_cbor_load_uint8(source) -
  481|   322k|                                         0xC0)); /* 0xC0 offset */
  482|   322k|      return result;
  483|   239k|    }
  484|  2.85k|    case 0xD8: /* 1B tag */
  ------------------
  |  Branch (484:5): [True: 2.85k, False: 25.9M]
  ------------------
  485|  2.85k|    {
  486|  2.85k|      if (claim_bytes(1, source_size, &result)) {
  ------------------
  |  Branch (486:11): [True: 2.85k, False: 1]
  ------------------
  487|  2.85k|        callbacks->tag(context, _cbor_load_uint8(source + 1));
  488|  2.85k|      }
  489|  2.85k|      return result;
  490|   239k|    }
  491|  3.23k|    case 0xD9: /* 2B tag */
  ------------------
  |  Branch (491:5): [True: 3.23k, False: 25.9M]
  ------------------
  492|  3.23k|    {
  493|  3.23k|      if (claim_bytes(2, source_size, &result)) {
  ------------------
  |  Branch (493:11): [True: 3.23k, False: 1]
  ------------------
  494|  3.23k|        callbacks->tag(context, _cbor_load_uint16(source + 1));
  495|  3.23k|      }
  496|  3.23k|      return result;
  497|   239k|    }
  498|  12.2k|    case 0xDA: /* 4B tag */
  ------------------
  |  Branch (498:5): [True: 12.2k, False: 25.9M]
  ------------------
  499|  12.2k|    {
  500|  12.2k|      if (claim_bytes(4, source_size, &result)) {
  ------------------
  |  Branch (500:11): [True: 12.2k, False: 2]
  ------------------
  501|  12.2k|        callbacks->tag(context, _cbor_load_uint32(source + 1));
  502|  12.2k|      }
  503|  12.2k|      return result;
  504|   239k|    }
  505|  4.36k|    case 0xDB: /* 8B tag */
  ------------------
  |  Branch (505:5): [True: 4.36k, False: 25.9M]
  ------------------
  506|  4.36k|    {
  507|  4.36k|      if (claim_bytes(8, source_size, &result)) {
  ------------------
  |  Branch (507:11): [True: 4.36k, False: 1]
  ------------------
  508|  4.36k|        callbacks->tag(context, _cbor_load_uint64(source + 1));
  509|  4.36k|      }
  510|  4.36k|      return result;
  511|   239k|    }
  512|      2|    case 0xDC: /* Fallthrough */
  ------------------
  |  Branch (512:5): [True: 2, False: 25.9M]
  ------------------
  513|      3|    case 0xDD: /* Fallthrough */
  ------------------
  |  Branch (513:5): [True: 1, False: 25.9M]
  ------------------
  514|      5|    case 0xDE: /* Fallthrough */
  ------------------
  |  Branch (514:5): [True: 2, False: 25.9M]
  ------------------
  515|      7|    case 0xDF: /* Reserved */
  ------------------
  |  Branch (515:5): [True: 2, False: 25.9M]
  ------------------
  516|      7|    {
  517|      7|      return (struct cbor_decoder_result){.status = CBOR_DECODER_ERROR};
  518|      5|    }
  519|      1|    case 0xE0: /* Fallthrough */
  ------------------
  |  Branch (519:5): [True: 1, False: 25.9M]
  ------------------
  520|      4|    case 0xE1: /* Fallthrough */
  ------------------
  |  Branch (520:5): [True: 3, False: 25.9M]
  ------------------
  521|      5|    case 0xE2: /* Fallthrough */
  ------------------
  |  Branch (521:5): [True: 1, False: 25.9M]
  ------------------
  522|      6|    case 0xE3: /* Fallthrough */
  ------------------
  |  Branch (522:5): [True: 1, False: 25.9M]
  ------------------
  523|      7|    case 0xE4: /* Fallthrough */
  ------------------
  |  Branch (523:5): [True: 1, False: 25.9M]
  ------------------
  524|      9|    case 0xE5: /* Fallthrough */
  ------------------
  |  Branch (524:5): [True: 2, False: 25.9M]
  ------------------
  525|     10|    case 0xE6: /* Fallthrough */
  ------------------
  |  Branch (525:5): [True: 1, False: 25.9M]
  ------------------
  526|     12|    case 0xE7: /* Fallthrough */
  ------------------
  |  Branch (526:5): [True: 2, False: 25.9M]
  ------------------
  527|     13|    case 0xE8: /* Fallthrough */
  ------------------
  |  Branch (527:5): [True: 1, False: 25.9M]
  ------------------
  528|     14|    case 0xE9: /* Fallthrough */
  ------------------
  |  Branch (528:5): [True: 1, False: 25.9M]
  ------------------
  529|     15|    case 0xEA: /* Fallthrough */
  ------------------
  |  Branch (529:5): [True: 1, False: 25.9M]
  ------------------
  530|     17|    case 0xEB: /* Fallthrough */
  ------------------
  |  Branch (530:5): [True: 2, False: 25.9M]
  ------------------
  531|     18|    case 0xEC: /* Fallthrough */
  ------------------
  |  Branch (531:5): [True: 1, False: 25.9M]
  ------------------
  532|     19|    case 0xED: /* Fallthrough */
  ------------------
  |  Branch (532:5): [True: 1, False: 25.9M]
  ------------------
  533|     21|    case 0xEE: /* Fallthrough */
  ------------------
  |  Branch (533:5): [True: 2, False: 25.9M]
  ------------------
  534|     23|    case 0xEF: /* Fallthrough */
  ------------------
  |  Branch (534:5): [True: 2, False: 25.9M]
  ------------------
  535|     24|    case 0xF0: /* Fallthrough */
  ------------------
  |  Branch (535:5): [True: 1, False: 25.9M]
  ------------------
  536|     26|    case 0xF1: /* Fallthrough */
  ------------------
  |  Branch (536:5): [True: 2, False: 25.9M]
  ------------------
  537|     28|    case 0xF2: /* Fallthrough */
  ------------------
  |  Branch (537:5): [True: 2, False: 25.9M]
  ------------------
  538|     32|    case 0xF3: /* Simple value - unassigned */
  ------------------
  |  Branch (538:5): [True: 4, False: 25.9M]
  ------------------
  539|     32|    {
  540|     32|      return (struct cbor_decoder_result){.status = CBOR_DECODER_ERROR};
  541|     28|    }
  542|  57.1k|    case 0xF4:
  ------------------
  |  Branch (542:5): [True: 57.1k, False: 25.9M]
  ------------------
  543|       |      /* False */
  544|  57.1k|      {
  545|  57.1k|        callbacks->boolean(context, false);
  546|  57.1k|        return result;
  547|     28|      }
  548|   757k|    case 0xF5:
  ------------------
  |  Branch (548:5): [True: 757k, False: 25.2M]
  ------------------
  549|       |      /* True */
  550|   757k|      {
  551|   757k|        callbacks->boolean(context, true);
  552|   757k|        return result;
  553|     28|      }
  554|   600k|    case 0xF6:
  ------------------
  |  Branch (554:5): [True: 600k, False: 25.3M]
  ------------------
  555|       |      /* Null */
  556|   600k|      {
  557|   600k|        callbacks->null(context);
  558|   600k|        return result;
  559|     28|      }
  560|  31.0k|    case 0xF7:
  ------------------
  |  Branch (560:5): [True: 31.0k, False: 25.9M]
  ------------------
  561|       |      /* Undefined */
  562|  31.0k|      {
  563|  31.0k|        callbacks->undefined(context);
  564|  31.0k|        return result;
  565|     28|      }
  566|      2|    case 0xF8:
  ------------------
  |  Branch (566:5): [True: 2, False: 25.9M]
  ------------------
  567|       |      /* 1B simple value, unassigned */
  568|      2|      { return (struct cbor_decoder_result){.status = CBOR_DECODER_ERROR}; }
  569|  55.1k|    case 0xF9:
  ------------------
  |  Branch (569:5): [True: 55.1k, False: 25.9M]
  ------------------
  570|       |      /* 2B float */
  571|  55.1k|      {
  572|  55.1k|        if (claim_bytes(2, source_size, &result)) {
  ------------------
  |  Branch (572:13): [True: 55.1k, False: 1]
  ------------------
  573|  55.1k|          callbacks->float2(context, _cbor_load_half(source + 1));
  574|  55.1k|        }
  575|  55.1k|        return result;
  576|     28|      }
  577|  11.6k|    case 0xFA:
  ------------------
  |  Branch (577:5): [True: 11.6k, False: 25.9M]
  ------------------
  578|       |      /* 4B float */
  579|  11.6k|      {
  580|  11.6k|        if (claim_bytes(4, source_size, &result)) {
  ------------------
  |  Branch (580:13): [True: 11.6k, False: 7]
  ------------------
  581|  11.6k|          callbacks->float4(context, _cbor_load_float(source + 1));
  582|  11.6k|        }
  583|  11.6k|        return result;
  584|     28|      }
  585|  30.4k|    case 0xFB:
  ------------------
  |  Branch (585:5): [True: 30.4k, False: 25.9M]
  ------------------
  586|       |      /* 8B float */
  587|  30.4k|      {
  588|  30.4k|        if (claim_bytes(8, source_size, &result)) {
  ------------------
  |  Branch (588:13): [True: 30.4k, False: 4]
  ------------------
  589|  30.4k|          callbacks->float8(context, _cbor_load_double(source + 1));
  590|  30.4k|        }
  591|  30.4k|        return result;
  592|     28|      }
  593|      3|    case 0xFC: /* Fallthrough */
  ------------------
  |  Branch (593:5): [True: 3, False: 25.9M]
  ------------------
  594|      4|    case 0xFD: /* Fallthrough */
  ------------------
  |  Branch (594:5): [True: 1, False: 25.9M]
  ------------------
  595|      6|    case 0xFE:
  ------------------
  |  Branch (595:5): [True: 2, False: 25.9M]
  ------------------
  596|       |      /* Reserved */
  597|      6|      { return (struct cbor_decoder_result){.status = CBOR_DECODER_ERROR}; }
  598|   382k|    case 0xFF:
  ------------------
  |  Branch (598:5): [True: 382k, False: 25.5M]
  ------------------
  599|       |      /* Break */
  600|   382k|      callbacks->indef_break(context);
  601|   382k|      return result;
  602|      0|    default:  // LCOV_EXCL_START
  ------------------
  |  Branch (602:5): [True: 0, False: 25.9M]
  ------------------
  603|       |      // Never happens, the switch statement is exhaustive on the 1B range
  604|      0|      _CBOR_UNREACHABLE;
  ------------------
  |  |  111|      0|#define _CBOR_UNREACHABLE __builtin_unreachable()
  ------------------
  605|      0|      return result;  // LCOV_EXCL_STOP
  606|  25.9M|  }
  607|  25.9M|}
streaming.c:claim_bytes:
   16|  28.4M|                        struct cbor_decoder_result* result) {
   17|       |  // Safe from underflow: read is only incremented on successful claims
   18|  28.4M|  CBOR_ASSERT(result->read <= provided);
  ------------------
  |  |   64|  28.4M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (18:3): [True: 0, False: 28.4M]
  |  Branch (18:3): [True: 28.4M, False: 0]
  ------------------
   19|  28.4M|  if (required > (provided - result->read)) {
  ------------------
  |  Branch (19:7): [True: 552, False: 28.4M]
  ------------------
   20|    552|    result->required = required + result->read;
   21|    552|    result->read = 0;
   22|    552|    result->status = CBOR_DECODER_NEDATA;
   23|    552|    return false;
   24|  28.4M|  } else {
   25|  28.4M|    result->read += required;
   26|  28.4M|    result->required = 0;
   27|  28.4M|    return true;
   28|  28.4M|  }
   29|  28.4M|}

cbor_new_definite_string:
   13|  1.26M|cbor_item_t* cbor_new_definite_string(void) {
   14|  1.26M|  cbor_item_t* item = _cbor_malloc(sizeof(cbor_item_t));
   15|  1.26M|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|  1.26M|  do {                           \
  |  |  127|  1.26M|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 1.26M]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|  1.26M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 1.26M]
  |  |  ------------------
  ------------------
   16|  1.26M|  *item = (cbor_item_t){
   17|  1.26M|      .refcount = 1,
   18|  1.26M|      .type = CBOR_TYPE_STRING,
   19|  1.26M|      .metadata = {.string_metadata = {.type = _CBOR_METADATA_DEFINITE,
   20|  1.26M|                                       .codepoint_count = 0,
   21|  1.26M|                                       .length = 0}}};
   22|  1.26M|  return item;
   23|  1.26M|}
cbor_new_indefinite_string:
   25|  7.43k|cbor_item_t* cbor_new_indefinite_string(void) {
   26|  7.43k|  cbor_item_t* item = _cbor_malloc(sizeof(cbor_item_t));
   27|  7.43k|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|  7.43k|  do {                           \
  |  |  127|  7.43k|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 7.43k]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|  7.43k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 7.43k]
  |  |  ------------------
  ------------------
   28|  7.43k|  *item = (cbor_item_t){
   29|  7.43k|      .refcount = 1,
   30|  7.43k|      .type = CBOR_TYPE_STRING,
   31|  7.43k|      .metadata = {.string_metadata = {.type = _CBOR_METADATA_INDEFINITE,
   32|  7.43k|                                       .length = 0}},
   33|  7.43k|      .data = _cbor_malloc(sizeof(struct cbor_indefinite_string_data))};
   34|  7.43k|  _CBOR_DEPENDENT_NOTNULL(item, item->data);
  ------------------
  |  |  135|  7.43k|  do {                                              \
  |  |  136|  7.43k|    if (pointer == NULL) {                          \
  |  |  ------------------
  |  |  |  Branch (136:9): [True: 0, False: 7.43k]
  |  |  ------------------
  |  |  137|      0|      _cbor_free(cbor_item);                        \
  |  |  138|      0|      return NULL;                                  \
  |  |  139|      0|    }                                               \
  |  |  140|  7.43k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (140:12): [Folded, False: 7.43k]
  |  |  ------------------
  ------------------
   35|  7.43k|  *((struct cbor_indefinite_string_data*)item->data) =
   36|  7.43k|      (struct cbor_indefinite_string_data){
   37|  7.43k|          .chunk_count = 0,
   38|  7.43k|          .chunk_capacity = 0,
   39|       |          .chunks = NULL,
   40|  7.43k|      };
   41|  7.43k|  return item;
   42|  7.43k|}
cbor_build_stringn:
   55|   454k|cbor_item_t* cbor_build_stringn(const char* val, size_t length) {
   56|   454k|  cbor_item_t* item = cbor_new_definite_string();
   57|   454k|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|   454k|  do {                           \
  |  |  127|   454k|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 454k]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|   454k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 454k]
  |  |  ------------------
  ------------------
   58|   454k|  unsigned char* handle = _cbor_malloc(length);
   59|   454k|  _CBOR_DEPENDENT_NOTNULL(item, handle);
  ------------------
  |  |  135|   454k|  do {                                              \
  |  |  136|   454k|    if (pointer == NULL) {                          \
  |  |  ------------------
  |  |  |  Branch (136:9): [True: 0, False: 454k]
  |  |  ------------------
  |  |  137|      0|      _cbor_free(cbor_item);                        \
  |  |  138|      0|      return NULL;                                  \
  |  |  139|      0|    }                                               \
  |  |  140|   454k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (140:12): [Folded, False: 454k]
  |  |  ------------------
  ------------------
   60|   454k|  memcpy(handle, val, length);
   61|   454k|  cbor_string_set_handle(item, handle, length);
   62|   454k|  return item;
   63|   454k|}
cbor_string_set_handle:
   67|  1.26M|                            size_t length) {
   68|  1.26M|  CBOR_ASSERT(cbor_isa_string(item));
  ------------------
  |  |   64|  1.26M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (68:3): [True: 0, False: 1.26M]
  |  Branch (68:3): [True: 1.26M, False: 0]
  ------------------
   69|  1.26M|  CBOR_ASSERT(cbor_string_is_definite(item));
  ------------------
  |  |   64|  1.26M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (69:3): [True: 0, False: 1.26M]
  |  Branch (69:3): [True: 1.26M, False: 0]
  ------------------
   70|  1.26M|  item->data = data;
   71|  1.26M|  item->metadata.string_metadata.length = length;
   72|  1.26M|  struct _cbor_unicode_status unicode_status;
   73|  1.26M|  size_t codepoint_count =
   74|  1.26M|      _cbor_unicode_codepoint_count(data, length, &unicode_status);
   75|  1.26M|  CBOR_ASSERT(codepoint_count <= length);
  ------------------
  |  |   64|  1.26M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (75:3): [True: 0, False: 1.26M]
  |  Branch (75:3): [True: 1.26M, False: 0]
  ------------------
   76|  1.26M|  if (unicode_status.status == _CBOR_UNICODE_OK) {
  ------------------
  |  Branch (76:7): [True: 1.22M, False: 39.9k]
  ------------------
   77|  1.22M|    item->metadata.string_metadata.codepoint_count = codepoint_count;
   78|  1.22M|  } else {
   79|  39.9k|    item->metadata.string_metadata.codepoint_count = 0;
   80|  39.9k|  }
   81|  1.26M|}
cbor_string_chunks_handle:
   83|   531k|cbor_item_t** cbor_string_chunks_handle(const cbor_item_t* item) {
   84|   531k|  CBOR_ASSERT(cbor_isa_string(item));
  ------------------
  |  |   64|   531k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (84:3): [True: 0, False: 531k]
  |  Branch (84:3): [True: 531k, False: 0]
  ------------------
   85|   531k|  CBOR_ASSERT(cbor_string_is_indefinite(item));
  ------------------
  |  |   64|   531k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (85:3): [True: 0, False: 531k]
  |  Branch (85:3): [True: 531k, False: 0]
  ------------------
   86|   531k|  return ((struct cbor_indefinite_string_data*)item->data)->chunks;
   87|   531k|}
cbor_string_chunk_count:
   89|  1.42M|size_t cbor_string_chunk_count(const cbor_item_t* item) {
   90|  1.42M|  CBOR_ASSERT(cbor_isa_string(item));
  ------------------
  |  |   64|  1.42M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (90:3): [True: 0, False: 1.42M]
  |  Branch (90:3): [True: 1.42M, False: 0]
  ------------------
   91|  1.42M|  CBOR_ASSERT(cbor_string_is_indefinite(item));
  ------------------
  |  |   64|  1.42M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (91:3): [True: 0, False: 1.42M]
  |  Branch (91:3): [True: 1.42M, False: 0]
  ------------------
   92|  1.42M|  return ((struct cbor_indefinite_string_data*)item->data)->chunk_count;
   93|  1.42M|}
cbor_string_add_chunk:
   95|   628k|bool cbor_string_add_chunk(cbor_item_t* item, cbor_item_t* chunk) {
   96|   628k|  CBOR_ASSERT(cbor_isa_string(item));
  ------------------
  |  |   64|   628k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (96:3): [True: 0, False: 628k]
  |  Branch (96:3): [True: 628k, False: 0]
  ------------------
   97|   628k|  CBOR_ASSERT(cbor_string_is_indefinite(item));
  ------------------
  |  |   64|   628k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (97:3): [True: 0, False: 628k]
  |  Branch (97:3): [True: 628k, False: 0]
  ------------------
   98|   628k|  struct cbor_indefinite_string_data* data =
   99|   628k|      (struct cbor_indefinite_string_data*)item->data;
  100|   628k|  if (data->chunk_count == data->chunk_capacity) {
  ------------------
  |  Branch (100:7): [True: 2.25k, False: 625k]
  ------------------
  101|  2.25k|    if (!_cbor_safe_to_multiply(CBOR_BUFFER_GROWTH, data->chunk_capacity)) {
  ------------------
  |  |    8|  2.25k|#define CBOR_BUFFER_GROWTH 2
  ------------------
  |  Branch (101:9): [True: 0, False: 2.25k]
  ------------------
  102|      0|      return false;
  103|      0|    }
  104|       |
  105|  2.25k|    size_t new_chunk_capacity =
  106|  2.25k|        data->chunk_capacity == 0 ? 1
  ------------------
  |  Branch (106:9): [True: 989, False: 1.26k]
  ------------------
  107|  2.25k|                                  : CBOR_BUFFER_GROWTH * (data->chunk_capacity);
  ------------------
  |  |    8|  1.26k|#define CBOR_BUFFER_GROWTH 2
  ------------------
  108|  2.25k|    cbor_item_t** new_chunks_data = _cbor_realloc_multiple(
  109|  2.25k|        data->chunks, sizeof(cbor_item_t*), new_chunk_capacity);
  110|       |
  111|  2.25k|    if (new_chunks_data == NULL) {
  ------------------
  |  Branch (111:9): [True: 0, False: 2.25k]
  ------------------
  112|      0|      return false;
  113|      0|    }
  114|       |
  115|  2.25k|    data->chunk_capacity = new_chunk_capacity;
  116|  2.25k|    data->chunks = new_chunks_data;
  117|  2.25k|  }
  118|   628k|  data->chunks[data->chunk_count++] = cbor_incref(chunk);
  119|   628k|  return true;
  120|   628k|}
cbor_string_length:
  122|  3.18M|size_t cbor_string_length(const cbor_item_t* item) {
  123|  3.18M|  CBOR_ASSERT(cbor_isa_string(item));
  ------------------
  |  |   64|  3.18M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (123:3): [True: 0, False: 3.18M]
  |  Branch (123:3): [True: 3.18M, False: 0]
  ------------------
  124|  3.18M|  return item->metadata.string_metadata.length;
  125|  3.18M|}
cbor_string_handle:
  127|  1.36M|unsigned char* cbor_string_handle(const cbor_item_t* item) {
  128|  1.36M|  CBOR_ASSERT(cbor_isa_string(item));
  ------------------
  |  |   64|  1.36M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (128:3): [True: 0, False: 1.36M]
  |  Branch (128:3): [True: 1.36M, False: 0]
  ------------------
  129|  1.36M|  return item->data;
  130|  1.36M|}
cbor_string_codepoint_count:
  132|   454k|size_t cbor_string_codepoint_count(const cbor_item_t* item) {
  133|   454k|  CBOR_ASSERT(cbor_isa_string(item));
  ------------------
  |  |   64|   454k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (133:3): [True: 0, False: 454k]
  |  Branch (133:3): [True: 454k, False: 0]
  ------------------
  134|   454k|  return item->metadata.string_metadata.codepoint_count;
  135|   454k|}
cbor_string_is_definite:
  137|  7.32M|bool cbor_string_is_definite(const cbor_item_t* item) {
  138|  7.32M|  CBOR_ASSERT(cbor_isa_string(item));
  ------------------
  |  |   64|  7.32M|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (138:3): [True: 0, False: 7.32M]
  |  Branch (138:3): [True: 7.32M, False: 0]
  ------------------
  139|  7.32M|  return item->metadata.string_metadata.type == _CBOR_METADATA_DEFINITE;
  140|  7.32M|}
cbor_string_is_indefinite:
  142|  3.41M|bool cbor_string_is_indefinite(const cbor_item_t* item) {
  143|  3.41M|  return !cbor_string_is_definite(item);
  144|  3.41M|}

cbor_new_tag:
   10|   558k|cbor_item_t* cbor_new_tag(uint64_t value) {
   11|   558k|  cbor_item_t* item = _cbor_malloc(sizeof(cbor_item_t));
   12|   558k|  _CBOR_NOTNULL(item);
  ------------------
  |  |  126|   558k|  do {                           \
  |  |  127|   558k|    if (cbor_item == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (127:9): [True: 0, False: 558k]
  |  |  ------------------
  |  |  128|      0|      return NULL;               \
  |  |  129|      0|    }                            \
  |  |  130|   558k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (130:12): [Folded, False: 558k]
  |  |  ------------------
  ------------------
   13|       |
   14|   558k|  *item = (cbor_item_t){
   15|   558k|      .refcount = 1,
   16|   558k|      .type = CBOR_TYPE_TAG,
   17|   558k|      .metadata = {.tag_metadata = {.value = value, .tagged_item = NULL}},
   18|       |      .data = NULL /* Never used */
   19|   558k|  };
   20|   558k|  return item;
   21|   558k|}
cbor_tag_item:
   23|   852k|cbor_item_t* cbor_tag_item(const cbor_item_t* tag) {
   24|   852k|  CBOR_ASSERT(cbor_isa_tag(tag));
  ------------------
  |  |   64|   852k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (24:3): [True: 0, False: 852k]
  |  Branch (24:3): [True: 852k, False: 0]
  ------------------
   25|   852k|  if (tag->metadata.tag_metadata.tagged_item == NULL) {
  ------------------
  |  Branch (25:7): [True: 0, False: 852k]
  ------------------
   26|      0|    return NULL;
   27|      0|  }
   28|   852k|  return cbor_incref(tag->metadata.tag_metadata.tagged_item);
   29|   852k|}
cbor_tag_value:
   31|   852k|uint64_t cbor_tag_value(const cbor_item_t* tag) {
   32|   852k|  CBOR_ASSERT(cbor_isa_tag(tag));
  ------------------
  |  |   64|   852k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (32:3): [True: 0, False: 852k]
  |  Branch (32:3): [True: 852k, False: 0]
  ------------------
   33|   852k|  return tag->metadata.tag_metadata.value;
   34|   852k|}
cbor_tag_set_item:
   36|   531k|void cbor_tag_set_item(cbor_item_t* tag, cbor_item_t* tagged_item) {
   37|   531k|  CBOR_ASSERT(cbor_isa_tag(tag));
  ------------------
  |  |   64|   531k|#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
  ------------------
  |  Branch (37:3): [True: 0, False: 531k]
  |  Branch (37:3): [True: 531k, False: 0]
  ------------------
   38|   531k|  if (tag->metadata.tag_metadata.tagged_item != NULL) {
  ------------------
  |  Branch (38:7): [True: 0, False: 531k]
  ------------------
   39|      0|    cbor_intermediate_decref(tag->metadata.tag_metadata.tagged_item);
   40|      0|  }
   41|   531k|  cbor_incref(tagged_item);
   42|   531k|  tag->metadata.tag_metadata.tagged_item = tagged_item;
   43|   531k|}
cbor_build_tag:
   45|   213k|cbor_item_t* cbor_build_tag(uint64_t value, cbor_item_t* item) {
   46|   213k|  cbor_item_t* res = cbor_new_tag(value);
   47|   213k|  if (res == NULL) {
  ------------------
  |  Branch (47:7): [True: 0, False: 213k]
  ------------------
   48|      0|    return NULL;
   49|      0|  }
   50|   213k|  cbor_tag_set_item(res, item);
   51|   213k|  return res;
   52|   213k|}

