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

fuzz-server-hello.c:ptls_new:
 1758|  2.27k|{
 1759|  2.27k|    return is_server ? ptls_server_new(ctx) : ptls_client_new(ctx);
  ------------------
  |  Branch (1759:12): [True: 0, False: 2.27k]
  ------------------
 1760|  2.27k|}
fuzz-server-hello.c:ptls_buffer_init:
 1774|  4.55k|{
 1775|  4.55k|    assert(smallbuf != NULL);
 1776|      0|    buf->base = (uint8_t *)smallbuf;
 1777|  4.55k|    buf->off = 0;
 1778|  4.55k|    buf->capacity = smallbuf_size;
 1779|  4.55k|    buf->is_allocated = 0;
 1780|  4.55k|    buf->align_bits = 0;
 1781|  4.55k|}
fuzz-server-hello.c:ptls_buffer_dispose:
 1784|  4.55k|{
 1785|  4.55k|    ptls_buffer__release_memory(buf);
 1786|  4.55k|    *buf = (ptls_buffer_t){NULL, 0, 0, 0, 0};
 1787|  4.55k|}
picotls.c:ptls_iovec_init:
 1763|   123k|{
 1764|       |    /* avoid the "return (ptls_iovec_t){(uint8_t *)p, len};" construct because it requires C99
 1765|       |     * and triggers a warning "C4204: nonstandard extension used: non-constant aggregate initializer"
 1766|       |     * in Visual Studio */
 1767|   123k|    ptls_iovec_t r;
 1768|   123k|    r.base = (uint8_t *)p;
 1769|   123k|    r.len = len;
 1770|   123k|    return r;
 1771|   123k|}
picotls.c:ptls_buffer_init:
 1774|  39.6k|{
 1775|  39.6k|    assert(smallbuf != NULL);
 1776|      0|    buf->base = (uint8_t *)smallbuf;
 1777|  39.6k|    buf->off = 0;
 1778|  39.6k|    buf->capacity = smallbuf_size;
 1779|  39.6k|    buf->is_allocated = 0;
 1780|  39.6k|    buf->align_bits = 0;
 1781|  39.6k|}
picotls.c:ptls_buffer_dispose:
 1784|   125k|{
 1785|   125k|    ptls_buffer__release_memory(buf);
 1786|   125k|    *buf = (ptls_buffer_t){NULL, 0, 0, 0, 0};
 1787|   125k|}
openssl.c:sha256_create:
 1945|  13.9k|    {                                                                                                                              \
 1946|  13.9k|        struct name##_context_t *ctx;                                                                                              \
 1947|  13.9k|        if ((ctx = malloc(sizeof(*ctx))) == NULL)                                                                                  \
  ------------------
  |  Branch (1947:13): [True: 0, False: 13.9k]
  ------------------
 1948|  13.9k|            return NULL;                                                                                                           \
 1949|  13.9k|        ctx->super = (ptls_hash_context_t){name##_update, name##_final, name##_clone};                                             \
 1950|  13.9k|        init_func(&ctx->ctx);                                                                                                      \
 1951|  13.9k|        return &ctx->super;                                                                                                        \
 1952|  13.9k|    }
openssl.c:sha256_update:
 1905|   169k|    {                                                                                                                              \
 1906|   169k|        struct name##_context_t *ctx = (struct name##_context_t *)_ctx;                                                            \
 1907|   169k|        update_func(&ctx->ctx, src, len);                                                                                          \
 1908|   169k|    }                                                                                                                              \
openssl.c:sha256_final:
 1911|  61.8k|    {                                                                                                                              \
 1912|  61.8k|        struct name##_context_t *ctx = (struct name##_context_t *)_ctx;                                                            \
 1913|  61.8k|        if (mode == PTLS_HASH_FINAL_MODE_SNAPSHOT) {                                                                               \
  ------------------
  |  Branch (1913:13): [True: 2.39k, False: 59.4k]
  ------------------
 1914|  2.39k|            ctx_type copy = ctx->ctx;                                                                                              \
 1915|  2.39k|            final_func(&copy, md);                                                                                                 \
  ------------------
  |  | 1327|  2.39k|ptls_define_hash(sha256, SHA256_CTX, SHA256_Init, SHA256_Update, _sha256_final);
  |  |  ------------------
  |  |  |  | 1326|  2.39k|#define _sha256_final(ctx, md) SHA256_Final((md), (ctx))
  |  |  ------------------
  ------------------
 1916|  2.39k|            ptls_clear_memory(&copy, sizeof(copy));                                                                                \
 1917|  2.39k|            return;                                                                                                                \
 1918|  2.39k|        }                                                                                                                          \
 1919|  61.8k|        if (md != NULL)                                                                                                            \
  ------------------
  |  Branch (1919:13): [True: 48.9k, False: 10.4k]
  ------------------
 1920|  59.4k|            final_func(&ctx->ctx, md);                                                                                             \
  ------------------
  |  | 1327|  48.9k|ptls_define_hash(sha256, SHA256_CTX, SHA256_Init, SHA256_Update, _sha256_final);
  |  |  ------------------
  |  |  |  | 1326|  48.9k|#define _sha256_final(ctx, md) SHA256_Final((md), (ctx))
  |  |  ------------------
  ------------------
 1921|  59.4k|        switch (mode) {                                                                                                            \
 1922|  13.9k|        case PTLS_HASH_FINAL_MODE_FREE:                                                                                            \
  ------------------
  |  Branch (1922:9): [True: 13.9k, False: 45.4k]
  ------------------
 1923|  13.9k|            ptls_clear_memory(&ctx->ctx, sizeof(ctx->ctx));                                                                        \
 1924|  13.9k|            free(ctx);                                                                                                             \
 1925|  13.9k|            break;                                                                                                                 \
 1926|  45.4k|        case PTLS_HASH_FINAL_MODE_RESET:                                                                                           \
  ------------------
  |  Branch (1926:9): [True: 45.4k, False: 13.9k]
  ------------------
 1927|  45.4k|            init_func(&ctx->ctx);                                                                                                  \
 1928|  45.4k|            break;                                                                                                                 \
 1929|      0|        default:                                                                                                                   \
  ------------------
  |  Branch (1929:9): [True: 0, False: 59.4k]
  ------------------
 1930|      0|            assert(!"FIXME");                                                                                                      \
 1931|      0|            break;                                                                                                                 \
 1932|  59.4k|        }                                                                                                                          \
 1933|  59.4k|    }                                                                                                                              \

openssl.c:x9_62_create_context:
  318|  27.8k|{
  319|  27.8k|    int ret;
  320|       |
  321|  27.8k|    if ((*ctx = (struct st_x9_62_keyex_context_t *)malloc(sizeof(**ctx))) == NULL) {
  ------------------
  |  Branch (321:9): [True: 0, False: 27.8k]
  ------------------
  322|      0|        ret = PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  224|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  323|      0|        goto Exit;
  324|      0|    }
  325|  27.8k|    **ctx = (struct st_x9_62_keyex_context_t){{algo, {NULL}, x9_62_on_exchange}};
  326|       |
  327|  27.8k|    if (((*ctx)->bn_ctx = BN_CTX_new()) == NULL) {
  ------------------
  |  Branch (327:9): [True: 0, False: 27.8k]
  ------------------
  328|      0|        ret = PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  224|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  329|      0|        goto Exit;
  330|      0|    }
  331|       |
  332|  27.8k|    ret = 0;
  333|  27.8k|Exit:
  334|  27.8k|    if (ret != 0 && *ctx != NULL) {
  ------------------
  |  Branch (334:9): [True: 0, False: 27.8k]
  |  Branch (334:21): [True: 0, False: 0]
  ------------------
  335|      0|        x9_62_free_context(*ctx);
  336|      0|        *ctx = NULL;
  337|      0|    }
  338|  27.8k|    return ret;
  339|  27.8k|}
openssl.c:x9_62_on_exchange:
  289|  27.8k|{
  290|  27.8k|    struct st_x9_62_keyex_context_t *ctx = (struct st_x9_62_keyex_context_t *)*_ctx;
  291|  27.8k|    const EC_GROUP *group = EC_KEY_get0_group(ctx->privkey);
  292|  27.8k|    EC_POINT *peer_point = NULL;
  293|  27.8k|    int ret;
  294|       |
  295|  27.8k|    if (secret == NULL) {
  ------------------
  |  Branch (295:9): [True: 26.6k, False: 1.17k]
  ------------------
  296|  26.6k|        ret = 0;
  297|  26.6k|        goto Exit;
  298|  26.6k|    }
  299|       |
  300|  1.17k|    if ((peer_point = x9_62_decode_point(group, peerkey, ctx->bn_ctx)) == NULL) {
  ------------------
  |  Branch (300:9): [True: 1, False: 1.17k]
  ------------------
  301|      1|        ret = PTLS_ALERT_DECODE_ERROR;
  ------------------
  |  |  203|      1|#define PTLS_ALERT_DECODE_ERROR 50
  ------------------
  302|      1|        goto Exit;
  303|      1|    }
  304|  1.17k|    if ((ret = ecdh_calc_secret(secret, group, ctx->privkey, peer_point)) != 0)
  ------------------
  |  Branch (304:9): [True: 1, False: 1.17k]
  ------------------
  305|      1|        goto Exit;
  306|       |
  307|  27.8k|Exit:
  308|  27.8k|    if (peer_point != NULL)
  ------------------
  |  Branch (308:9): [True: 1.17k, False: 26.6k]
  ------------------
  309|  1.17k|        EC_POINT_free(peer_point);
  310|  27.8k|    if (release) {
  ------------------
  |  Branch (310:9): [True: 27.8k, False: 0]
  ------------------
  311|  27.8k|        x9_62_free_context(ctx);
  312|  27.8k|        *_ctx = NULL;
  313|  27.8k|    }
  314|  27.8k|    return ret;
  315|  1.17k|}
openssl.c:x9_62_decode_point:
  243|  1.17k|{
  244|  1.17k|    EC_POINT *point = NULL;
  245|       |
  246|  1.17k|    if ((point = EC_POINT_new(group)) == NULL)
  ------------------
  |  Branch (246:9): [True: 0, False: 1.17k]
  ------------------
  247|      0|        return NULL;
  248|  1.17k|    if (!EC_POINT_oct2point(group, point, vec.base, vec.len, bn_ctx)) {
  ------------------
  |  Branch (248:9): [True: 1, False: 1.17k]
  ------------------
  249|      1|        EC_POINT_free(point);
  250|      1|        return NULL;
  251|      1|    }
  252|       |
  253|  1.17k|    return point;
  254|  1.17k|}
openssl.c:ecdh_calc_secret:
  217|  1.17k|{
  218|  1.17k|    ptls_iovec_t secret;
  219|  1.17k|    int ret;
  220|       |
  221|  1.17k|    secret.len = (EC_GROUP_get_degree(group) + 7) / 8;
  222|  1.17k|    if ((secret.base = malloc(secret.len)) == NULL) {
  ------------------
  |  Branch (222:9): [True: 0, False: 1.17k]
  ------------------
  223|      0|        ret = PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  224|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  224|      0|        goto Exit;
  225|      0|    }
  226|  1.17k|    if (ECDH_compute_key(secret.base, secret.len, peer_point, privkey, NULL) <= 0) {
  ------------------
  |  Branch (226:9): [True: 1, False: 1.17k]
  ------------------
  227|      1|        ret = PTLS_ALERT_HANDSHAKE_FAILURE; /* ??? */
  ------------------
  |  |  194|      1|#define PTLS_ALERT_HANDSHAKE_FAILURE 40
  ------------------
  228|      1|        goto Exit;
  229|      1|    }
  230|  1.17k|    ret = 0;
  231|       |
  232|  1.17k|Exit:
  233|  1.17k|    if (ret == 0) {
  ------------------
  |  Branch (233:9): [True: 1.17k, False: 1]
  ------------------
  234|  1.17k|        *out = secret;
  235|  1.17k|    } else {
  236|      1|        free(secret.base);
  237|      1|        *out = (ptls_iovec_t){NULL};
  238|      1|    }
  239|  1.17k|    return ret;
  240|  1.17k|}
openssl.c:x9_62_setup_pubkey:
  342|  27.8k|{
  343|  27.8k|    const EC_GROUP *group = EC_KEY_get0_group(ctx->privkey);
  344|  27.8k|    const EC_POINT *pubkey = EC_KEY_get0_public_key(ctx->privkey);
  345|  27.8k|    if ((ctx->super.pubkey = x9_62_encode_point(group, pubkey, ctx->bn_ctx)).base == NULL)
  ------------------
  |  Branch (345:9): [True: 0, False: 27.8k]
  ------------------
  346|      0|        return PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  224|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  347|  27.8k|    return 0;
  348|  27.8k|}
openssl.c:x9_62_encode_point:
  257|  27.8k|{
  258|  27.8k|    ptls_iovec_t vec;
  259|       |
  260|  27.8k|    if ((vec.len = EC_POINT_point2oct(group, point, POINT_CONVERSION_UNCOMPRESSED, NULL, 0, bn_ctx)) == 0)
  ------------------
  |  Branch (260:9): [True: 0, False: 27.8k]
  ------------------
  261|      0|        return (ptls_iovec_t){NULL};
  262|  27.8k|    if ((vec.base = malloc(vec.len)) == NULL)
  ------------------
  |  Branch (262:9): [True: 0, False: 27.8k]
  ------------------
  263|      0|        return (ptls_iovec_t){NULL};
  264|  27.8k|    if (EC_POINT_point2oct(group, point, POINT_CONVERSION_UNCOMPRESSED, vec.base, vec.len, bn_ctx) != vec.len) {
  ------------------
  |  Branch (264:9): [True: 0, False: 27.8k]
  ------------------
  265|      0|        free(vec.base);
  266|      0|        return (ptls_iovec_t){NULL};
  267|      0|    }
  268|       |
  269|  27.8k|    return vec;
  270|  27.8k|}
openssl.c:x9_62_free_context:
  279|  27.8k|{
  280|  27.8k|    free(ctx->super.pubkey.base);
  281|  27.8k|    if (ctx->privkey != NULL)
  ------------------
  |  Branch (281:9): [True: 27.8k, False: 0]
  ------------------
  282|  27.8k|        EC_KEY_free(ctx->privkey);
  283|  27.8k|    if (ctx->bn_ctx != NULL)
  ------------------
  |  Branch (283:9): [True: 27.8k, False: 0]
  ------------------
  284|  27.8k|        BN_CTX_free(ctx->bn_ctx);
  285|  27.8k|    free(ctx);
  286|  27.8k|}
openssl.c:x9_62_create_key_exchange:
  351|  27.8k|{
  352|  27.8k|    EC_GROUP *group = NULL;
  353|  27.8k|    struct st_x9_62_keyex_context_t *ctx = NULL;
  354|  27.8k|    int ret;
  355|       |
  356|       |    /* FIXME use a global? */
  357|  27.8k|    if ((group = EC_GROUP_new_by_curve_name((int)algo->data)) == NULL) {
  ------------------
  |  Branch (357:9): [True: 0, False: 27.8k]
  ------------------
  358|      0|        ret = PTLS_ERROR_LIBRARY;
  ------------------
  |  |  226|      0|#define PTLS_ERROR_LIBRARY (PTLS_ERROR_CLASS_INTERNAL + 3)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  359|      0|        goto Exit;
  360|      0|    }
  361|  27.8k|    if ((ret = x9_62_create_context(algo, &ctx)) != 0)
  ------------------
  |  Branch (361:9): [True: 0, False: 27.8k]
  ------------------
  362|      0|        goto Exit;
  363|  27.8k|    if ((ctx->privkey = ecdh_gerenate_key(group)) == NULL) {
  ------------------
  |  Branch (363:9): [True: 0, False: 27.8k]
  ------------------
  364|      0|        ret = PTLS_ERROR_LIBRARY;
  ------------------
  |  |  226|      0|#define PTLS_ERROR_LIBRARY (PTLS_ERROR_CLASS_INTERNAL + 3)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  365|      0|        goto Exit;
  366|      0|    }
  367|  27.8k|    if ((ret = x9_62_setup_pubkey(ctx)) != 0)
  ------------------
  |  Branch (367:9): [True: 0, False: 27.8k]
  ------------------
  368|      0|        goto Exit;
  369|  27.8k|    ret = 0;
  370|       |
  371|  27.8k|Exit:
  372|  27.8k|    if (group != NULL)
  ------------------
  |  Branch (372:9): [True: 27.8k, False: 0]
  ------------------
  373|  27.8k|        EC_GROUP_free(group);
  374|  27.8k|    if (ret == 0) {
  ------------------
  |  Branch (374:9): [True: 27.8k, False: 0]
  ------------------
  375|  27.8k|        *_ctx = &ctx->super;
  376|  27.8k|    } else {
  377|      0|        if (ctx != NULL)
  ------------------
  |  Branch (377:13): [True: 0, False: 0]
  ------------------
  378|      0|            x9_62_free_context(ctx);
  379|      0|        *_ctx = NULL;
  380|      0|    }
  381|       |
  382|  27.8k|    return ret;
  383|  27.8k|}
openssl.c:ecdh_gerenate_key:
  203|  27.8k|{
  204|  27.8k|    EC_KEY *key;
  205|       |
  206|  27.8k|    if ((key = EC_KEY_new()) == NULL)
  ------------------
  |  Branch (206:9): [True: 0, False: 27.8k]
  ------------------
  207|      0|        return NULL;
  208|  27.8k|    if (!EC_KEY_set_group(key, group) || !EC_KEY_generate_key(key)) {
  ------------------
  |  Branch (208:9): [True: 0, False: 27.8k]
  |  Branch (208:42): [True: 0, False: 27.8k]
  ------------------
  209|      0|        EC_KEY_free(key);
  210|      0|        return NULL;
  211|      0|    }
  212|       |
  213|  27.8k|    return key;
  214|  27.8k|}
openssl.c:aead_aes128gcm_setup_crypto:
 1275|  2.34k|{
 1276|  2.34k|    return aead_setup_crypto(ctx, is_enc, key, iv, EVP_aes_128_gcm());
 1277|  2.34k|}
openssl.c:aead_setup_crypto:
 1221|  2.34k|{
 1222|  2.34k|    struct aead_crypto_context_t *ctx = (struct aead_crypto_context_t *)_ctx;
 1223|  2.34k|    int ret;
 1224|       |
 1225|  2.34k|    ctx->super.dispose_crypto = aead_dispose_crypto;
 1226|  2.34k|    ctx->super.do_get_iv = aead_get_iv;
 1227|  2.34k|    ctx->super.do_set_iv = aead_set_iv;
 1228|  2.34k|    if (is_enc) {
  ------------------
  |  Branch (1228:9): [True: 1.17k, False: 1.17k]
  ------------------
 1229|  1.17k|        ctx->super.do_encrypt_init = aead_do_encrypt_init;
 1230|  1.17k|        ctx->super.do_encrypt_update = aead_do_encrypt_update;
 1231|  1.17k|        ctx->super.do_encrypt_final = aead_do_encrypt_final;
 1232|  1.17k|        ctx->super.do_encrypt = ptls_aead__do_encrypt;
 1233|  1.17k|        ctx->super.do_encrypt_v = ptls_aead__do_encrypt_v;
 1234|  1.17k|        ctx->super.do_decrypt = NULL;
 1235|  1.17k|    } else {
 1236|  1.17k|        ctx->super.do_encrypt_init = NULL;
 1237|  1.17k|        ctx->super.do_encrypt_update = NULL;
 1238|  1.17k|        ctx->super.do_encrypt_final = NULL;
 1239|  1.17k|        ctx->super.do_encrypt = NULL;
 1240|  1.17k|        ctx->super.do_encrypt_v = NULL;
 1241|  1.17k|        ctx->super.do_decrypt = aead_do_decrypt;
 1242|  1.17k|    }
 1243|  2.34k|    ctx->evp_ctx = NULL;
 1244|       |
 1245|  2.34k|    if ((ctx->evp_ctx = EVP_CIPHER_CTX_new()) == NULL) {
  ------------------
  |  Branch (1245:9): [True: 0, False: 2.34k]
  ------------------
 1246|      0|        ret = PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  224|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 1247|      0|        goto Error;
 1248|      0|    }
 1249|  2.34k|    if (is_enc) {
  ------------------
  |  Branch (1249:9): [True: 1.17k, False: 1.17k]
  ------------------
 1250|  1.17k|        if (!EVP_EncryptInit_ex(ctx->evp_ctx, cipher, NULL, key, NULL)) {
  ------------------
  |  Branch (1250:13): [True: 0, False: 1.17k]
  ------------------
 1251|      0|            ret = PTLS_ERROR_LIBRARY;
  ------------------
  |  |  226|      0|#define PTLS_ERROR_LIBRARY (PTLS_ERROR_CLASS_INTERNAL + 3)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 1252|      0|            goto Error;
 1253|      0|        }
 1254|  1.17k|    } else {
 1255|  1.17k|        if (!EVP_DecryptInit_ex(ctx->evp_ctx, cipher, NULL, key, NULL)) {
  ------------------
  |  Branch (1255:13): [True: 0, False: 1.17k]
  ------------------
 1256|      0|            ret = PTLS_ERROR_LIBRARY;
  ------------------
  |  |  226|      0|#define PTLS_ERROR_LIBRARY (PTLS_ERROR_CLASS_INTERNAL + 3)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 1257|      0|            goto Error;
 1258|      0|        }
 1259|  1.17k|    }
 1260|  2.34k|    if (!EVP_CIPHER_CTX_ctrl(ctx->evp_ctx, EVP_CTRL_GCM_SET_IVLEN, (int)ctx->super.algo->iv_size, NULL)) {
  ------------------
  |  Branch (1260:9): [True: 0, False: 2.34k]
  ------------------
 1261|      0|        ret = PTLS_ERROR_LIBRARY;
  ------------------
  |  |  226|      0|#define PTLS_ERROR_LIBRARY (PTLS_ERROR_CLASS_INTERNAL + 3)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 1262|      0|        goto Error;
 1263|      0|    }
 1264|       |
 1265|  2.34k|    memcpy(ctx->static_iv, iv, ctx->super.algo->iv_size);
 1266|       |
 1267|  2.34k|    return 0;
 1268|       |
 1269|      0|Error:
 1270|      0|    aead_dispose_crypto(&ctx->super);
 1271|      0|    return ret;
 1272|  2.34k|}
openssl.c:aead_dispose_crypto:
 1124|  2.34k|{
 1125|  2.34k|    struct aead_crypto_context_t *ctx = (struct aead_crypto_context_t *)_ctx;
 1126|       |
 1127|  2.34k|    if (ctx->evp_ctx != NULL)
  ------------------
  |  Branch (1127:9): [True: 2.34k, False: 0]
  ------------------
 1128|  2.34k|        EVP_CIPHER_CTX_free(ctx->evp_ctx);
 1129|  2.34k|}

ptls_buffer__release_memory:
  551|   137k|{
  552|   137k|    ptls_clear_memory(buf->base, buf->off);
  553|   137k|    if (buf->is_allocated) {
  ------------------
  |  Branch (553:9): [True: 7.47k, False: 129k]
  ------------------
  554|       |#ifdef _WINDOWS
  555|       |        if (buf->align_bits != 0) {
  556|       |            _aligned_free(buf->base);
  557|       |        } else {
  558|       |            free(buf->base);
  559|       |        }
  560|       |#else
  561|  7.47k|        free(buf->base);
  562|  7.47k|#endif
  563|  7.47k|    }
  564|   137k|}
ptls_buffer_reserve:
  567|  1.10M|{
  568|  1.10M|    return ptls_buffer_reserve_aligned(buf, delta, 0);
  569|  1.10M|}
ptls_buffer_reserve_aligned:
  572|  1.10M|{
  573|  1.10M|    if (buf->base == NULL)
  ------------------
  |  Branch (573:9): [True: 0, False: 1.10M]
  ------------------
  574|      0|        return PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  224|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  575|       |
  576|  1.10M|    if (PTLS_MEMORY_DEBUG || buf->capacity < buf->off + delta ||
  ------------------
  |  |  101|  2.21M|#define PTLS_MEMORY_DEBUG 0
  |  |  ------------------
  |  |  |  Branch (101:27): [Folded - Ignored]
  |  |  ------------------
  ------------------
  |  Branch (576:30): [True: 7.47k, False: 1.10M]
  ------------------
  577|  1.10M|        (buf->align_bits < align_bits && ((uintptr_t)buf->base & (((uintptr_t)1 << align_bits) - 1)) != 0)) {
  ------------------
  |  Branch (577:10): [True: 0, False: 1.10M]
  |  Branch (577:42): [True: 0, False: 0]
  ------------------
  578|  7.47k|        void *newp;
  579|  7.47k|        size_t new_capacity = buf->capacity;
  580|  7.47k|        if (new_capacity < 1024)
  ------------------
  |  Branch (580:13): [True: 6.75k, False: 717]
  ------------------
  581|  6.75k|            new_capacity = 1024;
  582|  8.77k|        while (new_capacity < buf->off + delta) {
  ------------------
  |  Branch (582:16): [True: 1.29k, False: 7.47k]
  ------------------
  583|  1.29k|            new_capacity *= 2;
  584|  1.29k|        }
  585|  7.47k|        if (align_bits != 0) {
  ------------------
  |  Branch (585:13): [True: 0, False: 7.47k]
  ------------------
  586|       |#ifdef _WINDOWS
  587|       |            if ((newp = _aligned_malloc(new_capacity, (size_t)1 << align_bits)) == NULL)
  588|       |                return PTLS_ERROR_NO_MEMORY;
  589|       |#else
  590|      0|            if (posix_memalign(&newp, 1 << align_bits, new_capacity) != 0)
  ------------------
  |  Branch (590:17): [True: 0, False: 0]
  ------------------
  591|      0|                return PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  224|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  592|      0|#endif
  593|  7.47k|        } else {
  594|  7.47k|            if ((newp = malloc(new_capacity)) == NULL)
  ------------------
  |  Branch (594:17): [True: 0, False: 7.47k]
  ------------------
  595|      0|                return PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  224|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  596|  7.47k|        }
  597|  7.47k|        memcpy(newp, buf->base, buf->off);
  598|  7.47k|        ptls_buffer__release_memory(buf);
  599|  7.47k|        buf->base = newp;
  600|  7.47k|        buf->capacity = new_capacity;
  601|  7.47k|        buf->is_allocated = 1;
  602|  7.47k|        buf->align_bits = align_bits;
  603|  7.47k|    }
  604|       |
  605|  1.10M|    return 0;
  606|  1.10M|}
ptls_buffer__do_pushv:
  609|  1.11M|{
  610|  1.11M|    int ret;
  611|       |
  612|  1.11M|    if (len == 0)
  ------------------
  |  Branch (612:9): [True: 32.5k, False: 1.08M]
  ------------------
  613|  32.5k|        return 0;
  614|  1.08M|    if ((ret = ptls_buffer_reserve(buf, len)) != 0)
  ------------------
  |  Branch (614:9): [True: 0, False: 1.08M]
  ------------------
  615|      0|        return ret;
  616|  1.08M|    memcpy(buf->base + buf->off, src, len);
  617|  1.08M|    buf->off += len;
  618|  1.08M|    return 0;
  619|  1.08M|}
ptls_decode8:
  897|  27.2k|{
  898|  27.2k|    if (*src == end)
  ------------------
  |  Branch (898:9): [True: 7, False: 27.2k]
  ------------------
  899|      7|        return PTLS_ALERT_DECODE_ERROR;
  ------------------
  |  |  203|      7|#define PTLS_ALERT_DECODE_ERROR 50
  ------------------
  900|  27.2k|    *value = *(*src)++;
  901|  27.2k|    return 0;
  902|  27.2k|}
ptls_decode16:
  905|  98.0k|{
  906|  98.0k|    if (end - *src < 2)
  ------------------
  |  Branch (906:9): [True: 60, False: 98.0k]
  ------------------
  907|     60|        return PTLS_ALERT_DECODE_ERROR;
  ------------------
  |  |  203|     60|#define PTLS_ALERT_DECODE_ERROR 50
  ------------------
  908|  98.0k|    *value = ntoh16(*src);
  909|  98.0k|    *src += 2;
  910|  98.0k|    return 0;
  911|  98.0k|}
ptls__key_schedule_update_hash:
 1377|  55.6k|{
 1378|  55.6k|    size_t i;
 1379|       |
 1380|  55.6k|    PTLS_DEBUGF("%s:%zu\n", __FUNCTION__, msglen);
 1381|   111k|    for (i = 0; i != sched->num_hashes; ++i) {
  ------------------
  |  Branch (1381:17): [True: 55.6k, False: 55.6k]
  ------------------
 1382|  55.6k|        ptls_hash_context_t *ctx = use_outer ? sched->hashes[i].ctx_outer : sched->hashes[i].ctx;
  ------------------
  |  Branch (1382:36): [True: 0, False: 55.6k]
  ------------------
 1383|  55.6k|        ctx->update(ctx, msg, msglen);
 1384|  55.6k|    }
 1385|  55.6k|}
ptls_find_cipher_suite:
 2489|  27.3k|{
 2490|  27.3k|    ptls_cipher_suite_t **cs;
 2491|  27.3k|    if (cipher_suites == NULL)
  ------------------
  |  Branch (2491:9): [True: 0, False: 27.3k]
  ------------------
 2492|      0|        return NULL;
 2493|  27.3k|    for (cs = cipher_suites; *cs != NULL && (*cs)->id != id; ++cs)
  ------------------
  |  Branch (2493:30): [True: 27.3k, False: 46]
  |  Branch (2493:45): [True: 46, False: 27.2k]
  ------------------
 2494|     46|        ;
 2495|  27.3k|    return *cs;
 2496|  27.3k|}
ptls_client_new:
 4958|  2.27k|{
 4959|  2.27k|    ptls_t *tls = new_instance(ctx, 0);
 4960|  2.27k|    tls->state = PTLS_STATE_CLIENT_HANDSHAKE_START;
 4961|  2.27k|    tls->ctx->random_bytes(tls->client_random, sizeof(tls->client_random));
 4962|  2.27k|    log_client_random(tls);
 4963|  2.27k|    if (tls->send_change_cipher_spec) {
  ------------------
  |  Branch (4963:9): [True: 0, False: 2.27k]
  ------------------
 4964|      0|        tls->client.legacy_session_id =
 4965|      0|            ptls_iovec_init(tls->client.legacy_session_id_buf, sizeof(tls->client.legacy_session_id_buf));
 4966|      0|        tls->ctx->random_bytes(tls->client.legacy_session_id.base, tls->client.legacy_session_id.len);
 4967|      0|    }
 4968|       |
 4969|  2.27k|    PTLS_PROBE(NEW, tls, 0);
 4970|  2.27k|    PTLS_LOG_CONN(new, tls, { PTLS_LOG_ELEMENT_BOOL(is_server, 0); });
  ------------------
  |  | 1262|  2.27k|    do {                                                                                                                           \
  |  | 1263|  2.27k|        ptls_t *_tls = (tls);                                                                                                      \
  |  | 1264|  2.27k|        if (!ptls_log.is_active || ptls_skip_tracing(_tls))                                                                        \
  |  |  ------------------
  |  |  |  Branch (1264:13): [True: 2.27k, False: 0]
  |  |  |  Branch (1264:36): [True: 0, False: 0]
  |  |  ------------------
  |  | 1265|  2.27k|            break;                                                                                                                 \
  |  | 1266|  2.27k|        PTLS_LOG__DO_LOG(picotls, type, {                                                                                          \
  |  |  ------------------
  |  |  |  | 1239|      0|    do {                                                                                                                           \
  |  |  |  | 1240|      0|        int ptlslog_skip = 0;                                                                                                      \
  |  |  |  | 1241|      0|        char smallbuf[128];                                                                                                        \
  |  |  |  | 1242|      0|        ptls_buffer_t ptlslogbuf;                                                                                                  \
  |  |  |  | 1243|      0|        ptls_buffer_init(&ptlslogbuf, smallbuf, sizeof(smallbuf));                                                                 \
  |  |  |  | 1244|      0|        PTLS_LOG__DO_PUSH_SAFESTR("{\"module\":\"" PTLS_TO_STR(module) "\",\"type\":\"" PTLS_TO_STR(type) "\"");                   \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1326|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1327|      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]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1328|      0|            ptlslog_skip = 1;                                                                                                      \
  |  |  |  |  |  | 1329|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1329:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1245|      0|        do {                                                                                                                       \
  |  |  |  | 1246|      0|            block                                                                                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1247|      0|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1247:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1248|      0|        PTLS_LOG__DO_PUSH_SAFESTR("}\n");                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1326|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1327|      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]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1328|      0|            ptlslog_skip = 1;                                                                                                      \
  |  |  |  |  |  | 1329|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1329:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1249|      0|        if (!ptlslog_skip)                                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1249:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1250|      0|            ptls_log__do_write(&ptlslogbuf);                                                                                       \
  |  |  |  | 1251|      0|        ptls_buffer_dispose(&ptlslogbuf);                                                                                          \
  |  |  |  | 1252|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1252:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1267|      0|            PTLS_LOG_ELEMENT_PTR(tls, _tls);                                                                                       \
  |  | 1268|      0|            do {                                                                                                                   \
  |  | 1269|      0|                block                                                                                                              \
  |  | 1270|      0|            } while (0);                                                                                                           \
  |  | 1271|      0|        });                                                                                                                        \
  |  | 1272|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1272:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4971|      0|    return tls;
 4972|  2.27k|}
ptls_free:
 5187|  2.27k|{
 5188|  2.27k|    PTLS_PROBE0(FREE, tls);
 5189|  2.27k|    PTLS_LOG_CONN(free, tls, {});
  ------------------
  |  | 1262|  2.27k|    do {                                                                                                                           \
  |  | 1263|  2.27k|        ptls_t *_tls = (tls);                                                                                                      \
  |  | 1264|  2.27k|        if (!ptls_log.is_active || ptls_skip_tracing(_tls))                                                                        \
  |  |  ------------------
  |  |  |  Branch (1264:13): [True: 2.27k, False: 0]
  |  |  |  Branch (1264:36): [True: 0, False: 0]
  |  |  ------------------
  |  | 1265|  2.27k|            break;                                                                                                                 \
  |  | 1266|  2.27k|        PTLS_LOG__DO_LOG(picotls, type, {                                                                                          \
  |  |  ------------------
  |  |  |  | 1239|      0|    do {                                                                                                                           \
  |  |  |  | 1240|      0|        int ptlslog_skip = 0;                                                                                                      \
  |  |  |  | 1241|      0|        char smallbuf[128];                                                                                                        \
  |  |  |  | 1242|      0|        ptls_buffer_t ptlslogbuf;                                                                                                  \
  |  |  |  | 1243|      0|        ptls_buffer_init(&ptlslogbuf, smallbuf, sizeof(smallbuf));                                                                 \
  |  |  |  | 1244|      0|        PTLS_LOG__DO_PUSH_SAFESTR("{\"module\":\"" PTLS_TO_STR(module) "\",\"type\":\"" PTLS_TO_STR(type) "\"");                   \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1326|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1327|      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]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1328|      0|            ptlslog_skip = 1;                                                                                                      \
  |  |  |  |  |  | 1329|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1329:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1245|      0|        do {                                                                                                                       \
  |  |  |  | 1246|      0|            block                                                                                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1247|      0|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1247:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1248|      0|        PTLS_LOG__DO_PUSH_SAFESTR("}\n");                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1326|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1327|      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]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1328|      0|            ptlslog_skip = 1;                                                                                                      \
  |  |  |  |  |  | 1329|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1329:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1249|      0|        if (!ptlslog_skip)                                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1249:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1250|      0|            ptls_log__do_write(&ptlslogbuf);                                                                                       \
  |  |  |  | 1251|      0|        ptls_buffer_dispose(&ptlslogbuf);                                                                                          \
  |  |  |  | 1252|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1252:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1267|      0|            PTLS_LOG_ELEMENT_PTR(tls, _tls);                                                                                       \
  |  | 1268|      0|            do {                                                                                                                   \
  |  | 1269|      0|                block                                                                                                              \
  |  | 1270|      0|            } while (0);                                                                                                           \
  |  | 1271|      0|        });                                                                                                                        \
  |  | 1272|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1272:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 5190|       |
 5191|      0|    ptls_buffer_dispose(&tls->recvbuf.rec);
 5192|  2.27k|    ptls_buffer_dispose(&tls->recvbuf.mess);
 5193|  2.27k|    free_exporter_master_secret(tls, 1);
 5194|  2.27k|    free_exporter_master_secret(tls, 0);
 5195|  2.27k|    if (tls->key_schedule != NULL)
  ------------------
  |  Branch (5195:9): [True: 2.27k, False: 0]
  ------------------
 5196|  2.27k|        key_schedule_free(tls->key_schedule);
 5197|  2.27k|    if (tls->traffic_protection.dec.aead != NULL)
  ------------------
  |  Branch (5197:9): [True: 1.17k, False: 1.10k]
  ------------------
 5198|  1.17k|        ptls_aead_free(tls->traffic_protection.dec.aead);
 5199|  2.27k|    if (tls->traffic_protection.enc.aead != NULL)
  ------------------
  |  Branch (5199:9): [True: 1.17k, False: 1.10k]
  ------------------
 5200|  1.17k|        ptls_aead_free(tls->traffic_protection.enc.aead);
 5201|  2.27k|    free(tls->server_name);
 5202|  2.27k|    free(tls->negotiated_protocol);
 5203|  2.27k|    clear_ech(&tls->ech, tls->is_server);
 5204|  2.27k|    if (tls->is_server) {
  ------------------
  |  Branch (5204:9): [True: 0, False: 2.27k]
  ------------------
 5205|      0|        if (tls->server.async_job != NULL)
  ------------------
  |  Branch (5205:13): [True: 0, False: 0]
  ------------------
 5206|      0|            tls->server.async_job->destroy_(tls->server.async_job);
 5207|  2.27k|    } else {
 5208|  2.27k|        if (tls->client.key_share_ctx != NULL)
  ------------------
  |  Branch (5208:13): [True: 1.07k, False: 1.20k]
  ------------------
 5209|  1.07k|            tls->client.key_share_ctx->on_exchange(&tls->client.key_share_ctx, 1, NULL, ptls_iovec_init(NULL, 0));
 5210|  2.27k|        if (tls->client.certificate_request.context.base != NULL)
  ------------------
  |  Branch (5210:13): [True: 312, False: 1.96k]
  ------------------
 5211|    312|            free(tls->client.certificate_request.context.base);
 5212|  2.27k|    }
 5213|  2.27k|    if (tls->certificate_verify.cb != NULL)
  ------------------
  |  Branch (5213:9): [True: 0, False: 2.27k]
  ------------------
 5214|      0|        tls->certificate_verify.cb(tls->certificate_verify.verify_ctx, 0, ptls_iovec_init(NULL, 0), ptls_iovec_init(NULL, 0));
 5215|  2.27k|    if (tls->pending_handshake_secret != NULL) {
  ------------------
  |  Branch (5215:9): [True: 0, False: 2.27k]
  ------------------
 5216|      0|        ptls_clear_memory(tls->pending_handshake_secret, PTLS_MAX_DIGEST_SIZE);
  ------------------
  |  |  108|      0|#define PTLS_MAX_DIGEST_SIZE 64
  ------------------
 5217|      0|        free(tls->pending_handshake_secret);
 5218|      0|    }
 5219|  2.27k|    update_open_count(tls->ctx, -1);
 5220|  2.27k|    ptls_clear_memory(tls, sizeof(*tls));
 5221|  2.27k|    free(tls);
 5222|  2.27k|}
ptls_set_negotiated_protocol:
 5296|     29|{
 5297|     29|    char *duped = NULL;
 5298|       |
 5299|     29|    if (protocol != NULL && (duped = duplicate_as_str(protocol, protocol_len != 0 ? protocol_len : strlen(protocol))) == NULL)
  ------------------
  |  Branch (5299:9): [True: 29, False: 0]
  |  Branch (5299:29): [True: 0, False: 29]
  |  Branch (5299:65): [True: 29, False: 0]
  ------------------
 5300|      0|        return PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  224|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 5301|       |
 5302|     29|    free(tls->negotiated_protocol);
 5303|     29|    tls->negotiated_protocol = duped;
 5304|       |
 5305|     29|    return 0;
 5306|     29|}
ptls_handshake:
 5751|  4.55k|{
 5752|  4.55k|    struct st_ptls_record_message_emitter_t emitter;
 5753|  4.55k|    int ret;
 5754|       |
 5755|  4.55k|    assert(tls->state < PTLS_STATE_POST_HANDSHAKE_MIN);
 5756|       |
 5757|      0|    init_record_message_emitter(tls, &emitter, _sendbuf);
 5758|  4.55k|    size_t sendbuf_orig_off = emitter.super.buf->off;
 5759|       |
 5760|       |    /* special handlings */
 5761|  4.55k|    switch (tls->state) {
 5762|  2.27k|    case PTLS_STATE_CLIENT_HANDSHAKE_START: {
  ------------------
  |  Branch (5762:5): [True: 2.27k, False: 2.27k]
  ------------------
 5763|  2.27k|        assert(input == NULL || *inlen == 0);
 5764|      0|        assert(tls->ctx->key_exchanges[0] != NULL);
 5765|      0|        return send_client_hello(tls, &emitter.super, properties, NULL);
 5766|      0|    }
 5767|      0|    case PTLS_STATE_SERVER_GENERATING_CERTIFICATE_VERIFY:
  ------------------
  |  Branch (5767:5): [True: 0, False: 4.55k]
  ------------------
 5768|      0|        return server_finish_handshake(tls, &emitter.super, 1, NULL);
 5769|  2.27k|    default:
  ------------------
  |  Branch (5769:5): [True: 2.27k, False: 2.27k]
  ------------------
 5770|  2.27k|        break;
 5771|  4.55k|    }
 5772|       |
 5773|  2.27k|    const uint8_t *src = input, *const src_end = src + *inlen;
 5774|  2.27k|    ptls_buffer_t decryptbuf;
 5775|       |
 5776|  2.27k|    ptls_buffer_init(&decryptbuf, "", 0);
 5777|       |
 5778|       |    /* perform handhake until completion or until all the input has been swallowed */
 5779|  2.27k|    ret = PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  225|  2.27k|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  177|  2.27k|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 5780|  54.0k|    while (ret == PTLS_ERROR_IN_PROGRESS && src != src_end) {
  ------------------
  |  |  225|   108k|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  177|  54.0k|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  |  Branch (5780:12): [True: 52.1k, False: 1.94k]
  |  Branch (5780:45): [True: 51.8k, False: 331]
  ------------------
 5781|  51.8k|        size_t consumed = src_end - src;
 5782|  51.8k|        ret = handle_input(tls, &emitter.super, &decryptbuf, src, &consumed, properties);
 5783|  51.8k|        src += consumed;
 5784|  51.8k|        assert(decryptbuf.off == 0);
 5785|  51.8k|    }
 5786|       |
 5787|  2.27k|    ptls_buffer_dispose(&decryptbuf);
 5788|       |
 5789|  2.27k|    switch (ret) {
 5790|      0|    case 0:
  ------------------
  |  Branch (5790:5): [True: 0, False: 2.27k]
  ------------------
 5791|    331|    case PTLS_ERROR_IN_PROGRESS:
  ------------------
  |  |  225|    331|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  177|    331|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  |  Branch (5791:5): [True: 331, False: 1.94k]
  ------------------
 5792|    331|    case PTLS_ERROR_STATELESS_RETRY:
  ------------------
  |  |  229|    331|#define PTLS_ERROR_STATELESS_RETRY (PTLS_ERROR_CLASS_INTERNAL + 6)
  |  |  ------------------
  |  |  |  |  177|    331|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  |  Branch (5792:5): [True: 0, False: 2.27k]
  ------------------
 5793|    331|    case PTLS_ERROR_ASYNC_OPERATION:
  ------------------
  |  |  234|    331|#define PTLS_ERROR_ASYNC_OPERATION (PTLS_ERROR_CLASS_INTERNAL + 11)
  |  |  ------------------
  |  |  |  |  177|    331|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  |  Branch (5793:5): [True: 0, False: 2.27k]
  ------------------
 5794|    331|        break;
 5795|  1.94k|    default:
  ------------------
  |  Branch (5795:5): [True: 1.94k, False: 331]
  ------------------
 5796|       |        /* Flush handshake messages that have been written partially. ECH_REQUIRED sticks out because it is a message sent
 5797|       |         * post-handshake compared to other alerts that are generating *during* the handshake. */
 5798|  1.94k|        if (ret != PTLS_ALERT_ECH_REQUIRED) {
  ------------------
  |  |  213|  1.94k|#define PTLS_ALERT_ECH_REQUIRED 121
  ------------------
  |  Branch (5798:13): [True: 1.94k, False: 0]
  ------------------
 5799|  1.94k|            ptls_clear_memory(emitter.super.buf->base + sendbuf_orig_off, emitter.super.buf->off - sendbuf_orig_off);
 5800|  1.94k|            emitter.super.buf->off = sendbuf_orig_off;
 5801|  1.94k|        }
 5802|       |        /* send alert immediately */
 5803|  1.94k|        if (PTLS_ERROR_GET_CLASS(ret) != PTLS_ERROR_CLASS_PEER_ALERT)
  ------------------
  |  |  179|  1.94k|#define PTLS_ERROR_GET_CLASS(e) ((e) & ~0xff)
  ------------------
                      if (PTLS_ERROR_GET_CLASS(ret) != PTLS_ERROR_CLASS_PEER_ALERT)
  ------------------
  |  |  176|  1.94k|#define PTLS_ERROR_CLASS_PEER_ALERT 0x100
  ------------------
  |  Branch (5803:13): [True: 1.93k, False: 13]
  ------------------
 5804|  1.93k|            if (ptls_send_alert(tls, emitter.super.buf, PTLS_ALERT_LEVEL_FATAL,
  ------------------
  |  |  189|  1.93k|#define PTLS_ALERT_LEVEL_FATAL 2
  ------------------
  |  Branch (5804:17): [True: 0, False: 1.93k]
  ------------------
 5805|  1.93k|                                PTLS_ERROR_GET_CLASS(ret) == PTLS_ERROR_CLASS_SELF_ALERT ? ret : PTLS_ALERT_INTERNAL_ERROR) != 0)
  ------------------
  |  |  179|  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)
  ------------------
  |  |  175|  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)
  ------------------
  |  |  206|  1.93k|#define PTLS_ALERT_INTERNAL_ERROR 80
  ------------------
  |  Branch (5805:33): [True: 1.93k, False: 0]
  ------------------
 5806|      0|                emitter.super.buf->off = sendbuf_orig_off;
 5807|  1.94k|        break;
 5808|  2.27k|    }
 5809|       |
 5810|  2.27k|    *inlen -= src_end - src;
 5811|  2.27k|    return ret;
 5812|  2.27k|}
ptls_send_alert:
 5915|  1.93k|{
 5916|  1.93k|    size_t rec_start = sendbuf->off;
 5917|  1.93k|    int ret = 0;
 5918|       |
 5919|  1.93k|    buffer_push_record(sendbuf, PTLS_CONTENT_TYPE_ALERT, { ptls_buffer_push(sendbuf, level, description); });
  ------------------
  |  |  742|  1.93k|    do {                                                                                                                           \
  |  |  743|  1.93k|        ptls_buffer_push((buf), (type), PTLS_RECORD_VERSION_MAJOR, PTLS_RECORD_VERSION_MINOR);                                     \
  |  |  ------------------
  |  |  |  | 1078|  1.93k|    do {                                                                                                                           \
  |  |  |  | 1079|  1.93k|        if ((ret = ptls_buffer__do_pushv((buf), (uint8_t[]){__VA_ARGS__}, sizeof((uint8_t[]){__VA_ARGS__}))) != 0)                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1079:13): [True: 0, False: 1.93k]
  |  |  |  |  ------------------
  |  |  |  | 1080|  1.93k|            goto Exit;                                                                                                             \
  |  |  |  | 1081|  1.93k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1081:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  744|  1.93k|        ptls_buffer_push_block((buf), 2, block);                                                                                   \
  |  |  ------------------
  |  |  |  | 1117|  1.93k|    do {                                                                                                                           \
  |  |  |  | 1118|  1.93k|        size_t capacity = (_capacity);                                                                                             \
  |  |  |  | 1119|  1.93k|        ptls_buffer_pushv((buf), (uint8_t *)"\0\0\0\0\0\0\0", capacity != -1 ? capacity : 1);                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1072|  1.93k|    do {                                                                                                                           \
  |  |  |  |  |  | 1073|  3.87k|        if ((ret = ptls_buffer__do_pushv((buf), (src), (len))) != 0)                                                               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1073:13): [True: 0, False: 1.93k]
  |  |  |  |  |  |  |  Branch (1073:57): [True: 1.93k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1074|  1.93k|            goto Exit;                                                                                                             \
  |  |  |  |  |  | 1075|  1.93k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1075:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1120|  1.93k|        size_t body_start = (buf)->off;                                                                                            \
  |  |  |  | 1121|  1.93k|        do {                                                                                                                       \
  |  |  |  | 1122|  5.80k|            block                                                                                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 1.93k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|  1.93k|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1123:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1124|  1.93k|        size_t body_size = (buf)->off - body_start;                                                                                \
  |  |  |  | 1125|  1.93k|        if (capacity != -1) {                                                                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1125:13): [True: 1.93k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1126|  5.80k|            for (; capacity != 0; --capacity)                                                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:20): [True: 3.87k, False: 1.93k]
  |  |  |  |  ------------------
  |  |  |  | 1127|  3.87k|                (buf)->base[body_start - capacity] = (uint8_t)(body_size >> (8 * (capacity - 1)));                                 \
  |  |  |  | 1128|  1.93k|        } else {                                                                                                                   \
  |  |  |  | 1129|      0|            if ((ret = ptls_buffer__adjust_quic_blocksize((buf), body_size)) != 0)                                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1129:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1130|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1131|      0|        }                                                                                                                          \
  |  |  |  | 1132|  1.93k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1132:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  745|  1.93k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (745:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 5920|       |    /* encrypt the alert if we have the encryption keys, unless when it is the early data key */
 5921|  1.93k|    if (tls->traffic_protection.enc.aead != NULL && !(tls->state <= PTLS_STATE_CLIENT_EXPECT_FINISHED)) {
  ------------------
  |  Branch (5921:9): [True: 1.08k, False: 855]
  |  Branch (5921:53): [True: 0, False: 1.08k]
  ------------------
 5922|      0|        if ((ret = buffer_encrypt_record(sendbuf, rec_start, &tls->traffic_protection.enc)) != 0)
  ------------------
  |  Branch (5922:13): [True: 0, False: 0]
  ------------------
 5923|      0|            goto Exit;
 5924|      0|    }
 5925|       |
 5926|  1.93k|Exit:
 5927|  1.93k|    return ret;
 5928|  1.93k|}
ptls_hmac_create:
 6032|  11.6k|{
 6033|  11.6k|    struct st_picotls_hmac_context_t *ctx;
 6034|       |
 6035|  11.6k|    assert(key_size <= algo->block_size);
 6036|       |
 6037|  11.6k|    if ((ctx = malloc(offsetof(struct st_picotls_hmac_context_t, key) + algo->block_size)) == NULL)
  ------------------
  |  Branch (6037:9): [True: 0, False: 11.6k]
  ------------------
 6038|      0|        return NULL;
 6039|       |
 6040|  11.6k|    *ctx = (struct st_picotls_hmac_context_t){{hmac_update, hmac_final}, algo};
 6041|  11.6k|    if ((ctx->hash = algo->create()) == NULL) {
  ------------------
  |  Branch (6041:9): [True: 0, False: 11.6k]
  ------------------
 6042|      0|        free(ctx);
 6043|      0|        return NULL;
 6044|      0|    }
 6045|  11.6k|    memset(ctx->key, 0, algo->block_size);
 6046|  11.6k|    memcpy(ctx->key, key, key_size);
 6047|       |
 6048|  11.6k|    hmac_apply_key(ctx, 0x36);
 6049|       |
 6050|  11.6k|    return &ctx->super;
 6051|  11.6k|}
ptls_hkdf_extract:
 6054|  3.45k|{
 6055|  3.45k|    ptls_hash_context_t *hash;
 6056|       |
 6057|  3.45k|    if (salt.len == 0)
  ------------------
  |  Branch (6057:9): [True: 0, False: 3.45k]
  ------------------
 6058|      0|        salt = ptls_iovec_init(zeroes_of_max_digest_size, algo->digest_size);
 6059|       |
 6060|  3.45k|    if ((hash = ptls_hmac_create(algo, salt.base, salt.len)) == NULL)
  ------------------
  |  Branch (6060:9): [True: 0, False: 3.45k]
  ------------------
 6061|      0|        return PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  224|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 6062|  3.45k|    hash->update(hash, ikm.base, ikm.len);
 6063|  3.45k|    hash->final(hash, output, PTLS_HASH_FINAL_MODE_FREE);
 6064|  3.45k|    return 0;
 6065|  3.45k|}
ptls_hkdf_expand:
 6068|  8.20k|{
 6069|  8.20k|    ptls_hash_context_t *hmac = NULL;
 6070|  8.20k|    size_t i;
 6071|  8.20k|    uint8_t digest[PTLS_MAX_DIGEST_SIZE];
 6072|       |
 6073|  16.4k|    for (i = 0; (i * algo->digest_size) < outlen; ++i) {
  ------------------
  |  Branch (6073:17): [True: 8.20k, False: 8.20k]
  ------------------
 6074|  8.20k|        if (hmac == NULL) {
  ------------------
  |  Branch (6074:13): [True: 8.20k, False: 0]
  ------------------
 6075|  8.20k|            if ((hmac = ptls_hmac_create(algo, prk.base, prk.len)) == NULL)
  ------------------
  |  Branch (6075:17): [True: 0, False: 8.20k]
  ------------------
 6076|      0|                return PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  224|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 6077|  8.20k|        } else {
 6078|      0|            hmac->update(hmac, digest, algo->digest_size);
 6079|      0|        }
 6080|  8.20k|        hmac->update(hmac, info.base, info.len);
 6081|  8.20k|        uint8_t gen = (uint8_t)(i + 1);
 6082|  8.20k|        hmac->update(hmac, &gen, 1);
 6083|  8.20k|        hmac->final(hmac, digest, 1);
 6084|       |
 6085|  8.20k|        size_t off_start = i * algo->digest_size, off_end = off_start + algo->digest_size;
 6086|  8.20k|        if (off_end > outlen)
  ------------------
  |  Branch (6086:13): [True: 4.68k, False: 3.52k]
  ------------------
 6087|  4.68k|            off_end = outlen;
 6088|  8.20k|        memcpy((uint8_t *)output + off_start, digest, off_end - off_start);
 6089|  8.20k|    }
 6090|       |
 6091|  8.20k|    if (hmac != NULL)
  ------------------
  |  Branch (6091:9): [True: 8.20k, False: 0]
  ------------------
 6092|  8.20k|        hmac->final(hmac, NULL, PTLS_HASH_FINAL_MODE_FREE);
 6093|       |
 6094|  8.20k|    ptls_clear_memory(digest, algo->digest_size);
 6095|       |
 6096|  8.20k|    return 0;
 6097|  8.20k|}
ptls_hkdf_expand_label:
 6101|  8.20k|{
 6102|  8.20k|    ptls_buffer_t hkdf_label;
 6103|  8.20k|    uint8_t hkdf_label_buf[80];
 6104|  8.20k|    int ret;
 6105|       |
 6106|  8.20k|    ptls_buffer_init(&hkdf_label, hkdf_label_buf, sizeof(hkdf_label_buf));
 6107|       |
 6108|  8.20k|    ptls_buffer_push16(&hkdf_label, (uint16_t)outlen);
  ------------------
  |  | 1084|  8.20k|    do {                                                                                                                           \
  |  | 1085|  8.20k|        uint16_t _v = (v);                                                                                                         \
  |  | 1086|  8.20k|        ptls_buffer_push(buf, (uint8_t)(_v >> 8), (uint8_t)_v);                                                                    \
  |  |  ------------------
  |  |  |  | 1078|  8.20k|    do {                                                                                                                           \
  |  |  |  | 1079|  8.20k|        if ((ret = ptls_buffer__do_pushv((buf), (uint8_t[]){__VA_ARGS__}, sizeof((uint8_t[]){__VA_ARGS__}))) != 0)                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1079:13): [True: 0, False: 8.20k]
  |  |  |  |  ------------------
  |  |  |  | 1080|  8.20k|            goto Exit;                                                                                                             \
  |  |  |  | 1081|  8.20k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1081:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1087|  8.20k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1087:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 6109|  8.20k|    ptls_buffer_push_block(&hkdf_label, 1, {
  ------------------
  |  | 1117|  8.20k|    do {                                                                                                                           \
  |  | 1118|  8.20k|        size_t capacity = (_capacity);                                                                                             \
  |  | 1119|  8.20k|        ptls_buffer_pushv((buf), (uint8_t *)"\0\0\0\0\0\0\0", capacity != -1 ? capacity : 1);                                      \
  |  |  ------------------
  |  |  |  | 1072|  8.20k|    do {                                                                                                                           \
  |  |  |  | 1073|  16.4k|        if ((ret = ptls_buffer__do_pushv((buf), (src), (len))) != 0)                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1073:13): [True: 0, False: 8.20k]
  |  |  |  |  |  Branch (1073:57): [True: 8.20k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1074|  8.20k|            goto Exit;                                                                                                             \
  |  |  |  | 1075|  8.20k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1075:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1120|  8.20k|        size_t body_start = (buf)->off;                                                                                            \
  |  | 1121|  8.20k|        do {                                                                                                                       \
  |  | 1122|  65.6k|            block                                                                                                                  \
  |  |  ------------------
  |  |  |  Branch (1122:13): [True: 8.20k, False: 0]
  |  |  |  Branch (1122:13): [True: 0, False: 8.20k]
  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  Branch (1122:13): [True: 0, False: 8.20k]
  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  ------------------
  |  | 1123|  8.20k|        } while (0);                                                                                                               \
  |  |  ------------------
  |  |  |  Branch (1123:18): [Folded - Ignored]
  |  |  ------------------
  |  | 1124|  8.20k|        size_t body_size = (buf)->off - body_start;                                                                                \
  |  | 1125|  8.20k|        if (capacity != -1) {                                                                                                      \
  |  |  ------------------
  |  |  |  Branch (1125:13): [True: 8.20k, False: 0]
  |  |  ------------------
  |  | 1126|  16.4k|            for (; capacity != 0; --capacity)                                                                                      \
  |  |  ------------------
  |  |  |  Branch (1126:20): [True: 8.20k, False: 8.20k]
  |  |  ------------------
  |  | 1127|  8.20k|                (buf)->base[body_start - capacity] = (uint8_t)(body_size >> (8 * (capacity - 1)));                                 \
  |  | 1128|  8.20k|        } else {                                                                                                                   \
  |  | 1129|      0|            if ((ret = ptls_buffer__adjust_quic_blocksize((buf), body_size)) != 0)                                                 \
  |  |  ------------------
  |  |  |  Branch (1129:17): [True: 0, False: 0]
  |  |  ------------------
  |  | 1130|      0|                goto Exit;                                                                                                         \
  |  | 1131|      0|        }                                                                                                                          \
  |  | 1132|  8.20k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1132:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 6110|  8.20k|        if (label_prefix == NULL)
 6111|  8.20k|            label_prefix = PTLS_HKDF_EXPAND_LABEL_PREFIX;
 6112|  8.20k|        ptls_buffer_pushv(&hkdf_label, label_prefix, strlen(label_prefix));
 6113|  8.20k|        ptls_buffer_pushv(&hkdf_label, label, strlen(label));
 6114|  8.20k|    });
 6115|  8.20k|    ptls_buffer_push_block(&hkdf_label, 1, { ptls_buffer_pushv(&hkdf_label, hash_value.base, hash_value.len); });
  ------------------
  |  | 1117|  8.20k|    do {                                                                                                                           \
  |  | 1118|  8.20k|        size_t capacity = (_capacity);                                                                                             \
  |  | 1119|  8.20k|        ptls_buffer_pushv((buf), (uint8_t *)"\0\0\0\0\0\0\0", capacity != -1 ? capacity : 1);                                      \
  |  |  ------------------
  |  |  |  | 1072|  8.20k|    do {                                                                                                                           \
  |  |  |  | 1073|  16.4k|        if ((ret = ptls_buffer__do_pushv((buf), (src), (len))) != 0)                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1073:13): [True: 0, False: 8.20k]
  |  |  |  |  |  Branch (1073:57): [True: 8.20k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1074|  8.20k|            goto Exit;                                                                                                             \
  |  |  |  | 1075|  8.20k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1075:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1120|  8.20k|        size_t body_start = (buf)->off;                                                                                            \
  |  | 1121|  8.20k|        do {                                                                                                                       \
  |  | 1122|  24.6k|            block                                                                                                                  \
  |  |  ------------------
  |  |  |  Branch (1122:13): [True: 0, False: 8.20k]
  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  ------------------
  |  | 1123|  8.20k|        } while (0);                                                                                                               \
  |  |  ------------------
  |  |  |  Branch (1123:18): [Folded - Ignored]
  |  |  ------------------
  |  | 1124|  8.20k|        size_t body_size = (buf)->off - body_start;                                                                                \
  |  | 1125|  8.20k|        if (capacity != -1) {                                                                                                      \
  |  |  ------------------
  |  |  |  Branch (1125:13): [True: 8.20k, False: 0]
  |  |  ------------------
  |  | 1126|  16.4k|            for (; capacity != 0; --capacity)                                                                                      \
  |  |  ------------------
  |  |  |  Branch (1126:20): [True: 8.20k, False: 8.20k]
  |  |  ------------------
  |  | 1127|  8.20k|                (buf)->base[body_start - capacity] = (uint8_t)(body_size >> (8 * (capacity - 1)));                                 \
  |  | 1128|  8.20k|        } else {                                                                                                                   \
  |  | 1129|      0|            if ((ret = ptls_buffer__adjust_quic_blocksize((buf), body_size)) != 0)                                                 \
  |  |  ------------------
  |  |  |  Branch (1129:17): [True: 0, False: 0]
  |  |  ------------------
  |  | 1130|      0|                goto Exit;                                                                                                         \
  |  | 1131|      0|        }                                                                                                                          \
  |  | 1132|  8.20k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1132:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 6116|       |
 6117|  8.20k|    ret = ptls_hkdf_expand(algo, output, outlen, secret, ptls_iovec_init(hkdf_label.base, hkdf_label.off));
 6118|       |
 6119|  8.20k|Exit:
 6120|  8.20k|    ptls_buffer_dispose(&hkdf_label);
 6121|  8.20k|    return ret;
 6122|  8.20k|}
ptls_aead_new:
 6206|  2.34k|{
 6207|  2.34k|    return new_aead(aead, hash, is_enc, secret, ptls_iovec_init(NULL, 0), label_prefix);
 6208|  2.34k|}
ptls_aead_new_direct:
 6211|  2.34k|{
 6212|  2.34k|    ptls_aead_context_t *ctx;
 6213|       |
 6214|  2.34k|    if ((ctx = (ptls_aead_context_t *)malloc(aead->context_size)) == NULL)
  ------------------
  |  Branch (6214:9): [True: 0, False: 2.34k]
  ------------------
 6215|      0|        return NULL;
 6216|       |
 6217|  2.34k|    *ctx = (ptls_aead_context_t){aead};
 6218|       |
 6219|  2.34k|    if (aead->setup_crypto(ctx, is_enc, key, iv) != 0) {
  ------------------
  |  Branch (6219:9): [True: 0, False: 2.34k]
  ------------------
 6220|      0|        free(ctx);
 6221|      0|        return NULL;
 6222|      0|    }
 6223|       |
 6224|  2.34k|    return ctx;
 6225|  2.34k|}
ptls_aead_free:
 6228|  2.34k|{
 6229|  2.34k|    ctx->dispose_crypto(ctx);
 6230|  2.34k|    free(ctx);
 6231|  2.34k|}
ptls_is_server:
 6294|  2.34k|{
 6295|  2.34k|    return tls->is_server;
 6296|  2.34k|}
picotls.c:ntoh16:
  506|   201k|{
  507|   201k|    return (uint16_t)src[0] << 8 | src[1];
  508|   201k|}
picotls.c:new_instance:
 4941|  2.27k|{
 4942|  2.27k|    ptls_t *tls;
 4943|       |
 4944|  2.27k|    assert(ctx->get_time != NULL && "please set ctx->get_time to `&ptls_get_time`; see #92");
 4945|       |
 4946|  2.27k|    if ((tls = malloc(sizeof(*tls))) == NULL)
  ------------------
  |  Branch (4946:9): [True: 0, False: 2.27k]
  ------------------
 4947|      0|        return NULL;
 4948|       |
 4949|  2.27k|    update_open_count(ctx, 1);
 4950|  2.27k|    *tls = (ptls_t){ctx};
 4951|  2.27k|    tls->is_server = is_server;
 4952|  2.27k|    tls->send_change_cipher_spec = ctx->send_change_cipher_spec;
 4953|  2.27k|    tls->skip_tracing = ptls_default_skip_tracing;
  ------------------
  |  | 1747|  2.27k|#define ptls_default_skip_tracing 0
  ------------------
 4954|  2.27k|    return tls;
 4955|  2.27k|}
picotls.c:log_client_random:
 1670|  2.27k|{
 1671|  2.27k|    char buf[sizeof(tls->client_random) * 2 + 1];
 1672|       |
 1673|  2.27k|    PTLS_PROBE(CLIENT_RANDOM, tls, ptls_hexdump(buf, tls->client_random, sizeof(tls->client_random)));
 1674|  2.27k|    PTLS_LOG_CONN(client_random, tls, { PTLS_LOG_ELEMENT_HEXDUMP(bytes, tls->client_random, sizeof(tls->client_random)); });
  ------------------
  |  | 1262|  2.27k|    do {                                                                                                                           \
  |  | 1263|  2.27k|        ptls_t *_tls = (tls);                                                                                                      \
  |  | 1264|  2.27k|        if (!ptls_log.is_active || ptls_skip_tracing(_tls))                                                                        \
  |  |  ------------------
  |  |  |  Branch (1264:13): [True: 2.27k, False: 0]
  |  |  |  Branch (1264:36): [True: 0, False: 0]
  |  |  ------------------
  |  | 1265|  2.27k|            break;                                                                                                                 \
  |  | 1266|  2.27k|        PTLS_LOG__DO_LOG(picotls, type, {                                                                                          \
  |  |  ------------------
  |  |  |  | 1239|      0|    do {                                                                                                                           \
  |  |  |  | 1240|      0|        int ptlslog_skip = 0;                                                                                                      \
  |  |  |  | 1241|      0|        char smallbuf[128];                                                                                                        \
  |  |  |  | 1242|      0|        ptls_buffer_t ptlslogbuf;                                                                                                  \
  |  |  |  | 1243|      0|        ptls_buffer_init(&ptlslogbuf, smallbuf, sizeof(smallbuf));                                                                 \
  |  |  |  | 1244|      0|        PTLS_LOG__DO_PUSH_SAFESTR("{\"module\":\"" PTLS_TO_STR(module) "\",\"type\":\"" PTLS_TO_STR(type) "\"");                   \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1326|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1327|      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]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1328|      0|            ptlslog_skip = 1;                                                                                                      \
  |  |  |  |  |  | 1329|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1329:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1245|      0|        do {                                                                                                                       \
  |  |  |  | 1246|      0|            block                                                                                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1247|      0|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1247:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1248|      0|        PTLS_LOG__DO_PUSH_SAFESTR("}\n");                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1326|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1327|      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]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1328|      0|            ptlslog_skip = 1;                                                                                                      \
  |  |  |  |  |  | 1329|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1329:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1249|      0|        if (!ptlslog_skip)                                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1249:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1250|      0|            ptls_log__do_write(&ptlslogbuf);                                                                                       \
  |  |  |  | 1251|      0|        ptls_buffer_dispose(&ptlslogbuf);                                                                                          \
  |  |  |  | 1252|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1252:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1267|      0|            PTLS_LOG_ELEMENT_PTR(tls, _tls);                                                                                       \
  |  | 1268|      0|            do {                                                                                                                   \
  |  | 1269|      0|                block                                                                                                              \
  |  | 1270|      0|            } while (0);                                                                                                           \
  |  | 1271|      0|        });                                                                                                                        \
  |  | 1272|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1272:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1675|  2.27k|}
picotls.c:free_exporter_master_secret:
 1462|  4.55k|{
 1463|  4.55k|    uint8_t *slot = is_early ? tls->exporter_master_secret.early : tls->exporter_master_secret.one_rtt;
  ------------------
  |  Branch (1463:21): [True: 2.27k, False: 2.27k]
  ------------------
 1464|  4.55k|    if (slot == NULL)
  ------------------
  |  Branch (1464:9): [True: 4.55k, False: 0]
  ------------------
 1465|  4.55k|        return;
 1466|      0|    assert(tls->key_schedule != NULL);
 1467|      0|    ptls_clear_memory(slot, tls->key_schedule->hashes[0].algo->digest_size);
 1468|      0|    free(slot);
 1469|      0|}
picotls.c:key_schedule_free:
 1239|  2.27k|{
 1240|  2.27k|    size_t i;
 1241|  2.27k|    ptls_clear_memory(sched->secret, sizeof(sched->secret));
 1242|  4.55k|    for (i = 0; i != sched->num_hashes; ++i) {
  ------------------
  |  Branch (1242:17): [True: 2.27k, False: 2.27k]
  ------------------
 1243|  2.27k|        sched->hashes[i].ctx->final(sched->hashes[i].ctx, NULL, PTLS_HASH_FINAL_MODE_FREE);
 1244|  2.27k|        if (sched->hashes[i].ctx_outer != NULL)
  ------------------
  |  Branch (1244:13): [True: 0, False: 2.27k]
  ------------------
 1245|      0|            sched->hashes[i].ctx_outer->final(sched->hashes[i].ctx_outer, NULL, PTLS_HASH_FINAL_MODE_FREE);
 1246|  2.27k|    }
 1247|  2.27k|    free(sched);
 1248|  2.27k|}
picotls.c:clear_ech:
  975|  3.45k|{
  976|  3.45k|    if (ech->aead != NULL) {
  ------------------
  |  Branch (976:9): [True: 0, False: 3.45k]
  ------------------
  977|      0|        ptls_aead_free(ech->aead);
  978|      0|        ech->aead = NULL;
  979|      0|    }
  980|  3.45k|    ptls_clear_memory(ech->inner_client_random, PTLS_HELLO_RANDOM_SIZE);
  ------------------
  |  |   74|  3.45k|#define PTLS_HELLO_RANDOM_SIZE 32
  ------------------
  981|  3.45k|    if (!is_server) {
  ------------------
  |  Branch (981:9): [True: 3.45k, False: 0]
  ------------------
  982|  3.45k|        free(ech->client.enc.base);
  983|  3.45k|        ech->client.enc = ptls_iovec_init(NULL, 0);
  984|  3.45k|        if (ech->client.public_name != NULL) {
  ------------------
  |  Branch (984:13): [True: 0, False: 3.45k]
  ------------------
  985|      0|            free(ech->client.public_name);
  986|      0|            ech->client.public_name = NULL;
  987|      0|        }
  988|  3.45k|        free(ech->client.first_ech.base);
  989|  3.45k|        ech->client.first_ech = ptls_iovec_init(NULL, 0);
  990|  3.45k|    }
  991|  3.45k|}
picotls.c:update_open_count:
 4935|  4.55k|{
 4936|  4.55k|    if (ctx->update_open_count != NULL)
  ------------------
  |  Branch (4936:9): [True: 0, False: 4.55k]
  ------------------
 4937|      0|        ctx->update_open_count->cb(ctx->update_open_count, delta);
 4938|  4.55k|}
picotls.c:get_traffic_keys:
 1605|  2.34k|{
 1606|  2.34k|    int ret;
 1607|       |
 1608|  2.34k|    if ((ret = get_traffic_key(hash, key, aead->key_size, 0, secret, hash_value, label_prefix)) != 0 ||
  ------------------
  |  Branch (1608:9): [True: 0, False: 2.34k]
  ------------------
 1609|  2.34k|        (ret = get_traffic_key(hash, iv, aead->iv_size, 1, secret, hash_value, label_prefix)) != 0) {
  ------------------
  |  Branch (1609:9): [True: 0, False: 2.34k]
  ------------------
 1610|      0|        ptls_clear_memory(key, aead->key_size);
 1611|      0|        ptls_clear_memory(iv, aead->iv_size);
 1612|      0|    }
 1613|       |
 1614|  2.34k|    return ret;
 1615|  2.34k|}
picotls.c:get_traffic_key:
 1598|  4.68k|{
 1599|  4.68k|    return ptls_hkdf_expand_label(algo, key, key_size, ptls_iovec_init(secret, algo->digest_size), is_iv ? "iv" : "key", hash_value,
  ------------------
  |  Branch (1599:100): [True: 2.34k, False: 2.34k]
  ------------------
 1600|  4.68k|                                  label_prefix);
 1601|  4.68k|}
picotls.c:duplicate_as_str:
  540|     29|{
  541|     29|    char *dst;
  542|       |
  543|     29|    if ((dst = malloc(len + 1)) == NULL)
  ------------------
  |  Branch (543:9): [True: 0, False: 29]
  ------------------
  544|      0|        return NULL;
  545|     29|    memcpy(dst, src, len);
  546|     29|    dst[len] = '\0';
  547|     29|    return dst;
  548|     29|}
picotls.c:init_record_message_emitter:
 5745|  4.55k|{
 5746|  4.55k|    *emitter = (struct st_ptls_record_message_emitter_t){
 5747|  4.55k|        {sendbuf, &tls->traffic_protection.enc, 5, begin_record_message, commit_record_message}};
 5748|  4.55k|}
picotls.c:begin_record_message:
  838|  27.8k|{
  839|  27.8k|    struct st_ptls_record_message_emitter_t *self = (void *)_self;
  840|  27.8k|    int ret;
  841|       |
  842|  27.8k|    self->rec_start = self->super.buf->off;
  843|  27.8k|    ptls_buffer_push(self->super.buf, PTLS_CONTENT_TYPE_HANDSHAKE, PTLS_RECORD_VERSION_MAJOR, PTLS_RECORD_VERSION_MINOR, 0, 0);
  ------------------
  |  | 1078|  27.8k|    do {                                                                                                                           \
  |  | 1079|  27.8k|        if ((ret = ptls_buffer__do_pushv((buf), (uint8_t[]){__VA_ARGS__}, sizeof((uint8_t[]){__VA_ARGS__}))) != 0)                 \
  |  |  ------------------
  |  |  |  Branch (1079:13): [True: 0, False: 27.8k]
  |  |  ------------------
  |  | 1080|  27.8k|            goto Exit;                                                                                                             \
  |  | 1081|  27.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1081:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  844|  27.8k|    ret = 0;
  845|  27.8k|Exit:
  846|  27.8k|    return ret;
  847|  27.8k|}
picotls.c:commit_record_message:
  850|  27.8k|{
  851|  27.8k|    struct st_ptls_record_message_emitter_t *self = (void *)_self;
  852|  27.8k|    int ret;
  853|       |
  854|  27.8k|    if (self->super.enc->aead != NULL) {
  ------------------
  |  Branch (854:9): [True: 0, False: 27.8k]
  ------------------
  855|      0|        ret = buffer_encrypt_record(self->super.buf, self->rec_start, self->super.enc);
  856|  27.8k|    } else {
  857|       |        /* TODO allow CH,SH,HRR above 16KB */
  858|  27.8k|        size_t sz = self->super.buf->off - self->rec_start - 5;
  859|  27.8k|        assert(sz <= PTLS_MAX_PLAINTEXT_RECORD_SIZE);
  860|      0|        self->super.buf->base[self->rec_start + 3] = (uint8_t)(sz >> 8);
  861|  27.8k|        self->super.buf->base[self->rec_start + 4] = (uint8_t)(sz);
  862|  27.8k|        ret = 0;
  863|  27.8k|    }
  864|       |
  865|      0|    return ret;
  866|  27.8k|}
picotls.c:send_client_hello:
 2294|  27.8k|{
 2295|  27.8k|    ptls_iovec_t resumption_secret = {NULL}, resumption_ticket = {NULL};
 2296|  27.8k|    uint32_t obfuscated_ticket_age = 0;
 2297|  27.8k|    const char *sni_name = NULL;
 2298|  27.8k|    size_t mess_start, msghash_off;
 2299|  27.8k|    uint8_t binder_key[PTLS_MAX_DIGEST_SIZE];
 2300|  27.8k|    ptls_buffer_t encoded_ch_inner;
 2301|  27.8k|    int ret, is_second_flight = tls->key_schedule != NULL;
 2302|       |
 2303|  27.8k|    ptls_buffer_init(&encoded_ch_inner, "", 0);
 2304|       |
 2305|  27.8k|    if (tls->server_name != NULL && !ptls_server_name_is_ipaddr(tls->server_name))
  ------------------
  |  Branch (2305:9): [True: 0, False: 27.8k]
  |  Branch (2305:37): [True: 0, False: 0]
  ------------------
 2306|      0|        sni_name = tls->server_name;
 2307|       |
 2308|  27.8k|    if (properties != NULL) {
  ------------------
  |  Branch (2308:9): [True: 27.8k, False: 0]
  ------------------
 2309|       |        /* try to use ECH (ignore broken ECHConfigList; it is delivered insecurely) */
 2310|  27.8k|        if (!is_second_flight && sni_name != NULL && tls->ctx->ech.client.ciphers != NULL) {
  ------------------
  |  Branch (2310:13): [True: 2.27k, False: 25.5k]
  |  Branch (2310:34): [True: 0, False: 2.27k]
  |  Branch (2310:54): [True: 0, False: 0]
  ------------------
 2311|      0|            if (properties->client.ech.configs.len != 0) {
  ------------------
  |  Branch (2311:17): [True: 0, False: 0]
  ------------------
 2312|      0|                struct st_decoded_ech_config_t decoded;
 2313|      0|                client_decode_ech_config_list(tls->ctx, &decoded, properties->client.ech.configs);
 2314|      0|                if (decoded.kem != NULL && decoded.cipher != NULL) {
  ------------------
  |  Branch (2314:21): [True: 0, False: 0]
  |  Branch (2314:44): [True: 0, False: 0]
  ------------------
 2315|      0|                    if ((ret = client_setup_ech(&tls->ech, &decoded, tls->ctx->random_bytes)) != 0)
  ------------------
  |  Branch (2315:25): [True: 0, False: 0]
  ------------------
 2316|      0|                        goto Exit;
 2317|      0|                }
 2318|      0|            } else {
 2319|       |                /* zero-length config indicates ECH greasing */
 2320|      0|                client_setup_ech_grease(&tls->ech, tls->ctx->random_bytes, tls->ctx->ech.client.kems, tls->ctx->ech.client.ciphers,
 2321|      0|                                        sni_name);
 2322|      0|            }
 2323|      0|        }
 2324|       |        /* setup resumption-related data. If successful, resumption_secret becomes a non-zero value. */
 2325|  27.8k|        if (properties->client.session_ticket.base != NULL) {
  ------------------
  |  Branch (2325:13): [True: 0, False: 27.8k]
  ------------------
 2326|      0|            ptls_key_exchange_algorithm_t *key_share = NULL;
 2327|      0|            ptls_cipher_suite_t *cipher_suite = NULL;
 2328|      0|            uint32_t max_early_data_size;
 2329|      0|            if (decode_stored_session_ticket(tls, &key_share, &cipher_suite, &resumption_secret, &obfuscated_ticket_age,
  ------------------
  |  Branch (2329:17): [True: 0, False: 0]
  ------------------
 2330|      0|                                             &resumption_ticket, &max_early_data_size, properties->client.session_ticket.base,
 2331|      0|                                             properties->client.session_ticket.base + properties->client.session_ticket.len) == 0) {
 2332|      0|                tls->client.offered_psk = 1;
 2333|       |                /* key-share selected by HRR should not be overridden */
 2334|      0|                if (tls->key_share == NULL)
  ------------------
  |  Branch (2334:21): [True: 0, False: 0]
  ------------------
 2335|      0|                    tls->key_share = key_share;
 2336|      0|                tls->cipher_suite = cipher_suite;
 2337|      0|                if (!is_second_flight && max_early_data_size != 0 && properties->client.max_early_data_size != NULL) {
  ------------------
  |  Branch (2337:21): [True: 0, False: 0]
  |  Branch (2337:42): [True: 0, False: 0]
  |  Branch (2337:70): [True: 0, False: 0]
  ------------------
 2338|      0|                    tls->client.using_early_data = 1;
 2339|      0|                    *properties->client.max_early_data_size = max_early_data_size;
 2340|      0|                }
 2341|      0|            } else {
 2342|      0|                resumption_secret = ptls_iovec_init(NULL, 0);
 2343|      0|            }
 2344|      0|        }
 2345|  27.8k|        if (tls->client.using_early_data) {
  ------------------
  |  Branch (2345:13): [True: 0, False: 27.8k]
  ------------------
 2346|      0|            properties->client.early_data_acceptance = PTLS_EARLY_DATA_ACCEPTANCE_UNKNOWN;
 2347|  27.8k|        } else {
 2348|  27.8k|            if (properties->client.max_early_data_size != NULL)
  ------------------
  |  Branch (2348:17): [True: 0, False: 27.8k]
  ------------------
 2349|      0|                *properties->client.max_early_data_size = 0;
 2350|  27.8k|            properties->client.early_data_acceptance = PTLS_EARLY_DATA_REJECTED;
 2351|  27.8k|        }
 2352|  27.8k|    }
 2353|       |
 2354|       |    /* use the default key share if still not undetermined */
 2355|  27.8k|    if (tls->key_share == NULL && !(properties != NULL && properties->client.negotiate_before_key_exchange))
  ------------------
  |  Branch (2355:9): [True: 2.27k, False: 25.5k]
  |  Branch (2355:37): [True: 2.27k, False: 0]
  |  Branch (2355:59): [True: 0, False: 2.27k]
  ------------------
 2356|  2.27k|        tls->key_share = tls->ctx->key_exchanges[0];
 2357|       |
 2358|       |    /* instantiate key share context */
 2359|  27.8k|    assert(tls->client.key_share_ctx == NULL);
 2360|  27.8k|    if (tls->key_share != NULL) {
  ------------------
  |  Branch (2360:9): [True: 27.8k, False: 0]
  ------------------
 2361|  27.8k|        if ((ret = tls->key_share->create(tls->key_share, &tls->client.key_share_ctx)) != 0)
  ------------------
  |  Branch (2361:13): [True: 0, False: 27.8k]
  ------------------
 2362|      0|            goto Exit;
 2363|  27.8k|    }
 2364|       |
 2365|       |    /* initialize key schedule */
 2366|  27.8k|    if (!is_second_flight) {
  ------------------
  |  Branch (2366:9): [True: 2.27k, False: 25.5k]
  ------------------
 2367|  2.27k|        tls->key_schedule = key_schedule_new(tls->cipher_suite, tls->ctx->cipher_suites, tls->ech.aead != NULL);
 2368|  2.27k|        if ((ret = key_schedule_extract(tls->key_schedule, resumption_secret)) != 0)
  ------------------
  |  Branch (2368:13): [True: 0, False: 2.27k]
  ------------------
 2369|      0|            goto Exit;
 2370|  2.27k|    }
 2371|       |
 2372|       |    /* start generating CH */
 2373|  27.8k|    if ((ret = emitter->begin_message(emitter)) != 0)
  ------------------
  |  Branch (2373:9): [True: 0, False: 27.8k]
  ------------------
 2374|      0|        goto Exit;
 2375|  27.8k|    mess_start = msghash_off = emitter->buf->off;
 2376|       |
 2377|       |    /* generate true (inner) CH */
 2378|  27.8k|    if ((ret = encode_client_hello(tls->ctx, emitter->buf, ENCODE_CH_MODE_INNER, is_second_flight, properties,
  ------------------
  |  Branch (2378:9): [True: 0, False: 27.8k]
  ------------------
 2379|  27.8k|                                   tls->ech.aead != NULL ? tls->ech.inner_client_random : tls->client_random,
  ------------------
  |  Branch (2379:36): [True: 0, False: 27.8k]
  ------------------
 2380|  27.8k|                                   tls->client.key_share_ctx, sni_name, tls->client.legacy_session_id, &tls->ech, NULL,
 2381|  27.8k|                                   tls->ech.client.first_ech, resumption_secret, resumption_ticket, obfuscated_ticket_age,
 2382|  27.8k|                                   tls->key_schedule->hashes[0].algo->digest_size, cookie, tls->client.using_early_data)) != 0)
 2383|      0|        goto Exit;
 2384|       |
 2385|       |    /* update the message hash, filling in the PSK binder HMAC if necessary */
 2386|  27.8k|    if (resumption_secret.base != NULL) {
  ------------------
  |  Branch (2386:9): [True: 0, False: 27.8k]
  ------------------
 2387|      0|        size_t psk_binder_off = emitter->buf->off - (3 + tls->key_schedule->hashes[0].algo->digest_size);
 2388|      0|        if ((ret = derive_secret_with_empty_digest(tls->key_schedule, binder_key, "res binder")) != 0)
  ------------------
  |  Branch (2388:13): [True: 0, False: 0]
  ------------------
 2389|      0|            goto Exit;
 2390|      0|        ptls__key_schedule_update_hash(tls->key_schedule, emitter->buf->base + msghash_off, psk_binder_off - msghash_off, 0);
 2391|      0|        msghash_off = psk_binder_off;
 2392|      0|        if ((ret = calc_verify_data(emitter->buf->base + psk_binder_off + 3, tls->key_schedule, binder_key)) != 0)
  ------------------
  |  Branch (2392:13): [True: 0, False: 0]
  ------------------
 2393|      0|            goto Exit;
 2394|      0|    }
 2395|  27.8k|    ptls__key_schedule_update_hash(tls->key_schedule, emitter->buf->base + msghash_off, emitter->buf->off - msghash_off, 0);
 2396|       |
 2397|       |    /* ECH */
 2398|  27.8k|    if (tls->ech.aead != NULL) {
  ------------------
  |  Branch (2398:9): [True: 0, False: 27.8k]
  ------------------
 2399|       |        /* build EncodedCHInner */
 2400|      0|        if ((ret = encode_client_hello(tls->ctx, &encoded_ch_inner, ENCODE_CH_MODE_ENCODED_INNER, is_second_flight, properties,
  ------------------
  |  Branch (2400:13): [True: 0, False: 0]
  ------------------
 2401|      0|                                       tls->ech.inner_client_random, tls->client.key_share_ctx, sni_name,
 2402|      0|                                       tls->client.legacy_session_id, &tls->ech, NULL, ptls_iovec_init(NULL, 0), resumption_secret,
 2403|      0|                                       resumption_ticket, obfuscated_ticket_age, tls->key_schedule->hashes[0].algo->digest_size,
 2404|      0|                                       cookie, tls->client.using_early_data)) != 0)
 2405|      0|            goto Exit;
 2406|      0|        if (resumption_secret.base != NULL)
  ------------------
  |  Branch (2406:13): [True: 0, False: 0]
  ------------------
 2407|      0|            memcpy(encoded_ch_inner.base + encoded_ch_inner.off - tls->key_schedule->hashes[0].algo->digest_size,
 2408|      0|                   emitter->buf->base + emitter->buf->off - tls->key_schedule->hashes[0].algo->digest_size,
 2409|      0|                   tls->key_schedule->hashes[0].algo->digest_size);
 2410|      0|        { /* pad EncodedCHInner (following draft-ietf-tls-esni-15 6.1.3) */
 2411|      0|            size_t padding_len;
 2412|      0|            if (sni_name != NULL) {
  ------------------
  |  Branch (2412:17): [True: 0, False: 0]
  ------------------
 2413|      0|                padding_len = strlen(sni_name);
 2414|      0|                if (padding_len < tls->ech.client.max_name_length)
  ------------------
  |  Branch (2414:21): [True: 0, False: 0]
  ------------------
 2415|      0|                    padding_len = tls->ech.client.max_name_length;
 2416|      0|            } else {
 2417|      0|                padding_len = tls->ech.client.max_name_length + 9;
 2418|      0|            }
 2419|      0|            size_t final_len = encoded_ch_inner.off - PTLS_HANDSHAKE_HEADER_SIZE + padding_len;
  ------------------
  |  |   56|      0|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
 2420|      0|            final_len = (final_len + 31) / 32 * 32;
 2421|      0|            padding_len = final_len - (encoded_ch_inner.off - PTLS_HANDSHAKE_HEADER_SIZE);
  ------------------
  |  |   56|      0|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
 2422|      0|            if (padding_len != 0) {
  ------------------
  |  Branch (2422:17): [True: 0, False: 0]
  ------------------
 2423|      0|                if ((ret = ptls_buffer_reserve(&encoded_ch_inner, padding_len)) != 0)
  ------------------
  |  Branch (2423:21): [True: 0, False: 0]
  ------------------
 2424|      0|                    goto Exit;
 2425|      0|                memset(encoded_ch_inner.base + encoded_ch_inner.off, 0, padding_len);
 2426|      0|                encoded_ch_inner.off += padding_len;
 2427|      0|            }
 2428|      0|        }
 2429|       |        /* flush CHInner, build CHOuterAAD */
 2430|      0|        emitter->buf->off = mess_start;
 2431|      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
  ------------------
 2432|      0|               ech_size_offset = ech_payload_size;
 2433|      0|        if ((ret = encode_client_hello(tls->ctx, emitter->buf, ENCODE_CH_MODE_OUTER, is_second_flight, properties,
  ------------------
  |  Branch (2433:13): [True: 0, False: 0]
  ------------------
 2434|      0|                                       tls->client_random, tls->client.key_share_ctx, tls->ech.client.public_name,
 2435|      0|                                       tls->client.legacy_session_id, &tls->ech, &ech_size_offset, ptls_iovec_init(NULL, 0),
 2436|      0|                                       resumption_secret, resumption_ticket, obfuscated_ticket_age,
 2437|      0|                                       tls->key_schedule->hashes[0].algo->digest_size, cookie, tls->client.using_early_data)) != 0)
 2438|      0|            goto Exit;
 2439|       |        /* overwrite ECH payload */
 2440|      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
  ------------------
 2441|      0|                          encoded_ch_inner.off - PTLS_HANDSHAKE_HEADER_SIZE, is_second_flight,
  ------------------
  |  |   56|      0|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
 2442|      0|                          emitter->buf->base + mess_start + PTLS_HANDSHAKE_HEADER_SIZE,
  ------------------
  |  |   56|      0|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
 2443|      0|                          emitter->buf->off - (mess_start + PTLS_HANDSHAKE_HEADER_SIZE));
  ------------------
  |  |   56|      0|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
 2444|       |        /* keep the copy of the 1st ECH extension so that we can send it again in 2nd CH in response to rejection with HRR */
 2445|      0|        if (!is_second_flight) {
  ------------------
  |  Branch (2445:13): [True: 0, False: 0]
  ------------------
 2446|      0|            size_t len = outer_ech_header_size(tls->ech.client.enc.len) + ech_payload_size;
 2447|      0|            if ((tls->ech.client.first_ech.base = malloc(len)) == NULL) {
  ------------------
  |  Branch (2447:17): [True: 0, False: 0]
  ------------------
 2448|      0|                ret = PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  224|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 2449|      0|                goto Exit;
 2450|      0|            }
 2451|      0|            memcpy(tls->ech.client.first_ech.base,
 2452|      0|                   emitter->buf->base + ech_size_offset - outer_ech_header_size(tls->ech.client.enc.len), len);
 2453|      0|            tls->ech.client.first_ech.len = len;
 2454|      0|            if (properties->client.ech.configs.len != 0) {
  ------------------
  |  Branch (2454:17): [True: 0, False: 0]
  ------------------
 2455|      0|                tls->ech.offered = 1;
 2456|      0|            } else {
 2457|      0|                tls->ech.offered_grease = 1;
 2458|      0|            }
 2459|      0|        }
 2460|       |        /* update hash */
 2461|      0|        ptls__key_schedule_update_hash(tls->key_schedule, emitter->buf->base + mess_start, emitter->buf->off - mess_start, 1);
 2462|      0|    }
 2463|       |
 2464|       |    /* commit CH to the record layer */
 2465|  27.8k|    if ((ret = emitter->commit_message(emitter)) != 0)
  ------------------
  |  Branch (2465:9): [True: 0, False: 27.8k]
  ------------------
 2466|      0|        goto Exit;
 2467|       |
 2468|  27.8k|    if (tls->client.using_early_data) {
  ------------------
  |  Branch (2468:9): [True: 0, False: 27.8k]
  ------------------
 2469|      0|        assert(!is_second_flight);
 2470|      0|        if ((ret = setup_traffic_protection(tls, 1, "c e traffic", 1, 0)) != 0)
  ------------------
  |  Branch (2470:13): [True: 0, False: 0]
  ------------------
 2471|      0|            goto Exit;
 2472|      0|        if ((ret = push_change_cipher_spec(tls, emitter)) != 0)
  ------------------
  |  Branch (2472:13): [True: 0, False: 0]
  ------------------
 2473|      0|            goto Exit;
 2474|      0|    }
 2475|  27.8k|    if (resumption_secret.base != NULL && !is_second_flight) {
  ------------------
  |  Branch (2475:9): [True: 0, False: 27.8k]
  |  Branch (2475:43): [True: 0, False: 0]
  ------------------
 2476|      0|        if ((ret = derive_exporter_secret(tls, 1)) != 0)
  ------------------
  |  Branch (2476:13): [True: 0, False: 0]
  ------------------
 2477|      0|            goto Exit;
 2478|      0|    }
 2479|  27.8k|    tls->state = cookie == NULL ? PTLS_STATE_CLIENT_EXPECT_SERVER_HELLO : PTLS_STATE_CLIENT_EXPECT_SECOND_SERVER_HELLO;
  ------------------
  |  Branch (2479:18): [True: 2.27k, False: 25.5k]
  ------------------
 2480|  27.8k|    ret = PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  225|  27.8k|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  177|  27.8k|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 2481|       |
 2482|  27.8k|Exit:
 2483|  27.8k|    ptls_buffer_dispose(&encoded_ch_inner);
 2484|  27.8k|    ptls_clear_memory(binder_key, sizeof(binder_key));
 2485|  27.8k|    return ret;
 2486|  27.8k|}
picotls.c:extension_bitmap_testandset:
  441|  34.0k|{
  442|  34.0k|#define HSTYPE_TO_BIT(hstype) ((uint64_t)1 << ((hstype) + 1)) /* min(hstype) is -1 (PSEUDO_HRR) */
  443|  34.0k|#define DEFINE_BIT(abbrev, hstype) static const uint64_t abbrev = HSTYPE_TO_BIT(PTLS_HANDSHAKE_TYPE_##hstype)
  444|  34.0k|#define EXT(candext, allowed_bits)                                                                                                 \
  445|  34.0k|    do {                                                                                                                           \
  446|  34.0k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  447|  34.0k|            allowed_hs_bits = allowed_bits;                                                                                        \
  448|  34.0k|            goto Found;                                                                                                            \
  449|  34.0k|        }                                                                                                                          \
  450|  34.0k|        ext_bitmap_mask <<= 1;                                                                                                     \
  451|  34.0k|    } while (0)
  452|       |
  453|  34.0k|    DEFINE_BIT(CH, CLIENT_HELLO);
  ------------------
  |  |  443|  34.0k|#define DEFINE_BIT(abbrev, hstype) static const uint64_t abbrev = HSTYPE_TO_BIT(PTLS_HANDSHAKE_TYPE_##hstype)
  |  |  ------------------
  |  |  |  |  442|  34.0k|#define HSTYPE_TO_BIT(hstype) ((uint64_t)1 << ((hstype) + 1)) /* min(hstype) is -1 (PSEUDO_HRR) */
  |  |  ------------------
  ------------------
  454|  34.0k|    DEFINE_BIT(SH, SERVER_HELLO);
  ------------------
  |  |  443|  34.0k|#define DEFINE_BIT(abbrev, hstype) static const uint64_t abbrev = HSTYPE_TO_BIT(PTLS_HANDSHAKE_TYPE_##hstype)
  |  |  ------------------
  |  |  |  |  442|  34.0k|#define HSTYPE_TO_BIT(hstype) ((uint64_t)1 << ((hstype) + 1)) /* min(hstype) is -1 (PSEUDO_HRR) */
  |  |  ------------------
  ------------------
  455|  34.0k|    DEFINE_BIT(HRR, PSEUDO_HRR);
  ------------------
  |  |  443|  34.0k|#define DEFINE_BIT(abbrev, hstype) static const uint64_t abbrev = HSTYPE_TO_BIT(PTLS_HANDSHAKE_TYPE_##hstype)
  |  |  ------------------
  |  |  |  |  442|  34.0k|#define HSTYPE_TO_BIT(hstype) ((uint64_t)1 << ((hstype) + 1)) /* min(hstype) is -1 (PSEUDO_HRR) */
  |  |  ------------------
  ------------------
  456|  34.0k|    DEFINE_BIT(EE, ENCRYPTED_EXTENSIONS);
  ------------------
  |  |  443|  34.0k|#define DEFINE_BIT(abbrev, hstype) static const uint64_t abbrev = HSTYPE_TO_BIT(PTLS_HANDSHAKE_TYPE_##hstype)
  |  |  ------------------
  |  |  |  |  442|  34.0k|#define HSTYPE_TO_BIT(hstype) ((uint64_t)1 << ((hstype) + 1)) /* min(hstype) is -1 (PSEUDO_HRR) */
  |  |  ------------------
  ------------------
  457|  34.0k|    DEFINE_BIT(CR, CERTIFICATE_REQUEST);
  ------------------
  |  |  443|  34.0k|#define DEFINE_BIT(abbrev, hstype) static const uint64_t abbrev = HSTYPE_TO_BIT(PTLS_HANDSHAKE_TYPE_##hstype)
  |  |  ------------------
  |  |  |  |  442|  34.0k|#define HSTYPE_TO_BIT(hstype) ((uint64_t)1 << ((hstype) + 1)) /* min(hstype) is -1 (PSEUDO_HRR) */
  |  |  ------------------
  ------------------
  458|  34.0k|    DEFINE_BIT(CT, CERTIFICATE);
  ------------------
  |  |  443|  34.0k|#define DEFINE_BIT(abbrev, hstype) static const uint64_t abbrev = HSTYPE_TO_BIT(PTLS_HANDSHAKE_TYPE_##hstype)
  |  |  ------------------
  |  |  |  |  442|  34.0k|#define HSTYPE_TO_BIT(hstype) ((uint64_t)1 << ((hstype) + 1)) /* min(hstype) is -1 (PSEUDO_HRR) */
  |  |  ------------------
  ------------------
  459|  34.0k|    DEFINE_BIT(NST, NEW_SESSION_TICKET);
  ------------------
  |  |  443|  34.0k|#define DEFINE_BIT(abbrev, hstype) static const uint64_t abbrev = HSTYPE_TO_BIT(PTLS_HANDSHAKE_TYPE_##hstype)
  |  |  ------------------
  |  |  |  |  442|  34.0k|#define HSTYPE_TO_BIT(hstype) ((uint64_t)1 << ((hstype) + 1)) /* min(hstype) is -1 (PSEUDO_HRR) */
  |  |  ------------------
  ------------------
  460|       |
  461|  34.0k|    uint64_t allowed_hs_bits, ext_bitmap_mask = 1;
  462|       |
  463|       |    /* clang-format off */
  464|       |    /* RFC 8446 section 4.2: "The table below indicates the messages where a given extension may appear... If an implementation
  465|       |     * receives an extension which it recognizes and which is not specified for the message in which it appears, it MUST abort the
  466|       |     * handshake with an "illegal_parameter" alert.
  467|       |     *
  468|       |     * +-------------------------+---------------+
  469|       |     * +        Extension        |    Allowed    |
  470|       |     * +-------------------------+---------------+ */
  471|  34.0k|    EXT( SERVER_NAME             , CH + EE       );
  ------------------
  |  |  445|  34.0k|    do {                                                                                                                           \
  |  |  446|  34.0k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  34.0k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 34, False: 34.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  447|     34|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  448|     34|            goto Found;                                                                                                            \
  |  |  449|     34|        }                                                                                                                          \
  |  |  450|  34.0k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  451|  34.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (451:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  472|  34.0k|    EXT( STATUS_REQUEST          , CH + CR + CT  );
  ------------------
  |  |  445|  34.0k|    do {                                                                                                                           \
  |  |  446|  34.0k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  34.0k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 59, False: 33.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  447|     59|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  448|     59|            goto Found;                                                                                                            \
  |  |  449|     59|        }                                                                                                                          \
  |  |  450|  34.0k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  451|  33.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (451:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  473|  33.9k|    EXT( SUPPORTED_GROUPS        , CH + EE       );
  ------------------
  |  |  445|  33.9k|    do {                                                                                                                           \
  |  |  446|  33.9k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  33.9k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 13, False: 33.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  447|     13|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  448|     13|            goto Found;                                                                                                            \
  |  |  449|     13|        }                                                                                                                          \
  |  |  450|  33.9k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  451|  33.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (451:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  474|  33.9k|    EXT( SIGNATURE_ALGORITHMS    , CH + CR       );
  ------------------
  |  |  445|  33.9k|    do {                                                                                                                           \
  |  |  446|  33.9k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  33.9k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 69, False: 33.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  447|     69|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  448|     69|            goto Found;                                                                                                            \
  |  |  449|     69|        }                                                                                                                          \
  |  |  450|  33.9k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  451|  33.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (451:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  475|  33.9k|    EXT( ALPN                    , CH + EE       );
  ------------------
  |  |  445|  33.9k|    do {                                                                                                                           \
  |  |  446|  33.9k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  33.9k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 90, False: 33.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  447|     90|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  448|     90|            goto Found;                                                                                                            \
  |  |  449|     90|        }                                                                                                                          \
  |  |  450|  33.9k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  451|  33.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (451:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  476|  33.8k|    EXT( SERVER_CERTIFICATE_TYPE , CH + EE       );
  ------------------
  |  |  445|  33.8k|    do {                                                                                                                           \
  |  |  446|  33.8k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  33.8k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 38, False: 33.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  447|     38|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  448|     38|            goto Found;                                                                                                            \
  |  |  449|     38|        }                                                                                                                          \
  |  |  450|  33.8k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  451|  33.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (451:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  477|  33.7k|    EXT( KEY_SHARE               , CH + SH + HRR );
  ------------------
  |  |  445|  33.7k|    do {                                                                                                                           \
  |  |  446|  33.7k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  33.7k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 1.70k, False: 32.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  447|  1.70k|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  448|  1.70k|            goto Found;                                                                                                            \
  |  |  449|  1.70k|        }                                                                                                                          \
  |  |  450|  33.7k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  451|  32.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (451:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  478|  32.0k|    EXT( PRE_SHARED_KEY          , CH + SH       );
  ------------------
  |  |  445|  32.0k|    do {                                                                                                                           \
  |  |  446|  32.0k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  32.0k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 38, False: 32.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  447|     38|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  448|     38|            goto Found;                                                                                                            \
  |  |  449|     38|        }                                                                                                                          \
  |  |  450|  32.0k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  451|  32.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (451:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  479|  32.0k|    EXT( PSK_KEY_EXCHANGE_MODES  , CH            );
  ------------------
  |  |  445|  32.0k|    do {                                                                                                                           \
  |  |  446|  32.0k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  32.0k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 4, False: 32.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  447|      4|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  448|      4|            goto Found;                                                                                                            \
  |  |  449|      4|        }                                                                                                                          \
  |  |  450|  32.0k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  451|  32.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (451:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  480|  32.0k|    EXT( EARLY_DATA              , CH + EE + NST );
  ------------------
  |  |  445|  32.0k|    do {                                                                                                                           \
  |  |  446|  32.0k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  32.0k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 10, False: 32.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  447|     10|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  448|     10|            goto Found;                                                                                                            \
  |  |  449|     10|        }                                                                                                                          \
  |  |  450|  32.0k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  451|  32.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (451:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  481|  32.0k|    EXT( COOKIE                  , CH + HRR      );
  ------------------
  |  |  445|  32.0k|    do {                                                                                                                           \
  |  |  446|  32.0k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  32.0k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 1.02k, False: 30.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  447|  1.02k|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  448|  1.02k|            goto Found;                                                                                                            \
  |  |  449|  1.02k|        }                                                                                                                          \
  |  |  450|  32.0k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  451|  30.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (451:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  482|  30.9k|    EXT( SUPPORTED_VERSIONS      , CH + SH + HRR );
  ------------------
  |  |  445|  30.9k|    do {                                                                                                                           \
  |  |  446|  30.9k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  30.9k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 26.8k, False: 4.12k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  447|  26.8k|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  448|  26.8k|            goto Found;                                                                                                            \
  |  |  449|  26.8k|        }                                                                                                                          \
  |  |  450|  30.9k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  451|  4.12k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (451:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  483|  4.12k|    EXT( COMPRESS_CERTIFICATE    , CH + CR       ); /* from RFC 8879 */
  ------------------
  |  |  445|  4.12k|    do {                                                                                                                           \
  |  |  446|  4.12k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  4.12k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 11, False: 4.11k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  447|     11|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  448|     11|            goto Found;                                                                                                            \
  |  |  449|     11|        }                                                                                                                          \
  |  |  450|  4.12k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  451|  4.11k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (451:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  484|  4.11k|    EXT( ENCRYPTED_CLIENT_HELLO  , CH + HRR + EE ); /* from draft-ietf-tls-esni-15 */
  ------------------
  |  |  445|  4.11k|    do {                                                                                                                           \
  |  |  446|  4.11k|        if (PTLS_UNLIKELY(extid == PTLS_EXTENSION_TYPE_##candext)) {                                                               \
  |  |  ------------------
  |  |  |  |   40|  4.11k|#define PTLS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:26): [True: 9, False: 4.10k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  447|      9|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  448|      9|            goto Found;                                                                                                            \
  |  |  449|      9|        }                                                                                                                          \
  |  |  450|  4.11k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  451|  4.10k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (451:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  485|  4.10k|    EXT( ECH_OUTER_EXTENSIONS    , 0             );
  ------------------
  |  |  445|  4.10k|    do {                                                                                                                           \
  |  |  446|  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: 4, False: 4.09k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  447|      4|            allowed_hs_bits = allowed_bits;                                                                                        \
  |  |  448|      4|            goto Found;                                                                                                            \
  |  |  449|      4|        }                                                                                                                          \
  |  |  450|  4.10k|        ext_bitmap_mask <<= 1;                                                                                                     \
  |  |  451|  4.09k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (451:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  486|       |    /* +-----------------------------------------+ */
  487|       |    /* clang-format on */
  488|       |
  489|  4.09k|    return 1;
  490|       |
  491|  29.9k|Found:
  492|  29.9k|    if ((allowed_hs_bits & HSTYPE_TO_BIT(hstype)) == 0)
  ------------------
  |  |  442|  29.9k|#define HSTYPE_TO_BIT(hstype) ((uint64_t)1 << ((hstype) + 1)) /* min(hstype) is -1 (PSEUDO_HRR) */
  ------------------
  |  Branch (492:9): [True: 77, False: 29.9k]
  ------------------
  493|     77|        return 0;
  494|  29.9k|    if ((bitmap->bits & ext_bitmap_mask) != 0)
  ------------------
  |  Branch (494:9): [True: 24, False: 29.8k]
  ------------------
  495|     24|        return 0;
  496|  29.8k|    bitmap->bits |= ext_bitmap_mask;
  497|  29.8k|    return 1;
  498|       |
  499|  29.9k|#undef HSTYPE_TO_BIT
  500|  29.9k|#undef DEFINE_ABBREV
  501|  29.9k|#undef EXT
  502|  29.9k|}
picotls.c:key_schedule_new:
 1251|  2.27k|{
 1252|  2.27k|#define FOREACH_HASH(block)                                                                                                        \
 1253|  2.27k|    do {                                                                                                                           \
 1254|  2.27k|        ptls_cipher_suite_t *cs;                                                                                                   \
 1255|  2.27k|        if ((cs = preferred) != NULL) {                                                                                            \
 1256|  2.27k|            block                                                                                                                  \
 1257|  2.27k|        }                                                                                                                          \
 1258|  2.27k|        if (offered != NULL) {                                                                                                     \
 1259|  2.27k|            size_t i, j;                                                                                                           \
 1260|  2.27k|            for (i = 0; (cs = offered[i]) != NULL; ++i) {                                                                          \
 1261|  2.27k|                if (preferred == NULL || cs->hash != preferred->hash) {                                                            \
 1262|  2.27k|                    for (j = 0; j != i; ++j)                                                                                       \
 1263|  2.27k|                        if (cs->hash == offered[j]->hash)                                                                          \
 1264|  2.27k|                            break;                                                                                                 \
 1265|  2.27k|                    if (j == i) {                                                                                                  \
 1266|  2.27k|                        block                                                                                                      \
 1267|  2.27k|                    }                                                                                                              \
 1268|  2.27k|                }                                                                                                                  \
 1269|  2.27k|            }                                                                                                                      \
 1270|  2.27k|        }                                                                                                                          \
 1271|  2.27k|    } while (0)
 1272|       |
 1273|  2.27k|    ptls_key_schedule_t *sched;
 1274|       |
 1275|  2.27k|    { /* allocate */
 1276|  2.27k|        size_t num_hashes = 0;
 1277|  2.27k|        FOREACH_HASH({ ++num_hashes; });
  ------------------
  |  | 1253|  2.27k|    do {                                                                                                                           \
  |  | 1254|  2.27k|        ptls_cipher_suite_t *cs;                                                                                                   \
  |  | 1255|  2.27k|        if ((cs = preferred) != NULL) {                                                                                            \
  |  |  ------------------
  |  |  |  Branch (1255:13): [True: 0, False: 2.27k]
  |  |  ------------------
  |  | 1256|      0|            block                                                                                                                  \
  |  | 1257|      0|        }                                                                                                                          \
  |  | 1258|  2.27k|        if (offered != NULL) {                                                                                                     \
  |  |  ------------------
  |  |  |  Branch (1258:13): [True: 2.27k, False: 0]
  |  |  ------------------
  |  | 1259|  2.27k|            size_t i, j;                                                                                                           \
  |  | 1260|  4.55k|            for (i = 0; (cs = offered[i]) != NULL; ++i) {                                                                          \
  |  |  ------------------
  |  |  |  Branch (1260:25): [True: 2.27k, False: 2.27k]
  |  |  ------------------
  |  | 1261|  2.27k|                if (preferred == NULL || cs->hash != preferred->hash) {                                                            \
  |  |  ------------------
  |  |  |  Branch (1261:21): [True: 2.27k, False: 0]
  |  |  |  Branch (1261:42): [True: 0, False: 0]
  |  |  ------------------
  |  | 1262|  2.27k|                    for (j = 0; j != i; ++j)                                                                                       \
  |  |  ------------------
  |  |  |  Branch (1262:33): [True: 0, False: 2.27k]
  |  |  ------------------
  |  | 1263|  2.27k|                        if (cs->hash == offered[j]->hash)                                                                          \
  |  |  ------------------
  |  |  |  Branch (1263:29): [True: 0, False: 0]
  |  |  ------------------
  |  | 1264|      0|                            break;                                                                                                 \
  |  | 1265|  2.27k|                    if (j == i) {                                                                                                  \
  |  |  ------------------
  |  |  |  Branch (1265:25): [True: 2.27k, False: 0]
  |  |  ------------------
  |  | 1266|  2.27k|                        block                                                                                                      \
  |  | 1267|  2.27k|                    }                                                                                                              \
  |  | 1268|  2.27k|                }                                                                                                                  \
  |  | 1269|  2.27k|            }                                                                                                                      \
  |  | 1270|  2.27k|        }                                                                                                                          \
  |  | 1271|  2.27k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1271:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1278|  2.27k|        if ((sched = malloc(offsetof(ptls_key_schedule_t, hashes) + sizeof(sched->hashes[0]) * num_hashes)) == NULL)
  ------------------
  |  Branch (1278:13): [True: 0, False: 2.27k]
  ------------------
 1279|      0|            return NULL;
 1280|  2.27k|        *sched = (ptls_key_schedule_t){0};
 1281|  2.27k|    }
 1282|       |
 1283|       |    /* setup the hash algos and contexts */
 1284|  2.27k|    FOREACH_HASH({
  ------------------
  |  | 1253|  2.27k|    do {                                                                                                                           \
  |  | 1254|  2.27k|        ptls_cipher_suite_t *cs;                                                                                                   \
  |  | 1255|  2.27k|        if ((cs = preferred) != NULL) {                                                                                            \
  |  |  ------------------
  |  |  |  Branch (1255:13): [True: 0, False: 2.27k]
  |  |  ------------------
  |  | 1256|      0|            block                                                                                                                  \
  |  |  ------------------
  |  |  |  Branch (1256:13): [True: 0, False: 0]
  |  |  |  Branch (1256:13): [True: 0, False: 0]
  |  |  |  Branch (1256:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1257|      0|        }                                                                                                                          \
  |  | 1258|  2.27k|        if (offered != NULL) {                                                                                                     \
  |  |  ------------------
  |  |  |  Branch (1258:13): [True: 2.27k, False: 0]
  |  |  ------------------
  |  | 1259|  2.27k|            size_t i, j;                                                                                                           \
  |  | 1260|  4.55k|            for (i = 0; (cs = offered[i]) != NULL; ++i) {                                                                          \
  |  |  ------------------
  |  |  |  Branch (1260:25): [True: 2.27k, False: 2.27k]
  |  |  ------------------
  |  | 1261|  2.27k|                if (preferred == NULL || cs->hash != preferred->hash) {                                                            \
  |  |  ------------------
  |  |  |  Branch (1261:21): [True: 2.27k, False: 0]
  |  |  |  Branch (1261:42): [True: 0, False: 0]
  |  |  ------------------
  |  | 1262|  2.27k|                    for (j = 0; j != i; ++j)                                                                                       \
  |  |  ------------------
  |  |  |  Branch (1262:33): [True: 0, False: 2.27k]
  |  |  ------------------
  |  | 1263|  2.27k|                        if (cs->hash == offered[j]->hash)                                                                          \
  |  |  ------------------
  |  |  |  Branch (1263:29): [True: 0, False: 0]
  |  |  ------------------
  |  | 1264|      0|                            break;                                                                                                 \
  |  | 1265|  2.27k|                    if (j == i) {                                                                                                  \
  |  |  ------------------
  |  |  |  Branch (1265:25): [True: 2.27k, False: 0]
  |  |  ------------------
  |  | 1266|  6.83k|                        block                                                                                                      \
  |  |  ------------------
  |  |  |  Branch (1266:25): [True: 0, False: 2.27k]
  |  |  |  Branch (1266:25): [True: 0, False: 0]
  |  |  |  Branch (1266:25): [True: 0, False: 2.27k]
  |  |  ------------------
  |  | 1267|  4.55k|                    }                                                                                                              \
  |  | 1268|  2.27k|                }                                                                                                                  \
  |  | 1269|  2.27k|            }                                                                                                                      \
  |  | 1270|  2.27k|        }                                                                                                                          \
  |  | 1271|  2.27k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1271:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1285|  2.27k|        sched->hashes[sched->num_hashes].algo = cs->hash;
 1286|  2.27k|        if ((sched->hashes[sched->num_hashes].ctx = cs->hash->create()) == NULL)
 1287|  2.27k|            goto Fail;
 1288|  2.27k|        if (use_outer) {
 1289|  2.27k|            if ((sched->hashes[sched->num_hashes].ctx_outer = cs->hash->create()) == NULL)
 1290|  2.27k|                goto Fail;
 1291|  2.27k|        } else {
 1292|  2.27k|            sched->hashes[sched->num_hashes].ctx_outer = NULL;
 1293|  2.27k|        }
 1294|  2.27k|        ++sched->num_hashes;
 1295|  2.27k|    });
 1296|       |
 1297|  2.27k|    return sched;
 1298|      0|Fail:
 1299|      0|    key_schedule_free(sched);
 1300|      0|    return NULL;
 1301|       |
 1302|  2.27k|#undef FOREACH_HASH
 1303|  2.27k|}
picotls.c:key_schedule_extract:
 1306|  3.45k|{
 1307|  3.45k|    int ret;
 1308|       |
 1309|  3.45k|    if (ikm.base == NULL)
  ------------------
  |  Branch (1309:9): [True: 2.27k, False: 1.17k]
  ------------------
 1310|  2.27k|        ikm = ptls_iovec_init(zeroes_of_max_digest_size, sched->hashes[0].algo->digest_size);
 1311|       |
 1312|  3.45k|    if (sched->generation != 0 &&
  ------------------
  |  Branch (1312:9): [True: 1.17k, False: 2.27k]
  ------------------
 1313|  3.45k|        (ret = ptls_hkdf_expand_label(sched->hashes[0].algo, sched->secret, sched->hashes[0].algo->digest_size,
  ------------------
  |  Branch (1313:9): [True: 0, False: 1.17k]
  ------------------
 1314|  1.17k|                                      ptls_iovec_init(sched->secret, sched->hashes[0].algo->digest_size), "derived",
 1315|  1.17k|                                      ptls_iovec_init(sched->hashes[0].algo->empty_digest, sched->hashes[0].algo->digest_size),
 1316|  1.17k|                                      NULL)) != 0)
 1317|      0|        return ret;
 1318|       |
 1319|  3.45k|    ++sched->generation;
 1320|  3.45k|    ret = ptls_hkdf_extract(sched->hashes[0].algo, sched->secret,
 1321|  3.45k|                            ptls_iovec_init(sched->secret, sched->hashes[0].algo->digest_size), ikm);
 1322|  3.45k|    PTLS_DEBUGF("%s: %u, %02x%02x\n", __FUNCTION__, sched->generation, (int)sched->secret[0], (int)sched->secret[1]);
 1323|  3.45k|    return ret;
 1324|  3.45k|}
picotls.c:encode_client_hello:
 2115|  27.8k|{
 2116|  27.8k|    int ret;
 2117|       |
 2118|  27.8k|    assert(mode == ENCODE_CH_MODE_INNER || ech != NULL);
 2119|       |
 2120|  27.8k|    ptls_buffer_push_message_body(sendbuf, NULL, PTLS_HANDSHAKE_TYPE_CLIENT_HELLO, {
  ------------------
  |  | 1157|  27.8k|    do {                                                                                                                           \
  |  | 1158|  27.8k|        ptls_buffer_t *_buf = (buf);                                                                                               \
  |  | 1159|  27.8k|        ptls_key_schedule_t *_key_sched = (key_sched);                                                                             \
  |  | 1160|  27.8k|        size_t mess_start = _buf->off;                                                                                             \
  |  | 1161|  27.8k|        ptls_buffer_push(_buf, (type));                                                                                            \
  |  |  ------------------
  |  |  |  | 1078|  27.8k|    do {                                                                                                                           \
  |  |  |  | 1079|  27.8k|        if ((ret = ptls_buffer__do_pushv((buf), (uint8_t[]){__VA_ARGS__}, sizeof((uint8_t[]){__VA_ARGS__}))) != 0)                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1079:13): [True: 0, False: 27.8k]
  |  |  |  |  ------------------
  |  |  |  | 1080|  27.8k|            goto Exit;                                                                                                             \
  |  |  |  | 1081|  27.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1081:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1162|  27.8k|        ptls_buffer_push_block(_buf, 3, block);                                                                                    \
  |  |  ------------------
  |  |  |  | 1117|  27.8k|    do {                                                                                                                           \
  |  |  |  | 1118|  27.8k|        size_t capacity = (_capacity);                                                                                             \
  |  |  |  | 1119|  27.8k|        ptls_buffer_pushv((buf), (uint8_t *)"\0\0\0\0\0\0\0", capacity != -1 ? capacity : 1);                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1072|  27.8k|    do {                                                                                                                           \
  |  |  |  |  |  | 1073|  55.7k|        if ((ret = ptls_buffer__do_pushv((buf), (src), (len))) != 0)                                                               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1073:13): [True: 0, False: 27.8k]
  |  |  |  |  |  |  |  Branch (1073:57): [True: 27.8k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1074|  27.8k|            goto Exit;                                                                                                             \
  |  |  |  |  |  | 1075|  27.8k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1075:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1120|  27.8k|        size_t body_start = (buf)->off;                                                                                            \
  |  |  |  | 1121|  27.8k|        do {                                                                                                                       \
  |  |  |  | 1122|  10.6M|            block                                                                                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 55.7k, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 55.7k, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 55.7k, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 55.7k, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 55.7k, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 55.7k, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 55.7k, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 25.5k, False: 2.27k]
  |  |  |  |  |  Branch (1122:13): [True: 946, False: 24.6k]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 946]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 946, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 946]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 946, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 946]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 946]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 1.89k, False: 946]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 946, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 1.89k, False: 946]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 946, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 55.7k, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1122:13): [True: 55.7k, False: 27.8k]
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [True: 27.8k, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|   139k|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1123:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1124|  27.8k|        size_t body_size = (buf)->off - body_start;                                                                                \
  |  |  |  | 1125|  27.8k|        if (capacity != -1) {                                                                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1125:13): [True: 27.8k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1126|   111k|            for (; capacity != 0; --capacity)                                                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:20): [True: 83.6k, False: 27.8k]
  |  |  |  |  ------------------
  |  |  |  | 1127|  83.6k|                (buf)->base[body_start - capacity] = (uint8_t)(body_size >> (8 * (capacity - 1)));                                 \
  |  |  |  | 1128|  27.8k|        } else {                                                                                                                   \
  |  |  |  | 1129|      0|            if ((ret = ptls_buffer__adjust_quic_blocksize((buf), body_size)) != 0)                                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1129:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1130|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1131|      0|        }                                                                                                                          \
  |  |  |  | 1132|  27.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1132:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1163|  27.8k|        if (_key_sched != NULL)                                                                                                    \
  |  |  ------------------
  |  |  |  Branch (1163:13): [True: 0, False: 27.8k]
  |  |  ------------------
  |  | 1164|  27.8k|            ptls__key_schedule_update_hash(_key_sched, _buf->base + mess_start, _buf->off - mess_start, 0);                        \
  |  | 1165|  27.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1165:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2121|       |        /* legacy_version */
 2122|  27.8k|        ptls_buffer_push16(sendbuf, 0x0303);
 2123|       |        /* random_bytes */
 2124|  27.8k|        ptls_buffer_pushv(sendbuf, client_random, PTLS_HELLO_RANDOM_SIZE);
 2125|       |        /* lecagy_session_id */
 2126|  27.8k|        ptls_buffer_push_block(sendbuf, 1, {
 2127|  27.8k|            if (mode != ENCODE_CH_MODE_ENCODED_INNER)
 2128|  27.8k|                ptls_buffer_pushv(sendbuf, legacy_session_id.base, legacy_session_id.len);
 2129|  27.8k|        });
 2130|       |        /* cipher_suites */
 2131|  27.8k|        ptls_buffer_push_block(sendbuf, 2, {
 2132|  27.8k|            ptls_cipher_suite_t **cs = ctx->cipher_suites;
 2133|  27.8k|            for (; *cs != NULL; ++cs)
 2134|  27.8k|                ptls_buffer_push16(sendbuf, (*cs)->id);
 2135|  27.8k|        });
 2136|       |        /* legacy_compression_methods */
 2137|  27.8k|        ptls_buffer_push_block(sendbuf, 1, { ptls_buffer_push(sendbuf, 0); });
 2138|       |        /* extensions */
 2139|  27.8k|        ptls_buffer_push_block(sendbuf, 2, {
 2140|  27.8k|            if (mode == ENCODE_CH_MODE_OUTER) {
 2141|  27.8k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_ENCRYPTED_CLIENT_HELLO, {
 2142|  27.8k|                    size_t ext_payload_from = sendbuf->off;
 2143|  27.8k|                    ptls_buffer_push(sendbuf, PTLS_ECH_CLIENT_HELLO_TYPE_OUTER);
 2144|  27.8k|                    ptls_buffer_push16(sendbuf, ech->cipher->id.kdf);
 2145|  27.8k|                    ptls_buffer_push16(sendbuf, ech->cipher->id.aead);
 2146|  27.8k|                    ptls_buffer_push(sendbuf, ech->config_id);
 2147|  27.8k|                    ptls_buffer_push_block(sendbuf, 2, {
 2148|  27.8k|                        if (!is_second_flight)
 2149|  27.8k|                            ptls_buffer_pushv(sendbuf, ech->client.enc.base, ech->client.enc.len);
 2150|  27.8k|                    });
 2151|  27.8k|                    ptls_buffer_push_block(sendbuf, 2, {
 2152|  27.8k|                        assert(sendbuf->off - ext_payload_from ==
 2153|  27.8k|                               outer_ech_header_size(is_second_flight ? 0 : ech->client.enc.len));
 2154|  27.8k|                        if ((ret = ptls_buffer_reserve(sendbuf, *ech_size_offset)) != 0)
 2155|  27.8k|                            goto Exit;
 2156|  27.8k|                        memset(sendbuf->base + sendbuf->off, 0, *ech_size_offset);
 2157|  27.8k|                        sendbuf->off += *ech_size_offset;
 2158|  27.8k|                        *ech_size_offset = sendbuf->off - *ech_size_offset;
 2159|  27.8k|                    });
 2160|  27.8k|                });
 2161|  27.8k|            } else if (ech->aead != NULL) {
 2162|  27.8k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_ENCRYPTED_CLIENT_HELLO,
 2163|  27.8k|                                      { ptls_buffer_push(sendbuf, PTLS_ECH_CLIENT_HELLO_TYPE_INNER); });
 2164|  27.8k|            } else if (ech_replay.base != NULL) {
 2165|  27.8k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_ENCRYPTED_CLIENT_HELLO,
 2166|  27.8k|                                      { ptls_buffer_pushv(sendbuf, ech_replay.base, ech_replay.len); });
 2167|  27.8k|            }
 2168|  27.8k|            if (mode == ENCODE_CH_MODE_ENCODED_INNER) {
 2169|  27.8k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_ECH_OUTER_EXTENSIONS, {
 2170|  27.8k|                    ptls_buffer_push_block(sendbuf, 1, { ptls_buffer_push16(sendbuf, PTLS_EXTENSION_TYPE_KEY_SHARE); });
 2171|  27.8k|                });
 2172|  27.8k|            } else {
 2173|  27.8k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_KEY_SHARE, {
 2174|  27.8k|                    ptls_buffer_push_block(sendbuf, 2, {
 2175|  27.8k|                        if (key_share_ctx != NULL &&
 2176|  27.8k|                            (ret = push_key_share_entry(sendbuf, key_share_ctx->algo->id, key_share_ctx->pubkey)) != 0)
 2177|  27.8k|                            goto Exit;
 2178|  27.8k|                    });
 2179|  27.8k|                });
 2180|  27.8k|            }
 2181|  27.8k|            if (sni_name != NULL) {
 2182|  27.8k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_SERVER_NAME, {
 2183|  27.8k|                    if ((ret = emit_server_name_extension(sendbuf, sni_name)) != 0)
 2184|  27.8k|                        goto Exit;
 2185|  27.8k|                });
 2186|  27.8k|            }
 2187|  27.8k|            if (properties != NULL && properties->client.negotiated_protocols.count != 0) {
 2188|  27.8k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_ALPN, {
 2189|  27.8k|                    ptls_buffer_push_block(sendbuf, 2, {
 2190|  27.8k|                        size_t i;
 2191|  27.8k|                        for (i = 0; i != properties->client.negotiated_protocols.count; ++i) {
 2192|  27.8k|                            ptls_buffer_push_block(sendbuf, 1, {
 2193|  27.8k|                                ptls_iovec_t p = properties->client.negotiated_protocols.list[i];
 2194|  27.8k|                                ptls_buffer_pushv(sendbuf, p.base, p.len);
 2195|  27.8k|                            });
 2196|  27.8k|                        }
 2197|  27.8k|                    });
 2198|  27.8k|                });
 2199|  27.8k|            }
 2200|  27.8k|            if (ctx->decompress_certificate != NULL) {
 2201|  27.8k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_COMPRESS_CERTIFICATE, {
 2202|  27.8k|                    ptls_buffer_push_block(sendbuf, 1, {
 2203|  27.8k|                        const uint16_t *algo = ctx->decompress_certificate->supported_algorithms;
 2204|  27.8k|                        assert(*algo != UINT16_MAX);
 2205|  27.8k|                        for (; *algo != UINT16_MAX; ++algo)
 2206|  27.8k|                            ptls_buffer_push16(sendbuf, *algo);
 2207|  27.8k|                    });
 2208|  27.8k|                });
 2209|  27.8k|            }
 2210|  27.8k|            buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_SUPPORTED_VERSIONS, {
 2211|  27.8k|                ptls_buffer_push_block(sendbuf, 1, {
 2212|  27.8k|                    size_t i;
 2213|  27.8k|                    for (i = 0; i != PTLS_ELEMENTSOF(supported_versions); ++i)
 2214|  27.8k|                        ptls_buffer_push16(sendbuf, supported_versions[i]);
 2215|  27.8k|                });
 2216|  27.8k|            });
 2217|  27.8k|            buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_SIGNATURE_ALGORITHMS, {
 2218|  27.8k|                if ((ret = push_signature_algorithms(ctx->verify_certificate, sendbuf)) != 0)
 2219|  27.8k|                    goto Exit;
 2220|  27.8k|            });
 2221|  27.8k|            buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_SUPPORTED_GROUPS, {
 2222|  27.8k|                ptls_key_exchange_algorithm_t **algo = ctx->key_exchanges;
 2223|  27.8k|                ptls_buffer_push_block(sendbuf, 2, {
 2224|  27.8k|                    for (; *algo != NULL; ++algo)
 2225|  27.8k|                        ptls_buffer_push16(sendbuf, (*algo)->id);
 2226|  27.8k|                });
 2227|  27.8k|            });
 2228|  27.8k|            if (cookie != NULL && cookie->base != NULL) {
 2229|  27.8k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_COOKIE, {
 2230|  27.8k|                    ptls_buffer_push_block(sendbuf, 2, { ptls_buffer_pushv(sendbuf, cookie->base, cookie->len); });
 2231|  27.8k|                });
 2232|  27.8k|            }
 2233|  27.8k|            if (ctx->use_raw_public_keys) {
 2234|  27.8k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_SERVER_CERTIFICATE_TYPE, {
 2235|  27.8k|                    ptls_buffer_push_block(sendbuf, 1, { ptls_buffer_push(sendbuf, PTLS_CERTIFICATE_TYPE_RAW_PUBLIC_KEY); });
 2236|  27.8k|                });
 2237|  27.8k|            }
 2238|  27.8k|            if ((ret = push_additional_extensions(properties, sendbuf)) != 0)
 2239|  27.8k|                goto Exit;
 2240|  27.8k|            if (ctx->save_ticket != NULL || resumption_secret.base != NULL) {
 2241|  27.8k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_PSK_KEY_EXCHANGE_MODES, {
 2242|  27.8k|                    ptls_buffer_push_block(sendbuf, 1, {
 2243|  27.8k|                        if (!ctx->require_dhe_on_psk)
 2244|  27.8k|                            ptls_buffer_push(sendbuf, PTLS_PSK_KE_MODE_PSK);
 2245|  27.8k|                        ptls_buffer_push(sendbuf, PTLS_PSK_KE_MODE_PSK_DHE);
 2246|  27.8k|                    });
 2247|  27.8k|                });
 2248|  27.8k|            }
 2249|  27.8k|            if (resumption_secret.base != NULL) {
 2250|  27.8k|                if (using_early_data && !is_second_flight)
 2251|  27.8k|                    buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_EARLY_DATA, {});
 2252|       |                /* pre-shared key "MUST be the last extension in the ClientHello" (draft-17 section 4.2.6) */
 2253|  27.8k|                buffer_push_extension(sendbuf, PTLS_EXTENSION_TYPE_PRE_SHARED_KEY, {
 2254|  27.8k|                    ptls_buffer_push_block(sendbuf, 2, {
 2255|  27.8k|                        ptls_buffer_push_block(sendbuf, 2, {
 2256|  27.8k|                            if (mode == ENCODE_CH_MODE_OUTER) {
 2257|  27.8k|                                if ((ret = ptls_buffer_reserve(sendbuf, resumption_ticket.len)) != 0)
 2258|  27.8k|                                    goto Exit;
 2259|  27.8k|                                ctx->random_bytes(sendbuf->base + sendbuf->off, resumption_ticket.len);
 2260|  27.8k|                                sendbuf->off += resumption_ticket.len;
 2261|  27.8k|                            } else {
 2262|  27.8k|                                ptls_buffer_pushv(sendbuf, resumption_ticket.base, resumption_ticket.len);
 2263|  27.8k|                            }
 2264|  27.8k|                        });
 2265|  27.8k|                        uint32_t age;
 2266|  27.8k|                        if (mode == ENCODE_CH_MODE_OUTER) {
 2267|  27.8k|                            ctx->random_bytes(&age, sizeof(age));
 2268|  27.8k|                        } else {
 2269|  27.8k|                            age = obfuscated_ticket_age;
 2270|  27.8k|                        }
 2271|  27.8k|                        ptls_buffer_push32(sendbuf, age);
 2272|  27.8k|                    });
 2273|       |                    /* allocate space for PSK binder. The space is filled initially filled by a random value (meeting the
 2274|       |                     * requirement of ClientHelloOuter), and later gets filled with the correct binder value if necessary. */
 2275|  27.8k|                    ptls_buffer_push_block(sendbuf, 2, {
 2276|  27.8k|                        ptls_buffer_push_block(sendbuf, 1, {
 2277|  27.8k|                            if ((ret = ptls_buffer_reserve(sendbuf, psk_binder_size)) != 0)
 2278|  27.8k|                                goto Exit;
 2279|  27.8k|                            ctx->random_bytes(sendbuf->base + sendbuf->off, psk_binder_size);
 2280|  27.8k|                            sendbuf->off += psk_binder_size;
 2281|  27.8k|                        });
 2282|  27.8k|                    });
 2283|  27.8k|                });
 2284|  27.8k|            }
 2285|  27.8k|        });
 2286|  27.8k|    });
 2287|       |
 2288|  27.8k|Exit:
 2289|  27.8k|    return ret;
 2290|  27.8k|}
picotls.c:push_key_share_entry:
 2019|  27.8k|{
 2020|  27.8k|    int ret;
 2021|       |
 2022|  27.8k|    ptls_buffer_push16(buf, group);
  ------------------
  |  | 1084|  27.8k|    do {                                                                                                                           \
  |  | 1085|  27.8k|        uint16_t _v = (v);                                                                                                         \
  |  | 1086|  27.8k|        ptls_buffer_push(buf, (uint8_t)(_v >> 8), (uint8_t)_v);                                                                    \
  |  |  ------------------
  |  |  |  | 1078|  27.8k|    do {                                                                                                                           \
  |  |  |  | 1079|  27.8k|        if ((ret = ptls_buffer__do_pushv((buf), (uint8_t[]){__VA_ARGS__}, sizeof((uint8_t[]){__VA_ARGS__}))) != 0)                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1079:13): [True: 0, False: 27.8k]
  |  |  |  |  ------------------
  |  |  |  | 1080|  27.8k|            goto Exit;                                                                                                             \
  |  |  |  | 1081|  27.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1081:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1087|  27.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1087:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2023|  27.8k|    ptls_buffer_push_block(buf, 2, { ptls_buffer_pushv(buf, pubkey.base, pubkey.len); });
  ------------------
  |  | 1117|  27.8k|    do {                                                                                                                           \
  |  | 1118|  27.8k|        size_t capacity = (_capacity);                                                                                             \
  |  | 1119|  27.8k|        ptls_buffer_pushv((buf), (uint8_t *)"\0\0\0\0\0\0\0", capacity != -1 ? capacity : 1);                                      \
  |  |  ------------------
  |  |  |  | 1072|  27.8k|    do {                                                                                                                           \
  |  |  |  | 1073|  55.7k|        if ((ret = ptls_buffer__do_pushv((buf), (src), (len))) != 0)                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1073:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1073:57): [True: 27.8k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1074|  27.8k|            goto Exit;                                                                                                             \
  |  |  |  | 1075|  27.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1075:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1120|  27.8k|        size_t body_start = (buf)->off;                                                                                            \
  |  | 1121|  27.8k|        do {                                                                                                                       \
  |  | 1122|  83.6k|            block                                                                                                                  \
  |  |  ------------------
  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  ------------------
  |  | 1123|  27.8k|        } while (0);                                                                                                               \
  |  |  ------------------
  |  |  |  Branch (1123:18): [Folded - Ignored]
  |  |  ------------------
  |  | 1124|  27.8k|        size_t body_size = (buf)->off - body_start;                                                                                \
  |  | 1125|  27.8k|        if (capacity != -1) {                                                                                                      \
  |  |  ------------------
  |  |  |  Branch (1125:13): [True: 27.8k, False: 0]
  |  |  ------------------
  |  | 1126|  83.6k|            for (; capacity != 0; --capacity)                                                                                      \
  |  |  ------------------
  |  |  |  Branch (1126:20): [True: 55.7k, False: 27.8k]
  |  |  ------------------
  |  | 1127|  55.7k|                (buf)->base[body_start - capacity] = (uint8_t)(body_size >> (8 * (capacity - 1)));                                 \
  |  | 1128|  27.8k|        } else {                                                                                                                   \
  |  | 1129|      0|            if ((ret = ptls_buffer__adjust_quic_blocksize((buf), body_size)) != 0)                                                 \
  |  |  ------------------
  |  |  |  Branch (1129:17): [True: 0, False: 0]
  |  |  ------------------
  |  | 1130|      0|                goto Exit;                                                                                                         \
  |  | 1131|      0|        }                                                                                                                          \
  |  | 1132|  27.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1132:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2024|  27.8k|    ret = 0;
 2025|  27.8k|Exit:
 2026|  27.8k|    return ret;
 2027|  27.8k|}
picotls.c:push_signature_algorithms:
 1946|  27.8k|{
 1947|       |    /* The list sent when verify callback is not registered */
 1948|  27.8k|    static const uint16_t default_algos[] = {PTLS_SIGNATURE_RSA_PSS_RSAE_SHA256, PTLS_SIGNATURE_ECDSA_SECP256R1_SHA256,
  ------------------
  |  |  154|  27.8k|#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,
  ------------------
  |  |  151|  27.8k|#define PTLS_SIGNATURE_ECDSA_SECP256R1_SHA256 0x0403
  ------------------
 1949|  27.8k|                                             PTLS_SIGNATURE_RSA_PKCS1_SHA256, PTLS_SIGNATURE_RSA_PKCS1_SHA1, UINT16_MAX};
  ------------------
  |  |  150|  27.8k|#define PTLS_SIGNATURE_RSA_PKCS1_SHA256 0x0401
  ------------------
                                                           PTLS_SIGNATURE_RSA_PKCS1_SHA256, PTLS_SIGNATURE_RSA_PKCS1_SHA1, UINT16_MAX};
  ------------------
  |  |  149|  27.8k|#define PTLS_SIGNATURE_RSA_PKCS1_SHA1 0x0201
  ------------------
 1950|  27.8k|    int ret;
 1951|       |
 1952|  27.8k|    ptls_buffer_push_block(sendbuf, 2, {
  ------------------
  |  | 1117|  27.8k|    do {                                                                                                                           \
  |  | 1118|  27.8k|        size_t capacity = (_capacity);                                                                                             \
  |  | 1119|  27.8k|        ptls_buffer_pushv((buf), (uint8_t *)"\0\0\0\0\0\0\0", capacity != -1 ? capacity : 1);                                      \
  |  |  ------------------
  |  |  |  | 1072|  27.8k|    do {                                                                                                                           \
  |  |  |  | 1073|  55.7k|        if ((ret = ptls_buffer__do_pushv((buf), (src), (len))) != 0)                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1073:13): [True: 0, False: 27.8k]
  |  |  |  |  |  Branch (1073:57): [True: 27.8k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1074|  27.8k|            goto Exit;                                                                                                             \
  |  |  |  | 1075|  27.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1075:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1120|  27.8k|        size_t body_start = (buf)->off;                                                                                            \
  |  | 1121|  27.8k|        do {                                                                                                                       \
  |  | 1122|   975k|            block                                                                                                                  \
  |  |  ------------------
  |  |  |  Branch (1122:13): [True: 0, False: 27.8k]
  |  |  |  Branch (1122:13): [True: 0, False: 111k]
  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  Branch (1122:13): [True: 111k, False: 27.8k]
  |  |  ------------------
  |  | 1123|  27.8k|        } while (0);                                                                                                               \
  |  |  ------------------
  |  |  |  Branch (1123:18): [Folded - Ignored]
  |  |  ------------------
  |  | 1124|  27.8k|        size_t body_size = (buf)->off - body_start;                                                                                \
  |  | 1125|  27.8k|        if (capacity != -1) {                                                                                                      \
  |  |  ------------------
  |  |  |  Branch (1125:13): [True: 27.8k, False: 0]
  |  |  ------------------
  |  | 1126|  83.6k|            for (; capacity != 0; --capacity)                                                                                      \
  |  |  ------------------
  |  |  |  Branch (1126:20): [True: 55.7k, False: 27.8k]
  |  |  ------------------
  |  | 1127|  55.7k|                (buf)->base[body_start - capacity] = (uint8_t)(body_size >> (8 * (capacity - 1)));                                 \
  |  | 1128|  27.8k|        } else {                                                                                                                   \
  |  | 1129|      0|            if ((ret = ptls_buffer__adjust_quic_blocksize((buf), body_size)) != 0)                                                 \
  |  |  ------------------
  |  |  |  Branch (1129:17): [True: 0, False: 0]
  |  |  ------------------
  |  | 1130|      0|                goto Exit;                                                                                                         \
  |  | 1131|      0|        }                                                                                                                          \
  |  | 1132|  27.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1132:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1953|  27.8k|        for (const uint16_t *p = vc != NULL ? vc->algos : default_algos; *p != UINT16_MAX; ++p)
 1954|  27.8k|            ptls_buffer_push16(sendbuf, *p);
 1955|  27.8k|    });
 1956|       |
 1957|  27.8k|    ret = 0;
 1958|  27.8k|Exit:
 1959|  27.8k|    return ret;
 1960|  27.8k|}
picotls.c:push_additional_extensions:
 1931|  27.8k|{
 1932|  27.8k|    int ret;
 1933|       |
 1934|  27.8k|    if (properties != NULL && properties->additional_extensions != NULL) {
  ------------------
  |  Branch (1934:9): [True: 27.8k, False: 0]
  |  Branch (1934:31): [True: 0, False: 27.8k]
  ------------------
 1935|      0|        ptls_raw_extension_t *ext;
 1936|      0|        for (ext = properties->additional_extensions; ext->type != UINT16_MAX; ++ext) {
  ------------------
  |  Branch (1936:55): [True: 0, False: 0]
  ------------------
 1937|      0|            buffer_push_extension(sendbuf, ext->type, { ptls_buffer_pushv(sendbuf, ext->data.base, ext->data.len); });
  ------------------
  |  |  869|      0|    do {                                                                                                                           \
  |  |  870|      0|        ptls_buffer_push16((buf), (type));                                                                                         \
  |  |  ------------------
  |  |  |  | 1084|      0|    do {                                                                                                                           \
  |  |  |  | 1085|      0|        uint16_t _v = (v);                                                                                                         \
  |  |  |  | 1086|      0|        ptls_buffer_push(buf, (uint8_t)(_v >> 8), (uint8_t)_v);                                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1078|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1079|      0|        if ((ret = ptls_buffer__do_pushv((buf), (uint8_t[]){__VA_ARGS__}, sizeof((uint8_t[]){__VA_ARGS__}))) != 0)                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1079:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1080|      0|            goto Exit;                                                                                                             \
  |  |  |  |  |  | 1081|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1081:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1087|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1087:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  871|      0|        ptls_buffer_push_block((buf), 2, block);                                                                                   \
  |  |  ------------------
  |  |  |  | 1117|      0|    do {                                                                                                                           \
  |  |  |  | 1118|      0|        size_t capacity = (_capacity);                                                                                             \
  |  |  |  | 1119|      0|        ptls_buffer_pushv((buf), (uint8_t *)"\0\0\0\0\0\0\0", capacity != -1 ? capacity : 1);                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1072|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1073|      0|        if ((ret = ptls_buffer__do_pushv((buf), (src), (len))) != 0)                                                               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1073:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1073:57): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1074|      0|            goto Exit;                                                                                                             \
  |  |  |  |  |  | 1075|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1075:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1120|      0|        size_t body_start = (buf)->off;                                                                                            \
  |  |  |  | 1121|      0|        do {                                                                                                                       \
  |  |  |  | 1122|      0|            block                                                                                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1122:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|      0|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1123:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1124|      0|        size_t body_size = (buf)->off - body_start;                                                                                \
  |  |  |  | 1125|      0|        if (capacity != -1) {                                                                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1125:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1126|      0|            for (; capacity != 0; --capacity)                                                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:20): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1127|      0|                (buf)->base[body_start - capacity] = (uint8_t)(body_size >> (8 * (capacity - 1)));                                 \
  |  |  |  | 1128|      0|        } else {                                                                                                                   \
  |  |  |  | 1129|      0|            if ((ret = ptls_buffer__adjust_quic_blocksize((buf), body_size)) != 0)                                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1129:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1130|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1131|      0|        }                                                                                                                          \
  |  |  |  | 1132|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1132:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  872|      0|    } while (0);
  |  |  ------------------
  |  |  |  Branch (872:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1938|      0|        }
 1939|      0|    }
 1940|  27.8k|    ret = 0;
 1941|  27.8k|Exit:
 1942|  27.8k|    return ret;
 1943|  27.8k|}
picotls.c:derive_secret_with_hash:
 1416|  2.34k|{
 1417|  2.34k|    int ret = ptls_hkdf_expand_label(sched->hashes[0].algo, secret, sched->hashes[0].algo->digest_size,
 1418|  2.34k|                                     ptls_iovec_init(sched->secret, sched->hashes[0].algo->digest_size), label,
 1419|  2.34k|                                     ptls_iovec_init(hash, sched->hashes[0].algo->digest_size), NULL);
 1420|  2.34k|    PTLS_DEBUGF("%s: (label=%s, hash=%02x%02x) => %02x%02x\n", __FUNCTION__, label, hash[0], hash[1], ((uint8_t *)secret)[0],
 1421|  2.34k|                ((uint8_t *)secret)[1]);
 1422|  2.34k|    return ret;
 1423|  2.34k|}
picotls.c:calc_verify_data:
 1776|     11|{
 1777|     11|    ptls_hash_context_t *hmac;
 1778|     11|    uint8_t digest[PTLS_MAX_DIGEST_SIZE];
 1779|     11|    int ret;
 1780|       |
 1781|     11|    if ((ret = ptls_hkdf_expand_label(sched->hashes[0].algo, digest, sched->hashes[0].algo->digest_size,
  ------------------
  |  Branch (1781:9): [True: 0, False: 11]
  ------------------
 1782|     11|                                      ptls_iovec_init(secret, sched->hashes[0].algo->digest_size), "finished",
 1783|     11|                                      ptls_iovec_init(NULL, 0), NULL)) != 0)
 1784|      0|        return ret;
 1785|     11|    if ((hmac = ptls_hmac_create(sched->hashes[0].algo, digest, sched->hashes[0].algo->digest_size)) == NULL) {
  ------------------
  |  Branch (1785:9): [True: 0, False: 11]
  ------------------
 1786|      0|        ptls_clear_memory(digest, sizeof(digest));
 1787|      0|        return PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  224|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 1788|      0|    }
 1789|       |
 1790|     11|    sched->hashes[0].ctx->final(sched->hashes[0].ctx, digest, PTLS_HASH_FINAL_MODE_SNAPSHOT);
 1791|     11|    PTLS_DEBUGF("%s: %02x%02x,%02x%02x\n", __FUNCTION__, ((uint8_t *)secret)[0], ((uint8_t *)secret)[1], digest[0], digest[1]);
 1792|     11|    hmac->update(hmac, digest, sched->hashes[0].algo->digest_size);
 1793|     11|    ptls_clear_memory(digest, sizeof(digest));
 1794|     11|    hmac->final(hmac, output, PTLS_HASH_FINAL_MODE_FREE);
 1795|       |
 1796|     11|    return 0;
 1797|     11|}
picotls.c:setup_traffic_protection:
 1618|  2.34k|{
 1619|  2.34k|    static const char *log_labels[2][4] = {
 1620|  2.34k|        {NULL, "CLIENT_EARLY_TRAFFIC_SECRET", "CLIENT_HANDSHAKE_TRAFFIC_SECRET", "CLIENT_TRAFFIC_SECRET_0"},
 1621|  2.34k|        {NULL, NULL, "SERVER_HANDSHAKE_TRAFFIC_SECRET", "SERVER_TRAFFIC_SECRET_0"}};
 1622|  2.34k|    struct st_ptls_traffic_protection_t *ctx = is_enc ? &tls->traffic_protection.enc : &tls->traffic_protection.dec;
  ------------------
  |  Branch (1622:48): [True: 1.17k, False: 1.17k]
  ------------------
 1623|       |
 1624|  2.34k|    if (secret_label != NULL) {
  ------------------
  |  Branch (1624:9): [True: 2.34k, False: 0]
  ------------------
 1625|  2.34k|        int ret;
 1626|  2.34k|        if ((ret = derive_secret(tls->key_schedule, ctx->secret, secret_label)) != 0)
  ------------------
  |  Branch (1626:13): [True: 0, False: 2.34k]
  ------------------
 1627|      0|            return ret;
 1628|  2.34k|    }
 1629|       |
 1630|  2.34k|    ctx->epoch = epoch;
 1631|       |
 1632|  2.34k|    log_secret(tls, log_labels[ptls_is_server(tls) == is_enc][epoch],
 1633|  2.34k|               ptls_iovec_init(ctx->secret, tls->key_schedule->hashes[0].algo->digest_size));
 1634|       |
 1635|       |    /* special path for applications having their own record layer */
 1636|  2.34k|    if (tls->ctx->update_traffic_key != NULL) {
  ------------------
  |  Branch (1636:9): [True: 0, False: 2.34k]
  ------------------
 1637|      0|        if (skip_notify)
  ------------------
  |  Branch (1637:13): [True: 0, False: 0]
  ------------------
 1638|      0|            return 0;
 1639|      0|        return tls->ctx->update_traffic_key->cb(tls->ctx->update_traffic_key, tls, is_enc, epoch, ctx->secret);
 1640|      0|    }
 1641|       |
 1642|  2.34k|    if (ctx->aead != NULL)
  ------------------
  |  Branch (1642:9): [True: 0, False: 2.34k]
  ------------------
 1643|      0|        ptls_aead_free(ctx->aead);
 1644|  2.34k|    if ((ctx->aead = ptls_aead_new(tls->cipher_suite->aead, tls->cipher_suite->hash, is_enc, ctx->secret,
  ------------------
  |  Branch (1644:9): [True: 0, False: 2.34k]
  ------------------
 1645|  2.34k|                                   tls->ctx->hkdf_label_prefix__obsolete)) == NULL)
 1646|      0|        return PTLS_ERROR_NO_MEMORY; /* TODO obtain error from ptls_aead_new */
  ------------------
  |  |  224|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 1647|  2.34k|    ctx->seq = 0;
 1648|       |
 1649|  2.34k|    PTLS_DEBUGF("[%s] %02x%02x,%02x%02x\n", log_labels[ptls_is_server(tls)][epoch], (unsigned)ctx->secret[0],
 1650|  2.34k|                (unsigned)ctx->secret[1], (unsigned)ctx->aead->static_iv[0], (unsigned)ctx->aead->static_iv[1]);
 1651|       |
 1652|  2.34k|    return 0;
 1653|  2.34k|}
picotls.c:derive_secret:
 1426|  2.34k|{
 1427|  2.34k|    uint8_t hash_value[PTLS_MAX_DIGEST_SIZE];
 1428|       |
 1429|  2.34k|    sched->hashes[0].ctx->final(sched->hashes[0].ctx, hash_value, PTLS_HASH_FINAL_MODE_SNAPSHOT);
 1430|  2.34k|    int ret = derive_secret_with_hash(sched, secret, label, hash_value);
 1431|  2.34k|    ptls_clear_memory(hash_value, sizeof(hash_value));
 1432|  2.34k|    return ret;
 1433|  2.34k|}
picotls.c:log_secret:
  961|  2.34k|{
  962|  2.34k|    char hexbuf[PTLS_MAX_DIGEST_SIZE * 2 + 1];
  963|       |
  964|  2.34k|    PTLS_PROBE(NEW_SECRET, tls, type, ptls_hexdump(hexbuf, secret.base, secret.len));
  965|  2.34k|    PTLS_LOG_CONN(new_secret, tls, { PTLS_LOG_ELEMENT_SAFESTR(label, type); });
  ------------------
  |  | 1262|  2.34k|    do {                                                                                                                           \
  |  | 1263|  2.34k|        ptls_t *_tls = (tls);                                                                                                      \
  |  | 1264|  2.34k|        if (!ptls_log.is_active || ptls_skip_tracing(_tls))                                                                        \
  |  |  ------------------
  |  |  |  Branch (1264:13): [True: 2.34k, False: 0]
  |  |  |  Branch (1264:36): [True: 0, False: 0]
  |  |  ------------------
  |  | 1265|  2.34k|            break;                                                                                                                 \
  |  | 1266|  2.34k|        PTLS_LOG__DO_LOG(picotls, type, {                                                                                          \
  |  |  ------------------
  |  |  |  | 1239|      0|    do {                                                                                                                           \
  |  |  |  | 1240|      0|        int ptlslog_skip = 0;                                                                                                      \
  |  |  |  | 1241|      0|        char smallbuf[128];                                                                                                        \
  |  |  |  | 1242|      0|        ptls_buffer_t ptlslogbuf;                                                                                                  \
  |  |  |  | 1243|      0|        ptls_buffer_init(&ptlslogbuf, smallbuf, sizeof(smallbuf));                                                                 \
  |  |  |  | 1244|      0|        PTLS_LOG__DO_PUSH_SAFESTR("{\"module\":\"" PTLS_TO_STR(module) "\",\"type\":\"" PTLS_TO_STR(type) "\"");                   \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1326|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1327|      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]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1328|      0|            ptlslog_skip = 1;                                                                                                      \
  |  |  |  |  |  | 1329|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1329:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1245|      0|        do {                                                                                                                       \
  |  |  |  | 1246|      0|            block                                                                                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1247|      0|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1247:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1248|      0|        PTLS_LOG__DO_PUSH_SAFESTR("}\n");                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1326|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1327|      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]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1328|      0|            ptlslog_skip = 1;                                                                                                      \
  |  |  |  |  |  | 1329|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1329:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1249|      0|        if (!ptlslog_skip)                                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1249:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1250|      0|            ptls_log__do_write(&ptlslogbuf);                                                                                       \
  |  |  |  | 1251|      0|        ptls_buffer_dispose(&ptlslogbuf);                                                                                          \
  |  |  |  | 1252|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1252:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1267|      0|            PTLS_LOG_ELEMENT_PTR(tls, _tls);                                                                                       \
  |  | 1268|      0|            do {                                                                                                                   \
  |  | 1269|      0|                block                                                                                                              \
  |  | 1270|      0|            } while (0);                                                                                                           \
  |  | 1271|      0|        });                                                                                                                        \
  |  | 1272|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1272:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  966|       |
  967|  2.34k|    if (tls->ctx->log_event != NULL)
  ------------------
  |  Branch (967:9): [True: 0, False: 2.34k]
  ------------------
  968|      0|        tls->ctx->log_event->cb(tls->ctx->log_event, tls, type, "%s", ptls_hexdump(hexbuf, secret.base, secret.len));
  969|  2.34k|}
picotls.c:build_certificate_verify_signdata:
 1761|     39|{
 1762|     39|    size_t datalen = 0;
 1763|       |
 1764|     39|    memset(data + datalen, 32, 64);
 1765|     39|    datalen += 64;
 1766|     39|    memcpy(data + datalen, context_string, strlen(context_string) + 1);
 1767|     39|    datalen += strlen(context_string) + 1;
 1768|     39|    sched->hashes[0].ctx->final(sched->hashes[0].ctx, data + datalen, PTLS_HASH_FINAL_MODE_SNAPSHOT);
 1769|     39|    datalen += sched->hashes[0].algo->digest_size;
 1770|     39|    assert(datalen <= PTLS_MAX_CERTIFICATE_VERIFY_SIGNDATA_SIZE);
 1771|       |
 1772|      0|    return datalen;
 1773|     39|}
picotls.c:handle_input:
 5594|  51.8k|{
 5595|  51.8k|    struct st_ptls_record_t rec;
 5596|  51.8k|    int ret;
 5597|       |
 5598|       |    /* extract the record */
 5599|  51.8k|    if ((ret = parse_record(tls, &rec, input, inlen)) != 0)
  ------------------
  |  Branch (5599:9): [True: 156, False: 51.6k]
  ------------------
 5600|    156|        return ret;
 5601|  51.6k|    assert(rec.fragment != NULL);
 5602|       |
 5603|       |    /* decrypt the record */
 5604|  51.6k|    if (rec.type == PTLS_CONTENT_TYPE_CHANGE_CIPHER_SPEC) {
  ------------------
  |  |   48|  51.6k|#define PTLS_CONTENT_TYPE_CHANGE_CIPHER_SPEC 20
  ------------------
  |  Branch (5604:9): [True: 223, False: 51.4k]
  ------------------
 5605|    223|        if (tls->state < PTLS_STATE_POST_HANDSHAKE_MIN) {
  ------------------
  |  Branch (5605:13): [True: 223, False: 0]
  ------------------
 5606|    223|            if (!(rec.length == 1 && rec.fragment[0] == 0x01))
  ------------------
  |  Branch (5606:19): [True: 206, False: 17]
  |  Branch (5606:38): [True: 198, False: 8]
  ------------------
 5607|     25|                return PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  200|     25|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 5608|    223|        } else {
 5609|      0|            return PTLS_ALERT_HANDSHAKE_FAILURE;
  ------------------
  |  |  194|      0|#define PTLS_ALERT_HANDSHAKE_FAILURE 40
  ------------------
 5610|      0|        }
 5611|    198|        ret = PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  225|    198|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  177|    198|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 5612|    198|        goto NextRecord;
 5613|    223|    }
 5614|  51.4k|    if (tls->traffic_protection.dec.aead != NULL && rec.type != PTLS_CONTENT_TYPE_ALERT) {
  ------------------
  |  |   49|  1.64k|#define PTLS_CONTENT_TYPE_ALERT 21
  ------------------
  |  Branch (5614:9): [True: 1.64k, False: 49.7k]
  |  Branch (5614:53): [True: 1.64k, False: 1]
  ------------------
 5615|  1.64k|        size_t decrypted_length;
 5616|  1.64k|        if (rec.type != PTLS_CONTENT_TYPE_APPDATA)
  ------------------
  |  |   51|  1.64k|#define PTLS_CONTENT_TYPE_APPDATA 23
  ------------------
  |  Branch (5616:13): [True: 2, False: 1.64k]
  ------------------
 5617|      2|            return PTLS_ALERT_HANDSHAKE_FAILURE;
  ------------------
  |  |  194|      2|#define PTLS_ALERT_HANDSHAKE_FAILURE 40
  ------------------
 5618|  1.64k|        if ((ret = ptls_buffer_reserve(decryptbuf, 5 + rec.length)) != 0)
  ------------------
  |  Branch (5618:13): [True: 0, False: 1.64k]
  ------------------
 5619|      0|            return ret;
 5620|  1.64k|        if ((ret = aead_decrypt(&tls->traffic_protection.dec, decryptbuf->base + decryptbuf->off, &decrypted_length, rec.fragment,
  ------------------
  |  Branch (5620:13): [True: 7, False: 1.63k]
  ------------------
 5621|  1.64k|                                rec.length)) != 0) {
 5622|      7|            if (tls->is_server && tls->server.early_data_skipped_bytes != UINT32_MAX)
  ------------------
  |  Branch (5622:17): [True: 0, False: 7]
  |  Branch (5622:35): [True: 0, False: 0]
  ------------------
 5623|      0|                goto ServerSkipEarlyData;
 5624|      7|            return ret;
 5625|      7|        }
 5626|  1.63k|        rec.length = decrypted_length;
 5627|  1.63k|        rec.fragment = decryptbuf->base + decryptbuf->off;
 5628|       |        /* skip padding */
 5629|  2.23k|        for (; rec.length != 0; --rec.length)
  ------------------
  |  Branch (5629:16): [True: 2.21k, False: 17]
  ------------------
 5630|  2.21k|            if (rec.fragment[rec.length - 1] != 0)
  ------------------
  |  Branch (5630:17): [True: 1.62k, False: 594]
  ------------------
 5631|  1.62k|                break;
 5632|  1.63k|        if (rec.length == 0)
  ------------------
  |  Branch (5632:13): [True: 17, False: 1.62k]
  ------------------
 5633|     17|            return PTLS_ALERT_UNEXPECTED_MESSAGE;
  ------------------
  |  |  192|     17|#define PTLS_ALERT_UNEXPECTED_MESSAGE 10
  ------------------
 5634|  1.62k|        rec.type = rec.fragment[--rec.length];
 5635|  49.7k|    } else if (rec.type == PTLS_CONTENT_TYPE_APPDATA && tls->is_server && tls->server.early_data_skipped_bytes != UINT32_MAX) {
  ------------------
  |  |   51|  99.5k|#define PTLS_CONTENT_TYPE_APPDATA 23
  ------------------
  |  Branch (5635:16): [True: 6, False: 49.7k]
  |  Branch (5635:57): [True: 0, False: 6]
  |  Branch (5635:75): [True: 0, False: 0]
  ------------------
 5636|      0|        goto ServerSkipEarlyData;
 5637|      0|    }
 5638|       |
 5639|  51.3k|    if (tls->recvbuf.mess.base != NULL || rec.type == PTLS_CONTENT_TYPE_HANDSHAKE) {
  ------------------
  |  |   50|  30.8k|#define PTLS_CONTENT_TYPE_HANDSHAKE 22
  ------------------
  |  Branch (5639:9): [True: 20.5k, False: 30.8k]
  |  Branch (5639:43): [True: 30.7k, False: 61]
  ------------------
 5640|       |        /* handshake record */
 5641|  51.3k|        ret = handle_handshake_record(tls, tls->is_server ? handle_server_handshake_message : handle_client_handshake_message,
  ------------------
  |  Branch (5641:44): [True: 0, False: 51.3k]
  ------------------
 5642|  51.3k|                                      emitter, &rec, properties);
 5643|  51.3k|    } else {
 5644|       |        /* handling of an alert or an application record */
 5645|     61|        switch (rec.type) {
 5646|     10|        case PTLS_CONTENT_TYPE_APPDATA:
  ------------------
  |  |   51|     10|#define PTLS_CONTENT_TYPE_APPDATA 23
  ------------------
  |  Branch (5646:9): [True: 10, False: 51]
  ------------------
 5647|     10|            if (tls->state >= PTLS_STATE_POST_HANDSHAKE_MIN) {
  ------------------
  |  Branch (5647:17): [True: 0, False: 10]
  ------------------
 5648|      0|                decryptbuf->off += rec.length;
 5649|      0|                ret = 0;
 5650|     10|            } else if (tls->state == PTLS_STATE_SERVER_EXPECT_END_OF_EARLY_DATA) {
  ------------------
  |  Branch (5650:24): [True: 0, False: 10]
  ------------------
 5651|      0|                if (tls->traffic_protection.dec.aead != NULL)
  ------------------
  |  Branch (5651:21): [True: 0, False: 0]
  ------------------
 5652|      0|                    decryptbuf->off += rec.length;
 5653|      0|                ret = 0;
 5654|     10|            } else {
 5655|     10|                ret = PTLS_ALERT_UNEXPECTED_MESSAGE;
  ------------------
  |  |  192|     10|#define PTLS_ALERT_UNEXPECTED_MESSAGE 10
  ------------------
 5656|     10|            }
 5657|     10|            break;
 5658|     30|        case PTLS_CONTENT_TYPE_ALERT:
  ------------------
  |  |   49|     30|#define PTLS_CONTENT_TYPE_ALERT 21
  ------------------
  |  Branch (5658:9): [True: 30, False: 31]
  ------------------
 5659|     30|            ret = handle_alert(tls, rec.fragment, rec.length);
 5660|     30|            break;
 5661|     21|        default:
  ------------------
  |  Branch (5661:9): [True: 21, False: 40]
  ------------------
 5662|     21|            ret = PTLS_ALERT_UNEXPECTED_MESSAGE;
  ------------------
  |  |  192|     21|#define PTLS_ALERT_UNEXPECTED_MESSAGE 10
  ------------------
 5663|     21|            break;
 5664|     61|        }
 5665|     61|    }
 5666|       |
 5667|  51.5k|NextRecord:
 5668|  51.5k|    ptls_buffer_dispose(&tls->recvbuf.rec);
 5669|  51.5k|    return ret;
 5670|       |
 5671|      0|ServerSkipEarlyData:
 5672|      0|    tls->server.early_data_skipped_bytes += (uint32_t)rec.length;
 5673|      0|    if (tls->server.early_data_skipped_bytes > PTLS_MAX_EARLY_DATA_SKIP_SIZE)
  ------------------
  |  |   92|      0|#define PTLS_MAX_EARLY_DATA_SKIP_SIZE 65536
  ------------------
  |  Branch (5673:9): [True: 0, False: 0]
  ------------------
 5674|      0|        return PTLS_ALERT_HANDSHAKE_FAILURE;
  ------------------
  |  |  194|      0|#define PTLS_ALERT_HANDSHAKE_FAILURE 40
  ------------------
 5675|      0|    ret = PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  225|      0|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 5676|      0|    goto NextRecord;
 5677|      0|}
picotls.c:parse_record:
 4858|  51.8k|{
 4859|  51.8k|    int ret;
 4860|       |
 4861|  51.8k|    assert(*len != 0);
 4862|       |
 4863|       |    /* Check if the first byte is something that we can handle, otherwise do not bother parsing / buffering the entire record as it
 4864|       |     * is obviously broken. SSL 2.0 handshakes fall into this path as well. */
 4865|  51.8k|    if (tls->recvbuf.rec.base == NULL) {
  ------------------
  |  Branch (4865:9): [True: 51.8k, False: 0]
  ------------------
 4866|  51.8k|        uint8_t type = src[0];
 4867|  51.8k|        switch (type) {
 4868|    231|        case PTLS_CONTENT_TYPE_CHANGE_CIPHER_SPEC:
  ------------------
  |  |   48|    231|#define PTLS_CONTENT_TYPE_CHANGE_CIPHER_SPEC 20
  ------------------
  |  Branch (4868:9): [True: 231, False: 51.5k]
  ------------------
 4869|    271|        case PTLS_CONTENT_TYPE_ALERT:
  ------------------
  |  |   49|    271|#define PTLS_CONTENT_TYPE_ALERT 21
  ------------------
  |  Branch (4869:9): [True: 40, False: 51.7k]
  ------------------
 4870|  50.0k|        case PTLS_CONTENT_TYPE_HANDSHAKE:
  ------------------
  |  |   50|  50.0k|#define PTLS_CONTENT_TYPE_HANDSHAKE 22
  ------------------
  |  Branch (4870:9): [True: 49.8k, False: 1.97k]
  ------------------
 4871|  51.7k|        case PTLS_CONTENT_TYPE_APPDATA:
  ------------------
  |  |   51|  51.7k|#define PTLS_CONTENT_TYPE_APPDATA 23
  ------------------
  |  Branch (4871:9): [True: 1.66k, False: 50.1k]
  ------------------
 4872|  51.7k|            break;
 4873|     43|        default:
  ------------------
  |  Branch (4873:9): [True: 43, False: 51.7k]
  ------------------
 4874|     43|            return PTLS_ALERT_DECODE_ERROR;
  ------------------
  |  |  203|     43|#define PTLS_ALERT_DECODE_ERROR 50
  ------------------
 4875|  51.8k|        }
 4876|  51.8k|    }
 4877|       |
 4878|  51.7k|    if (tls->recvbuf.rec.base == NULL && *len >= 5) {
  ------------------
  |  Branch (4878:9): [True: 51.7k, False: 0]
  |  Branch (4878:42): [True: 51.7k, False: 28]
  ------------------
 4879|       |        /* fast path */
 4880|  51.7k|        if ((ret = parse_record_header(rec, src)) != 0)
  ------------------
  |  Branch (4880:13): [True: 6, False: 51.7k]
  ------------------
 4881|      6|            return ret;
 4882|  51.7k|        if (5 + rec->length <= *len) {
  ------------------
  |  Branch (4882:13): [True: 51.6k, False: 79]
  ------------------
 4883|  51.6k|            rec->fragment = src + 5;
 4884|  51.6k|            *len = rec->length + 5;
 4885|  51.6k|            return 0;
 4886|  51.6k|        }
 4887|  51.7k|    }
 4888|       |
 4889|       |    /* slow path */
 4890|    107|    const uint8_t *const end = src + *len;
 4891|    107|    *rec = (struct st_ptls_record_t){0};
 4892|       |
 4893|    107|    if (tls->recvbuf.rec.base == NULL) {
  ------------------
  |  Branch (4893:9): [True: 107, False: 0]
  ------------------
 4894|    107|        ptls_buffer_init(&tls->recvbuf.rec, "", 0);
 4895|    107|        if ((ret = ptls_buffer_reserve(&tls->recvbuf.rec, 5)) != 0)
  ------------------
  |  Branch (4895:13): [True: 0, False: 107]
  ------------------
 4896|      0|            return ret;
 4897|    107|    }
 4898|       |
 4899|       |    /* fill and parse the header */
 4900|    538|    while (tls->recvbuf.rec.off < 5) {
  ------------------
  |  Branch (4900:12): [True: 459, False: 79]
  ------------------
 4901|    459|        if (src == end)
  ------------------
  |  Branch (4901:13): [True: 28, False: 431]
  ------------------
 4902|     28|            return PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  225|     28|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  177|     28|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 4903|    431|        tls->recvbuf.rec.base[tls->recvbuf.rec.off++] = *src++;
 4904|    431|    }
 4905|     79|    if ((ret = parse_record_header(rec, tls->recvbuf.rec.base)) != 0)
  ------------------
  |  Branch (4905:9): [True: 0, False: 79]
  ------------------
 4906|      0|        return ret;
 4907|       |
 4908|       |    /* fill the fragment */
 4909|     79|    size_t addlen = rec->length + 5 - tls->recvbuf.rec.off;
 4910|     79|    if (addlen != 0) {
  ------------------
  |  Branch (4910:9): [True: 79, False: 0]
  ------------------
 4911|     79|        if ((ret = ptls_buffer_reserve(&tls->recvbuf.rec, addlen)) != 0)
  ------------------
  |  Branch (4911:13): [True: 0, False: 79]
  ------------------
 4912|      0|            return ret;
 4913|     79|        if (addlen > (size_t)(end - src))
  ------------------
  |  Branch (4913:13): [True: 79, False: 0]
  ------------------
 4914|     79|            addlen = end - src;
 4915|     79|        if (addlen != 0) {
  ------------------
  |  Branch (4915:13): [True: 21, False: 58]
  ------------------
 4916|     21|            memcpy(tls->recvbuf.rec.base + tls->recvbuf.rec.off, src, addlen);
 4917|     21|            tls->recvbuf.rec.off += addlen;
 4918|     21|            src += addlen;
 4919|     21|        }
 4920|     79|    }
 4921|       |
 4922|       |    /* set rec->fragment if a complete record has been parsed */
 4923|     79|    if (tls->recvbuf.rec.off == rec->length + 5) {
  ------------------
  |  Branch (4923:9): [True: 0, False: 79]
  ------------------
 4924|      0|        rec->fragment = tls->recvbuf.rec.base + 5;
 4925|      0|        ret = 0;
 4926|     79|    } else {
 4927|     79|        ret = PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  225|     79|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  177|     79|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 4928|     79|    }
 4929|       |
 4930|     79|    *len -= end - src;
 4931|     79|    return ret;
 4932|     79|}
picotls.c:parse_record_header:
 4845|  51.8k|{
 4846|  51.8k|    rec->type = src[0];
 4847|  51.8k|    rec->version = ntoh16(src + 1);
 4848|  51.8k|    rec->length = ntoh16(src + 3);
 4849|       |
 4850|  51.8k|    if (rec->length >
  ------------------
  |  Branch (4850:9): [True: 6, False: 51.8k]
  ------------------
 4851|  51.8k|        (size_t)(rec->type == PTLS_CONTENT_TYPE_APPDATA ? PTLS_MAX_ENCRYPTED_RECORD_SIZE : PTLS_MAX_PLAINTEXT_RECORD_SIZE))
  ------------------
  |  |   51|  51.8k|#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.67k|#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|  50.1k|#define PTLS_MAX_PLAINTEXT_RECORD_SIZE 16384
  ------------------
  |  Branch (4851:18): [True: 1.67k, False: 50.1k]
  ------------------
 4852|      6|        return PTLS_ALERT_DECODE_ERROR;
  ------------------
  |  |  203|      6|#define PTLS_ALERT_DECODE_ERROR 50
  ------------------
 4853|       |
 4854|  51.8k|    return 0;
 4855|  51.8k|}
picotls.c:aead_decrypt:
  685|  1.64k|{
  686|  1.64k|    if (inlen < 16) {
  ------------------
  |  Branch (686:9): [True: 7, False: 1.63k]
  ------------------
  687|      7|        return PTLS_ALERT_BAD_RECORD_MAC;
  ------------------
  |  |  193|      7|#define PTLS_ALERT_BAD_RECORD_MAC 20
  ------------------
  688|      7|    }
  689|  1.63k|    memcpy(output, input, inlen - 16);
  690|  1.63k|    *outlen = inlen - 16; /* removing the 16 bytes of tag */
  691|  1.63k|    return 0;
  692|  1.64k|}
picotls.c:handle_alert:
 5504|     30|{
 5505|     30|    if (len != 2)
  ------------------
  |  Branch (5505:9): [True: 17, False: 13]
  ------------------
 5506|     17|        return PTLS_ALERT_DECODE_ERROR;
  ------------------
  |  |  203|     17|#define PTLS_ALERT_DECODE_ERROR 50
  ------------------
 5507|       |
 5508|     13|    uint8_t desc = src[1];
 5509|       |
 5510|       |    /* all fatal alerts and USER_CANCELLED warning tears down the connection immediately, regardless of the transmitted level */
 5511|     13|    return PTLS_ALERT_TO_PEER_ERROR(desc);
  ------------------
  |  |  181|     13|#define PTLS_ALERT_TO_PEER_ERROR(e) ((e) + PTLS_ERROR_CLASS_PEER_ALERT)
  |  |  ------------------
  |  |  |  |  176|     13|#define PTLS_ERROR_CLASS_PEER_ALERT 0x100
  |  |  ------------------
  ------------------
 5512|     30|}
picotls.c:hmac_update:
 5977|  19.8k|{
 5978|  19.8k|    struct st_picotls_hmac_context_t *ctx = (struct st_picotls_hmac_context_t *)_ctx;
 5979|  19.8k|    ctx->hash->update(ctx->hash, src, len);
 5980|  19.8k|}
picotls.c:hmac_final:
 5994|  19.8k|{
 5995|  19.8k|    struct st_picotls_hmac_context_t *ctx = (struct st_picotls_hmac_context_t *)_ctx;
 5996|       |
 5997|  19.8k|    assert(mode != PTLS_HASH_FINAL_MODE_SNAPSHOT || !"not supported");
 5998|       |
 5999|  19.8k|    if (md != NULL) {
  ------------------
  |  Branch (5999:9): [True: 11.6k, False: 8.20k]
  ------------------
 6000|  11.6k|        ctx->hash->final(ctx->hash, md, PTLS_HASH_FINAL_MODE_RESET);
 6001|  11.6k|        hmac_apply_key(ctx, 0x5c);
 6002|  11.6k|        ctx->hash->update(ctx->hash, md, ctx->algo->digest_size);
 6003|  11.6k|    }
 6004|  19.8k|    ctx->hash->final(ctx->hash, md, mode);
 6005|       |
 6006|  19.8k|    switch (mode) {
 6007|  11.6k|    case PTLS_HASH_FINAL_MODE_FREE:
  ------------------
  |  Branch (6007:5): [True: 11.6k, False: 8.20k]
  ------------------
 6008|  11.6k|        ptls_clear_memory(ctx->key, ctx->algo->block_size);
 6009|  11.6k|        free(ctx);
 6010|  11.6k|        break;
 6011|  8.20k|    case PTLS_HASH_FINAL_MODE_RESET:
  ------------------
  |  Branch (6011:5): [True: 8.20k, False: 11.6k]
  ------------------
 6012|  8.20k|        hmac_apply_key(ctx, 0x36);
 6013|  8.20k|        break;
 6014|      0|    default:
  ------------------
  |  Branch (6014:5): [True: 0, False: 19.8k]
  ------------------
 6015|      0|        assert(!"FIXME");
 6016|      0|        break;
 6017|  19.8k|    }
 6018|  19.8k|}
picotls.c:hmac_apply_key:
 5983|  31.5k|{
 5984|  31.5k|    size_t i;
 5985|       |
 5986|  2.05M|    for (i = 0; i != ctx->algo->block_size; ++i)
  ------------------
  |  Branch (5986:17): [True: 2.01M, False: 31.5k]
  ------------------
 5987|  2.01M|        ctx->key[i] ^= pad;
 5988|  31.5k|    ctx->hash->update(ctx->hash, ctx->key, ctx->algo->block_size);
 5989|  2.05M|    for (i = 0; i != ctx->algo->block_size; ++i)
  ------------------
  |  Branch (5989:17): [True: 2.01M, False: 31.5k]
  ------------------
 5990|  2.01M|        ctx->key[i] ^= pad;
 5991|  31.5k|}
picotls.c:new_aead:
 6187|  2.34k|{
 6188|  2.34k|    ptls_aead_context_t *ctx = NULL;
 6189|  2.34k|    struct {
 6190|  2.34k|        uint8_t key[PTLS_MAX_SECRET_SIZE];
 6191|  2.34k|        uint8_t iv[PTLS_MAX_IV_SIZE];
 6192|  2.34k|    } key_iv;
 6193|  2.34k|    int ret;
 6194|       |
 6195|  2.34k|    if ((ret = get_traffic_keys(aead, hash, key_iv.key, key_iv.iv, secret, hash_value, label_prefix)) != 0)
  ------------------
  |  Branch (6195:9): [True: 0, False: 2.34k]
  ------------------
 6196|      0|        goto Exit;
 6197|  2.34k|    ctx = ptls_aead_new_direct(aead, is_enc, key_iv.key, key_iv.iv);
 6198|       |
 6199|  2.34k|Exit:
 6200|  2.34k|    ptls_clear_memory(&key_iv, sizeof(key_iv));
 6201|  2.34k|    return ctx;
 6202|  2.34k|}
picotls.c:clear_memory:
 6261|   242k|{
 6262|   242k|    if (len != 0)
  ------------------
  |  Branch (6262:9): [True: 118k, False: 124k]
  ------------------
 6263|   118k|        memset(p, 0, len);
 6264|   242k|}
picotls.c:mem_equal:
 6269|  26.8k|{
 6270|  26.8k|    const volatile uint8_t *x = _x, *y = _y;
 6271|  26.8k|    uint8_t t = 0;
 6272|       |
 6273|  27.1k|    for (; len != 0; --len)
  ------------------
  |  Branch (6273:12): [True: 352, False: 26.8k]
  ------------------
 6274|    352|        t |= *x++ ^ *y++;
 6275|       |
 6276|  26.8k|    return t == 0;
 6277|  26.8k|}
picotls.c:handle_handshake_record:
 5528|  51.3k|{
 5529|  51.3k|    int ret;
 5530|       |
 5531|       |    /* handshake */
 5532|  51.3k|    if (rec->type != PTLS_CONTENT_TYPE_HANDSHAKE)
  ------------------
  |  |   50|  51.3k|#define PTLS_CONTENT_TYPE_HANDSHAKE 22
  ------------------
  |  Branch (5532:9): [True: 10, False: 51.3k]
  ------------------
 5533|     10|        return PTLS_ALERT_DECODE_ERROR;
  ------------------
  |  |  203|     10|#define PTLS_ALERT_DECODE_ERROR 50
  ------------------
 5534|       |
 5535|       |    /* flatten the unhandled messages */
 5536|  51.3k|    const uint8_t *src, *src_end;
 5537|  51.3k|    if (tls->recvbuf.mess.base == NULL) {
  ------------------
  |  Branch (5537:9): [True: 30.7k, False: 20.5k]
  ------------------
 5538|  30.7k|        src = rec->fragment;
 5539|  30.7k|        src_end = src + rec->length;
 5540|  30.7k|    } else {
 5541|  20.5k|        if (message_buffer_is_overflow(tls->ctx, tls->recvbuf.mess.off + rec->length))
  ------------------
  |  Branch (5541:13): [True: 0, False: 20.5k]
  ------------------
 5542|      0|            return PTLS_ALERT_HANDSHAKE_FAILURE;
  ------------------
  |  |  194|      0|#define PTLS_ALERT_HANDSHAKE_FAILURE 40
  ------------------
 5543|  20.5k|        if ((ret = ptls_buffer_reserve(&tls->recvbuf.mess, rec->length)) != 0)
  ------------------
  |  Branch (5543:13): [True: 0, False: 20.5k]
  ------------------
 5544|      0|            return ret;
 5545|  20.5k|        memcpy(tls->recvbuf.mess.base + tls->recvbuf.mess.off, rec->fragment, rec->length);
 5546|  20.5k|        tls->recvbuf.mess.off += rec->length;
 5547|  20.5k|        src = tls->recvbuf.mess.base;
 5548|  20.5k|        src_end = src + tls->recvbuf.mess.off;
 5549|  20.5k|    }
 5550|       |
 5551|       |    /* handle the messages */
 5552|  51.3k|    ret = PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  225|  51.3k|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  177|  51.3k|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 5553|  79.0k|    while (src_end - src >= 4) {
  ------------------
  |  Branch (5553:12): [True: 49.7k, False: 29.3k]
  ------------------
 5554|  49.7k|        size_t mess_len = 4 + ntoh24(src + 1);
 5555|  49.7k|        if (src_end - src < (int)mess_len)
  ------------------
  |  Branch (5555:13): [True: 20.2k, False: 29.4k]
  ------------------
 5556|  20.2k|            break;
 5557|  29.4k|        ret = cb(tls, emitter, ptls_iovec_init(src, mess_len), src_end - src == mess_len, properties);
 5558|  29.4k|        switch (ret) {
 5559|      0|        case 0:
  ------------------
  |  Branch (5559:9): [True: 0, False: 29.4k]
  ------------------
 5560|      0|        case PTLS_ERROR_ASYNC_OPERATION:
  ------------------
  |  |  234|      0|#define PTLS_ERROR_ASYNC_OPERATION (PTLS_ERROR_CLASS_INTERNAL + 11)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  |  Branch (5560:9): [True: 0, False: 29.4k]
  ------------------
 5561|  27.7k|        case PTLS_ERROR_IN_PROGRESS:
  ------------------
  |  |  225|  27.7k|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  177|  27.7k|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
  |  Branch (5561:9): [True: 27.7k, False: 1.77k]
  ------------------
 5562|  27.7k|            break;
 5563|  1.77k|        default:
  ------------------
  |  Branch (5563:9): [True: 1.77k, False: 27.7k]
  ------------------
 5564|  1.77k|            ptls_buffer_dispose(&tls->recvbuf.mess);
 5565|  1.77k|            return ret;
 5566|  29.4k|        }
 5567|  27.7k|        src += mess_len;
 5568|  27.7k|    }
 5569|       |
 5570|       |    /* keep last partial message in buffer */
 5571|  49.5k|    if (src != src_end) {
  ------------------
  |  Branch (5571:9): [True: 20.6k, False: 28.9k]
  ------------------
 5572|  20.6k|        size_t new_size = src_end - src;
 5573|  20.6k|        if (message_buffer_is_overflow(tls->ctx, new_size))
  ------------------
  |  Branch (5573:13): [True: 0, False: 20.6k]
  ------------------
 5574|      0|            return PTLS_ALERT_HANDSHAKE_FAILURE;
  ------------------
  |  |  194|      0|#define PTLS_ALERT_HANDSHAKE_FAILURE 40
  ------------------
 5575|  20.6k|        if (tls->recvbuf.mess.base == NULL) {
  ------------------
  |  Branch (5575:13): [True: 1.17k, False: 19.4k]
  ------------------
 5576|  1.17k|            ptls_buffer_init(&tls->recvbuf.mess, "", 0);
 5577|  1.17k|            if ((ret = ptls_buffer_reserve(&tls->recvbuf.mess, new_size)) != 0)
  ------------------
  |  Branch (5577:17): [True: 0, False: 1.17k]
  ------------------
 5578|      0|                return ret;
 5579|  1.17k|            memcpy(tls->recvbuf.mess.base, src, new_size);
 5580|  19.4k|        } else {
 5581|  19.4k|            memmove(tls->recvbuf.mess.base, src, new_size);
 5582|  19.4k|        }
 5583|  20.6k|        tls->recvbuf.mess.off = new_size;
 5584|  20.6k|        ret = PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  225|  20.6k|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  177|  20.6k|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 5585|  28.9k|    } else {
 5586|  28.9k|        ptls_buffer_dispose(&tls->recvbuf.mess);
 5587|  28.9k|    }
 5588|       |
 5589|  49.5k|    return ret;
 5590|  49.5k|}
picotls.c:message_buffer_is_overflow:
 5515|  41.1k|{
 5516|  41.1k|    if (ctx->max_buffer_size == 0)
  ------------------
  |  Branch (5516:9): [True: 41.1k, False: 0]
  ------------------
 5517|  41.1k|        return 0;
 5518|      0|    if (size <= ctx->max_buffer_size)
  ------------------
  |  Branch (5518:9): [True: 0, False: 0]
  ------------------
 5519|      0|        return 0;
 5520|      0|    return 1;
 5521|      0|}
picotls.c:ntoh24:
  513|  49.7k|{
  514|  49.7k|    return (uint32_t)src[0] << 16 | (uint32_t)src[1] << 8 | src[2];
  515|  49.7k|}
picotls.c:handle_client_handshake_message:
 5349|  29.4k|{
 5350|  29.4k|    uint8_t type = message.base[0];
 5351|  29.4k|    int ret;
 5352|       |
 5353|  29.4k|    switch (tls->state) {
 5354|  2.04k|    case PTLS_STATE_CLIENT_EXPECT_SERVER_HELLO:
  ------------------
  |  Branch (5354:5): [True: 2.04k, False: 27.4k]
  ------------------
 5355|  27.5k|    case PTLS_STATE_CLIENT_EXPECT_SECOND_SERVER_HELLO:
  ------------------
  |  Branch (5355:5): [True: 25.4k, False: 4.00k]
  ------------------
 5356|  27.5k|        if (type == PTLS_HANDSHAKE_TYPE_SERVER_HELLO && is_end_of_record) {
  ------------------
  |  |  253|  55.0k|#define PTLS_HANDSHAKE_TYPE_SERVER_HELLO 2
  ------------------
  |  Branch (5356:13): [True: 27.4k, False: 33]
  |  Branch (5356:57): [True: 27.4k, False: 7]
  ------------------
 5357|  27.4k|            ret = client_handle_hello(tls, emitter, message, properties);
 5358|  27.4k|        } else {
 5359|     40|            ret = PTLS_ALERT_UNEXPECTED_MESSAGE;
  ------------------
  |  |  192|     40|#define PTLS_ALERT_UNEXPECTED_MESSAGE 10
  ------------------
 5360|     40|        }
 5361|  27.5k|        break;
 5362|  1.09k|    case PTLS_STATE_CLIENT_EXPECT_ENCRYPTED_EXTENSIONS:
  ------------------
  |  Branch (5362:5): [True: 1.09k, False: 28.3k]
  ------------------
 5363|  1.09k|        if (type == PTLS_HANDSHAKE_TYPE_ENCRYPTED_EXTENSIONS) {
  ------------------
  |  |  256|  1.09k|#define PTLS_HANDSHAKE_TYPE_ENCRYPTED_EXTENSIONS 8
  ------------------
  |  Branch (5363:13): [True: 1.08k, False: 9]
  ------------------
 5364|  1.08k|            ret = client_handle_encrypted_extensions(tls, message, properties);
 5365|  1.08k|        } else {
 5366|      9|            ret = PTLS_ALERT_UNEXPECTED_MESSAGE;
  ------------------
  |  |  192|      9|#define PTLS_ALERT_UNEXPECTED_MESSAGE 10
  ------------------
 5367|      9|        }
 5368|  1.09k|        break;
 5369|    748|    case PTLS_STATE_CLIENT_EXPECT_CERTIFICATE_REQUEST_OR_CERTIFICATE:
  ------------------
  |  Branch (5369:5): [True: 748, False: 28.7k]
  ------------------
 5370|    748|        if (type == PTLS_HANDSHAKE_TYPE_CERTIFICATE_REQUEST) {
  ------------------
  |  |  258|    748|#define PTLS_HANDSHAKE_TYPE_CERTIFICATE_REQUEST 13
  ------------------
  |  Branch (5370:13): [True: 320, False: 428]
  ------------------
 5371|    320|            ret = client_handle_certificate_request(tls, message, properties);
 5372|    320|            break;
 5373|    320|        }
 5374|       |    /* fall through */
 5375|    431|    case PTLS_STATE_CLIENT_EXPECT_CERTIFICATE:
  ------------------
  |  Branch (5375:5): [True: 3, False: 29.4k]
  ------------------
 5376|    431|        switch (type) {
 5377|    427|        case PTLS_HANDSHAKE_TYPE_CERTIFICATE:
  ------------------
  |  |  257|    427|#define PTLS_HANDSHAKE_TYPE_CERTIFICATE 11
  ------------------
  |  Branch (5377:9): [True: 427, False: 4]
  ------------------
 5378|    427|            ret = client_handle_certificate(tls, message);
 5379|    427|            break;
 5380|      2|        case PTLS_HANDSHAKE_TYPE_COMPRESSED_CERTIFICATE:
  ------------------
  |  |  262|      2|#define PTLS_HANDSHAKE_TYPE_COMPRESSED_CERTIFICATE 25
  ------------------
  |  Branch (5380:9): [True: 2, False: 429]
  ------------------
 5381|      2|            ret = client_handle_compressed_certificate(tls, message);
 5382|      2|            break;
 5383|      2|        default:
  ------------------
  |  Branch (5383:9): [True: 2, False: 429]
  ------------------
 5384|      2|            ret = PTLS_ALERT_UNEXPECTED_MESSAGE;
  ------------------
  |  |  192|      2|#define PTLS_ALERT_UNEXPECTED_MESSAGE 10
  ------------------
 5385|      2|            break;
 5386|    431|        }
 5387|    431|        break;
 5388|    431|    case PTLS_STATE_CLIENT_EXPECT_CERTIFICATE_VERIFY:
  ------------------
  |  Branch (5388:5): [True: 87, False: 29.3k]
  ------------------
 5389|     87|        if (type == PTLS_HANDSHAKE_TYPE_CERTIFICATE_VERIFY) {
  ------------------
  |  |  259|     87|#define PTLS_HANDSHAKE_TYPE_CERTIFICATE_VERIFY 15
  ------------------
  |  Branch (5389:13): [True: 86, False: 1]
  ------------------
 5390|     86|            ret = client_handle_certificate_verify(tls, message);
 5391|     86|        } else {
 5392|      1|            ret = PTLS_ALERT_UNEXPECTED_MESSAGE;
  ------------------
  |  |  192|      1|#define PTLS_ALERT_UNEXPECTED_MESSAGE 10
  ------------------
 5393|      1|        }
 5394|     87|        break;
 5395|     33|    case PTLS_STATE_CLIENT_EXPECT_FINISHED:
  ------------------
  |  Branch (5395:5): [True: 33, False: 29.4k]
  ------------------
 5396|     33|        if (type == PTLS_HANDSHAKE_TYPE_FINISHED && is_end_of_record) {
  ------------------
  |  |  260|     66|#define PTLS_HANDSHAKE_TYPE_FINISHED 20
  ------------------
  |  Branch (5396:13): [True: 13, False: 20]
  |  Branch (5396:53): [True: 12, False: 1]
  ------------------
 5397|     12|            ret = client_handle_finished(tls, emitter, message);
 5398|     21|        } else {
 5399|     21|            ret = PTLS_ALERT_UNEXPECTED_MESSAGE;
  ------------------
  |  |  192|     21|#define PTLS_ALERT_UNEXPECTED_MESSAGE 10
  ------------------
 5400|     21|        }
 5401|     33|        break;
 5402|      0|    case PTLS_STATE_CLIENT_POST_HANDSHAKE:
  ------------------
  |  Branch (5402:5): [True: 0, False: 29.4k]
  ------------------
 5403|      0|        switch (type) {
 5404|      0|        case PTLS_HANDSHAKE_TYPE_NEW_SESSION_TICKET:
  ------------------
  |  |  254|      0|#define PTLS_HANDSHAKE_TYPE_NEW_SESSION_TICKET 4
  ------------------
  |  Branch (5404:9): [True: 0, False: 0]
  ------------------
 5405|      0|            ret = client_handle_new_session_ticket(tls, message);
 5406|      0|            break;
 5407|      0|        case PTLS_HANDSHAKE_TYPE_KEY_UPDATE:
  ------------------
  |  |  261|      0|#define PTLS_HANDSHAKE_TYPE_KEY_UPDATE 24
  ------------------
  |  Branch (5407:9): [True: 0, False: 0]
  ------------------
 5408|      0|            ret = handle_key_update(tls, emitter, message);
 5409|      0|            break;
 5410|      0|        default:
  ------------------
  |  Branch (5410:9): [True: 0, False: 0]
  ------------------
 5411|      0|            ret = PTLS_ALERT_UNEXPECTED_MESSAGE;
  ------------------
  |  |  192|      0|#define PTLS_ALERT_UNEXPECTED_MESSAGE 10
  ------------------
 5412|      0|            break;
 5413|      0|        }
 5414|      0|        break;
 5415|      0|    default:
  ------------------
  |  Branch (5415:5): [True: 0, False: 29.4k]
  ------------------
 5416|      0|        assert(!"unexpected state");
 5417|      0|        ret = PTLS_ALERT_INTERNAL_ERROR;
  ------------------
  |  |  206|      0|#define PTLS_ALERT_INTERNAL_ERROR 80
  ------------------
 5418|      0|        break;
 5419|  29.4k|    }
 5420|       |
 5421|  29.4k|    PTLS_PROBE(RECEIVE_MESSAGE, tls, message.base[0], message.base + PTLS_HANDSHAKE_HEADER_SIZE,
 5422|  29.4k|               message.len - PTLS_HANDSHAKE_HEADER_SIZE, ret);
 5423|  29.4k|    PTLS_LOG_CONN(receive_message, tls, {
  ------------------
  |  | 1262|  29.4k|    do {                                                                                                                           \
  |  | 1263|  29.4k|        ptls_t *_tls = (tls);                                                                                                      \
  |  | 1264|  29.4k|        if (!ptls_log.is_active || ptls_skip_tracing(_tls))                                                                        \
  |  |  ------------------
  |  |  |  Branch (1264:13): [True: 29.4k, False: 0]
  |  |  |  Branch (1264:36): [True: 0, False: 0]
  |  |  ------------------
  |  | 1265|  29.4k|            break;                                                                                                                 \
  |  | 1266|  29.4k|        PTLS_LOG__DO_LOG(picotls, type, {                                                                                          \
  |  |  ------------------
  |  |  |  | 1239|      0|    do {                                                                                                                           \
  |  |  |  | 1240|      0|        int ptlslog_skip = 0;                                                                                                      \
  |  |  |  | 1241|      0|        char smallbuf[128];                                                                                                        \
  |  |  |  | 1242|      0|        ptls_buffer_t ptlslogbuf;                                                                                                  \
  |  |  |  | 1243|      0|        ptls_buffer_init(&ptlslogbuf, smallbuf, sizeof(smallbuf));                                                                 \
  |  |  |  | 1244|      0|        PTLS_LOG__DO_PUSH_SAFESTR("{\"module\":\"" PTLS_TO_STR(module) "\",\"type\":\"" PTLS_TO_STR(type) "\"");                   \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1326|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1327|      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]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1328|      0|            ptlslog_skip = 1;                                                                                                      \
  |  |  |  |  |  | 1329|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1329:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1245|      0|        do {                                                                                                                       \
  |  |  |  | 1246|      0|            block                                                                                                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [True: 0, False: 0]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  |  Branch (1246:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1247|      0|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1247:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1248|      0|        PTLS_LOG__DO_PUSH_SAFESTR("}\n");                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1326|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1327|      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]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1328|      0|            ptlslog_skip = 1;                                                                                                      \
  |  |  |  |  |  | 1329|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1329:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1249|      0|        if (!ptlslog_skip)                                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1249:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1250|      0|            ptls_log__do_write(&ptlslogbuf);                                                                                       \
  |  |  |  | 1251|      0|        ptls_buffer_dispose(&ptlslogbuf);                                                                                          \
  |  |  |  | 1252|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1252:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1267|      0|            PTLS_LOG_ELEMENT_PTR(tls, _tls);                                                                                       \
  |  | 1268|      0|            do {                                                                                                                   \
  |  | 1269|      0|                block                                                                                                              \
  |  | 1270|      0|            } while (0);                                                                                                           \
  |  | 1271|      0|        });                                                                                                                        \
  |  | 1272|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1272:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 5424|  29.4k|        PTLS_LOG_ELEMENT_UNSIGNED(message, message.base[0]);
 5425|  29.4k|        PTLS_LOG_ELEMENT_UNSIGNED(len, message.len - PTLS_HANDSHAKE_HEADER_SIZE);
 5426|  29.4k|        PTLS_LOG_ELEMENT_SIGNED(result, ret);
 5427|  29.4k|    });
 5428|       |
 5429|      0|    return ret;
 5430|  29.4k|}
picotls.c:client_handle_hello:
 2721|  27.4k|{
 2722|  27.4k|    struct st_ptls_server_hello_t sh;
 2723|  27.4k|    ptls_iovec_t ecdh_secret = {NULL};
 2724|  27.4k|    int ret;
 2725|       |
 2726|  27.4k|    if ((ret = decode_server_hello(tls, &sh, message.base + PTLS_HANDSHAKE_HEADER_SIZE, message.base + message.len)) != 0)
  ------------------
  |  |   56|  27.4k|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
  |  Branch (2726:9): [True: 683, False: 26.8k]
  ------------------
 2727|    683|        goto Exit;
 2728|  26.8k|    if (!(sh.legacy_session_id.len == tls->client.legacy_session_id.len &&
  ------------------
  |  Branch (2728:11): [True: 26.7k, False: 6]
  ------------------
 2729|  26.8k|          ptls_mem_equal(sh.legacy_session_id.base, tls->client.legacy_session_id.base, tls->client.legacy_session_id.len))) {
  ------------------
  |  Branch (2729:11): [True: 26.7k, False: 0]
  ------------------
 2730|      6|        ret = PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  200|      6|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 2731|      6|        goto Exit;
 2732|      6|    }
 2733|       |
 2734|  26.7k|    if (sh.is_retry_request) {
  ------------------
  |  Branch (2734:9): [True: 25.6k, False: 1.17k]
  ------------------
 2735|  25.6k|        if ((ret = key_schedule_select_cipher(tls->key_schedule, tls->cipher_suite, 0)) != 0)
  ------------------
  |  Branch (2735:13): [True: 0, False: 25.6k]
  ------------------
 2736|      0|            goto Exit;
 2737|  25.6k|        key_schedule_transform_post_ch1hash(tls->key_schedule);
 2738|  25.6k|        if (tls->ech.aead != NULL) {
  ------------------
  |  Branch (2738:13): [True: 0, False: 25.6k]
  ------------------
 2739|      0|            size_t confirm_hash_off = 0;
 2740|      0|            if (tls->ech.offered) {
  ------------------
  |  Branch (2740:17): [True: 0, False: 0]
  ------------------
 2741|      0|                if (sh.retry_request.ech != NULL)
  ------------------
  |  Branch (2741:21): [True: 0, False: 0]
  ------------------
 2742|      0|                    confirm_hash_off = sh.retry_request.ech - message.base;
 2743|      0|            } else {
 2744|      0|                assert(tls->ech.offered_grease);
 2745|      0|            }
 2746|      0|            if ((ret = client_ech_select_hello(tls, message, confirm_hash_off, ECH_CONFIRMATION_HRR)) != 0)
  ------------------
  |  | 1205|      0|#define ECH_CONFIRMATION_HRR "hrr ech accept confirmation"
  ------------------
  |  Branch (2746:17): [True: 0, False: 0]
  ------------------
 2747|      0|                goto Exit;
 2748|      0|        }
 2749|  25.6k|        ptls__key_schedule_update_hash(tls->key_schedule, message.base, message.len, 0);
 2750|  25.6k|        return handle_hello_retry_request(tls, emitter, &sh, message, properties);
 2751|  25.6k|    }
 2752|       |
 2753|  1.17k|    if ((ret = key_schedule_select_cipher(tls->key_schedule, tls->cipher_suite,
  ------------------
  |  Branch (2753:9): [True: 0, False: 1.17k]
  ------------------
 2754|  1.17k|                                          tls->client.offered_psk && !tls->is_psk_handshake)) != 0)
  ------------------
  |  Branch (2754:43): [True: 0, False: 1.17k]
  |  Branch (2754:70): [True: 0, False: 0]
  ------------------
 2755|      0|        goto Exit;
 2756|       |
 2757|       |    /* check if ECH is accepted */
 2758|  1.17k|    if (tls->ech.aead != NULL) {
  ------------------
  |  Branch (2758:9): [True: 0, False: 1.17k]
  ------------------
 2759|      0|        size_t confirm_hash_off = 0;
 2760|      0|        if (tls->ech.offered) {
  ------------------
  |  Branch (2760:13): [True: 0, False: 0]
  ------------------
 2761|      0|            confirm_hash_off =
 2762|      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;
  ------------------
  |  |   80|      0|#define PTLS_ECH_CONFIRM_LENGTH 8
  ------------------
 2763|      0|        } else {
 2764|      0|            assert(tls->ech.offered_grease);
 2765|      0|        }
 2766|      0|        if ((ret = client_ech_select_hello(tls, message, confirm_hash_off, ECH_CONFIRMATION_SERVER_HELLO)) != 0)
  ------------------
  |  | 1204|      0|#define ECH_CONFIRMATION_SERVER_HELLO "ech accept confirmation"
  ------------------
  |  Branch (2766:13): [True: 0, False: 0]
  ------------------
 2767|      0|            goto Exit;
 2768|      0|    }
 2769|       |
 2770|       |    /* clear sensitive and space-consuming ECH state, now that are done with handling sending and decoding Hellos */
 2771|  1.17k|    clear_ech(&tls->ech, 0);
 2772|  1.17k|    if (tls->key_schedule->hashes[0].ctx_outer != NULL) {
  ------------------
  |  Branch (2772:9): [True: 0, False: 1.17k]
  ------------------
 2773|      0|        tls->key_schedule->hashes[0].ctx_outer->final(tls->key_schedule->hashes[0].ctx_outer, NULL, PTLS_HASH_FINAL_MODE_FREE);
 2774|      0|        tls->key_schedule->hashes[0].ctx_outer = NULL;
 2775|      0|    }
 2776|       |
 2777|  1.17k|    ptls__key_schedule_update_hash(tls->key_schedule, message.base, message.len, 0);
 2778|       |
 2779|  1.17k|    if (sh.peerkey.base != NULL) {
  ------------------
  |  Branch (2779:9): [True: 1.17k, False: 0]
  ------------------
 2780|  1.17k|        if ((ret = tls->client.key_share_ctx->on_exchange(&tls->client.key_share_ctx, 1, &ecdh_secret, sh.peerkey)) != 0)
  ------------------
  |  Branch (2780:13): [True: 2, False: 1.17k]
  ------------------
 2781|      2|            goto Exit;
 2782|  1.17k|    }
 2783|       |
 2784|  1.17k|    if ((ret = key_schedule_extract(tls->key_schedule, ecdh_secret)) != 0)
  ------------------
  |  Branch (2784:9): [True: 0, False: 1.17k]
  ------------------
 2785|      0|        goto Exit;
 2786|  1.17k|    if ((ret = setup_traffic_protection(tls, 0, "s hs traffic", 2, 0)) != 0)
  ------------------
  |  Branch (2786:9): [True: 0, False: 1.17k]
  ------------------
 2787|      0|        goto Exit;
 2788|  1.17k|    if (tls->client.using_early_data) {
  ------------------
  |  Branch (2788:9): [True: 0, False: 1.17k]
  ------------------
 2789|      0|        if ((tls->pending_handshake_secret = malloc(PTLS_MAX_DIGEST_SIZE)) == NULL) {
  ------------------
  |  |  108|      0|#define PTLS_MAX_DIGEST_SIZE 64
  ------------------
  |  Branch (2789:13): [True: 0, False: 0]
  ------------------
 2790|      0|            ret = PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  224|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 2791|      0|            goto Exit;
 2792|      0|        }
 2793|      0|        if ((ret = derive_secret(tls->key_schedule, tls->pending_handshake_secret, "c hs traffic")) != 0)
  ------------------
  |  Branch (2793:13): [True: 0, False: 0]
  ------------------
 2794|      0|            goto Exit;
 2795|      0|        if (tls->ctx->update_traffic_key != NULL &&
  ------------------
  |  Branch (2795:13): [True: 0, False: 0]
  ------------------
 2796|      0|            (ret = tls->ctx->update_traffic_key->cb(tls->ctx->update_traffic_key, tls, 1, 2, tls->pending_handshake_secret)) != 0)
  ------------------
  |  Branch (2796:13): [True: 0, False: 0]
  ------------------
 2797|      0|            goto Exit;
 2798|  1.17k|    } else {
 2799|  1.17k|        if ((ret = setup_traffic_protection(tls, 1, "c hs traffic", 2, 0)) != 0)
  ------------------
  |  Branch (2799:13): [True: 0, False: 1.17k]
  ------------------
 2800|      0|            goto Exit;
 2801|  1.17k|    }
 2802|       |
 2803|  1.17k|    tls->state = PTLS_STATE_CLIENT_EXPECT_ENCRYPTED_EXTENSIONS;
 2804|  1.17k|    ret = PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  225|  1.17k|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  177|  1.17k|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 2805|       |
 2806|  1.86k|Exit:
 2807|  1.86k|    if (ecdh_secret.base != NULL) {
  ------------------
  |  Branch (2807:9): [True: 1.17k, False: 691]
  ------------------
 2808|  1.17k|        ptls_clear_memory(ecdh_secret.base, ecdh_secret.len);
 2809|  1.17k|        free(ecdh_secret.base);
 2810|  1.17k|    }
 2811|  1.86k|    return ret;
 2812|  1.17k|}
picotls.c:decode_server_hello:
 2499|  27.4k|{
 2500|  27.4k|    int ret;
 2501|       |
 2502|  27.4k|    *sh = (struct st_ptls_server_hello_t){{0}};
 2503|       |
 2504|       |    /* ignore legacy-version */
 2505|  27.4k|    if (end - src < 2) {
  ------------------
  |  Branch (2505:9): [True: 9, False: 27.4k]
  ------------------
 2506|      9|        ret = PTLS_ALERT_DECODE_ERROR;
  ------------------
  |  |  203|      9|#define PTLS_ALERT_DECODE_ERROR 50
  ------------------
 2507|      9|        goto Exit;
 2508|      9|    }
 2509|  27.4k|    src += 2;
 2510|       |
 2511|       |    /* random */
 2512|  27.4k|    if (end - src < PTLS_HELLO_RANDOM_SIZE) {
  ------------------
  |  |   74|  27.4k|#define PTLS_HELLO_RANDOM_SIZE 32
  ------------------
  |  Branch (2512:9): [True: 9, False: 27.4k]
  ------------------
 2513|      9|        ret = PTLS_ALERT_DECODE_ERROR;
  ------------------
  |  |  203|      9|#define PTLS_ALERT_DECODE_ERROR 50
  ------------------
 2514|      9|        goto Exit;
 2515|      9|    }
 2516|  27.4k|    sh->is_retry_request = memcmp(src, hello_retry_random, PTLS_HELLO_RANDOM_SIZE) == 0;
  ------------------
  |  |   74|  27.4k|#define PTLS_HELLO_RANDOM_SIZE 32
  ------------------
 2517|  27.4k|    src += PTLS_HELLO_RANDOM_SIZE;
  ------------------
  |  |   74|  27.4k|#define PTLS_HELLO_RANDOM_SIZE 32
  ------------------
 2518|       |
 2519|       |    /* legacy_session_id */
 2520|  27.4k|    ptls_decode_open_block(src, end, 1, {
  ------------------
  |  | 1185|  27.4k|    do {                                                                                                                           \
  |  | 1186|  27.4k|        size_t _capacity = (capacity);                                                                                             \
  |  | 1187|  27.4k|        size_t _block_size;                                                                                                        \
  |  | 1188|  27.4k|        if (_capacity == -1) {                                                                                                     \
  |  |  ------------------
  |  |  |  Branch (1188:13): [True: 0, False: 27.4k]
  |  |  ------------------
  |  | 1189|      0|            uint64_t _block_size64;                                                                                                \
  |  | 1190|      0|            const uint8_t *_src = (src);                                                                                           \
  |  | 1191|      0|            if ((_block_size64 = ptls_decode_quicint(&_src, end)) == UINT64_MAX ||                                                 \
  |  |  ------------------
  |  |  |  Branch (1191:17): [True: 0, False: 0]
  |  |  ------------------
  |  | 1192|      0|                (sizeof(size_t) < 8 && (_block_size64 >> (8 * sizeof(size_t))) != 0)) {                                            \
  |  |  ------------------
  |  |  |  Branch (1192:18): [Folded - Ignored]
  |  |  |  Branch (1192:40): [True: 0, False: 0]
  |  |  ------------------
  |  | 1193|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1194|      0|                goto Exit;                                                                                                         \
  |  | 1195|      0|            }                                                                                                                      \
  |  | 1196|      0|            (src) = _src;                                                                                                          \
  |  | 1197|      0|            _block_size = (size_t)_block_size64;                                                                                   \
  |  | 1198|  27.4k|        } else {                                                                                                                   \
  |  | 1199|  27.4k|            if (_capacity > (size_t)(end - (src))) {                                                                               \
  |  |  ------------------
  |  |  |  Branch (1199:17): [True: 125, False: 27.3k]
  |  |  ------------------
  |  | 1200|    125|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  203|    125|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1201|    125|                goto Exit;                                                                                                         \
  |  | 1202|    125|            }                                                                                                                      \
  |  | 1203|  27.4k|            _block_size = 0;                                                                                                       \
  |  | 1204|  27.3k|            do {                                                                                                                   \
  |  | 1205|  27.3k|                _block_size = _block_size << 8 | *(src)++;                                                                         \
  |  | 1206|  27.3k|            } while (--_capacity != 0);                                                                                            \
  |  |  ------------------
  |  |  |  Branch (1206:22): [True: 0, False: 27.3k]
  |  |  ------------------
  |  | 1207|  27.3k|        }                                                                                                                          \
  |  | 1208|  27.4k|        if (_block_size > (size_t)(end - (src))) {                                                                                 \
  |  |  ------------------
  |  |  |  Branch (1208:13): [True: 15, False: 27.3k]
  |  |  ------------------
  |  | 1209|     15|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  ------------------
  |  |  |  |  203|     15|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1210|     15|            goto Exit;                                                                                                             \
  |  | 1211|     15|        }                                                                                                                          \
  |  | 1212|  27.3k|        do {                                                                                                                       \
  |  | 1213|  27.3k|            const uint8_t *const end = (src) + _block_size;                                                                        \
  |  | 1214|  27.3k|            do {                                                                                                                   \
  |  | 1215|  27.3k|                block                                                                                                              \
  |  |  ------------------
  |  |  |  Branch (1215:17): [True: 9, False: 27.3k]
  |  |  ------------------
  |  | 1216|  27.3k|            } while (0);                                                                                                           \
  |  |  ------------------
  |  |  |  Branch (1216:22): [Folded - Ignored]
  |  |  ------------------
  |  | 1217|  27.3k|            if ((src) != end) {                                                                                                    \
  |  |  ------------------
  |  |  |  Branch (1217:17): [True: 0, False: 27.3k]
  |  |  ------------------
  |  | 1218|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1219|      0|                goto Exit;                                                                                                         \
  |  | 1220|      0|            }                                                                                                                      \
  |  | 1221|  27.3k|        } while (0);                                                                                                               \
  |  |  ------------------
  |  |  |  Branch (1221:18): [Folded - Ignored]
  |  |  ------------------
  |  | 1222|  27.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1222:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2521|  27.4k|        if (end - src > 32) {
 2522|  27.4k|            ret = PTLS_ALERT_DECODE_ERROR;
 2523|  27.4k|            goto Exit;
 2524|  27.4k|        }
 2525|  27.4k|        sh->legacy_session_id = ptls_iovec_init(src, end - src);
 2526|  27.4k|        src = end;
 2527|  27.4k|    });
 2528|       |
 2529|  27.3k|    { /* select cipher_suite */
 2530|  27.3k|        uint16_t csid;
 2531|  27.3k|        if ((ret = ptls_decode16(&csid, &src, end)) != 0)
  ------------------
  |  Branch (2531:13): [True: 10, False: 27.3k]
  ------------------
 2532|     10|            goto Exit;
 2533|  27.3k|        if ((tls->cipher_suite = ptls_find_cipher_suite(tls->ctx->cipher_suites, csid)) == NULL) {
  ------------------
  |  Branch (2533:13): [True: 46, False: 27.2k]
  ------------------
 2534|     46|            ret = PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  200|     46|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 2535|     46|            goto Exit;
 2536|     46|        }
 2537|  27.3k|    }
 2538|       |
 2539|  27.2k|    { /* legacy_compression_method */
 2540|  27.2k|        uint8_t method;
 2541|  27.2k|        if ((ret = ptls_decode8(&method, &src, end)) != 0)
  ------------------
  |  Branch (2541:13): [True: 7, False: 27.2k]
  ------------------
 2542|      7|            goto Exit;
 2543|  27.2k|        if (method != 0) {
  ------------------
  |  Branch (2543:13): [True: 6, False: 27.2k]
  ------------------
 2544|      6|            ret = PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  200|      6|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 2545|      6|            goto Exit;
 2546|      6|        }
 2547|  27.2k|    }
 2548|       |
 2549|  27.2k|    if (sh->is_retry_request)
  ------------------
  |  Branch (2549:9): [True: 25.7k, False: 1.51k]
  ------------------
 2550|  25.7k|        sh->retry_request.selected_group = UINT16_MAX;
 2551|       |
 2552|  27.2k|    uint16_t exttype, found_version = UINT16_MAX, selected_psk_identity = UINT16_MAX;
 2553|  27.2k|    decode_extensions(src, end, sh->is_retry_request ? PTLS_HANDSHAKE_TYPE_PSEUDO_HRR : PTLS_HANDSHAKE_TYPE_SERVER_HELLO, &exttype,
  ------------------
  |  |  891|  27.2k|    do {                                                                                                                           \
  |  |  892|  27.2k|        decode_open_extensions((src), end, hstype, exttype, block);                                                                \
  |  |  ------------------
  |  |  |  |  875|  27.2k|    do {                                                                                                                           \
  |  |  |  |  876|  27.2k|        struct st_ptls_extension_bitmap_t bitmap = {0};                                                                            \
  |  |  |  |  877|  27.2k|        ptls_decode_open_block((src), end, 2, {                                                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1185|  27.2k|    do {                                                                                                                           \
  |  |  |  |  |  | 1186|  27.2k|        size_t _capacity = (capacity);                                                                                             \
  |  |  |  |  |  | 1187|  27.2k|        size_t _block_size;                                                                                                        \
  |  |  |  |  |  | 1188|  27.2k|        if (_capacity == -1) {                                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1188:13): [True: 0, False: 27.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1189|      0|            uint64_t _block_size64;                                                                                                \
  |  |  |  |  |  | 1190|      0|            const uint8_t *_src = (src);                                                                                           \
  |  |  |  |  |  | 1191|      0|            if ((_block_size64 = ptls_decode_quicint(&_src, end)) == UINT64_MAX ||                                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1191:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1192|      0|                (sizeof(size_t) < 8 && (_block_size64 >> (8 * sizeof(size_t))) != 0)) {                                            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1192:18): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1192:40): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1193|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1194|      0|                goto Exit;                                                                                                         \
  |  |  |  |  |  | 1195|      0|            }                                                                                                                      \
  |  |  |  |  |  | 1196|      0|            (src) = _src;                                                                                                          \
  |  |  |  |  |  | 1197|      0|            _block_size = (size_t)_block_size64;                                                                                   \
  |  |  |  |  |  | 1198|  27.2k|        } else {                                                                                                                   \
  |  |  |  |  |  | 1199|  27.2k|            if (_capacity > (size_t)(end - (src))) {                                                                               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1199:17): [True: 3, False: 27.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1200|      3|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  203|      3|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1201|      3|                goto Exit;                                                                                                         \
  |  |  |  |  |  | 1202|      3|            }                                                                                                                      \
  |  |  |  |  |  | 1203|  27.2k|            _block_size = 0;                                                                                                       \
  |  |  |  |  |  | 1204|  54.4k|            do {                                                                                                                   \
  |  |  |  |  |  | 1205|  54.4k|                _block_size = _block_size << 8 | *(src)++;                                                                         \
  |  |  |  |  |  | 1206|  54.4k|            } while (--_capacity != 0);                                                                                            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1206:22): [True: 27.2k, False: 27.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1207|  27.2k|        }                                                                                                                          \
  |  |  |  |  |  | 1208|  27.2k|        if (_block_size > (size_t)(end - (src))) {                                                                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1208:13): [True: 29, False: 27.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1209|     29|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  203|     29|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1210|     29|            goto Exit;                                                                                                             \
  |  |  |  |  |  | 1211|     29|        }                                                                                                                          \
  |  |  |  |  |  | 1212|  27.2k|        do {                                                                                                                       \
  |  |  |  |  |  | 1213|  27.2k|            const uint8_t *const end = (src) + _block_size;                                                                        \
  |  |  |  |  |  | 1214|  27.2k|            do {                                                                                                                   \
  |  |  |  |  |  | 1215|  1.08M|                block                                                                                                              \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1215:17): [True: 4, False: 31.8k]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 28.7k, False: 3.07k]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 33, False: 31.8k]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 83, False: 31.7k]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 31.7k, False: 31.7k]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 31.8k]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 44, False: 31.6k]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 31.6k]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 2, False: 26.8k]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 2, False: 452]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 43, False: 1.19k]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 2, False: 1.19k]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 1.19k]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 18, False: 1.17k]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 454, False: 1.23k]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 1.01k, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 2, False: 1.01k]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 1.01k, False: 1.01k]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 1.01k]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 34, False: 977]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 2, False: 975]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 975]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 17, False: 958]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 32, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 2, False: 30]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 3, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 3]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 3]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 2.08k, False: 29.6k]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 3, False: 31.6k]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 32, False: 31.6k]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 1.01k, False: 30.6k]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 1.69k, False: 29.9k]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 26.8k, False: 4.82k]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 39, False: 31.5k]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 31.8k, False: 26.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1216|  27.2k|            } while (0);                                                                                                           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1216:22): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1217|  27.2k|            if ((src) != end) {                                                                                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1217:17): [True: 0, False: 26.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1218|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1219|      0|                goto Exit;                                                                                                         \
  |  |  |  |  |  | 1220|      0|            }                                                                                                                      \
  |  |  |  |  |  | 1221|  26.8k|        } while (0);                                                                                                               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1221:18): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1222|  27.2k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1222:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  878|  27.2k|            while ((src) != end) {                                                                                                 \
  |  |  |  |  879|  27.2k|                if ((ret = ptls_decode16((exttype), &(src), end)) != 0)                                                            \
  |  |  |  |  880|  27.2k|                    goto Exit;                                                                                                     \
  |  |  |  |  881|  27.2k|                if (!extension_bitmap_testandset(&bitmap, (hstype), *(exttype))) {                                                 \
  |  |  |  |  882|  27.2k|                    ret = PTLS_ALERT_ILLEGAL_PARAMETER;                                                                            \
  |  |  |  |  883|  27.2k|                    goto Exit;                                                                                                     \
  |  |  |  |  884|  27.2k|                }                                                                                                                  \
  |  |  |  |  885|  27.2k|                ptls_decode_open_block((src), end, 2, block);                                                                      \
  |  |  |  |  886|  27.2k|            }                                                                                                                      \
  |  |  |  |  887|  27.2k|        });                                                                                                                        \
  |  |  |  |  888|  27.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (888:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  893|  27.2k|        ptls_decode_assert_block_close((src), end);                                                                                \
  |  |  ------------------
  |  |  |  | 1225|  26.8k|    do {                                                                                                                           \
  |  |  |  | 1226|  26.8k|        if ((src) != end) {                                                                                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1226:13): [True: 4, False: 26.8k]
  |  |  |  |  ------------------
  |  |  |  | 1227|      4|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|      4|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1228|      4|            goto Exit;                                                                                                             \
  |  |  |  | 1229|      4|        }                                                                                                                          \
  |  |  |  | 1230|  26.8k|    } while (0);
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1230:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  894|  26.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (894:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2554|  27.2k|                      {
 2555|  27.2k|                          if (tls->ctx->on_extension != NULL &&
 2556|  27.2k|                              (ret = tls->ctx->on_extension->cb(tls->ctx->on_extension, tls, PTLS_HANDSHAKE_TYPE_SERVER_HELLO,
 2557|  27.2k|                                                                exttype, ptls_iovec_init(src, end - src)) != 0))
 2558|  27.2k|                              goto Exit;
 2559|  27.2k|                          switch (exttype) {
 2560|  27.2k|                          case PTLS_EXTENSION_TYPE_SUPPORTED_VERSIONS:
 2561|  27.2k|                              if ((ret = ptls_decode16(&found_version, &src, end)) != 0)
 2562|  27.2k|                                  goto Exit;
 2563|  27.2k|                              break;
 2564|  27.2k|                          case PTLS_EXTENSION_TYPE_KEY_SHARE:
 2565|  27.2k|                              if (sh->is_retry_request) {
 2566|  27.2k|                                  if ((ret = ptls_decode16(&sh->retry_request.selected_group, &src, end)) != 0)
 2567|  27.2k|                                      goto Exit;
 2568|  27.2k|                              } else {
 2569|  27.2k|                                  uint16_t group;
 2570|  27.2k|                                  if ((ret = decode_key_share_entry(&group, &sh->peerkey, &src, end)) != 0)
 2571|  27.2k|                                      goto Exit;
 2572|  27.2k|                                  if (src != end) {
 2573|  27.2k|                                      ret = PTLS_ALERT_DECODE_ERROR;
 2574|  27.2k|                                      goto Exit;
 2575|  27.2k|                                  }
 2576|  27.2k|                                  if (tls->key_share == NULL || tls->key_share->id != group) {
 2577|  27.2k|                                      ret = PTLS_ALERT_ILLEGAL_PARAMETER;
 2578|  27.2k|                                      goto Exit;
 2579|  27.2k|                                  }
 2580|  27.2k|                              }
 2581|  27.2k|                              break;
 2582|  27.2k|                          case PTLS_EXTENSION_TYPE_COOKIE:
 2583|  27.2k|                              assert(sh->is_retry_request);
 2584|  27.2k|                              ptls_decode_block(src, end, 2, {
 2585|  27.2k|                                  if (src == end) {
 2586|  27.2k|                                      ret = PTLS_ALERT_DECODE_ERROR;
 2587|  27.2k|                                      goto Exit;
 2588|  27.2k|                                  }
 2589|  27.2k|                                  sh->retry_request.cookie = ptls_iovec_init(src, end - src);
 2590|  27.2k|                                  src = end;
 2591|  27.2k|                              });
 2592|  27.2k|                              break;
 2593|  27.2k|                          case PTLS_EXTENSION_TYPE_PRE_SHARED_KEY:
 2594|  27.2k|                              assert(!sh->is_retry_request);
 2595|  27.2k|                              if ((ret = ptls_decode16(&selected_psk_identity, &src, end)) != 0)
 2596|  27.2k|                                  goto Exit;
 2597|  27.2k|                              break;
 2598|  27.2k|                          case PTLS_EXTENSION_TYPE_ENCRYPTED_CLIENT_HELLO:
 2599|  27.2k|                              assert(sh->is_retry_request);
 2600|  27.2k|                              if (!(tls->ech.offered || tls->ech.offered_grease)) {
 2601|  27.2k|                                  ret = PTLS_ALERT_UNSUPPORTED_EXTENSION;
 2602|  27.2k|                                  goto Exit;
 2603|  27.2k|                              }
 2604|  27.2k|                              if (end - src != PTLS_ECH_CONFIRM_LENGTH) {
 2605|  27.2k|                                  ret = PTLS_ALERT_DECODE_ERROR;
 2606|  27.2k|                                  goto Exit;
 2607|  27.2k|                              }
 2608|  27.2k|                              sh->retry_request.ech = src;
 2609|  27.2k|                              src = end;
 2610|  27.2k|                              break;
 2611|  27.2k|                          default:
 2612|  27.2k|                              src = end;
 2613|  27.2k|                              break;
 2614|  27.2k|                          }
 2615|  27.2k|                      });
 2616|       |
 2617|  26.8k|    if (!is_supported_version(found_version)) {
  ------------------
  |  Branch (2617:9): [True: 61, False: 26.8k]
  ------------------
 2618|     61|        ret = PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  200|     61|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 2619|     61|        goto Exit;
 2620|     61|    }
 2621|  26.8k|    if (!sh->is_retry_request) {
  ------------------
  |  Branch (2621:9): [True: 1.19k, False: 25.6k]
  ------------------
 2622|  1.19k|        if (selected_psk_identity != UINT16_MAX) {
  ------------------
  |  Branch (2622:13): [True: 16, False: 1.17k]
  ------------------
 2623|     16|            if (!tls->client.offered_psk) {
  ------------------
  |  Branch (2623:17): [True: 16, False: 0]
  ------------------
 2624|     16|                ret = PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  200|     16|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 2625|     16|                goto Exit;
 2626|     16|            }
 2627|      0|            if (selected_psk_identity != 0) {
  ------------------
  |  Branch (2627:17): [True: 0, False: 0]
  ------------------
 2628|      0|                ret = PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  200|      0|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 2629|      0|                goto Exit;
 2630|      0|            }
 2631|      0|            tls->is_psk_handshake = 1;
 2632|      0|        }
 2633|  1.17k|        if (sh->peerkey.base == NULL && !tls->is_psk_handshake) {
  ------------------
  |  Branch (2633:13): [True: 4, False: 1.17k]
  |  Branch (2633:41): [True: 4, False: 0]
  ------------------
 2634|      4|            ret = PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  200|      4|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 2635|      4|            goto Exit;
 2636|      4|        }
 2637|  1.17k|    }
 2638|       |
 2639|  26.8k|    ret = 0;
 2640|  27.4k|Exit:
 2641|  27.4k|    return ret;
 2642|  26.8k|}
picotls.c:decode_key_share_entry:
 2030|  1.23k|{
 2031|  1.23k|    int ret;
 2032|       |
 2033|  1.23k|    if ((ret = ptls_decode16(group, src, end)) != 0)
  ------------------
  |  Branch (2033:9): [True: 2, False: 1.23k]
  ------------------
 2034|      2|        goto Exit;
 2035|  1.23k|    ptls_decode_open_block(*src, end, 2, {
  ------------------
  |  | 1185|  1.23k|    do {                                                                                                                           \
  |  | 1186|  1.23k|        size_t _capacity = (capacity);                                                                                             \
  |  | 1187|  1.23k|        size_t _block_size;                                                                                                        \
  |  | 1188|  1.23k|        if (_capacity == -1) {                                                                                                     \
  |  |  ------------------
  |  |  |  Branch (1188:13): [True: 0, False: 1.23k]
  |  |  ------------------
  |  | 1189|      0|            uint64_t _block_size64;                                                                                                \
  |  | 1190|      0|            const uint8_t *_src = (src);                                                                                           \
  |  | 1191|      0|            if ((_block_size64 = ptls_decode_quicint(&_src, end)) == UINT64_MAX ||                                                 \
  |  |  ------------------
  |  |  |  Branch (1191:17): [True: 0, False: 0]
  |  |  ------------------
  |  | 1192|      0|                (sizeof(size_t) < 8 && (_block_size64 >> (8 * sizeof(size_t))) != 0)) {                                            \
  |  |  ------------------
  |  |  |  Branch (1192:18): [Folded - Ignored]
  |  |  |  Branch (1192:40): [True: 0, False: 0]
  |  |  ------------------
  |  | 1193|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1194|      0|                goto Exit;                                                                                                         \
  |  | 1195|      0|            }                                                                                                                      \
  |  | 1196|      0|            (src) = _src;                                                                                                          \
  |  | 1197|      0|            _block_size = (size_t)_block_size64;                                                                                   \
  |  | 1198|  1.23k|        } else {                                                                                                                   \
  |  | 1199|  1.23k|            if (_capacity > (size_t)(end - (src))) {                                                                               \
  |  |  ------------------
  |  |  |  Branch (1199:17): [True: 4, False: 1.23k]
  |  |  ------------------
  |  | 1200|      4|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  203|      4|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1201|      4|                goto Exit;                                                                                                         \
  |  | 1202|      4|            }                                                                                                                      \
  |  | 1203|  1.23k|            _block_size = 0;                                                                                                       \
  |  | 1204|  2.46k|            do {                                                                                                                   \
  |  | 1205|  2.46k|                _block_size = _block_size << 8 | *(src)++;                                                                         \
  |  | 1206|  2.46k|            } while (--_capacity != 0);                                                                                            \
  |  |  ------------------
  |  |  |  Branch (1206:22): [True: 1.23k, False: 1.23k]
  |  |  ------------------
  |  | 1207|  1.23k|        }                                                                                                                          \
  |  | 1208|  1.23k|        if (_block_size > (size_t)(end - (src))) {                                                                                 \
  |  |  ------------------
  |  |  |  Branch (1208:13): [True: 37, False: 1.19k]
  |  |  ------------------
  |  | 1209|     37|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  ------------------
  |  |  |  |  203|     37|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1210|     37|            goto Exit;                                                                                                             \
  |  | 1211|     37|        }                                                                                                                          \
  |  | 1212|  1.23k|        do {                                                                                                                       \
  |  | 1213|  1.19k|            const uint8_t *const end = (src) + _block_size;                                                                        \
  |  | 1214|  1.19k|            do {                                                                                                                   \
  |  | 1215|  1.19k|                block                                                                                                              \
  |  | 1216|  1.19k|            } while (0);                                                                                                           \
  |  |  ------------------
  |  |  |  Branch (1216:22): [Folded - Ignored]
  |  |  ------------------
  |  | 1217|  1.19k|            if ((src) != end) {                                                                                                    \
  |  |  ------------------
  |  |  |  Branch (1217:17): [True: 0, False: 1.19k]
  |  |  ------------------
  |  | 1218|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1219|      0|                goto Exit;                                                                                                         \
  |  | 1220|      0|            }                                                                                                                      \
  |  | 1221|  1.19k|        } while (0);                                                                                                               \
  |  |  ------------------
  |  |  |  Branch (1221:18): [Folded - Ignored]
  |  |  ------------------
  |  | 1222|  1.19k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1222:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2036|  1.23k|        *key_exchange = ptls_iovec_init(*src, end - *src);
 2037|  1.23k|        *src = end;
 2038|  1.23k|    });
 2039|       |
 2040|  1.23k|Exit:
 2041|  1.23k|    return ret;
 2042|  1.23k|}
picotls.c:is_supported_version:
  432|  26.8k|{
  433|  26.8k|    size_t i;
  434|  26.9k|    for (i = 0; i != PTLS_ELEMENTSOF(supported_versions); ++i)
  ------------------
  |  |   61|  26.9k|#define PTLS_ELEMENTSOF(x) (PTLS_ASSERT_IS_ARRAY_EXPR(x) * sizeof(x) / sizeof((x)[0]))
  |  |  ------------------
  |  |  |  |   56|  26.9k|#define PTLS_ASSERT_IS_ARRAY_EXPR(a) PTLS_BUILD_ASSERT_EXPR(__builtin_types_compatible_p(__typeof__(a[0])[], __typeof__(a)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  26.9k|#define PTLS_BUILD_ASSERT_EXPR(cond) (sizeof(char[2 * !!(!__builtin_constant_p(cond) || (cond)) - 1]) != 0)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (434:17): [True: 26.8k, False: 61]
  ------------------
  435|  26.8k|        if (supported_versions[i] == v)
  ------------------
  |  Branch (435:13): [True: 26.8k, False: 61]
  ------------------
  436|  26.8k|            return 1;
  437|     61|    return 0;
  438|  26.8k|}
picotls.c:key_schedule_select_cipher:
 1327|  26.7k|{
 1328|  26.7k|    size_t found_slot = SIZE_MAX, i;
 1329|  26.7k|    int ret;
 1330|       |
 1331|  26.7k|    assert(sched->generation == 1);
 1332|       |
 1333|       |    /* find the one, while freeing others */
 1334|  53.5k|    for (i = 0; i != sched->num_hashes; ++i) {
  ------------------
  |  Branch (1334:17): [True: 26.7k, False: 26.7k]
  ------------------
 1335|  26.7k|        if (sched->hashes[i].algo == cs->hash) {
  ------------------
  |  Branch (1335:13): [True: 26.7k, False: 0]
  ------------------
 1336|  26.7k|            assert(found_slot == SIZE_MAX);
 1337|      0|            found_slot = i;
 1338|  26.7k|        } else {
 1339|      0|            sched->hashes[i].ctx->final(sched->hashes[i].ctx, NULL, PTLS_HASH_FINAL_MODE_FREE);
 1340|      0|            if (sched->hashes[i].ctx_outer != NULL)
  ------------------
  |  Branch (1340:17): [True: 0, False: 0]
  ------------------
 1341|      0|                sched->hashes[i].ctx_outer->final(sched->hashes[i].ctx_outer, NULL, PTLS_HASH_FINAL_MODE_FREE);
 1342|      0|        }
 1343|  26.7k|    }
 1344|  26.7k|    if (found_slot != 0) {
  ------------------
  |  Branch (1344:9): [True: 0, False: 26.7k]
  ------------------
 1345|      0|        sched->hashes[0] = sched->hashes[found_slot];
 1346|      0|        reset = 1;
 1347|      0|    }
 1348|  26.7k|    sched->num_hashes = 1;
 1349|       |
 1350|       |    /* recalculate the hash if a different hash as been selected than the one we used for calculating the early secrets */
 1351|  26.7k|    if (reset) {
  ------------------
  |  Branch (1351:9): [True: 0, False: 26.7k]
  ------------------
 1352|      0|        --sched->generation;
 1353|      0|        memset(sched->secret, 0, sizeof(sched->secret));
 1354|      0|        if ((ret = key_schedule_extract(sched, ptls_iovec_init(NULL, 0))) != 0)
  ------------------
  |  Branch (1354:13): [True: 0, False: 0]
  ------------------
 1355|      0|            goto Exit;
 1356|      0|    }
 1357|       |
 1358|  26.7k|    ret = 0;
 1359|  26.7k|Exit:
 1360|  26.7k|    return ret;
 1361|  26.7k|}
picotls.c:key_schedule_transform_post_ch1hash:
 1400|  25.6k|{
 1401|  25.6k|    size_t digest_size = sched->hashes[0].algo->digest_size;
 1402|  25.6k|    ptls_hash_context_t *hashes[3] = {sched->hashes[0].ctx, sched->hashes[0].ctx_outer, NULL};
 1403|  25.6k|    uint8_t ch1hash[PTLS_MAX_DIGEST_SIZE];
 1404|  25.6k|    uint8_t prefix[4] = {PTLS_HANDSHAKE_TYPE_MESSAGE_HASH, 0, 0, (uint8_t)digest_size};
  ------------------
  |  |  263|  25.6k|#define PTLS_HANDSHAKE_TYPE_MESSAGE_HASH 254
  ------------------
 1405|       |
 1406|  51.2k|    for (size_t i = 0; hashes[i] != NULL; ++i) {
  ------------------
  |  Branch (1406:24): [True: 25.6k, False: 25.6k]
  ------------------
 1407|  25.6k|        hashes[i]->final(hashes[i], ch1hash, PTLS_HASH_FINAL_MODE_RESET);
 1408|  25.6k|        hashes[i]->update(hashes[i], prefix, sizeof(prefix));
 1409|  25.6k|        hashes[i]->update(hashes[i], ch1hash, digest_size);
 1410|  25.6k|    }
 1411|       |
 1412|  25.6k|    ptls_clear_memory(ch1hash, sizeof(ch1hash));
 1413|  25.6k|}
picotls.c:handle_hello_retry_request:
 2646|  25.6k|{
 2647|  25.6k|    int ret;
 2648|       |
 2649|  25.6k|    if (tls->client.key_share_ctx != NULL) {
  ------------------
  |  Branch (2649:9): [True: 25.6k, False: 0]
  ------------------
 2650|  25.6k|        tls->client.key_share_ctx->on_exchange(&tls->client.key_share_ctx, 1, NULL, ptls_iovec_init(NULL, 0));
 2651|  25.6k|        tls->client.key_share_ctx = NULL;
 2652|  25.6k|    }
 2653|  25.6k|    if (tls->client.using_early_data) {
  ------------------
  |  Branch (2653:9): [True: 0, False: 25.6k]
  ------------------
 2654|       |        /* release traffic encryption key so that 2nd CH goes out in cleartext, but keep the epoch at 1 since we've already
 2655|       |         * called derive-secret */
 2656|      0|        if (tls->ctx->update_traffic_key == NULL) {
  ------------------
  |  Branch (2656:13): [True: 0, False: 0]
  ------------------
 2657|      0|            assert(tls->traffic_protection.enc.aead != NULL);
 2658|      0|            ptls_aead_free(tls->traffic_protection.enc.aead);
 2659|      0|            tls->traffic_protection.enc.aead = NULL;
 2660|      0|        }
 2661|      0|        tls->client.using_early_data = 0;
 2662|      0|    }
 2663|       |
 2664|  25.6k|    if (sh->retry_request.selected_group != UINT16_MAX) {
  ------------------
  |  Branch (2664:9): [True: 426, False: 25.1k]
  ------------------
 2665|       |        /* we offer the first key_exchanges[0] as KEY_SHARE unless client.negotiate_before_key_exchange is set */
 2666|    426|        ptls_key_exchange_algorithm_t **cand;
 2667|    460|        for (cand = tls->ctx->key_exchanges; *cand != NULL; ++cand)
  ------------------
  |  Branch (2667:46): [True: 426, False: 34]
  ------------------
 2668|    426|            if ((*cand)->id == sh->retry_request.selected_group)
  ------------------
  |  Branch (2668:17): [True: 392, False: 34]
  ------------------
 2669|    392|                break;
 2670|    426|        if (*cand == NULL) {
  ------------------
  |  Branch (2670:13): [True: 34, False: 392]
  ------------------
 2671|     34|            ret = PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  200|     34|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 2672|     34|            goto Exit;
 2673|     34|        }
 2674|    392|        tls->key_share = *cand;
 2675|  25.1k|    } else if (tls->key_share != NULL) {
  ------------------
  |  Branch (2675:16): [True: 25.1k, False: 0]
  ------------------
 2676|       |        /* retain the key-share using in first CH, if server does not specify one */
 2677|  25.1k|    } else {
 2678|      0|        ret = PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  200|      0|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 2679|      0|        goto Exit;
 2680|      0|    }
 2681|       |
 2682|  25.5k|    ret = send_client_hello(tls, emitter, properties, &sh->retry_request.cookie);
 2683|       |
 2684|  25.6k|Exit:
 2685|  25.6k|    return ret;
 2686|  25.5k|}
picotls.c:client_handle_encrypted_extensions:
 2847|  1.08k|{
 2848|  1.08k|    const uint8_t *src = message.base + PTLS_HANDSHAKE_HEADER_SIZE, *const end = message.base + message.len;
  ------------------
  |  |   56|  1.08k|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
 2849|  1.08k|    uint16_t type;
 2850|  1.08k|    static const ptls_raw_extension_t no_unknown_extensions = {UINT16_MAX};
 2851|  1.08k|    ptls_raw_extension_t *unknown_extensions = (ptls_raw_extension_t *)&no_unknown_extensions;
 2852|  1.08k|    int ret, skip_early_data = 1;
 2853|  1.08k|    uint8_t server_offered_cert_type = PTLS_CERTIFICATE_TYPE_X509;
  ------------------
  |  |  266|  1.08k|#define PTLS_CERTIFICATE_TYPE_X509 0
  ------------------
 2854|       |
 2855|  1.08k|    decode_extensions(src, end, PTLS_HANDSHAKE_TYPE_ENCRYPTED_EXTENSIONS, &type, {
  ------------------
  |  |  891|  1.08k|    do {                                                                                                                           \
  |  |  892|  1.08k|        decode_open_extensions((src), end, hstype, exttype, block);                                                                \
  |  |  ------------------
  |  |  |  |  875|  1.08k|    do {                                                                                                                           \
  |  |  |  |  876|  1.08k|        struct st_ptls_extension_bitmap_t bitmap = {0};                                                                            \
  |  |  |  |  877|  1.08k|        ptls_decode_open_block((src), end, 2, {                                                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1185|  1.08k|    do {                                                                                                                           \
  |  |  |  |  |  | 1186|  1.08k|        size_t _capacity = (capacity);                                                                                             \
  |  |  |  |  |  | 1187|  1.08k|        size_t _block_size;                                                                                                        \
  |  |  |  |  |  | 1188|  1.08k|        if (_capacity == -1) {                                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1188:13): [True: 0, False: 1.08k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1189|      0|            uint64_t _block_size64;                                                                                                \
  |  |  |  |  |  | 1190|      0|            const uint8_t *_src = (src);                                                                                           \
  |  |  |  |  |  | 1191|      0|            if ((_block_size64 = ptls_decode_quicint(&_src, end)) == UINT64_MAX ||                                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1191:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1192|      0|                (sizeof(size_t) < 8 && (_block_size64 >> (8 * sizeof(size_t))) != 0)) {                                            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1192:18): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1192:40): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1193|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1194|      0|                goto Exit;                                                                                                         \
  |  |  |  |  |  | 1195|      0|            }                                                                                                                      \
  |  |  |  |  |  | 1196|      0|            (src) = _src;                                                                                                          \
  |  |  |  |  |  | 1197|      0|            _block_size = (size_t)_block_size64;                                                                                   \
  |  |  |  |  |  | 1198|  1.08k|        } else {                                                                                                                   \
  |  |  |  |  |  | 1199|  1.08k|            if (_capacity > (size_t)(end - (src))) {                                                                               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1199:17): [True: 1, False: 1.08k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1200|      1|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  203|      1|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1201|      1|                goto Exit;                                                                                                         \
  |  |  |  |  |  | 1202|      1|            }                                                                                                                      \
  |  |  |  |  |  | 1203|  1.08k|            _block_size = 0;                                                                                                       \
  |  |  |  |  |  | 1204|  2.16k|            do {                                                                                                                   \
  |  |  |  |  |  | 1205|  2.16k|                _block_size = _block_size << 8 | *(src)++;                                                                         \
  |  |  |  |  |  | 1206|  2.16k|            } while (--_capacity != 0);                                                                                            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1206:22): [True: 1.08k, False: 1.08k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1207|  1.08k|        }                                                                                                                          \
  |  |  |  |  |  | 1208|  1.08k|        if (_block_size > (size_t)(end - (src))) {                                                                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1208:13): [True: 19, False: 1.06k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1209|     19|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  203|     19|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1210|     19|            goto Exit;                                                                                                             \
  |  |  |  |  |  | 1211|     19|        }                                                                                                                          \
  |  |  |  |  |  | 1212|  1.08k|        do {                                                                                                                       \
  |  |  |  |  |  | 1213|  1.06k|            const uint8_t *const end = (src) + _block_size;                                                                        \
  |  |  |  |  |  | 1214|  1.06k|            do {                                                                                                                   \
  |  |  |  |  |  | 1215|  20.4k|                block                                                                                                              \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1215:17): [True: 9, False: 655]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 12, False: 643]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 97, False: 546]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 546, False: 546]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 643]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 34, False: 512]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 512]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 3, False: 5]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 5]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 2, False: 83]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 83, False: 83]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 85]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 32, False: 51]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 2, False: 49]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 49]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 51]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 10, False: 39]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 10, False: 29]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 29]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 29]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 21, False: 8]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 8]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 2, False: 6]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 1, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 13, False: 15]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 1]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 1]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 389]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 389, False: 123]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 1, False: 511]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 28, False: 484]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 1, False: 511]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 85, False: 427]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 8, False: 504]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 410]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 664, False: 807]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1216|  1.06k|            } while (0);                                                                                                           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1216:22): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1217|  1.06k|            if ((src) != end) {                                                                                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1217:17): [True: 0, False: 807]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1218|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1219|      0|                goto Exit;                                                                                                         \
  |  |  |  |  |  | 1220|      0|            }                                                                                                                      \
  |  |  |  |  |  | 1221|    807|        } while (0);                                                                                                               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1221:18): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1222|  1.06k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1222:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  878|  1.08k|            while ((src) != end) {                                                                                                 \
  |  |  |  |  879|  1.08k|                if ((ret = ptls_decode16((exttype), &(src), end)) != 0)                                                            \
  |  |  |  |  880|  1.08k|                    goto Exit;                                                                                                     \
  |  |  |  |  881|  1.08k|                if (!extension_bitmap_testandset(&bitmap, (hstype), *(exttype))) {                                                 \
  |  |  |  |  882|  1.08k|                    ret = PTLS_ALERT_ILLEGAL_PARAMETER;                                                                            \
  |  |  |  |  883|  1.08k|                    goto Exit;                                                                                                     \
  |  |  |  |  884|  1.08k|                }                                                                                                                  \
  |  |  |  |  885|  1.08k|                ptls_decode_open_block((src), end, 2, block);                                                                      \
  |  |  |  |  886|  1.08k|            }                                                                                                                      \
  |  |  |  |  887|  1.08k|        });                                                                                                                        \
  |  |  |  |  888|  1.08k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (888:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  893|  1.08k|        ptls_decode_assert_block_close((src), end);                                                                                \
  |  |  ------------------
  |  |  |  | 1225|    807|    do {                                                                                                                           \
  |  |  |  | 1226|    807|        if ((src) != end) {                                                                                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1226:13): [True: 1, False: 806]
  |  |  |  |  ------------------
  |  |  |  | 1227|      1|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|      1|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1228|      1|            goto Exit;                                                                                                             \
  |  |  |  | 1229|      1|        }                                                                                                                          \
  |  |  |  | 1230|    807|    } while (0);
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1230:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  894|    806|    } while (0)
  |  |  ------------------
  |  |  |  Branch (894:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2856|  1.08k|        if (tls->ctx->on_extension != NULL &&
 2857|  1.08k|            (ret = tls->ctx->on_extension->cb(tls->ctx->on_extension, tls, PTLS_HANDSHAKE_TYPE_ENCRYPTED_EXTENSIONS, type,
 2858|  1.08k|                                              ptls_iovec_init(src, end - src)) != 0))
 2859|  1.08k|            goto Exit;
 2860|  1.08k|        switch (type) {
 2861|  1.08k|        case PTLS_EXTENSION_TYPE_SERVER_NAME:
 2862|  1.08k|            if (src != end) {
 2863|  1.08k|                ret = PTLS_ALERT_DECODE_ERROR;
 2864|  1.08k|                goto Exit;
 2865|  1.08k|            }
 2866|  1.08k|            if (!(tls->server_name != NULL && !ptls_server_name_is_ipaddr(tls->server_name))) {
 2867|  1.08k|                ret = PTLS_ALERT_ILLEGAL_PARAMETER;
 2868|  1.08k|                goto Exit;
 2869|  1.08k|            }
 2870|  1.08k|            break;
 2871|  1.08k|        case PTLS_EXTENSION_TYPE_ALPN:
 2872|  1.08k|            ptls_decode_block(src, end, 2, {
 2873|  1.08k|                ptls_decode_open_block(src, end, 1, {
 2874|  1.08k|                    if (src == end) {
 2875|  1.08k|                        ret = PTLS_ALERT_DECODE_ERROR;
 2876|  1.08k|                        goto Exit;
 2877|  1.08k|                    }
 2878|  1.08k|                    if ((ret = ptls_set_negotiated_protocol(tls, (const char *)src, end - src)) != 0)
 2879|  1.08k|                        goto Exit;
 2880|  1.08k|                    src = end;
 2881|  1.08k|                });
 2882|  1.08k|                if (src != end) {
 2883|  1.08k|                    ret = PTLS_ALERT_HANDSHAKE_FAILURE;
 2884|  1.08k|                    goto Exit;
 2885|  1.08k|                }
 2886|  1.08k|            });
 2887|  1.08k|            break;
 2888|  1.08k|        case PTLS_EXTENSION_TYPE_EARLY_DATA:
 2889|  1.08k|            if (!tls->client.using_early_data) {
 2890|  1.08k|                ret = PTLS_ALERT_ILLEGAL_PARAMETER;
 2891|  1.08k|                goto Exit;
 2892|  1.08k|            }
 2893|  1.08k|            skip_early_data = 0;
 2894|  1.08k|            break;
 2895|  1.08k|        case PTLS_EXTENSION_TYPE_SERVER_CERTIFICATE_TYPE:
 2896|  1.08k|            if (end - src != 1) {
 2897|  1.08k|                ret = PTLS_ALERT_DECODE_ERROR;
 2898|  1.08k|                goto Exit;
 2899|  1.08k|            }
 2900|  1.08k|            server_offered_cert_type = *src;
 2901|  1.08k|            src = end;
 2902|  1.08k|            break;
 2903|  1.08k|        case PTLS_EXTENSION_TYPE_ENCRYPTED_CLIENT_HELLO: {
 2904|       |            /* accept retry_configs only if we offered ECH but rejected */
 2905|  1.08k|            if (!((tls->ech.offered || tls->ech.offered_grease) && !ptls_is_ech_handshake(tls, NULL, NULL, NULL))) {
 2906|  1.08k|                ret = PTLS_ALERT_UNSUPPORTED_EXTENSION;
 2907|  1.08k|                goto Exit;
 2908|  1.08k|            }
 2909|       |            /* parse retry_config, and if it is applicable, provide that to the application */
 2910|  1.08k|            struct st_decoded_ech_config_t decoded;
 2911|  1.08k|            if ((ret = client_decode_ech_config_list(tls->ctx, &decoded, ptls_iovec_init(src, end - src))) != 0)
 2912|  1.08k|                goto Exit;
 2913|  1.08k|            if (decoded.kem != NULL && decoded.cipher != NULL && properties != NULL &&
 2914|  1.08k|                properties->client.ech.retry_configs != NULL) {
 2915|  1.08k|                if ((properties->client.ech.retry_configs->base = malloc(end - src)) == NULL) {
 2916|  1.08k|                    ret = PTLS_ERROR_NO_MEMORY;
 2917|  1.08k|                    goto Exit;
 2918|  1.08k|                }
 2919|  1.08k|                memcpy(properties->client.ech.retry_configs->base, src, end - src);
 2920|  1.08k|                properties->client.ech.retry_configs->len = end - src;
 2921|  1.08k|            }
 2922|  1.08k|            src = end;
 2923|  1.08k|        } break;
 2924|  1.08k|        default:
 2925|  1.08k|            if (should_collect_unknown_extension(tls, properties, type)) {
 2926|  1.08k|                if (unknown_extensions == &no_unknown_extensions) {
 2927|  1.08k|                    if ((unknown_extensions = malloc(sizeof(*unknown_extensions) * (MAX_UNKNOWN_EXTENSIONS + 1))) == NULL) {
 2928|  1.08k|                        ret = PTLS_ERROR_NO_MEMORY;
 2929|  1.08k|                        goto Exit;
 2930|  1.08k|                    }
 2931|  1.08k|                    unknown_extensions[0].type = UINT16_MAX;
 2932|  1.08k|                }
 2933|  1.08k|                if ((ret = collect_unknown_extension(tls, type, src, end, unknown_extensions)) != 0)
 2934|  1.08k|                    goto Exit;
 2935|  1.08k|            }
 2936|  1.08k|            break;
 2937|  1.08k|        }
 2938|  1.08k|        src = end;
 2939|  1.08k|    });
 2940|       |
 2941|    806|    if (server_offered_cert_type !=
  ------------------
  |  Branch (2941:9): [True: 11, False: 795]
  ------------------
 2942|    806|        (tls->ctx->use_raw_public_keys ? PTLS_CERTIFICATE_TYPE_RAW_PUBLIC_KEY : PTLS_CERTIFICATE_TYPE_X509)) {
  ------------------
  |  |  267|      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)) {
  ------------------
  |  |  266|    806|#define PTLS_CERTIFICATE_TYPE_X509 0
  ------------------
  |  Branch (2942:10): [True: 0, False: 806]
  ------------------
 2943|     11|        ret = PTLS_ALERT_UNSUPPORTED_CERTIFICATE;
  ------------------
  |  |  196|     11|#define PTLS_ALERT_UNSUPPORTED_CERTIFICATE 43
  ------------------
 2944|     11|        goto Exit;
 2945|     11|    }
 2946|       |
 2947|    795|    if (tls->client.using_early_data) {
  ------------------
  |  Branch (2947:9): [True: 0, False: 795]
  ------------------
 2948|      0|        if (skip_early_data)
  ------------------
  |  Branch (2948:13): [True: 0, False: 0]
  ------------------
 2949|      0|            tls->client.using_early_data = 0;
 2950|      0|        if (properties != NULL)
  ------------------
  |  Branch (2950:13): [True: 0, False: 0]
  ------------------
 2951|      0|            properties->client.early_data_acceptance = skip_early_data ? PTLS_EARLY_DATA_REJECTED : PTLS_EARLY_DATA_ACCEPTED;
  ------------------
  |  Branch (2951:56): [True: 0, False: 0]
  ------------------
 2952|      0|    }
 2953|    795|    if ((ret = report_unknown_extensions(tls, properties, unknown_extensions)) != 0)
  ------------------
  |  Branch (2953:9): [True: 0, False: 795]
  ------------------
 2954|      0|        goto Exit;
 2955|       |
 2956|    795|    ptls__key_schedule_update_hash(tls->key_schedule, message.base, message.len, 0);
 2957|    795|    tls->state =
 2958|    795|        tls->is_psk_handshake ? PTLS_STATE_CLIENT_EXPECT_FINISHED : PTLS_STATE_CLIENT_EXPECT_CERTIFICATE_REQUEST_OR_CERTIFICATE;
  ------------------
  |  Branch (2958:9): [True: 0, False: 795]
  ------------------
 2959|    795|    ret = PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  225|    795|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  177|    795|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 2960|       |
 2961|  1.08k|Exit:
 2962|  1.08k|    if (unknown_extensions != &no_unknown_extensions)
  ------------------
  |  Branch (2962:9): [True: 0, False: 1.08k]
  ------------------
 2963|      0|        free(unknown_extensions);
 2964|  1.08k|    return ret;
 2965|    795|}
picotls.c:should_collect_unknown_extension:
 2815|    389|{
 2816|    389|    return properties != NULL && properties->collect_extension != NULL && properties->collect_extension(tls, properties, type);
  ------------------
  |  Branch (2816:12): [True: 389, False: 0]
  |  Branch (2816:34): [True: 0, False: 389]
  |  Branch (2816:75): [True: 0, False: 0]
  ------------------
 2817|    389|}
picotls.c:report_unknown_extensions:
 2837|    795|{
 2838|    795|    if (properties != NULL && properties->collect_extension != NULL) {
  ------------------
  |  Branch (2838:9): [True: 795, False: 0]
  |  Branch (2838:31): [True: 0, False: 795]
  ------------------
 2839|      0|        assert(properties->collected_extensions != NULL);
 2840|      0|        return properties->collected_extensions(tls, properties, slots);
 2841|    795|    } else {
 2842|    795|        return 0;
 2843|    795|    }
 2844|    795|}
picotls.c:client_handle_certificate_request:
 3130|    320|{
 3131|    320|    const uint8_t *src = message.base + PTLS_HANDSHAKE_HEADER_SIZE, *const end = message.base + message.len;
  ------------------
  |  |   56|    320|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
 3132|    320|    int ret = 0;
 3133|       |
 3134|    320|    assert(!tls->is_psk_handshake && "state machine asserts that this message is never delivered when PSK is used");
 3135|       |
 3136|    320|    if ((ret = decode_certificate_request(tls, &tls->client.certificate_request, src, end)) != 0)
  ------------------
  |  Branch (3136:9): [True: 303, False: 17]
  ------------------
 3137|    303|        return ret;
 3138|       |
 3139|       |    /* This field SHALL be zero length unless used for the post-handshake authentication exchanges (section 4.3.2) */
 3140|     17|    if (tls->client.certificate_request.context.len != 0)
  ------------------
  |  Branch (3140:9): [True: 2, False: 15]
  ------------------
 3141|      2|        return PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  200|      2|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 3142|       |
 3143|     15|    tls->state = PTLS_STATE_CLIENT_EXPECT_CERTIFICATE;
 3144|     15|    ptls__key_schedule_update_hash(tls->key_schedule, message.base, message.len, 0);
 3145|       |
 3146|     15|    return PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  225|     15|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  177|     15|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 3147|     17|}
picotls.c:decode_certificate_request:
 2969|    320|{
 2970|    320|    int ret;
 2971|    320|    uint16_t exttype = 0;
 2972|       |
 2973|       |    /* certificate request context */
 2974|    320|    ptls_decode_open_block(src, end, 1, {
  ------------------
  |  | 1185|    320|    do {                                                                                                                           \
  |  | 1186|    320|        size_t _capacity = (capacity);                                                                                             \
  |  | 1187|    320|        size_t _block_size;                                                                                                        \
  |  | 1188|    320|        if (_capacity == -1) {                                                                                                     \
  |  |  ------------------
  |  |  |  Branch (1188:13): [True: 0, False: 320]
  |  |  ------------------
  |  | 1189|      0|            uint64_t _block_size64;                                                                                                \
  |  | 1190|      0|            const uint8_t *_src = (src);                                                                                           \
  |  | 1191|      0|            if ((_block_size64 = ptls_decode_quicint(&_src, end)) == UINT64_MAX ||                                                 \
  |  |  ------------------
  |  |  |  Branch (1191:17): [True: 0, False: 0]
  |  |  ------------------
  |  | 1192|      0|                (sizeof(size_t) < 8 && (_block_size64 >> (8 * sizeof(size_t))) != 0)) {                                            \
  |  |  ------------------
  |  |  |  Branch (1192:18): [Folded - Ignored]
  |  |  |  Branch (1192:40): [True: 0, False: 0]
  |  |  ------------------
  |  | 1193|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1194|      0|                goto Exit;                                                                                                         \
  |  | 1195|      0|            }                                                                                                                      \
  |  | 1196|      0|            (src) = _src;                                                                                                          \
  |  | 1197|      0|            _block_size = (size_t)_block_size64;                                                                                   \
  |  | 1198|    320|        } else {                                                                                                                   \
  |  | 1199|    320|            if (_capacity > (size_t)(end - (src))) {                                                                               \
  |  |  ------------------
  |  |  |  Branch (1199:17): [True: 1, False: 319]
  |  |  ------------------
  |  | 1200|      1|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  203|      1|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1201|      1|                goto Exit;                                                                                                         \
  |  | 1202|      1|            }                                                                                                                      \
  |  | 1203|    320|            _block_size = 0;                                                                                                       \
  |  | 1204|    319|            do {                                                                                                                   \
  |  | 1205|    319|                _block_size = _block_size << 8 | *(src)++;                                                                         \
  |  | 1206|    319|            } while (--_capacity != 0);                                                                                            \
  |  |  ------------------
  |  |  |  Branch (1206:22): [True: 0, False: 319]
  |  |  ------------------
  |  | 1207|    319|        }                                                                                                                          \
  |  | 1208|    320|        if (_block_size > (size_t)(end - (src))) {                                                                                 \
  |  |  ------------------
  |  |  |  Branch (1208:13): [True: 7, False: 312]
  |  |  ------------------
  |  | 1209|      7|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  ------------------
  |  |  |  |  203|      7|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1210|      7|            goto Exit;                                                                                                             \
  |  | 1211|      7|        }                                                                                                                          \
  |  | 1212|    319|        do {                                                                                                                       \
  |  | 1213|    312|            const uint8_t *const end = (src) + _block_size;                                                                        \
  |  | 1214|    312|            do {                                                                                                                   \
  |  | 1215|  1.24k|                block                                                                                                              \
  |  |  ------------------
  |  |  |  Branch (1215:17): [True: 0, False: 312]
  |  |  |  Branch (1215:17): [True: 50, False: 262]
  |  |  |  Branch (1215:17): [True: 0, False: 312]
  |  |  ------------------
  |  | 1216|    624|            } while (0);                                                                                                           \
  |  |  ------------------
  |  |  |  Branch (1216:22): [Folded - Ignored]
  |  |  ------------------
  |  | 1217|    312|            if ((src) != end) {                                                                                                    \
  |  |  ------------------
  |  |  |  Branch (1217:17): [True: 0, False: 312]
  |  |  ------------------
  |  | 1218|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1219|      0|                goto Exit;                                                                                                         \
  |  | 1220|      0|            }                                                                                                                      \
  |  | 1221|    312|        } while (0);                                                                                                               \
  |  |  ------------------
  |  |  |  Branch (1221:18): [Folded - Ignored]
  |  |  ------------------
  |  | 1222|    312|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1222:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2975|    320|        size_t len = end - src;
 2976|    320|        if (len > 255) {
 2977|    320|            ret = PTLS_ALERT_DECODE_ERROR;
 2978|    320|            goto Exit;
 2979|    320|        }
 2980|    320|        if ((cr->context.base = malloc(len != 0 ? len : 1)) == NULL) {
 2981|    320|            ret = PTLS_ERROR_NO_MEMORY;
 2982|    320|            goto Exit;
 2983|    320|        }
 2984|    320|        cr->context.len = len;
 2985|    320|        memcpy(cr->context.base, src, len);
 2986|    320|        src = end;
 2987|    320|    });
 2988|       |
 2989|       |    /* decode extensions */
 2990|    312|    decode_extensions(src, end, PTLS_HANDSHAKE_TYPE_CERTIFICATE_REQUEST, &exttype, {
  ------------------
  |  |  891|    312|    do {                                                                                                                           \
  |  |  892|    312|        decode_open_extensions((src), end, hstype, exttype, block);                                                                \
  |  |  ------------------
  |  |  |  |  875|    312|    do {                                                                                                                           \
  |  |  |  |  876|    312|        struct st_ptls_extension_bitmap_t bitmap = {0};                                                                            \
  |  |  |  |  877|    312|        ptls_decode_open_block((src), end, 2, {                                                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1185|    312|    do {                                                                                                                           \
  |  |  |  |  |  | 1186|    312|        size_t _capacity = (capacity);                                                                                             \
  |  |  |  |  |  | 1187|    312|        size_t _block_size;                                                                                                        \
  |  |  |  |  |  | 1188|    312|        if (_capacity == -1) {                                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1188:13): [True: 0, False: 312]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1189|      0|            uint64_t _block_size64;                                                                                                \
  |  |  |  |  |  | 1190|      0|            const uint8_t *_src = (src);                                                                                           \
  |  |  |  |  |  | 1191|      0|            if ((_block_size64 = ptls_decode_quicint(&_src, end)) == UINT64_MAX ||                                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1191:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1192|      0|                (sizeof(size_t) < 8 && (_block_size64 >> (8 * sizeof(size_t))) != 0)) {                                            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1192:18): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1192:40): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1193|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1194|      0|                goto Exit;                                                                                                         \
  |  |  |  |  |  | 1195|      0|            }                                                                                                                      \
  |  |  |  |  |  | 1196|      0|            (src) = _src;                                                                                                          \
  |  |  |  |  |  | 1197|      0|            _block_size = (size_t)_block_size64;                                                                                   \
  |  |  |  |  |  | 1198|    312|        } else {                                                                                                                   \
  |  |  |  |  |  | 1199|    312|            if (_capacity > (size_t)(end - (src))) {                                                                               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1199:17): [True: 10, False: 302]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1200|     10|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  203|     10|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1201|     10|                goto Exit;                                                                                                         \
  |  |  |  |  |  | 1202|     10|            }                                                                                                                      \
  |  |  |  |  |  | 1203|    312|            _block_size = 0;                                                                                                       \
  |  |  |  |  |  | 1204|    604|            do {                                                                                                                   \
  |  |  |  |  |  | 1205|    604|                _block_size = _block_size << 8 | *(src)++;                                                                         \
  |  |  |  |  |  | 1206|    604|            } while (--_capacity != 0);                                                                                            \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1206:22): [True: 302, False: 302]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1207|    302|        }                                                                                                                          \
  |  |  |  |  |  | 1208|    312|        if (_block_size > (size_t)(end - (src))) {                                                                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1208:13): [True: 35, False: 267]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1209|     35|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  203|     35|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1210|     35|            goto Exit;                                                                                                             \
  |  |  |  |  |  | 1211|     35|        }                                                                                                                          \
  |  |  |  |  |  | 1212|    302|        do {                                                                                                                       \
  |  |  |  |  |  | 1213|    267|            const uint8_t *const end = (src) + _block_size;                                                                        \
  |  |  |  |  |  | 1214|    267|            do {                                                                                                                   \
  |  |  |  |  |  | 1215|  15.6k|                block                                                                                                              \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1215:17): [True: 8, False: 639]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 30, False: 609]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 90, False: 519]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 519, False: 519]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 609]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 52, False: 467]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 467]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 42, False: 21]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 63, False: 404]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 404, False: 63]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 0, False: 425]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (1215:17): [True: 647, False: 45]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1216|    267|            } while (0);                                                                                                           \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1216:22): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1217|    267|            if ((src) != end) {                                                                                                    \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1217:17): [True: 0, False: 45]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1218|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1219|      0|                goto Exit;                                                                                                         \
  |  |  |  |  |  | 1220|      0|            }                                                                                                                      \
  |  |  |  |  |  | 1221|     45|        } while (0);                                                                                                               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1221:18): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1222|    267|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1222:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  878|    312|            while ((src) != end) {                                                                                                 \
  |  |  |  |  879|    312|                if ((ret = ptls_decode16((exttype), &(src), end)) != 0)                                                            \
  |  |  |  |  880|    312|                    goto Exit;                                                                                                     \
  |  |  |  |  881|    312|                if (!extension_bitmap_testandset(&bitmap, (hstype), *(exttype))) {                                                 \
  |  |  |  |  882|    312|                    ret = PTLS_ALERT_ILLEGAL_PARAMETER;                                                                            \
  |  |  |  |  883|    312|                    goto Exit;                                                                                                     \
  |  |  |  |  884|    312|                }                                                                                                                  \
  |  |  |  |  885|    312|                ptls_decode_open_block((src), end, 2, block);                                                                      \
  |  |  |  |  886|    312|            }                                                                                                                      \
  |  |  |  |  887|    312|        });                                                                                                                        \
  |  |  |  |  888|    312|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (888:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  893|    312|        ptls_decode_assert_block_close((src), end);                                                                                \
  |  |  ------------------
  |  |  |  | 1225|     45|    do {                                                                                                                           \
  |  |  |  | 1226|     45|        if ((src) != end) {                                                                                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1226:13): [True: 5, False: 40]
  |  |  |  |  ------------------
  |  |  |  | 1227|      5|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|      5|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1228|      5|            goto Exit;                                                                                                             \
  |  |  |  | 1229|      5|        }                                                                                                                          \
  |  |  |  | 1230|     45|    } while (0);
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1230:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  894|     40|    } while (0)
  |  |  ------------------
  |  |  |  Branch (894:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2991|    312|        if (tls->ctx->on_extension != NULL &&
 2992|    312|            (ret = tls->ctx->on_extension->cb(tls->ctx->on_extension, tls, PTLS_HANDSHAKE_TYPE_CERTIFICATE_REQUEST, exttype,
 2993|    312|                                              ptls_iovec_init(src, end - src)) != 0))
 2994|    312|            goto Exit;
 2995|    312|        switch (exttype) {
 2996|    312|        case PTLS_EXTENSION_TYPE_SIGNATURE_ALGORITHMS:
 2997|    312|            if ((ret = decode_signature_algorithms(&cr->signature_algorithms, &src, end)) != 0)
 2998|    312|                goto Exit;
 2999|    312|            break;
 3000|    312|        }
 3001|    312|        src = end;
 3002|    312|    });
 3003|       |
 3004|     40|    if (cr->signature_algorithms.count == 0) {
  ------------------
  |  Branch (3004:9): [True: 23, False: 17]
  ------------------
 3005|     23|        ret = PTLS_ALERT_MISSING_EXTENSION;
  ------------------
  |  |  208|     23|#define PTLS_ALERT_MISSING_EXTENSION 109
  ------------------
 3006|     23|        goto Exit;
 3007|     23|    }
 3008|       |
 3009|     17|    ret = 0;
 3010|    320|Exit:
 3011|    320|    return ret;
 3012|     17|}
picotls.c:decode_signature_algorithms:
 1963|     63|{
 1964|     63|    int ret;
 1965|       |
 1966|     63|    ptls_decode_block(*src, end, 2, {
  ------------------
  |  | 1233|     63|    do {                                                                                                                           \
  |  | 1234|     63|        ptls_decode_open_block((src), end, capacity, block);                                                                       \
  |  |  ------------------
  |  |  |  | 1185|     63|    do {                                                                                                                           \
  |  |  |  | 1186|     63|        size_t _capacity = (capacity);                                                                                             \
  |  |  |  | 1187|     63|        size_t _block_size;                                                                                                        \
  |  |  |  | 1188|     63|        if (_capacity == -1) {                                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1188:13): [True: 0, False: 63]
  |  |  |  |  ------------------
  |  |  |  | 1189|      0|            uint64_t _block_size64;                                                                                                \
  |  |  |  | 1190|      0|            const uint8_t *_src = (src);                                                                                           \
  |  |  |  | 1191|      0|            if ((_block_size64 = ptls_decode_quicint(&_src, end)) == UINT64_MAX ||                                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1191:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1192|      0|                (sizeof(size_t) < 8 && (_block_size64 >> (8 * sizeof(size_t))) != 0)) {                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1192:18): [Folded - Ignored]
  |  |  |  |  |  Branch (1192:40): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1193|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1194|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1195|      0|            }                                                                                                                      \
  |  |  |  | 1196|      0|            (src) = _src;                                                                                                          \
  |  |  |  | 1197|      0|            _block_size = (size_t)_block_size64;                                                                                   \
  |  |  |  | 1198|     63|        } else {                                                                                                                   \
  |  |  |  | 1199|     63|            if (_capacity > (size_t)(end - (src))) {                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1199:17): [True: 2, False: 61]
  |  |  |  |  ------------------
  |  |  |  | 1200|      2|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|      2|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1201|      2|                goto Exit;                                                                                                         \
  |  |  |  | 1202|      2|            }                                                                                                                      \
  |  |  |  | 1203|     63|            _block_size = 0;                                                                                                       \
  |  |  |  | 1204|    122|            do {                                                                                                                   \
  |  |  |  | 1205|    122|                _block_size = _block_size << 8 | *(src)++;                                                                         \
  |  |  |  | 1206|    122|            } while (--_capacity != 0);                                                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1206:22): [True: 61, False: 61]
  |  |  |  |  ------------------
  |  |  |  | 1207|     61|        }                                                                                                                          \
  |  |  |  | 1208|     63|        if (_block_size > (size_t)(end - (src))) {                                                                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1208:13): [True: 22, False: 39]
  |  |  |  |  ------------------
  |  |  |  | 1209|     22|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|     22|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1210|     22|            goto Exit;                                                                                                             \
  |  |  |  | 1211|     22|        }                                                                                                                          \
  |  |  |  | 1212|     61|        do {                                                                                                                       \
  |  |  |  | 1213|     39|            const uint8_t *const end = (src) + _block_size;                                                                        \
  |  |  |  | 1214|     39|            do {                                                                                                                   \
  |  |  |  | 1215|  40.3k|                block                                                                                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1215:17): [True: 14, False: 7.98k]
  |  |  |  |  |  Branch (1215:17): [True: 348, False: 7.63k]
  |  |  |  |  |  Branch (1215:17): [True: 7.95k, False: 25]
  |  |  |  |  ------------------
  |  |  |  | 1216|     39|            } while (0);                                                                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1216:22): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1217|     39|            if ((src) != end) {                                                                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1217:17): [True: 0, False: 25]
  |  |  |  |  ------------------
  |  |  |  | 1218|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1219|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1220|      0|            }                                                                                                                      \
  |  |  |  | 1221|     25|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1221:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1222|     39|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1222:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1235|     63|        ptls_decode_assert_block_close((src), end);                                                                                \
  |  |  ------------------
  |  |  |  | 1225|     25|    do {                                                                                                                           \
  |  |  |  | 1226|     25|        if ((src) != end) {                                                                                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1226:13): [True: 4, False: 21]
  |  |  |  |  ------------------
  |  |  |  | 1227|      4|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|      4|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1228|      4|            goto Exit;                                                                                                             \
  |  |  |  | 1229|      4|        }                                                                                                                          \
  |  |  |  | 1230|     25|    } while (0);
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1230:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1236|     21|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1236:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1967|     63|        do {
 1968|     63|            uint16_t id;
 1969|     63|            if ((ret = ptls_decode16(&id, src, end)) != 0)
 1970|     63|                goto Exit;
 1971|     63|            if (sa->count < PTLS_ELEMENTSOF(sa->list))
 1972|     63|                sa->list[sa->count++] = id;
 1973|     63|        } while (*src != end);
 1974|     63|    });
 1975|       |
 1976|     21|    ret = 0;
 1977|     63|Exit:
 1978|     63|    return ret;
 1979|     21|}
picotls.c:client_handle_certificate:
 3214|    427|{
 3215|    427|    int ret;
 3216|       |
 3217|    427|    if ((ret = client_do_handle_certificate(tls, message.base + PTLS_HANDSHAKE_HEADER_SIZE, message.base + message.len)) != 0)
  ------------------
  |  |   56|    427|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
  |  Branch (3217:9): [True: 327, False: 100]
  ------------------
 3218|    327|        return ret;
 3219|       |
 3220|    100|    ptls__key_schedule_update_hash(tls->key_schedule, message.base, message.len, 0);
 3221|       |
 3222|    100|    tls->state = PTLS_STATE_CLIENT_EXPECT_CERTIFICATE_VERIFY;
 3223|    100|    return PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  225|    100|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  177|    100|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 3224|    427|}
picotls.c:client_do_handle_certificate:
 3202|    427|{
 3203|    427|    int got_certs, ret;
 3204|       |
 3205|    427|    if ((ret = handle_certificate(tls, src, end, &got_certs)) != 0)
  ------------------
  |  Branch (3205:9): [True: 326, False: 101]
  ------------------
 3206|    326|        return ret;
 3207|    101|    if (!got_certs)
  ------------------
  |  Branch (3207:9): [True: 1, False: 100]
  ------------------
 3208|      1|        return PTLS_ALERT_ILLEGAL_PARAMETER;
  ------------------
  |  |  200|      1|#define PTLS_ALERT_ILLEGAL_PARAMETER 47
  ------------------
 3209|       |
 3210|    100|    return 0;
 3211|    101|}
picotls.c:handle_certificate:
 3150|    427|{
 3151|    427|    ptls_iovec_t certs[16];
 3152|    427|    size_t num_certs = 0;
 3153|    427|    int ret = 0;
 3154|       |
 3155|       |    /* certificate request context */
 3156|    427|    ptls_decode_open_block(src, end, 1, {
  ------------------
  |  | 1185|    427|    do {                                                                                                                           \
  |  | 1186|    427|        size_t _capacity = (capacity);                                                                                             \
  |  | 1187|    427|        size_t _block_size;                                                                                                        \
  |  | 1188|    427|        if (_capacity == -1) {                                                                                                     \
  |  |  ------------------
  |  |  |  Branch (1188:13): [True: 0, False: 427]
  |  |  ------------------
  |  | 1189|      0|            uint64_t _block_size64;                                                                                                \
  |  | 1190|      0|            const uint8_t *_src = (src);                                                                                           \
  |  | 1191|      0|            if ((_block_size64 = ptls_decode_quicint(&_src, end)) == UINT64_MAX ||                                                 \
  |  |  ------------------
  |  |  |  Branch (1191:17): [True: 0, False: 0]
  |  |  ------------------
  |  | 1192|      0|                (sizeof(size_t) < 8 && (_block_size64 >> (8 * sizeof(size_t))) != 0)) {                                            \
  |  |  ------------------
  |  |  |  Branch (1192:18): [Folded - Ignored]
  |  |  |  Branch (1192:40): [True: 0, False: 0]
  |  |  ------------------
  |  | 1193|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1194|      0|                goto Exit;                                                                                                         \
  |  | 1195|      0|            }                                                                                                                      \
  |  | 1196|      0|            (src) = _src;                                                                                                          \
  |  | 1197|      0|            _block_size = (size_t)_block_size64;                                                                                   \
  |  | 1198|    427|        } else {                                                                                                                   \
  |  | 1199|    427|            if (_capacity > (size_t)(end - (src))) {                                                                               \
  |  |  ------------------
  |  |  |  Branch (1199:17): [True: 2, False: 425]
  |  |  ------------------
  |  | 1200|      2|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  203|      2|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1201|      2|                goto Exit;                                                                                                         \
  |  | 1202|      2|            }                                                                                                                      \
  |  | 1203|    427|            _block_size = 0;                                                                                                       \
  |  | 1204|    425|            do {                                                                                                                   \
  |  | 1205|    425|                _block_size = _block_size << 8 | *(src)++;                                                                         \
  |  | 1206|    425|            } while (--_capacity != 0);                                                                                            \
  |  |  ------------------
  |  |  |  Branch (1206:22): [True: 0, False: 425]
  |  |  ------------------
  |  | 1207|    425|        }                                                                                                                          \
  |  | 1208|    427|        if (_block_size > (size_t)(end - (src))) {                                                                                 \
  |  |  ------------------
  |  |  |  Branch (1208:13): [True: 8, False: 417]
  |  |  ------------------
  |  | 1209|      8|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  ------------------
  |  |  |  |  203|      8|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1210|      8|            goto Exit;                                                                                                             \
  |  | 1211|      8|        }                                                                                                                          \
  |  | 1212|    425|        do {                                                                                                                       \
  |  | 1213|    417|            const uint8_t *const end = (src) + _block_size;                                                                        \
  |  | 1214|    417|            do {                                                                                                                   \
  |  | 1215|    431|                block                                                                                                              \
  |  |  ------------------
  |  |  |  Branch (1215:17): [True: 14, False: 403]
  |  |  ------------------
  |  | 1216|    417|            } while (0);                                                                                                           \
  |  |  ------------------
  |  |  |  Branch (1216:22): [Folded - Ignored]
  |  |  ------------------
  |  | 1217|    417|            if ((src) != end) {                                                                                                    \
  |  |  ------------------
  |  |  |  Branch (1217:17): [True: 0, False: 403]
  |  |  ------------------
  |  | 1218|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  ------------------
  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  ------------------
  |  | 1219|      0|                goto Exit;                                                                                                         \
  |  | 1220|      0|            }                                                                                                                      \
  |  | 1221|    403|        } while (0);                                                                                                               \
  |  |  ------------------
  |  |  |  Branch (1221:18): [Folded - Ignored]
  |  |  ------------------
  |  | 1222|    417|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1222:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3157|    427|        if (src != end) {
 3158|    427|            ret = PTLS_ALERT_ILLEGAL_PARAMETER;
 3159|    427|            goto Exit;
 3160|    427|        }
 3161|    427|    });
 3162|       |    /* certificate_list */
 3163|    403|    ptls_decode_block(src, end, 3, {
  ------------------
  |  | 1233|    403|    do {                                                                                                                           \
  |  | 1234|    403|        ptls_decode_open_block((src), end, capacity, block);                                                                       \
  |  |  ------------------
  |  |  |  | 1185|    403|    do {                                                                                                                           \
  |  |  |  | 1186|    403|        size_t _capacity = (capacity);                                                                                             \
  |  |  |  | 1187|    403|        size_t _block_size;                                                                                                        \
  |  |  |  | 1188|    403|        if (_capacity == -1) {                                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1188:13): [True: 0, False: 403]
  |  |  |  |  ------------------
  |  |  |  | 1189|      0|            uint64_t _block_size64;                                                                                                \
  |  |  |  | 1190|      0|            const uint8_t *_src = (src);                                                                                           \
  |  |  |  | 1191|      0|            if ((_block_size64 = ptls_decode_quicint(&_src, end)) == UINT64_MAX ||                                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1191:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1192|      0|                (sizeof(size_t) < 8 && (_block_size64 >> (8 * sizeof(size_t))) != 0)) {                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1192:18): [Folded - Ignored]
  |  |  |  |  |  Branch (1192:40): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1193|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1194|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1195|      0|            }                                                                                                                      \
  |  |  |  | 1196|      0|            (src) = _src;                                                                                                          \
  |  |  |  | 1197|      0|            _block_size = (size_t)_block_size64;                                                                                   \
  |  |  |  | 1198|    403|        } else {                                                                                                                   \
  |  |  |  | 1199|    403|            if (_capacity > (size_t)(end - (src))) {                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1199:17): [True: 3, False: 400]
  |  |  |  |  ------------------
  |  |  |  | 1200|      3|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|      3|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1201|      3|                goto Exit;                                                                                                         \
  |  |  |  | 1202|      3|            }                                                                                                                      \
  |  |  |  | 1203|    403|            _block_size = 0;                                                                                                       \
  |  |  |  | 1204|  1.20k|            do {                                                                                                                   \
  |  |  |  | 1205|  1.20k|                _block_size = _block_size << 8 | *(src)++;                                                                         \
  |  |  |  | 1206|  1.20k|            } while (--_capacity != 0);                                                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1206:22): [True: 800, False: 400]
  |  |  |  |  ------------------
  |  |  |  | 1207|    400|        }                                                                                                                          \
  |  |  |  | 1208|    403|        if (_block_size > (size_t)(end - (src))) {                                                                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1208:13): [True: 47, False: 353]
  |  |  |  |  ------------------
  |  |  |  | 1209|     47|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|     47|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1210|     47|            goto Exit;                                                                                                             \
  |  |  |  | 1211|     47|        }                                                                                                                          \
  |  |  |  | 1212|    400|        do {                                                                                                                       \
  |  |  |  | 1213|    353|            const uint8_t *const end = (src) + _block_size;                                                                        \
  |  |  |  | 1214|    353|            do {                                                                                                                   \
  |  |  |  | 1215|   100k|                block                                                                                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  Branch (1215:17): [True: 7, False: 1.71k]
  |  |  |  |  |  Branch (1215:17): [True: 3.42k, False: 1.71k]
  |  |  |  |  |  Branch (1215:17): [True: 0, False: 1.71k]
  |  |  |  |  |  Branch (1215:17): [True: 54, False: 1.65k]
  |  |  |  |  |  Branch (1215:17): [True: 676, False: 981]
  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1215:17): [True: 0, False: 1.65k]
  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  Branch (1215:17): [True: 13, False: 1.64k]
  |  |  |  |  |  Branch (1215:17): [True: 1.64k, False: 1.64k]
  |  |  |  |  |  Branch (1215:17): [True: 0, False: 1.65k]
  |  |  |  |  |  Branch (1215:17): [True: 30, False: 1.61k]
  |  |  |  |  |  Branch (1215:17): [True: 6, False: 933]
  |  |  |  |  |  Branch (1215:17): [True: 26, False: 907]
  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  Branch (1215:17): [True: 78, False: 829]
  |  |  |  |  |  Branch (1215:17): [True: 829, False: 829]
  |  |  |  |  |  Branch (1215:17): [True: 0, False: 907]
  |  |  |  |  |  Branch (1215:17): [True: 37, False: 792]
  |  |  |  |  |  Branch (1215:17): [True: 0, False: 792]
  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1215:17): [True: 0, False: 792]
  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1215:17): [True: 939, False: 1.46k]
  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1215:17): [True: 0, False: 1.46k]
  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1215:17): [Folded - Ignored]
  |  |  |  |  |  Branch (1215:17): [True: 1.71k, False: 102]
  |  |  |  |  ------------------
  |  |  |  | 1216|    353|            } while (0);                                                                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1216:22): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1217|    353|            if ((src) != end) {                                                                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1217:17): [True: 0, False: 102]
  |  |  |  |  ------------------
  |  |  |  | 1218|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1219|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1220|      0|            }                                                                                                                      \
  |  |  |  | 1221|    102|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1221:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1222|    353|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1222:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1235|    403|        ptls_decode_assert_block_close((src), end);                                                                                \
  |  |  ------------------
  |  |  |  | 1225|    102|    do {                                                                                                                           \
  |  |  |  | 1226|    102|        if ((src) != end) {                                                                                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1226:13): [True: 1, False: 101]
  |  |  |  |  ------------------
  |  |  |  | 1227|      1|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|      1|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1228|      1|            goto Exit;                                                                                                             \
  |  |  |  | 1229|      1|        }                                                                                                                          \
  |  |  |  | 1230|    102|    } while (0);
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1230:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1236|    101|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1236:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3164|    403|        while (src != end) {
 3165|    403|            ptls_decode_open_block(src, end, 3, {
 3166|    403|                if (num_certs < PTLS_ELEMENTSOF(certs))
 3167|    403|                    certs[num_certs++] = ptls_iovec_init(src, end - src);
 3168|    403|                src = end;
 3169|    403|            });
 3170|    403|            uint16_t type;
 3171|    403|            decode_open_extensions(src, end, PTLS_HANDSHAKE_TYPE_CERTIFICATE, &type, {
 3172|    403|                if (tls->ctx->on_extension != NULL &&
 3173|    403|                    (ret = tls->ctx->on_extension->cb(tls->ctx->on_extension, tls, PTLS_HANDSHAKE_TYPE_CERTIFICATE, type,
 3174|    403|                                                      ptls_iovec_init(src, end - src)) != 0))
 3175|    403|                    goto Exit;
 3176|    403|                src = end;
 3177|    403|            });
 3178|    403|        }
 3179|    403|    });
 3180|       |
 3181|    101|    if (tls->ctx->verify_certificate != NULL) {
  ------------------
  |  Branch (3181:9): [True: 0, False: 101]
  ------------------
 3182|      0|        const char *server_name = NULL;
 3183|      0|        if (!ptls_is_server(tls)) {
  ------------------
  |  Branch (3183:13): [True: 0, False: 0]
  ------------------
 3184|      0|            if (tls->ech.offered && !ptls_is_ech_handshake(tls, NULL, NULL, NULL)) {
  ------------------
  |  Branch (3184:17): [True: 0, False: 0]
  |  Branch (3184:37): [True: 0, False: 0]
  ------------------
 3185|      0|                server_name = tls->ech.client.public_name;
 3186|      0|            } else {
 3187|      0|                server_name = tls->server_name;
 3188|      0|            }
 3189|      0|        }
 3190|      0|        if ((ret = tls->ctx->verify_certificate->cb(tls->ctx->verify_certificate, tls, server_name, &tls->certificate_verify.cb,
  ------------------
  |  Branch (3190:13): [True: 0, False: 0]
  ------------------
 3191|      0|                                                    &tls->certificate_verify.verify_ctx, certs, num_certs)) != 0)
 3192|      0|            goto Exit;
 3193|      0|    }
 3194|       |
 3195|    101|    *got_certs = num_certs != 0;
 3196|       |
 3197|    427|Exit:
 3198|    427|    return ret;
 3199|    101|}
picotls.c:client_handle_compressed_certificate:
 3227|      2|{
 3228|      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
  ------------------
 3229|      2|    uint16_t algo;
 3230|      2|    uint32_t uncompressed_size;
 3231|      2|    uint8_t *uncompressed = NULL;
 3232|      2|    int ret;
 3233|       |
 3234|      2|    if (tls->ctx->decompress_certificate == NULL) {
  ------------------
  |  Branch (3234:9): [True: 2, False: 0]
  ------------------
 3235|      2|        ret = PTLS_ALERT_UNEXPECTED_MESSAGE;
  ------------------
  |  |  192|      2|#define PTLS_ALERT_UNEXPECTED_MESSAGE 10
  ------------------
 3236|      2|        goto Exit;
 3237|      2|    }
 3238|       |
 3239|       |    /* decode */
 3240|      0|    if ((ret = ptls_decode16(&algo, &src, end)) != 0)
  ------------------
  |  Branch (3240:9): [True: 0, False: 0]
  ------------------
 3241|      0|        goto Exit;
 3242|      0|    if ((ret = ptls_decode24(&uncompressed_size, &src, end)) != 0)
  ------------------
  |  Branch (3242:9): [True: 0, False: 0]
  ------------------
 3243|      0|        goto Exit;
 3244|      0|    if (uncompressed_size > 65536) { /* TODO find a sensible number */
  ------------------
  |  Branch (3244:9): [True: 0, False: 0]
  ------------------
 3245|      0|        ret = PTLS_ALERT_BAD_CERTIFICATE;
  ------------------
  |  |  195|      0|#define PTLS_ALERT_BAD_CERTIFICATE 42
  ------------------
 3246|      0|        goto Exit;
 3247|      0|    }
 3248|      0|    if ((uncompressed = malloc(uncompressed_size)) == NULL) {
  ------------------
  |  Branch (3248:9): [True: 0, False: 0]
  ------------------
 3249|      0|        ret = PTLS_ERROR_NO_MEMORY;
  ------------------
  |  |  224|      0|#define PTLS_ERROR_NO_MEMORY (PTLS_ERROR_CLASS_INTERNAL + 1)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 3250|      0|        goto Exit;
 3251|      0|    }
 3252|      0|    ptls_decode_block(src, end, 3, {
  ------------------
  |  | 1233|      0|    do {                                                                                                                           \
  |  | 1234|      0|        ptls_decode_open_block((src), end, capacity, block);                                                                       \
  |  |  ------------------
  |  |  |  | 1185|      0|    do {                                                                                                                           \
  |  |  |  | 1186|      0|        size_t _capacity = (capacity);                                                                                             \
  |  |  |  | 1187|      0|        size_t _block_size;                                                                                                        \
  |  |  |  | 1188|      0|        if (_capacity == -1) {                                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1188:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1189|      0|            uint64_t _block_size64;                                                                                                \
  |  |  |  | 1190|      0|            const uint8_t *_src = (src);                                                                                           \
  |  |  |  | 1191|      0|            if ((_block_size64 = ptls_decode_quicint(&_src, end)) == UINT64_MAX ||                                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1191:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1192|      0|                (sizeof(size_t) < 8 && (_block_size64 >> (8 * sizeof(size_t))) != 0)) {                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1192:18): [Folded - Ignored]
  |  |  |  |  |  Branch (1192:40): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1193|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1194|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1195|      0|            }                                                                                                                      \
  |  |  |  | 1196|      0|            (src) = _src;                                                                                                          \
  |  |  |  | 1197|      0|            _block_size = (size_t)_block_size64;                                                                                   \
  |  |  |  | 1198|      0|        } else {                                                                                                                   \
  |  |  |  | 1199|      0|            if (_capacity > (size_t)(end - (src))) {                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1199:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1200|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1201|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1202|      0|            }                                                                                                                      \
  |  |  |  | 1203|      0|            _block_size = 0;                                                                                                       \
  |  |  |  | 1204|      0|            do {                                                                                                                   \
  |  |  |  | 1205|      0|                _block_size = _block_size << 8 | *(src)++;                                                                         \
  |  |  |  | 1206|      0|            } while (--_capacity != 0);                                                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1206:22): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1207|      0|        }                                                                                                                          \
  |  |  |  | 1208|      0|        if (_block_size > (size_t)(end - (src))) {                                                                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1208:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1209|      0|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1210|      0|            goto Exit;                                                                                                             \
  |  |  |  | 1211|      0|        }                                                                                                                          \
  |  |  |  | 1212|      0|        do {                                                                                                                       \
  |  |  |  | 1213|      0|            const uint8_t *const end = (src) + _block_size;                                                                        \
  |  |  |  | 1214|      0|            do {                                                                                                                   \
  |  |  |  | 1215|      0|                block                                                                                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1215:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1216|      0|            } while (0);                                                                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1216:22): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1217|      0|            if ((src) != end) {                                                                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1217:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1218|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1219|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1220|      0|            }                                                                                                                      \
  |  |  |  | 1221|      0|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1221:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1222|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1222:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1235|      0|        ptls_decode_assert_block_close((src), end);                                                                                \
  |  |  ------------------
  |  |  |  | 1225|      0|    do {                                                                                                                           \
  |  |  |  | 1226|      0|        if ((src) != end) {                                                                                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1226:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1227|      0|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1228|      0|            goto Exit;                                                                                                             \
  |  |  |  | 1229|      0|        }                                                                                                                          \
  |  |  |  | 1230|      0|    } while (0);
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1230:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1236|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1236:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3253|      0|        if ((ret = tls->ctx->decompress_certificate->cb(tls->ctx->decompress_certificate, tls, algo,
 3254|      0|                                                        ptls_iovec_init(uncompressed, uncompressed_size),
 3255|      0|                                                        ptls_iovec_init(src, end - src))) != 0)
 3256|      0|            goto Exit;
 3257|      0|        src = end;
 3258|      0|    });
 3259|       |
 3260|       |    /* handle */
 3261|      0|    if ((ret = client_do_handle_certificate(tls, uncompressed, uncompressed + uncompressed_size)) != 0)
  ------------------
  |  Branch (3261:9): [True: 0, False: 0]
  ------------------
 3262|      0|        goto Exit;
 3263|       |
 3264|      0|    ptls__key_schedule_update_hash(tls->key_schedule, message.base, message.len, 0);
 3265|      0|    tls->state = PTLS_STATE_CLIENT_EXPECT_CERTIFICATE_VERIFY;
 3266|      0|    ret = PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  225|      0|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  177|      0|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 3267|       |
 3268|      2|Exit:
 3269|      2|    free(uncompressed);
 3270|      2|    return ret;
 3271|      0|}
picotls.c:client_handle_certificate_verify:
 3329|     86|{
 3330|     86|    int ret = handle_certificate_verify(tls, message, PTLS_SERVER_CERTIFICATE_VERIFY_CONTEXT_STRING);
  ------------------
  |  |   84|     86|#define PTLS_SERVER_CERTIFICATE_VERIFY_CONTEXT_STRING "TLS 1.3, server CertificateVerify"
  ------------------
 3331|       |
 3332|     86|    if (ret == 0) {
  ------------------
  |  Branch (3332:9): [True: 39, False: 47]
  ------------------
 3333|     39|        tls->state = PTLS_STATE_CLIENT_EXPECT_FINISHED;
 3334|     39|        ret = PTLS_ERROR_IN_PROGRESS;
  ------------------
  |  |  225|     39|#define PTLS_ERROR_IN_PROGRESS (PTLS_ERROR_CLASS_INTERNAL + 2)
  |  |  ------------------
  |  |  |  |  177|     39|#define PTLS_ERROR_CLASS_INTERNAL 0x200
  |  |  ------------------
  ------------------
 3335|     39|    }
 3336|       |
 3337|     86|    return ret;
 3338|     86|}
picotls.c:handle_certificate_verify:
 3293|     86|{
 3294|     86|    const uint8_t *src = message.base + PTLS_HANDSHAKE_HEADER_SIZE, *const end = message.base + message.len;
  ------------------
  |  |   56|     86|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
 3295|     86|    uint16_t algo;
 3296|     86|    ptls_iovec_t signature;
 3297|     86|    uint8_t signdata[PTLS_MAX_CERTIFICATE_VERIFY_SIGNDATA_SIZE];
 3298|     86|    size_t signdata_size;
 3299|     86|    int ret;
 3300|       |
 3301|       |    /* decode */
 3302|     86|    if ((ret = ptls_decode16(&algo, &src, end)) != 0)
  ------------------
  |  Branch (3302:9): [True: 1, False: 85]
  ------------------
 3303|      1|        goto Exit;
 3304|     85|    ptls_decode_block(src, end, 2, {
  ------------------
  |  | 1233|     85|    do {                                                                                                                           \
  |  | 1234|     85|        ptls_decode_open_block((src), end, capacity, block);                                                                       \
  |  |  ------------------
  |  |  |  | 1185|     85|    do {                                                                                                                           \
  |  |  |  | 1186|     85|        size_t _capacity = (capacity);                                                                                             \
  |  |  |  | 1187|     85|        size_t _block_size;                                                                                                        \
  |  |  |  | 1188|     85|        if (_capacity == -1) {                                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1188:13): [True: 0, False: 85]
  |  |  |  |  ------------------
  |  |  |  | 1189|      0|            uint64_t _block_size64;                                                                                                \
  |  |  |  | 1190|      0|            const uint8_t *_src = (src);                                                                                           \
  |  |  |  | 1191|      0|            if ((_block_size64 = ptls_decode_quicint(&_src, end)) == UINT64_MAX ||                                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1191:17): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1192|      0|                (sizeof(size_t) < 8 && (_block_size64 >> (8 * sizeof(size_t))) != 0)) {                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1192:18): [Folded - Ignored]
  |  |  |  |  |  Branch (1192:40): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1193|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1194|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1195|      0|            }                                                                                                                      \
  |  |  |  | 1196|      0|            (src) = _src;                                                                                                          \
  |  |  |  | 1197|      0|            _block_size = (size_t)_block_size64;                                                                                   \
  |  |  |  | 1198|     85|        } else {                                                                                                                   \
  |  |  |  | 1199|     85|            if (_capacity > (size_t)(end - (src))) {                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1199:17): [True: 2, False: 83]
  |  |  |  |  ------------------
  |  |  |  | 1200|      2|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|      2|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1201|      2|                goto Exit;                                                                                                         \
  |  |  |  | 1202|      2|            }                                                                                                                      \
  |  |  |  | 1203|     85|            _block_size = 0;                                                                                                       \
  |  |  |  | 1204|    166|            do {                                                                                                                   \
  |  |  |  | 1205|    166|                _block_size = _block_size << 8 | *(src)++;                                                                         \
  |  |  |  | 1206|    166|            } while (--_capacity != 0);                                                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1206:22): [True: 83, False: 83]
  |  |  |  |  ------------------
  |  |  |  | 1207|     83|        }                                                                                                                          \
  |  |  |  | 1208|     85|        if (_block_size > (size_t)(end - (src))) {                                                                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1208:13): [True: 40, False: 43]
  |  |  |  |  ------------------
  |  |  |  | 1209|     40|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|     40|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1210|     40|            goto Exit;                                                                                                             \
  |  |  |  | 1211|     40|        }                                                                                                                          \
  |  |  |  | 1212|     83|        do {                                                                                                                       \
  |  |  |  | 1213|     43|            const uint8_t *const end = (src) + _block_size;                                                                        \
  |  |  |  | 1214|     43|            do {                                                                                                                   \
  |  |  |  | 1215|     43|                block                                                                                                              \
  |  |  |  | 1216|     43|            } while (0);                                                                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1216:22): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1217|     43|            if ((src) != end) {                                                                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1217:17): [True: 0, False: 43]
  |  |  |  |  ------------------
  |  |  |  | 1218|      0|                ret = PTLS_ALERT_DECODE_ERROR;                                                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|      0|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1219|      0|                goto Exit;                                                                                                         \
  |  |  |  | 1220|      0|            }                                                                                                                      \
  |  |  |  | 1221|     43|        } while (0);                                                                                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1221:18): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1222|     43|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1222:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1235|     85|        ptls_decode_assert_block_close((src), end);                                                                                \
  |  |  ------------------
  |  |  |  | 1225|     43|    do {                                                                                                                           \
  |  |  |  | 1226|     43|        if ((src) != end) {                                                                                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1226:13): [True: 4, False: 39]
  |  |  |  |  ------------------
  |  |  |  | 1227|      4|            ret = PTLS_ALERT_DECODE_ERROR;                                                                                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |  203|      4|#define PTLS_ALERT_DECODE_ERROR 50
  |  |  |  |  ------------------
  |  |  |  | 1228|      4|            goto Exit;                                                                                                             \
  |  |  |  | 1229|      4|        }                                                                                                                          \
  |  |  |  | 1230|     43|    } while (0);
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1230:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1236|     39|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1236:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3305|     85|        signature = ptls_iovec_init(src, end - src);
 3306|     85|        src = end;
 3307|     85|    });
 3308|       |
 3309|     39|    signdata_size = build_certificate_verify_signdata(signdata, tls->key_schedule, context_string);
 3310|     39|    if (tls->certificate_verify.cb != NULL) {
  ------------------
  |  Branch (3310:9): [True: 0, False: 39]
  ------------------
 3311|      0|        ret = tls->certificate_verify.cb(tls->certificate_verify.verify_ctx, algo, ptls_iovec_init(signdata, signdata_size),
 3312|      0|                                         signature);
 3313|     39|    } else {
 3314|     39|        ret = 0;
 3315|     39|    }
 3316|     39|    ptls_clear_memory(signdata, signdata_size);
 3317|     39|    tls->certificate_verify.cb = NULL;
 3318|     39|    if (ret != 0) {
  ------------------
  |  Branch (3318:9): [True: 0, False: 39]
  ------------------
 3319|      0|        goto Exit;
 3320|      0|    }
 3321|       |
 3322|     39|    ptls__key_schedule_update_hash(tls->key_schedule, message.base, message.len, 0);
 3323|       |
 3324|     86|Exit:
 3325|     86|    return ret;
 3326|     39|}
picotls.c:client_handle_finished:
 3353|     12|{
 3354|     12|    uint8_t send_secret[PTLS_MAX_DIGEST_SIZE];
 3355|     12|    int alert_ech_required = tls->ech.offered && !ptls_is_ech_handshake(tls, NULL, NULL, NULL), ret;
  ------------------
  |  Branch (3355:30): [True: 0, False: 12]
  |  Branch (3355:50): [True: 0, False: 0]
  ------------------
 3356|       |
 3357|     12|    if ((ret = verify_finished(tls, message)) != 0)
  ------------------
  |  Branch (3357:9): [True: 12, False: 0]
  ------------------
 3358|     12|        goto Exit;
 3359|      0|    ptls__key_schedule_update_hash(tls->key_schedule, message.base, message.len, 0);
 3360|       |
 3361|       |    /* update traffic keys by using messages upto ServerFinished, but commission them after sending ClientFinished */
 3362|      0|    if ((ret = key_schedule_extract(tls->key_schedule, ptls_iovec_init(NULL, 0))) != 0)
  ------------------
  |  Branch (3362:9): [True: 0, False: 0]
  ------------------
 3363|      0|        goto Exit;
 3364|      0|    if ((ret = setup_traffic_protection(tls, 0, "s ap traffic", 3, 0)) != 0)
  ------------------
  |  Branch (3364:9): [True: 0, False: 0]
  ------------------
 3365|      0|        goto Exit;
 3366|      0|    if ((ret = derive_secret(tls->key_schedule, send_secret, "c ap traffic")) != 0)
  ------------------
  |  Branch (3366:9): [True: 0, False: 0]
  ------------------
 3367|      0|        goto Exit;
 3368|      0|    if ((ret = derive_exporter_secret(tls, 0)) != 0)
  ------------------
  |  Branch (3368:9): [True: 0, False: 0]
  ------------------
 3369|      0|        goto Exit;
 3370|       |
 3371|       |    /* if sending early data, emit EOED and commision the client handshake traffic secret */
 3372|      0|    if (tls->pending_handshake_secret != NULL) {
  ------------------
  |  Branch (3372:9): [True: 0, False: 0]
  ------------------
 3373|      0|        assert(tls->traffic_protection.enc.aead != NULL || tls->ctx->update_traffic_key != NULL);
 3374|      0|        if (tls->client.using_early_data && !tls->ctx->omit_end_of_early_data)
  ------------------
  |  Branch (3374:13): [True: 0, False: 0]
  |  Branch (3374:45): [True: 0, False: 0]
  ------------------
 3375|      0|            ptls_push_message(emitter, tls->key_schedule, PTLS_HANDSHAKE_TYPE_END_OF_EARLY_DATA, {});
  ------------------
  |  | 1168|      0|    do {                                                                                                                           \
  |  | 1169|      0|        ptls_message_emitter_t *_emitter = (emitter);                                                                              \
  |  | 1170|      0|        if ((ret = _emitter->begin_message(_emitter)) != 0)                                                                        \
  |  |  ------------------
  |  |  |  Branch (1170:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1171|      0|            goto Exit;                                                                                                             \
  |  | 1172|      0|        ptls_buffer_push_message_body(_emitter->buf, (key_sched), (type), block);                                                  \
  |  |  ------------------
  |  |  |  | 1157|      0|    do {                                                                                                                           \
  |  |  |  | 1158|      0|        ptls_buffer_t *_buf = (buf);                                                                                               \
  |  |  |  | 1159|      0|        ptls_key_schedule_t *_key_sched = (key_sched);                                                                             \
  |  |  |  | 1160|      0|        size_t mess_start = _buf->off;                                                                                             \
  |  |  |  | 1161|      0|        ptls_buffer_push(_buf, (type));                                                                                            \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1078|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1079|      0|        if ((ret = ptls_buffer__do_pushv((buf), (uint8_t[]){__VA_ARGS__}, sizeof((uint8_t[]){__VA_ARGS__}))) != 0)                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1079:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1080|      0|            goto Exit;                                                                                                             \
  |  |  |  |  |  | 1081|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1081:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1162|      0|        ptls_buffer_push_block(_buf, 3, block);                                                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1117|      0|    do {                                                                                                                           \
  |  |  |  |  |  | 1118|      0|        size_t capacity = (_capacity);                                                                                             \
  |  |  |  |  |  | 1119|      0|        ptls_buffer_pushv((buf), (uint8_t *)"\0\0\0\0\0\0\0", capacity != -1 ? capacity : 1);                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1072|      0|    do {                                                                                                                           \
  |  |  |  |  |  |  |  | 1073|      0|        if ((ret = ptls_buffer__do_pushv((buf), (src), (len))) != 0)                                                               \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (1073:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (1073:57): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1074|      0|            goto Exit;                                                                                                             \
  |  |  |  |  |  |  |  | 1075|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (1075:14): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1120|      0|        size_t body_start = (buf)->off;                                                                                            \
  |  |  |  |  |  | 1121|      0|        do {                                                                                                                       \
  |  |  |  |  |  | 1122|      0|            block                                                                                                                  \
  |  |  |  |  |  | 1123|      0|        } while (0);                                                                                                               \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1123:18): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1124|      0|        size_t body_size = (buf)->off - body_start;                                                                                \
  |  |  |  |  |  | 1125|      0|        if (capacity != -1) {                                                                                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1125:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1126|      0|            for (; capacity != 0; --capacity)                                                                                      \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1126:20): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1127|      0|                (buf)->base[body_start - capacity] = (uint8_t)(body_size >> (8 * (capacity - 1)));                                 \
  |  |  |  |  |  | 1128|      0|        } else {                                                                                                                   \
  |  |  |  |  |  | 1129|      0|            if ((ret = ptls_buffer__adjust_quic_blocksize((buf), body_size)) != 0)                                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1129:17): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1130|      0|                goto Exit;                                                                                                         \
  |  |  |  |  |  | 1131|      0|        }                                                                                                                          \
  |  |  |  |  |  | 1132|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1132:14): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1163|      0|        if (_key_sched != NULL)                                                                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1163:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1164|      0|            ptls__key_schedule_update_hash(_key_sched, _buf->base + mess_start, _buf->off - mess_start, 0);                        \
  |  |  |  | 1165|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1165:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1173|      0|        if ((ret = _emitter->commit_message(_emitter)) != 0)                                                                       \
  |  |  ------------------
  |  |  |  Branch (1173:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1174|      0|            goto Exit;                                                                                                             \
  |  | 1175|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1175:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3376|      0|        tls->client.using_early_data = 0;
 3377|      0|        if ((ret = commission_handshake_secret(tls)) != 0)
  ------------------
  |  Branch (3377:13): [True: 0, False: 0]
  ------------------
 3378|      0|            goto Exit;
 3379|      0|    }
 3380|       |
 3381|      0|    if ((ret = push_change_cipher_spec(tls, emitter)) != 0)
  ------------------
  |  Branch (3381:9): [True: 0, False: 0]
  ------------------
 3382|      0|        goto Exit;
 3383|       |
 3384|      0|    if (!alert_ech_required && tls->client.certificate_request.context.base != NULL) {
  ------------------
  |  Branch (3384:9): [True: 0, False: 0]
  |  Branch (3384:32): [True: 0, False: 0]
  ------------------
 3385|      0|        if ((ret = send_certificate(tls, emitter, &tls->client.certificate_request.signature_algorithms,
  ------------------
  |  Branch (3385:13): [True: 0, False: 0]
  ------------------
 3386|      0|                                    tls->client.certificate_request.context, 0, NULL, 0)) == 0)
 3387|      0|            ret = send_certificate_verify(tls, emitter, &tls->client.certificate_request.signature_algorithms,
 3388|      0|                                          PTLS_CLIENT_CERTIFICATE_VERIFY_CONTEXT_STRING);
  ------------------
  |  |   85|      0|#define PTLS_CLIENT_CERTIFICATE_VERIFY_CONTEXT_STRING "TLS 1.3, client CertificateVerify"
  ------------------
 3389|      0|        free(tls->client.certificate_request.context.base);
 3390|      0|        tls->client.certificate_request.context = ptls_iovec_init(NULL, 0);
 3391|      0|        if (ret != 0)
  ------------------
  |  Branch (3391:13): [True: 0, False: 0]
  ------------------
 3392|      0|            goto Exit;
 3393|      0|    }
 3394|       |
 3395|      0|    ret = send_finished(tls, emitter);
 3396|       |
 3397|      0|    memcpy(tls->traffic_protection.enc.secret, send_secret, sizeof(send_secret));
 3398|      0|    if ((ret = setup_traffic_protection(tls, 1, NULL, 3, 0)) != 0)
  ------------------
  |  Branch (3398:9): [True: 0, False: 0]
  ------------------
 3399|      0|        goto Exit;
 3400|       |
 3401|      0|    tls->state = PTLS_STATE_CLIENT_POST_HANDSHAKE;
 3402|       |
 3403|       |    /* if ECH was rejected, close the connection with ECH_REQUIRED alert after verifying messages up to Finished */
 3404|      0|    if (alert_ech_required)
  ------------------
  |  Branch (3404:9): [True: 0, False: 0]
  ------------------
 3405|      0|        ret = PTLS_ALERT_ECH_REQUIRED;
  ------------------
  |  |  213|      0|#define PTLS_ALERT_ECH_REQUIRED 121
  ------------------
 3406|       |
 3407|     12|Exit:
 3408|     12|    ptls_clear_memory(send_secret, sizeof(send_secret));
 3409|     12|    return ret;
 3410|      0|}
picotls.c:verify_finished:
 1800|     12|{
 1801|     12|    uint8_t verify_data[PTLS_MAX_DIGEST_SIZE];
 1802|     12|    int ret;
 1803|       |
 1804|     12|    if (PTLS_HANDSHAKE_HEADER_SIZE + tls->key_schedule->hashes[0].algo->digest_size != message.len) {
  ------------------
  |  |   56|     12|#define PTLS_HANDSHAKE_HEADER_SIZE 4
  ------------------
  |  Branch (1804:9): [True: 1, False: 11]
  ------------------
 1805|      1|        ret = PTLS_ALERT_DECODE_ERROR;
  ------------------
  |  |  203|      1|#define PTLS_ALERT_DECODE_ERROR 50
  ------------------
 1806|      1|        goto Exit;
 1807|      1|    }
 1808|       |
 1809|     11|    if ((ret = calc_verify_data(verify_data, tls->key_schedule, tls->traffic_protection.dec.secret)) != 0)
  ------------------
  |  Branch (1809:9): [True: 0, False: 11]
  ------------------
 1810|      0|        goto Exit;
 1811|     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 (1811:9): [True: 11, False: 0]
  ------------------
 1812|     11|        ret = PTLS_ALERT_HANDSHAKE_FAILURE;
  ------------------
  |  |  194|     11|#define PTLS_ALERT_HANDSHAKE_FAILURE 40
  ------------------
 1813|     11|        goto Exit;
 1814|     11|    }
 1815|       |
 1816|     12|Exit:
 1817|     12|    ptls_clear_memory(verify_data, sizeof(verify_data));
 1818|     12|    return ret;
 1819|     11|}

