deterministic_random_bytes:
   23|  2.28k|void deterministic_random_bytes(void *buf, size_t len) {
   24|  75.2k|  for (int i = 0; i < len; i++) {
  ------------------
  |  Branch (24:19): [True: 72.9k, False: 2.28k]
  ------------------
   25|  72.9k|    ((uint8_t *)buf)[i] = 0;
   26|  72.9k|  }
   27|  2.28k|}
LLVMFuzzerTestOneInput:
   34|  2.28k|int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   35|       |  // key exchanges
   36|  2.28k|  ptls_key_exchange_algorithm_t *key_exchanges[128] = {NULL};
   37|  2.28k|  key_exchanges[0] = &ptls_openssl_secp256r1;
   38|  2.28k|  ptls_cipher_suite_t *cipher_suites[] = {&ptls_openssl_aes128gcmsha256, NULL};
   39|       |
   40|       |  // create ptls_context_t
   41|  2.28k|  ptls_context_t ctx_client = {deterministic_random_bytes, &ptls_get_time,
   42|  2.28k|                               key_exchanges, cipher_suites};
   43|  2.28k|  ctx_client.verify_certificate = NULL;
   44|       |
   45|       |  // create pls_t
   46|  2.28k|  ptls_t *tls_client = ptls_new(&ctx_client, 0);  // 0: client
   47|       |
   48|       |  // fake ticket saving
   49|  2.28k|  static struct st_util_save_ticket_t st;
   50|  2.28k|  st.super.cb = fake_ticket_cb;
   51|  2.28k|  ctx_client.save_ticket = &st.super;
   52|       |
   53|       |  // empty hsprop
   54|  2.28k|  ptls_handshake_properties_t hsprop = {{{{NULL}}}};
   55|       |
   56|       |  // buffers
   57|  2.28k|  ptls_buffer_t client_encbuf;
   58|  2.28k|  ptls_buffer_init(&client_encbuf, "", 0);
   59|       |
   60|       |  // generate client_hello
   61|  2.28k|  ptls_handshake(tls_client, &client_encbuf, NULL, 0, &hsprop);
   62|       |
   63|       |  // reset buffer
   64|  2.28k|  ptls_buffer_dispose(&client_encbuf);
   65|  2.28k|  ptls_buffer_init(&client_encbuf, "", 0);
   66|       |
   67|       |  // accept server
   68|  2.28k|  size_t consumed = size;
   69|  2.28k|  int ret =
   70|  2.28k|      ptls_handshake(tls_client, &client_encbuf, data, &consumed, &hsprop);
   71|       |
   72|       |  // more messages to parse?
   73|  2.28k|  if (ret == 0 && size - consumed > 0) {
  ------------------
  |  Branch (73:7): [True: 0, False: 2.28k]
  |  Branch (73:19): [True: 0, False: 0]
  ------------------
   74|      0|    size = size - consumed;
   75|       |    // reset buffer
   76|      0|    ptls_buffer_dispose(&client_encbuf);
   77|      0|    ptls_buffer_init(&client_encbuf, "", 0);
   78|       |    // receive messages
   79|      0|    ptls_receive(tls_client, &client_encbuf, data + consumed, &size);
   80|      0|  }
   81|       |
   82|       |  // cleaning
   83|  2.28k|  ptls_buffer_dispose(&client_encbuf);
   84|  2.28k|  ptls_free(tls_client);
   85|       |
   86|  2.28k|  return 0;
   87|  2.28k|}

fuzz-server-hello.c:ptls_new:
 1889|  2.28k|{
 1890|  2.28k|    return is_server ? ptls_server_new(ctx) : ptls_client_new(ctx);
  ------------------
  |  Branch (1890:12): [True: 0, False: 2.28k]
  ------------------
 1891|  2.28k|}
fuzz-server-hello.c:ptls_buffer_init:
 1905|  4.56k|{
 1906|  4.56k|    assert(smallbuf != NULL);
 1907|  4.56k|    buf->base = (uint8_t *)smallbuf;
 1908|  4.56k|    buf->off = 0;
 1909|  4.56k|    buf->capacity = smallbuf_size;
 1910|  4.56k|    buf->is_allocated = 0;
 1911|  4.56k|    buf->align_bits = 0;
 1912|  4.56k|}
fuzz-server-hello.c:ptls_buffer_dispose:
 1915|  4.56k|{
 1916|  4.56k|    ptls_buffer__release_memory(buf);
 1917|  4.56k|    *buf = (ptls_buffer_t){NULL, 0, 0, 0, 0};
 1918|  4.56k|}
picotls.c:ptls_iovec_init:
 1894|   161k|{
 1895|       |    /* avoid the "return (ptls_iovec_t){(uint8_t *)p, len};" construct because it requires C99
 1896|       |     * and triggers a warning "C4204: nonstandard extension used: non-constant aggregate initializer"
 1897|       |     * in Visual Studio */
 1898|   161k|    ptls_iovec_t r;
 1899|   161k|    r.base = (uint8_t *)p;
 1900|   161k|    r.len = len;
 1901|   161k|    return r;
 1902|   161k|}
picotls.c:ptls_buffer_init:
 1905|  51.7k|{
 1906|  51.7k|    assert(smallbuf != NULL);
 1907|  51.7k|    buf->base = (uint8_t *)smallbuf;
 1908|  51.7k|    buf->off = 0;
 1909|  51.7k|    buf->capacity = smallbuf_size;
 1910|  51.7k|    buf->is_allocated = 0;
 1911|  51.7k|    buf->align_bits = 0;
 1912|  51.7k|}
picotls.c:ptls_buffer_dispose:
 1915|   170k|{
 1916|   170k|    ptls_buffer__release_memory(buf);
 1917|   170k|    *buf = (ptls_buffer_t){NULL, 0, 0, 0, 0};
 1918|   170k|}
openssl.c:sha256_create:
 2084|  13.8k|    {                                                                                                                              \
 2085|  13.8k|        struct name##_context_t *ctx;                                                                                              \
 2086|  13.8k|        if ((ctx = malloc(sizeof(*ctx))) == NULL)                                                                                  \
  ------------------
  |  Branch (2086:13): [True: 0, False: 13.8k]
  ------------------
 2087|  13.8k|            return NULL;                                                                                                           \
 2088|  13.8k|        ctx->super = (ptls_hash_context_t){name##_update, name##_final, name##_clone};                                             \
 2089|  13.8k|        init_func(&ctx->ctx);                                                                                                      \
 2090|  13.8k|        return &ctx->super;                                                                                                        \
 2091|  13.8k|    }
openssl.c:sha256_update:
 2043|   217k|    {                                                                                                                              \
 2044|   217k|        struct name##_context_t *ctx = (struct name##_context_t *)_ctx;                                                            \
 2045|   217k|        update_func(&ctx->ctx, src, len);                                                                                          \
 2046|   217k|    }                                                                                                                              \
openssl.c:sha256_final:
 2049|  73.7k|    {                                                                                                                              \
 2050|  73.7k|        struct name##_context_t *ctx = (struct name##_context_t *)_ctx;                                                            \
 2051|  73.7k|        if (mode == PTLS_HASH_FINAL_MODE_SNAPSHOT) {                                                                               \
  ------------------
  |  Branch (2051:13): [True: 2.37k, False: 71.3k]
  ------------------
 2052|  2.37k|            ctx_type copy = ctx->ctx;                                                                                              \
 2053|  2.37k|            final_func(&copy, md);                                                                                                 \
  ------------------
  |  | 1347|  2.37k|ptls_define_hash(sha256, SHA256_CTX, SHA256_Init, SHA256_Update, _sha256_final);
  |  |  ------------------
  |  |  |  | 1346|  2.37k|#define _sha256_final(ctx, md) SHA256_Final((md), (ctx))
  |  |  ------------------
  ------------------
 2054|  2.37k|            ptls_clear_memory(&copy, sizeof(copy));                                                                                \
 2055|  2.37k|            return;                                                                                                                \
 2056|  2.37k|        }                                                                                                                          \
 2057|  73.7k|        if (md != NULL)                                                                                                            \
  ------------------
  |  Branch (2057:13): [True: 60.9k, False: 10.4k]
  ------------------
 2058|  71.3k|            final_func(&ctx->ctx, md);                                                                                             \
  ------------------
  |  | 1347|  60.9k|ptls_define_hash(sha256, SHA256_CTX, SHA256_Init, SHA256_Update, _sha256_final);
  |  |  ------------------
  |  |  |  | 1346|  60.9k|#define _sha256_final(ctx, md) SHA256_Final((md), (ctx))
  |  |  ------------------
  ------------------
 2059|  71.3k|        switch (mode) {                                                                                                            \
 2060|  13.8k|        case PTLS_HASH_FINAL_MODE_FREE:                                                                                            \
  ------------------
  |  Branch (2060:9): [True: 13.8k, False: 57.4k]
  ------------------
 2061|  13.8k|            ptls_clear_memory(&ctx->ctx, sizeof(ctx->ctx));                                                                        \
 2062|  13.8k|            free(ctx);                                                                                                             \
 2063|  13.8k|            break;                                                                                                                 \
 2064|  57.4k|        case PTLS_HASH_FINAL_MODE_RESET:                                                                                           \
  ------------------
  |  Branch (2064:9): [True: 57.4k, False: 13.8k]
  ------------------
 2065|  57.4k|            init_func(&ctx->ctx);                                                                                                  \
 2066|  57.4k|            break;                                                                                                                 \
 2067|      0|        default:                                                                                                                   \
  ------------------
  |  Branch (2067:9): [True: 0, False: 71.3k]
  ------------------
 2068|      0|            assert(!"FIXME");                                                                                                      \
 2069|      0|            break;                                                                                                                 \
 2070|  71.3k|        }                                                                                                                          \
 2071|  71.3k|    }                                                                                                                              \

openssl.c:x9_62_create_context:
  320|  40.0k|{
  321|  40.0k|    int ret;
  322|       |
  323|  40.0k|    if ((*ctx = (struct st_x9_62_keyex_context_t *)malloc(sizeof(**ctx))) == NULL) {
  ------------------
  |  Branch (323:9): [True: 0, False: 40.0k]
  ------------------
  324|      0|        ret = PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  241|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  325|      0|        goto Exit;
  326|      0|    }
  327|  40.0k|    **ctx = (struct st_x9_62_keyex_context_t){{algo, {NULL}, x9_62_on_exchange}};
  328|       |
  329|  40.0k|    if (((*ctx)->bn_ctx = BN_CTX_new()) == NULL) {
  ------------------
  |  Branch (329:9): [True: 0, False: 40.0k]
  ------------------
  330|      0|        ret = PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  241|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  331|      0|        goto Exit;
  332|      0|    }
  333|       |
  334|  40.0k|    ret = 0;
  335|  40.0k|Exit:
  336|  40.0k|    if (ret != 0 && *ctx != NULL) {
  ------------------
  |  Branch (336:9): [True: 0, False: 40.0k]
  |  Branch (336:21): [True: 0, False: 0]
  ------------------
  337|      0|        x9_62_free_context(*ctx);
  338|      0|        *ctx = NULL;
  339|      0|    }
  340|  40.0k|    return ret;
  341|  40.0k|}
openssl.c:x9_62_on_exchange:
  291|  40.0k|{
  292|  40.0k|    struct st_x9_62_keyex_context_t *ctx = (struct st_x9_62_keyex_context_t *)*_ctx;
  293|  40.0k|    const EC_GROUP *group = EC_KEY_get0_group(ctx->privkey);
  294|  40.0k|    EC_POINT *peer_point = NULL;
  295|  40.0k|    int ret;
  296|       |
  297|  40.0k|    if (secret == NULL) {
  ------------------
  |  Branch (297:9): [True: 38.8k, False: 1.16k]
  ------------------
  298|  38.8k|        ret = 0;
  299|  38.8k|        goto Exit;
  300|  38.8k|    }
  301|       |
  302|  1.16k|    if ((peer_point = x9_62_decode_point(group, peerkey, ctx->bn_ctx)) == NULL) {
  ------------------
  |  Branch (302:9): [True: 3, False: 1.16k]
  ------------------
  303|      3|        ret = PTLS_ALERT_DECODE_ERROR;
  ------------------
  |  |  219|      3|#define PTLS_ALERT_DECODE_ERROR 50
  ------------------
  304|      3|        goto Exit;
  305|      3|    }
  306|  1.16k|    if ((ret = ecdh_calc_secret(secret, group, ctx->privkey, peer_point)) != 0)
  ------------------
  |  Branch (306:9): [True: 1, False: 1.16k]
  ------------------
  307|      1|        goto Exit;
  308|       |
  309|  40.0k|Exit:
  310|  40.0k|    if (peer_point != NULL)
  ------------------
  |  Branch (310:9): [True: 1.16k, False: 38.8k]
  ------------------
  311|  1.16k|        EC_POINT_free(peer_point);
  312|  40.0k|    if (release) {
  ------------------
  |  Branch (312:9): [True: 40.0k, False: 0]
  ------------------
  313|  40.0k|        x9_62_free_context(ctx);
  314|  40.0k|        *_ctx = NULL;
  315|  40.0k|    }
  316|  40.0k|    return ret;
  317|  1.16k|}
openssl.c:x9_62_decode_point:
  245|  1.16k|{
  246|  1.16k|    EC_POINT *point = NULL;
  247|       |
  248|  1.16k|    if ((point = EC_POINT_new(group)) == NULL)
  ------------------
  |  Branch (248:9): [True: 0, False: 1.16k]
  ------------------
  249|      0|        return NULL;
  250|  1.16k|    if (!EC_POINT_oct2point(group, point, vec.base, vec.len, bn_ctx)) {
  ------------------
  |  Branch (250:9): [True: 3, False: 1.16k]
  ------------------
  251|      3|        EC_POINT_free(point);
  252|      3|        return NULL;
  253|      3|    }
  254|       |
  255|  1.16k|    return point;
  256|  1.16k|}
openssl.c:ecdh_calc_secret:
  219|  1.16k|{
  220|  1.16k|    ptls_iovec_t secret;
  221|  1.16k|    int ret;
  222|       |
  223|  1.16k|    secret.len = (EC_GROUP_get_degree(group) + 7) / 8;
  224|  1.16k|    if ((secret.base = malloc(secret.len)) == NULL) {
  ------------------
  |  Branch (224:9): [True: 0, False: 1.16k]
  ------------------
  225|      0|        ret = PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  241|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  226|      0|        goto Exit;
  227|      0|    }
  228|  1.16k|    if (ECDH_compute_key(secret.base, secret.len, peer_point, privkey, NULL) <= 0) {
  ------------------
  |  Branch (228:9): [True: 1, False: 1.16k]
  ------------------
  229|      1|        ret = PTLS_ALERT_HANDSHAKE_FAILURE; /* ??? */
  ------------------
  |  |  210|      1|#define PTLS_ALERT_HANDSHAKE_FAILURE 40
  ------------------
  230|      1|        goto Exit;
  231|      1|    }
  232|  1.16k|    ret = 0;
  233|       |
  234|  1.16k|Exit:
  235|  1.16k|    if (ret == 0) {
  ------------------
  |  Branch (235:9): [True: 1.16k, False: 1]
  ------------------
  236|  1.16k|        *out = secret;
  237|  1.16k|    } else {
  238|      1|        free(secret.base);
  239|      1|        *out = (ptls_iovec_t){NULL};
  240|      1|    }
  241|  1.16k|    return ret;
  242|  1.16k|}
openssl.c:x9_62_setup_pubkey:
  344|  40.0k|{
  345|  40.0k|    const EC_GROUP *group = EC_KEY_get0_group(ctx->privkey);
  346|  40.0k|    const EC_POINT *pubkey = EC_KEY_get0_public_key(ctx->privkey);
  347|  40.0k|    if ((ctx->super.pubkey = x9_62_encode_point(group, pubkey, ctx->bn_ctx)).base == NULL)
  ------------------
  |  Branch (347:9): [True: 0, False: 40.0k]
  ------------------
  348|      0|        return PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  241|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  349|  40.0k|    return 0;
  350|  40.0k|}
openssl.c:x9_62_encode_point:
  259|  40.0k|{
  260|  40.0k|    ptls_iovec_t vec;
  261|       |
  262|  40.0k|    if ((vec.len = EC_POINT_point2oct(group, point, POINT_CONVERSION_UNCOMPRESSED, NULL, 0, bn_ctx)) == 0)
  ------------------
  |  Branch (262:9): [True: 0, False: 40.0k]
  ------------------
  263|      0|        return (ptls_iovec_t){NULL};
  264|  40.0k|    if ((vec.base = malloc(vec.len)) == NULL)
  ------------------
  |  Branch (264:9): [True: 0, False: 40.0k]
  ------------------
  265|      0|        return (ptls_iovec_t){NULL};
  266|  40.0k|    if (EC_POINT_point2oct(group, point, POINT_CONVERSION_UNCOMPRESSED, vec.base, vec.len, bn_ctx) != vec.len) {
  ------------------
  |  Branch (266:9): [True: 0, False: 40.0k]
  ------------------
  267|      0|        free(vec.base);
  268|      0|        return (ptls_iovec_t){NULL};
  269|      0|    }
  270|       |
  271|  40.0k|    return vec;
  272|  40.0k|}
openssl.c:x9_62_free_context:
  281|  40.0k|{
  282|  40.0k|    free(ctx->super.pubkey.base);
  283|  40.0k|    if (ctx->privkey != NULL)
  ------------------
  |  Branch (283:9): [True: 40.0k, False: 0]
  ------------------
  284|  40.0k|        EC_KEY_free(ctx->privkey);
  285|  40.0k|    if (ctx->bn_ctx != NULL)
  ------------------
  |  Branch (285:9): [True: 40.0k, False: 0]
  ------------------
  286|  40.0k|        BN_CTX_free(ctx->bn_ctx);
  287|  40.0k|    free(ctx);
  288|  40.0k|}
openssl.c:x9_62_create_key_exchange:
  353|  40.0k|{
  354|  40.0k|    EC_GROUP *group = NULL;
  355|  40.0k|    struct st_x9_62_keyex_context_t *ctx = NULL;
  356|  40.0k|    int ret;
  357|       |
  358|       |    /* FIXME use a global? */
  359|  40.0k|    if ((group = EC_GROUP_new_by_curve_name((int)algo->data)) == NULL) {
  ------------------
  |  Branch (359:9): [True: 0, False: 40.0k]
  ------------------
  360|      0|        ret = PTLS_ERROR_LIBRARY;
  ------------------
  |  |  243|      0|#define PTLS_ERROR_LIBRARY (PTLS_ERROR_CLASS_INTERNAL + 3)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  361|      0|        goto Exit;
  362|      0|    }
  363|  40.0k|    if ((ret = x9_62_create_context(algo, &ctx)) != 0)
  ------------------
  |  Branch (363:9): [True: 0, False: 40.0k]
  ------------------
  364|      0|        goto Exit;
  365|  40.0k|    if ((ctx->privkey = ecdh_gerenate_key(group)) == NULL) {
  ------------------
  |  Branch (365:9): [True: 0, False: 40.0k]
  ------------------
  366|      0|        ret = PTLS_ERROR_LIBRARY;
  ------------------
  |  |  243|      0|#define PTLS_ERROR_LIBRARY (PTLS_ERROR_CLASS_INTERNAL + 3)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  367|      0|        goto Exit;
  368|      0|    }
  369|  40.0k|    if ((ret = x9_62_setup_pubkey(ctx)) != 0)
  ------------------
  |  Branch (369:9): [True: 0, False: 40.0k]
  ------------------
  370|      0|        goto Exit;
  371|  40.0k|    ret = 0;
  372|       |
  373|  40.0k|Exit:
  374|  40.0k|    if (group != NULL)
  ------------------
  |  Branch (374:9): [True: 40.0k, False: 0]
  ------------------
  375|  40.0k|        EC_GROUP_free(group);
  376|  40.0k|    if (ret == 0) {
  ------------------
  |  Branch (376:9): [True: 40.0k, False: 0]
  ------------------
  377|  40.0k|        *_ctx = &ctx->super;
  378|  40.0k|    } else {
  379|      0|        if (ctx != NULL)
  ------------------
  |  Branch (379:13): [True: 0, False: 0]
  ------------------
  380|      0|            x9_62_free_context(ctx);
  381|      0|        *_ctx = NULL;
  382|      0|    }
  383|       |
  384|  40.0k|    return ret;
  385|  40.0k|}
openssl.c:ecdh_gerenate_key:
  205|  40.0k|{
  206|  40.0k|    EC_KEY *key;
  207|       |
  208|  40.0k|    if ((key = EC_KEY_new()) == NULL)
  ------------------
  |  Branch (208:9): [True: 0, False: 40.0k]
  ------------------
  209|      0|        return NULL;
  210|  40.0k|    if (!EC_KEY_set_group(key, group) || !EC_KEY_generate_key(key)) {
  ------------------
  |  Branch (210:9): [True: 0, False: 40.0k]
  |  Branch (210:42): [True: 0, False: 40.0k]
  ------------------
  211|      0|        EC_KEY_free(key);
  212|      0|        return NULL;
  213|      0|    }
  214|       |
  215|  40.0k|    return key;
  216|  40.0k|}
openssl.c:aead_aes128gcm_setup_crypto:
 1295|  2.32k|{
 1296|  2.32k|    return aead_setup_crypto(ctx, is_enc, key, iv, EVP_aes_128_gcm());
 1297|  2.32k|}
openssl.c:aead_setup_crypto:
 1241|  2.32k|{
 1242|  2.32k|    struct aead_crypto_context_t *ctx = (struct aead_crypto_context_t *)_ctx;
 1243|  2.32k|    int ret;
 1244|       |
 1245|  2.32k|    ctx->super.dispose_crypto = aead_dispose_crypto;
 1246|  2.32k|    ctx->super.do_get_iv = aead_get_iv;
 1247|  2.32k|    ctx->super.do_set_iv = aead_set_iv;
 1248|  2.32k|    if (is_enc) {
  ------------------
  |  Branch (1248:9): [True: 1.16k, False: 1.16k]
  ------------------
 1249|  1.16k|        ctx->super.do_encrypt_init = aead_do_encrypt_init;
 1250|  1.16k|        ctx->super.do_encrypt_update = aead_do_encrypt_update;
 1251|  1.16k|        ctx->super.do_encrypt_final = aead_do_encrypt_final;
 1252|  1.16k|        ctx->super.do_encrypt = ptls_aead__do_encrypt;
 1253|  1.16k|        ctx->super.do_encrypt_v = ptls_aead__do_encrypt_v;
 1254|  1.16k|        ctx->super.do_decrypt = NULL;
 1255|  1.16k|    } else {
 1256|  1.16k|        ctx->super.do_encrypt_init = NULL;
 1257|  1.16k|        ctx->super.do_encrypt_update = NULL;
 1258|  1.16k|        ctx->super.do_encrypt_final = NULL;
 1259|  1.16k|        ctx->super.do_encrypt = NULL;
 1260|  1.16k|        ctx->super.do_encrypt_v = NULL;
 1261|  1.16k|        ctx->super.do_decrypt = aead_do_decrypt;
 1262|  1.16k|    }
 1263|  2.32k|    ctx->evp_ctx = NULL;
 1264|       |
 1265|  2.32k|    if ((ctx->evp_ctx = EVP_CIPHER_CTX_new()) == NULL) {
  ------------------
  |  Branch (1265:9): [True: 0, False: 2.32k]
  ------------------
 1266|      0|        ret = PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  241|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 1267|      0|        goto Error;
 1268|      0|    }
 1269|  2.32k|    if (is_enc) {
  ------------------
  |  Branch (1269:9): [True: 1.16k, False: 1.16k]
  ------------------
 1270|  1.16k|        if (!EVP_EncryptInit_ex(ctx->evp_ctx, cipher, NULL, key, NULL)) {
  ------------------
  |  Branch (1270:13): [True: 0, False: 1.16k]
  ------------------
 1271|      0|            ret = PTLS_ERROR_LIBRARY;
  ------------------
  |  |  243|      0|#define PTLS_ERROR_LIBRARY (PTLS_ERROR_CLASS_INTERNAL + 3)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 1272|      0|            goto Error;
 1273|      0|        }
 1274|  1.16k|    } else {
 1275|  1.16k|        if (!EVP_DecryptInit_ex(ctx->evp_ctx, cipher, NULL, key, NULL)) {
  ------------------
  |  Branch (1275:13): [True: 0, False: 1.16k]
  ------------------
 1276|      0|            ret = PTLS_ERROR_LIBRARY;
  ------------------
  |  |  243|      0|#define PTLS_ERROR_LIBRARY (PTLS_ERROR_CLASS_INTERNAL + 3)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 1277|      0|            goto Error;
 1278|      0|        }
 1279|  1.16k|    }
 1280|  2.32k|    if (!EVP_CIPHER_CTX_ctrl(ctx->evp_ctx, EVP_CTRL_GCM_SET_IVLEN, (int)ctx->super.algo->iv_size, NULL)) {
  ------------------
  |  Branch (1280:9): [True: 0, False: 2.32k]
  ------------------
 1281|      0|        ret = PTLS_ERROR_LIBRARY;
  ------------------
  |  |  243|      0|#define PTLS_ERROR_LIBRARY (PTLS_ERROR_CLASS_INTERNAL + 3)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 1282|      0|        goto Error;
 1283|      0|    }
 1284|       |
 1285|  2.32k|    memcpy(ctx->static_iv, iv, ctx->super.algo->iv_size);
 1286|       |
 1287|  2.32k|    return 0;
 1288|       |
 1289|      0|Error:
 1290|      0|    aead_dispose_crypto(&ctx->super);
 1291|      0|    return ret;
 1292|  2.32k|}
openssl.c:aead_dispose_crypto:
 1144|  2.32k|{
 1145|  2.32k|    struct aead_crypto_context_t *ctx = (struct aead_crypto_context_t *)_ctx;
 1146|       |
 1147|  2.32k|    if (ctx->evp_ctx != NULL)
  ------------------
  |  Branch (1147:9): [True: 2.32k, False: 0]
  ------------------
 1148|  2.32k|        EVP_CIPHER_CTX_free(ctx->evp_ctx);
 1149|  2.32k|}

ptls_buffer__release_memory:
  546|   182k|{
  547|   182k|    ptls_clear_memory(buf->base, buf->off);
  548|   182k|    if (buf->is_allocated) {
  ------------------
  |  Branch (548:9): [True: 7.50k, False: 174k]
  ------------------
  549|       |#ifdef _WINDOWS
  550|       |        if (buf->align_bits != 0) {
  551|       |            _aligned_free(buf->base);
  552|       |        } else {
  553|       |            free(buf->base);
  554|       |        }
  555|       |#else
  556|  7.50k|        free(buf->base);
  557|  7.50k|#endif
  558|  7.50k|    }
  559|   182k|}
ptls_buffer_reserve:
  562|  1.56M|{
  563|  1.56M|    return ptls_buffer_reserve_aligned(buf, delta, 0);
  564|  1.56M|}
ptls_buffer_reserve_aligned:
  567|  1.56M|{
  568|  1.56M|    if (buf->base == NULL)
  ------------------
  |  Branch (568:9): [True: 0, False: 1.56M]
  ------------------
  569|      0|        return PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  241|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  570|       |
  571|  1.56M|    if (PTLS_MEMORY_DEBUG || buf->capacity < buf->off + delta ||
  ------------------
  |  |  102|  3.13M|#define PTLS_MEMORY_DEBUG 0
  |  |  ------------------
  |  |  |  Branch (102:27): [Folded - Ignored]
  |  |  ------------------
  ------------------
  |  Branch (571:30): [True: 7.50k, False: 1.56M]
  ------------------
  572|  1.56M|        (buf->align_bits < align_bits && ((uintptr_t)buf->base & (((uintptr_t)1 << align_bits) - 1)) != 0)) {
  ------------------
  |  Branch (572:10): [True: 0, False: 1.56M]
  |  Branch (572:42): [True: 0, False: 0]
  ------------------
  573|  7.50k|        void *newp;
  574|  7.50k|        size_t new_capacity = buf->capacity;
  575|  7.50k|        if (new_capacity < 1024)
  ------------------
  |  Branch (575:13): [True: 6.76k, False: 745]
  ------------------
  576|  6.76k|            new_capacity = 1024;
  577|  8.85k|        while (new_capacity < buf->off + delta) {
  ------------------
  |  Branch (577:16): [True: 1.34k, False: 7.50k]
  ------------------
  578|  1.34k|            new_capacity *= 2;
  579|  1.34k|        }
  580|  7.50k|        if (align_bits != 0) {
  ------------------
  |  Branch (580:13): [True: 0, False: 7.50k]
  ------------------
  581|       |#ifdef _WINDOWS
  582|       |            if ((newp = _aligned_malloc(new_capacity, (size_t)1 << align_bits)) == NULL)
  583|       |                return PTLS_ERROR_NO_MEMORY;
  584|       |#else
  585|      0|            if (posix_memalign(&newp, 1 << align_bits, new_capacity) != 0)
  ------------------
  |  Branch (585:17): [True: 0, False: 0]
  ------------------
  586|      0|                return PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  241|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  587|      0|#endif
  588|  7.50k|        } else {
  589|  7.50k|            if ((newp = malloc(new_capacity)) == NULL)
  ------------------
  |  Branch (589:17): [True: 0, False: 7.50k]
  ------------------
  590|      0|                return PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  241|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  591|  7.50k|        }
  592|  7.50k|        memcpy(newp, buf->base, buf->off);
  593|  7.50k|        ptls_buffer__release_memory(buf);
  594|  7.50k|        buf->base = newp;
  595|  7.50k|        buf->capacity = new_capacity;
  596|  7.50k|        buf->is_allocated = 1;
  597|  7.50k|        buf->align_bits = align_bits;
  598|  7.50k|    }
  599|       |
  600|  1.56M|    return 0;
  601|  1.56M|}
ptls_buffer__do_pushv:
  604|  1.58M|{
  605|  1.58M|    int ret;
  606|       |
  607|  1.58M|    if (len == 0)
  ------------------
  |  Branch (607:9): [True: 44.6k, False: 1.53M]
  ------------------
  608|  44.6k|        return 0;
  609|  1.53M|    if ((ret = ptls_buffer_reserve(buf, len)) != 0)
  ------------------
  |  Branch (609:9): [True: 0, False: 1.53M]
  ------------------
  610|      0|        return ret;
  611|  1.53M|    memcpy(buf->base + buf->off, src, len);
  612|  1.53M|    buf->off += len;
  613|  1.53M|    return 0;
  614|  1.53M|}
ptls_decode8:
  892|  39.3k|{
  893|  39.3k|    if (*src == end)
  ------------------
  |  Branch (893:9): [True: 7, False: 39.3k]
  ------------------
  894|      7|        return PTLS_ALERT_DECODE_ERROR;
  ------------------
  |  |  219|      7|#define PTLS_ALERT_DECODE_ERROR 50
  ------------------
  895|  39.3k|    *value = *(*src)++;
  896|  39.3k|    return 0;
  897|  39.3k|}
ptls_decode16:
  900|   139k|{
  901|   139k|    if (end - *src < 2)
  ------------------
  |  Branch (901:9): [True: 54, False: 139k]
  ------------------
  902|     54|        return PTLS_ALERT_DECODE_ERROR;
  ------------------
  |  |  219|     54|#define PTLS_ALERT_DECODE_ERROR 50
  ------------------
  903|   139k|    *value = ntoh16(*src);
  904|   139k|    *src += 2;
  905|   139k|    return 0;
  906|   139k|}
ptls__key_schedule_update_hash:
 1372|  79.8k|{
 1373|  79.8k|    size_t i;
 1374|       |
 1375|  79.8k|    PTLS_DEBUGF("%s:%p:len=%zu\n", __FUNCTION__, sched, msglen);
 1376|   159k|    for (i = 0; i != sched->num_hashes; ++i) {
  ------------------
  |  Branch (1376:17): [True: 79.8k, False: 79.8k]
  ------------------
 1377|  79.8k|        ptls_hash_context_t *ctx = use_outer ? sched->hashes[i].ctx_outer : sched->hashes[i].ctx;
  ------------------
  |  Branch (1377:36): [True: 0, False: 79.8k]
  ------------------
 1378|  79.8k|        ctx->update(ctx, msg, msglen);
 1379|       |#if defined(PTLS_DEBUG) && PTLS_DEBUG
 1380|       |        {
 1381|       |            uint8_t digest[PTLS_MAX_DIGEST_SIZE];
 1382|       |            ctx->final(ctx, digest, PTLS_HASH_FINAL_MODE_SNAPSHOT);
 1383|       |            PTLS_DEBUGF("  %zu: %02x%02x%02x%02x\n", i, digest[0], digest[1], digest[2], digest[3]);
 1384|       |        }
 1385|       |#endif
 1386|  79.8k|    }
 1387|  79.8k|}
ptls_find_cipher_suite:
 2550|  39.4k|{
 2551|  39.4k|    ptls_cipher_suite_t **cs;
 2552|  39.4k|    if (cipher_suites == NULL)
  ------------------
  |  Branch (2552:9): [True: 0, False: 39.4k]
  ------------------
 2553|      0|        return NULL;
 2554|  39.4k|    for (cs = cipher_suites; *cs != NULL && (*cs)->id != id; ++cs)
  ------------------
  |  Branch (2554:30): [True: 39.4k, False: 36]
  |  Branch (2554:45): [True: 36, False: 39.3k]
  ------------------
 2555|     36|        ;
 2556|  39.4k|    return *cs;
 2557|  39.4k|}
ptls_client_new:
 5098|  2.28k|{
 5099|  2.28k|    ptls_t *tls = new_instance(ctx, 0);
 5100|  2.28k|    tls->state = PTLS_STATE_CLIENT_HANDSHAKE_START;
 5101|  2.28k|    tls->ctx->random_bytes(tls->client_random, sizeof(tls->client_random));
 5102|  2.28k|    log_client_random(tls);
 5103|  2.28k|    if (tls->send_change_cipher_spec) {
  ------------------
  |  Branch (5103:9): [True: 0, False: 2.28k]
  ------------------
 5104|      0|        tls->client.legacy_session_id =
 5105|      0|            ptls_iovec_init(tls->client.legacy_session_id_buf, sizeof(tls->client.legacy_session_id_buf));
 5106|      0|        tls->ctx->random_bytes(tls->client.legacy_session_id.base, tls->client.legacy_session_id.len);
 5107|      0|    }
 5108|       |
 5109|  2.28k|    PTLS_PROBE(NEW, tls, 0);
 5110|  2.28k|    PTLS_LOG_CONN(new, tls, { PTLS_LOG_ELEMENT_BOOL(is_server, 0); });
  ------------------
  |  | 1384|  2.28k|    do {                                                                                                                           \
  |  | 1385|  2.28k|        ptls_t *_tls = (tls);                                                                                                      \
  |  | 1386|  2.28k|        if (!ptls_log.is_active || ptls_skip_tracing(_tls))                                                                        \
  |  |  ------------------
  |  |  |  Branch (1386:13): [True: 2.28k, False: 0]
  |  |  |  Branch (1386:36): [True: 0, False: 0]
  |  |  ------------------
  |  | 1387|  2.28k|            break;                                                                                                                 \
  |  | 1388|  2.28k|        PTLS_LOG__DO_LOG(picotls, type, {                                                                                          \
  |  |  ------------------
  |  |  |  | 1361|      0|    do {                                                                                                                           \
  |  |  |  | 1362|      0|        int ptlslog_skip = 0;                                                                                                      \
  |  |  |  | 1363|      0|        char smallbuf[128];                                                                                                        \
  |  |  |  | 1364|      0|        ptls_buffer_t ptlslogbuf;                                                                                                  \
  |  |  |  | 1365|      0|        ptls_buffer_init(&ptlslogbuf, smallbuf, sizeof(smallbuf));                                                                 \
  |  |  |  | 1366|      0|        PTLS_LOG__DO_PUSH_SAFESTR("{\"module\":\"" PTLS_TO_STR(module) "\",\"type\":\"" PTLS_TO_STR(type) "\"");                   \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1448|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1449|      0|        if (PTLS_UNLIKELY(!ptlslog_skip && !ptls_log__do_push_safestr(&ptlslogbuf, (v))))                                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   40|      0|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (40:26): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (40:46): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (40:46): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1450|      0|            ptlslog_skip = 1;                                                                                                      \
  |  |  |  |  |  | 1451|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1451:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1367|      0|        do {                                                                                                                       \
  |  |  |  | 1368|      0|            block                                                                                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1369|      0|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1369:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1370|      0|        PTLS_LOG__DO_PUSH_SAFESTR("}\n");                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1448|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1449|      0|        if (PTLS_UNLIKELY(!ptlslog_skip && !ptls_log__do_push_safestr(&ptlslogbuf, (v))))                                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   40|      0|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (40:26): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (40:46): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (40:46): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1450|      0|            ptlslog_skip = 1;                                                                                                      \
  |  |  |  |  |  | 1451|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1451:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1371|      0|        if (!ptlslog_skip)                                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1371:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1372|      0|            ptls_log__do_write(&ptlslogbuf);                                                                                       \
  |  |  |  | 1373|      0|        ptls_buffer_dispose(&ptlslogbuf);                                                                                          \
  |  |  |  | 1374|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1374:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1389|      0|            PTLS_LOG_ELEMENT_PTR(tls, _tls);                                                                                       \
  |  | 1390|      0|            do {                                                                                                                   \
  |  | 1391|      0|                block                                                                                                              \
  |  | 1392|      0|            } while (0);                                                                                                           \
  |  | 1393|      0|        });                                                                                                                        \
  |  | 1394|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1394:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 5111|      0|    return tls;
 5112|  2.28k|}
ptls_free:
 5389|  2.28k|{
 5390|  2.28k|    PTLS_PROBE0(FREE, tls);
 5391|  2.28k|    PTLS_LOG_CONN(free, tls, {});
  ------------------
  |  | 1384|  2.28k|    do {                                                                                                                           \
  |  | 1385|  2.28k|        ptls_t *_tls = (tls);                                                                                                      \
  |  | 1386|  2.28k|        if (!ptls_log.is_active || ptls_skip_tracing(_tls))                                                                        \
  |  |  ------------------
  |  |  |  Branch (1386:13): [True: 2.28k, False: 0]
  |  |  |  Branch (1386:36): [True: 0, False: 0]
  |  |  ------------------
  |  | 1387|  2.28k|            break;                                                                                                                 \
  |  | 1388|  2.28k|        PTLS_LOG__DO_LOG(picotls, type, {                                                                                          \
  |  |  ------------------
  |  |  |  | 1361|      0|    do {                                                                                                                           \
  |  |  |  | 1362|      0|        int ptlslog_skip = 0;                                                                                                      \
  |  |  |  | 1363|      0|        char smallbuf[128];                                                                                                        \
  |  |  |  | 1364|      0|        ptls_buffer_t ptlslogbuf;                                                                                                  \
  |  |  |  | 1365|      0|        ptls_buffer_init(&ptlslogbuf, smallbuf, sizeof(smallbuf));                                                                 \
  |  |  |  | 1366|      0|        PTLS_LOG__DO_PUSH_SAFESTR("{\"module\":\"" PTLS_TO_STR(module) "\",\"type\":\"" PTLS_TO_STR(type) "\"");                   \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1448|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1449|      0|        if (PTLS_UNLIKELY(!ptlslog_skip && !ptls_log__do_push_safestr(&ptlslogbuf, (v))))                                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   40|      0|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (40:26): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (40:46): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (40:46): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1450|      0|            ptlslog_skip = 1;                                                                                                      \
  |  |  |  |  |  | 1451|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1451:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1367|      0|        do {                                                                                                                       \
  |  |  |  | 1368|      0|            block                                                                                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1369|      0|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1369:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1370|      0|        PTLS_LOG__DO_PUSH_SAFESTR("}\n");                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1448|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1449|      0|        if (PTLS_UNLIKELY(!ptlslog_skip && !ptls_log__do_push_safestr(&ptlslogbuf, (v))))                                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   40|      0|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (40:26): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (40:46): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (40:46): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1450|      0|            ptlslog_skip = 1;                                                                                                      \
  |  |  |  |  |  | 1451|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1451:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1371|      0|        if (!ptlslog_skip)                                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1371:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1372|      0|            ptls_log__do_write(&ptlslogbuf);                                                                                       \
  |  |  |  | 1373|      0|        ptls_buffer_dispose(&ptlslogbuf);                                                                                          \
  |  |  |  | 1374|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1374:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1389|      0|            PTLS_LOG_ELEMENT_PTR(tls, _tls);                                                                                       \
  |  | 1390|      0|            do {                                                                                                                   \
  |  | 1391|      0|                block                                                                                                              \
  |  | 1392|      0|            } while (0);                                                                                                           \
  |  | 1393|      0|        });                                                                                                                        \
  |  | 1394|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1394:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 5392|       |
 5393|      0|    ptls_buffer_dispose(&tls->recvbuf.rec);
 5394|  2.28k|    ptls_buffer_dispose(&tls->recvbuf.mess);
 5395|  2.28k|    free_exporter_master_secret(tls, 1);
 5396|  2.28k|    free_exporter_master_secret(tls, 0);
 5397|  2.28k|    if (tls->key_schedule != NULL)
  ------------------
  |  Branch (5397:9): [True: 2.28k, False: 0]
  ------------------
 5398|  2.28k|        key_schedule_free(tls->key_schedule);
 5399|  2.28k|    if (tls->traffic_protection.dec.aead != NULL)
  ------------------
  |  Branch (5399:9): [True: 1.16k, False: 1.12k]
  ------------------
 5400|  1.16k|        ptls_aead_free(tls->traffic_protection.dec.aead);
 5401|  2.28k|    if (tls->traffic_protection.enc.aead != NULL)
  ------------------
  |  Branch (5401:9): [True: 1.16k, False: 1.12k]
  ------------------
 5402|  1.16k|        ptls_aead_free(tls->traffic_protection.enc.aead);
 5403|  2.28k|    free(tls->server_name);
 5404|  2.28k|    free(tls->negotiated_protocol);
 5405|  2.28k|    clear_ech(&tls->ech, tls->is_server);
 5406|  2.28k|    if (tls->is_server) {
  ------------------
  |  Branch (5406:9): [True: 0, False: 2.28k]
  ------------------
 5407|      0|        if (tls->server.async_job != NULL)
  ------------------
  |  Branch (5407:13): [True: 0, False: 0]
  ------------------
 5408|      0|            tls->server.async_job->destroy_(tls->server.async_job);
 5409|  2.28k|    } else {
 5410|  2.28k|        if (tls->client.key_share_ctx != NULL)
  ------------------
  |  Branch (5410:13): [True: 1.08k, False: 1.19k]
  ------------------
 5411|  1.08k|            tls->client.key_share_ctx->on_exchange(&tls->client.key_share_ctx, 1, NULL, ptls_iovec_init(NULL, 0));
 5412|  2.28k|        if (tls->client.certificate_request.context.base != NULL)
  ------------------
  |  Branch (5412:13): [True: 282, False: 1.99k]
  ------------------
 5413|    282|            free(tls->client.certificate_request.context.base);
 5414|  2.28k|    }
 5415|  2.28k|    if (tls->certificate_verify.cb != NULL)
  ------------------
  |  Branch (5415:9): [True: 0, False: 2.28k]
  ------------------
 5416|      0|        tls->certificate_verify.cb(tls->certificate_verify.verify_ctx, 0, ptls_iovec_init(NULL, 0), ptls_iovec_init(NULL, 0));
 5417|  2.28k|    if (tls->pending_handshake_secret != NULL) {
  ------------------
  |  Branch (5417:9): [True: 0, False: 2.28k]
  ------------------
 5418|      0|        ptls_clear_memory(tls->pending_handshake_secret, PTLS_MAX_DIGEST_SIZE);
  ------------------
  |  |  120|      0|#define PTLS_MAX_DIGEST_SIZE 64
  ------------------
 5419|      0|        free(tls->pending_handshake_secret);
 5420|      0|    }
 5421|  2.28k|    update_open_count(tls->ctx, -1);
 5422|  2.28k|    ptls_clear_memory(tls, sizeof(*tls));
 5423|  2.28k|    free(tls);
 5424|  2.28k|}
ptls_set_negotiated_protocol:
 5498|     28|{
 5499|     28|    char *duped = NULL;
 5500|       |
 5501|     28|    if (protocol != NULL && (duped = duplicate_as_str(protocol, protocol_len != 0 ? protocol_len : strlen(protocol))) == NULL)
  ------------------
  |  Branch (5501:9): [True: 28, False: 0]
  |  Branch (5501:29): [True: 0, False: 28]
  |  Branch (5501:65): [True: 28, False: 0]
  ------------------
 5502|      0|        return PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  241|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 5503|       |
 5504|     28|    free(tls->negotiated_protocol);
 5505|     28|    tls->negotiated_protocol = duped;
 5506|       |
 5507|     28|    return 0;
 5508|     28|}
ptls_handshake:
 5953|  4.56k|{
 5954|  4.56k|    struct st_ptls_record_message_emitter_t emitter;
 5955|  4.56k|    int ret;
 5956|       |
 5957|  4.56k|    assert(tls->state < PTLS_STATE_POST_HANDSHAKE_MIN);
 5958|       |
 5959|  4.56k|    init_record_message_emitter(tls, &emitter, _sendbuf);
 5960|  4.56k|    size_t sendbuf_orig_off = emitter.super.buf->off;
 5961|       |
 5962|       |    /* special handlings */
 5963|  4.56k|    switch (tls->state) {
 5964|  2.28k|    case PTLS_STATE_CLIENT_HANDSHAKE_START: {
  ------------------
  |  Branch (5964:5): [True: 2.28k, False: 2.28k]
  ------------------
 5965|  2.28k|        assert(input == NULL || *inlen == 0);
 5966|  2.28k|        return send_client_hello(tls, &emitter.super, properties, NULL);
 5967|  2.28k|    }
 5968|      0|    case PTLS_STATE_SERVER_GENERATING_CERTIFICATE_VERIFY:
  ------------------
  |  Branch (5968:5): [True: 0, False: 4.56k]
  ------------------
 5969|      0|        return server_finish_handshake(tls, &emitter.super, 1, NULL);
 5970|  2.28k|    default:
  ------------------
  |  Branch (5970:5): [True: 2.28k, False: 2.28k]
  ------------------
 5971|  2.28k|        break;
 5972|  4.56k|    }
 5973|       |
 5974|  2.28k|    const uint8_t *src = input, *const src_end = src + *inlen;
 5975|  2.28k|    ptls_buffer_t decryptbuf;
 5976|       |
 5977|  2.28k|    ptls_buffer_init(&decryptbuf, "", 0);
 5978|       |
 5979|       |    /* perform handhake until completion or until all the input has been swallowed */
 5980|  2.28k|    ret = PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  242|  2.28k|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  193|  2.28k|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 5981|  74.7k|    while (ret == PTLS_ERROR_IN_PROGRESS && src != src_end) {
  ------------------
  |  |  242|   149k|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  193|  74.7k|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  |  Branch (5981:12): [True: 72.7k, False: 1.95k]
  |  Branch (5981:45): [True: 72.4k, False: 330]
  ------------------
 5982|  72.4k|        size_t consumed = src_end - src;
 5983|  72.4k|        ret = handle_input(tls, &emitter.super, &decryptbuf, src, &consumed, properties);
 5984|  72.4k|        src += consumed;
 5985|  72.4k|        assert(decryptbuf.off == 0);
 5986|  72.4k|    }
 5987|       |
 5988|  2.28k|    ptls_buffer_dispose(&decryptbuf);
 5989|       |
 5990|  2.28k|    switch (ret) {
 5991|      0|    case 0:
  ------------------
  |  Branch (5991:5): [True: 0, False: 2.28k]
  ------------------
 5992|    330|    case PTLS_ERROR_IN_PROGRESS:
  ------------------
  |  |  242|    330|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  193|    330|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  |  Branch (5992:5): [True: 330, False: 1.95k]
  ------------------
 5993|    330|    case PTLS_ERROR_STATELESS_RETRY:
  ------------------
  |  |  246|    330|#define PTLS_ERROR_STATELESS_RETRY (PTLS_ERROR_CLASS_INTERNAL + 6)
  |  |  ------------------
  |  |  |  |  193|    330|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  |  Branch (5993:5): [True: 0, False: 2.28k]
  ------------------
 5994|    330|    case PTLS_ERROR_ASYNC_OPERATION:
  ------------------
  |  |  251|    330|#define PTLS_ERROR_ASYNC_OPERATION (PTLS_ERROR_CLASS_INTERNAL + 11)
  |  |  ------------------
  |  |  |  |  193|    330|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  |  Branch (5994:5): [True: 0, False: 2.28k]
  ------------------
 5995|    330|        break;
 5996|  1.95k|    default:
  ------------------
  |  Branch (5996:5): [True: 1.95k, False: 330]
  ------------------
 5997|       |        /* Flush handshake messages that have been written partially. ECH_REQUIRED sticks out because it is a message sent
 5998|       |         * post-handshake compared to other alerts that are generating *during* the handshake. */
 5999|  1.95k|        if (ret != PTLS_ALERT_ECH_REQUIRED) {
  ------------------
  |  |  230|  1.95k|#define PTLS_ALERT_ECH_REQUIRED 121
  ------------------
  |  Branch (5999:13): [True: 1.95k, False: 0]
  ------------------
 6000|  1.95k|            ptls_clear_memory(emitter.super.buf->base + sendbuf_orig_off, emitter.super.buf->off - sendbuf_orig_off);
 6001|  1.95k|            emitter.super.buf->off = sendbuf_orig_off;
 6002|  1.95k|        }
 6003|       |        /* send alert immediately */
 6004|  1.95k|        if (PTLS_ERROR_GET_CLASS(ret) != PTLS_ERROR_CLASS_PEER_ALERT)
  ------------------
  |  |  195|  1.95k|#define PTLS_ERROR_GET_CLASS(e) ((e) & ~0xff)
  ------------------
                      if (PTLS_ERROR_GET_CLASS(ret) != PTLS_ERROR_CLASS_PEER_ALERT)
  ------------------
  |  |  192|  1.95k|#define PTLS_ERROR_CLASS_PEER_ALERT 0x100
  ------------------
  |  Branch (6004:13): [True: 1.93k, False: 15]
  ------------------
 6005|  1.93k|            if (ptls_send_alert(tls, emitter.super.buf, PTLS_ALERT_LEVEL_FATAL,
  ------------------
  |  |  205|  1.93k|#define PTLS_ALERT_LEVEL_FATAL 2
  ------------------
  |  Branch (6005:17): [True: 0, False: 1.93k]
  ------------------
 6006|  1.93k|                                PTLS_ERROR_GET_CLASS(ret) == PTLS_ERROR_CLASS_SELF_ALERT ? ret : PTLS_ALERT_INTERNAL_ERROR) != 0)
  ------------------
  |  |  195|  1.93k|#define PTLS_ERROR_GET_CLASS(e) ((e) & ~0xff)
  ------------------
                                              PTLS_ERROR_GET_CLASS(ret) == PTLS_ERROR_CLASS_SELF_ALERT ? ret : PTLS_ALERT_INTERNAL_ERROR) != 0)
  ------------------
  |  |  191|  1.93k|#define PTLS_ERROR_CLASS_SELF_ALERT 0
  ------------------
                                              PTLS_ERROR_GET_CLASS(ret) == PTLS_ERROR_CLASS_SELF_ALERT ? ret : PTLS_ALERT_INTERNAL_ERROR) != 0)
  ------------------
  |  |  222|  1.93k|#define PTLS_ALERT_INTERNAL_ERROR 80
  ------------------
  |  Branch (6006:33): [True: 1.93k, False: 0]
  ------------------
 6007|      0|                emitter.super.buf->off = sendbuf_orig_off;
 6008|  1.95k|        break;
 6009|  2.28k|    }
 6010|       |
 6011|  2.28k|    *inlen -= src_end - src;
 6012|  2.28k|    return ret;
 6013|  2.28k|}
ptls_send_alert:
 6118|  1.93k|{
 6119|  1.93k|    size_t rec_start = sendbuf->off;
 6120|  1.93k|    int ret = 0;
 6121|       |
 6122|  1.93k|    buffer_push_record(sendbuf, PTLS_CONTENT_TYPE_ALERT, { ptls_buffer_push(sendbuf, level, description); });
  ------------------
  |  |  737|  1.93k|    do {                                                                                                                           \
  |  |  738|  1.93k|        ptls_buffer_push((buf), (type), PTLS_RECORD_VERSION_MAJOR, PTLS_RECORD_VERSION_MINOR);                                     \
  |  |  ------------------
  |  |  |  | 1196|  1.93k|    do {                                                                                                                           \
  |  |  |  | 1197|  1.93k|        if ((ret = ptls_buffer__do_pushv((buf), (uint8_t[]){__VA_ARGS__}, sizeof((uint8_t[]){__VA_ARGS__}))) != 0)                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1197:13): [True: 0, False: 1.93k]
  |  |  |  |  ------------------
  |  |  |  | 1198|  1.93k|            goto Exit;                                                                                                             \
  |  |  |  | 1199|  1.93k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1199:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  739|  1.93k|        ptls_buffer_push_block((buf), 2, block);                                                                                   \
  |  |  ------------------
  |  |  |  | 1235|  1.93k|    do {                                                                                                                           \
  |  |  |  | 1236|  1.93k|        size_t capacity = (_capacity);                                                                                             \
  |  |  |  | 1237|  1.93k|        ptls_buffer_pushv((buf), (uint8_t *)"\0\0\0\0\0\0\0", capacity != -1 ? capacity : 1);                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1190|  1.93k|    do {                                                                                                                           \
  |  |  |  |  |  | 1191|  3.87k|        if ((ret = ptls_buffer__do_pushv((buf), (src), (len))) != 0)                                                               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1191:13): [True: 0, False: 1.93k]
  |  |  |  |  |  |  |  Branch (1191:57): [True: 1.93k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1192|  1.93k|            goto Exit;                                                                                                             \
  |  |  |  |  |  | 1193|  1.93k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1193:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1238|  1.93k|        size_t body_start = (buf)->off;                                                                                            \
  |  |  |  | 1239|  1.93k|        do {                                                                                                                       \
  |  |  |  | 1240|  5.80k|            block                                                                                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 1.93k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1241|  1.93k|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1241:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1242|  1.93k|        size_t body_size = (buf)->off - body_start;                                                                                \
  |  |  |  | 1243|  1.93k|        if (capacity != -1) {                                                                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1243:13): [True: 1.93k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1244|  1.93k|            if (capacity < sizeof(size_t) && body_size >= (size_t)1 << (capacity * 8)) {                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1244:17): [True: 1.93k, False: 0]
  |  |  |  |  |  Branch (1244:46): [True: 0, False: 1.93k]
  |  |  |  |  ------------------
  |  |  |  | 1245|      0|                ret = PTLS_ERROR_BLOCK_OVERFLOW;                                                                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  252|      0|#define PTLS_ERROR_BLOCK_OVERFLOW (PTLS_ERROR_CLASS_INTERNAL + 12)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1246|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1247|      0|            }                                                                                                                      \
  |  |  |  | 1248|  5.80k|            for (; capacity != 0; --capacity)                                                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1248:20): [True: 3.87k, False: 1.93k]
  |  |  |  |  ------------------
  |  |  |  | 1249|  3.87k|                (buf)->base[body_start - capacity] = (uint8_t)(body_size >> (8 * (capacity - 1)));                                 \
  |  |  |  | 1250|  1.93k|        } else {                                                                                                                   \
  |  |  |  | 1251|      0|            if ((ret = ptls_buffer__adjust_quic_blocksize((buf), body_size)) != 0)                                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1251:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1252|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1253|      0|        }                                                                                                                          \
  |  |  |  | 1254|  1.93k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1254:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  740|  1.93k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (740:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 6123|       |    /* encrypt the alert if we have the encryption keys, unless when it is the early data key */
 6124|  1.93k|    if (tls->traffic_protection.enc.aead != NULL && !(tls->state <= PTLS_STATE_CLIENT_EXPECT_FINISHED)) {
  ------------------
  |  Branch (6124:9): [True: 1.07k, False: 857]
  |  Branch (6124:53): [True: 0, False: 1.07k]
  ------------------
 6125|      0|        if ((ret = buffer_encrypt_record(sendbuf, rec_start, &tls->traffic_protection.enc)) != 0)
  ------------------
  |  Branch (6125:13): [True: 0, False: 0]
  ------------------
 6126|      0|            goto Exit;
 6127|      0|    }
 6128|       |
 6129|  1.93k|Exit:
 6130|  1.93k|    return ret;
 6131|  1.93k|}
ptls_hmac_create:
 6235|  11.5k|{
 6236|  11.5k|    struct st_picotls_hmac_context_t *ctx;
 6237|       |
 6238|  11.5k|    assert(key_size <= algo->block_size);
 6239|       |
 6240|  11.5k|    if ((ctx = malloc(offsetof(struct st_picotls_hmac_context_t, key) + algo->block_size)) == NULL)
  ------------------
  |  Branch (6240:9): [True: 0, False: 11.5k]
  ------------------
 6241|      0|        return NULL;
 6242|       |
 6243|  11.5k|    *ctx = (struct st_picotls_hmac_context_t){{hmac_update, hmac_final}, algo};
 6244|  11.5k|    if ((ctx->hash = algo->create()) == NULL) {
  ------------------
  |  Branch (6244:9): [True: 0, False: 11.5k]
  ------------------
 6245|      0|        free(ctx);
 6246|      0|        return NULL;
 6247|      0|    }
 6248|  11.5k|    memset(ctx->key, 0, algo->block_size);
 6249|  11.5k|    memcpy(ctx->key, key, key_size);
 6250|       |
 6251|  11.5k|    hmac_apply_key(ctx, 0x36);
 6252|       |
 6253|  11.5k|    return &ctx->super;
 6254|  11.5k|}
ptls_hkdf_extract:
 6257|  3.44k|{
 6258|  3.44k|    ptls_hash_context_t *hash;
 6259|       |
 6260|  3.44k|    if (salt.len == 0)
  ------------------
  |  Branch (6260:9): [True: 0, False: 3.44k]
  ------------------
 6261|      0|        salt = ptls_iovec_init(zeroes_of_max_digest_size, algo->digest_size);
 6262|       |
 6263|  3.44k|    if ((hash = ptls_hmac_create(algo, salt.base, salt.len)) == NULL)
  ------------------
  |  Branch (6263:9): [True: 0, False: 3.44k]
  ------------------
 6264|      0|        return PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  241|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 6265|  3.44k|    hash->update(hash, ikm.base, ikm.len);
 6266|  3.44k|    hash->final(hash, output, PTLS_HASH_FINAL_MODE_FREE);
 6267|  3.44k|    return 0;
 6268|  3.44k|}
ptls_hkdf_expand:
 6271|  8.13k|{
 6272|  8.13k|    ptls_hash_context_t *hmac = NULL;
 6273|  8.13k|    size_t i;
 6274|  8.13k|    uint8_t digest[PTLS_MAX_DIGEST_SIZE];
 6275|       |
 6276|  16.2k|    for (i = 0; (i * algo->digest_size) < outlen; ++i) {
  ------------------
  |  Branch (6276:17): [True: 8.13k, False: 8.13k]
  ------------------
 6277|  8.13k|        if (hmac == NULL) {
  ------------------
  |  Branch (6277:13): [True: 8.13k, False: 0]
  ------------------
 6278|  8.13k|            if ((hmac = ptls_hmac_create(algo, prk.base, prk.len)) == NULL)
  ------------------
  |  Branch (6278:17): [True: 0, False: 8.13k]
  ------------------
 6279|      0|                return PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  241|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 6280|  8.13k|        } else {
 6281|      0|            hmac->update(hmac, digest, algo->digest_size);
 6282|      0|        }
 6283|  8.13k|        hmac->update(hmac, info.base, info.len);
 6284|  8.13k|        uint8_t gen = (uint8_t)(i + 1);
 6285|  8.13k|        hmac->update(hmac, &gen, 1);
 6286|  8.13k|        hmac->final(hmac, digest, 1);
 6287|       |
 6288|  8.13k|        size_t off_start = i * algo->digest_size, off_end = off_start + algo->digest_size;
 6289|  8.13k|        if (off_end > outlen)
  ------------------
  |  Branch (6289:13): [True: 4.64k, False: 3.49k]
  ------------------
 6290|  4.64k|            off_end = outlen;
 6291|  8.13k|        memcpy((uint8_t *)output + off_start, digest, off_end - off_start);
 6292|  8.13k|    }
 6293|       |
 6294|  8.13k|    if (hmac != NULL)
  ------------------
  |  Branch (6294:9): [True: 8.13k, False: 0]
  ------------------
 6295|  8.13k|        hmac->final(hmac, NULL, PTLS_HASH_FINAL_MODE_FREE);
 6296|       |
 6297|  8.13k|    ptls_clear_memory(digest, algo->digest_size);
 6298|       |
 6299|  8.13k|    return 0;
 6300|  8.13k|}
ptls_hkdf_expand_label:
 6304|  8.13k|{
 6305|  8.13k|    ptls_buffer_t hkdf_label;
 6306|  8.13k|    uint8_t hkdf_label_buf[80];
 6307|  8.13k|    int ret;
 6308|       |
 6309|  8.13k|    ptls_buffer_init(&hkdf_label, hkdf_label_buf, sizeof(hkdf_label_buf));
 6310|       |
 6311|  8.13k|    ptls_buffer_push16(&hkdf_label, (uint16_t)outlen);
  ------------------
  |  | 1202|  8.13k|    do {                                                                                                                           \
  |  | 1203|  8.13k|        uint16_t _v = (v);                                                                                                         \
  |  | 1204|  8.13k|        ptls_buffer_push(buf, (uint8_t)(_v >> 8), (uint8_t)_v);                                                                    \
  |  |  ------------------
  |  |  |  | 1196|  8.13k|    do {                                                                                                                           \
  |  |  |  | 1197|  8.13k|        if ((ret = ptls_buffer__do_pushv((buf), (uint8_t[]){__VA_ARGS__}, sizeof((uint8_t[]){__VA_ARGS__}))) != 0)                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1197:13): [True: 0, False: 8.13k]
  |  |  |  |  ------------------
  |  |  |  | 1198|  8.13k|            goto Exit;                                                                                                             \
  |  |  |  | 1199|  8.13k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1199:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1205|  8.13k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1205:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 6312|  8.13k|    ptls_buffer_push_block(&hkdf_label, 1, {
  ------------------
  |  | 1235|  8.13k|    do {                                                                                                                           \
  |  | 1236|  8.13k|        size_t capacity = (_capacity);                                                                                             \
  |  | 1237|  8.13k|        ptls_buffer_pushv((buf), (uint8_t *)"\0\0\0\0\0\0\0", capacity != -1 ? capacity : 1);                                      \
  |  |  ------------------
  |  |  |  | 1190|  8.13k|    do {                                                                                                                           \
  |  |  |  | 1191|  16.2k|        if ((ret = ptls_buffer__do_pushv((buf), (src), (len))) != 0)                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1191:13): [True: 0, False: 8.13k]
  |  |  |  |  |  Branch (1191:57): [True: 8.13k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1192|  8.13k|            goto Exit;                                                                                                             \
  |  |  |  | 1193|  8.13k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1193:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1238|  8.13k|        size_t body_start = (buf)->off;                                                                                            \
  |  | 1239|  8.13k|        do {                                                                                                                       \
  |  | 1240|  65.1k|            block                                                                                                                  \
  |  |  ------------------
  |  |  |  Branch (1240:13): [True: 8.13k, False: 0]
  |  |  |  Branch (1240:13): [True: 0, False: 8.13k]
  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  Branch (1240:13): [True: 0, False: 8.13k]
  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  ------------------
  |  | 1241|  8.13k|        } while (0);                                                                                                               \
  |  |  ------------------
  |  |  |  Branch (1241:18): [Folded - Ignored]
  |  |  ------------------
  |  | 1242|  8.13k|        size_t body_size = (buf)->off - body_start;                                                                                \
  |  | 1243|  8.13k|        if (capacity != -1) {                                                                                                      \
  |  |  ------------------
  |  |  |  Branch (1243:13): [True: 8.13k, False: 0]
  |  |  ------------------
  |  | 1244|  8.13k|            if (capacity < sizeof(size_t) && body_size >= (size_t)1 << (capacity * 8)) {                                           \
  |  |  ------------------
  |  |  |  Branch (1244:17): [True: 8.13k, False: 0]
  |  |  |  Branch (1244:46): [True: 0, False: 8.13k]
  |  |  ------------------
  |  | 1245|      0|                ret = PTLS_ERROR_BLOCK_OVERFLOW;                                                                                   \
  |  |  ------------------
  |  |  |  |  252|      0|#define PTLS_ERROR_BLOCK_OVERFLOW (PTLS_ERROR_CLASS_INTERNAL + 12)
  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1246|      0|                goto Exit;                                                                                                         \
  |  | 1247|      0|            }                                                                                                                      \
  |  | 1248|  16.2k|            for (; capacity != 0; --capacity)                                                                                      \
  |  |  ------------------
  |  |  |  Branch (1248:20): [True: 8.13k, False: 8.13k]
  |  |  ------------------
  |  | 1249|  8.13k|                (buf)->base[body_start - capacity] = (uint8_t)(body_size >> (8 * (capacity - 1)));                                 \
  |  | 1250|  8.13k|        } else {                                                                                                                   \
  |  | 1251|      0|            if ((ret = ptls_buffer__adjust_quic_blocksize((buf), body_size)) != 0)                                                 \
  |  |  ------------------
  |  |  |  Branch (1251:17): [True: 0, False: 0]
  |  |  ------------------
  |  | 1252|      0|                goto Exit;                                                                                                         \
  |  | 1253|      0|        }                                                                                                                          \
  |  | 1254|  8.13k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1254:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 6313|  8.13k|        if (label_prefix == NULL)
 6314|  8.13k|            label_prefix = PTLS_HKDF_EXPAND_LABEL_PREFIX;
 6315|  8.13k|        ptls_buffer_pushv(&hkdf_label, label_prefix, strlen(label_prefix));
 6316|  8.13k|        ptls_buffer_pushv(&hkdf_label, label, strlen(label));
 6317|  8.13k|    });
 6318|  8.13k|    ptls_buffer_push_block(&hkdf_label, 1, { ptls_buffer_pushv(&hkdf_label, hash_value.base, hash_value.len); });
  ------------------
  |  | 1235|  8.13k|    do {                                                                                                                           \
  |  | 1236|  8.13k|        size_t capacity = (_capacity);                                                                                             \
  |  | 1237|  8.13k|        ptls_buffer_pushv((buf), (uint8_t *)"\0\0\0\0\0\0\0", capacity != -1 ? capacity : 1);                                      \
  |  |  ------------------
  |  |  |  | 1190|  8.13k|    do {                                                                                                                           \
  |  |  |  | 1191|  16.2k|        if ((ret = ptls_buffer__do_pushv((buf), (src), (len))) != 0)                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1191:13): [True: 0, False: 8.13k]
  |  |  |  |  |  Branch (1191:57): [True: 8.13k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1192|  8.13k|            goto Exit;                                                                                                             \
  |  |  |  | 1193|  8.13k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1193:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1238|  8.13k|        size_t body_start = (buf)->off;                                                                                            \
  |  | 1239|  8.13k|        do {                                                                                                                       \
  |  | 1240|  24.4k|            block                                                                                                                  \
  |  |  ------------------
  |  |  |  Branch (1240:13): [True: 0, False: 8.13k]
  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  ------------------
  |  | 1241|  8.13k|        } while (0);                                                                                                               \
  |  |  ------------------
  |  |  |  Branch (1241:18): [Folded - Ignored]
  |  |  ------------------
  |  | 1242|  8.13k|        size_t body_size = (buf)->off - body_start;                                                                                \
  |  | 1243|  8.13k|        if (capacity != -1) {                                                                                                      \
  |  |  ------------------
  |  |  |  Branch (1243:13): [True: 8.13k, False: 0]
  |  |  ------------------
  |  | 1244|  8.13k|            if (capacity < sizeof(size_t) && body_size >= (size_t)1 << (capacity * 8)) {                                           \
  |  |  ------------------
  |  |  |  Branch (1244:17): [True: 8.13k, False: 0]
  |  |  |  Branch (1244:46): [True: 0, False: 8.13k]
  |  |  ------------------
  |  | 1245|      0|                ret = PTLS_ERROR_BLOCK_OVERFLOW;                                                                                   \
  |  |  ------------------
  |  |  |  |  252|      0|#define PTLS_ERROR_BLOCK_OVERFLOW (PTLS_ERROR_CLASS_INTERNAL + 12)
  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1246|      0|                goto Exit;                                                                                                         \
  |  | 1247|      0|            }                                                                                                                      \
  |  | 1248|  16.2k|            for (; capacity != 0; --capacity)                                                                                      \
  |  |  ------------------
  |  |  |  Branch (1248:20): [True: 8.13k, False: 8.13k]
  |  |  ------------------
  |  | 1249|  8.13k|                (buf)->base[body_start - capacity] = (uint8_t)(body_size >> (8 * (capacity - 1)));                                 \
  |  | 1250|  8.13k|        } else {                                                                                                                   \
  |  | 1251|      0|            if ((ret = ptls_buffer__adjust_quic_blocksize((buf), body_size)) != 0)                                                 \
  |  |  ------------------
  |  |  |  Branch (1251:17): [True: 0, False: 0]
  |  |  ------------------
  |  | 1252|      0|                goto Exit;                                                                                                         \
  |  | 1253|      0|        }                                                                                                                          \
  |  | 1254|  8.13k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1254:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 6319|       |
 6320|  8.13k|    ret = ptls_hkdf_expand(algo, output, outlen, secret, ptls_iovec_init(hkdf_label.base, hkdf_label.off));
 6321|       |
 6322|  8.13k|Exit:
 6323|  8.13k|    ptls_buffer_dispose(&hkdf_label);
 6324|  8.13k|    return ret;
 6325|  8.13k|}
ptls_aead_new:
 6408|  2.32k|{
 6409|  2.32k|    return new_aead(aead, hash, is_enc, secret, ptls_iovec_init(NULL, 0), label_prefix);
 6410|  2.32k|}
ptls_aead_new_direct:
 6413|  2.32k|{
 6414|  2.32k|    ptls_aead_context_t *ctx;
 6415|       |
 6416|  2.32k|    if ((ctx = (ptls_aead_context_t *)malloc(aead->context_size)) == NULL)
  ------------------
  |  Branch (6416:9): [True: 0, False: 2.32k]
  ------------------
 6417|      0|        return NULL;
 6418|       |
 6419|  2.32k|    *ctx = (ptls_aead_context_t){aead};
 6420|       |
 6421|  2.32k|    if (aead->setup_crypto(ctx, is_enc, key, iv) != 0) {
  ------------------
  |  Branch (6421:9): [True: 0, False: 2.32k]
  ------------------
 6422|      0|        free(ctx);
 6423|      0|        return NULL;
 6424|      0|    }
 6425|       |
 6426|  2.32k|    return ctx;
 6427|  2.32k|}
ptls_aead_free:
 6430|  2.32k|{
 6431|  2.32k|    ctx->dispose_crypto(ctx);
 6432|  2.32k|    free(ctx);
 6433|  2.32k|}
ptls_is_server:
 6496|  2.32k|{
 6497|  2.32k|    return tls->is_server;
 6498|  2.32k|}
picotls.c:ntoh16:
  501|   284k|{
  502|   284k|    return (uint16_t)src[0] << 8 | src[1];
  503|   284k|}
picotls.c:new_instance:
 5071|  2.28k|{
 5072|  2.28k|    ptls_t *tls;
 5073|       |
 5074|       |    /* check consistency of `ptls_context_t` before instantiating a connection object */
 5075|  2.28k|    assert(ctx->get_time != NULL && "please set ctx->get_time to `&ptls_get_time`; see #92");
 5076|  2.28k|    if (ctx->pre_shared_key.identity.base != NULL) {
  ------------------
  |  Branch (5076:9): [True: 0, False: 2.28k]
  ------------------
 5077|      0|        assert(ctx->pre_shared_key.identity.len != 0 && ctx->pre_shared_key.secret.base != NULL &&
 5078|      0|               ctx->pre_shared_key.secret.len != 0 && ctx->pre_shared_key.hash != NULL &&
 5079|      0|               "`ptls_context_t::pre_shared_key` in incosistent state");
 5080|  2.28k|    } else {
 5081|  2.28k|        assert(ctx->pre_shared_key.identity.len == 0 && ctx->pre_shared_key.secret.base == NULL &&
 5082|  2.28k|               ctx->pre_shared_key.secret.len == 0 && ctx->pre_shared_key.hash == NULL &&
 5083|  2.28k|               "`ptls_context_t::pre_shared_key` in inconsitent state");
 5084|  2.28k|    }
 5085|       |
 5086|  2.28k|    if ((tls = malloc(sizeof(*tls))) == NULL)
  ------------------
  |  Branch (5086:9): [True: 0, False: 2.28k]
  ------------------
 5087|      0|        return NULL;
 5088|       |
 5089|  2.28k|    update_open_count(ctx, 1);
 5090|  2.28k|    *tls = (ptls_t){ctx};
 5091|  2.28k|    tls->is_server = is_server;
 5092|  2.28k|    tls->send_change_cipher_spec = ctx->send_change_cipher_spec;
 5093|  2.28k|    tls->skip_tracing = ptls_default_skip_tracing;
  ------------------
  |  | 1878|  2.28k|#define ptls_default_skip_tracing 0
  ------------------
 5094|  2.28k|    return tls;
 5095|  2.28k|}
picotls.c:log_client_random:
 1678|  2.28k|{
 1679|       |#if PICOTLS_USE_DTRACE
 1680|       |    char buf[sizeof(tls->client_random) * 2 + 1];
 1681|       |#endif
 1682|       |
 1683|  2.28k|    PTLS_PROBE(CLIENT_RANDOM, tls, ptls_hexdump(buf, tls->client_random, sizeof(tls->client_random)));
 1684|  2.28k|    PTLS_LOG_CONN(client_random, tls, { PTLS_LOG_ELEMENT_HEXDUMP(bytes, tls->client_random, sizeof(tls->client_random)); });
  ------------------
  |  | 1384|  2.28k|    do {                                                                                                                           \
  |  | 1385|  2.28k|        ptls_t *_tls = (tls);                                                                                                      \
  |  | 1386|  2.28k|        if (!ptls_log.is_active || ptls_skip_tracing(_tls))                                                                        \
  |  |  ------------------
  |  |  |  Branch (1386:13): [True: 2.28k, False: 0]
  |  |  |  Branch (1386:36): [True: 0, False: 0]
  |  |  ------------------
  |  | 1387|  2.28k|            break;                                                                                                                 \
  |  | 1388|  2.28k|        PTLS_LOG__DO_LOG(picotls, type, {                                                                                          \
  |  |  ------------------
  |  |  |  | 1361|      0|    do {                                                                                                                           \
  |  |  |  | 1362|      0|        int ptlslog_skip = 0;                                                                                                      \
  |  |  |  | 1363|      0|        char smallbuf[128];                                                                                                        \
  |  |  |  | 1364|      0|        ptls_buffer_t ptlslogbuf;                                                                                                  \
  |  |  |  | 1365|      0|        ptls_buffer_init(&ptlslogbuf, smallbuf, sizeof(smallbuf));                                                                 \
  |  |  |  | 1366|      0|        PTLS_LOG__DO_PUSH_SAFESTR("{\"module\":\"" PTLS_TO_STR(module) "\",\"type\":\"" PTLS_TO_STR(type) "\"");                   \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1448|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1449|      0|        if (PTLS_UNLIKELY(!ptlslog_skip && !ptls_log__do_push_safestr(&ptlslogbuf, (v))))                                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   40|      0|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (40:26): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (40:46): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (40:46): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1450|      0|            ptlslog_skip = 1;                                                                                                      \
  |  |  |  |  |  | 1451|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1451:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1367|      0|        do {                                                                                                                       \
  |  |  |  | 1368|      0|            block                                                                                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1369|      0|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1369:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1370|      0|        PTLS_LOG__DO_PUSH_SAFESTR("}\n");                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1448|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1449|      0|        if (PTLS_UNLIKELY(!ptlslog_skip && !ptls_log__do_push_safestr(&ptlslogbuf, (v))))                                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   40|      0|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (40:26): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (40:46): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (40:46): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1450|      0|            ptlslog_skip = 1;                                                                                                      \
  |  |  |  |  |  | 1451|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1451:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1371|      0|        if (!ptlslog_skip)                                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1371:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1372|      0|            ptls_log__do_write(&ptlslogbuf);                                                                                       \
  |  |  |  | 1373|      0|        ptls_buffer_dispose(&ptlslogbuf);                                                                                          \
  |  |  |  | 1374|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1374:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1389|      0|            PTLS_LOG_ELEMENT_PTR(tls, _tls);                                                                                       \
  |  | 1390|      0|            do {                                                                                                                   \
  |  | 1391|      0|                block                                                                                                              \
  |  | 1392|      0|            } while (0);                                                                                                           \
  |  | 1393|      0|        });                                                                                                                        \
  |  | 1394|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1394:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1685|  2.28k|}
picotls.c:key_schedule_new:
 1246|  2.28k|{
 1247|  2.28k|#define FOREACH_HASH(block)                                                                                                        \
 1248|  2.28k|    do {                                                                                                                           \
 1249|  2.28k|        ptls_cipher_suite_t *cs;                                                                                                   \
 1250|  2.28k|        if ((cs = preferred) != NULL) {                                                                                            \
 1251|  2.28k|            block                                                                                                                  \
 1252|  2.28k|        }                                                                                                                          \
 1253|  2.28k|        if (offered != NULL) {                                                                                                     \
 1254|  2.28k|            size_t i, j;                                                                                                           \
 1255|  2.28k|            for (i = 0; (cs = offered[i]) != NULL; ++i) {                                                                          \
 1256|  2.28k|                if (preferred == NULL || cs->hash != preferred->hash) {                                                            \
 1257|  2.28k|                    for (j = 0; j != i; ++j)                                                                                       \
 1258|  2.28k|                        if (cs->hash == offered[j]->hash)                                                                          \
 1259|  2.28k|                            break;                                                                                                 \
 1260|  2.28k|                    if (j == i) {                                                                                                  \
 1261|  2.28k|                        block                                                                                                      \
 1262|  2.28k|                    }                                                                                                              \
 1263|  2.28k|                }                                                                                                                  \
 1264|  2.28k|            }                                                                                                                      \
 1265|  2.28k|        }                                                                                                                          \
 1266|  2.28k|    } while (0)
 1267|       |
 1268|  2.28k|    ptls_key_schedule_t *sched;
 1269|       |
 1270|  2.28k|    { /* allocate */
 1271|  2.28k|        size_t num_hashes = 0;
 1272|  2.28k|        FOREACH_HASH({ ++num_hashes; });
  ------------------
  |  | 1248|  2.28k|    do {                                                                                                                           \
  |  | 1249|  2.28k|        ptls_cipher_suite_t *cs;                                                                                                   \
  |  | 1250|  2.28k|        if ((cs = preferred) != NULL) {                                                                                            \
  |  |  ------------------
  |  |  |  Branch (1250:13): [True: 0, False: 2.28k]
  |  |  ------------------
  |  | 1251|      0|            block                                                                                                                  \
  |  | 1252|      0|        }                                                                                                                          \
  |  | 1253|  2.28k|        if (offered != NULL) {                                                                                                     \
  |  |  ------------------
  |  |  |  Branch (1253:13): [True: 2.28k, False: 0]
  |  |  ------------------
  |  | 1254|  2.28k|            size_t i, j;                                                                                                           \
  |  | 1255|  4.56k|            for (i = 0; (cs = offered[i]) != NULL; ++i) {                                                                          \
  |  |  ------------------
  |  |  |  Branch (1255:25): [True: 2.28k, False: 2.28k]
  |  |  ------------------
  |  | 1256|  2.28k|                if (preferred == NULL || cs->hash != preferred->hash) {                                                            \
  |  |  ------------------
  |  |  |  Branch (1256:21): [True: 2.28k, False: 0]
  |  |  |  Branch (1256:42): [True: 0, False: 0]
  |  |  ------------------
  |  | 1257|  2.28k|                    for (j = 0; j != i; ++j)                                                                                       \
  |  |  ------------------
  |  |  |  Branch (1257:33): [True: 0, False: 2.28k]
  |  |  ------------------
  |  | 1258|  2.28k|                        if (cs->hash == offered[j]->hash)                                                                          \
  |  |  ------------------
  |  |  |  Branch (1258:29): [True: 0, False: 0]
  |  |  ------------------
  |  | 1259|      0|                            break;                                                                                                 \
  |  | 1260|  2.28k|                    if (j == i) {                                                                                                  \
  |  |  ------------------
  |  |  |  Branch (1260:25): [True: 2.28k, False: 0]
  |  |  ------------------
  |  | 1261|  2.28k|                        block                                                                                                      \
  |  | 1262|  2.28k|                    }                                                                                                              \
  |  | 1263|  2.28k|                }                                                                                                                  \
  |  | 1264|  2.28k|            }                                                                                                                      \
  |  | 1265|  2.28k|        }                                                                                                                          \
  |  | 1266|  2.28k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1266:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1273|  2.28k|        if ((sched = malloc(offsetof(ptls_key_schedule_t, hashes) + sizeof(sched->hashes[0]) * num_hashes)) == NULL)
  ------------------
  |  Branch (1273:13): [True: 0, False: 2.28k]
  ------------------
 1274|      0|            return NULL;
 1275|  2.28k|        *sched = (ptls_key_schedule_t){0};
 1276|  2.28k|    }
 1277|       |
 1278|       |    /* setup the hash algos and contexts */
 1279|  2.28k|    FOREACH_HASH({
  ------------------
  |  | 1248|  2.28k|    do {                                                                                                                           \
  |  | 1249|  2.28k|        ptls_cipher_suite_t *cs;                                                                                                   \
  |  | 1250|  2.28k|        if ((cs = preferred) != NULL) {                                                                                            \
  |  |  ------------------
  |  |  |  Branch (1250:13): [True: 0, False: 2.28k]
  |  |  ------------------
  |  | 1251|      0|            block                                                                                                                  \
  |  |  ------------------
  |  |  |  Branch (1251:13): [True: 0, False: 0]
  |  |  |  Branch (1251:13): [True: 0, False: 0]
  |  |  |  Branch (1251:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1252|      0|        }                                                                                                                          \
  |  | 1253|  2.28k|        if (offered != NULL) {                                                                                                     \
  |  |  ------------------
  |  |  |  Branch (1253:13): [True: 2.28k, False: 0]
  |  |  ------------------
  |  | 1254|  2.28k|            size_t i, j;                                                                                                           \
  |  | 1255|  4.56k|            for (i = 0; (cs = offered[i]) != NULL; ++i) {                                                                          \
  |  |  ------------------
  |  |  |  Branch (1255:25): [True: 2.28k, False: 2.28k]
  |  |  ------------------
  |  | 1256|  2.28k|                if (preferred == NULL || cs->hash != preferred->hash) {                                                            \
  |  |  ------------------
  |  |  |  Branch (1256:21): [True: 2.28k, False: 0]
  |  |  |  Branch (1256:42): [True: 0, False: 0]
  |  |  ------------------
  |  | 1257|  2.28k|                    for (j = 0; j != i; ++j)                                                                                       \
  |  |  ------------------
  |  |  |  Branch (1257:33): [True: 0, False: 2.28k]
  |  |  ------------------
  |  | 1258|  2.28k|                        if (cs->hash == offered[j]->hash)                                                                          \
  |  |  ------------------
  |  |  |  Branch (1258:29): [True: 0, False: 0]
  |  |  ------------------
  |  | 1259|      0|                            break;                                                                                                 \
  |  | 1260|  2.28k|                    if (j == i) {                                                                                                  \
  |  |  ------------------
  |  |  |  Branch (1260:25): [True: 2.28k, False: 0]
  |  |  ------------------
  |  | 1261|  6.84k|                        block                                                                                                      \
  |  |  ------------------
  |  |  |  Branch (1261:25): [True: 0, False: 2.28k]
  |  |  |  Branch (1261:25): [True: 0, False: 0]
  |  |  |  Branch (1261:25): [True: 0, False: 2.28k]
  |  |  ------------------
  |  | 1262|  4.56k|                    }                                                                                                              \
  |  | 1263|  2.28k|                }                                                                                                                  \
  |  | 1264|  2.28k|            }                                                                                                                      \
  |  | 1265|  2.28k|        }                                                                                                                          \
  |  | 1266|  2.28k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1266:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1280|  2.28k|        sched->hashes[sched->num_hashes].algo = cs->hash;
 1281|  2.28k|        if ((sched->hashes[sched->num_hashes].ctx = cs->hash->create()) == NULL)
 1282|  2.28k|            goto Fail;
 1283|  2.28k|        if (use_outer) {
 1284|  2.28k|            if ((sched->hashes[sched->num_hashes].ctx_outer = cs->hash->create()) == NULL)
 1285|  2.28k|                goto Fail;
 1286|  2.28k|        } else {
 1287|  2.28k|            sched->hashes[sched->num_hashes].ctx_outer = NULL;
 1288|  2.28k|        }
 1289|  2.28k|        ++sched->num_hashes;
 1290|  2.28k|    });
 1291|       |
 1292|  2.28k|    return sched;
 1293|      0|Fail:
 1294|      0|    key_schedule_free(sched);
 1295|      0|    return NULL;
 1296|       |
 1297|  2.28k|#undef FOREACH_HASH
 1298|  2.28k|}
picotls.c:setup_traffic_protection:
 1620|  2.32k|{
 1621|  2.32k|    static const char *log_labels[2][4] = {
 1622|  2.32k|        {NULL, "CLIENT_EARLY_TRAFFIC_SECRET", "CLIENT_HANDSHAKE_TRAFFIC_SECRET", "CLIENT_TRAFFIC_SECRET_0"},
 1623|  2.32k|        {NULL, NULL, "SERVER_HANDSHAKE_TRAFFIC_SECRET", "SERVER_TRAFFIC_SECRET_0"}};
 1624|  2.32k|    struct st_ptls_traffic_protection_t *ctx = is_enc ? &tls->traffic_protection.enc : &tls->traffic_protection.dec;
  ------------------
  |  Branch (1624:48): [True: 1.16k, False: 1.16k]
  ------------------
 1625|       |
 1626|  2.32k|    if (secret_label != NULL) {
  ------------------
  |  Branch (1626:9): [True: 2.32k, False: 0]
  ------------------
 1627|  2.32k|        int ret;
 1628|  2.32k|        if ((ret = derive_secret(tls->key_schedule, ctx->secret, secret_label)) != 0)
  ------------------
  |  Branch (1628:13): [True: 0, False: 2.32k]
  ------------------
 1629|      0|            return ret;
 1630|  2.32k|    }
 1631|       |
 1632|  2.32k|    ctx->epoch = epoch;
 1633|       |
 1634|  2.32k|    log_secret(tls, log_labels[ptls_is_server(tls) == is_enc][epoch],
 1635|  2.32k|               ptls_iovec_init(ctx->secret, tls->key_schedule->hashes[0].algo->digest_size));
 1636|       |
 1637|       |    /* special path for applications having their own record layer */
 1638|  2.32k|    if (tls->ctx->update_traffic_key != NULL) {
  ------------------
  |  Branch (1638:9): [True: 0, False: 2.32k]
  ------------------
 1639|      0|        if (skip_notify)
  ------------------
  |  Branch (1639:13): [True: 0, False: 0]
  ------------------
 1640|      0|            return 0;
 1641|      0|        return tls->ctx->update_traffic_key->cb(tls->ctx->update_traffic_key, tls, is_enc, epoch, ctx->secret);
 1642|      0|    }
 1643|       |
 1644|  2.32k|    if (ctx->aead != NULL)
  ------------------
  |  Branch (1644:9): [True: 0, False: 2.32k]
  ------------------
 1645|      0|        ptls_aead_free(ctx->aead);
 1646|  2.32k|    if ((ctx->aead = ptls_aead_new(tls->cipher_suite->aead, tls->cipher_suite->hash, is_enc, ctx->secret,
  ------------------
  |  Branch (1646:9): [True: 0, False: 2.32k]
  ------------------
 1647|  2.32k|                                   tls->ctx->hkdf_label_prefix__obsolete)) == NULL)
 1648|      0|        return PTLS_ERROR_NO_MEMORY; /* TODO obtain error from ptls_aead_new */
  ------------------
  |  |  241|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 1649|  2.32k|    ctx->seq = seq;
 1650|       |
 1651|       |#if defined(PTLS_DEBUG) && PTLS_DEBUG
 1652|       |    {
 1653|       |        uint8_t static_iv[PTLS_MAX_IV_SIZE];
 1654|       |        ptls_aead_get_iv(ctx->aead, static_iv);
 1655|       |        PTLS_DEBUGF("[%s] %02x%02x,%02x%02x\n", log_labels[ptls_is_server(tls)][epoch], (unsigned)ctx->secret[0],
 1656|       |                    (unsigned)ctx->secret[1], static_iv[0], static_iv[1]);
 1657|       |    }
 1658|       |#endif
 1659|       |
 1660|  2.32k|    return 0;
 1661|  2.32k|}
picotls.c:derive_secret:
 1428|  2.32k|{
 1429|  2.32k|    uint8_t hash_value[PTLS_MAX_DIGEST_SIZE];
 1430|       |
 1431|  2.32k|    sched->hashes[0].ctx->final(sched->hashes[0].ctx, hash_value, PTLS_HASH_FINAL_MODE_SNAPSHOT);
 1432|  2.32k|    int ret = derive_secret_with_hash(sched, secret, label, hash_value);
 1433|  2.32k|    ptls_clear_memory(hash_value, sizeof(hash_value));
 1434|  2.32k|    return ret;
 1435|  2.32k|}
picotls.c:derive_secret_with_hash:
 1418|  2.32k|{
 1419|  2.32k|    int ret = ptls_hkdf_expand_label(sched->hashes[0].algo, secret, sched->hashes[0].algo->digest_size,
 1420|  2.32k|                                     ptls_iovec_init(sched->secret, sched->hashes[0].algo->digest_size), label,
 1421|  2.32k|                                     ptls_iovec_init(hash, sched->hashes[0].algo->digest_size), NULL);
 1422|  2.32k|    PTLS_DEBUGF("%s: (label=%s, hash=%02x%02x) => %02x%02x\n", __FUNCTION__, label, hash[0], hash[1], ((uint8_t *)secret)[0],
 1423|  2.32k|                ((uint8_t *)secret)[1]);
 1424|  2.32k|    return ret;
 1425|  2.32k|}
picotls.c:log_secret:
  956|  2.32k|{
  957|  2.32k|    char hexbuf[PTLS_MAX_DIGEST_SIZE * 2 + 1];
  958|       |
  959|  2.32k|    PTLS_PROBE(NEW_SECRET, tls, type, ptls_hexdump(hexbuf, secret.base, secret.len));
  960|  2.32k|    PTLS_LOG_CONN(new_secret, tls, { PTLS_LOG_ELEMENT_SAFESTR(label, type); });
  ------------------
  |  | 1384|  2.32k|    do {                                                                                                                           \
  |  | 1385|  2.32k|        ptls_t *_tls = (tls);                                                                                                      \
  |  | 1386|  2.32k|        if (!ptls_log.is_active || ptls_skip_tracing(_tls))                                                                        \
  |  |  ------------------
  |  |  |  Branch (1386:13): [True: 2.32k, False: 0]
  |  |  |  Branch (1386:36): [True: 0, False: 0]
  |  |  ------------------
  |  | 1387|  2.32k|            break;                                                                                                                 \
  |  | 1388|  2.32k|        PTLS_LOG__DO_LOG(picotls, type, {                                                                                          \
  |  |  ------------------
  |  |  |  | 1361|      0|    do {                                                                                                                           \
  |  |  |  | 1362|      0|        int ptlslog_skip = 0;                                                                                                      \
  |  |  |  | 1363|      0|        char smallbuf[128];                                                                                                        \
  |  |  |  | 1364|      0|        ptls_buffer_t ptlslogbuf;                                                                                                  \
  |  |  |  | 1365|      0|        ptls_buffer_init(&ptlslogbuf, smallbuf, sizeof(smallbuf));                                                                 \
  |  |  |  | 1366|      0|        PTLS_LOG__DO_PUSH_SAFESTR("{\"module\":\"" PTLS_TO_STR(module) "\",\"type\":\"" PTLS_TO_STR(type) "\"");                   \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1448|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1449|      0|        if (PTLS_UNLIKELY(!ptlslog_skip && !ptls_log__do_push_safestr(&ptlslogbuf, (v))))                                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   40|      0|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (40:26): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (40:46): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (40:46): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1450|      0|            ptlslog_skip = 1;                                                                                                      \
  |  |  |  |  |  | 1451|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1451:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1367|      0|        do {                                                                                                                       \
  |  |  |  | 1368|      0|            block                                                                                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1369|      0|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1369:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1370|      0|        PTLS_LOG__DO_PUSH_SAFESTR("}\n");                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1448|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1449|      0|        if (PTLS_UNLIKELY(!ptlslog_skip && !ptls_log__do_push_safestr(&ptlslogbuf, (v))))                                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   40|      0|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (40:26): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (40:46): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (40:46): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1450|      0|            ptlslog_skip = 1;                                                                                                      \
  |  |  |  |  |  | 1451|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1451:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1371|      0|        if (!ptlslog_skip)                                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1371:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1372|      0|            ptls_log__do_write(&ptlslogbuf);                                                                                       \
  |  |  |  | 1373|      0|        ptls_buffer_dispose(&ptlslogbuf);                                                                                          \
  |  |  |  | 1374|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1374:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1389|      0|            PTLS_LOG_ELEMENT_PTR(tls, _tls);                                                                                       \
  |  | 1390|      0|            do {                                                                                                                   \
  |  | 1391|      0|                block                                                                                                              \
  |  | 1392|      0|            } while (0);                                                                                                           \
  |  | 1393|      0|        });                                                                                                                        \
  |  | 1394|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1394:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  961|       |
  962|  2.32k|    if (tls->ctx->log_event != NULL)
  ------------------
  |  Branch (962:9): [True: 0, False: 2.32k]
  ------------------
  963|      0|        tls->ctx->log_event->cb(tls->ctx->log_event, tls, type, "%s", ptls_hexdump(hexbuf, secret.base, secret.len));
  964|  2.32k|}
picotls.c:free_exporter_master_secret:
 1464|  4.56k|{
 1465|  4.56k|    uint8_t *slot = is_early ? tls->exporter_master_secret.early : tls->exporter_master_secret.one_rtt;
  ------------------
  |  Branch (1465:21): [True: 2.28k, False: 2.28k]
  ------------------
 1466|  4.56k|    if (slot == NULL)
  ------------------
  |  Branch (1466:9): [True: 4.56k, False: 0]
  ------------------
 1467|  4.56k|        return;
 1468|      0|    assert(tls->key_schedule != NULL);
 1469|      0|    ptls_clear_memory(slot, tls->key_schedule->hashes[0].algo->digest_size);
 1470|      0|    free(slot);
 1471|      0|}
picotls.c:key_schedule_free:
 1234|  2.28k|{
 1235|  2.28k|    size_t i;
 1236|  2.28k|    ptls_clear_memory(sched->secret, sizeof(sched->secret));
 1237|  4.56k|    for (i = 0; i != sched->num_hashes; ++i) {
  ------------------
  |  Branch (1237:17): [True: 2.28k, False: 2.28k]
  ------------------
 1238|  2.28k|        sched->hashes[i].ctx->final(sched->hashes[i].ctx, NULL, PTLS_HASH_FINAL_MODE_FREE);
 1239|  2.28k|        if (sched->hashes[i].ctx_outer != NULL)
  ------------------
  |  Branch (1239:13): [True: 0, False: 2.28k]
  ------------------
 1240|      0|            sched->hashes[i].ctx_outer->final(sched->hashes[i].ctx_outer, NULL, PTLS_HASH_FINAL_MODE_FREE);
 1241|  2.28k|    }
 1242|  2.28k|    free(sched);
 1243|  2.28k|}
picotls.c:clear_ech:
  970|  3.44k|{
  971|  3.44k|    if (ech->aead != NULL) {
  ------------------
  |  Branch (971:9): [True: 0, False: 3.44k]
  ------------------
  972|      0|        ptls_aead_free(ech->aead);
  973|      0|        ech->aead = NULL;
  974|      0|    }
  975|  3.44k|    ptls_clear_memory(ech->inner_client_random, PTLS_HELLO_RANDOM_SIZE);
  ------------------
  |  |   74|  3.44k|#define PTLS_HELLO_RANDOM_SIZE 32
  ------------------
  976|  3.44k|    if (!is_server) {
  ------------------
  |  Branch (976:9): [True: 3.44k, False: 0]
  ------------------
  977|  3.44k|        free(ech->client.enc.base);
  978|  3.44k|        ech->client.enc = ptls_iovec_init(NULL, 0);
  979|  3.44k|        if (ech->client.public_name != NULL) {
  ------------------
  |  Branch (979:13): [True: 0, False: 3.44k]
  ------------------
  980|      0|            free(ech->client.public_name);
  981|      0|            ech->client.public_name = NULL;
  982|      0|        }
  983|  3.44k|        free(ech->client.first_ech.base);
  984|  3.44k|        ech->client.first_ech = ptls_iovec_init(NULL, 0);
  985|  3.44k|    }
  986|  3.44k|}
picotls.c:update_open_count:
 5065|  4.56k|{
 5066|  4.56k|    if (ctx->update_open_count != NULL)
  ------------------
  |  Branch (5066:9): [True: 0, False: 4.56k]
  ------------------
 5067|      0|        ctx->update_open_count->cb(ctx->update_open_count, delta);
 5068|  4.56k|}
picotls.c:get_traffic_keys:
 1607|  2.32k|{
 1608|  2.32k|    int ret;
 1609|       |
 1610|  2.32k|    if ((ret = get_traffic_key(hash, key, aead->key_size, 0, secret, hash_value, label_prefix)) != 0 ||
  ------------------
  |  Branch (1610:9): [True: 0, False: 2.32k]
  ------------------
 1611|  2.32k|        (ret = get_traffic_key(hash, iv, aead->iv_size, 1, secret, hash_value, label_prefix)) != 0) {
  ------------------
  |  Branch (1611:9): [True: 0, False: 2.32k]
  ------------------
 1612|      0|        ptls_clear_memory(key, aead->key_size);
 1613|      0|        ptls_clear_memory(iv, aead->iv_size);
 1614|      0|    }
 1615|       |
 1616|  2.32k|    return ret;
 1617|  2.32k|}
picotls.c:get_traffic_key:
 1600|  4.64k|{
 1601|  4.64k|    return ptls_hkdf_expand_label(algo, key, key_size, ptls_iovec_init(secret, algo->digest_size), is_iv ? "iv" : "key", hash_value,
  ------------------
  |  Branch (1601:100): [True: 2.32k, False: 2.32k]
  ------------------
 1602|  4.64k|                                  label_prefix);
 1603|  4.64k|}
picotls.c:duplicate_as_str:
  535|     28|{
  536|     28|    char *dst;
  537|       |
  538|     28|    if ((dst = malloc(len + 1)) == NULL)
  ------------------
  |  Branch (538:9): [True: 0, False: 28]
  ------------------
  539|      0|        return NULL;
  540|     28|    memcpy(dst, src, len);
  541|     28|    dst[len] = '\0';
  542|     28|    return dst;
  543|     28|}
picotls.c:init_record_message_emitter:
 5947|  4.56k|{
 5948|  4.56k|    *emitter = (struct st_ptls_record_message_emitter_t){
 5949|  4.56k|        {sendbuf, &tls->traffic_protection.enc, 5, begin_record_message, commit_record_message}};
 5950|  4.56k|}
picotls.c:begin_record_message:
  833|  40.0k|{
  834|  40.0k|    struct st_ptls_record_message_emitter_t *self = (void *)_self;
  835|  40.0k|    int ret;
  836|       |
  837|  40.0k|    self->rec_start = self->super.buf->off;
  838|  40.0k|    ptls_buffer_push(self->super.buf, PTLS_CONTENT_TYPE_HANDSHAKE, PTLS_RECORD_VERSION_MAJOR, PTLS_RECORD_VERSION_MINOR, 0, 0);
  ------------------
  |  | 1196|  40.0k|    do {                                                                                                                           \
  |  | 1197|  40.0k|        if ((ret = ptls_buffer__do_pushv((buf), (uint8_t[]){__VA_ARGS__}, sizeof((uint8_t[]){__VA_ARGS__}))) != 0)                 \
  |  |  ------------------
  |  |  |  Branch (1197:13): [True: 0, False: 40.0k]
  |  |  ------------------
  |  | 1198|  40.0k|            goto Exit;                                                                                                             \
  |  | 1199|  40.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1199:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  839|  40.0k|    ret = 0;
  840|  40.0k|Exit:
  841|  40.0k|    return ret;
  842|  40.0k|}
picotls.c:commit_record_message:
  845|  40.0k|{
  846|  40.0k|    struct st_ptls_record_message_emitter_t *self = (void *)_self;
  847|  40.0k|    int ret;
  848|       |
  849|  40.0k|    if (self->super.enc->aead != NULL) {
  ------------------
  |  Branch (849:9): [True: 0, False: 40.0k]
  ------------------
  850|      0|        ret = buffer_encrypt_record(self->super.buf, self->rec_start, self->super.enc);
  851|  40.0k|    } else {
  852|       |        /* TODO allow CH,SH,HRR above 16KB */
  853|  40.0k|        size_t sz = self->super.buf->off - self->rec_start - 5;
  854|  40.0k|        assert(sz <= PTLS_MAX_PLAINTEXT_RECORD_SIZE);
  855|  40.0k|        self->super.buf->base[self->rec_start + 3] = (uint8_t)(sz >> 8);
  856|  40.0k|        self->super.buf->base[self->rec_start + 4] = (uint8_t)(sz);
  857|  40.0k|        ret = 0;
  858|  40.0k|    }
  859|       |
  860|  40.0k|    return ret;
  861|  40.0k|}
picotls.c:send_client_hello:
 2317|  40.0k|{
 2318|  40.0k|    struct {
 2319|  40.0k|        ptls_iovec_t secret;
 2320|  40.0k|        ptls_iovec_t identity;
 2321|  40.0k|        const char *label;
 2322|  40.0k|    } psk = {{NULL}};
 2323|  40.0k|    uint32_t obfuscated_ticket_age = 0;
 2324|  40.0k|    const char *sni_name = NULL;
 2325|  40.0k|    size_t mess_start, msghash_off;
 2326|  40.0k|    uint8_t binder_key[PTLS_MAX_DIGEST_SIZE];
 2327|  40.0k|    ptls_buffer_t encoded_ch_inner;
 2328|  40.0k|    int ret, is_second_flight = tls->key_schedule != NULL;
 2329|       |
 2330|  40.0k|    ptls_buffer_init(&encoded_ch_inner, "", 0);
 2331|       |
 2332|  40.0k|    if (tls->server_name != NULL && !ptls_server_name_is_ipaddr(tls->server_name))
  ------------------
  |  Branch (2332:9): [True: 0, False: 40.0k]
  |  Branch (2332:37): [True: 0, False: 0]
  ------------------
 2333|      0|        sni_name = tls->server_name;
 2334|       |
 2335|       |    /* try to use ECH (ignore broken ECHConfigList; it is delivered insecurely) */
 2336|  40.0k|    if (properties != NULL) {
  ------------------
  |  Branch (2336:9): [True: 40.0k, False: 0]
  ------------------
 2337|  40.0k|        if (!is_second_flight && sni_name != NULL && tls->ctx->ech.client.ciphers != NULL) {
  ------------------
  |  Branch (2337:13): [True: 2.28k, False: 37.7k]
  |  Branch (2337:34): [True: 0, False: 2.28k]
  |  Branch (2337:54): [True: 0, False: 0]
  ------------------
 2338|      0|            if (properties->client.ech.configs.len != 0) {
  ------------------
  |  Branch (2338:17): [True: 0, False: 0]
  ------------------
 2339|      0|                struct st_decoded_ech_config_t decoded;
 2340|      0|                client_decode_ech_config_list(tls->ctx, &decoded, properties->client.ech.configs);
 2341|      0|                if (decoded.kem != NULL && decoded.cipher != NULL) {
  ------------------
  |  Branch (2341:21): [True: 0, False: 0]
  |  Branch (2341:44): [True: 0, False: 0]
  ------------------
 2342|      0|                    if ((ret = client_setup_ech(&tls->ech, &decoded, tls->ctx->random_bytes)) != 0)
  ------------------
  |  Branch (2342:25): [True: 0, False: 0]
  ------------------
 2343|      0|                        goto Exit;
 2344|      0|                }
 2345|      0|            } else {
 2346|       |                /* zero-length config indicates ECH greasing */
 2347|      0|                client_setup_ech_grease(&tls->ech, tls->ctx->random_bytes, tls->ctx->ech.client.kems, tls->ctx->ech.client.ciphers,
 2348|      0|                                        sni_name);
 2349|      0|            }
 2350|      0|        }
 2351|  40.0k|    }
 2352|       |
 2353|       |    /* use external PSK if provided */
 2354|  40.0k|    if (tls->ctx->pre_shared_key.identity.base != NULL) {
  ------------------
  |  Branch (2354:9): [True: 0, False: 40.0k]
  ------------------
 2355|      0|        if (!is_second_flight) {
  ------------------
  |  Branch (2355:13): [True: 0, False: 0]
  ------------------
 2356|      0|            tls->client.offered_psk = 1;
 2357|      0|            for (size_t i = 0; tls->ctx->cipher_suites[i] != NULL; ++i) {
  ------------------
  |  Branch (2357:32): [True: 0, False: 0]
  ------------------
 2358|      0|                if (tls->ctx->cipher_suites[i]->hash == tls->ctx->pre_shared_key.hash) {
  ------------------
  |  Branch (2358:21): [True: 0, False: 0]
  ------------------
 2359|      0|                    tls->cipher_suite = tls->ctx->cipher_suites[i];
 2360|      0|                    break;
 2361|      0|                }
 2362|      0|            }
 2363|      0|            assert(tls->cipher_suite != NULL && "no compatible cipher-suite provided that matches psk.hash");
 2364|      0|            if (properties->client.max_early_data_size != NULL) {
  ------------------
  |  Branch (2364:17): [True: 0, False: 0]
  ------------------
 2365|      0|                tls->client.using_early_data = 1;
 2366|      0|                *properties->client.max_early_data_size = SIZE_MAX;
 2367|      0|            }
 2368|      0|        } else {
 2369|      0|            assert(tls->cipher_suite != NULL && tls->cipher_suite->hash == tls->ctx->pre_shared_key.hash);
 2370|      0|        }
 2371|      0|        psk.secret = tls->ctx->pre_shared_key.secret;
 2372|      0|        psk.identity = tls->ctx->pre_shared_key.identity;
 2373|      0|        psk.label = "ext binder";
 2374|      0|    }
 2375|       |
 2376|       |    /* try to setup resumption-related data, unless external PSK is used */
 2377|  40.0k|    if (psk.secret.base == NULL && properties != NULL && properties->client.session_ticket.base != NULL &&
  ------------------
  |  Branch (2377:9): [True: 40.0k, False: 0]
  |  Branch (2377:36): [True: 40.0k, False: 0]
  |  Branch (2377:58): [True: 0, False: 40.0k]
  ------------------
 2378|  40.0k|        tls->ctx->key_exchanges != NULL) {
  ------------------
  |  Branch (2378:9): [True: 0, False: 0]
  ------------------
 2379|      0|        ptls_key_exchange_algorithm_t *key_share = NULL;
 2380|      0|        ptls_cipher_suite_t *cipher_suite = NULL;
 2381|      0|        uint32_t max_early_data_size;
 2382|      0|        if (decode_stored_session_ticket(tls, &key_share, &cipher_suite, &psk.secret, &obfuscated_ticket_age, &psk.identity,
  ------------------
  |  Branch (2382:13): [True: 0, False: 0]
  ------------------
 2383|      0|                                         &max_early_data_size, properties->client.session_ticket.base,
 2384|      0|                                         properties->client.session_ticket.base + properties->client.session_ticket.len) == 0) {
 2385|      0|            psk.label = "res binder";
 2386|      0|            tls->client.offered_psk = 1;
 2387|       |            /* key-share selected by HRR should not be overridden */
 2388|      0|            if (tls->key_share == NULL)
  ------------------
  |  Branch (2388:17): [True: 0, False: 0]
  ------------------
 2389|      0|                tls->key_share = key_share;
 2390|      0|            tls->cipher_suite = cipher_suite;
 2391|      0|            if (!is_second_flight && max_early_data_size != 0 && properties->client.max_early_data_size != NULL) {
  ------------------
  |  Branch (2391:17): [True: 0, False: 0]
  |  Branch (2391:38): [True: 0, False: 0]
  |  Branch (2391:66): [True: 0, False: 0]
  ------------------
 2392|      0|                tls->client.using_early_data = 1;
 2393|      0|                *properties->client.max_early_data_size = max_early_data_size;
 2394|      0|            }
 2395|      0|        } else {
 2396|      0|            psk.secret = ptls_iovec_init(NULL, 0);
 2397|      0|        }
 2398|      0|    }
 2399|       |
 2400|       |    /* send 0-RTT related signals back to the client */
 2401|  40.0k|    if (properties != NULL) {
  ------------------
  |  Branch (2401:9): [True: 40.0k, False: 0]
  ------------------
 2402|  40.0k|        if (tls->client.using_early_data) {
  ------------------
  |  Branch (2402:13): [True: 0, False: 40.0k]
  ------------------
 2403|      0|            properties->client.early_data_acceptance = PTLS_EARLY_DATA_ACCEPTANCE_UNKNOWN;
 2404|  40.0k|        } else {
 2405|  40.0k|            if (properties->client.max_early_data_size != NULL)
  ------------------
  |  Branch (2405:17): [True: 0, False: 40.0k]
  ------------------
 2406|      0|                *properties->client.max_early_data_size = 0;
 2407|  40.0k|            properties->client.early_data_acceptance = PTLS_EARLY_DATA_REJECTED;
 2408|  40.0k|        }
 2409|  40.0k|    }
 2410|       |
 2411|       |    /* use the default key share if still not undetermined */
 2412|  40.0k|    if (tls->key_share == NULL && tls->ctx->key_exchanges != NULL &&
  ------------------
  |  Branch (2412:9): [True: 2.28k, False: 37.7k]
  |  Branch (2412:35): [True: 2.28k, False: 0]
  ------------------
 2413|  40.0k|        !(properties != NULL && properties->client.negotiate_before_key_exchange))
  ------------------
  |  Branch (2413:11): [True: 2.28k, False: 0]
  |  Branch (2413:33): [True: 0, False: 2.28k]
  ------------------
 2414|  2.28k|        tls->key_share = tls->ctx->key_exchanges[0];
 2415|       |
 2416|       |    /* instantiate key share context */
 2417|  40.0k|    assert(tls->client.key_share_ctx == NULL);
 2418|  40.0k|    if (tls->key_share != NULL) {
  ------------------
  |  Branch (2418:9): [True: 40.0k, False: 0]
  ------------------
 2419|  40.0k|        if ((ret = tls->key_share->create(tls->key_share, &tls->client.key_share_ctx)) != 0)
  ------------------
  |  Branch (2419:13): [True: 0, False: 40.0k]
  ------------------
 2420|      0|            goto Exit;
 2421|  40.0k|    }
 2422|       |
 2423|       |    /* initialize key schedule */
 2424|  40.0k|    if (!is_second_flight) {
  ------------------
  |  Branch (2424:9): [True: 2.28k, False: 37.7k]
  ------------------
 2425|  2.28k|        if ((tls->key_schedule = key_schedule_new(tls->cipher_suite, tls->ctx->cipher_suites, tls->ech.aead != NULL)) == NULL) {
  ------------------
  |  Branch (2425:13): [True: 0, False: 2.28k]
  ------------------
 2426|      0|            ret = PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  241|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 2427|      0|            goto Exit;
 2428|      0|        }
 2429|  2.28k|        if ((ret = key_schedule_extract(tls->key_schedule, psk.secret)) != 0)
  ------------------
  |  Branch (2429:13): [True: 0, False: 2.28k]
  ------------------
 2430|      0|            goto Exit;
 2431|  2.28k|    }
 2432|       |
 2433|       |    /* start generating CH */
 2434|  40.0k|    if ((ret = emitter->begin_message(emitter)) != 0)
  ------------------
  |  Branch (2434:9): [True: 0, False: 40.0k]
  ------------------
 2435|      0|        goto Exit;
 2436|  40.0k|    mess_start = msghash_off = emitter->buf->off;
 2437|       |
 2438|       |    /* generate true (inner) CH */
 2439|  40.0k|    if ((ret = encode_client_hello(tls->ctx, emitter->buf, ENCODE_CH_MODE_INNER, is_second_flight, properties,
  ------------------
  |  Branch (2439:9): [True: 0, False: 40.0k]
  ------------------
 2440|  40.0k|                                   tls->ech.aead != NULL ? tls->ech.inner_client_random : tls->client_random,
  ------------------
  |  Branch (2440:36): [True: 0, False: 40.0k]
  ------------------
 2441|  40.0k|                                   tls->client.key_share_ctx, sni_name, tls->client.legacy_session_id, &tls->ech, NULL,
 2442|  40.0k|                                   tls->ech.client.first_ech, psk.secret, psk.identity, obfuscated_ticket_age,
 2443|  40.0k|                                   tls->key_schedule->hashes[0].algo->digest_size, cookie, tls->client.using_early_data)) != 0)
 2444|      0|        goto Exit;
 2445|       |
 2446|       |    /* update the message hash, filling in the PSK binder HMAC if necessary */
 2447|  40.0k|    if (psk.secret.base != NULL) {
  ------------------
  |  Branch (2447:9): [True: 0, False: 40.0k]
  ------------------
 2448|      0|        size_t psk_binder_off = emitter->buf->off - (3 + tls->key_schedule->hashes[0].algo->digest_size);
 2449|      0|        if ((ret = derive_secret_with_empty_digest(tls->key_schedule, binder_key, psk.label)) != 0)
  ------------------
  |  Branch (2449:13): [True: 0, False: 0]
  ------------------
 2450|      0|            goto Exit;
 2451|      0|        ptls__key_schedule_update_hash(tls->key_schedule, emitter->buf->base + msghash_off, psk_binder_off - msghash_off, 0);
 2452|      0|        msghash_off = psk_binder_off;
 2453|      0|        if ((ret = calc_verify_data(emitter->buf->base + psk_binder_off + 3, tls->key_schedule, binder_key)) != 0)
  ------------------
  |  Branch (2453:13): [True: 0, False: 0]
  ------------------
 2454|      0|            goto Exit;
 2455|      0|    }
 2456|  40.0k|    ptls__key_schedule_update_hash(tls->key_schedule, emitter->buf->base + msghash_off, emitter->buf->off - msghash_off, 0);
 2457|       |
 2458|       |    /* ECH */
 2459|  40.0k|    if (tls->ech.aead != NULL) {
  ------------------
  |  Branch (2459:9): [True: 0, False: 40.0k]
  ------------------
 2460|       |        /* build EncodedCHInner */
 2461|      0|        if ((ret = encode_client_hello(tls->ctx, &encoded_ch_inner, ENCODE_CH_MODE_ENCODED_INNER, is_second_flight, properties,
  ------------------
  |  Branch (2461:13): [True: 0, False: 0]
  ------------------
 2462|      0|                                       tls->ech.inner_client_random, tls->client.key_share_ctx, sni_name,
 2463|      0|                                       tls->client.legacy_session_id, &tls->ech, NULL, ptls_iovec_init(NULL, 0), psk.secret,
 2464|      0|                                       psk.identity, obfuscated_ticket_age, tls->key_schedule->hashes[0].algo->digest_size, cookie,
 2465|      0|                                       tls->client.using_early_data)) != 0)
 2466|      0|            goto Exit;
 2467|      0|        if (psk.secret.base != NULL)
  ------------------
  |  Branch (2467:13): [True: 0, False: 0]
  ------------------
 2468|      0|            memcpy(encoded_ch_inner.base + encoded_ch_inner.off - tls->key_schedule->hashes[0].algo->digest_size,
 2469|      0|                   emitter->buf->base + emitter->buf->off - tls->key_schedule->hashes[0].algo->digest_size,
 2470|      0|                   tls->key_schedule->hashes[0].algo->digest_size);
 2471|      0|        { /* pad EncodedCHInner (following draft-ietf-tls-esni-15 6.1.3) */
 2472|      0|            size_t padding_len;
 2473|      0|            if (sni_name != NULL) {
  ------------------
  |  Branch (2473:17): [True: 0, False: 0]
  ------------------
 2474|      0|                padding_len = strlen(sni_name);
 2475|      0|                if (padding_len < tls->ech.client.max_name_length)
  ------------------
  |  Branch (2475:21): [True: 0, False: 0]
  ------------------
 2476|      0|                    padding_len = tls->ech.client.max_name_length;
 2477|      0|            } else {
 2478|      0|                padding_len = tls->ech.client.max_name_length + 9;
 2479|      0|            }
 2480|      0|            size_t final_len = encoded_ch_inner.off - PTLS_HANDSHAKE_HEADER_SIZE + padding_len;
  ------------------
  |  |   56|      0|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
 2481|      0|            final_len = (final_len + 31) / 32 * 32;
 2482|      0|            padding_len = final_len - (encoded_ch_inner.off - PTLS_HANDSHAKE_HEADER_SIZE);
  ------------------
  |  |   56|      0|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
 2483|      0|            if (padding_len != 0) {
  ------------------
  |  Branch (2483:17): [True: 0, False: 0]
  ------------------
 2484|      0|                if ((ret = ptls_buffer_reserve(&encoded_ch_inner, padding_len)) != 0)
  ------------------
  |  Branch (2484:21): [True: 0, False: 0]
  ------------------
 2485|      0|                    goto Exit;
 2486|      0|                memset(encoded_ch_inner.base + encoded_ch_inner.off, 0, padding_len);
 2487|      0|                encoded_ch_inner.off += padding_len;
 2488|      0|            }
 2489|      0|        }
 2490|       |        /* flush CHInner, build CHOuterAAD */
 2491|      0|        emitter->buf->off = mess_start;
 2492|      0|        size_t ech_payload_size = encoded_ch_inner.off - PTLS_HANDSHAKE_HEADER_SIZE + tls->ech.aead->algo->tag_size,
  ------------------
  |  |   56|      0|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
 2493|      0|               ech_size_offset = ech_payload_size;
 2494|      0|        if ((ret = encode_client_hello(tls->ctx, emitter->buf, ENCODE_CH_MODE_OUTER, is_second_flight, properties,
  ------------------
  |  Branch (2494:13): [True: 0, False: 0]
  ------------------
 2495|      0|                                       tls->client_random, tls->client.key_share_ctx, tls->ech.client.public_name,
 2496|      0|                                       tls->client.legacy_session_id, &tls->ech, &ech_size_offset, ptls_iovec_init(NULL, 0),
 2497|      0|                                       psk.secret, psk.identity, obfuscated_ticket_age,
 2498|      0|                                       tls->key_schedule->hashes[0].algo->digest_size, cookie, tls->client.using_early_data)) != 0)
 2499|      0|            goto Exit;
 2500|       |        /* overwrite ECH payload */
 2501|      0|        ptls_aead_encrypt(tls->ech.aead, emitter->buf->base + ech_size_offset, encoded_ch_inner.base + PTLS_HANDSHAKE_HEADER_SIZE,
  ------------------
  |  |   56|      0|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
 2502|      0|                          encoded_ch_inner.off - PTLS_HANDSHAKE_HEADER_SIZE, is_second_flight,
  ------------------
  |  |   56|      0|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
 2503|      0|                          emitter->buf->base + mess_start + PTLS_HANDSHAKE_HEADER_SIZE,
  ------------------
  |  |   56|      0|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
 2504|      0|                          emitter->buf->off - (mess_start + PTLS_HANDSHAKE_HEADER_SIZE));
  ------------------
  |  |   56|      0|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
 2505|       |        /* keep the copy of the 1st ECH extension so that we can send it again in 2nd CH in response to rejection with HRR */
 2506|      0|        if (!is_second_flight) {
  ------------------
  |  Branch (2506:13): [True: 0, False: 0]
  ------------------
 2507|      0|            size_t len = outer_ech_header_size(tls->ech.client.enc.len) + ech_payload_size;
 2508|      0|            if ((tls->ech.client.first_ech.base = malloc(len)) == NULL) {
  ------------------
  |  Branch (2508:17): [True: 0, False: 0]
  ------------------
 2509|      0|                ret = PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  241|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 2510|      0|                goto Exit;
 2511|      0|            }
 2512|      0|            memcpy(tls->ech.client.first_ech.base,
 2513|      0|                   emitter->buf->base + ech_size_offset - outer_ech_header_size(tls->ech.client.enc.len), len);
 2514|      0|            tls->ech.client.first_ech.len = len;
 2515|      0|            if (properties->client.ech.configs.len != 0) {
  ------------------
  |  Branch (2515:17): [True: 0, False: 0]
  ------------------
 2516|      0|                tls->ech.offered = 1;
 2517|      0|            } else {
 2518|      0|                tls->ech.offered_grease = 1;
 2519|      0|            }
 2520|      0|        }
 2521|       |        /* update hash */
 2522|      0|        ptls__key_schedule_update_hash(tls->key_schedule, emitter->buf->base + mess_start, emitter->buf->off - mess_start, 1);
 2523|      0|    }
 2524|       |
 2525|       |    /* commit CH to the record layer */
 2526|  40.0k|    if ((ret = emitter->commit_message(emitter)) != 0)
  ------------------
  |  Branch (2526:9): [True: 0, False: 40.0k]
  ------------------
 2527|      0|        goto Exit;
 2528|       |
 2529|  40.0k|    if (tls->client.using_early_data) {
  ------------------
  |  Branch (2529:9): [True: 0, False: 40.0k]
  ------------------
 2530|      0|        assert(!is_second_flight);
 2531|      0|        if ((ret = setup_traffic_protection(tls, 1, "c e traffic", 1, 0, 0)) != 0)
  ------------------
  |  Branch (2531:13): [True: 0, False: 0]
  ------------------
 2532|      0|            goto Exit;
 2533|      0|        if ((ret = push_change_cipher_spec(tls, emitter)) != 0)
  ------------------
  |  Branch (2533:13): [True: 0, False: 0]
  ------------------
 2534|      0|            goto Exit;
 2535|      0|    }
 2536|  40.0k|    if (psk.secret.base != NULL && !is_second_flight) {
  ------------------
  |  Branch (2536:9): [True: 0, False: 40.0k]
  |  Branch (2536:36): [True: 0, False: 0]
  ------------------
 2537|      0|        if ((ret = derive_exporter_secret(tls, 1)) != 0)
  ------------------
  |  Branch (2537:13): [True: 0, False: 0]
  ------------------
 2538|      0|            goto Exit;
 2539|      0|    }
 2540|  40.0k|    tls->state = cookie == NULL ? PTLS_STATE_CLIENT_EXPECT_SERVER_HELLO : PTLS_STATE_CLIENT_EXPECT_SECOND_SERVER_HELLO;
  ------------------
  |  Branch (2540:18): [True: 2.28k, False: 37.7k]
  ------------------
 2541|  40.0k|    ret = PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  242|  40.0k|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  193|  40.0k|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 2542|       |
 2543|  40.0k|Exit:
 2544|  40.0k|    ptls_buffer_dispose(&encoded_ch_inner);
 2545|  40.0k|    ptls_clear_memory(binder_key, sizeof(binder_key));
 2546|  40.0k|    return ret;
 2547|  40.0k|}
picotls.c:extension_bitmap_testandset:
  436|  46.7k|{
  437|  46.7k|#define HSTYPE_TO_BIT(hstype) ((uint64_t)1 << ((hstype) + 1)) /* min(hstype) is -1 (PSEUDO_HRR) */
  438|  46.7k|#define DEFINE_BIT(abbrev, hstype) static const uint64_t abbrev = HSTYPE_TO_BIT(PTLS_HANDSHAKE_TYPE_##hstype)
  439|  46.7k|#define EXT(candext, allowed_bits)                                                                                                 \
  440|  46.7k|    do {                                                                                                                           \
  441|  46.7k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  442|  46.7k|            allowed_hs_bits = allowed_bits;                                                                                        \
  443|  46.7k|            goto Found;                                                                                                            \
  444|  46.7k|        }                                                                                                                          \
  445|  46.7k|        ext_bitmap_mask <<= 1;                                                                                                     \
  446|  46.7k|    } while (0)
  447|       |
  448|  46.7k|    DEFINE_BIT(CH, CLIENT_HELLO);
  ------------------
  |  |  438|  46.7k|#define DEFINE_BIT(abbrev, hstype) static const uint64_t abbrev = HSTYPE_TO_BIT(PTLS_HANDSHAKE_TYPE_##hstype)
  |  |  ------------------
  |  |  |  |  437|  46.7k|#define HSTYPE_TO_BIT(hstype) ((uint64_t)1 << ((hstype) + 1)) /* min(hstype) is -1 (PSEUDO_HRR) */
  |  |  ------------------
  ------------------
  449|  46.7k|    DEFINE_BIT(SH, SERVER_HELLO);
  ------------------
  |  |  438|  46.7k|#define DEFINE_BIT(abbrev, hstype) static const uint64_t abbrev = HSTYPE_TO_BIT(PTLS_HANDSHAKE_TYPE_##hstype)
  |  |  ------------------
  |  |  |  |  437|  46.7k|#define HSTYPE_TO_BIT(hstype) ((uint64_t)1 << ((hstype) + 1)) /* min(hstype) is -1 (PSEUDO_HRR) */
  |  |  ------------------
  ------------------
  450|  46.7k|    DEFINE_BIT(HRR, PSEUDO_HRR);
  ------------------
  |  |  438|  46.7k|#define DEFINE_BIT(abbrev, hstype) static const uint64_t abbrev = HSTYPE_TO_BIT(PTLS_HANDSHAKE_TYPE_##hstype)
  |  |  ------------------
  |  |  |  |  437|  46.7k|#define HSTYPE_TO_BIT(hstype) ((uint64_t)1 << ((hstype) + 1)) /* min(hstype) is -1 (PSEUDO_HRR) */
  |  |  ------------------
  ------------------
  451|  46.7k|    DEFINE_BIT(EE, ENCRYPTED_EXTENSIONS);
  ------------------
  |  |  438|  46.7k|#define DEFINE_BIT(abbrev, hstype) static const uint64_t abbrev = HSTYPE_TO_BIT(PTLS_HANDSHAKE_TYPE_##hstype)
  |  |  ------------------
  |  |  |  |  437|  46.7k|#define HSTYPE_TO_BIT(hstype) ((uint64_t)1 << ((hstype) + 1)) /* min(hstype) is -1 (PSEUDO_HRR) */
  |  |  ------------------
  ------------------
  452|  46.7k|    DEFINE_BIT(CR, CERTIFICATE_REQUEST);
  ------------------
  |  |  438|  46.7k|#define DEFINE_BIT(abbrev, hstype) static const uint64_t abbrev = HSTYPE_TO_BIT(PTLS_HANDSHAKE_TYPE_##hstype)
  |  |  ------------------
  |  |  |  |  437|  46.7k|#define HSTYPE_TO_BIT(hstype) ((uint64_t)1 << ((hstype) + 1)) /* min(hstype) is -1 (PSEUDO_HRR) */
  |  |  ------------------
  ------------------
  453|  46.7k|    DEFINE_BIT(CT, CERTIFICATE);
  ------------------
  |  |  438|  46.7k|#define DEFINE_BIT(abbrev, hstype) static const uint64_t abbrev = HSTYPE_TO_BIT(PTLS_HANDSHAKE_TYPE_##hstype)
  |  |  ------------------
  |  |  |  |  437|  46.7k|#define HSTYPE_TO_BIT(hstype) ((uint64_t)1 << ((hstype) + 1)) /* min(hstype) is -1 (PSEUDO_HRR) */
  |  |  ------------------
  ------------------
  454|  46.7k|    DEFINE_BIT(NST, NEW_SESSION_TICKET);
  ------------------
  |  |  438|  46.7k|#define DEFINE_BIT(abbrev, hstype) static const uint64_t abbrev = HSTYPE_TO_BIT(PTLS_HANDSHAKE_TYPE_##hstype)
  |  |  ------------------
  |  |  |  |  437|  46.7k|#define HSTYPE_TO_BIT(hstype) ((uint64_t)1 << ((hstype) + 1)) /* min(hstype) is -1 (PSEUDO_HRR) */
  |  |  ------------------
  ------------------
  455|       |
  456|  46.7k|    uint64_t allowed_hs_bits, ext_bitmap_mask = 1;
  457|       |
  458|       |    /* clang-format off */
  459|       |    /* RFC 8446 section 4.2: "The table below indicates the messages where a given extension may appear... If an implementation
  460|       |     * receives an extension which it recognizes and which is not specified for the message in which it appears, it MUST abort the
  461|       |     * handshake with an "illegal_parameter" alert.
  462|       |     *
  463|       |     * +-------------------------+---------------+
  464|       |     * +        Extension        |    Allowed    |
  465|       |     * +-------------------------+---------------+ */
  466|  46.7k|    EXT( SERVER_NAME             , CH + EE       );
  ------------------
  |  |  440|  46.7k|    do {                                                                                                                           \
  |  |  441|  46.7k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  46.7k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 41, False: 46.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  442|     41|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  443|     41|            goto Found;                                                                                                            \
  |  |  444|     41|        }                                                                                                                          \
  |  |  445|  46.7k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  446|  46.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (446:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  467|  46.7k|    EXT( STATUS_REQUEST          , CH + CR + CT  );
  ------------------
  |  |  440|  46.7k|    do {                                                                                                                           \
  |  |  441|  46.7k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  46.7k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 304, False: 46.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  442|    304|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  443|    304|            goto Found;                                                                                                            \
  |  |  444|    304|        }                                                                                                                          \
  |  |  445|  46.7k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  446|  46.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (446:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  468|  46.4k|    EXT( SUPPORTED_GROUPS        , CH + EE       );
  ------------------
  |  |  440|  46.4k|    do {                                                                                                                           \
  |  |  441|  46.4k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  46.4k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 17, False: 46.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  442|     17|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  443|     17|            goto Found;                                                                                                            \
  |  |  444|     17|        }                                                                                                                          \
  |  |  445|  46.4k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  446|  46.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (446:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  469|  46.4k|    EXT( SIGNATURE_ALGORITHMS    , CH + CR       );
  ------------------
  |  |  440|  46.4k|    do {                                                                                                                           \
  |  |  441|  46.4k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  46.4k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 72, False: 46.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  442|     72|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  443|     72|            goto Found;                                                                                                            \
  |  |  444|     72|        }                                                                                                                          \
  |  |  445|  46.4k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  446|  46.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (446:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  470|  46.3k|    EXT( ALPN                    , CH + EE       );
  ------------------
  |  |  440|  46.3k|    do {                                                                                                                           \
  |  |  441|  46.3k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  46.3k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 90, False: 46.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  442|     90|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  443|     90|            goto Found;                                                                                                            \
  |  |  444|     90|        }                                                                                                                          \
  |  |  445|  46.3k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  446|  46.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (446:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  471|  46.2k|    EXT( SERVER_CERTIFICATE_TYPE , CH + EE       );
  ------------------
  |  |  440|  46.2k|    do {                                                                                                                           \
  |  |  441|  46.2k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  46.2k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 35, False: 46.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  442|     35|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  443|     35|            goto Found;                                                                                                            \
  |  |  444|     35|        }                                                                                                                          \
  |  |  445|  46.2k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  446|  46.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (446:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  472|  46.2k|    EXT( KEY_SHARE               , CH + SH + HRR );
  ------------------
  |  |  440|  46.2k|    do {                                                                                                                           \
  |  |  441|  46.2k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  46.2k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 1.60k, False: 44.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  442|  1.60k|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  443|  1.60k|            goto Found;                                                                                                            \
  |  |  444|  1.60k|        }                                                                                                                          \
  |  |  445|  46.2k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  446|  44.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (446:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  473|  44.6k|    EXT( PRE_SHARED_KEY          , CH + SH       );
  ------------------
  |  |  440|  44.6k|    do {                                                                                                                           \
  |  |  441|  44.6k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  44.6k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 43, False: 44.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  442|     43|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  443|     43|            goto Found;                                                                                                            \
  |  |  444|     43|        }                                                                                                                          \
  |  |  445|  44.6k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  446|  44.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (446:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  474|  44.5k|    EXT( PSK_KEY_EXCHANGE_MODES  , CH            );
  ------------------
  |  |  440|  44.5k|    do {                                                                                                                           \
  |  |  441|  44.5k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  44.5k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 5, False: 44.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  442|      5|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  443|      5|            goto Found;                                                                                                            \
  |  |  444|      5|        }                                                                                                                          \
  |  |  445|  44.5k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  446|  44.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (446:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  475|  44.5k|    EXT( EARLY_DATA              , CH + EE + NST );
  ------------------
  |  |  440|  44.5k|    do {                                                                                                                           \
  |  |  441|  44.5k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  44.5k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 7, False: 44.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  442|      7|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  443|      7|            goto Found;                                                                                                            \
  |  |  444|      7|        }                                                                                                                          \
  |  |  445|  44.5k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  446|  44.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (446:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  476|  44.5k|    EXT( COOKIE                  , CH + HRR      );
  ------------------
  |  |  440|  44.5k|    do {                                                                                                                           \
  |  |  441|  44.5k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  44.5k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 1.47k, False: 43.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  442|  1.47k|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  443|  1.47k|            goto Found;                                                                                                            \
  |  |  444|  1.47k|        }                                                                                                                          \
  |  |  445|  44.5k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  446|  43.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (446:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  477|  43.1k|    EXT( SUPPORTED_VERSIONS      , CH + SH + HRR );
  ------------------
  |  |  440|  43.1k|    do {                                                                                                                           \
  |  |  441|  43.1k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  43.1k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 38.9k, False: 4.10k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  442|  38.9k|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  443|  38.9k|            goto Found;                                                                                                            \
  |  |  444|  38.9k|        }                                                                                                                          \
  |  |  445|  43.1k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  446|  4.10k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (446:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  478|  4.10k|    EXT( COMPRESS_CERTIFICATE    , CH + CR       ); /* from RFC 8879 */
  ------------------
  |  |  440|  4.10k|    do {                                                                                                                           \
  |  |  441|  4.10k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  4.10k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 13, False: 4.09k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  442|     13|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  443|     13|            goto Found;                                                                                                            \
  |  |  444|     13|        }                                                                                                                          \
  |  |  445|  4.10k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  446|  4.09k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (446:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  479|  4.09k|    EXT( ENCRYPTED_CLIENT_HELLO  , CH + HRR + EE ); /* from draft-ietf-tls-esni-15 */
  ------------------
  |  |  440|  4.09k|    do {                                                                                                                           \
  |  |  441|  4.09k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  4.09k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 15, False: 4.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  442|     15|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  443|     15|            goto Found;                                                                                                            \
  |  |  444|     15|        }                                                                                                                          \
  |  |  445|  4.09k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  446|  4.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (446:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  480|  4.08k|    EXT( ECH_OUTER_EXTENSIONS    , 0             );
  ------------------
  |  |  440|  4.08k|    do {                                                                                                                           \
  |  |  441|  4.08k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  4.08k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 6, False: 4.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  442|      6|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  443|      6|            goto Found;                                                                                                            \
  |  |  444|      6|        }                                                                                                                          \
  |  |  445|  4.08k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  446|  4.07k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (446:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  481|       |    /* +-----------------------------------------+ */
  482|       |    /* clang-format on */
  483|       |
  484|  4.07k|    return 1;
  485|       |
  486|  42.7k|Found:
  487|  42.7k|    if ((allowed_hs_bits & HSTYPE_TO_BIT(hstype)) == 0)
  ------------------
  |  |  437|  42.7k|#define HSTYPE_TO_BIT(hstype) ((uint64_t)1 << ((hstype) + 1)) /* min(hstype) is -1 (PSEUDO_HRR) */
  ------------------
  |  Branch (487:9): [True: 73, False: 42.6k]
  ------------------
  488|     73|        return 0;
  489|  42.6k|    if ((bitmap->bits & ext_bitmap_mask) != 0)
  ------------------
  |  Branch (489:9): [True: 29, False: 42.6k]
  ------------------
  490|     29|        return 0;
  491|  42.6k|    bitmap->bits |= ext_bitmap_mask;
  492|  42.6k|    return 1;
  493|       |
  494|  42.6k|#undef HSTYPE_TO_BIT
  495|  42.6k|#undef DEFINE_ABBREV
  496|  42.6k|#undef EXT
  497|  42.6k|}
picotls.c:key_schedule_extract:
 1301|  3.44k|{
 1302|  3.44k|    int ret;
 1303|       |
 1304|  3.44k|    if (ikm.base == NULL)
  ------------------
  |  Branch (1304:9): [True: 2.28k, False: 1.16k]
  ------------------
 1305|  2.28k|        ikm = ptls_iovec_init(zeroes_of_max_digest_size, sched->hashes[0].algo->digest_size);
 1306|       |
 1307|  3.44k|    if (sched->generation != 0 &&
  ------------------
  |  Branch (1307:9): [True: 1.16k, False: 2.28k]
  ------------------
 1308|  3.44k|        (ret = ptls_hkdf_expand_label(sched->hashes[0].algo, sched->secret, sched->hashes[0].algo->digest_size,
  ------------------
  |  Branch (1308:9): [True: 0, False: 1.16k]
  ------------------
 1309|  1.16k|                                      ptls_iovec_init(sched->secret, sched->hashes[0].algo->digest_size), "derived",
 1310|  1.16k|                                      ptls_iovec_init(sched->hashes[0].algo->empty_digest, sched->hashes[0].algo->digest_size),
 1311|  1.16k|                                      NULL)) != 0)
 1312|      0|        return ret;
 1313|       |
 1314|  3.44k|    ++sched->generation;
 1315|  3.44k|    ret = ptls_hkdf_extract(sched->hashes[0].algo, sched->secret,
 1316|  3.44k|                            ptls_iovec_init(sched->secret, sched->hashes[0].algo->digest_size), ikm);
 1317|  3.44k|    PTLS_DEBUGF("%s: %u, %02x%02x\n", __FUNCTION__, sched->generation, (int)sched->secret[0], (int)sched->secret[1]);
 1318|  3.44k|    return ret;
 1319|  3.44k|}
picotls.c:encode_client_hello:
 2136|  40.0k|{
 2137|  40.0k|    int ret;
 2138|       |
 2139|  40.0k|    assert(mode == ENCODE_CH_MODE_INNER || ech != NULL);
 2140|       |
 2141|  40.0k|    ptls_buffer_push_message_body(sendbuf, NULL, PTLS_HANDSHAKE_TYPE_CLIENT_HELLO, {
  ------------------
  |  | 1279|  40.0k|    do {                                                                                                                           \
  |  | 1280|  40.0k|        ptls_buffer_t *_buf = (buf);                                                                                               \
  |  | 1281|  40.0k|        ptls_key_schedule_t *_key_sched = (key_sched);                                                                             \
  |  | 1282|  40.0k|        size_t mess_start = _buf->off;                                                                                             \
  |  | 1283|  40.0k|        ptls_buffer_push(_buf, (type));                                                                                            \
  |  |  ------------------
  |  |  |  | 1196|  40.0k|    do {                                                                                                                           \
  |  |  |  | 1197|  40.0k|        if ((ret = ptls_buffer__do_pushv((buf), (uint8_t[]){__VA_ARGS__}, sizeof((uint8_t[]){__VA_ARGS__}))) != 0)                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1197:13): [True: 0, False: 40.0k]
  |  |  |  |  ------------------
  |  |  |  | 1198|  40.0k|            goto Exit;                                                                                                             \
  |  |  |  | 1199|  40.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1199:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1284|  40.0k|        ptls_buffer_push_block(_buf, 3, block);                                                                                    \
  |  |  ------------------
  |  |  |  | 1235|  40.0k|    do {                                                                                                                           \
  |  |  |  | 1236|  40.0k|        size_t capacity = (_capacity);                                                                                             \
  |  |  |  | 1237|  40.0k|        ptls_buffer_pushv((buf), (uint8_t *)"\0\0\0\0\0\0\0", capacity != -1 ? capacity : 1);                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1190|  40.0k|    do {                                                                                                                           \
  |  |  |  |  |  | 1191|  80.0k|        if ((ret = ptls_buffer__do_pushv((buf), (src), (len))) != 0)                                                               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1191:13): [True: 0, False: 40.0k]
  |  |  |  |  |  |  |  Branch (1191:57): [True: 40.0k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1192|  40.0k|            goto Exit;                                                                                                             \
  |  |  |  |  |  | 1193|  40.0k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1193:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1238|  40.0k|        size_t body_start = (buf)->off;                                                                                            \
  |  |  |  | 1239|  40.0k|        do {                                                                                                                       \
  |  |  |  | 1240|  17.4M|            block                                                                                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 80.0k, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 80.0k, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 80.0k, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 80.0k, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 80.0k, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 80.0k, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 80.0k, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 37.7k, False: 2.28k]
  |  |  |  |  |  Branch (1240:13): [True: 1.38k, False: 36.3k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 1.38k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 1.38k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 1.38k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 1.38k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 1.38k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 1.38k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 1.38k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 1.38k]
  |  |  |  |  |  Branch (1240:13): [True: 2.77k, False: 1.38k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 1.38k, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 1.38k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 1.38k]
  |  |  |  |  |  Branch (1240:13): [True: 2.77k, False: 1.38k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 1.38k, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 80.0k, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 80.0k, False: 40.0k]
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1241|   200k|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1241:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1242|  40.0k|        size_t body_size = (buf)->off - body_start;                                                                                \
  |  |  |  | 1243|  40.0k|        if (capacity != -1) {                                                                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1243:13): [True: 40.0k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1244|  40.0k|            if (capacity < sizeof(size_t) && body_size >= (size_t)1 << (capacity * 8)) {                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1244:17): [True: 40.0k, False: 0]
  |  |  |  |  |  Branch (1244:46): [True: 0, False: 40.0k]
  |  |  |  |  ------------------
  |  |  |  | 1245|      0|                ret = PTLS_ERROR_BLOCK_OVERFLOW;                                                                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  252|      0|#define PTLS_ERROR_BLOCK_OVERFLOW (PTLS_ERROR_CLASS_INTERNAL + 12)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1246|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1247|      0|            }                                                                                                                      \
  |  |  |  | 1248|   160k|            for (; capacity != 0; --capacity)                                                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1248:20): [True: 120k, False: 40.0k]
  |  |  |  |  ------------------
  |  |  |  | 1249|   120k|                (buf)->base[body_start - capacity] = (uint8_t)(body_size >> (8 * (capacity - 1)));                                 \
  |  |  |  | 1250|  40.0k|        } else {                                                                                                                   \
  |  |  |  | 1251|      0|            if ((ret = ptls_buffer__adjust_quic_blocksize((buf), body_size)) != 0)                                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1251:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1252|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1253|      0|        }                                                                                                                          \
  |  |  |  | 1254|  40.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1254:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1285|  40.0k|        if (_key_sched != NULL)                                                                                                    \
  |  |  ------------------
  |  |  |  Branch (1285:13): [True: 0, False: 40.0k]
  |  |  ------------------
  |  | 1286|  40.0k|            ptls__key_schedule_update_hash(_key_sched, _buf->base + mess_start, _buf->off - mess_start, 0);                        \
  |  | 1287|  40.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1287:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2142|       |        /* legacy_version */
 2143|  40.0k|        ptls_buffer_push16(sendbuf, 0x0303);
 2144|       |        /* random_bytes */
 2145|  40.0k|        ptls_buffer_pushv(sendbuf, client_random, PTLS_HELLO_RANDOM_SIZE);
 2146|       |        /* lecagy_session_id */
 2147|  40.0k|        ptls_buffer_push_block(sendbuf, 1, {
 2148|  40.0k|            if (mode != ENCODE_CH_MODE_ENCODED_INNER)
 2149|  40.0k|                ptls_buffer_pushv(sendbuf, legacy_session_id.base, legacy_session_id.len);
 2150|  40.0k|        });
 2151|       |        /* cipher_suites */
 2152|  40.0k|        ptls_buffer_push_block(sendbuf, 2, {
 2153|  40.0k|            ptls_cipher_suite_t **cs = ctx->cipher_suites;
 2154|  40.0k|            for (; *cs != NULL; ++cs)
 2155|  40.0k|                ptls_buffer_push16(sendbuf, (*cs)->id);
 2156|  40.0k|        });
 2157|       |        /* legacy_compression_methods */
 2158|  40.0k|        ptls_buffer_push_block(sendbuf, 1, { ptls_buffer_push(sendbuf, 0); });
 2159|       |        /* extensions */
 2160|  40.0k|        ptls_buffer_push_block(sendbuf, 2, {
 2161|  40.0k|            if (mode == ENCODE_CH_MODE_OUTER) {
 2162|  40.0k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_ENCRYPTED_CLIENT_HELLO, {
 2163|  40.0k|                    size_t ext_payload_from = sendbuf->off;
 2164|  40.0k|                    ptls_buffer_push(sendbuf, PTLS_ECH_CLIENT_HELLO_TYPE_OUTER);
 2165|  40.0k|                    ptls_buffer_push16(sendbuf, ech->cipher->id.kdf);
 2166|  40.0k|                    ptls_buffer_push16(sendbuf, ech->cipher->id.aead);
 2167|  40.0k|                    ptls_buffer_push(sendbuf, ech->config_id);
 2168|  40.0k|                    ptls_buffer_push_block(sendbuf, 2, {
 2169|  40.0k|                        if (!is_second_flight)
 2170|  40.0k|                            ptls_buffer_pushv(sendbuf, ech->client.enc.base, ech->client.enc.len);
 2171|  40.0k|                    });
 2172|  40.0k|                    ptls_buffer_push_block(sendbuf, 2, {
 2173|  40.0k|                        assert(sendbuf->off - ext_payload_from ==
 2174|  40.0k|                               outer_ech_header_size(is_second_flight ? 0 : ech->client.enc.len));
 2175|  40.0k|                        if ((ret = ptls_buffer_reserve(sendbuf, *ech_size_offset)) != 0)
 2176|  40.0k|                            goto Exit;
 2177|  40.0k|                        memset(sendbuf->base + sendbuf->off, 0, *ech_size_offset);
 2178|  40.0k|                        sendbuf->off += *ech_size_offset;
 2179|  40.0k|                        *ech_size_offset = sendbuf->off - *ech_size_offset;
 2180|  40.0k|                    });
 2181|  40.0k|                });
 2182|  40.0k|            } else if (ech->aead != NULL) {
 2183|  40.0k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_ENCRYPTED_CLIENT_HELLO,
 2184|  40.0k|                                      { ptls_buffer_push(sendbuf, PTLS_ECH_CLIENT_HELLO_TYPE_INNER); });
 2185|  40.0k|            } else if (ech_replay.base != NULL) {
 2186|  40.0k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_ENCRYPTED_CLIENT_HELLO,
 2187|  40.0k|                                      { ptls_buffer_pushv(sendbuf, ech_replay.base, ech_replay.len); });
 2188|  40.0k|            }
 2189|  40.0k|            if (mode == ENCODE_CH_MODE_ENCODED_INNER) {
 2190|  40.0k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_ECH_OUTER_EXTENSIONS, {
 2191|  40.0k|                    ptls_buffer_push_block(sendbuf, 1, { ptls_buffer_push16(sendbuf, PTLS_EXTENSION_TYPE_KEY_SHARE); });
 2192|  40.0k|                });
 2193|  40.0k|            } else {
 2194|  40.0k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_KEY_SHARE, {
 2195|  40.0k|                    ptls_buffer_push_block(sendbuf, 2, {
 2196|  40.0k|                        if (key_share_ctx != NULL &&
 2197|  40.0k|                            (ret = push_key_share_entry(sendbuf, key_share_ctx->algo->id, key_share_ctx->pubkey)) != 0)
 2198|  40.0k|                            goto Exit;
 2199|  40.0k|                    });
 2200|  40.0k|                });
 2201|  40.0k|            }
 2202|  40.0k|            if (sni_name != NULL) {
 2203|  40.0k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_SERVER_NAME, {
 2204|  40.0k|                    if ((ret = emit_server_name_extension(sendbuf, sni_name)) != 0)
 2205|  40.0k|                        goto Exit;
 2206|  40.0k|                });
 2207|  40.0k|            }
 2208|  40.0k|            if (properties != NULL && properties->client.negotiated_protocols.count != 0) {
 2209|  40.0k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_ALPN, {
 2210|  40.0k|                    ptls_buffer_push_block(sendbuf, 2, {
 2211|  40.0k|                        size_t i;
 2212|  40.0k|                        for (i = 0; i != properties->client.negotiated_protocols.count; ++i) {
 2213|  40.0k|                            ptls_buffer_push_block(sendbuf, 1, {
 2214|  40.0k|                                ptls_iovec_t p = properties->client.negotiated_protocols.list[i];
 2215|  40.0k|                                ptls_buffer_pushv(sendbuf, p.base, p.len);
 2216|  40.0k|                            });
 2217|  40.0k|                        }
 2218|  40.0k|                    });
 2219|  40.0k|                });
 2220|  40.0k|            }
 2221|  40.0k|            if (ctx->decompress_certificate != NULL) {
 2222|  40.0k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_COMPRESS_CERTIFICATE, {
 2223|  40.0k|                    ptls_buffer_push_block(sendbuf, 1, {
 2224|  40.0k|                        const uint16_t *algo = ctx->decompress_certificate->supported_algorithms;
 2225|  40.0k|                        assert(*algo != UINT16_MAX);
 2226|  40.0k|                        for (; *algo != UINT16_MAX; ++algo)
 2227|  40.0k|                            ptls_buffer_push16(sendbuf, *algo);
 2228|  40.0k|                    });
 2229|  40.0k|                });
 2230|  40.0k|            }
 2231|  40.0k|            buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_SUPPORTED_VERSIONS, {
 2232|  40.0k|                ptls_buffer_push_block(sendbuf, 1, {
 2233|  40.0k|                    size_t i;
 2234|  40.0k|                    for (i = 0; i != PTLS_ELEMENTSOF(supported_versions); ++i)
 2235|  40.0k|                        ptls_buffer_push16(sendbuf, supported_versions[i]);
 2236|  40.0k|                });
 2237|  40.0k|            });
 2238|  40.0k|            buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_SIGNATURE_ALGORITHMS, {
 2239|  40.0k|                if ((ret = push_signature_algorithms(ctx->verify_certificate, sendbuf)) != 0)
 2240|  40.0k|                    goto Exit;
 2241|  40.0k|            });
 2242|  40.0k|            if (ctx->key_exchanges != NULL) {
 2243|  40.0k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_SUPPORTED_GROUPS, {
 2244|  40.0k|                    ptls_key_exchange_algorithm_t **algo = ctx->key_exchanges;
 2245|  40.0k|                    ptls_buffer_push_block(sendbuf, 2, {
 2246|  40.0k|                        for (; *algo != NULL; ++algo)
 2247|  40.0k|                            ptls_buffer_push16(sendbuf, (*algo)->id);
 2248|  40.0k|                    });
 2249|  40.0k|                });
 2250|  40.0k|            }
 2251|  40.0k|            if (cookie != NULL && cookie->base != NULL) {
 2252|  40.0k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_COOKIE, {
 2253|  40.0k|                    ptls_buffer_push_block(sendbuf, 2, { ptls_buffer_pushv(sendbuf, cookie->base, cookie->len); });
 2254|  40.0k|                });
 2255|  40.0k|            }
 2256|  40.0k|            if (ctx->use_raw_public_keys) {
 2257|  40.0k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_SERVER_CERTIFICATE_TYPE, {
 2258|  40.0k|                    ptls_buffer_push_block(sendbuf, 1, { ptls_buffer_push(sendbuf, PTLS_CERTIFICATE_TYPE_RAW_PUBLIC_KEY); });
 2259|  40.0k|                });
 2260|  40.0k|            }
 2261|  40.0k|            if ((ret = push_additional_extensions(properties, sendbuf)) != 0)
 2262|  40.0k|                goto Exit;
 2263|  40.0k|            if (ctx->save_ticket != NULL || psk_secret.base != NULL) {
 2264|  40.0k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_PSK_KEY_EXCHANGE_MODES, {
 2265|  40.0k|                    ptls_buffer_push_block(sendbuf, 1, {
 2266|  40.0k|                        if (!ctx->require_dhe_on_psk)
 2267|  40.0k|                            ptls_buffer_push(sendbuf, PTLS_PSK_KE_MODE_PSK);
 2268|  40.0k|                        ptls_buffer_push(sendbuf, PTLS_PSK_KE_MODE_PSK_DHE);
 2269|  40.0k|                    });
 2270|  40.0k|                });
 2271|  40.0k|            }
 2272|  40.0k|            if (psk_secret.base != NULL) {
 2273|  40.0k|                if (using_early_data && !is_second_flight)
 2274|  40.0k|                    buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_EARLY_DATA, {});
 2275|       |                /* pre-shared key "MUST be the last extension in the ClientHello" (draft-17 section 4.2.6) */
 2276|  40.0k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_PRE_SHARED_KEY, {
 2277|  40.0k|                    ptls_buffer_push_block(sendbuf, 2, {
 2278|  40.0k|                        ptls_buffer_push_block(sendbuf, 2, {
 2279|  40.0k|                            if (mode == ENCODE_CH_MODE_OUTER) {
 2280|  40.0k|                                if ((ret = ptls_buffer_reserve(sendbuf, psk_identity.len)) != 0)
 2281|  40.0k|                                    goto Exit;
 2282|  40.0k|                                ctx->random_bytes(sendbuf->base + sendbuf->off, psk_identity.len);
 2283|  40.0k|                                sendbuf->off += psk_identity.len;
 2284|  40.0k|                            } else {
 2285|  40.0k|                                ptls_buffer_pushv(sendbuf, psk_identity.base, psk_identity.len);
 2286|  40.0k|                            }
 2287|  40.0k|                        });
 2288|  40.0k|                        uint32_t age;
 2289|  40.0k|                        if (mode == ENCODE_CH_MODE_OUTER) {
 2290|  40.0k|                            ctx->random_bytes(&age, sizeof(age));
 2291|  40.0k|                        } else {
 2292|  40.0k|                            age = obfuscated_ticket_age;
 2293|  40.0k|                        }
 2294|  40.0k|                        ptls_buffer_push32(sendbuf, age);
 2295|  40.0k|                    });
 2296|       |                    /* allocate space for PSK binder. The space is filled initially filled by a random value (meeting the
 2297|       |                     * requirement of ClientHelloOuter), and later gets filled with the correct binder value if necessary. */
 2298|  40.0k|                    ptls_buffer_push_block(sendbuf, 2, {
 2299|  40.0k|                        ptls_buffer_push_block(sendbuf, 1, {
 2300|  40.0k|                            if ((ret = ptls_buffer_reserve(sendbuf, psk_binder_size)) != 0)
 2301|  40.0k|                                goto Exit;
 2302|  40.0k|                            ctx->random_bytes(sendbuf->base + sendbuf->off, psk_binder_size);
 2303|  40.0k|                            sendbuf->off += psk_binder_size;
 2304|  40.0k|                        });
 2305|  40.0k|                    });
 2306|  40.0k|                });
 2307|  40.0k|            }
 2308|  40.0k|        });
 2309|  40.0k|    });
 2310|       |
 2311|  40.0k|Exit:
 2312|  40.0k|    return ret;
 2313|  40.0k|}
picotls.c:push_key_share_entry:
 2040|  40.0k|{
 2041|  40.0k|    int ret;
 2042|       |
 2043|  40.0k|    ptls_buffer_push16(buf, group);
  ------------------
  |  | 1202|  40.0k|    do {                                                                                                                           \
  |  | 1203|  40.0k|        uint16_t _v = (v);                                                                                                         \
  |  | 1204|  40.0k|        ptls_buffer_push(buf, (uint8_t)(_v >> 8), (uint8_t)_v);                                                                    \
  |  |  ------------------
  |  |  |  | 1196|  40.0k|    do {                                                                                                                           \
  |  |  |  | 1197|  40.0k|        if ((ret = ptls_buffer__do_pushv((buf), (uint8_t[]){__VA_ARGS__}, sizeof((uint8_t[]){__VA_ARGS__}))) != 0)                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1197:13): [True: 0, False: 40.0k]
  |  |  |  |  ------------------
  |  |  |  | 1198|  40.0k|            goto Exit;                                                                                                             \
  |  |  |  | 1199|  40.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1199:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1205|  40.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1205:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2044|  40.0k|    ptls_buffer_push_block(buf, 2, { ptls_buffer_pushv(buf, pubkey.base, pubkey.len); });
  ------------------
  |  | 1235|  40.0k|    do {                                                                                                                           \
  |  | 1236|  40.0k|        size_t capacity = (_capacity);                                                                                             \
  |  | 1237|  40.0k|        ptls_buffer_pushv((buf), (uint8_t *)"\0\0\0\0\0\0\0", capacity != -1 ? capacity : 1);                                      \
  |  |  ------------------
  |  |  |  | 1190|  40.0k|    do {                                                                                                                           \
  |  |  |  | 1191|  80.0k|        if ((ret = ptls_buffer__do_pushv((buf), (src), (len))) != 0)                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1191:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1191:57): [True: 40.0k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1192|  40.0k|            goto Exit;                                                                                                             \
  |  |  |  | 1193|  40.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1193:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1238|  40.0k|        size_t body_start = (buf)->off;                                                                                            \
  |  | 1239|  40.0k|        do {                                                                                                                       \
  |  | 1240|   120k|            block                                                                                                                  \
  |  |  ------------------
  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  ------------------
  |  | 1241|  40.0k|        } while (0);                                                                                                               \
  |  |  ------------------
  |  |  |  Branch (1241:18): [Folded - Ignored]
  |  |  ------------------
  |  | 1242|  40.0k|        size_t body_size = (buf)->off - body_start;                                                                                \
  |  | 1243|  40.0k|        if (capacity != -1) {                                                                                                      \
  |  |  ------------------
  |  |  |  Branch (1243:13): [True: 40.0k, False: 0]
  |  |  ------------------
  |  | 1244|  40.0k|            if (capacity < sizeof(size_t) && body_size >= (size_t)1 << (capacity * 8)) {                                           \
  |  |  ------------------
  |  |  |  Branch (1244:17): [True: 40.0k, False: 0]
  |  |  |  Branch (1244:46): [True: 0, False: 40.0k]
  |  |  ------------------
  |  | 1245|      0|                ret = PTLS_ERROR_BLOCK_OVERFLOW;                                                                                   \
  |  |  ------------------
  |  |  |  |  252|      0|#define PTLS_ERROR_BLOCK_OVERFLOW (PTLS_ERROR_CLASS_INTERNAL + 12)
  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1246|      0|                goto Exit;                                                                                                         \
  |  | 1247|      0|            }                                                                                                                      \
  |  | 1248|   120k|            for (; capacity != 0; --capacity)                                                                                      \
  |  |  ------------------
  |  |  |  Branch (1248:20): [True: 80.0k, False: 40.0k]
  |  |  ------------------
  |  | 1249|  80.0k|                (buf)->base[body_start - capacity] = (uint8_t)(body_size >> (8 * (capacity - 1)));                                 \
  |  | 1250|  40.0k|        } else {                                                                                                                   \
  |  | 1251|      0|            if ((ret = ptls_buffer__adjust_quic_blocksize((buf), body_size)) != 0)                                                 \
  |  |  ------------------
  |  |  |  Branch (1251:17): [True: 0, False: 0]
  |  |  ------------------
  |  | 1252|      0|                goto Exit;                                                                                                         \
  |  | 1253|      0|        }                                                                                                                          \
  |  | 1254|  40.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1254:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2045|  40.0k|    ret = 0;
 2046|  40.0k|Exit:
 2047|  40.0k|    return ret;
 2048|  40.0k|}
picotls.c:push_signature_algorithms:
 1959|  40.0k|{
 1960|       |    /* The list sent when verify callback is not registered */
 1961|  40.0k|    static const uint16_t default_algos[] = {PTLS_SIGNATURE_RSA_PSS_RSAE_SHA256, PTLS_SIGNATURE_ECDSA_SECP256R1_SHA256,
  ------------------
  |  |  170|  40.0k|#define PTLS_SIGNATURE_RSA_PSS_RSAE_SHA256 0x0804
  ------------------
                  static const uint16_t default_algos[] = {PTLS_SIGNATURE_RSA_PSS_RSAE_SHA256, PTLS_SIGNATURE_ECDSA_SECP256R1_SHA256,
  ------------------
  |  |  167|  40.0k|#define PTLS_SIGNATURE_ECDSA_SECP256R1_SHA256 0x0403
  ------------------
 1962|  40.0k|                                             PTLS_SIGNATURE_RSA_PKCS1_SHA256, PTLS_SIGNATURE_RSA_PKCS1_SHA1, UINT16_MAX};
  ------------------
  |  |  166|  40.0k|#define PTLS_SIGNATURE_RSA_PKCS1_SHA256 0x0401
  ------------------
                                                           PTLS_SIGNATURE_RSA_PKCS1_SHA256, PTLS_SIGNATURE_RSA_PKCS1_SHA1, UINT16_MAX};
  ------------------
  |  |  165|  40.0k|#define PTLS_SIGNATURE_RSA_PKCS1_SHA1 0x0201
  ------------------
 1963|  40.0k|    int ret;
 1964|       |
 1965|  40.0k|    ptls_buffer_push_block(sendbuf, 2, {
  ------------------
  |  | 1235|  40.0k|    do {                                                                                                                           \
  |  | 1236|  40.0k|        size_t capacity = (_capacity);                                                                                             \
  |  | 1237|  40.0k|        ptls_buffer_pushv((buf), (uint8_t *)"\0\0\0\0\0\0\0", capacity != -1 ? capacity : 1);                                      \
  |  |  ------------------
  |  |  |  | 1190|  40.0k|    do {                                                                                                                           \
  |  |  |  | 1191|  80.0k|        if ((ret = ptls_buffer__do_pushv((buf), (src), (len))) != 0)                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1191:13): [True: 0, False: 40.0k]
  |  |  |  |  |  Branch (1191:57): [True: 40.0k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1192|  40.0k|            goto Exit;                                                                                                             \
  |  |  |  | 1193|  40.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1193:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1238|  40.0k|        size_t body_start = (buf)->off;                                                                                            \
  |  | 1239|  40.0k|        do {                                                                                                                       \
  |  | 1240|  1.40M|            block                                                                                                                  \
  |  |  ------------------
  |  |  |  Branch (1240:13): [True: 0, False: 40.0k]
  |  |  |  Branch (1240:13): [True: 0, False: 160k]
  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  Branch (1240:13): [True: 160k, False: 40.0k]
  |  |  ------------------
  |  | 1241|  40.0k|        } while (0);                                                                                                               \
  |  |  ------------------
  |  |  |  Branch (1241:18): [Folded - Ignored]
  |  |  ------------------
  |  | 1242|  40.0k|        size_t body_size = (buf)->off - body_start;                                                                                \
  |  | 1243|  40.0k|        if (capacity != -1) {                                                                                                      \
  |  |  ------------------
  |  |  |  Branch (1243:13): [True: 40.0k, False: 0]
  |  |  ------------------
  |  | 1244|  40.0k|            if (capacity < sizeof(size_t) && body_size >= (size_t)1 << (capacity * 8)) {                                           \
  |  |  ------------------
  |  |  |  Branch (1244:17): [True: 40.0k, False: 0]
  |  |  |  Branch (1244:46): [True: 0, False: 40.0k]
  |  |  ------------------
  |  | 1245|      0|                ret = PTLS_ERROR_BLOCK_OVERFLOW;                                                                                   \
  |  |  ------------------
  |  |  |  |  252|      0|#define PTLS_ERROR_BLOCK_OVERFLOW (PTLS_ERROR_CLASS_INTERNAL + 12)
  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1246|      0|                goto Exit;                                                                                                         \
  |  | 1247|      0|            }                                                                                                                      \
  |  | 1248|   120k|            for (; capacity != 0; --capacity)                                                                                      \
  |  |  ------------------
  |  |  |  Branch (1248:20): [True: 80.0k, False: 40.0k]
  |  |  ------------------
  |  | 1249|  80.0k|                (buf)->base[body_start - capacity] = (uint8_t)(body_size >> (8 * (capacity - 1)));                                 \
  |  | 1250|  40.0k|        } else {                                                                                                                   \
  |  | 1251|      0|            if ((ret = ptls_buffer__adjust_quic_blocksize((buf), body_size)) != 0)                                                 \
  |  |  ------------------
  |  |  |  Branch (1251:17): [True: 0, False: 0]
  |  |  ------------------
  |  | 1252|      0|                goto Exit;                                                                                                         \
  |  | 1253|      0|        }                                                                                                                          \
  |  | 1254|  40.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1254:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1966|  40.0k|        for (const uint16_t *p = vc != NULL ? vc->algos : default_algos; *p != UINT16_MAX; ++p)
 1967|  40.0k|            ptls_buffer_push16(sendbuf, *p);
 1968|  40.0k|    });
 1969|       |
 1970|  40.0k|    ret = 0;
 1971|  40.0k|Exit:
 1972|  40.0k|    return ret;
 1973|  40.0k|}
picotls.c:push_additional_extensions:
 1944|  40.0k|{
 1945|  40.0k|    int ret;
 1946|       |
 1947|  40.0k|    if (properties != NULL && properties->additional_extensions != NULL) {
  ------------------
  |  Branch (1947:9): [True: 40.0k, False: 0]
  |  Branch (1947:31): [True: 0, False: 40.0k]
  ------------------
 1948|      0|        ptls_raw_extension_t *ext;
 1949|      0|        for (ext = properties->additional_extensions; ext->type != UINT16_MAX; ++ext) {
  ------------------
  |  Branch (1949:55): [True: 0, False: 0]
  ------------------
 1950|      0|            buffer_push_extension(sendbuf, ext->type, { ptls_buffer_pushv(sendbuf, ext->data.base, ext->data.len); });
  ------------------
  |  |  864|      0|    do {                                                                                                                           \
  |  |  865|      0|        ptls_buffer_push16((buf), (type));                                                                                         \
  |  |  ------------------
  |  |  |  | 1202|      0|    do {                                                                                                                           \
  |  |  |  | 1203|      0|        uint16_t _v = (v);                                                                                                         \
  |  |  |  | 1204|      0|        ptls_buffer_push(buf, (uint8_t)(_v >> 8), (uint8_t)_v);                                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1196|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1197|      0|        if ((ret = ptls_buffer__do_pushv((buf), (uint8_t[]){__VA_ARGS__}, sizeof((uint8_t[]){__VA_ARGS__}))) != 0)                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1197:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1198|      0|            goto Exit;                                                                                                             \
  |  |  |  |  |  | 1199|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1199:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1205|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1205:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  866|      0|        ptls_buffer_push_block((buf), 2, block);                                                                                   \
  |  |  ------------------
  |  |  |  | 1235|      0|    do {                                                                                                                           \
  |  |  |  | 1236|      0|        size_t capacity = (_capacity);                                                                                             \
  |  |  |  | 1237|      0|        ptls_buffer_pushv((buf), (uint8_t *)"\0\0\0\0\0\0\0", capacity != -1 ? capacity : 1);                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1190|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1191|      0|        if ((ret = ptls_buffer__do_pushv((buf), (src), (len))) != 0)                                                               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1191:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1191:57): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1192|      0|            goto Exit;                                                                                                             \
  |  |  |  |  |  | 1193|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1193:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1238|      0|        size_t body_start = (buf)->off;                                                                                            \
  |  |  |  | 1239|      0|        do {                                                                                                                       \
  |  |  |  | 1240|      0|            block                                                                                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1240:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1240:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1241|      0|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1241:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1242|      0|        size_t body_size = (buf)->off - body_start;                                                                                \
  |  |  |  | 1243|      0|        if (capacity != -1) {                                                                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1243:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1244|      0|            if (capacity < sizeof(size_t) && body_size >= (size_t)1 << (capacity * 8)) {                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1244:17): [True: 0, False: 0]
  |  |  |  |  |  Branch (1244:46): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1245|      0|                ret = PTLS_ERROR_BLOCK_OVERFLOW;                                                                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  252|      0|#define PTLS_ERROR_BLOCK_OVERFLOW (PTLS_ERROR_CLASS_INTERNAL + 12)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1246|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1247|      0|            }                                                                                                                      \
  |  |  |  | 1248|      0|            for (; capacity != 0; --capacity)                                                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1248:20): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1249|      0|                (buf)->base[body_start - capacity] = (uint8_t)(body_size >> (8 * (capacity - 1)));                                 \
  |  |  |  | 1250|      0|        } else {                                                                                                                   \
  |  |  |  | 1251|      0|            if ((ret = ptls_buffer__adjust_quic_blocksize((buf), body_size)) != 0)                                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1251:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1252|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1253|      0|        }                                                                                                                          \
  |  |  |  | 1254|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1254:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  867|      0|    } while (0);
  |  |  ------------------
  |  |  |  Branch (867:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1951|      0|        }
 1952|      0|    }
 1953|  40.0k|    ret = 0;
 1954|  40.0k|Exit:
 1955|  40.0k|    return ret;
 1956|  40.0k|}
picotls.c:calc_verify_data:
 1789|     11|{
 1790|     11|    ptls_hash_context_t *hmac;
 1791|     11|    uint8_t digest[PTLS_MAX_DIGEST_SIZE];
 1792|     11|    int ret;
 1793|       |
 1794|     11|    if ((ret = ptls_hkdf_expand_label(sched->hashes[0].algo, digest, sched->hashes[0].algo->digest_size,
  ------------------
  |  Branch (1794:9): [True: 0, False: 11]
  ------------------
 1795|     11|                                      ptls_iovec_init(secret, sched->hashes[0].algo->digest_size), "finished",
 1796|     11|                                      ptls_iovec_init(NULL, 0), NULL)) != 0)
 1797|      0|        return ret;
 1798|     11|    if ((hmac = ptls_hmac_create(sched->hashes[0].algo, digest, sched->hashes[0].algo->digest_size)) == NULL) {
  ------------------
  |  Branch (1798:9): [True: 0, False: 11]
  ------------------
 1799|      0|        ptls_clear_memory(digest, sizeof(digest));
 1800|      0|        return PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  241|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 1801|      0|    }
 1802|       |
 1803|     11|    sched->hashes[0].ctx->final(sched->hashes[0].ctx, digest, PTLS_HASH_FINAL_MODE_SNAPSHOT);
 1804|     11|    PTLS_DEBUGF("%s: %02x%02x,%02x%02x\n", __FUNCTION__, ((uint8_t *)secret)[0], ((uint8_t *)secret)[1], digest[0], digest[1]);
 1805|     11|    hmac->update(hmac, digest, sched->hashes[0].algo->digest_size);
 1806|     11|    ptls_clear_memory(digest, sizeof(digest));
 1807|     11|    hmac->final(hmac, output, PTLS_HASH_FINAL_MODE_FREE);
 1808|       |
 1809|     11|    return 0;
 1810|     11|}
picotls.c:build_certificate_verify_signdata:
 1774|     40|{
 1775|     40|    size_t datalen = 0;
 1776|       |
 1777|     40|    memset(data + datalen, 32, 64);
 1778|     40|    datalen += 64;
 1779|     40|    memcpy(data + datalen, context_string, strlen(context_string) + 1);
 1780|     40|    datalen += strlen(context_string) + 1;
 1781|     40|    sched->hashes[0].ctx->final(sched->hashes[0].ctx, data + datalen, PTLS_HASH_FINAL_MODE_SNAPSHOT);
 1782|     40|    datalen += sched->hashes[0].algo->digest_size;
 1783|     40|    assert(datalen <= PTLS_MAX_CERTIFICATE_VERIFY_SIGNDATA_SIZE);
 1784|       |
 1785|     40|    return datalen;
 1786|     40|}
picotls.c:handle_input:
 5796|  72.4k|{
 5797|  72.4k|    struct st_ptls_record_t rec;
 5798|  72.4k|    int ret;
 5799|       |
 5800|       |    /* extract the record */
 5801|  72.4k|    if ((ret = parse_record(tls, &rec, input, inlen)) != 0)
  ------------------
  |  Branch (5801:9): [True: 164, False: 72.2k]
  ------------------
 5802|    164|        return ret;
 5803|  72.2k|    assert(rec.fragment != NULL);
 5804|       |
 5805|       |    /* decrypt the record */
 5806|  72.2k|    if (rec.type == PTLS_CONTENT_TYPE_CHANGE_CIPHER_SPEC) {
  ------------------
  |  |   48|  72.2k|#define PTLS_CONTENT_TYPE_CHANGE_CIPHER_SPEC 20
  ------------------
  |  Branch (5806:9): [True: 212, False: 72.0k]
  ------------------
 5807|    212|        if (tls->state < PTLS_STATE_POST_HANDSHAKE_MIN) {
  ------------------
  |  Branch (5807:13): [True: 212, False: 0]
  ------------------
 5808|    212|            if (!(rec.length == 1 && rec.fragment[0] == 0x01))
  ------------------
  |  Branch (5808:19): [True: 203, False: 9]
  |  Branch (5808:38): [True: 194, False: 9]
  ------------------
 5809|     18|                return PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  216|     18|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 5810|    212|        } else {
 5811|      0|            return PTLS_ALERT_HANDSHAKE_FAILURE;
  ------------------
  |  |  210|      0|#define PTLS_ALERT_HANDSHAKE_FAILURE 40
  ------------------
 5812|      0|        }
 5813|    194|        ret = PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  242|    194|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  193|    194|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 5814|    194|        goto NextRecord;
 5815|    212|    }
 5816|  72.0k|    if (tls->traffic_protection.dec.aead != NULL && rec.type != PTLS_CONTENT_TYPE_ALERT) {
  ------------------
  |  |   49|  1.59k|#define PTLS_CONTENT_TYPE_ALERT 21
  ------------------
  |  Branch (5816:9): [True: 1.59k, False: 70.4k]
  |  Branch (5816:53): [True: 1.59k, False: 1]
  ------------------
 5817|  1.59k|        size_t decrypted_length;
 5818|  1.59k|        if (rec.type != PTLS_CONTENT_TYPE_APPDATA)
  ------------------
  |  |   51|  1.59k|#define PTLS_CONTENT_TYPE_APPDATA 23
  ------------------
  |  Branch (5818:13): [True: 1, False: 1.59k]
  ------------------
 5819|      1|            return PTLS_ALERT_HANDSHAKE_FAILURE;
  ------------------
  |  |  210|      1|#define PTLS_ALERT_HANDSHAKE_FAILURE 40
  ------------------
 5820|  1.59k|        if ((ret = ptls_buffer_reserve(decryptbuf, 5 + rec.length)) != 0)
  ------------------
  |  Branch (5820:13): [True: 0, False: 1.59k]
  ------------------
 5821|      0|            return ret;
 5822|  1.59k|        if ((ret = aead_decrypt(&tls->traffic_protection.dec, decryptbuf->base + decryptbuf->off, &decrypted_length, rec.fragment,
  ------------------
  |  Branch (5822:13): [True: 7, False: 1.58k]
  ------------------
 5823|  1.59k|                                rec.length)) != 0) {
 5824|      7|            if (tls->is_server && tls->server.early_data_skipped_bytes != UINT32_MAX)
  ------------------
  |  Branch (5824:17): [True: 0, False: 7]
  |  Branch (5824:35): [True: 0, False: 0]
  ------------------
 5825|      0|                goto ServerSkipEarlyData;
 5826|      7|            return ret;
 5827|      7|        }
 5828|  1.58k|        rec.length = decrypted_length;
 5829|  1.58k|        rec.fragment = decryptbuf->base + decryptbuf->off;
 5830|       |        /* skip padding */
 5831|  3.42k|        for (; rec.length != 0; --rec.length)
  ------------------
  |  Branch (5831:16): [True: 3.40k, False: 17]
  ------------------
 5832|  3.40k|            if (rec.fragment[rec.length - 1] != 0)
  ------------------
  |  Branch (5832:17): [True: 1.57k, False: 1.83k]
  ------------------
 5833|  1.57k|                break;
 5834|  1.58k|        if (rec.length == 0)
  ------------------
  |  Branch (5834:13): [True: 17, False: 1.57k]
  ------------------
 5835|     17|            return PTLS_ALERT_UNEXPECTED_MESSAGE;
  ------------------
  |  |  208|     17|#define PTLS_ALERT_UNEXPECTED_MESSAGE 10
  ------------------
 5836|  1.57k|        rec.type = rec.fragment[--rec.length];
 5837|  70.4k|    } else if (rec.type == PTLS_CONTENT_TYPE_APPDATA && tls->is_server && tls->server.early_data_skipped_bytes != UINT32_MAX) {
  ------------------
  |  |   51|   140k|#define PTLS_CONTENT_TYPE_APPDATA 23
  ------------------
  |  Branch (5837:16): [True: 8, False: 70.4k]
  |  Branch (5837:57): [True: 0, False: 8]
  |  Branch (5837:75): [True: 0, False: 0]
  ------------------
 5838|      0|        goto ServerSkipEarlyData;
 5839|      0|    }
 5840|       |
 5841|  72.0k|    if (tls->recvbuf.mess.base != NULL || rec.type == PTLS_CONTENT_TYPE_HANDSHAKE) {
  ------------------
  |  |   50|  43.0k|#define PTLS_CONTENT_TYPE_HANDSHAKE 22
  ------------------
  |  Branch (5841:9): [True: 28.9k, False: 43.0k]
  |  Branch (5841:43): [True: 43.0k, False: 66]
  ------------------
 5842|       |        /* handshake record */
 5843|  71.9k|        ret = handle_handshake_record(tls, tls->is_server ? handle_server_handshake_message : handle_client_handshake_message,
  ------------------
  |  Branch (5843:44): [True: 0, False: 71.9k]
  ------------------
 5844|  71.9k|                                      emitter, &rec, properties);
 5845|  71.9k|    } else {
 5846|       |        /* handling of an alert or an application record */
 5847|     66|        switch (rec.type) {
 5848|     10|        case PTLS_CONTENT_TYPE_APPDATA:
  ------------------
  |  |   51|     10|#define PTLS_CONTENT_TYPE_APPDATA 23
  ------------------
  |  Branch (5848:9): [True: 10, False: 56]
  ------------------
 5849|     10|            if (tls->state >= PTLS_STATE_POST_HANDSHAKE_MIN) {
  ------------------
  |  Branch (5849:17): [True: 0, False: 10]
  ------------------
 5850|      0|                decryptbuf->off += rec.length;
 5851|      0|                ret = 0;
 5852|     10|            } else if (tls->state == PTLS_STATE_SERVER_EXPECT_END_OF_EARLY_DATA) {
  ------------------
  |  Branch (5852:24): [True: 0, False: 10]
  ------------------
 5853|      0|                if (tls->traffic_protection.dec.aead != NULL)
  ------------------
  |  Branch (5853:21): [True: 0, False: 0]
  ------------------
 5854|      0|                    decryptbuf->off += rec.length;
 5855|      0|                ret = 0;
 5856|     10|            } else {
 5857|     10|                ret = PTLS_ALERT_UNEXPECTED_MESSAGE;
  ------------------
  |  |  208|     10|#define PTLS_ALERT_UNEXPECTED_MESSAGE 10
  ------------------
 5858|     10|            }
 5859|     10|            break;
 5860|     23|        case PTLS_CONTENT_TYPE_ALERT:
  ------------------
  |  |   49|     23|#define PTLS_CONTENT_TYPE_ALERT 21
  ------------------
  |  Branch (5860:9): [True: 23, False: 43]
  ------------------
 5861|     23|            ret = handle_alert(tls, rec.fragment, rec.length);
 5862|     23|            break;
 5863|     33|        default:
  ------------------
  |  Branch (5863:9): [True: 33, False: 33]
  ------------------
 5864|     33|            ret = PTLS_ALERT_UNEXPECTED_MESSAGE;
  ------------------
  |  |  208|     33|#define PTLS_ALERT_UNEXPECTED_MESSAGE 10
  ------------------
 5865|     33|            break;
 5866|     66|        }
 5867|     66|    }
 5868|       |
 5869|  72.2k|NextRecord:
 5870|  72.2k|    ptls_buffer_dispose(&tls->recvbuf.rec);
 5871|  72.2k|    return ret;
 5872|       |
 5873|      0|ServerSkipEarlyData:
 5874|      0|    tls->server.early_data_skipped_bytes += (uint32_t)rec.length;
 5875|      0|    if (tls->server.early_data_skipped_bytes > PTLS_MAX_EARLY_DATA_SKIP_SIZE)
  ------------------
  |  |   93|      0|#define PTLS_MAX_EARLY_DATA_SKIP_SIZE 65536
  ------------------
  |  Branch (5875:9): [True: 0, False: 0]
  ------------------
 5876|      0|        return PTLS_ALERT_HANDSHAKE_FAILURE;
  ------------------
  |  |  210|      0|#define PTLS_ALERT_HANDSHAKE_FAILURE 40
  ------------------
 5877|      0|    ret = PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  242|      0|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 5878|      0|    goto NextRecord;
 5879|      0|}
picotls.c:parse_record:
 4988|  72.4k|{
 4989|  72.4k|    int ret;
 4990|       |
 4991|  72.4k|    assert(*len != 0);
 4992|       |
 4993|       |    /* Check if the first byte is something that we can handle, otherwise do not bother parsing / buffering the entire record as it
 4994|       |     * is obviously broken. SSL 2.0 handshakes fall into this path as well. */
 4995|  72.4k|    if (tls->recvbuf.rec.base == NULL) {
  ------------------
  |  Branch (4995:9): [True: 72.4k, False: 0]
  ------------------
 4996|  72.4k|        uint8_t type = src[0];
 4997|  72.4k|        switch (type) {
 4998|    217|        case PTLS_CONTENT_TYPE_CHANGE_CIPHER_SPEC:
  ------------------
  |  |   48|    217|#define PTLS_CONTENT_TYPE_CHANGE_CIPHER_SPEC 20
  ------------------
  |  Branch (4998:9): [True: 217, False: 72.2k]
  ------------------
 4999|    251|        case PTLS_CONTENT_TYPE_ALERT:
  ------------------
  |  |   49|    251|#define PTLS_CONTENT_TYPE_ALERT 21
  ------------------
  |  Branch (4999:9): [True: 34, False: 72.4k]
  ------------------
 5000|  70.7k|        case PTLS_CONTENT_TYPE_HANDSHAKE:
  ------------------
  |  |   50|  70.7k|#define PTLS_CONTENT_TYPE_HANDSHAKE 22
  ------------------
  |  Branch (5000:9): [True: 70.5k, False: 1.91k]
  ------------------
 5001|  72.3k|        case PTLS_CONTENT_TYPE_APPDATA:
  ------------------
  |  |   51|  72.3k|#define PTLS_CONTENT_TYPE_APPDATA 23
  ------------------
  |  Branch (5001:9): [True: 1.61k, False: 70.8k]
  ------------------
 5002|  72.3k|            break;
 5003|     55|        default:
  ------------------
  |  Branch (5003:9): [True: 55, False: 72.3k]
  ------------------
 5004|     55|            return PTLS_ALERT_DECODE_ERROR;
  ------------------
  |  |  219|     55|#define PTLS_ALERT_DECODE_ERROR 50
  ------------------
 5005|  72.4k|        }
 5006|  72.4k|    }
 5007|       |
 5008|  72.3k|    if (tls->recvbuf.rec.base == NULL && *len >= 5) {
  ------------------
  |  Branch (5008:9): [True: 72.3k, False: 0]
  |  Branch (5008:42): [True: 72.3k, False: 24]
  ------------------
 5009|       |        /* fast path */
 5010|  72.3k|        if ((ret = parse_record_header(rec, src)) != 0)
  ------------------
  |  Branch (5010:13): [True: 4, False: 72.3k]
  ------------------
 5011|      4|            return ret;
 5012|  72.3k|        if (5 + rec->length <= *len) {
  ------------------
  |  Branch (5012:13): [True: 72.2k, False: 81]
  ------------------
 5013|  72.2k|            rec->fragment = src + 5;
 5014|  72.2k|            *len = rec->length + 5;
 5015|  72.2k|            return 0;
 5016|  72.2k|        }
 5017|  72.3k|    }
 5018|       |
 5019|       |    /* slow path */
 5020|    105|    const uint8_t *const end = src + *len;
 5021|    105|    *rec = (struct st_ptls_record_t){0};
 5022|       |
 5023|    105|    if (tls->recvbuf.rec.base == NULL) {
  ------------------
  |  Branch (5023:9): [True: 105, False: 0]
  ------------------
 5024|    105|        ptls_buffer_init(&tls->recvbuf.rec, "", 0);
 5025|    105|        if ((ret = ptls_buffer_reserve(&tls->recvbuf.rec, 5)) != 0)
  ------------------
  |  Branch (5025:13): [True: 0, False: 105]
  ------------------
 5026|      0|            return ret;
 5027|    105|    }
 5028|       |
 5029|       |    /* fill and parse the header */
 5030|    541|    while (tls->recvbuf.rec.off < 5) {
  ------------------
  |  Branch (5030:12): [True: 460, False: 81]
  ------------------
 5031|    460|        if (src == end)
  ------------------
  |  Branch (5031:13): [True: 24, False: 436]
  ------------------
 5032|     24|            return PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  242|     24|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  193|     24|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 5033|    436|        tls->recvbuf.rec.base[tls->recvbuf.rec.off++] = *src++;
 5034|    436|    }
 5035|     81|    if ((ret = parse_record_header(rec, tls->recvbuf.rec.base)) != 0)
  ------------------
  |  Branch (5035:9): [True: 0, False: 81]
  ------------------
 5036|      0|        return ret;
 5037|       |
 5038|       |    /* fill the fragment */
 5039|     81|    size_t addlen = rec->length + 5 - tls->recvbuf.rec.off;
 5040|     81|    if (addlen != 0) {
  ------------------
  |  Branch (5040:9): [True: 81, False: 0]
  ------------------
 5041|     81|        if ((ret = ptls_buffer_reserve(&tls->recvbuf.rec, addlen)) != 0)
  ------------------
  |  Branch (5041:13): [True: 0, False: 81]
  ------------------
 5042|      0|            return ret;
 5043|     81|        if (addlen > (size_t)(end - src))
  ------------------
  |  Branch (5043:13): [True: 81, False: 0]
  ------------------
 5044|     81|            addlen = end - src;
 5045|     81|        if (addlen != 0) {
  ------------------
  |  Branch (5045:13): [True: 19, False: 62]
  ------------------
 5046|     19|            memcpy(tls->recvbuf.rec.base + tls->recvbuf.rec.off, src, addlen);
 5047|     19|            tls->recvbuf.rec.off += addlen;
 5048|     19|            src += addlen;
 5049|     19|        }
 5050|     81|    }
 5051|       |
 5052|       |    /* set rec->fragment if a complete record has been parsed */
 5053|     81|    if (tls->recvbuf.rec.off == rec->length + 5) {
  ------------------
  |  Branch (5053:9): [True: 0, False: 81]
  ------------------
 5054|      0|        rec->fragment = tls->recvbuf.rec.base + 5;
 5055|      0|        ret = 0;
 5056|     81|    } else {
 5057|     81|        ret = PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  242|     81|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  193|     81|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 5058|     81|    }
 5059|       |
 5060|     81|    *len -= end - src;
 5061|     81|    return ret;
 5062|     81|}
picotls.c:parse_record_header:
 4975|  72.4k|{
 4976|  72.4k|    rec->type = src[0];
 4977|  72.4k|    rec->version = ntoh16(src + 1);
 4978|  72.4k|    rec->length = ntoh16(src + 3);
 4979|       |
 4980|  72.4k|    if (rec->length >
  ------------------
  |  Branch (4980:9): [True: 4, False: 72.4k]
  ------------------
 4981|  72.4k|        (size_t)(rec->type == PTLS_CONTENT_TYPE_APPDATA ? PTLS_MAX_ENCRYPTED_RECORD_SIZE : PTLS_MAX_PLAINTEXT_RECORD_SIZE))
  ------------------
  |  |   51|  72.4k|#define PTLS_CONTENT_TYPE_APPDATA 23
  ------------------
                      (size_t)(rec->type == PTLS_CONTENT_TYPE_APPDATA ? PTLS_MAX_ENCRYPTED_RECORD_SIZE : PTLS_MAX_PLAINTEXT_RECORD_SIZE))
  ------------------
  |  |   43|  1.61k|#define PTLS_MAX_ENCRYPTED_RECORD_SIZE (16384 + 256)
  ------------------
                      (size_t)(rec->type == PTLS_CONTENT_TYPE_APPDATA ? PTLS_MAX_ENCRYPTED_RECORD_SIZE : PTLS_MAX_PLAINTEXT_RECORD_SIZE))
  ------------------
  |  |   42|  70.8k|#define PTLS_MAX_PLAINTEXT_RECORD_SIZE 16384
  ------------------
  |  Branch (4981:18): [True: 1.61k, False: 70.8k]
  ------------------
 4982|      4|        return PTLS_ALERT_DECODE_ERROR;
  ------------------
  |  |  219|      4|#define PTLS_ALERT_DECODE_ERROR 50
  ------------------
 4983|       |
 4984|  72.4k|    return 0;
 4985|  72.4k|}
picotls.c:aead_decrypt:
  680|  1.59k|{
  681|  1.59k|    if (inlen < 16) {
  ------------------
  |  Branch (681:9): [True: 7, False: 1.58k]
  ------------------
  682|      7|        return PTLS_ALERT_BAD_RECORD_MAC;
  ------------------
  |  |  209|      7|#define PTLS_ALERT_BAD_RECORD_MAC 20
  ------------------
  683|      7|    }
  684|  1.58k|    memcpy(output, input, inlen - 16);
  685|  1.58k|    *outlen = inlen - 16; /* removing the 16 bytes of tag */
  686|  1.58k|    return 0;
  687|  1.59k|}
picotls.c:handle_alert:
 5706|     23|{
 5707|     23|    if (len != 2)
  ------------------
  |  Branch (5707:9): [True: 8, False: 15]
  ------------------
 5708|      8|        return PTLS_ALERT_DECODE_ERROR;
  ------------------
  |  |  219|      8|#define PTLS_ALERT_DECODE_ERROR 50
  ------------------
 5709|       |
 5710|     15|    uint8_t desc = src[1];
 5711|       |
 5712|       |    /* all fatal alerts and USER_CANCELLED warning tears down the connection immediately, regardless of the transmitted level */
 5713|     15|    return PTLS_ALERT_TO_PEER_ERROR(desc);
  ------------------
  |  |  197|     15|#define PTLS_ALERT_TO_PEER_ERROR(e) ((e) + PTLS_ERROR_CLASS_PEER_ALERT)
  |  |  ------------------
  |  |  |  |  192|     15|#define PTLS_ERROR_CLASS_PEER_ALERT 0x100
  |  |  ------------------
  ------------------
 5714|     23|}
picotls.c:hmac_update:
 6180|  19.7k|{
 6181|  19.7k|    struct st_picotls_hmac_context_t *ctx = (struct st_picotls_hmac_context_t *)_ctx;
 6182|  19.7k|    ctx->hash->update(ctx->hash, src, len);
 6183|  19.7k|}
picotls.c:hmac_final:
 6197|  19.7k|{
 6198|  19.7k|    struct st_picotls_hmac_context_t *ctx = (struct st_picotls_hmac_context_t *)_ctx;
 6199|       |
 6200|  19.7k|    assert(mode != PTLS_HASH_FINAL_MODE_SNAPSHOT || !"not supported");
 6201|       |
 6202|  19.7k|    if (md != NULL) {
  ------------------
  |  Branch (6202:9): [True: 11.5k, False: 8.13k]
  ------------------
 6203|  11.5k|        ctx->hash->final(ctx->hash, md, PTLS_HASH_FINAL_MODE_RESET);
 6204|  11.5k|        hmac_apply_key(ctx, 0x5c);
 6205|  11.5k|        ctx->hash->update(ctx->hash, md, ctx->algo->digest_size);
 6206|  11.5k|    }
 6207|  19.7k|    ctx->hash->final(ctx->hash, md, mode);
 6208|       |
 6209|  19.7k|    switch (mode) {
 6210|  11.5k|    case PTLS_HASH_FINAL_MODE_FREE:
  ------------------
  |  Branch (6210:5): [True: 11.5k, False: 8.13k]
  ------------------
 6211|  11.5k|        ptls_clear_memory(ctx->key, ctx->algo->block_size);
 6212|  11.5k|        free(ctx);
 6213|  11.5k|        break;
 6214|  8.13k|    case PTLS_HASH_FINAL_MODE_RESET:
  ------------------
  |  Branch (6214:5): [True: 8.13k, False: 11.5k]
  ------------------
 6215|  8.13k|        hmac_apply_key(ctx, 0x36);
 6216|  8.13k|        break;
 6217|      0|    default:
  ------------------
  |  Branch (6217:5): [True: 0, False: 19.7k]
  ------------------
 6218|      0|        assert(!"FIXME");
 6219|      0|        break;
 6220|  19.7k|    }
 6221|  19.7k|}
picotls.c:hmac_apply_key:
 6186|  31.3k|{
 6187|  31.3k|    size_t i;
 6188|       |
 6189|  2.03M|    for (i = 0; i != ctx->algo->block_size; ++i)
  ------------------
  |  Branch (6189:17): [True: 2.00M, False: 31.3k]
  ------------------
 6190|  2.00M|        ctx->key[i] ^= pad;
 6191|  31.3k|    ctx->hash->update(ctx->hash, ctx->key, ctx->algo->block_size);
 6192|  2.03M|    for (i = 0; i != ctx->algo->block_size; ++i)
  ------------------
  |  Branch (6192:17): [True: 2.00M, False: 31.3k]
  ------------------
 6193|  2.00M|        ctx->key[i] ^= pad;
 6194|  31.3k|}
picotls.c:new_aead:
 6390|  2.32k|{
 6391|  2.32k|    ptls_aead_context_t *ctx = NULL;
 6392|  2.32k|    struct {
 6393|  2.32k|        uint8_t key[PTLS_MAX_SECRET_SIZE];
 6394|  2.32k|        uint8_t iv[PTLS_MAX_IV_SIZE];
 6395|  2.32k|    } key_iv;
 6396|  2.32k|    int ret;
 6397|       |
 6398|  2.32k|    if ((ret = get_traffic_keys(aead, hash, key_iv.key, key_iv.iv, secret, hash_value, label_prefix)) != 0)
  ------------------
  |  Branch (6398:9): [True: 0, False: 2.32k]
  ------------------
 6399|      0|        goto Exit;
 6400|  2.32k|    ctx = ptls_aead_new_direct(aead, is_enc, key_iv.key, key_iv.iv);
 6401|  2.32k|Exit:
 6402|  2.32k|    ptls_clear_memory(&key_iv, sizeof(key_iv));
 6403|  2.32k|    return ctx;
 6404|  2.32k|}
picotls.c:clear_memory:
 6463|   311k|{
 6464|   311k|    if (len != 0)
  ------------------
  |  Branch (6464:9): [True: 142k, False: 169k]
  ------------------
 6465|   142k|        memset(p, 0, len);
 6466|   311k|}
picotls.c:mem_equal:
 6471|  38.9k|{
 6472|  38.9k|    const volatile uint8_t *x = _x, *y = _y;
 6473|  38.9k|    uint8_t t = 0;
 6474|       |
 6475|  39.2k|    for (; len != 0; --len)
  ------------------
  |  Branch (6475:12): [True: 352, False: 38.9k]
  ------------------
 6476|    352|        t |= *x++ ^ *y++;
 6477|       |
 6478|  38.9k|    return t == 0;
 6479|  38.9k|}
picotls.c:handle_handshake_record:
 5730|  71.9k|{
 5731|  71.9k|    int ret;
 5732|       |
 5733|       |    /* handshake */
 5734|  71.9k|    if (rec->type != PTLS_CONTENT_TYPE_HANDSHAKE)
  ------------------
  |  |   50|  71.9k|#define PTLS_CONTENT_TYPE_HANDSHAKE 22
  ------------------
  |  Branch (5734:9): [True: 12, False: 71.9k]
  ------------------
 5735|     12|        return PTLS_ALERT_DECODE_ERROR;
  ------------------
  |  |  219|     12|#define PTLS_ALERT_DECODE_ERROR 50
  ------------------
 5736|       |
 5737|       |    /* flatten the unhandled messages */
 5738|  71.9k|    const uint8_t *src, *src_end;
 5739|  71.9k|    if (tls->recvbuf.mess.base == NULL) {
  ------------------
  |  Branch (5739:9): [True: 43.0k, False: 28.9k]
  ------------------
 5740|  43.0k|        src = rec->fragment;
 5741|  43.0k|        src_end = src + rec->length;
 5742|  43.0k|    } else {
 5743|  28.9k|        if (message_buffer_is_overflow(tls->ctx, tls->recvbuf.mess.off + rec->length))
  ------------------
  |  Branch (5743:13): [True: 0, False: 28.9k]
  ------------------
 5744|      0|            return PTLS_ALERT_HANDSHAKE_FAILURE;
  ------------------
  |  |  210|      0|#define PTLS_ALERT_HANDSHAKE_FAILURE 40
  ------------------
 5745|  28.9k|        if ((ret = ptls_buffer_reserve(&tls->recvbuf.mess, rec->length)) != 0)
  ------------------
  |  Branch (5745:13): [True: 0, False: 28.9k]
  ------------------
 5746|      0|            return ret;
 5747|  28.9k|        memcpy(tls->recvbuf.mess.base + tls->recvbuf.mess.off, rec->fragment, rec->length);
 5748|  28.9k|        tls->recvbuf.mess.off += rec->length;
 5749|  28.9k|        src = tls->recvbuf.mess.base;
 5750|  28.9k|        src_end = src + tls->recvbuf.mess.off;
 5751|  28.9k|    }
 5752|       |
 5753|       |    /* handle the messages */
 5754|  71.9k|    ret = PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  242|  71.9k|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  193|  71.9k|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 5755|   111k|    while (src_end - src >= 4) {
  ------------------
  |  Branch (5755:12): [True: 70.2k, False: 41.5k]
  ------------------
 5756|  70.2k|        size_t mess_len = 4 + ntoh24(src + 1);
 5757|  70.2k|        if (src_end - src < (int)mess_len)
  ------------------
  |  Branch (5757:13): [True: 28.6k, False: 41.5k]
  ------------------
 5758|  28.6k|            break;
 5759|  41.5k|        ret = cb(tls, emitter, ptls_iovec_init(src, mess_len), src_end - src == mess_len, properties);
 5760|  41.5k|        switch (ret) {
 5761|      0|        case 0:
  ------------------
  |  Branch (5761:9): [True: 0, False: 41.5k]
  ------------------
 5762|      0|        case PTLS_ERROR_ASYNC_OPERATION:
  ------------------
  |  |  251|      0|#define PTLS_ERROR_ASYNC_OPERATION (PTLS_ERROR_CLASS_INTERNAL + 11)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  |  Branch (5762:9): [True: 0, False: 41.5k]
  ------------------
 5763|  39.7k|        case PTLS_ERROR_IN_PROGRESS:
  ------------------
  |  |  242|  39.7k|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  193|  39.7k|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  |  Branch (5763:9): [True: 39.7k, False: 1.77k]
  ------------------
 5764|  39.7k|            break;
 5765|  1.77k|        default:
  ------------------
  |  Branch (5765:9): [True: 1.77k, False: 39.7k]
  ------------------
 5766|  1.77k|            ptls_buffer_dispose(&tls->recvbuf.mess);
 5767|  1.77k|            return ret;
 5768|  41.5k|        }
 5769|  39.7k|        src += mess_len;
 5770|  39.7k|    }
 5771|       |
 5772|       |    /* keep last partial message in buffer */
 5773|  70.1k|    if (src != src_end) {
  ------------------
  |  Branch (5773:9): [True: 29.0k, False: 41.1k]
  ------------------
 5774|  29.0k|        size_t new_size = src_end - src;
 5775|  29.0k|        if (message_buffer_is_overflow(tls->ctx, new_size))
  ------------------
  |  Branch (5775:13): [True: 0, False: 29.0k]
  ------------------
 5776|      0|            return PTLS_ALERT_HANDSHAKE_FAILURE;
  ------------------
  |  |  210|      0|#define PTLS_ALERT_HANDSHAKE_FAILURE 40
  ------------------
 5777|  29.0k|        if (tls->recvbuf.mess.base == NULL) {
  ------------------
  |  Branch (5777:13): [True: 1.18k, False: 27.8k]
  ------------------
 5778|  1.18k|            ptls_buffer_init(&tls->recvbuf.mess, "", 0);
 5779|  1.18k|            if ((ret = ptls_buffer_reserve(&tls->recvbuf.mess, new_size)) != 0)
  ------------------
  |  Branch (5779:17): [True: 0, False: 1.18k]
  ------------------
 5780|      0|                return ret;
 5781|  1.18k|            memcpy(tls->recvbuf.mess.base, src, new_size);
 5782|  27.8k|        } else {
 5783|  27.8k|            memmove(tls->recvbuf.mess.base, src, new_size);
 5784|  27.8k|        }
 5785|  29.0k|        tls->recvbuf.mess.off = new_size;
 5786|  29.0k|        ret = PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  242|  29.0k|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  193|  29.0k|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 5787|  41.1k|    } else {
 5788|  41.1k|        ptls_buffer_dispose(&tls->recvbuf.mess);
 5789|  41.1k|    }
 5790|       |
 5791|  70.1k|    return ret;
 5792|  70.1k|}
picotls.c:message_buffer_is_overflow:
 5717|  58.0k|{
 5718|  58.0k|    if (ctx->max_buffer_size == 0)
  ------------------
  |  Branch (5718:9): [True: 58.0k, False: 0]
  ------------------
 5719|  58.0k|        return 0;
 5720|      0|    if (size <= ctx->max_buffer_size)
  ------------------
  |  Branch (5720:9): [True: 0, False: 0]
  ------------------
 5721|      0|        return 0;
 5722|      0|    return 1;
 5723|      0|}
picotls.c:ntoh24:
  508|  70.2k|{
  509|  70.2k|    return (uint32_t)src[0] << 16 | (uint32_t)src[1] << 8 | src[2];
  510|  70.2k|}
picotls.c:handle_client_handshake_message:
 5551|  41.5k|{
 5552|  41.5k|    uint8_t type = message.base[0];
 5553|  41.5k|    int ret;
 5554|       |
 5555|  41.5k|    switch (tls->state) {
 5556|  2.05k|    case PTLS_STATE_CLIENT_EXPECT_SERVER_HELLO:
  ------------------
  |  Branch (5556:5): [True: 2.05k, False: 39.5k]
  ------------------
 5557|  39.6k|    case PTLS_STATE_CLIENT_EXPECT_SECOND_SERVER_HELLO:
  ------------------
  |  Branch (5557:5): [True: 37.5k, False: 3.96k]
  ------------------
 5558|  39.6k|        if (type == PTLS_HANDSHAKE_TYPE_SERVER_HELLO && is_end_of_record) {
  ------------------
  |  |  271|  79.3k|#define PTLS_HANDSHAKE_TYPE_SERVER_HELLO 2
  ------------------
  |  Branch (5558:13): [True: 39.6k, False: 36]
  |  Branch (5558:57): [True: 39.6k, False: 6]
  ------------------
 5559|  39.6k|            ret = client_handle_hello(tls, emitter, message, properties);
 5560|  39.6k|        } else {
 5561|     42|            ret = PTLS_ALERT_UNEXPECTED_MESSAGE;
  ------------------
  |  |  208|     42|#define PTLS_ALERT_UNEXPECTED_MESSAGE 10
  ------------------
 5562|     42|        }
 5563|  39.6k|        break;
 5564|  1.06k|    case PTLS_STATE_CLIENT_EXPECT_ENCRYPTED_EXTENSIONS:
  ------------------
  |  Branch (5564:5): [True: 1.06k, False: 40.4k]
  ------------------
 5565|  1.06k|        if (type == PTLS_HANDSHAKE_TYPE_ENCRYPTED_EXTENSIONS) {
  ------------------
  |  |  274|  1.06k|#define PTLS_HANDSHAKE_TYPE_ENCRYPTED_EXTENSIONS 8
  ------------------
  |  Branch (5565:13): [True: 1.05k, False: 10]
  ------------------
 5566|  1.05k|            ret = client_handle_encrypted_extensions(tls, message, properties);
 5567|  1.05k|        } else {
 5568|     10|            ret = PTLS_ALERT_UNEXPECTED_MESSAGE;
  ------------------
  |  |  208|     10|#define PTLS_ALERT_UNEXPECTED_MESSAGE 10
  ------------------
 5569|     10|        }
 5570|  1.06k|        break;
 5571|    713|    case PTLS_STATE_CLIENT_EXPECT_CERTIFICATE_REQUEST_OR_CERTIFICATE:
  ------------------
  |  Branch (5571:5): [True: 713, False: 40.8k]
  ------------------
 5572|    713|        if (type == PTLS_HANDSHAKE_TYPE_CERTIFICATE_REQUEST) {
  ------------------
  |  |  276|    713|#define PTLS_HANDSHAKE_TYPE_CERTIFICATE_REQUEST 13
  ------------------
  |  Branch (5572:13): [True: 286, False: 427]
  ------------------
 5573|    286|            ret = client_handle_certificate_request(tls, message, properties);
 5574|    286|            break;
 5575|    286|        }
 5576|       |    /* fall through */
 5577|    430|    case PTLS_STATE_CLIENT_EXPECT_CERTIFICATE:
  ------------------
  |  Branch (5577:5): [True: 3, False: 41.5k]
  ------------------
 5578|    430|        switch (type) {
 5579|    426|        case PTLS_HANDSHAKE_TYPE_CERTIFICATE:
  ------------------
  |  |  275|    426|#define PTLS_HANDSHAKE_TYPE_CERTIFICATE 11
  ------------------
  |  Branch (5579:9): [True: 426, False: 4]
  ------------------
 5580|    426|            ret = client_handle_certificate(tls, message);
 5581|    426|            break;
 5582|      2|        case PTLS_HANDSHAKE_TYPE_COMPRESSED_CERTIFICATE:
  ------------------
  |  |  280|      2|#define PTLS_HANDSHAKE_TYPE_COMPRESSED_CERTIFICATE 25
  ------------------
  |  Branch (5582:9): [True: 2, False: 428]
  ------------------
 5583|      2|            ret = client_handle_compressed_certificate(tls, message);
 5584|      2|            break;
 5585|      2|        default:
  ------------------
  |  Branch (5585:9): [True: 2, False: 428]
  ------------------
 5586|      2|            ret = PTLS_ALERT_UNEXPECTED_MESSAGE;
  ------------------
  |  |  208|      2|#define PTLS_ALERT_UNEXPECTED_MESSAGE 10
  ------------------
 5587|      2|            break;
 5588|    430|        }
 5589|    430|        break;
 5590|    430|    case PTLS_STATE_CLIENT_EXPECT_CERTIFICATE_VERIFY:
  ------------------
  |  Branch (5590:5): [True: 90, False: 41.4k]
  ------------------
 5591|     90|        if (type == PTLS_HANDSHAKE_TYPE_CERTIFICATE_VERIFY) {
  ------------------
  |  |  277|     90|#define PTLS_HANDSHAKE_TYPE_CERTIFICATE_VERIFY 15
  ------------------
  |  Branch (5591:13): [True: 81, False: 9]
  ------------------
 5592|     81|            ret = client_handle_certificate_verify(tls, message);
 5593|     81|        } else {
 5594|      9|            ret = PTLS_ALERT_UNEXPECTED_MESSAGE;
  ------------------
  |  |  208|      9|#define PTLS_ALERT_UNEXPECTED_MESSAGE 10
  ------------------
 5595|      9|        }
 5596|     90|        break;
 5597|     37|    case PTLS_STATE_CLIENT_EXPECT_FINISHED:
  ------------------
  |  Branch (5597:5): [True: 37, False: 41.5k]
  ------------------
 5598|     37|        if (type == PTLS_HANDSHAKE_TYPE_FINISHED && is_end_of_record) {
  ------------------
  |  |  278|     74|#define PTLS_HANDSHAKE_TYPE_FINISHED 20
  ------------------
  |  Branch (5598:13): [True: 21, False: 16]
  |  Branch (5598:53): [True: 18, False: 3]
  ------------------
 5599|     18|            ret = client_handle_finished(tls, emitter, message);
 5600|     19|        } else {
 5601|     19|            ret = PTLS_ALERT_UNEXPECTED_MESSAGE;
  ------------------
  |  |  208|     19|#define PTLS_ALERT_UNEXPECTED_MESSAGE 10
  ------------------
 5602|     19|        }
 5603|     37|        break;
 5604|      0|    case PTLS_STATE_CLIENT_POST_HANDSHAKE:
  ------------------
  |  Branch (5604:5): [True: 0, False: 41.5k]
  ------------------
 5605|      0|        switch (type) {
 5606|      0|        case PTLS_HANDSHAKE_TYPE_NEW_SESSION_TICKET:
  ------------------
  |  |  272|      0|#define PTLS_HANDSHAKE_TYPE_NEW_SESSION_TICKET 4
  ------------------
  |  Branch (5606:9): [True: 0, False: 0]
  ------------------
 5607|      0|            ret = client_handle_new_session_ticket(tls, message);
 5608|      0|            break;
 5609|      0|        case PTLS_HANDSHAKE_TYPE_KEY_UPDATE:
  ------------------
  |  |  279|      0|#define PTLS_HANDSHAKE_TYPE_KEY_UPDATE 24
  ------------------
  |  Branch (5609:9): [True: 0, False: 0]
  ------------------
 5610|      0|            ret = handle_key_update(tls, emitter, message);
 5611|      0|            break;
 5612|      0|        default:
  ------------------
  |  Branch (5612:9): [True: 0, False: 0]
  ------------------
 5613|      0|            ret = PTLS_ALERT_UNEXPECTED_MESSAGE;
  ------------------
  |  |  208|      0|#define PTLS_ALERT_UNEXPECTED_MESSAGE 10
  ------------------
 5614|      0|            break;
 5615|      0|        }
 5616|      0|        break;
 5617|      0|    default:
  ------------------
  |  Branch (5617:5): [True: 0, False: 41.5k]
  ------------------
 5618|      0|        assert(!"unexpected state");
 5619|      0|        ret = PTLS_ALERT_INTERNAL_ERROR;
  ------------------
  |  |  222|      0|#define PTLS_ALERT_INTERNAL_ERROR 80
  ------------------
 5620|      0|        break;
 5621|  41.5k|    }
 5622|       |
 5623|  41.5k|    PTLS_PROBE(RECEIVE_MESSAGE, tls, message.base[0], message.base + PTLS_HANDSHAKE_HEADER_SIZE,
 5624|  41.5k|               message.len - PTLS_HANDSHAKE_HEADER_SIZE, ret);
 5625|  41.5k|    PTLS_LOG_CONN(receive_message, tls, {
  ------------------
  |  | 1384|  41.5k|    do {                                                                                                                           \
  |  | 1385|  41.5k|        ptls_t *_tls = (tls);                                                                                                      \
  |  | 1386|  41.5k|        if (!ptls_log.is_active || ptls_skip_tracing(_tls))                                                                        \
  |  |  ------------------
  |  |  |  Branch (1386:13): [True: 41.5k, False: 0]
  |  |  |  Branch (1386:36): [True: 0, False: 0]
  |  |  ------------------
  |  | 1387|  41.5k|            break;                                                                                                                 \
  |  | 1388|  41.5k|        PTLS_LOG__DO_LOG(picotls, type, {                                                                                          \
  |  |  ------------------
  |  |  |  | 1361|      0|    do {                                                                                                                           \
  |  |  |  | 1362|      0|        int ptlslog_skip = 0;                                                                                                      \
  |  |  |  | 1363|      0|        char smallbuf[128];                                                                                                        \
  |  |  |  | 1364|      0|        ptls_buffer_t ptlslogbuf;                                                                                                  \
  |  |  |  | 1365|      0|        ptls_buffer_init(&ptlslogbuf, smallbuf, sizeof(smallbuf));                                                                 \
  |  |  |  | 1366|      0|        PTLS_LOG__DO_PUSH_SAFESTR("{\"module\":\"" PTLS_TO_STR(module) "\",\"type\":\"" PTLS_TO_STR(type) "\"");                   \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1448|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1449|      0|        if (PTLS_UNLIKELY(!ptlslog_skip && !ptls_log__do_push_safestr(&ptlslogbuf, (v))))                                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   40|      0|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (40:26): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (40:46): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (40:46): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1450|      0|            ptlslog_skip = 1;                                                                                                      \
  |  |  |  |  |  | 1451|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1451:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1367|      0|        do {                                                                                                                       \
  |  |  |  | 1368|      0|            block                                                                                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1368:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1369|      0|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1369:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1370|      0|        PTLS_LOG__DO_PUSH_SAFESTR("}\n");                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1448|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1449|      0|        if (PTLS_UNLIKELY(!ptlslog_skip && !ptls_log__do_push_safestr(&ptlslogbuf, (v))))                                          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   40|      0|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (40:26): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (40:46): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (40:46): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1450|      0|            ptlslog_skip = 1;                                                                                                      \
  |  |  |  |  |  | 1451|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1451:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1371|      0|        if (!ptlslog_skip)                                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1371:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1372|      0|            ptls_log__do_write(&ptlslogbuf);                                                                                       \
  |  |  |  | 1373|      0|        ptls_buffer_dispose(&ptlslogbuf);                                                                                          \
  |  |  |  | 1374|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1374:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1389|      0|            PTLS_LOG_ELEMENT_PTR(tls, _tls);                                                                                       \
  |  | 1390|      0|            do {                                                                                                                   \
  |  | 1391|      0|                block                                                                                                              \
  |  | 1392|      0|            } while (0);                                                                                                           \
  |  | 1393|      0|        });                                                                                                                        \
  |  | 1394|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1394:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 5626|  41.5k|        PTLS_LOG_ELEMENT_UNSIGNED(message, message.base[0]);
 5627|  41.5k|        PTLS_LOG_ELEMENT_UNSIGNED(len, message.len - PTLS_HANDSHAKE_HEADER_SIZE);
 5628|  41.5k|        PTLS_LOG_ELEMENT_SIGNED(result, ret);
 5629|  41.5k|    });
 5630|       |
 5631|      0|    return ret;
 5632|  41.5k|}
picotls.c:client_handle_hello:
 2786|  39.6k|{
 2787|  39.6k|    struct st_ptls_server_hello_t sh;
 2788|  39.6k|    ptls_iovec_t ecdh_secret = {NULL};
 2789|  39.6k|    int ret;
 2790|       |
 2791|  39.6k|    if ((ret = decode_server_hello(tls, &sh, message.base + PTLS_HANDSHAKE_HEADER_SIZE, message.base + message.len)) != 0)
  ------------------
  |  |   56|  39.6k|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
  |  Branch (2791:9): [True: 687, False: 38.9k]
  ------------------
 2792|    687|        goto Exit;
 2793|  38.9k|    if (!(sh.legacy_session_id.len == tls->client.legacy_session_id.len &&
  ------------------
  |  Branch (2793:11): [True: 38.9k, False: 7]
  ------------------
 2794|  38.9k|          ptls_mem_equal(sh.legacy_session_id.base, tls->client.legacy_session_id.base, tls->client.legacy_session_id.len))) {
  ------------------
  |  Branch (2794:11): [True: 38.9k, False: 0]
  ------------------
 2795|      7|        ret = PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  216|      7|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 2796|      7|        goto Exit;
 2797|      7|    }
 2798|       |
 2799|  38.9k|    if (sh.is_retry_request) {
  ------------------
  |  Branch (2799:9): [True: 37.7k, False: 1.16k]
  ------------------
 2800|  37.7k|        if ((ret = key_schedule_select_cipher(tls->key_schedule, tls->cipher_suite, 0, tls->ctx->pre_shared_key.secret)) != 0)
  ------------------
  |  Branch (2800:13): [True: 0, False: 37.7k]
  ------------------
 2801|      0|            goto Exit;
 2802|  37.7k|        key_schedule_transform_post_ch1hash(tls->key_schedule);
 2803|  37.7k|        if (tls->ech.aead != NULL) {
  ------------------
  |  Branch (2803:13): [True: 0, False: 37.7k]
  ------------------
 2804|      0|            size_t confirm_hash_off = 0;
 2805|      0|            if (tls->ech.offered) {
  ------------------
  |  Branch (2805:17): [True: 0, False: 0]
  ------------------
 2806|      0|                if (sh.retry_request.ech != NULL)
  ------------------
  |  Branch (2806:21): [True: 0, False: 0]
  ------------------
 2807|      0|                    confirm_hash_off = sh.retry_request.ech - message.base;
 2808|      0|            } else {
 2809|      0|                assert(tls->ech.offered_grease);
 2810|      0|            }
 2811|      0|            if ((ret = client_ech_select_hello(tls, message, confirm_hash_off, ECH_CONFIRMATION_HRR)) != 0)
  ------------------
  |  | 1200|      0|#define ECH_CONFIRMATION_HRR "hrr ech accept confirmation"
  ------------------
  |  Branch (2811:17): [True: 0, False: 0]
  ------------------
 2812|      0|                goto Exit;
 2813|      0|        }
 2814|  37.7k|        ptls__key_schedule_update_hash(tls->key_schedule, message.base, message.len, 0);
 2815|  37.7k|        return handle_hello_retry_request(tls, emitter, &sh, message, properties);
 2816|  37.7k|    }
 2817|       |
 2818|  1.16k|    if ((ret = key_schedule_select_cipher(tls->key_schedule, tls->cipher_suite, tls->client.offered_psk && !tls->is_psk_handshake,
  ------------------
  |  Branch (2818:9): [True: 0, False: 1.16k]
  |  Branch (2818:81): [True: 0, False: 1.16k]
  |  Branch (2818:108): [True: 0, False: 0]
  ------------------
 2819|  1.16k|                                          ptls_iovec_init(NULL, 0))) != 0)
 2820|      0|        goto Exit;
 2821|       |
 2822|       |    /* check if ECH is accepted */
 2823|  1.16k|    if (tls->ech.aead != NULL) {
  ------------------
  |  Branch (2823:9): [True: 0, False: 1.16k]
  ------------------
 2824|      0|        size_t confirm_hash_off = 0;
 2825|      0|        if (tls->ech.offered) {
  ------------------
  |  Branch (2825:13): [True: 0, False: 0]
  ------------------
 2826|      0|            confirm_hash_off =
 2827|      0|                PTLS_HANDSHAKE_HEADER_SIZE + 2 /* legacy_version */ + PTLS_HELLO_RANDOM_SIZE - PTLS_ECH_CONFIRM_LENGTH;
  ------------------
  |  |   56|      0|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
                              PTLS_HANDSHAKE_HEADER_SIZE + 2 /* legacy_version */ + PTLS_HELLO_RANDOM_SIZE - PTLS_ECH_CONFIRM_LENGTH;
  ------------------
  |  |   74|      0|#define PTLS_HELLO_RANDOM_SIZE 32
  ------------------
                              PTLS_HANDSHAKE_HEADER_SIZE + 2 /* legacy_version */ + PTLS_HELLO_RANDOM_SIZE - PTLS_ECH_CONFIRM_LENGTH;
  ------------------
  |  |   81|      0|#define PTLS_ECH_CONFIRM_LENGTH 8
  ------------------
 2828|      0|        } else {
 2829|      0|            assert(tls->ech.offered_grease);
 2830|      0|        }
 2831|      0|        if ((ret = client_ech_select_hello(tls, message, confirm_hash_off, ECH_CONFIRMATION_SERVER_HELLO)) != 0)
  ------------------
  |  | 1199|      0|#define ECH_CONFIRMATION_SERVER_HELLO "ech accept confirmation"
  ------------------
  |  Branch (2831:13): [True: 0, False: 0]
  ------------------
 2832|      0|            goto Exit;
 2833|      0|    }
 2834|       |
 2835|       |    /* clear sensitive and space-consuming ECH state, now that are done with handling sending and decoding Hellos */
 2836|  1.16k|    clear_ech(&tls->ech, 0);
 2837|  1.16k|    if (tls->key_schedule->hashes[0].ctx_outer != NULL) {
  ------------------
  |  Branch (2837:9): [True: 0, False: 1.16k]
  ------------------
 2838|      0|        tls->key_schedule->hashes[0].ctx_outer->final(tls->key_schedule->hashes[0].ctx_outer, NULL, PTLS_HASH_FINAL_MODE_FREE);
 2839|      0|        tls->key_schedule->hashes[0].ctx_outer = NULL;
 2840|      0|    }
 2841|       |
 2842|       |    /* if the client offered external PSK but the server did not use that, we call it a handshake failure */
 2843|  1.16k|    if (tls->ctx->pre_shared_key.identity.base != NULL && !tls->is_psk_handshake) {
  ------------------
  |  Branch (2843:9): [True: 0, False: 1.16k]
  |  Branch (2843:59): [True: 0, False: 0]
  ------------------
 2844|      0|        ret = PTLS_ALERT_HANDSHAKE_FAILURE;
  ------------------
  |  |  210|      0|#define PTLS_ALERT_HANDSHAKE_FAILURE 40
  ------------------
 2845|      0|        goto Exit;
 2846|      0|    }
 2847|       |
 2848|  1.16k|    ptls__key_schedule_update_hash(tls->key_schedule, message.base, message.len, 0);
 2849|       |
 2850|  1.16k|    if (sh.peerkey.base != NULL) {
  ------------------
  |  Branch (2850:9): [True: 1.16k, False: 0]
  ------------------
 2851|  1.16k|        if ((ret = tls->client.key_share_ctx->on_exchange(&tls->client.key_share_ctx, 1, &ecdh_secret, sh.peerkey)) != 0)
  ------------------
  |  Branch (2851:13): [True: 4, False: 1.16k]
  ------------------
 2852|      4|            goto Exit;
 2853|  1.16k|    }
 2854|       |
 2855|  1.16k|    if ((ret = key_schedule_extract(tls->key_schedule, ecdh_secret)) != 0)
  ------------------
  |  Branch (2855:9): [True: 0, False: 1.16k]
  ------------------
 2856|      0|        goto Exit;
 2857|  1.16k|    if ((ret = setup_traffic_protection(tls, 0, "s hs traffic", 2, 0, 0)) != 0)
  ------------------
  |  Branch (2857:9): [True: 0, False: 1.16k]
  ------------------
 2858|      0|        goto Exit;
 2859|  1.16k|    if (tls->client.using_early_data) {
  ------------------
  |  Branch (2859:9): [True: 0, False: 1.16k]
  ------------------
 2860|      0|        if ((tls->pending_handshake_secret = malloc(PTLS_MAX_DIGEST_SIZE)) == NULL) {
  ------------------
  |  |  120|      0|#define PTLS_MAX_DIGEST_SIZE 64
  ------------------
  |  Branch (2860:13): [True: 0, False: 0]
  ------------------
 2861|      0|            ret = PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  241|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 2862|      0|            goto Exit;
 2863|      0|        }
 2864|      0|        if ((ret = derive_secret(tls->key_schedule, tls->pending_handshake_secret, "c hs traffic")) != 0)
  ------------------
  |  Branch (2864:13): [True: 0, False: 0]
  ------------------
 2865|      0|            goto Exit;
 2866|      0|        if (tls->ctx->update_traffic_key != NULL &&
  ------------------
  |  Branch (2866:13): [True: 0, False: 0]
  ------------------
 2867|      0|            (ret = tls->ctx->update_traffic_key->cb(tls->ctx->update_traffic_key, tls, 1, 2, tls->pending_handshake_secret)) != 0)
  ------------------
  |  Branch (2867:13): [True: 0, False: 0]
  ------------------
 2868|      0|            goto Exit;
 2869|  1.16k|    } else {
 2870|  1.16k|        if ((ret = setup_traffic_protection(tls, 1, "c hs traffic", 2, 0, 0)) != 0)
  ------------------
  |  Branch (2870:13): [True: 0, False: 1.16k]
  ------------------
 2871|      0|            goto Exit;
 2872|  1.16k|    }
 2873|       |
 2874|  1.16k|    tls->state = PTLS_STATE_CLIENT_EXPECT_ENCRYPTED_EXTENSIONS;
 2875|  1.16k|    ret = PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  242|  1.16k|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  193|  1.16k|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 2876|       |
 2877|  1.85k|Exit:
 2878|  1.85k|    if (ecdh_secret.base != NULL) {
  ------------------
  |  Branch (2878:9): [True: 1.16k, False: 698]
  ------------------
 2879|  1.16k|        ptls_clear_memory(ecdh_secret.base, ecdh_secret.len);
 2880|  1.16k|        free(ecdh_secret.base);
 2881|  1.16k|    }
 2882|  1.85k|    return ret;
 2883|  1.16k|}
picotls.c:decode_server_hello:
 2560|  39.6k|{
 2561|  39.6k|    int ret;
 2562|       |
 2563|  39.6k|    *sh = (struct st_ptls_server_hello_t){{0}};
 2564|       |
 2565|       |    /* ignore legacy-version */
 2566|  39.6k|    if (end - src < 2) {
  ------------------
  |  Branch (2566:9): [True: 9, False: 39.6k]
  ------------------
 2567|      9|        ret = PTLS_ALERT_DECODE_ERROR;
  ------------------
  |  |  219|      9|#define PTLS_ALERT_DECODE_ERROR 50
  ------------------
 2568|      9|        goto Exit;
 2569|      9|    }
 2570|  39.6k|    src += 2;
 2571|       |
 2572|       |    /* random */
 2573|  39.6k|    if (end - src < PTLS_HELLO_RANDOM_SIZE) {
  ------------------
  |  |   74|  39.6k|#define PTLS_HELLO_RANDOM_SIZE 32
  ------------------
  |  Branch (2573:9): [True: 9, False: 39.5k]
  ------------------
 2574|      9|        ret = PTLS_ALERT_DECODE_ERROR;
  ------------------
  |  |  219|      9|#define PTLS_ALERT_DECODE_ERROR 50
  ------------------
 2575|      9|        goto Exit;
 2576|      9|    }
 2577|  39.5k|    sh->is_retry_request = memcmp(src, hello_retry_random, PTLS_HELLO_RANDOM_SIZE) == 0;
  ------------------
  |  |   74|  39.5k|#define PTLS_HELLO_RANDOM_SIZE 32
  ------------------
 2578|  39.5k|    src += PTLS_HELLO_RANDOM_SIZE;
  ------------------
  |  |   74|  39.5k|#define PTLS_HELLO_RANDOM_SIZE 32
  ------------------
 2579|       |
 2580|       |    /* legacy_session_id */
 2581|  39.5k|    ptls_decode_open_block(src, end, 1, {
  ------------------
  |  | 1307|  39.5k|    do {                                                                                                                           \
  |  | 1308|  39.5k|        size_t _capacity = (capacity);                                                                                             \
  |  | 1309|  39.5k|        size_t _block_size;                                                                                                        \
  |  | 1310|  39.5k|        if (_capacity == -1) {                                                                                                     \
  |  |  ------------------
  |  |  |  Branch (1310:13): [True: 0, False: 39.5k]
  |  |  ------------------
  |  | 1311|      0|            uint64_t _block_size64;                                                                                                \
  |  | 1312|      0|            const uint8_t *_src = (src);                                                                                           \
  |  | 1313|      0|            if ((_block_size64 = ptls_decode_quicint(&_src, end)) == UINT64_MAX ||                                                 \
  |  |  ------------------
  |  |  |  Branch (1313:17): [True: 0, False: 0]
  |  |  ------------------
  |  | 1314|      0|                (sizeof(size_t) < 8 && (_block_size64 >> (8 * sizeof(size_t))) != 0)) {                                            \
  |  |  ------------------
  |  |  |  Branch (1314:18): [Folded - Ignored]
  |  |  |  Branch (1314:40): [True: 0, False: 0]
  |  |  ------------------
  |  | 1315|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1316|      0|                goto Exit;                                                                                                         \
  |  | 1317|      0|            }                                                                                                                      \
  |  | 1318|      0|            (src) = _src;                                                                                                          \
  |  | 1319|      0|            _block_size = (size_t)_block_size64;                                                                                   \
  |  | 1320|  39.5k|        } else {                                                                                                                   \
  |  | 1321|  39.5k|            if (_capacity > (size_t)(end - (src))) {                                                                               \
  |  |  ------------------
  |  |  |  Branch (1321:17): [True: 129, False: 39.4k]
  |  |  ------------------
  |  | 1322|    129|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  219|    129|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1323|    129|                goto Exit;                                                                                                         \
  |  | 1324|    129|            }                                                                                                                      \
  |  | 1325|  39.5k|            _block_size = 0;                                                                                                       \
  |  | 1326|  39.4k|            do {                                                                                                                   \
  |  | 1327|  39.4k|                _block_size = _block_size << 8 | *(src)++;                                                                         \
  |  | 1328|  39.4k|            } while (--_capacity != 0);                                                                                            \
  |  |  ------------------
  |  |  |  Branch (1328:22): [True: 0, False: 39.4k]
  |  |  ------------------
  |  | 1329|  39.4k|        }                                                                                                                          \
  |  | 1330|  39.5k|        if (_block_size > (size_t)(end - (src))) {                                                                                 \
  |  |  ------------------
  |  |  |  Branch (1330:13): [True: 14, False: 39.4k]
  |  |  ------------------
  |  | 1331|     14|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  ------------------
  |  |  |  |  219|     14|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1332|     14|            goto Exit;                                                                                                             \
  |  | 1333|     14|        }                                                                                                                          \
  |  | 1334|  39.4k|        do {                                                                                                                       \
  |  | 1335|  39.4k|            const uint8_t *const end = (src) + _block_size;                                                                        \
  |  | 1336|  39.4k|            do {                                                                                                                   \
  |  | 1337|  39.4k|                block                                                                                                              \
  |  |  ------------------
  |  |  |  Branch (1337:17): [True: 13, False: 39.4k]
  |  |  ------------------
  |  | 1338|  39.4k|            } while (0);                                                                                                           \
  |  |  ------------------
  |  |  |  Branch (1338:22): [Folded - Ignored]
  |  |  ------------------
  |  | 1339|  39.4k|            if ((src) != end) {                                                                                                    \
  |  |  ------------------
  |  |  |  Branch (1339:17): [True: 0, False: 39.4k]
  |  |  ------------------
  |  | 1340|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1341|      0|                goto Exit;                                                                                                         \
  |  | 1342|      0|            }                                                                                                                      \
  |  | 1343|  39.4k|        } while (0);                                                                                                               \
  |  |  ------------------
  |  |  |  Branch (1343:18): [Folded - Ignored]
  |  |  ------------------
  |  | 1344|  39.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1344:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2582|  39.5k|        if (end - src > 32) {
 2583|  39.5k|            ret = PTLS_ALERT_DECODE_ERROR;
 2584|  39.5k|            goto Exit;
 2585|  39.5k|        }
 2586|  39.5k|        sh->legacy_session_id = ptls_iovec_init(src, end - src);
 2587|  39.5k|        src = end;
 2588|  39.5k|    });
 2589|       |
 2590|  39.4k|    { /* select cipher_suite */
 2591|  39.4k|        uint16_t csid;
 2592|  39.4k|        if ((ret = ptls_decode16(&csid, &src, end)) != 0)
  ------------------
  |  Branch (2592:13): [True: 9, False: 39.4k]
  ------------------
 2593|      9|            goto Exit;
 2594|  39.4k|        if ((tls->cipher_suite = ptls_find_cipher_suite(tls->ctx->cipher_suites, csid)) == NULL) {
  ------------------
  |  Branch (2594:13): [True: 36, False: 39.3k]
  ------------------
 2595|     36|            ret = PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  216|     36|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 2596|     36|            goto Exit;
 2597|     36|        }
 2598|  39.4k|    }
 2599|       |
 2600|  39.3k|    { /* legacy_compression_method */
 2601|  39.3k|        uint8_t method;
 2602|  39.3k|        if ((ret = ptls_decode8(&method, &src, end)) != 0)
  ------------------
  |  Branch (2602:13): [True: 7, False: 39.3k]
  ------------------
 2603|      7|            goto Exit;
 2604|  39.3k|        if (method != 0) {
  ------------------
  |  Branch (2604:13): [True: 11, False: 39.3k]
  ------------------
 2605|     11|            ret = PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  216|     11|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 2606|     11|            goto Exit;
 2607|     11|        }
 2608|  39.3k|    }
 2609|       |
 2610|  39.3k|    if (sh->is_retry_request)
  ------------------
  |  Branch (2610:9): [True: 37.8k, False: 1.50k]
  ------------------
 2611|  37.8k|        sh->retry_request.selected_group = UINT16_MAX;
 2612|       |
 2613|  39.3k|    uint16_t exttype, found_version = UINT16_MAX, selected_psk_identity = UINT16_MAX;
 2614|  39.3k|    decode_extensions(src, end, sh->is_retry_request ? PTLS_HANDSHAKE_TYPE_PSEUDO_HRR : PTLS_HANDSHAKE_TYPE_SERVER_HELLO, &exttype,
  ------------------
  |  |  886|  39.3k|    do {                                                                                                                           \
  |  |  887|  39.3k|        decode_open_extensions((src), end, hstype, exttype, block);                                                                \
  |  |  ------------------
  |  |  |  |  870|  39.3k|    do {                                                                                                                           \
  |  |  |  |  871|  39.3k|        struct st_ptls_extension_bitmap_t bitmap = {0};                                                                            \
  |  |  |  |  872|  39.3k|        ptls_decode_open_block((src), end, 2, {                                                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1307|  39.3k|    do {                                                                                                                           \
  |  |  |  |  |  | 1308|  39.3k|        size_t _capacity = (capacity);                                                                                             \
  |  |  |  |  |  | 1309|  39.3k|        size_t _block_size;                                                                                                        \
  |  |  |  |  |  | 1310|  39.3k|        if (_capacity == -1) {                                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1310:13): [True: 0, False: 39.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1311|      0|            uint64_t _block_size64;                                                                                                \
  |  |  |  |  |  | 1312|      0|            const uint8_t *_src = (src);                                                                                           \
  |  |  |  |  |  | 1313|      0|            if ((_block_size64 = ptls_decode_quicint(&_src, end)) == UINT64_MAX ||                                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1313:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1314|      0|                (sizeof(size_t) < 8 && (_block_size64 >> (8 * sizeof(size_t))) != 0)) {                                            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1314:18): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1314:40): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1315|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1316|      0|                goto Exit;                                                                                                         \
  |  |  |  |  |  | 1317|      0|            }                                                                                                                      \
  |  |  |  |  |  | 1318|      0|            (src) = _src;                                                                                                          \
  |  |  |  |  |  | 1319|      0|            _block_size = (size_t)_block_size64;                                                                                   \
  |  |  |  |  |  | 1320|  39.3k|        } else {                                                                                                                   \
  |  |  |  |  |  | 1321|  39.3k|            if (_capacity > (size_t)(end - (src))) {                                                                               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1321:17): [True: 10, False: 39.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1322|     10|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  219|     10|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1323|     10|                goto Exit;                                                                                                         \
  |  |  |  |  |  | 1324|     10|            }                                                                                                                      \
  |  |  |  |  |  | 1325|  39.3k|            _block_size = 0;                                                                                                       \
  |  |  |  |  |  | 1326|  78.7k|            do {                                                                                                                   \
  |  |  |  |  |  | 1327|  78.7k|                _block_size = _block_size << 8 | *(src)++;                                                                         \
  |  |  |  |  |  | 1328|  78.7k|            } while (--_capacity != 0);                                                                                            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1328:22): [True: 39.3k, False: 39.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1329|  39.3k|        }                                                                                                                          \
  |  |  |  |  |  | 1330|  39.3k|        if (_block_size > (size_t)(end - (src))) {                                                                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1330:13): [True: 30, False: 39.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1331|     30|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  219|     30|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1332|     30|            goto Exit;                                                                                                             \
  |  |  |  |  |  | 1333|     30|        }                                                                                                                          \
  |  |  |  |  |  | 1334|  39.3k|        do {                                                                                                                       \
  |  |  |  |  |  | 1335|  39.3k|            const uint8_t *const end = (src) + _block_size;                                                                        \
  |  |  |  |  |  | 1336|  39.3k|            do {                                                                                                                   \
  |  |  |  |  |  | 1337|  1.51M|                block                                                                                                              \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1337:17): [True: 6, False: 44.3k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 41.3k, False: 3.05k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 37, False: 44.3k]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 75, False: 44.2k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 44.2k, False: 44.2k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 44.3k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 54, False: 44.2k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 44.2k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 2, False: 38.9k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 1.59k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 2, False: 364]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 38, False: 1.19k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 3, False: 1.18k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 1.18k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 19, False: 1.16k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 366, False: 1.22k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 1.45k, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 2, False: 1.45k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 1.45k, False: 1.45k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 1.45k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 36, False: 1.42k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 1, False: 1.41k]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 1.41k]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 14, False: 1.40k]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 37, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 1, False: 36]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 3, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 3]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 3]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 2.15k, False: 42.0k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 3, False: 44.2k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 37, False: 44.1k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 1.45k, False: 42.7k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 1.59k, False: 42.6k]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 38.9k, False: 5.24k]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 33, False: 44.0k]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 44.4k, False: 39.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1338|  39.3k|            } while (0);                                                                                                           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1338:22): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1339|  39.3k|            if ((src) != end) {                                                                                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1339:17): [True: 0, False: 39.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1340|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1341|      0|                goto Exit;                                                                                                         \
  |  |  |  |  |  | 1342|      0|            }                                                                                                                      \
  |  |  |  |  |  | 1343|  39.0k|        } while (0);                                                                                                               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1343:18): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1344|  39.3k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1344:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  873|  39.3k|            while ((src) != end) {                                                                                                 \
  |  |  |  |  874|  39.3k|                if ((ret = ptls_decode16((exttype), &(src), end)) != 0)                                                            \
  |  |  |  |  875|  39.3k|                    goto Exit;                                                                                                     \
  |  |  |  |  876|  39.3k|                if (!extension_bitmap_testandset(&bitmap, (hstype), *(exttype))) {                                                 \
  |  |  |  |  877|  39.3k|                    ret = PTLS_ALERT_ILLEGAL_PARAMETER;                                                                            \
  |  |  |  |  878|  39.3k|                    goto Exit;                                                                                                     \
  |  |  |  |  879|  39.3k|                }                                                                                                                  \
  |  |  |  |  880|  39.3k|                ptls_decode_open_block((src), end, 2, block);                                                                      \
  |  |  |  |  881|  39.3k|            }                                                                                                                      \
  |  |  |  |  882|  39.3k|        });                                                                                                                        \
  |  |  |  |  883|  39.3k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (883:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  888|  39.3k|        ptls_decode_assert_block_close((src), end);                                                                                \
  |  |  ------------------
  |  |  |  | 1347|  39.0k|    do {                                                                                                                           \
  |  |  |  | 1348|  39.0k|        if ((src) != end) {                                                                                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1348:13): [True: 1, False: 39.0k]
  |  |  |  |  ------------------
  |  |  |  | 1349|      1|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|      1|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1350|      1|            goto Exit;                                                                                                             \
  |  |  |  | 1351|      1|        }                                                                                                                          \
  |  |  |  | 1352|  39.0k|    } while (0);
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1352:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  889|  39.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (889:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2615|  39.3k|                      {
 2616|  39.3k|                          if (tls->ctx->on_extension != NULL &&
 2617|  39.3k|                              (ret = tls->ctx->on_extension->cb(tls->ctx->on_extension, tls, PTLS_HANDSHAKE_TYPE_SERVER_HELLO,
 2618|  39.3k|                                                                exttype, ptls_iovec_init(src, end - src)) != 0))
 2619|  39.3k|                              goto Exit;
 2620|  39.3k|                          switch (exttype) {
 2621|  39.3k|                          case PTLS_EXTENSION_TYPE_SUPPORTED_VERSIONS:
 2622|  39.3k|                              if ((ret = ptls_decode16(&found_version, &src, end)) != 0)
 2623|  39.3k|                                  goto Exit;
 2624|  39.3k|                              break;
 2625|  39.3k|                          case PTLS_EXTENSION_TYPE_KEY_SHARE:
 2626|  39.3k|                              if (tls->ctx->key_exchanges == NULL) {
 2627|  39.3k|                                  ret = PTLS_ALERT_HANDSHAKE_FAILURE;
 2628|  39.3k|                                  goto Exit;
 2629|  39.3k|                              }
 2630|  39.3k|                              if (sh->is_retry_request) {
 2631|  39.3k|                                  if ((ret = ptls_decode16(&sh->retry_request.selected_group, &src, end)) != 0)
 2632|  39.3k|                                      goto Exit;
 2633|  39.3k|                              } else {
 2634|  39.3k|                                  uint16_t group;
 2635|  39.3k|                                  if ((ret = decode_key_share_entry(&group, &sh->peerkey, &src, end)) != 0)
 2636|  39.3k|                                      goto Exit;
 2637|  39.3k|                                  if (src != end) {
 2638|  39.3k|                                      ret = PTLS_ALERT_DECODE_ERROR;
 2639|  39.3k|                                      goto Exit;
 2640|  39.3k|                                  }
 2641|  39.3k|                                  if (tls->key_share == NULL || tls->key_share->id != group) {
 2642|  39.3k|                                      ret = PTLS_ALERT_ILLEGAL_PARAMETER;
 2643|  39.3k|                                      goto Exit;
 2644|  39.3k|                                  }
 2645|  39.3k|                              }
 2646|  39.3k|                              break;
 2647|  39.3k|                          case PTLS_EXTENSION_TYPE_COOKIE:
 2648|  39.3k|                              assert(sh->is_retry_request);
 2649|  39.3k|                              ptls_decode_block(src, end, 2, {
 2650|  39.3k|                                  if (src == end) {
 2651|  39.3k|                                      ret = PTLS_ALERT_DECODE_ERROR;
 2652|  39.3k|                                      goto Exit;
 2653|  39.3k|                                  }
 2654|  39.3k|                                  sh->retry_request.cookie = ptls_iovec_init(src, end - src);
 2655|  39.3k|                                  src = end;
 2656|  39.3k|                              });
 2657|  39.3k|                              break;
 2658|  39.3k|                          case PTLS_EXTENSION_TYPE_PRE_SHARED_KEY:
 2659|  39.3k|                              assert(!sh->is_retry_request);
 2660|  39.3k|                              if ((ret = ptls_decode16(&selected_psk_identity, &src, end)) != 0)
 2661|  39.3k|                                  goto Exit;
 2662|  39.3k|                              break;
 2663|  39.3k|                          case PTLS_EXTENSION_TYPE_ENCRYPTED_CLIENT_HELLO:
 2664|  39.3k|                              assert(sh->is_retry_request);
 2665|  39.3k|                              if (!(tls->ech.offered || tls->ech.offered_grease)) {
 2666|  39.3k|                                  ret = PTLS_ALERT_UNSUPPORTED_EXTENSION;
 2667|  39.3k|                                  goto Exit;
 2668|  39.3k|                              }
 2669|  39.3k|                              if (end - src != PTLS_ECH_CONFIRM_LENGTH) {
 2670|  39.3k|                                  ret = PTLS_ALERT_DECODE_ERROR;
 2671|  39.3k|                                  goto Exit;
 2672|  39.3k|                              }
 2673|  39.3k|                              sh->retry_request.ech = src;
 2674|  39.3k|                              src = end;
 2675|  39.3k|                              break;
 2676|  39.3k|                          default:
 2677|  39.3k|                              src = end;
 2678|  39.3k|                              break;
 2679|  39.3k|                          }
 2680|  39.3k|                      });
 2681|       |
 2682|  39.0k|    if (!is_supported_version(found_version)) {
  ------------------
  |  Branch (2682:9): [True: 58, False: 38.9k]
  ------------------
 2683|     58|        ret = PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  216|     58|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 2684|     58|        goto Exit;
 2685|     58|    }
 2686|  38.9k|    if (!sh->is_retry_request) {
  ------------------
  |  Branch (2686:9): [True: 1.19k, False: 37.7k]
  ------------------
 2687|  1.19k|        if (selected_psk_identity != UINT16_MAX) {
  ------------------
  |  Branch (2687:13): [True: 24, False: 1.16k]
  ------------------
 2688|     24|            if (!tls->client.offered_psk) {
  ------------------
  |  Branch (2688:17): [True: 24, False: 0]
  ------------------
 2689|     24|                ret = PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  216|     24|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 2690|     24|                goto Exit;
 2691|     24|            }
 2692|      0|            if (selected_psk_identity != 0) {
  ------------------
  |  Branch (2692:17): [True: 0, False: 0]
  ------------------
 2693|      0|                ret = PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  216|      0|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 2694|      0|                goto Exit;
 2695|      0|            }
 2696|      0|            tls->is_psk_handshake = 1;
 2697|      0|        }
 2698|  1.16k|        if (sh->peerkey.base == NULL && !tls->is_psk_handshake) {
  ------------------
  |  Branch (2698:13): [True: 1, False: 1.16k]
  |  Branch (2698:41): [True: 1, False: 0]
  ------------------
 2699|      1|            ret = PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  216|      1|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 2700|      1|            goto Exit;
 2701|      1|        }
 2702|  1.16k|    }
 2703|       |
 2704|  38.9k|    ret = 0;
 2705|  39.6k|Exit:
 2706|  39.6k|    return ret;
 2707|  38.9k|}
picotls.c:decode_key_share_entry:
 2051|  1.22k|{
 2052|  1.22k|    int ret;
 2053|       |
 2054|  1.22k|    if ((ret = ptls_decode16(group, src, end)) != 0)
  ------------------
  |  Branch (2054:9): [True: 1, False: 1.22k]
  ------------------
 2055|      1|        goto Exit;
 2056|  1.22k|    ptls_decode_open_block(*src, end, 2, {
  ------------------
  |  | 1307|  1.22k|    do {                                                                                                                           \
  |  | 1308|  1.22k|        size_t _capacity = (capacity);                                                                                             \
  |  | 1309|  1.22k|        size_t _block_size;                                                                                                        \
  |  | 1310|  1.22k|        if (_capacity == -1) {                                                                                                     \
  |  |  ------------------
  |  |  |  Branch (1310:13): [True: 0, False: 1.22k]
  |  |  ------------------
  |  | 1311|      0|            uint64_t _block_size64;                                                                                                \
  |  | 1312|      0|            const uint8_t *_src = (src);                                                                                           \
  |  | 1313|      0|            if ((_block_size64 = ptls_decode_quicint(&_src, end)) == UINT64_MAX ||                                                 \
  |  |  ------------------
  |  |  |  Branch (1313:17): [True: 0, False: 0]
  |  |  ------------------
  |  | 1314|      0|                (sizeof(size_t) < 8 && (_block_size64 >> (8 * sizeof(size_t))) != 0)) {                                            \
  |  |  ------------------
  |  |  |  Branch (1314:18): [Folded - Ignored]
  |  |  |  Branch (1314:40): [True: 0, False: 0]
  |  |  ------------------
  |  | 1315|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1316|      0|                goto Exit;                                                                                                         \
  |  | 1317|      0|            }                                                                                                                      \
  |  | 1318|      0|            (src) = _src;                                                                                                          \
  |  | 1319|      0|            _block_size = (size_t)_block_size64;                                                                                   \
  |  | 1320|  1.22k|        } else {                                                                                                                   \
  |  | 1321|  1.22k|            if (_capacity > (size_t)(end - (src))) {                                                                               \
  |  |  ------------------
  |  |  |  Branch (1321:17): [True: 2, False: 1.22k]
  |  |  ------------------
  |  | 1322|      2|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  219|      2|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1323|      2|                goto Exit;                                                                                                         \
  |  | 1324|      2|            }                                                                                                                      \
  |  | 1325|  1.22k|            _block_size = 0;                                                                                                       \
  |  | 1326|  2.45k|            do {                                                                                                                   \
  |  | 1327|  2.45k|                _block_size = _block_size << 8 | *(src)++;                                                                         \
  |  | 1328|  2.45k|            } while (--_capacity != 0);                                                                                            \
  |  |  ------------------
  |  |  |  Branch (1328:22): [True: 1.22k, False: 1.22k]
  |  |  ------------------
  |  | 1329|  1.22k|        }                                                                                                                          \
  |  | 1330|  1.22k|        if (_block_size > (size_t)(end - (src))) {                                                                                 \
  |  |  ------------------
  |  |  |  Branch (1330:13): [True: 35, False: 1.19k]
  |  |  ------------------
  |  | 1331|     35|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  ------------------
  |  |  |  |  219|     35|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1332|     35|            goto Exit;                                                                                                             \
  |  | 1333|     35|        }                                                                                                                          \
  |  | 1334|  1.22k|        do {                                                                                                                       \
  |  | 1335|  1.19k|            const uint8_t *const end = (src) + _block_size;                                                                        \
  |  | 1336|  1.19k|            do {                                                                                                                   \
  |  | 1337|  1.19k|                block                                                                                                              \
  |  | 1338|  1.19k|            } while (0);                                                                                                           \
  |  |  ------------------
  |  |  |  Branch (1338:22): [Folded - Ignored]
  |  |  ------------------
  |  | 1339|  1.19k|            if ((src) != end) {                                                                                                    \
  |  |  ------------------
  |  |  |  Branch (1339:17): [True: 0, False: 1.19k]
  |  |  ------------------
  |  | 1340|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1341|      0|                goto Exit;                                                                                                         \
  |  | 1342|      0|            }                                                                                                                      \
  |  | 1343|  1.19k|        } while (0);                                                                                                               \
  |  |  ------------------
  |  |  |  Branch (1343:18): [Folded - Ignored]
  |  |  ------------------
  |  | 1344|  1.19k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1344:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2057|  1.22k|        *key_exchange = ptls_iovec_init(*src, end - *src);
 2058|  1.22k|        *src = end;
 2059|  1.22k|    });
 2060|       |
 2061|  1.22k|Exit:
 2062|  1.22k|    return ret;
 2063|  1.22k|}
picotls.c:is_supported_version:
  427|  39.0k|{
  428|  39.0k|    size_t i;
  429|  39.0k|    for (i = 0; i != PTLS_ELEMENTSOF(supported_versions); ++i)
  ------------------
  |  |   61|  39.0k|#define PTLS_ELEMENTSOF(x) (PTLS_ASSERT_IS_ARRAY_EXPR(x) * sizeof(x) / sizeof((x)[0]))
  |  |  ------------------
  |  |  |  |   56|  39.0k|#define PTLS_ASSERT_IS_ARRAY_EXPR(a) PTLS_BUILD_ASSERT_EXPR(__builtin_types_compatible_p(__typeof__(a[0])[], __typeof__(a)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  39.0k|#define PTLS_BUILD_ASSERT_EXPR(cond) (sizeof(char[2 * !!(!__builtin_constant_p(cond) || (cond)) - 1]) != 0)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (429:17): [True: 39.0k, False: 58]
  ------------------
  430|  39.0k|        if (supported_versions[i] == v)
  ------------------
  |  Branch (430:13): [True: 38.9k, False: 58]
  ------------------
  431|  38.9k|            return 1;
  432|     58|    return 0;
  433|  39.0k|}
picotls.c:key_schedule_select_cipher:
 1322|  38.9k|{
 1323|  38.9k|    size_t found_slot = SIZE_MAX, i;
 1324|  38.9k|    int ret;
 1325|       |
 1326|  38.9k|    assert(sched->generation == 1);
 1327|       |
 1328|       |    /* find the one, while freeing others */
 1329|  77.8k|    for (i = 0; i != sched->num_hashes; ++i) {
  ------------------
  |  Branch (1329:17): [True: 38.9k, False: 38.9k]
  ------------------
 1330|  38.9k|        if (sched->hashes[i].algo == cs->hash) {
  ------------------
  |  Branch (1330:13): [True: 38.9k, False: 0]
  ------------------
 1331|  38.9k|            assert(found_slot == SIZE_MAX);
 1332|  38.9k|            found_slot = i;
 1333|  38.9k|        } else {
 1334|      0|            sched->hashes[i].ctx->final(sched->hashes[i].ctx, NULL, PTLS_HASH_FINAL_MODE_FREE);
 1335|      0|            if (sched->hashes[i].ctx_outer != NULL)
  ------------------
  |  Branch (1335:17): [True: 0, False: 0]
  ------------------
 1336|      0|                sched->hashes[i].ctx_outer->final(sched->hashes[i].ctx_outer, NULL, PTLS_HASH_FINAL_MODE_FREE);
 1337|      0|        }
 1338|  38.9k|    }
 1339|  38.9k|    if (found_slot != 0) {
  ------------------
  |  Branch (1339:9): [True: 0, False: 38.9k]
  ------------------
 1340|      0|        sched->hashes[0] = sched->hashes[found_slot];
 1341|      0|        reset = 1;
 1342|      0|    }
 1343|  38.9k|    sched->num_hashes = 1;
 1344|       |
 1345|       |    /* recalculate the hash if a different hash as been selected than the one we used for calculating the early secrets */
 1346|  38.9k|    if (reset) {
  ------------------
  |  Branch (1346:9): [True: 0, False: 38.9k]
  ------------------
 1347|      0|        --sched->generation;
 1348|      0|        memset(sched->secret, 0, sizeof(sched->secret));
 1349|      0|        if ((ret = key_schedule_extract(sched, reset_ikm)) != 0)
  ------------------
  |  Branch (1349:13): [True: 0, False: 0]
  ------------------
 1350|      0|            goto Exit;
 1351|      0|    }
 1352|       |
 1353|  38.9k|    ret = 0;
 1354|  38.9k|Exit:
 1355|  38.9k|    return ret;
 1356|  38.9k|}
picotls.c:key_schedule_transform_post_ch1hash:
 1402|  37.7k|{
 1403|  37.7k|    size_t digest_size = sched->hashes[0].algo->digest_size;
 1404|  37.7k|    ptls_hash_context_t *hashes[3] = {sched->hashes[0].ctx, sched->hashes[0].ctx_outer, NULL};
 1405|  37.7k|    uint8_t ch1hash[PTLS_MAX_DIGEST_SIZE];
 1406|  37.7k|    uint8_t prefix[4] = {PTLS_HANDSHAKE_TYPE_MESSAGE_HASH, 0, 0, (uint8_t)digest_size};
  ------------------
  |  |  281|  37.7k|#define PTLS_HANDSHAKE_TYPE_MESSAGE_HASH 254
  ------------------
 1407|       |
 1408|  75.5k|    for (size_t i = 0; hashes[i] != NULL; ++i) {
  ------------------
  |  Branch (1408:24): [True: 37.7k, False: 37.7k]
  ------------------
 1409|  37.7k|        hashes[i]->final(hashes[i], ch1hash, PTLS_HASH_FINAL_MODE_RESET);
 1410|  37.7k|        hashes[i]->update(hashes[i], prefix, sizeof(prefix));
 1411|  37.7k|        hashes[i]->update(hashes[i], ch1hash, digest_size);
 1412|  37.7k|    }
 1413|       |
 1414|  37.7k|    ptls_clear_memory(ch1hash, sizeof(ch1hash));
 1415|  37.7k|}
picotls.c:handle_hello_retry_request:
 2711|  37.7k|{
 2712|  37.7k|    int ret;
 2713|       |
 2714|  37.7k|    if (tls->client.key_share_ctx != NULL) {
  ------------------
  |  Branch (2714:9): [True: 37.7k, False: 0]
  ------------------
 2715|  37.7k|        tls->client.key_share_ctx->on_exchange(&tls->client.key_share_ctx, 1, NULL, ptls_iovec_init(NULL, 0));
 2716|  37.7k|        tls->client.key_share_ctx = NULL;
 2717|  37.7k|    }
 2718|  37.7k|    if (tls->client.using_early_data) {
  ------------------
  |  Branch (2718:9): [True: 0, False: 37.7k]
  ------------------
 2719|       |        /* release traffic encryption key so that 2nd CH goes out in cleartext, but keep the epoch at 1 since we've already
 2720|       |         * called derive-secret */
 2721|      0|        if (tls->ctx->update_traffic_key == NULL) {
  ------------------
  |  Branch (2721:13): [True: 0, False: 0]
  ------------------
 2722|      0|            assert(tls->traffic_protection.enc.aead != NULL);
 2723|      0|            ptls_aead_free(tls->traffic_protection.enc.aead);
 2724|      0|            tls->traffic_protection.enc.aead = NULL;
 2725|      0|        }
 2726|      0|        tls->client.using_early_data = 0;
 2727|      0|    }
 2728|       |
 2729|  37.7k|    if (sh->retry_request.selected_group != UINT16_MAX) {
  ------------------
  |  Branch (2729:9): [True: 336, False: 37.4k]
  ------------------
 2730|       |        /* we offer the first key_exchanges[0] as KEY_SHARE unless client.negotiate_before_key_exchange is set */
 2731|    336|        ptls_key_exchange_algorithm_t **cand;
 2732|    366|        for (cand = tls->ctx->key_exchanges; *cand != NULL; ++cand)
  ------------------
  |  Branch (2732:46): [True: 336, False: 30]
  ------------------
 2733|    336|            if ((*cand)->id == sh->retry_request.selected_group)
  ------------------
  |  Branch (2733:17): [True: 306, False: 30]
  ------------------
 2734|    306|                break;
 2735|    336|        if (*cand == NULL) {
  ------------------
  |  Branch (2735:13): [True: 30, False: 306]
  ------------------
 2736|     30|            ret = PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  216|     30|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 2737|     30|            goto Exit;
 2738|     30|        }
 2739|    306|        tls->key_share = *cand;
 2740|  37.4k|    } else if (tls->key_share != NULL) {
  ------------------
  |  Branch (2740:16): [True: 37.4k, False: 0]
  ------------------
 2741|       |        /* retain the key-share using in first CH, if server does not specify one */
 2742|  37.4k|    } else {
 2743|      0|        ret = PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  216|      0|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 2744|      0|        goto Exit;
 2745|      0|    }
 2746|       |
 2747|  37.7k|    ret = send_client_hello(tls, emitter, properties, &sh->retry_request.cookie);
 2748|       |
 2749|  37.7k|Exit:
 2750|  37.7k|    return ret;
 2751|  37.7k|}
picotls.c:client_handle_encrypted_extensions:
 2918|  1.05k|{
 2919|  1.05k|    const uint8_t *src = message.base + PTLS_HANDSHAKE_HEADER_SIZE, *const end = message.base + message.len;
  ------------------
  |  |   56|  1.05k|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
 2920|  1.05k|    uint16_t type;
 2921|  1.05k|    static const ptls_raw_extension_t no_unknown_extensions = {UINT16_MAX};
 2922|  1.05k|    ptls_raw_extension_t *unknown_extensions = (ptls_raw_extension_t *)&no_unknown_extensions;
 2923|  1.05k|    int ret, skip_early_data = 1;
 2924|  1.05k|    uint8_t server_offered_cert_type = PTLS_CERTIFICATE_TYPE_X509;
  ------------------
  |  |  284|  1.05k|#define PTLS_CERTIFICATE_TYPE_X509 0
  ------------------
 2925|       |
 2926|  1.05k|    decode_extensions(src, end, PTLS_HANDSHAKE_TYPE_ENCRYPTED_EXTENSIONS, &type, {
  ------------------
  |  |  886|  1.05k|    do {                                                                                                                           \
  |  |  887|  1.05k|        decode_open_extensions((src), end, hstype, exttype, block);                                                                \
  |  |  ------------------
  |  |  |  |  870|  1.05k|    do {                                                                                                                           \
  |  |  |  |  871|  1.05k|        struct st_ptls_extension_bitmap_t bitmap = {0};                                                                            \
  |  |  |  |  872|  1.05k|        ptls_decode_open_block((src), end, 2, {                                                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1307|  1.05k|    do {                                                                                                                           \
  |  |  |  |  |  | 1308|  1.05k|        size_t _capacity = (capacity);                                                                                             \
  |  |  |  |  |  | 1309|  1.05k|        size_t _block_size;                                                                                                        \
  |  |  |  |  |  | 1310|  1.05k|        if (_capacity == -1) {                                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1310:13): [True: 0, False: 1.05k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1311|      0|            uint64_t _block_size64;                                                                                                \
  |  |  |  |  |  | 1312|      0|            const uint8_t *_src = (src);                                                                                           \
  |  |  |  |  |  | 1313|      0|            if ((_block_size64 = ptls_decode_quicint(&_src, end)) == UINT64_MAX ||                                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1313:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1314|      0|                (sizeof(size_t) < 8 && (_block_size64 >> (8 * sizeof(size_t))) != 0)) {                                            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1314:18): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1314:40): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1315|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1316|      0|                goto Exit;                                                                                                         \
  |  |  |  |  |  | 1317|      0|            }                                                                                                                      \
  |  |  |  |  |  | 1318|      0|            (src) = _src;                                                                                                          \
  |  |  |  |  |  | 1319|      0|            _block_size = (size_t)_block_size64;                                                                                   \
  |  |  |  |  |  | 1320|  1.05k|        } else {                                                                                                                   \
  |  |  |  |  |  | 1321|  1.05k|            if (_capacity > (size_t)(end - (src))) {                                                                               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1321:17): [True: 1, False: 1.05k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1322|      1|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  219|      1|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1323|      1|                goto Exit;                                                                                                         \
  |  |  |  |  |  | 1324|      1|            }                                                                                                                      \
  |  |  |  |  |  | 1325|  1.05k|            _block_size = 0;                                                                                                       \
  |  |  |  |  |  | 1326|  2.11k|            do {                                                                                                                   \
  |  |  |  |  |  | 1327|  2.11k|                _block_size = _block_size << 8 | *(src)++;                                                                         \
  |  |  |  |  |  | 1328|  2.11k|            } while (--_capacity != 0);                                                                                            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1328:22): [True: 1.05k, False: 1.05k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1329|  1.05k|        }                                                                                                                          \
  |  |  |  |  |  | 1330|  1.05k|        if (_block_size > (size_t)(end - (src))) {                                                                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1330:13): [True: 27, False: 1.02k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1331|     27|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  219|     27|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1332|     27|            goto Exit;                                                                                                             \
  |  |  |  |  |  | 1333|     27|        }                                                                                                                          \
  |  |  |  |  |  | 1334|  1.05k|        do {                                                                                                                       \
  |  |  |  |  |  | 1335|  1.02k|            const uint8_t *const end = (src) + _block_size;                                                                        \
  |  |  |  |  |  | 1336|  1.02k|            do {                                                                                                                   \
  |  |  |  |  |  | 1337|  20.8k|                block                                                                                                              \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1337:17): [True: 9, False: 663]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 15, False: 648]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 80, False: 568]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 568, False: 568]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 648]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 38, False: 530]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 530]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 17, False: 4]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 4]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 2, False: 83]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 83, False: 83]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 85]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 28, False: 55]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 2, False: 53]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 53]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 55]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 11, False: 42]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 14, False: 28]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 28]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 28]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 20, False: 8]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 8]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 3, False: 5]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 1, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 14, False: 15]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 1]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 1]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 393]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 393, False: 137]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 1, False: 529]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 29, False: 501]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 1, False: 529]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 85, False: 445]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 21, False: 509]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 413]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 672, False: 770]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1338|  1.02k|            } while (0);                                                                                                           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1338:22): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1339|  1.02k|            if ((src) != end) {                                                                                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1339:17): [True: 0, False: 770]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1340|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1341|      0|                goto Exit;                                                                                                         \
  |  |  |  |  |  | 1342|      0|            }                                                                                                                      \
  |  |  |  |  |  | 1343|    770|        } while (0);                                                                                                               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1343:18): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1344|  1.02k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1344:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  873|  1.05k|            while ((src) != end) {                                                                                                 \
  |  |  |  |  874|  1.05k|                if ((ret = ptls_decode16((exttype), &(src), end)) != 0)                                                            \
  |  |  |  |  875|  1.05k|                    goto Exit;                                                                                                     \
  |  |  |  |  876|  1.05k|                if (!extension_bitmap_testandset(&bitmap, (hstype), *(exttype))) {                                                 \
  |  |  |  |  877|  1.05k|                    ret = PTLS_ALERT_ILLEGAL_PARAMETER;                                                                            \
  |  |  |  |  878|  1.05k|                    goto Exit;                                                                                                     \
  |  |  |  |  879|  1.05k|                }                                                                                                                  \
  |  |  |  |  880|  1.05k|                ptls_decode_open_block((src), end, 2, block);                                                                      \
  |  |  |  |  881|  1.05k|            }                                                                                                                      \
  |  |  |  |  882|  1.05k|        });                                                                                                                        \
  |  |  |  |  883|  1.05k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (883:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  888|  1.05k|        ptls_decode_assert_block_close((src), end);                                                                                \
  |  |  ------------------
  |  |  |  | 1347|    770|    do {                                                                                                                           \
  |  |  |  | 1348|    770|        if ((src) != end) {                                                                                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1348:13): [True: 2, False: 768]
  |  |  |  |  ------------------
  |  |  |  | 1349|      2|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|      2|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1350|      2|            goto Exit;                                                                                                             \
  |  |  |  | 1351|      2|        }                                                                                                                          \
  |  |  |  | 1352|    770|    } while (0);
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1352:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  889|    768|    } while (0)
  |  |  ------------------
  |  |  |  Branch (889:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2927|  1.05k|        if (tls->ctx->on_extension != NULL &&
 2928|  1.05k|            (ret = tls->ctx->on_extension->cb(tls->ctx->on_extension, tls, PTLS_HANDSHAKE_TYPE_ENCRYPTED_EXTENSIONS, type,
 2929|  1.05k|                                              ptls_iovec_init(src, end - src)) != 0))
 2930|  1.05k|            goto Exit;
 2931|  1.05k|        switch (type) {
 2932|  1.05k|        case PTLS_EXTENSION_TYPE_SERVER_NAME:
 2933|  1.05k|            if (src != end) {
 2934|  1.05k|                ret = PTLS_ALERT_DECODE_ERROR;
 2935|  1.05k|                goto Exit;
 2936|  1.05k|            }
 2937|  1.05k|            if (!(tls->server_name != NULL && !ptls_server_name_is_ipaddr(tls->server_name))) {
 2938|  1.05k|                ret = PTLS_ALERT_ILLEGAL_PARAMETER;
 2939|  1.05k|                goto Exit;
 2940|  1.05k|            }
 2941|  1.05k|            break;
 2942|  1.05k|        case PTLS_EXTENSION_TYPE_ALPN:
 2943|  1.05k|            ptls_decode_block(src, end, 2, {
 2944|  1.05k|                ptls_decode_open_block(src, end, 1, {
 2945|  1.05k|                    if (src == end) {
 2946|  1.05k|                        ret = PTLS_ALERT_DECODE_ERROR;
 2947|  1.05k|                        goto Exit;
 2948|  1.05k|                    }
 2949|  1.05k|                    if ((ret = ptls_set_negotiated_protocol(tls, (const char *)src, end - src)) != 0)
 2950|  1.05k|                        goto Exit;
 2951|  1.05k|                    src = end;
 2952|  1.05k|                });
 2953|  1.05k|                if (src != end) {
 2954|  1.05k|                    ret = PTLS_ALERT_HANDSHAKE_FAILURE;
 2955|  1.05k|                    goto Exit;
 2956|  1.05k|                }
 2957|  1.05k|            });
 2958|  1.05k|            break;
 2959|  1.05k|        case PTLS_EXTENSION_TYPE_EARLY_DATA:
 2960|  1.05k|            if (!tls->client.using_early_data) {
 2961|  1.05k|                ret = PTLS_ALERT_ILLEGAL_PARAMETER;
 2962|  1.05k|                goto Exit;
 2963|  1.05k|            }
 2964|  1.05k|            skip_early_data = 0;
 2965|  1.05k|            break;
 2966|  1.05k|        case PTLS_EXTENSION_TYPE_SERVER_CERTIFICATE_TYPE:
 2967|  1.05k|            if (end - src != 1) {
 2968|  1.05k|                ret = PTLS_ALERT_DECODE_ERROR;
 2969|  1.05k|                goto Exit;
 2970|  1.05k|            }
 2971|  1.05k|            server_offered_cert_type = *src;
 2972|  1.05k|            src = end;
 2973|  1.05k|            break;
 2974|  1.05k|        case PTLS_EXTENSION_TYPE_ENCRYPTED_CLIENT_HELLO: {
 2975|       |            /* accept retry_configs only if we offered ECH but rejected */
 2976|  1.05k|            if (!((tls->ech.offered || tls->ech.offered_grease) && !ptls_is_ech_handshake(tls, NULL, NULL, NULL))) {
 2977|  1.05k|                ret = PTLS_ALERT_UNSUPPORTED_EXTENSION;
 2978|  1.05k|                goto Exit;
 2979|  1.05k|            }
 2980|       |            /* parse retry_config, and if it is applicable, provide that to the application */
 2981|  1.05k|            struct st_decoded_ech_config_t decoded;
 2982|  1.05k|            if ((ret = client_decode_ech_config_list(tls->ctx, &decoded, ptls_iovec_init(src, end - src))) != 0)
 2983|  1.05k|                goto Exit;
 2984|  1.05k|            if (decoded.kem != NULL && decoded.cipher != NULL && properties != NULL &&
 2985|  1.05k|                properties->client.ech.retry_configs != NULL) {
 2986|  1.05k|                if ((properties->client.ech.retry_configs->base = malloc(end - src)) == NULL) {
 2987|  1.05k|                    ret = PTLS_ERROR_NO_MEMORY;
 2988|  1.05k|                    goto Exit;
 2989|  1.05k|                }
 2990|  1.05k|                memcpy(properties->client.ech.retry_configs->base, src, end - src);
 2991|  1.05k|                properties->client.ech.retry_configs->len = end - src;
 2992|  1.05k|            }
 2993|  1.05k|            src = end;
 2994|  1.05k|        } break;
 2995|  1.05k|        default:
 2996|  1.05k|            if (should_collect_unknown_extension(tls, properties, type)) {
 2997|  1.05k|                if (unknown_extensions == &no_unknown_extensions) {
 2998|  1.05k|                    if ((unknown_extensions = malloc(sizeof(*unknown_extensions) * (MAX_UNKNOWN_EXTENSIONS + 1))) == NULL) {
 2999|  1.05k|                        ret = PTLS_ERROR_NO_MEMORY;
 3000|  1.05k|                        goto Exit;
 3001|  1.05k|                    }
 3002|  1.05k|                    unknown_extensions[0].type = UINT16_MAX;
 3003|  1.05k|                }
 3004|  1.05k|                if ((ret = collect_unknown_extension(tls, type, src, end, unknown_extensions)) != 0)
 3005|  1.05k|                    goto Exit;
 3006|  1.05k|            }
 3007|  1.05k|            break;
 3008|  1.05k|        }
 3009|  1.05k|        src = end;
 3010|  1.05k|    });
 3011|       |
 3012|    768|    if (server_offered_cert_type !=
  ------------------
  |  Branch (3012:9): [True: 12, False: 756]
  ------------------
 3013|    768|        (tls->ctx->use_raw_public_keys ? PTLS_CERTIFICATE_TYPE_RAW_PUBLIC_KEY : PTLS_CERTIFICATE_TYPE_X509)) {
  ------------------
  |  |  285|      0|#define PTLS_CERTIFICATE_TYPE_RAW_PUBLIC_KEY 2
  ------------------
                      (tls->ctx->use_raw_public_keys ? PTLS_CERTIFICATE_TYPE_RAW_PUBLIC_KEY : PTLS_CERTIFICATE_TYPE_X509)) {
  ------------------
  |  |  284|    768|#define PTLS_CERTIFICATE_TYPE_X509 0
  ------------------
  |  Branch (3013:10): [True: 0, False: 768]
  ------------------
 3014|     12|        ret = PTLS_ALERT_UNSUPPORTED_CERTIFICATE;
  ------------------
  |  |  212|     12|#define PTLS_ALERT_UNSUPPORTED_CERTIFICATE 43
  ------------------
 3015|     12|        goto Exit;
 3016|     12|    }
 3017|       |
 3018|    756|    if (tls->client.using_early_data) {
  ------------------
  |  Branch (3018:9): [True: 0, False: 756]
  ------------------
 3019|      0|        if (skip_early_data)
  ------------------
  |  Branch (3019:13): [True: 0, False: 0]
  ------------------
 3020|      0|            tls->client.using_early_data = 0;
 3021|      0|        if (properties != NULL)
  ------------------
  |  Branch (3021:13): [True: 0, False: 0]
  ------------------
 3022|      0|            properties->client.early_data_acceptance = skip_early_data ? PTLS_EARLY_DATA_REJECTED : PTLS_EARLY_DATA_ACCEPTED;
  ------------------
  |  Branch (3022:56): [True: 0, False: 0]
  ------------------
 3023|      0|    }
 3024|    756|    if ((ret = report_unknown_extensions(tls, properties, unknown_extensions)) != 0)
  ------------------
  |  Branch (3024:9): [True: 0, False: 756]
  ------------------
 3025|      0|        goto Exit;
 3026|       |
 3027|    756|    ptls__key_schedule_update_hash(tls->key_schedule, message.base, message.len, 0);
 3028|    756|    tls->state =
 3029|    756|        tls->is_psk_handshake ? PTLS_STATE_CLIENT_EXPECT_FINISHED : PTLS_STATE_CLIENT_EXPECT_CERTIFICATE_REQUEST_OR_CERTIFICATE;
  ------------------
  |  Branch (3029:9): [True: 0, False: 756]
  ------------------
 3030|    756|    ret = PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  242|    756|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  193|    756|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 3031|       |
 3032|  1.05k|Exit:
 3033|  1.05k|    if (unknown_extensions != &no_unknown_extensions)
  ------------------
  |  Branch (3033:9): [True: 0, False: 1.05k]
  ------------------
 3034|      0|        free(unknown_extensions);
 3035|  1.05k|    return ret;
 3036|    756|}
picotls.c:should_collect_unknown_extension:
 2886|    393|{
 2887|    393|    return properties != NULL && properties->collect_extension != NULL && properties->collect_extension(tls, properties, type);
  ------------------
  |  Branch (2887:12): [True: 393, False: 0]
  |  Branch (2887:34): [True: 0, False: 393]
  |  Branch (2887:75): [True: 0, False: 0]
  ------------------
 2888|    393|}
picotls.c:report_unknown_extensions:
 2908|    756|{
 2909|    756|    if (properties != NULL && properties->collect_extension != NULL) {
  ------------------
  |  Branch (2909:9): [True: 756, False: 0]
  |  Branch (2909:31): [True: 0, False: 756]
  ------------------
 2910|      0|        assert(properties->collected_extensions != NULL);
 2911|      0|        return properties->collected_extensions(tls, properties, slots);
 2912|    756|    } else {
 2913|    756|        return 0;
 2914|    756|    }
 2915|    756|}
picotls.c:client_handle_certificate_request:
 3201|    286|{
 3202|    286|    const uint8_t *src = message.base + PTLS_HANDSHAKE_HEADER_SIZE, *const end = message.base + message.len;
  ------------------
  |  |   56|    286|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
 3203|    286|    int ret = 0;
 3204|       |
 3205|    286|    assert(!tls->is_psk_handshake && "state machine asserts that this message is never delivered when PSK is used");
 3206|       |
 3207|    286|    if ((ret = decode_certificate_request(tls, &tls->client.certificate_request, src, end)) != 0)
  ------------------
  |  Branch (3207:9): [True: 270, False: 16]
  ------------------
 3208|    270|        return ret;
 3209|       |
 3210|       |    /* This field SHALL be zero length unless used for the post-handshake authentication exchanges (section 4.3.2) */
 3211|     16|    if (tls->client.certificate_request.context.len != 0)
  ------------------
  |  Branch (3211:9): [True: 3, False: 13]
  ------------------
 3212|      3|        return PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  216|      3|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 3213|       |
 3214|     13|    tls->state = PTLS_STATE_CLIENT_EXPECT_CERTIFICATE;
 3215|     13|    ptls__key_schedule_update_hash(tls->key_schedule, message.base, message.len, 0);
 3216|       |
 3217|     13|    return PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  242|     13|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  193|     13|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 3218|     16|}
picotls.c:decode_certificate_request:
 3040|    286|{
 3041|    286|    int ret;
 3042|    286|    uint16_t exttype = 0;
 3043|       |
 3044|       |    /* certificate request context */
 3045|    286|    ptls_decode_open_block(src, end, 1, {
  ------------------
  |  | 1307|    286|    do {                                                                                                                           \
  |  | 1308|    286|        size_t _capacity = (capacity);                                                                                             \
  |  | 1309|    286|        size_t _block_size;                                                                                                        \
  |  | 1310|    286|        if (_capacity == -1) {                                                                                                     \
  |  |  ------------------
  |  |  |  Branch (1310:13): [True: 0, False: 286]
  |  |  ------------------
  |  | 1311|      0|            uint64_t _block_size64;                                                                                                \
  |  | 1312|      0|            const uint8_t *_src = (src);                                                                                           \
  |  | 1313|      0|            if ((_block_size64 = ptls_decode_quicint(&_src, end)) == UINT64_MAX ||                                                 \
  |  |  ------------------
  |  |  |  Branch (1313:17): [True: 0, False: 0]
  |  |  ------------------
  |  | 1314|      0|                (sizeof(size_t) < 8 && (_block_size64 >> (8 * sizeof(size_t))) != 0)) {                                            \
  |  |  ------------------
  |  |  |  Branch (1314:18): [Folded - Ignored]
  |  |  |  Branch (1314:40): [True: 0, False: 0]
  |  |  ------------------
  |  | 1315|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1316|      0|                goto Exit;                                                                                                         \
  |  | 1317|      0|            }                                                                                                                      \
  |  | 1318|      0|            (src) = _src;                                                                                                          \
  |  | 1319|      0|            _block_size = (size_t)_block_size64;                                                                                   \
  |  | 1320|    286|        } else {                                                                                                                   \
  |  | 1321|    286|            if (_capacity > (size_t)(end - (src))) {                                                                               \
  |  |  ------------------
  |  |  |  Branch (1321:17): [True: 1, False: 285]
  |  |  ------------------
  |  | 1322|      1|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  219|      1|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1323|      1|                goto Exit;                                                                                                         \
  |  | 1324|      1|            }                                                                                                                      \
  |  | 1325|    286|            _block_size = 0;                                                                                                       \
  |  | 1326|    285|            do {                                                                                                                   \
  |  | 1327|    285|                _block_size = _block_size << 8 | *(src)++;                                                                         \
  |  | 1328|    285|            } while (--_capacity != 0);                                                                                            \
  |  |  ------------------
  |  |  |  Branch (1328:22): [True: 0, False: 285]
  |  |  ------------------
  |  | 1329|    285|        }                                                                                                                          \
  |  | 1330|    286|        if (_block_size > (size_t)(end - (src))) {                                                                                 \
  |  |  ------------------
  |  |  |  Branch (1330:13): [True: 3, False: 282]
  |  |  ------------------
  |  | 1331|      3|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  ------------------
  |  |  |  |  219|      3|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1332|      3|            goto Exit;                                                                                                             \
  |  | 1333|      3|        }                                                                                                                          \
  |  | 1334|    285|        do {                                                                                                                       \
  |  | 1335|    282|            const uint8_t *const end = (src) + _block_size;                                                                        \
  |  | 1336|    282|            do {                                                                                                                   \
  |  | 1337|  1.12k|                block                                                                                                              \
  |  |  ------------------
  |  |  |  Branch (1337:17): [True: 0, False: 282]
  |  |  |  Branch (1337:17): [True: 43, False: 239]
  |  |  |  Branch (1337:17): [True: 0, False: 282]
  |  |  ------------------
  |  | 1338|    564|            } while (0);                                                                                                           \
  |  |  ------------------
  |  |  |  Branch (1338:22): [Folded - Ignored]
  |  |  ------------------
  |  | 1339|    282|            if ((src) != end) {                                                                                                    \
  |  |  ------------------
  |  |  |  Branch (1339:17): [True: 0, False: 282]
  |  |  ------------------
  |  | 1340|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1341|      0|                goto Exit;                                                                                                         \
  |  | 1342|      0|            }                                                                                                                      \
  |  | 1343|    282|        } while (0);                                                                                                               \
  |  |  ------------------
  |  |  |  Branch (1343:18): [Folded - Ignored]
  |  |  ------------------
  |  | 1344|    282|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1344:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3046|    286|        size_t len = end - src;
 3047|    286|        if (len > 255) {
 3048|    286|            ret = PTLS_ALERT_DECODE_ERROR;
 3049|    286|            goto Exit;
 3050|    286|        }
 3051|    286|        if ((cr->context.base = malloc(len != 0 ? len : 1)) == NULL) {
 3052|    286|            ret = PTLS_ERROR_NO_MEMORY;
 3053|    286|            goto Exit;
 3054|    286|        }
 3055|    286|        cr->context.len = len;
 3056|    286|        memcpy(cr->context.base, src, len);
 3057|    286|        src = end;
 3058|    286|    });
 3059|       |
 3060|       |    /* decode extensions */
 3061|    282|    decode_extensions(src, end, PTLS_HANDSHAKE_TYPE_CERTIFICATE_REQUEST, &exttype, {
  ------------------
  |  |  886|    282|    do {                                                                                                                           \
  |  |  887|    282|        decode_open_extensions((src), end, hstype, exttype, block);                                                                \
  |  |  ------------------
  |  |  |  |  870|    282|    do {                                                                                                                           \
  |  |  |  |  871|    282|        struct st_ptls_extension_bitmap_t bitmap = {0};                                                                            \
  |  |  |  |  872|    282|        ptls_decode_open_block((src), end, 2, {                                                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1307|    282|    do {                                                                                                                           \
  |  |  |  |  |  | 1308|    282|        size_t _capacity = (capacity);                                                                                             \
  |  |  |  |  |  | 1309|    282|        size_t _block_size;                                                                                                        \
  |  |  |  |  |  | 1310|    282|        if (_capacity == -1) {                                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1310:13): [True: 0, False: 282]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1311|      0|            uint64_t _block_size64;                                                                                                \
  |  |  |  |  |  | 1312|      0|            const uint8_t *_src = (src);                                                                                           \
  |  |  |  |  |  | 1313|      0|            if ((_block_size64 = ptls_decode_quicint(&_src, end)) == UINT64_MAX ||                                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1313:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1314|      0|                (sizeof(size_t) < 8 && (_block_size64 >> (8 * sizeof(size_t))) != 0)) {                                            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1314:18): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1314:40): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1315|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1316|      0|                goto Exit;                                                                                                         \
  |  |  |  |  |  | 1317|      0|            }                                                                                                                      \
  |  |  |  |  |  | 1318|      0|            (src) = _src;                                                                                                          \
  |  |  |  |  |  | 1319|      0|            _block_size = (size_t)_block_size64;                                                                                   \
  |  |  |  |  |  | 1320|    282|        } else {                                                                                                                   \
  |  |  |  |  |  | 1321|    282|            if (_capacity > (size_t)(end - (src))) {                                                                               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1321:17): [True: 4, False: 278]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1322|      4|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  219|      4|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1323|      4|                goto Exit;                                                                                                         \
  |  |  |  |  |  | 1324|      4|            }                                                                                                                      \
  |  |  |  |  |  | 1325|    282|            _block_size = 0;                                                                                                       \
  |  |  |  |  |  | 1326|    556|            do {                                                                                                                   \
  |  |  |  |  |  | 1327|    556|                _block_size = _block_size << 8 | *(src)++;                                                                         \
  |  |  |  |  |  | 1328|    556|            } while (--_capacity != 0);                                                                                            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1328:22): [True: 278, False: 278]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1329|    278|        }                                                                                                                          \
  |  |  |  |  |  | 1330|    282|        if (_block_size > (size_t)(end - (src))) {                                                                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1330:13): [True: 43, False: 235]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1331|     43|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  219|     43|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1332|     43|            goto Exit;                                                                                                             \
  |  |  |  |  |  | 1333|     43|        }                                                                                                                          \
  |  |  |  |  |  | 1334|    278|        do {                                                                                                                       \
  |  |  |  |  |  | 1335|    235|            const uint8_t *const end = (src) + _block_size;                                                                        \
  |  |  |  |  |  | 1336|    235|            do {                                                                                                                   \
  |  |  |  |  |  | 1337|  17.4k|                block                                                                                                              \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1337:17): [True: 9, False: 685]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 21, False: 664]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 81, False: 583]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 583, False: 583]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 664]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 36, False: 547]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 547]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 45, False: 20]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 65, False: 482]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 482, False: 65]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 0, False: 502]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1337:17): [True: 694, False: 43]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1338|    235|            } while (0);                                                                                                           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1338:22): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1339|    235|            if ((src) != end) {                                                                                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1339:17): [True: 0, False: 43]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1340|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1341|      0|                goto Exit;                                                                                                         \
  |  |  |  |  |  | 1342|      0|            }                                                                                                                      \
  |  |  |  |  |  | 1343|     43|        } while (0);                                                                                                               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1343:18): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1344|    235|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1344:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  873|    282|            while ((src) != end) {                                                                                                 \
  |  |  |  |  874|    282|                if ((ret = ptls_decode16((exttype), &(src), end)) != 0)                                                            \
  |  |  |  |  875|    282|                    goto Exit;                                                                                                     \
  |  |  |  |  876|    282|                if (!extension_bitmap_testandset(&bitmap, (hstype), *(exttype))) {                                                 \
  |  |  |  |  877|    282|                    ret = PTLS_ALERT_ILLEGAL_PARAMETER;                                                                            \
  |  |  |  |  878|    282|                    goto Exit;                                                                                                     \
  |  |  |  |  879|    282|                }                                                                                                                  \
  |  |  |  |  880|    282|                ptls_decode_open_block((src), end, 2, block);                                                                      \
  |  |  |  |  881|    282|            }                                                                                                                      \
  |  |  |  |  882|    282|        });                                                                                                                        \
  |  |  |  |  883|    282|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (883:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  888|    282|        ptls_decode_assert_block_close((src), end);                                                                                \
  |  |  ------------------
  |  |  |  | 1347|     43|    do {                                                                                                                           \
  |  |  |  | 1348|     43|        if ((src) != end) {                                                                                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1348:13): [True: 4, False: 39]
  |  |  |  |  ------------------
  |  |  |  | 1349|      4|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|      4|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1350|      4|            goto Exit;                                                                                                             \
  |  |  |  | 1351|      4|        }                                                                                                                          \
  |  |  |  | 1352|     43|    } while (0);
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1352:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  889|     39|    } while (0)
  |  |  ------------------
  |  |  |  Branch (889:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3062|    282|        if (tls->ctx->on_extension != NULL &&
 3063|    282|            (ret = tls->ctx->on_extension->cb(tls->ctx->on_extension, tls, PTLS_HANDSHAKE_TYPE_CERTIFICATE_REQUEST, exttype,
 3064|    282|                                              ptls_iovec_init(src, end - src)) != 0))
 3065|    282|            goto Exit;
 3066|    282|        switch (exttype) {
 3067|    282|        case PTLS_EXTENSION_TYPE_SIGNATURE_ALGORITHMS:
 3068|    282|            if ((ret = decode_signature_algorithms(&cr->signature_algorithms, &src, end)) != 0)
 3069|    282|                goto Exit;
 3070|    282|            break;
 3071|    282|        }
 3072|    282|        src = end;
 3073|    282|    });
 3074|       |
 3075|     39|    if (cr->signature_algorithms.count == 0) {
  ------------------
  |  Branch (3075:9): [True: 23, False: 16]
  ------------------
 3076|     23|        ret = PTLS_ALERT_MISSING_EXTENSION;
  ------------------
  |  |  224|     23|#define PTLS_ALERT_MISSING_EXTENSION 109
  ------------------
 3077|     23|        goto Exit;
 3078|     23|    }
 3079|       |
 3080|     16|    ret = 0;
 3081|    286|Exit:
 3082|    286|    return ret;
 3083|     16|}
picotls.c:decode_signature_algorithms:
 1976|     65|{
 1977|     65|    int ret;
 1978|       |
 1979|     65|    ptls_decode_block(*src, end, 2, {
  ------------------
  |  | 1355|     65|    do {                                                                                                                           \
  |  | 1356|     65|        ptls_decode_open_block((src), end, capacity, block);                                                                       \
  |  |  ------------------
  |  |  |  | 1307|     65|    do {                                                                                                                           \
  |  |  |  | 1308|     65|        size_t _capacity = (capacity);                                                                                             \
  |  |  |  | 1309|     65|        size_t _block_size;                                                                                                        \
  |  |  |  | 1310|     65|        if (_capacity == -1) {                                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1310:13): [True: 0, False: 65]
  |  |  |  |  ------------------
  |  |  |  | 1311|      0|            uint64_t _block_size64;                                                                                                \
  |  |  |  | 1312|      0|            const uint8_t *_src = (src);                                                                                           \
  |  |  |  | 1313|      0|            if ((_block_size64 = ptls_decode_quicint(&_src, end)) == UINT64_MAX ||                                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1313:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1314|      0|                (sizeof(size_t) < 8 && (_block_size64 >> (8 * sizeof(size_t))) != 0)) {                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1314:18): [Folded - Ignored]
  |  |  |  |  |  Branch (1314:40): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1315|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1316|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1317|      0|            }                                                                                                                      \
  |  |  |  | 1318|      0|            (src) = _src;                                                                                                          \
  |  |  |  | 1319|      0|            _block_size = (size_t)_block_size64;                                                                                   \
  |  |  |  | 1320|     65|        } else {                                                                                                                   \
  |  |  |  | 1321|     65|            if (_capacity > (size_t)(end - (src))) {                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1321:17): [True: 3, False: 62]
  |  |  |  |  ------------------
  |  |  |  | 1322|      3|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|      3|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1323|      3|                goto Exit;                                                                                                         \
  |  |  |  | 1324|      3|            }                                                                                                                      \
  |  |  |  | 1325|     65|            _block_size = 0;                                                                                                       \
  |  |  |  | 1326|    124|            do {                                                                                                                   \
  |  |  |  | 1327|    124|                _block_size = _block_size << 8 | *(src)++;                                                                         \
  |  |  |  | 1328|    124|            } while (--_capacity != 0);                                                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1328:22): [True: 62, False: 62]
  |  |  |  |  ------------------
  |  |  |  | 1329|     62|        }                                                                                                                          \
  |  |  |  | 1330|     65|        if (_block_size > (size_t)(end - (src))) {                                                                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1330:13): [True: 20, False: 42]
  |  |  |  |  ------------------
  |  |  |  | 1331|     20|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|     20|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1332|     20|            goto Exit;                                                                                                             \
  |  |  |  | 1333|     20|        }                                                                                                                          \
  |  |  |  | 1334|     62|        do {                                                                                                                       \
  |  |  |  | 1335|     42|            const uint8_t *const end = (src) + _block_size;                                                                        \
  |  |  |  | 1336|     42|            do {                                                                                                                   \
  |  |  |  | 1337|  62.0k|                block                                                                                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1337:17): [True: 10, False: 12.3k]
  |  |  |  |  |  Branch (1337:17): [True: 373, False: 11.9k]
  |  |  |  |  |  Branch (1337:17): [True: 12.2k, False: 32]
  |  |  |  |  ------------------
  |  |  |  | 1338|     42|            } while (0);                                                                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1338:22): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1339|     42|            if ((src) != end) {                                                                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1339:17): [True: 0, False: 32]
  |  |  |  |  ------------------
  |  |  |  | 1340|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1341|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1342|      0|            }                                                                                                                      \
  |  |  |  | 1343|     32|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1343:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1344|     42|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1344:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1357|     65|        ptls_decode_assert_block_close((src), end);                                                                                \
  |  |  ------------------
  |  |  |  | 1347|     32|    do {                                                                                                                           \
  |  |  |  | 1348|     32|        if ((src) != end) {                                                                                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1348:13): [True: 12, False: 20]
  |  |  |  |  ------------------
  |  |  |  | 1349|     12|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|     12|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1350|     12|            goto Exit;                                                                                                             \
  |  |  |  | 1351|     12|        }                                                                                                                          \
  |  |  |  | 1352|     32|    } while (0);
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1352:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1358|     20|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1358:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1980|     65|        do {
 1981|     65|            uint16_t id;
 1982|     65|            if ((ret = ptls_decode16(&id, src, end)) != 0)
 1983|     65|                goto Exit;
 1984|     65|            if (sa->count < PTLS_ELEMENTSOF(sa->list))
 1985|     65|                sa->list[sa->count++] = id;
 1986|     65|        } while (*src != end);
 1987|     65|    });
 1988|       |
 1989|     20|    ret = 0;
 1990|     65|Exit:
 1991|     65|    return ret;
 1992|     20|}
picotls.c:client_handle_certificate:
 3285|    426|{
 3286|    426|    int ret;
 3287|       |
 3288|    426|    if ((ret = client_do_handle_certificate(tls, message.base + PTLS_HANDSHAKE_HEADER_SIZE, message.base + message.len)) != 0)
  ------------------
  |  |   56|    426|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
  |  Branch (3288:9): [True: 326, False: 100]
  ------------------
 3289|    326|        return ret;
 3290|       |
 3291|    100|    ptls__key_schedule_update_hash(tls->key_schedule, message.base, message.len, 0);
 3292|       |
 3293|    100|    tls->state = PTLS_STATE_CLIENT_EXPECT_CERTIFICATE_VERIFY;
 3294|    100|    return PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  242|    100|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  193|    100|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 3295|    426|}
picotls.c:client_do_handle_certificate:
 3273|    426|{
 3274|    426|    int got_certs, ret;
 3275|       |
 3276|    426|    if ((ret = handle_certificate(tls, src, end, &got_certs)) != 0)
  ------------------
  |  Branch (3276:9): [True: 325, False: 101]
  ------------------
 3277|    325|        return ret;
 3278|    101|    if (!got_certs)
  ------------------
  |  Branch (3278:9): [True: 1, False: 100]
  ------------------
 3279|      1|        return PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  216|      1|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 3280|       |
 3281|    100|    return 0;
 3282|    101|}
picotls.c:handle_certificate:
 3221|    426|{
 3222|    426|    ptls_iovec_t certs[16];
 3223|    426|    size_t num_certs = 0;
 3224|    426|    int ret = 0;
 3225|       |
 3226|       |    /* certificate request context */
 3227|    426|    ptls_decode_open_block(src, end, 1, {
  ------------------
  |  | 1307|    426|    do {                                                                                                                           \
  |  | 1308|    426|        size_t _capacity = (capacity);                                                                                             \
  |  | 1309|    426|        size_t _block_size;                                                                                                        \
  |  | 1310|    426|        if (_capacity == -1) {                                                                                                     \
  |  |  ------------------
  |  |  |  Branch (1310:13): [True: 0, False: 426]
  |  |  ------------------
  |  | 1311|      0|            uint64_t _block_size64;                                                                                                \
  |  | 1312|      0|            const uint8_t *_src = (src);                                                                                           \
  |  | 1313|      0|            if ((_block_size64 = ptls_decode_quicint(&_src, end)) == UINT64_MAX ||                                                 \
  |  |  ------------------
  |  |  |  Branch (1313:17): [True: 0, False: 0]
  |  |  ------------------
  |  | 1314|      0|                (sizeof(size_t) < 8 && (_block_size64 >> (8 * sizeof(size_t))) != 0)) {                                            \
  |  |  ------------------
  |  |  |  Branch (1314:18): [Folded - Ignored]
  |  |  |  Branch (1314:40): [True: 0, False: 0]
  |  |  ------------------
  |  | 1315|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1316|      0|                goto Exit;                                                                                                         \
  |  | 1317|      0|            }                                                                                                                      \
  |  | 1318|      0|            (src) = _src;                                                                                                          \
  |  | 1319|      0|            _block_size = (size_t)_block_size64;                                                                                   \
  |  | 1320|    426|        } else {                                                                                                                   \
  |  | 1321|    426|            if (_capacity > (size_t)(end - (src))) {                                                                               \
  |  |  ------------------
  |  |  |  Branch (1321:17): [True: 2, False: 424]
  |  |  ------------------
  |  | 1322|      2|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  219|      2|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1323|      2|                goto Exit;                                                                                                         \
  |  | 1324|      2|            }                                                                                                                      \
  |  | 1325|    426|            _block_size = 0;                                                                                                       \
  |  | 1326|    424|            do {                                                                                                                   \
  |  | 1327|    424|                _block_size = _block_size << 8 | *(src)++;                                                                         \
  |  | 1328|    424|            } while (--_capacity != 0);                                                                                            \
  |  |  ------------------
  |  |  |  Branch (1328:22): [True: 0, False: 424]
  |  |  ------------------
  |  | 1329|    424|        }                                                                                                                          \
  |  | 1330|    426|        if (_block_size > (size_t)(end - (src))) {                                                                                 \
  |  |  ------------------
  |  |  |  Branch (1330:13): [True: 8, False: 416]
  |  |  ------------------
  |  | 1331|      8|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  ------------------
  |  |  |  |  219|      8|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1332|      8|            goto Exit;                                                                                                             \
  |  | 1333|      8|        }                                                                                                                          \
  |  | 1334|    424|        do {                                                                                                                       \
  |  | 1335|    416|            const uint8_t *const end = (src) + _block_size;                                                                        \
  |  | 1336|    416|            do {                                                                                                                   \
  |  | 1337|    430|                block                                                                                                              \
  |  |  ------------------
  |  |  |  Branch (1337:17): [True: 14, False: 402]
  |  |  ------------------
  |  | 1338|    416|            } while (0);                                                                                                           \
  |  |  ------------------
  |  |  |  Branch (1338:22): [Folded - Ignored]
  |  |  ------------------
  |  | 1339|    416|            if ((src) != end) {                                                                                                    \
  |  |  ------------------
  |  |  |  Branch (1339:17): [True: 0, False: 402]
  |  |  ------------------
  |  | 1340|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1341|      0|                goto Exit;                                                                                                         \
  |  | 1342|      0|            }                                                                                                                      \
  |  | 1343|    402|        } while (0);                                                                                                               \
  |  |  ------------------
  |  |  |  Branch (1343:18): [Folded - Ignored]
  |  |  ------------------
  |  | 1344|    416|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1344:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3228|    426|        if (src != end) {
 3229|    426|            ret = PTLS_ALERT_ILLEGAL_PARAMETER;
 3230|    426|            goto Exit;
 3231|    426|        }
 3232|    426|    });
 3233|       |    /* certificate_list */
 3234|    402|    ptls_decode_block(src, end, 3, {
  ------------------
  |  | 1355|    402|    do {                                                                                                                           \
  |  | 1356|    402|        ptls_decode_open_block((src), end, capacity, block);                                                                       \
  |  |  ------------------
  |  |  |  | 1307|    402|    do {                                                                                                                           \
  |  |  |  | 1308|    402|        size_t _capacity = (capacity);                                                                                             \
  |  |  |  | 1309|    402|        size_t _block_size;                                                                                                        \
  |  |  |  | 1310|    402|        if (_capacity == -1) {                                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1310:13): [True: 0, False: 402]
  |  |  |  |  ------------------
  |  |  |  | 1311|      0|            uint64_t _block_size64;                                                                                                \
  |  |  |  | 1312|      0|            const uint8_t *_src = (src);                                                                                           \
  |  |  |  | 1313|      0|            if ((_block_size64 = ptls_decode_quicint(&_src, end)) == UINT64_MAX ||                                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1313:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1314|      0|                (sizeof(size_t) < 8 && (_block_size64 >> (8 * sizeof(size_t))) != 0)) {                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1314:18): [Folded - Ignored]
  |  |  |  |  |  Branch (1314:40): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1315|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1316|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1317|      0|            }                                                                                                                      \
  |  |  |  | 1318|      0|            (src) = _src;                                                                                                          \
  |  |  |  | 1319|      0|            _block_size = (size_t)_block_size64;                                                                                   \
  |  |  |  | 1320|    402|        } else {                                                                                                                   \
  |  |  |  | 1321|    402|            if (_capacity > (size_t)(end - (src))) {                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1321:17): [True: 3, False: 399]
  |  |  |  |  ------------------
  |  |  |  | 1322|      3|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|      3|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1323|      3|                goto Exit;                                                                                                         \
  |  |  |  | 1324|      3|            }                                                                                                                      \
  |  |  |  | 1325|    402|            _block_size = 0;                                                                                                       \
  |  |  |  | 1326|  1.19k|            do {                                                                                                                   \
  |  |  |  | 1327|  1.19k|                _block_size = _block_size << 8 | *(src)++;                                                                         \
  |  |  |  | 1328|  1.19k|            } while (--_capacity != 0);                                                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1328:22): [True: 798, False: 399]
  |  |  |  |  ------------------
  |  |  |  | 1329|    399|        }                                                                                                                          \
  |  |  |  | 1330|    402|        if (_block_size > (size_t)(end - (src))) {                                                                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1330:13): [True: 43, False: 356]
  |  |  |  |  ------------------
  |  |  |  | 1331|     43|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|     43|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1332|     43|            goto Exit;                                                                                                             \
  |  |  |  | 1333|     43|        }                                                                                                                          \
  |  |  |  | 1334|    399|        do {                                                                                                                       \
  |  |  |  | 1335|    356|            const uint8_t *const end = (src) + _block_size;                                                                        \
  |  |  |  | 1336|    356|            do {                                                                                                                   \
  |  |  |  | 1337|   109k|                block                                                                                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  Branch (1337:17): [True: 7, False: 1.84k]
  |  |  |  |  |  Branch (1337:17): [True: 3.68k, False: 1.84k]
  |  |  |  |  |  Branch (1337:17): [True: 0, False: 1.85k]
  |  |  |  |  |  Branch (1337:17): [True: 51, False: 1.79k]
  |  |  |  |  |  Branch (1337:17): [True: 709, False: 1.08k]
  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1337:17): [True: 0, False: 1.79k]
  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  Branch (1337:17): [True: 14, False: 1.77k]
  |  |  |  |  |  Branch (1337:17): [True: 1.77k, False: 1.77k]
  |  |  |  |  |  Branch (1337:17): [True: 0, False: 1.79k]
  |  |  |  |  |  Branch (1337:17): [True: 25, False: 1.75k]
  |  |  |  |  |  Branch (1337:17): [True: 4, False: 1.05k]
  |  |  |  |  |  Branch (1337:17): [True: 29, False: 1.02k]
  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  Branch (1337:17): [True: 79, False: 948]
  |  |  |  |  |  Branch (1337:17): [True: 948, False: 948]
  |  |  |  |  |  Branch (1337:17): [True: 0, False: 1.02k]
  |  |  |  |  |  Branch (1337:17): [True: 41, False: 907]
  |  |  |  |  |  Branch (1337:17): [True: 0, False: 907]
  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1337:17): [True: 0, False: 907]
  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1337:17): [True: 1.06k, False: 1.60k]
  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1337:17): [True: 0, False: 1.60k]
  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1337:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1337:17): [True: 1.85k, False: 106]
  |  |  |  |  ------------------
  |  |  |  | 1338|    356|            } while (0);                                                                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1338:22): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1339|    356|            if ((src) != end) {                                                                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1339:17): [True: 0, False: 106]
  |  |  |  |  ------------------
  |  |  |  | 1340|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1341|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1342|      0|            }                                                                                                                      \
  |  |  |  | 1343|    106|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1343:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1344|    356|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1344:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1357|    402|        ptls_decode_assert_block_close((src), end);                                                                                \
  |  |  ------------------
  |  |  |  | 1347|    106|    do {                                                                                                                           \
  |  |  |  | 1348|    106|        if ((src) != end) {                                                                                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1348:13): [True: 5, False: 101]
  |  |  |  |  ------------------
  |  |  |  | 1349|      5|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|      5|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1350|      5|            goto Exit;                                                                                                             \
  |  |  |  | 1351|      5|        }                                                                                                                          \
  |  |  |  | 1352|    106|    } while (0);
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1352:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1358|    101|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1358:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3235|    402|        while (src != end) {
 3236|    402|            ptls_decode_open_block(src, end, 3, {
 3237|    402|                if (num_certs < PTLS_ELEMENTSOF(certs))
 3238|    402|                    certs[num_certs++] = ptls_iovec_init(src, end - src);
 3239|    402|                src = end;
 3240|    402|            });
 3241|    402|            uint16_t type;
 3242|    402|            decode_open_extensions(src, end, PTLS_HANDSHAKE_TYPE_CERTIFICATE, &type, {
 3243|    402|                if (tls->ctx->on_extension != NULL &&
 3244|    402|                    (ret = tls->ctx->on_extension->cb(tls->ctx->on_extension, tls, PTLS_HANDSHAKE_TYPE_CERTIFICATE, type,
 3245|    402|                                                      ptls_iovec_init(src, end - src)) != 0))
 3246|    402|                    goto Exit;
 3247|    402|                src = end;
 3248|    402|            });
 3249|    402|        }
 3250|    402|    });
 3251|       |
 3252|    101|    if (tls->ctx->verify_certificate != NULL) {
  ------------------
  |  Branch (3252:9): [True: 0, False: 101]
  ------------------
 3253|      0|        const char *server_name = NULL;
 3254|      0|        if (!ptls_is_server(tls)) {
  ------------------
  |  Branch (3254:13): [True: 0, False: 0]
  ------------------
 3255|      0|            if (tls->ech.offered && !ptls_is_ech_handshake(tls, NULL, NULL, NULL)) {
  ------------------
  |  Branch (3255:17): [True: 0, False: 0]
  |  Branch (3255:37): [True: 0, False: 0]
  ------------------
 3256|      0|                server_name = tls->ech.client.public_name;
 3257|      0|            } else {
 3258|      0|                server_name = tls->server_name;
 3259|      0|            }
 3260|      0|        }
 3261|      0|        if ((ret = tls->ctx->verify_certificate->cb(tls->ctx->verify_certificate, tls, server_name, &tls->certificate_verify.cb,
  ------------------
  |  Branch (3261:13): [True: 0, False: 0]
  ------------------
 3262|      0|                                                    &tls->certificate_verify.verify_ctx, certs, num_certs)) != 0)
 3263|      0|            goto Exit;
 3264|      0|    }
 3265|       |
 3266|    101|    *got_certs = num_certs != 0;
 3267|       |
 3268|    426|Exit:
 3269|    426|    return ret;
 3270|    101|}
picotls.c:client_handle_compressed_certificate:
 3298|      2|{
 3299|      2|    const uint8_t *src = message.base + PTLS_HANDSHAKE_HEADER_SIZE, *const end = message.base + message.len;
  ------------------
  |  |   56|      2|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
 3300|      2|    uint16_t algo;
 3301|      2|    uint32_t uncompressed_size;
 3302|      2|    uint8_t *uncompressed = NULL;
 3303|      2|    int ret;
 3304|       |
 3305|      2|    if (tls->ctx->decompress_certificate == NULL) {
  ------------------
  |  Branch (3305:9): [True: 2, False: 0]
  ------------------
 3306|      2|        ret = PTLS_ALERT_UNEXPECTED_MESSAGE;
  ------------------
  |  |  208|      2|#define PTLS_ALERT_UNEXPECTED_MESSAGE 10
  ------------------
 3307|      2|        goto Exit;
 3308|      2|    }
 3309|       |
 3310|       |    /* decode */
 3311|      0|    if ((ret = ptls_decode16(&algo, &src, end)) != 0)
  ------------------
  |  Branch (3311:9): [True: 0, False: 0]
  ------------------
 3312|      0|        goto Exit;
 3313|      0|    if ((ret = ptls_decode24(&uncompressed_size, &src, end)) != 0)
  ------------------
  |  Branch (3313:9): [True: 0, False: 0]
  ------------------
 3314|      0|        goto Exit;
 3315|      0|    if (uncompressed_size > 65536) { /* TODO find a sensible number */
  ------------------
  |  Branch (3315:9): [True: 0, False: 0]
  ------------------
 3316|      0|        ret = PTLS_ALERT_BAD_CERTIFICATE;
  ------------------
  |  |  211|      0|#define PTLS_ALERT_BAD_CERTIFICATE 42
  ------------------
 3317|      0|        goto Exit;
 3318|      0|    }
 3319|      0|    if ((uncompressed = malloc(uncompressed_size)) == NULL) {
  ------------------
  |  Branch (3319:9): [True: 0, False: 0]
  ------------------
 3320|      0|        ret = PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  241|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 3321|      0|        goto Exit;
 3322|      0|    }
 3323|      0|    ptls_decode_block(src, end, 3, {
  ------------------
  |  | 1355|      0|    do {                                                                                                                           \
  |  | 1356|      0|        ptls_decode_open_block((src), end, capacity, block);                                                                       \
  |  |  ------------------
  |  |  |  | 1307|      0|    do {                                                                                                                           \
  |  |  |  | 1308|      0|        size_t _capacity = (capacity);                                                                                             \
  |  |  |  | 1309|      0|        size_t _block_size;                                                                                                        \
  |  |  |  | 1310|      0|        if (_capacity == -1) {                                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1310:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1311|      0|            uint64_t _block_size64;                                                                                                \
  |  |  |  | 1312|      0|            const uint8_t *_src = (src);                                                                                           \
  |  |  |  | 1313|      0|            if ((_block_size64 = ptls_decode_quicint(&_src, end)) == UINT64_MAX ||                                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1313:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1314|      0|                (sizeof(size_t) < 8 && (_block_size64 >> (8 * sizeof(size_t))) != 0)) {                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1314:18): [Folded - Ignored]
  |  |  |  |  |  Branch (1314:40): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1315|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1316|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1317|      0|            }                                                                                                                      \
  |  |  |  | 1318|      0|            (src) = _src;                                                                                                          \
  |  |  |  | 1319|      0|            _block_size = (size_t)_block_size64;                                                                                   \
  |  |  |  | 1320|      0|        } else {                                                                                                                   \
  |  |  |  | 1321|      0|            if (_capacity > (size_t)(end - (src))) {                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1321:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1322|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1323|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1324|      0|            }                                                                                                                      \
  |  |  |  | 1325|      0|            _block_size = 0;                                                                                                       \
  |  |  |  | 1326|      0|            do {                                                                                                                   \
  |  |  |  | 1327|      0|                _block_size = _block_size << 8 | *(src)++;                                                                         \
  |  |  |  | 1328|      0|            } while (--_capacity != 0);                                                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1328:22): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1329|      0|        }                                                                                                                          \
  |  |  |  | 1330|      0|        if (_block_size > (size_t)(end - (src))) {                                                                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1330:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1331|      0|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1332|      0|            goto Exit;                                                                                                             \
  |  |  |  | 1333|      0|        }                                                                                                                          \
  |  |  |  | 1334|      0|        do {                                                                                                                       \
  |  |  |  | 1335|      0|            const uint8_t *const end = (src) + _block_size;                                                                        \
  |  |  |  | 1336|      0|            do {                                                                                                                   \
  |  |  |  | 1337|      0|                block                                                                                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1337:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1338|      0|            } while (0);                                                                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1338:22): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1339|      0|            if ((src) != end) {                                                                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1339:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1340|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1341|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1342|      0|            }                                                                                                                      \
  |  |  |  | 1343|      0|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1343:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1344|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1344:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1357|      0|        ptls_decode_assert_block_close((src), end);                                                                                \
  |  |  ------------------
  |  |  |  | 1347|      0|    do {                                                                                                                           \
  |  |  |  | 1348|      0|        if ((src) != end) {                                                                                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1348:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1349|      0|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1350|      0|            goto Exit;                                                                                                             \
  |  |  |  | 1351|      0|        }                                                                                                                          \
  |  |  |  | 1352|      0|    } while (0);
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1352:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1358|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1358:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3324|      0|        if ((ret = tls->ctx->decompress_certificate->cb(tls->ctx->decompress_certificate, tls, algo,
 3325|      0|                                                        ptls_iovec_init(uncompressed, uncompressed_size),
 3326|      0|                                                        ptls_iovec_init(src, end - src))) != 0)
 3327|      0|            goto Exit;
 3328|      0|        src = end;
 3329|      0|    });
 3330|       |
 3331|       |    /* handle */
 3332|      0|    if ((ret = client_do_handle_certificate(tls, uncompressed, uncompressed + uncompressed_size)) != 0)
  ------------------
  |  Branch (3332:9): [True: 0, False: 0]
  ------------------
 3333|      0|        goto Exit;
 3334|       |
 3335|      0|    ptls__key_schedule_update_hash(tls->key_schedule, message.base, message.len, 0);
 3336|      0|    tls->state = PTLS_STATE_CLIENT_EXPECT_CERTIFICATE_VERIFY;
 3337|      0|    ret = PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  242|      0|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 3338|       |
 3339|      2|Exit:
 3340|      2|    free(uncompressed);
 3341|      2|    return ret;
 3342|      0|}
picotls.c:client_handle_certificate_verify:
 3400|     81|{
 3401|     81|    int ret = handle_certificate_verify(tls, message, PTLS_SERVER_CERTIFICATE_VERIFY_CONTEXT_STRING);
  ------------------
  |  |   85|     81|#define PTLS_SERVER_CERTIFICATE_VERIFY_CONTEXT_STRING "TLS 1.3, server CertificateVerify"
  ------------------
 3402|       |
 3403|     81|    if (ret == 0) {
  ------------------
  |  Branch (3403:9): [True: 40, False: 41]
  ------------------
 3404|     40|        tls->state = PTLS_STATE_CLIENT_EXPECT_FINISHED;
 3405|     40|        ret = PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  242|     40|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  193|     40|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 3406|     40|    }
 3407|       |
 3408|     81|    return ret;
 3409|     81|}
picotls.c:handle_certificate_verify:
 3364|     81|{
 3365|     81|    const uint8_t *src = message.base + PTLS_HANDSHAKE_HEADER_SIZE, *const end = message.base + message.len;
  ------------------
  |  |   56|     81|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
 3366|     81|    uint16_t algo;
 3367|     81|    ptls_iovec_t signature;
 3368|     81|    uint8_t signdata[PTLS_MAX_CERTIFICATE_VERIFY_SIGNDATA_SIZE];
 3369|     81|    size_t signdata_size;
 3370|     81|    int ret;
 3371|       |
 3372|       |    /* decode */
 3373|     81|    if ((ret = ptls_decode16(&algo, &src, end)) != 0)
  ------------------
  |  Branch (3373:9): [True: 1, False: 80]
  ------------------
 3374|      1|        goto Exit;
 3375|     80|    ptls_decode_block(src, end, 2, {
  ------------------
  |  | 1355|     80|    do {                                                                                                                           \
  |  | 1356|     80|        ptls_decode_open_block((src), end, capacity, block);                                                                       \
  |  |  ------------------
  |  |  |  | 1307|     80|    do {                                                                                                                           \
  |  |  |  | 1308|     80|        size_t _capacity = (capacity);                                                                                             \
  |  |  |  | 1309|     80|        size_t _block_size;                                                                                                        \
  |  |  |  | 1310|     80|        if (_capacity == -1) {                                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1310:13): [True: 0, False: 80]
  |  |  |  |  ------------------
  |  |  |  | 1311|      0|            uint64_t _block_size64;                                                                                                \
  |  |  |  | 1312|      0|            const uint8_t *_src = (src);                                                                                           \
  |  |  |  | 1313|      0|            if ((_block_size64 = ptls_decode_quicint(&_src, end)) == UINT64_MAX ||                                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1313:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1314|      0|                (sizeof(size_t) < 8 && (_block_size64 >> (8 * sizeof(size_t))) != 0)) {                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1314:18): [Folded - Ignored]
  |  |  |  |  |  Branch (1314:40): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1315|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1316|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1317|      0|            }                                                                                                                      \
  |  |  |  | 1318|      0|            (src) = _src;                                                                                                          \
  |  |  |  | 1319|      0|            _block_size = (size_t)_block_size64;                                                                                   \
  |  |  |  | 1320|     80|        } else {                                                                                                                   \
  |  |  |  | 1321|     80|            if (_capacity > (size_t)(end - (src))) {                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1321:17): [True: 2, False: 78]
  |  |  |  |  ------------------
  |  |  |  | 1322|      2|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|      2|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1323|      2|                goto Exit;                                                                                                         \
  |  |  |  | 1324|      2|            }                                                                                                                      \
  |  |  |  | 1325|     80|            _block_size = 0;                                                                                                       \
  |  |  |  | 1326|    156|            do {                                                                                                                   \
  |  |  |  | 1327|    156|                _block_size = _block_size << 8 | *(src)++;                                                                         \
  |  |  |  | 1328|    156|            } while (--_capacity != 0);                                                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1328:22): [True: 78, False: 78]
  |  |  |  |  ------------------
  |  |  |  | 1329|     78|        }                                                                                                                          \
  |  |  |  | 1330|     80|        if (_block_size > (size_t)(end - (src))) {                                                                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1330:13): [True: 33, False: 45]
  |  |  |  |  ------------------
  |  |  |  | 1331|     33|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|     33|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1332|     33|            goto Exit;                                                                                                             \
  |  |  |  | 1333|     33|        }                                                                                                                          \
  |  |  |  | 1334|     78|        do {                                                                                                                       \
  |  |  |  | 1335|     45|            const uint8_t *const end = (src) + _block_size;                                                                        \
  |  |  |  | 1336|     45|            do {                                                                                                                   \
  |  |  |  | 1337|     45|                block                                                                                                              \
  |  |  |  | 1338|     45|            } while (0);                                                                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1338:22): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1339|     45|            if ((src) != end) {                                                                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1339:17): [True: 0, False: 45]
  |  |  |  |  ------------------
  |  |  |  | 1340|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1341|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1342|      0|            }                                                                                                                      \
  |  |  |  | 1343|     45|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1343:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1344|     45|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1344:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1357|     80|        ptls_decode_assert_block_close((src), end);                                                                                \
  |  |  ------------------
  |  |  |  | 1347|     45|    do {                                                                                                                           \
  |  |  |  | 1348|     45|        if ((src) != end) {                                                                                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1348:13): [True: 5, False: 40]
  |  |  |  |  ------------------
  |  |  |  | 1349|      5|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|      5|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1350|      5|            goto Exit;                                                                                                             \
  |  |  |  | 1351|      5|        }                                                                                                                          \
  |  |  |  | 1352|     45|    } while (0);
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1352:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1358|     40|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1358:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3376|     80|        signature = ptls_iovec_init(src, end - src);
 3377|     80|        src = end;
 3378|     80|    });
 3379|       |
 3380|     40|    signdata_size = build_certificate_verify_signdata(signdata, tls->key_schedule, context_string);
 3381|     40|    if (tls->certificate_verify.cb != NULL) {
  ------------------
  |  Branch (3381:9): [True: 0, False: 40]
  ------------------
 3382|      0|        ret = tls->certificate_verify.cb(tls->certificate_verify.verify_ctx, algo, ptls_iovec_init(signdata, signdata_size),
 3383|      0|                                         signature);
 3384|     40|    } else {
 3385|     40|        ret = 0;
 3386|     40|    }
 3387|     40|    ptls_clear_memory(signdata, signdata_size);
 3388|     40|    tls->certificate_verify.cb = NULL;
 3389|     40|    if (ret != 0) {
  ------------------
  |  Branch (3389:9): [True: 0, False: 40]
  ------------------
 3390|      0|        goto Exit;
 3391|      0|    }
 3392|       |
 3393|     40|    ptls__key_schedule_update_hash(tls->key_schedule, message.base, message.len, 0);
 3394|       |
 3395|     81|Exit:
 3396|     81|    return ret;
 3397|     40|}
picotls.c:client_handle_finished:
 3424|     18|{
 3425|     18|    uint8_t send_secret[PTLS_MAX_DIGEST_SIZE];
 3426|     18|    int alert_ech_required = tls->ech.offered && !ptls_is_ech_handshake(tls, NULL, NULL, NULL), ret;
  ------------------
  |  Branch (3426:30): [True: 0, False: 18]
  |  Branch (3426:50): [True: 0, False: 0]
  ------------------
 3427|       |
 3428|     18|    if ((ret = verify_finished(tls, message)) != 0)
  ------------------
  |  Branch (3428:9): [True: 18, False: 0]
  ------------------
 3429|     18|        goto Exit;
 3430|      0|    ptls__key_schedule_update_hash(tls->key_schedule, message.base, message.len, 0);
 3431|       |
 3432|       |    /* update traffic keys by using messages upto ServerFinished, but commission them after sending ClientFinished */
 3433|      0|    if ((ret = key_schedule_extract(tls->key_schedule, ptls_iovec_init(NULL, 0))) != 0)
  ------------------
  |  Branch (3433:9): [True: 0, False: 0]
  ------------------
 3434|      0|        goto Exit;
 3435|      0|    if ((ret = setup_traffic_protection(tls, 0, "s ap traffic", 3, 0, 0)) != 0)
  ------------------
  |  Branch (3435:9): [True: 0, False: 0]
  ------------------
 3436|      0|        goto Exit;
 3437|      0|    if ((ret = derive_secret(tls->key_schedule, send_secret, "c ap traffic")) != 0)
  ------------------
  |  Branch (3437:9): [True: 0, False: 0]
  ------------------
 3438|      0|        goto Exit;
 3439|      0|    if ((ret = derive_exporter_secret(tls, 0)) != 0)
  ------------------
  |  Branch (3439:9): [True: 0, False: 0]
  ------------------
 3440|      0|        goto Exit;
 3441|       |
 3442|       |    /* if sending early data, emit EOED and commision the client handshake traffic secret */
 3443|      0|    if (tls->pending_handshake_secret != NULL) {
  ------------------
  |  Branch (3443:9): [True: 0, False: 0]
  ------------------
 3444|      0|        assert(tls->traffic_protection.enc.aead != NULL || tls->ctx->update_traffic_key != NULL);
 3445|      0|        if (tls->client.using_early_data && !tls->ctx->omit_end_of_early_data)
  ------------------
  |  Branch (3445:13): [True: 0, False: 0]
  |  Branch (3445:45): [True: 0, False: 0]
  ------------------
 3446|      0|            ptls_push_message(emitter, tls->key_schedule, PTLS_HANDSHAKE_TYPE_END_OF_EARLY_DATA, {});
  ------------------
  |  | 1290|      0|    do {                                                                                                                           \
  |  | 1291|      0|        ptls_message_emitter_t *_emitter = (emitter);                                                                              \
  |  | 1292|      0|        if ((ret = _emitter->begin_message(_emitter)) != 0)                                                                        \
  |  |  ------------------
  |  |  |  Branch (1292:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1293|      0|            goto Exit;                                                                                                             \
  |  | 1294|      0|        ptls_buffer_push_message_body(_emitter->buf, (key_sched), (type), block);                                                  \
  |  |  ------------------
  |  |  |  | 1279|      0|    do {                                                                                                                           \
  |  |  |  | 1280|      0|        ptls_buffer_t *_buf = (buf);                                                                                               \
  |  |  |  | 1281|      0|        ptls_key_schedule_t *_key_sched = (key_sched);                                                                             \
  |  |  |  | 1282|      0|        size_t mess_start = _buf->off;                                                                                             \
  |  |  |  | 1283|      0|        ptls_buffer_push(_buf, (type));                                                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1196|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1197|      0|        if ((ret = ptls_buffer__do_pushv((buf), (uint8_t[]){__VA_ARGS__}, sizeof((uint8_t[]){__VA_ARGS__}))) != 0)                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1197:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1198|      0|            goto Exit;                                                                                                             \
  |  |  |  |  |  | 1199|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1199:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1284|      0|        ptls_buffer_push_block(_buf, 3, block);                                                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1235|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1236|      0|        size_t capacity = (_capacity);                                                                                             \
  |  |  |  |  |  | 1237|      0|        ptls_buffer_pushv((buf), (uint8_t *)"\0\0\0\0\0\0\0", capacity != -1 ? capacity : 1);                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1190|      0|    do {                                                                                                                           \
  |  |  |  |  |  |  |  | 1191|      0|        if ((ret = ptls_buffer__do_pushv((buf), (src), (len))) != 0)                                                               \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (1191:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (1191:57): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1192|      0|            goto Exit;                                                                                                             \
  |  |  |  |  |  |  |  | 1193|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (1193:14): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1238|      0|        size_t body_start = (buf)->off;                                                                                            \
  |  |  |  |  |  | 1239|      0|        do {                                                                                                                       \
  |  |  |  |  |  | 1240|      0|            block                                                                                                                  \
  |  |  |  |  |  | 1241|      0|        } while (0);                                                                                                               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1241:18): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1242|      0|        size_t body_size = (buf)->off - body_start;                                                                                \
  |  |  |  |  |  | 1243|      0|        if (capacity != -1) {                                                                                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1243:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1244|      0|            if (capacity < sizeof(size_t) && body_size >= (size_t)1 << (capacity * 8)) {                                           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1244:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1244:46): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1245|      0|                ret = PTLS_ERROR_BLOCK_OVERFLOW;                                                                                   \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  252|      0|#define PTLS_ERROR_BLOCK_OVERFLOW (PTLS_ERROR_CLASS_INTERNAL + 12)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  193|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1246|      0|                goto Exit;                                                                                                         \
  |  |  |  |  |  | 1247|      0|            }                                                                                                                      \
  |  |  |  |  |  | 1248|      0|            for (; capacity != 0; --capacity)                                                                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1248:20): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1249|      0|                (buf)->base[body_start - capacity] = (uint8_t)(body_size >> (8 * (capacity - 1)));                                 \
  |  |  |  |  |  | 1250|      0|        } else {                                                                                                                   \
  |  |  |  |  |  | 1251|      0|            if ((ret = ptls_buffer__adjust_quic_blocksize((buf), body_size)) != 0)                                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1251:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1252|      0|                goto Exit;                                                                                                         \
  |  |  |  |  |  | 1253|      0|        }                                                                                                                          \
  |  |  |  |  |  | 1254|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1254:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1285|      0|        if (_key_sched != NULL)                                                                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1285:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1286|      0|            ptls__key_schedule_update_hash(_key_sched, _buf->base + mess_start, _buf->off - mess_start, 0);                        \
  |  |  |  | 1287|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1287:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1295|      0|        if ((ret = _emitter->commit_message(_emitter)) != 0)                                                                       \
  |  |  ------------------
  |  |  |  Branch (1295:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1296|      0|            goto Exit;                                                                                                             \
  |  | 1297|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1297:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3447|      0|        tls->client.using_early_data = 0;
 3448|      0|        if ((ret = commission_handshake_secret(tls)) != 0)
  ------------------
  |  Branch (3448:13): [True: 0, False: 0]
  ------------------
 3449|      0|            goto Exit;
 3450|      0|    }
 3451|       |
 3452|      0|    if ((ret = push_change_cipher_spec(tls, emitter)) != 0)
  ------------------
  |  Branch (3452:9): [True: 0, False: 0]
  ------------------
 3453|      0|        goto Exit;
 3454|       |
 3455|      0|    if (!alert_ech_required && tls->client.certificate_request.context.base != NULL) {
  ------------------
  |  Branch (3455:9): [True: 0, False: 0]
  |  Branch (3455:32): [True: 0, False: 0]
  ------------------
 3456|      0|        if ((ret = send_certificate(tls, emitter, &tls->client.certificate_request.signature_algorithms,
  ------------------
  |  Branch (3456:13): [True: 0, False: 0]
  ------------------
 3457|      0|                                    tls->client.certificate_request.context, 0, NULL, 0)) == 0)
 3458|      0|            ret = send_certificate_verify(tls, emitter, &tls->client.certificate_request.signature_algorithms,
 3459|      0|                                          PTLS_CLIENT_CERTIFICATE_VERIFY_CONTEXT_STRING);
  ------------------
  |  |   86|      0|#define PTLS_CLIENT_CERTIFICATE_VERIFY_CONTEXT_STRING "TLS 1.3, client CertificateVerify"
  ------------------
 3460|      0|        free(tls->client.certificate_request.context.base);
 3461|      0|        tls->client.certificate_request.context = ptls_iovec_init(NULL, 0);
 3462|      0|        if (ret != 0)
  ------------------
  |  Branch (3462:13): [True: 0, False: 0]
  ------------------
 3463|      0|            goto Exit;
 3464|      0|    }
 3465|       |
 3466|      0|    ret = send_finished(tls, emitter);
 3467|       |
 3468|      0|    memcpy(tls->traffic_protection.enc.secret, send_secret, sizeof(send_secret));
 3469|      0|    if ((ret = setup_traffic_protection(tls, 1, NULL, 3, 0, 0)) != 0)
  ------------------
  |  Branch (3469:9): [True: 0, False: 0]
  ------------------
 3470|      0|        goto Exit;
 3471|       |
 3472|      0|    tls->state = PTLS_STATE_CLIENT_POST_HANDSHAKE;
 3473|       |
 3474|       |    /* if ECH was rejected, close the connection with ECH_REQUIRED alert after verifying messages up to Finished */
 3475|      0|    if (alert_ech_required)
  ------------------
  |  Branch (3475:9): [True: 0, False: 0]
  ------------------
 3476|      0|        ret = PTLS_ALERT_ECH_REQUIRED;
  ------------------
  |  |  230|      0|#define PTLS_ALERT_ECH_REQUIRED 121
  ------------------
 3477|       |
 3478|     18|Exit:
 3479|     18|    ptls_clear_memory(send_secret, sizeof(send_secret));
 3480|     18|    return ret;
 3481|      0|}
picotls.c:verify_finished:
 1813|     18|{
 1814|     18|    uint8_t verify_data[PTLS_MAX_DIGEST_SIZE];
 1815|     18|    int ret;
 1816|       |
 1817|     18|    if (PTLS_HANDSHAKE_HEADER_SIZE + tls->key_schedule->hashes[0].algo->digest_size != message.len) {
  ------------------
  |  |   56|     18|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
  |  Branch (1817:9): [True: 7, False: 11]
  ------------------
 1818|      7|        ret = PTLS_ALERT_DECODE_ERROR;
  ------------------
  |  |  219|      7|#define PTLS_ALERT_DECODE_ERROR 50
  ------------------
 1819|      7|        goto Exit;
 1820|      7|    }
 1821|       |
 1822|     11|    if ((ret = calc_verify_data(verify_data, tls->key_schedule, tls->traffic_protection.dec.secret)) != 0)
  ------------------
  |  Branch (1822:9): [True: 0, False: 11]
  ------------------
 1823|      0|        goto Exit;
 1824|     11|    if (!ptls_mem_equal(message.base + PTLS_HANDSHAKE_HEADER_SIZE, verify_data, tls->key_schedule->hashes[0].algo->digest_size)) {
  ------------------
  |  |   56|     11|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
  |  Branch (1824:9): [True: 11, False: 0]
  ------------------
 1825|     11|        ret = PTLS_ALERT_HANDSHAKE_FAILURE;
  ------------------
  |  |  210|     11|#define PTLS_ALERT_HANDSHAKE_FAILURE 40
  ------------------
 1826|     11|        goto Exit;
 1827|     11|    }
 1828|       |
 1829|     18|Exit:
 1830|     18|    ptls_clear_memory(verify_data, sizeof(verify_data));
 1831|     18|    return ret;
 1832|     11|}

