ossl_err_load_ASN1_strings:
  210|      2|{
  211|      2|#ifndef OPENSSL_NO_ERR
  212|      2|    if (ERR_reason_error_string(ASN1_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (212:9): [True: 2, False: 0]
  ------------------
  213|      2|        ERR_load_strings_const(ASN1_str_reasons);
  214|      2|#endif
  215|      2|    return 1;
  216|      2|}

ossl_err_load_ASYNC_strings:
   31|      2|{
   32|      2|#ifndef OPENSSL_NO_ERR
   33|      2|    if (ERR_reason_error_string(ASYNC_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (33:9): [True: 2, False: 0]
  ------------------
   34|      2|        ERR_load_strings_const(ASYNC_str_reasons);
   35|      2|#endif
   36|      2|    return 1;
   37|      2|}

ossl_err_load_BIO_strings:
   93|      2|{
   94|      2|#ifndef OPENSSL_NO_ERR
   95|      2|    if (ERR_reason_error_string(BIO_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (95:9): [True: 2, False: 0]
  ------------------
   96|      2|        ERR_load_strings_const(BIO_str_reasons);
   97|      2|#endif
   98|      2|    return 1;
   99|      2|}

BIO_new_ex:
   82|  3.63k|{
   83|  3.63k|    BIO *bio = OPENSSL_zalloc(sizeof(*bio));
  ------------------
  |  |  104|  3.63k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.63k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.63k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   84|       |
   85|  3.63k|    if (bio == NULL)
  ------------------
  |  Branch (85:9): [True: 0, False: 3.63k]
  ------------------
   86|      0|        return NULL;
   87|       |
   88|  3.63k|    bio->libctx = libctx;
   89|  3.63k|    bio->method = method;
   90|  3.63k|    bio->shutdown = 1;
   91|       |
   92|  3.63k|    if (!CRYPTO_NEW_REF(&bio->references, 1))
  ------------------
  |  Branch (92:9): [True: 0, False: 3.63k]
  ------------------
   93|      0|        goto err;
   94|       |
   95|  3.63k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data))
  ------------------
  |  |  241|  3.63k|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  |  Branch (95:9): [True: 0, False: 3.63k]
  ------------------
   96|      0|        goto err;
   97|       |
   98|  3.63k|    if (method->create != NULL && !method->create(bio)) {
  ------------------
  |  Branch (98:9): [True: 3.63k, False: 0]
  |  Branch (98:35): [True: 0, False: 3.63k]
  ------------------
   99|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_INIT_FAIL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  100|      0|        CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data);
  ------------------
  |  |  241|      0|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  101|      0|        goto err;
  102|      0|    }
  103|  3.63k|    if (method->create == NULL)
  ------------------
  |  Branch (103:9): [True: 0, False: 3.63k]
  ------------------
  104|      0|        bio->init = 1;
  105|       |
  106|  3.63k|    return bio;
  107|       |
  108|      0|err:
  109|      0|    CRYPTO_FREE_REF(&bio->references);
  110|      0|    OPENSSL_free(bio);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  111|      0|    return NULL;
  112|  3.63k|}
BIO_new:
  115|  3.63k|{
  116|  3.63k|    return BIO_new_ex(NULL, method);
  117|  3.63k|}
BIO_free:
  120|  3.64k|{
  121|  3.64k|    int ret;
  122|       |
  123|  3.64k|    if (a == NULL)
  ------------------
  |  Branch (123:9): [True: 6, False: 3.63k]
  ------------------
  124|      6|        return 0;
  125|       |
  126|  3.63k|    if (CRYPTO_DOWN_REF(&a->references, &ret) <= 0)
  ------------------
  |  Branch (126:9): [True: 0, False: 3.63k]
  ------------------
  127|      0|        return 0;
  128|       |
  129|  3.63k|    REF_PRINT_COUNT("BIO", ret, a);
  ------------------
  |  |  301|  3.63k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  3.63k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|  3.63k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  3.63k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  130|  3.63k|    if (ret > 0)
  ------------------
  |  Branch (130:9): [True: 0, False: 3.63k]
  ------------------
  131|      0|        return 1;
  132|  3.63k|    REF_ASSERT_ISNT(ret < 0);
  ------------------
  |  |  293|  3.63k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 3.63k]
  |  |  ------------------
  ------------------
  133|       |
  134|  3.63k|    if (HAS_CALLBACK(a)) {
  ------------------
  |  |   26|  3.63k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 3.63k]
  |  |  |  Branch (26:52): [True: 0, False: 3.63k]
  |  |  ------------------
  ------------------
  135|      0|        ret = (int)bio_call_callback(a, BIO_CB_FREE, NULL, 0, 0, 0L, 1L, NULL);
  ------------------
  |  |  289|      0|# define BIO_CB_FREE        0x01
  ------------------
  136|      0|        if (ret <= 0)
  ------------------
  |  Branch (136:13): [True: 0, False: 0]
  ------------------
  137|      0|            return 0;
  138|      0|    }
  139|       |
  140|  3.63k|    if ((a->method != NULL) && (a->method->destroy != NULL))
  ------------------
  |  Branch (140:9): [True: 3.63k, False: 0]
  |  Branch (140:32): [True: 3.63k, False: 0]
  ------------------
  141|  3.63k|        a->method->destroy(a);
  142|       |
  143|  3.63k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data);
  ------------------
  |  |  241|  3.63k|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  144|       |
  145|  3.63k|    CRYPTO_FREE_REF(&a->references);
  146|       |
  147|  3.63k|    OPENSSL_free(a);
  ------------------
  |  |  115|  3.63k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.63k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.63k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  148|       |
  149|  3.63k|    return 1;
  150|  3.63k|}
BIO_clear_flags:
  200|  1.04M|{
  201|  1.04M|    b->flags &= ~flags;
  202|  1.04M|}
BIO_read:
  304|    210|{
  305|    210|    size_t readbytes;
  306|    210|    int ret;
  307|       |
  308|    210|    if (dlen < 0)
  ------------------
  |  Branch (308:9): [True: 0, False: 210]
  ------------------
  309|      0|        return 0;
  310|       |
  311|    210|    ret = bio_read_intern(b, data, (size_t)dlen, &readbytes);
  312|       |
  313|    210|    if (ret > 0) {
  ------------------
  |  Branch (313:9): [True: 210, False: 0]
  ------------------
  314|       |        /* *readbytes should always be <= dlen */
  315|    210|        ret = (int)readbytes;
  316|    210|    }
  317|       |
  318|    210|    return ret;
  319|    210|}
BIO_write:
  371|  1.70k|{
  372|  1.70k|    size_t written;
  373|  1.70k|    int ret;
  374|       |
  375|  1.70k|    if (dlen <= 0)
  ------------------
  |  Branch (375:9): [True: 279, False: 1.42k]
  ------------------
  376|    279|        return 0;
  377|       |
  378|  1.42k|    ret = bio_write_intern(b, data, (size_t)dlen, &written);
  379|       |
  380|  1.42k|    if (ret > 0) {
  ------------------
  |  Branch (380:9): [True: 1.42k, False: 0]
  ------------------
  381|       |        /* written should always be <= dlen */
  382|  1.42k|        ret = (int)written;
  383|  1.42k|    }
  384|       |
  385|  1.42k|    return ret;
  386|  1.70k|}
BIO_puts:
  499|   291k|{
  500|   291k|    int ret;
  501|   291k|    size_t written = 0;
  502|       |
  503|   291k|    if (b == NULL) {
  ------------------
  |  Branch (503:9): [True: 0, False: 291k]
  ------------------
  504|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  505|      0|        return -1;
  506|      0|    }
  507|   291k|    if (b->method == NULL || b->method->bputs == NULL) {
  ------------------
  |  Branch (507:9): [True: 0, False: 291k]
  |  Branch (507:30): [True: 0, False: 291k]
  ------------------
  508|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  509|      0|        return -2;
  510|      0|    }
  511|       |
  512|   291k|    if (HAS_CALLBACK(b)) {
  ------------------
  |  |   26|   291k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 291k]
  |  |  |  Branch (26:52): [True: 0, False: 291k]
  |  |  ------------------
  ------------------
  513|      0|        ret = (int)bio_call_callback(b, BIO_CB_PUTS, buf, 0, 0, 0L, 1L, NULL);
  ------------------
  |  |  292|      0|# define BIO_CB_PUTS        0x04
  ------------------
  514|      0|        if (ret <= 0)
  ------------------
  |  Branch (514:13): [True: 0, False: 0]
  ------------------
  515|      0|            return ret;
  516|      0|    }
  517|       |
  518|   291k|    if (!b->init) {
  ------------------
  |  Branch (518:9): [True: 0, False: 291k]
  ------------------
  519|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNINITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  520|      0|        return -1;
  521|      0|    }
  522|       |
  523|   291k|    ret = b->method->bputs(b, buf);
  524|       |
  525|   291k|    if (ret > 0) {
  ------------------
  |  Branch (525:9): [True: 291k, False: 471]
  ------------------
  526|   291k|        b->num_write += (uint64_t)ret;
  527|   291k|        written = ret;
  528|   291k|        ret = 1;
  529|   291k|    }
  530|       |
  531|   291k|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|   291k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 291k]
  |  |  |  Branch (26:52): [True: 0, False: 291k]
  |  |  ------------------
  ------------------
  532|      0|        ret = (int)bio_call_callback(b, BIO_CB_PUTS | BIO_CB_RETURN, buf, 0, 0,
  ------------------
  |  |  292|      0|# define BIO_CB_PUTS        0x04
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_PUTS | BIO_CB_RETURN, buf, 0, 0,
  ------------------
  |  |  302|      0|# define BIO_CB_RETURN   0x80
  ------------------
  533|      0|                                     0L, ret, &written);
  534|       |
  535|   291k|    if (ret > 0) {
  ------------------
  |  Branch (535:9): [True: 291k, False: 471]
  ------------------
  536|   291k|        if (written > INT_MAX) {
  ------------------
  |  Branch (536:13): [True: 0, False: 291k]
  ------------------
  537|      0|            ERR_raise(ERR_LIB_BIO, BIO_R_LENGTH_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  538|      0|            ret = -1;
  539|   291k|        } else {
  540|   291k|            ret = (int)written;
  541|   291k|        }
  542|   291k|    }
  543|       |
  544|   291k|    return ret;
  545|   291k|}
BIO_gets:
  548|   374k|{
  549|   374k|    int ret;
  550|   374k|    size_t readbytes = 0;
  551|       |
  552|   374k|    if (b == NULL) {
  ------------------
  |  Branch (552:9): [True: 0, False: 374k]
  ------------------
  553|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  554|      0|        return -1;
  555|      0|    }
  556|   374k|    if (b->method == NULL || b->method->bgets == NULL) {
  ------------------
  |  Branch (556:9): [True: 0, False: 374k]
  |  Branch (556:30): [True: 0, False: 374k]
  ------------------
  557|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  558|      0|        return -2;
  559|      0|    }
  560|       |
  561|   374k|    if (size < 0) {
  ------------------
  |  Branch (561:9): [True: 0, False: 374k]
  ------------------
  562|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  563|      0|        return -1;
  564|      0|    }
  565|       |
  566|   374k|    if (HAS_CALLBACK(b)) {
  ------------------
  |  |   26|   374k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 374k]
  |  |  |  Branch (26:52): [True: 0, False: 374k]
  |  |  ------------------
  ------------------
  567|      0|        ret = (int)bio_call_callback(b, BIO_CB_GETS, buf, size, 0, 0L, 1, NULL);
  ------------------
  |  |  293|      0|# define BIO_CB_GETS        0x05
  ------------------
  568|      0|        if (ret <= 0)
  ------------------
  |  Branch (568:13): [True: 0, False: 0]
  ------------------
  569|      0|            return ret;
  570|      0|    }
  571|       |
  572|   374k|    if (!b->init) {
  ------------------
  |  Branch (572:9): [True: 0, False: 374k]
  ------------------
  573|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNINITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  574|      0|        return -1;
  575|      0|    }
  576|       |
  577|   374k|    ret = b->method->bgets(b, buf, size);
  578|       |
  579|   374k|    if (ret > 0) {
  ------------------
  |  Branch (579:9): [True: 373k, False: 717]
  ------------------
  580|   373k|        readbytes = ret;
  581|   373k|        ret = 1;
  582|   373k|    }
  583|       |
  584|   374k|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|   374k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 374k]
  |  |  |  Branch (26:52): [True: 0, False: 374k]
  |  |  ------------------
  ------------------
  585|      0|        ret = (int)bio_call_callback(b, BIO_CB_GETS | BIO_CB_RETURN, buf, size,
  ------------------
  |  |  293|      0|# define BIO_CB_GETS        0x05
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_GETS | BIO_CB_RETURN, buf, size,
  ------------------
  |  |  302|      0|# define BIO_CB_RETURN   0x80
  ------------------
  586|      0|                                     0, 0L, ret, &readbytes);
  587|       |
  588|   374k|    if (ret > 0) {
  ------------------
  |  Branch (588:9): [True: 373k, False: 717]
  ------------------
  589|       |        /* Shouldn't happen */
  590|   373k|        if (readbytes > (size_t)size)
  ------------------
  |  Branch (590:13): [True: 0, False: 373k]
  ------------------
  591|      0|            ret = -1;
  592|   373k|        else
  593|   373k|            ret = (int)readbytes;
  594|   373k|    }
  595|       |
  596|   374k|    return ret;
  597|   374k|}
BIO_ctrl:
  661|    432|{
  662|    432|    long ret;
  663|       |
  664|    432|    if (b == NULL)
  ------------------
  |  Branch (664:9): [True: 0, False: 432]
  ------------------
  665|      0|        return -1;
  666|    432|    if (b->method == NULL || b->method->ctrl == NULL) {
  ------------------
  |  Branch (666:9): [True: 0, False: 432]
  |  Branch (666:30): [True: 0, False: 432]
  ------------------
  667|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  668|      0|        return -2;
  669|      0|    }
  670|       |
  671|    432|    if (HAS_CALLBACK(b)) {
  ------------------
  |  |   26|    432|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 432]
  |  |  |  Branch (26:52): [True: 0, False: 432]
  |  |  ------------------
  ------------------
  672|      0|        ret = bio_call_callback(b, BIO_CB_CTRL, parg, 0, cmd, larg, 1L, NULL);
  ------------------
  |  |  294|      0|# define BIO_CB_CTRL        0x06
  ------------------
  673|      0|        if (ret <= 0)
  ------------------
  |  Branch (673:13): [True: 0, False: 0]
  ------------------
  674|      0|            return ret;
  675|      0|    }
  676|       |
  677|    432|    ret = b->method->ctrl(b, cmd, larg, parg);
  678|       |
  679|    432|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|    432|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 432]
  |  |  |  Branch (26:52): [True: 0, False: 432]
  |  |  ------------------
  ------------------
  680|      0|        ret = bio_call_callback(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, 0, cmd,
  ------------------
  |  |  294|      0|# define BIO_CB_CTRL        0x06
  ------------------
                      ret = bio_call_callback(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, 0, cmd,
  ------------------
  |  |  302|      0|# define BIO_CB_RETURN   0x80
  ------------------
  681|      0|                                larg, ret, NULL);
  682|       |
  683|    432|    return ret;
  684|    432|}
bio_cleanup:
  947|      2|{
  948|      2|#ifndef OPENSSL_NO_SOCK
  949|      2|    bio_sock_cleanup_int();
  950|      2|    CRYPTO_THREAD_lock_free(bio_lookup_lock);
  951|      2|    bio_lookup_lock = NULL;
  952|      2|#endif
  953|      2|    CRYPTO_FREE_REF(&bio_type_count);
  954|      2|}
bio_lib.c:bio_read_intern:
  263|    210|{
  264|    210|    int ret;
  265|       |
  266|    210|    if (b == NULL) {
  ------------------
  |  Branch (266:9): [True: 0, False: 210]
  ------------------
  267|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  268|      0|        return -1;
  269|      0|    }
  270|    210|    if (b->method == NULL || b->method->bread == NULL) {
  ------------------
  |  Branch (270:9): [True: 0, False: 210]
  |  Branch (270:30): [True: 0, False: 210]
  ------------------
  271|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|        return -2;
  273|      0|    }
  274|       |
  275|    210|    if (HAS_CALLBACK(b) &&
  ------------------
  |  |   26|    420|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 210]
  |  |  |  Branch (26:52): [True: 0, False: 210]
  |  |  ------------------
  ------------------
  276|    210|        ((ret = (int)bio_call_callback(b, BIO_CB_READ, data, dlen, 0, 0L, 1L,
  ------------------
  |  |  290|      0|# define BIO_CB_READ        0x02
  ------------------
  |  Branch (276:9): [True: 0, False: 0]
  ------------------
  277|      0|                                       NULL)) <= 0))
  278|      0|        return ret;
  279|       |
  280|    210|    if (!b->init) {
  ------------------
  |  Branch (280:9): [True: 0, False: 210]
  ------------------
  281|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNINITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  282|      0|        return -1;
  283|      0|    }
  284|       |
  285|    210|    ret = b->method->bread(b, data, dlen, readbytes);
  286|       |
  287|    210|    if (ret > 0)
  ------------------
  |  Branch (287:9): [True: 210, False: 0]
  ------------------
  288|    210|        b->num_read += (uint64_t)*readbytes;
  289|       |
  290|    210|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|    210|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 210]
  |  |  |  Branch (26:52): [True: 0, False: 210]
  |  |  ------------------
  ------------------
  291|      0|        ret = (int)bio_call_callback(b, BIO_CB_READ | BIO_CB_RETURN, data,
  ------------------
  |  |  290|      0|# define BIO_CB_READ        0x02
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_READ | BIO_CB_RETURN, data,
  ------------------
  |  |  302|      0|# define BIO_CB_RETURN   0x80
  ------------------
  292|      0|                                     dlen, 0, 0L, ret, readbytes);
  293|       |
  294|       |    /* Shouldn't happen */
  295|    210|    if (ret > 0 && *readbytes > dlen) {
  ------------------
  |  Branch (295:9): [True: 210, False: 0]
  |  Branch (295:20): [True: 0, False: 210]
  ------------------
  296|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  297|      0|        return -1;
  298|      0|    }
  299|       |
  300|    210|    return ret;
  301|    210|}
bio_lib.c:bio_write_intern:
  328|  1.42k|{
  329|  1.42k|    size_t local_written;
  330|  1.42k|    int ret;
  331|       |
  332|  1.42k|    if (written != NULL)
  ------------------
  |  Branch (332:9): [True: 1.42k, False: 0]
  ------------------
  333|  1.42k|        *written = 0;
  334|       |    /*
  335|       |     * b == NULL is not an error but just means that zero bytes are written.
  336|       |     * Do not raise an error here.
  337|       |     */
  338|  1.42k|    if (b == NULL)
  ------------------
  |  Branch (338:9): [True: 0, False: 1.42k]
  ------------------
  339|      0|        return 0;
  340|       |
  341|  1.42k|    if (b->method == NULL || b->method->bwrite == NULL) {
  ------------------
  |  Branch (341:9): [True: 0, False: 1.42k]
  |  Branch (341:30): [True: 0, False: 1.42k]
  ------------------
  342|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  343|      0|        return -2;
  344|      0|    }
  345|       |
  346|  1.42k|    if (HAS_CALLBACK(b) &&
  ------------------
  |  |   26|  2.85k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 1.42k]
  |  |  |  Branch (26:52): [True: 0, False: 1.42k]
  |  |  ------------------
  ------------------
  347|  1.42k|        ((ret = (int)bio_call_callback(b, BIO_CB_WRITE, data, dlen, 0, 0L, 1L,
  ------------------
  |  |  291|      0|# define BIO_CB_WRITE       0x03
  ------------------
  |  Branch (347:9): [True: 0, False: 0]
  ------------------
  348|      0|                                       NULL)) <= 0))
  349|      0|        return ret;
  350|       |
  351|  1.42k|    if (!b->init) {
  ------------------
  |  Branch (351:9): [True: 0, False: 1.42k]
  ------------------
  352|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNINITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  353|      0|        return -1;
  354|      0|    }
  355|       |
  356|  1.42k|    ret = b->method->bwrite(b, data, dlen, &local_written);
  357|       |
  358|  1.42k|    if (ret > 0)
  ------------------
  |  Branch (358:9): [True: 1.42k, False: 0]
  ------------------
  359|  1.42k|        b->num_write += (uint64_t)local_written;
  360|       |
  361|  1.42k|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|  1.42k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 1.42k]
  |  |  |  Branch (26:52): [True: 0, False: 1.42k]
  |  |  ------------------
  ------------------
  362|      0|        ret = (int)bio_call_callback(b, BIO_CB_WRITE | BIO_CB_RETURN, data,
  ------------------
  |  |  291|      0|# define BIO_CB_WRITE       0x03
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_WRITE | BIO_CB_RETURN, data,
  ------------------
  |  |  302|      0|# define BIO_CB_RETURN   0x80
  ------------------
  363|      0|                                     dlen, 0, 0L, ret, &local_written);
  364|       |
  365|  1.42k|    if (written != NULL)
  ------------------
  |  Branch (365:9): [True: 1.42k, False: 0]
  ------------------
  366|  1.42k|        *written = local_written;
  367|  1.42k|    return ret;
  368|  1.42k|}

bwrite_conv:
   73|  1.42k|{
   74|  1.42k|    int ret;
   75|       |
   76|  1.42k|    if (datal > INT_MAX)
  ------------------
  |  Branch (76:9): [True: 0, False: 1.42k]
  ------------------
   77|      0|        datal = INT_MAX;
   78|       |
   79|  1.42k|    ret = bio->method->bwrite_old(bio, data, (int)datal);
   80|       |
   81|  1.42k|    if (ret <= 0) {
  ------------------
  |  Branch (81:9): [True: 0, False: 1.42k]
  ------------------
   82|      0|        *written = 0;
   83|      0|        return ret;
   84|      0|    }
   85|       |
   86|  1.42k|    *written = (size_t)ret;
   87|       |
   88|  1.42k|    return 1;
   89|  1.42k|}
bread_conv:
  121|    210|{
  122|    210|    int ret;
  123|       |
  124|    210|    if (datal > INT_MAX)
  ------------------
  |  Branch (124:9): [True: 0, False: 210]
  ------------------
  125|      0|        datal = INT_MAX;
  126|       |
  127|    210|    ret = bio->method->bread_old(bio, data, (int)datal);
  128|       |
  129|    210|    if (ret <= 0) {
  ------------------
  |  Branch (129:9): [True: 0, False: 210]
  ------------------
  130|      0|        *readbytes = 0;
  131|      0|        return ret;
  132|      0|    }
  133|       |
  134|    210|    *readbytes = (size_t)ret;
  135|       |
  136|    210|    return 1;
  137|    210|}

bio_sock_cleanup_int:
  203|      2|{
  204|       |# ifdef OPENSSL_SYS_WINDOWS
  205|       |    if (wsa_init_done) {
  206|       |        wsa_init_done = 0;
  207|       |        WSACleanup();
  208|       |    }
  209|       |# endif
  210|      2|}

ossl_bio_core_globals_free:
   26|      2|{
   27|      2|    OPENSSL_free(vbcg);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   28|      2|}
ossl_bio_core_globals_new:
   31|      2|{
   32|      2|    return OPENSSL_zalloc(sizeof(BIO_CORE_GLOBALS));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|      2|}

BIO_s_mem:
   73|  1.90k|{
   74|  1.90k|    return &mem_method;
   75|  1.90k|}
BIO_s_secmem:
   78|    520|{
   79|    520|    return &secmem_method;
   80|    520|}
bss_mem.c:mem_write:
  215|   293k|{
  216|   293k|    int ret = -1;
  217|   293k|    int blen;
  218|   293k|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  219|       |
  220|   293k|    if (b->flags & BIO_FLAGS_MEM_RDONLY) {
  ------------------
  |  |  237|   293k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (220:9): [True: 0, False: 293k]
  ------------------
  221|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_WRITE_TO_READ_ONLY_BIO);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  222|      0|        goto end;
  223|      0|    }
  224|   293k|    BIO_clear_retry_flags(b);
  ------------------
  |  |  261|   293k|                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  223|   293k|# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  220|   293k|# define BIO_FLAGS_READ          0x01
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  221|   293k|# define BIO_FLAGS_WRITE         0x02
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  222|   293k|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  224|   293k|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  225|   293k|    if (inl == 0)
  ------------------
  |  Branch (225:9): [True: 471, False: 292k]
  ------------------
  226|    471|        return 0;
  227|   292k|    if (in == NULL) {
  ------------------
  |  Branch (227:9): [True: 0, False: 292k]
  ------------------
  228|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  229|      0|        goto end;
  230|      0|    }
  231|   292k|    blen = bbm->readp->length;
  232|   292k|    mem_buf_sync(b);
  233|   292k|    if (BUF_MEM_grow_clean(bbm->buf, blen + inl) == 0)
  ------------------
  |  Branch (233:9): [True: 0, False: 292k]
  ------------------
  234|      0|        goto end;
  235|   292k|    memcpy(bbm->buf->data + blen, in, inl);
  236|   292k|    *bbm->readp = *bbm->buf;
  237|   292k|    ret = inl;
  238|   292k| end:
  239|   292k|    return ret;
  240|   292k|}
bss_mem.c:mem_buf_sync:
  178|   293k|{
  179|   293k|    if (b != NULL && b->init != 0 && b->ptr != NULL) {
  ------------------
  |  Branch (179:9): [True: 293k, False: 0]
  |  Branch (179:22): [True: 293k, False: 0]
  |  Branch (179:38): [True: 293k, False: 0]
  ------------------
  180|   293k|        BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  181|       |
  182|   293k|        if (bbm->readp->data != bbm->buf->data) {
  ------------------
  |  Branch (182:13): [True: 164, False: 292k]
  ------------------
  183|    164|            memmove(bbm->buf->data, bbm->readp->data, bbm->readp->length);
  184|    164|            bbm->buf->length = bbm->readp->length;
  185|    164|            bbm->readp->data = bbm->buf->data;
  186|    164|        }
  187|   293k|    }
  188|   293k|    return 0;
  189|   293k|}
bss_mem.c:mem_read:
  192|   373k|{
  193|   373k|    int ret = -1;
  194|   373k|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  195|   373k|    BUF_MEM *bm = bbm->readp;
  196|       |
  197|   373k|    if (b->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  237|   373k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (197:9): [True: 0, False: 373k]
  ------------------
  198|      0|        bm = bbm->buf;
  199|   373k|    BIO_clear_retry_flags(b);
  ------------------
  |  |  261|   373k|                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  223|   373k|# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  220|   373k|# define BIO_FLAGS_READ          0x01
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  221|   373k|# define BIO_FLAGS_WRITE         0x02
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  222|   373k|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  224|   373k|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  200|   373k|    ret = (outl >= 0 && (size_t)outl > bm->length) ? (int)bm->length : outl;
  ------------------
  |  Branch (200:12): [True: 373k, False: 0]
  |  Branch (200:25): [True: 0, False: 373k]
  ------------------
  201|   373k|    if ((out != NULL) && (ret > 0)) {
  ------------------
  |  Branch (201:9): [True: 373k, False: 0]
  |  Branch (201:26): [True: 373k, False: 0]
  ------------------
  202|   373k|        memcpy(out, bm->data, ret);
  203|   373k|        bm->length -= ret;
  204|   373k|        bm->max -= ret;
  205|   373k|        bm->data += ret;
  206|   373k|    } else if (bm->length == 0) {
  ------------------
  |  Branch (206:16): [True: 0, False: 0]
  ------------------
  207|      0|        ret = b->num;
  208|      0|        if (ret != 0)
  ------------------
  |  Branch (208:13): [True: 0, False: 0]
  ------------------
  209|      0|            BIO_set_retry_read(b);
  ------------------
  |  |  255|      0|                BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  220|      0|# define BIO_FLAGS_READ          0x01
  |  |  ------------------
  |  |                               BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  224|      0|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  210|      0|    }
  211|   373k|    return ret;
  212|   373k|}
bss_mem.c:mem_puts:
  380|   291k|{
  381|   291k|    int n, ret;
  382|       |
  383|   291k|    n = strlen(str);
  384|   291k|    ret = mem_write(bp, str, n);
  385|       |    /* memory semantics is that it will always work */
  386|   291k|    return ret;
  387|   291k|}
bss_mem.c:mem_gets:
  342|   374k|{
  343|   374k|    int i, j;
  344|   374k|    int ret = -1;
  345|   374k|    char *p;
  346|   374k|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)bp->ptr;
  347|   374k|    BUF_MEM *bm = bbm->readp;
  348|       |
  349|   374k|    if (bp->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  237|   374k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (349:9): [True: 0, False: 374k]
  ------------------
  350|      0|        bm = bbm->buf;
  351|   374k|    BIO_clear_retry_flags(bp);
  ------------------
  |  |  261|   374k|                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  223|   374k|# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  220|   374k|# define BIO_FLAGS_READ          0x01
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  221|   374k|# define BIO_FLAGS_WRITE         0x02
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  222|   374k|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  224|   374k|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  352|   374k|    j = bm->length;
  353|   374k|    if ((size - 1) < j)
  ------------------
  |  Branch (353:9): [True: 366k, False: 7.83k]
  ------------------
  354|   366k|        j = size - 1;
  355|   374k|    if (j <= 0) {
  ------------------
  |  Branch (355:9): [True: 717, False: 373k]
  ------------------
  356|    717|        *buf = '\0';
  357|    717|        return 0;
  358|    717|    }
  359|   373k|    p = bm->data;
  360|  46.6M|    for (i = 0; i < j; i++) {
  ------------------
  |  Branch (360:17): [True: 46.4M, False: 170k]
  ------------------
  361|  46.4M|        if (p[i] == '\n') {
  ------------------
  |  Branch (361:13): [True: 203k, False: 46.2M]
  ------------------
  362|   203k|            i++;
  363|   203k|            break;
  364|   203k|        }
  365|  46.4M|    }
  366|       |
  367|       |    /*
  368|       |     * i is now the max num of bytes to copy, either j or up to
  369|       |     * and including the first newline
  370|       |     */
  371|       |
  372|   373k|    i = mem_read(bp, buf, i);
  373|   373k|    if (i > 0)
  ------------------
  |  Branch (373:9): [True: 373k, False: 0]
  ------------------
  374|   373k|        buf[i] = '\0';
  375|   373k|    ret = i;
  376|   373k|    return ret;
  377|   374k|}
bss_mem.c:mem_ctrl:
  243|    432|{
  244|    432|    long ret = 1;
  245|    432|    char **pptr;
  246|    432|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  247|    432|    BUF_MEM *bm, *bo;            /* bio_mem, bio_other */
  248|    432|    long off, remain;
  249|       |
  250|    432|    if (b->flags & BIO_FLAGS_MEM_RDONLY) {
  ------------------
  |  |  237|    432|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (250:9): [True: 0, False: 432]
  ------------------
  251|      0|        bm = bbm->buf;
  252|      0|        bo = bbm->readp;
  253|    432|    } else {
  254|    432|        bm = bbm->readp;
  255|    432|        bo = bbm->buf;
  256|    432|    }
  257|    432|    off = (bm->data == bo->data) ? 0 : bm->data - bo->data;
  ------------------
  |  Branch (257:11): [True: 432, False: 0]
  ------------------
  258|    432|    remain = bm->length;
  259|       |
  260|    432|    switch (cmd) {
  261|      0|    case BIO_CTRL_RESET:
  ------------------
  |  |   88|      0|# define BIO_CTRL_RESET          1/* opt - rewind/zero etc */
  ------------------
  |  Branch (261:5): [True: 0, False: 432]
  ------------------
  262|      0|        bm = bbm->buf;
  263|      0|        if (bm->data != NULL) {
  ------------------
  |  Branch (263:13): [True: 0, False: 0]
  ------------------
  264|      0|            if (!(b->flags & BIO_FLAGS_MEM_RDONLY)) {
  ------------------
  |  |  237|      0|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (264:17): [True: 0, False: 0]
  ------------------
  265|      0|                if (!(b->flags & BIO_FLAGS_NONCLEAR_RST)) {
  ------------------
  |  |  238|      0|# define BIO_FLAGS_NONCLEAR_RST  0x400
  ------------------
  |  Branch (265:21): [True: 0, False: 0]
  ------------------
  266|      0|                    memset(bm->data, 0, bm->max);
  267|      0|                    bm->length = 0;
  268|      0|                }
  269|      0|                *bbm->readp = *bbm->buf;
  270|      0|            } else {
  271|       |                /* For read only case just reset to the start again */
  272|      0|                *bbm->buf = *bbm->readp;
  273|      0|            }
  274|      0|        }
  275|      0|        break;
  276|      0|    case BIO_C_FILE_SEEK:
  ------------------
  |  |  459|      0|# define BIO_C_FILE_SEEK                         128
  ------------------
  |  Branch (276:5): [True: 0, False: 432]
  ------------------
  277|      0|        if (num < 0 || num > off + remain)
  ------------------
  |  Branch (277:13): [True: 0, False: 0]
  |  Branch (277:24): [True: 0, False: 0]
  ------------------
  278|      0|            return -1;   /* Can't see outside of the current buffer */
  279|       |
  280|      0|        bm->data = (num != 0) ? bo->data + num : bo->data;
  ------------------
  |  Branch (280:20): [True: 0, False: 0]
  ------------------
  281|      0|        bm->length = bo->length - num;
  282|      0|        bm->max = bo->max - num;
  283|      0|        off = num;
  284|       |        /* FALLTHRU */
  285|      0|    case BIO_C_FILE_TELL:
  ------------------
  |  |  465|      0|# define BIO_C_FILE_TELL                         133
  ------------------
  |  Branch (285:5): [True: 0, False: 432]
  ------------------
  286|      0|        ret = off;
  287|      0|        break;
  288|      0|    case BIO_CTRL_EOF:
  ------------------
  |  |   89|      0|# define BIO_CTRL_EOF            2/* opt - are we at the eof */
  ------------------
  |  Branch (288:5): [True: 0, False: 432]
  ------------------
  289|      0|        ret = (long)(bm->length == 0);
  290|      0|        break;
  291|      0|    case BIO_C_SET_BUF_MEM_EOF_RETURN:
  ------------------
  |  |  461|      0|# define BIO_C_SET_BUF_MEM_EOF_RETURN            130/* return end of input
  ------------------
  |  Branch (291:5): [True: 0, False: 432]
  ------------------
  292|      0|        b->num = (int)num;
  293|      0|        break;
  294|    174|    case BIO_CTRL_INFO:
  ------------------
  |  |   90|    174|# define BIO_CTRL_INFO           3/* opt - extra tit-bits */
  ------------------
  |  Branch (294:5): [True: 174, False: 258]
  ------------------
  295|    174|        ret = (long)bm->length;
  296|    174|        if (ptr != NULL) {
  ------------------
  |  Branch (296:13): [True: 0, False: 174]
  ------------------
  297|      0|            pptr = (char **)ptr;
  298|      0|            *pptr = (char *)(bm->data);
  299|      0|        }
  300|    174|        break;
  301|      0|    case BIO_C_SET_BUF_MEM:
  ------------------
  |  |  445|      0|# define BIO_C_SET_BUF_MEM                       114
  ------------------
  |  Branch (301:5): [True: 0, False: 432]
  ------------------
  302|      0|        mem_buf_free(b);
  303|      0|        b->shutdown = (int)num;
  304|      0|        bbm->buf = ptr;
  305|      0|        *bbm->readp = *bbm->buf;
  306|      0|        break;
  307|    258|    case BIO_C_GET_BUF_MEM_PTR:
  ------------------
  |  |  446|    258|# define BIO_C_GET_BUF_MEM_PTR                   115
  ------------------
  |  Branch (307:5): [True: 258, False: 174]
  ------------------
  308|    258|        if (ptr != NULL) {
  ------------------
  |  Branch (308:13): [True: 258, False: 0]
  ------------------
  309|    258|            if (!(b->flags & BIO_FLAGS_MEM_RDONLY))
  ------------------
  |  |  237|    258|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (309:17): [True: 258, False: 0]
  ------------------
  310|    258|                mem_buf_sync(b);
  311|    258|            bm = bbm->buf;
  312|    258|            pptr = (char **)ptr;
  313|    258|            *pptr = (char *)bm;
  314|    258|        }
  315|    258|        break;
  316|      0|    case BIO_CTRL_GET_CLOSE:
  ------------------
  |  |   95|      0|# define BIO_CTRL_GET_CLOSE      8/* man - set the 'close' on free */
  ------------------
  |  Branch (316:5): [True: 0, False: 432]
  ------------------
  317|      0|        ret = (long)b->shutdown;
  318|      0|        break;
  319|      0|    case BIO_CTRL_SET_CLOSE:
  ------------------
  |  |   96|      0|# define BIO_CTRL_SET_CLOSE      9/* man - set the 'close' on free */
  ------------------
  |  Branch (319:5): [True: 0, False: 432]
  ------------------
  320|      0|        b->shutdown = (int)num;
  321|      0|        break;
  322|      0|    case BIO_CTRL_WPENDING:
  ------------------
  |  |  100|      0|# define BIO_CTRL_WPENDING       13/* opt - number of bytes still to write */
  ------------------
  |  Branch (322:5): [True: 0, False: 432]
  ------------------
  323|      0|        ret = 0L;
  324|      0|        break;
  325|      0|    case BIO_CTRL_PENDING:
  ------------------
  |  |   97|      0|# define BIO_CTRL_PENDING        10/* opt - is their more data buffered */
  ------------------
  |  Branch (325:5): [True: 0, False: 432]
  ------------------
  326|      0|        ret = (long)bm->length;
  327|      0|        break;
  328|      0|    case BIO_CTRL_DUP:
  ------------------
  |  |   99|      0|# define BIO_CTRL_DUP            12/* man - extra stuff for 'duped' BIO */
  ------------------
  |  Branch (328:5): [True: 0, False: 432]
  ------------------
  329|      0|    case BIO_CTRL_FLUSH:
  ------------------
  |  |   98|      0|# define BIO_CTRL_FLUSH          11/* opt - 'flush' buffered output */
  ------------------
  |  Branch (329:5): [True: 0, False: 432]
  ------------------
  330|      0|        ret = 1;
  331|      0|        break;
  332|      0|    case BIO_CTRL_PUSH:
  ------------------
  |  |   93|      0|# define BIO_CTRL_PUSH           6/* opt - internal, used to signify change */
  ------------------
  |  Branch (332:5): [True: 0, False: 432]
  ------------------
  333|      0|    case BIO_CTRL_POP:
  ------------------
  |  |   94|      0|# define BIO_CTRL_POP            7/* opt - internal, used to signify change */
  ------------------
  |  Branch (333:5): [True: 0, False: 432]
  ------------------
  334|      0|    default:
  ------------------
  |  Branch (334:5): [True: 0, False: 432]
  ------------------
  335|      0|        ret = 0;
  336|      0|        break;
  337|    432|    }
  338|    432|    return ret;
  339|    432|}
bss_mem.c:mem_buf_free:
  158|  3.63k|{
  159|  3.63k|    if (a == NULL)
  ------------------
  |  Branch (159:9): [True: 0, False: 3.63k]
  ------------------
  160|      0|        return 0;
  161|       |
  162|  3.63k|    if (a->shutdown && a->init && a->ptr != NULL) {
  ------------------
  |  Branch (162:9): [True: 3.63k, False: 0]
  |  Branch (162:24): [True: 3.63k, False: 0]
  |  Branch (162:35): [True: 3.63k, False: 0]
  ------------------
  163|  3.63k|        BIO_BUF_MEM *bb = (BIO_BUF_MEM *)a->ptr;
  164|  3.63k|        BUF_MEM *b = bb->buf;
  165|       |
  166|  3.63k|        if (a->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  237|  3.63k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (166:13): [True: 0, False: 3.63k]
  ------------------
  167|      0|            b->data = NULL;
  168|  3.63k|        BUF_MEM_free(b);
  169|  3.63k|    }
  170|  3.63k|    return 1;
  171|  3.63k|}
bss_mem.c:mem_new:
  133|  2.59k|{
  134|  2.59k|    return mem_init(bi, 0L);
  135|  2.59k|}
bss_mem.c:mem_init:
  110|  3.63k|{
  111|  3.63k|    BIO_BUF_MEM *bb = OPENSSL_zalloc(sizeof(*bb));
  ------------------
  |  |  104|  3.63k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.63k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.63k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  112|       |
  113|  3.63k|    if (bb == NULL)
  ------------------
  |  Branch (113:9): [True: 0, False: 3.63k]
  ------------------
  114|      0|        return 0;
  115|  3.63k|    if ((bb->buf = BUF_MEM_new_ex(flags)) == NULL) {
  ------------------
  |  Branch (115:9): [True: 0, False: 3.63k]
  ------------------
  116|      0|        OPENSSL_free(bb);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  117|      0|        return 0;
  118|      0|    }
  119|  3.63k|    if ((bb->readp = OPENSSL_zalloc(sizeof(*bb->readp))) == NULL) {
  ------------------
  |  |  104|  3.63k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.63k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.63k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (119:9): [True: 0, False: 3.63k]
  ------------------
  120|      0|        BUF_MEM_free(bb->buf);
  121|      0|        OPENSSL_free(bb);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  122|      0|        return 0;
  123|      0|    }
  124|  3.63k|    *bb->readp = *bb->buf;
  125|  3.63k|    bi->shutdown = 1;
  126|  3.63k|    bi->init = 1;
  127|  3.63k|    bi->num = -1;
  128|  3.63k|    bi->ptr = (char *)bb;
  129|  3.63k|    return 1;
  130|  3.63k|}
bss_mem.c:mem_free:
  143|  3.63k|{
  144|  3.63k|    BIO_BUF_MEM *bb;
  145|       |
  146|  3.63k|    if (a == NULL)
  ------------------
  |  Branch (146:9): [True: 0, False: 3.63k]
  ------------------
  147|      0|        return 0;
  148|       |
  149|  3.63k|    bb = (BIO_BUF_MEM *)a->ptr;
  150|  3.63k|    if (!mem_buf_free(a))
  ------------------
  |  Branch (150:9): [True: 0, False: 3.63k]
  ------------------
  151|      0|        return 0;
  152|  3.63k|    OPENSSL_free(bb->readp);
  ------------------
  |  |  115|  3.63k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.63k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.63k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  153|  3.63k|    OPENSSL_free(bb);
  ------------------
  |  |  115|  3.63k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.63k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.63k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  154|  3.63k|    return 1;
  155|  3.63k|}
bss_mem.c:secmem_new:
  138|  1.04k|{
  139|  1.04k|    return mem_init(bi, BUF_MEM_FLAG_SECURE);
  ------------------
  |  |   49|  1.04k|# define BUF_MEM_FLAG_SECURE  0x01
  ------------------
  140|  1.04k|}

ossl_err_load_BN_strings:
   50|      2|{
   51|      2|#ifndef OPENSSL_NO_ERR
   52|      2|    if (ERR_reason_error_string(BN_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (52:9): [True: 2, False: 0]
  ------------------
   53|      2|        ERR_load_strings_const(BN_str_reasons);
   54|      2|#endif
   55|      2|    return 1;
   56|      2|}

ossl_err_load_BUF_strings:
   24|      2|{
   25|      2|#ifndef OPENSSL_NO_ERR
   26|      2|    if (ERR_reason_error_string(BUF_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (26:9): [True: 2, False: 0]
  ------------------
   27|      2|        ERR_load_strings_const(BUF_str_reasons);
   28|      2|#endif
   29|      2|    return 1;
   30|      2|}

BUF_MEM_new_ex:
   22|  3.63k|{
   23|  3.63k|    BUF_MEM *ret;
   24|       |
   25|  3.63k|    ret = BUF_MEM_new();
   26|  3.63k|    if (ret != NULL)
  ------------------
  |  Branch (26:9): [True: 3.63k, False: 0]
  ------------------
   27|  3.63k|        ret->flags = flags;
   28|  3.63k|    return ret;
   29|  3.63k|}
BUF_MEM_new:
   32|  3.63k|{
   33|  3.63k|    BUF_MEM *ret;
   34|       |
   35|  3.63k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  3.63k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.63k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.63k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   36|  3.63k|    if (ret == NULL)
  ------------------
  |  Branch (36:9): [True: 0, False: 3.63k]
  ------------------
   37|      0|        return NULL;
   38|  3.63k|    return ret;
   39|  3.63k|}
BUF_MEM_free:
   42|  3.63k|{
   43|  3.63k|    if (a == NULL)
  ------------------
  |  Branch (43:9): [True: 0, False: 3.63k]
  ------------------
   44|      0|        return;
   45|  3.63k|    if (a->data != NULL) {
  ------------------
  |  Branch (45:9): [True: 1.93k, False: 1.70k]
  ------------------
   46|  1.93k|        if (a->flags & BUF_MEM_FLAG_SECURE)
  ------------------
  |  |   49|  1.93k|# define BUF_MEM_FLAG_SECURE  0x01
  ------------------
  |  Branch (46:13): [True: 309, False: 1.62k]
  ------------------
   47|    309|            OPENSSL_secure_clear_free(a->data, a->max);
  ------------------
  |  |  129|    309|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    309|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    309|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   48|  1.62k|        else
   49|  1.62k|            OPENSSL_clear_free(a->data, a->max);
  ------------------
  |  |  113|  1.62k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.62k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.62k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   50|  1.93k|    }
   51|  3.63k|    OPENSSL_free(a);
  ------------------
  |  |  115|  3.63k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.63k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.63k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   52|  3.63k|}
BUF_MEM_grow_clean:
  108|   292k|{
  109|   292k|    char *ret;
  110|   292k|    size_t n;
  111|       |
  112|   292k|    if (str->length >= len) {
  ------------------
  |  Branch (112:9): [True: 0, False: 292k]
  ------------------
  113|      0|        if (str->data != NULL)
  ------------------
  |  Branch (113:13): [True: 0, False: 0]
  ------------------
  114|      0|            memset(&str->data[len], 0, str->length - len);
  115|      0|        str->length = len;
  116|      0|        return len;
  117|      0|    }
  118|   292k|    if (str->max >= len) {
  ------------------
  |  Branch (118:9): [True: 287k, False: 5.54k]
  ------------------
  119|   287k|        memset(&str->data[str->length], 0, len - str->length);
  120|   287k|        str->length = len;
  121|   287k|        return len;
  122|   287k|    }
  123|       |    /* This limit is sufficient to ensure (len+3)/3*4 < 2**31 */
  124|  5.54k|    if (len > LIMIT_BEFORE_EXPANSION) {
  ------------------
  |  |   19|  5.54k|#define LIMIT_BEFORE_EXPANSION 0x5ffffffc
  ------------------
  |  Branch (124:9): [True: 0, False: 5.54k]
  ------------------
  125|      0|        ERR_raise(ERR_LIB_BUF, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  126|      0|        return 0;
  127|      0|    }
  128|  5.54k|    n = (len + 3) / 3 * 4;
  129|  5.54k|    if ((str->flags & BUF_MEM_FLAG_SECURE))
  ------------------
  |  |   49|  5.54k|# define BUF_MEM_FLAG_SECURE  0x01
  ------------------
  |  Branch (129:9): [True: 1.63k, False: 3.91k]
  ------------------
  130|  1.63k|        ret = sec_alloc_realloc(str, n);
  131|  3.91k|    else
  132|  3.91k|        ret = OPENSSL_clear_realloc(str->data, str->max, n);
  ------------------
  |  |  111|  3.91k|        CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.91k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.91k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  133|  5.54k|    if (ret == NULL) {
  ------------------
  |  Branch (133:9): [True: 0, False: 5.54k]
  ------------------
  134|      0|        len = 0;
  135|  5.54k|    } else {
  136|  5.54k|        str->data = ret;
  137|  5.54k|        str->max = n;
  138|  5.54k|        memset(&str->data[str->length], 0, len - str->length);
  139|  5.54k|        str->length = len;
  140|  5.54k|    }
  141|  5.54k|    return len;
  142|  5.54k|}
buffer.c:sec_alloc_realloc:
   57|  1.63k|{
   58|  1.63k|    char *ret;
   59|       |
   60|  1.63k|    ret = OPENSSL_secure_malloc(len);
  ------------------
  |  |  123|  1.63k|        CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.63k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.63k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|  1.63k|    if (str->data != NULL) {
  ------------------
  |  Branch (61:9): [True: 1.32k, False: 309]
  ------------------
   62|  1.32k|        if (ret != NULL) {
  ------------------
  |  Branch (62:13): [True: 1.32k, False: 0]
  ------------------
   63|  1.32k|            memcpy(ret, str->data, str->length);
   64|  1.32k|            OPENSSL_secure_clear_free(str->data, str->length);
  ------------------
  |  |  129|  1.32k|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.32k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.32k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   65|  1.32k|            str->data = NULL;
   66|  1.32k|        }
   67|  1.32k|    }
   68|  1.63k|    return ret;
   69|  1.63k|}

ossl_err_load_CMP_strings:
  199|      2|{
  200|      2|# ifndef OPENSSL_NO_ERR
  201|      2|    if (ERR_reason_error_string(CMP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (201:9): [True: 2, False: 0]
  ------------------
  202|      2|        ERR_load_strings_const(CMP_str_reasons);
  203|      2|# endif
  204|      2|    return 1;
  205|      2|}

OSSL_CMP_log_close:
   41|      2|{
   42|      2|    (void)OSSL_trace_set_channel(OSSL_TRACE_CATEGORY_CMP, NULL);
  ------------------
  |  |   53|      2|# define OSSL_TRACE_CATEGORY_CMP                13
  ------------------
   43|      2|}

ossl_err_load_CMS_strings:
  175|      2|{
  176|      2|# ifndef OPENSSL_NO_ERR
  177|      2|    if (ERR_reason_error_string(CMS_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (177:9): [True: 2, False: 0]
  ------------------
  178|      2|        ERR_load_strings_const(CMS_str_reasons);
  179|      2|# endif
  180|      2|    return 1;
  181|      2|}

ossl_comp_brotli_cleanup:
  353|      2|{
  354|       |#ifdef BROTLI_SHARED
  355|       |    DSO_free(brotli_encode_dso);
  356|       |    brotli_encode_dso = NULL;
  357|       |    DSO_free(brotli_decode_dso);
  358|       |    brotli_decode_dso = NULL;
  359|       |    p_encode_init = NULL;
  360|       |    p_encode_stream = NULL;
  361|       |    p_encode_has_more = NULL;
  362|       |    p_encode_end = NULL;
  363|       |    p_encode_oneshot = NULL;
  364|       |    p_decode_init = NULL;
  365|       |    p_decode_stream = NULL;
  366|       |    p_decode_has_more = NULL;
  367|       |    p_decode_end = NULL;
  368|       |    p_decode_error = NULL;
  369|       |    p_decode_error_string = NULL;
  370|       |    p_decode_is_finished = NULL;
  371|       |    p_decode_oneshot = NULL;
  372|       |#endif
  373|      2|}

COMP_zlib:
  311|      2|{
  312|      2|    COMP_METHOD *meth = NULL;
  313|       |
  314|       |#ifndef OPENSSL_NO_ZLIB
  315|       |    if (RUN_ONCE(&zlib_once, ossl_comp_zlib_init))
  316|       |        meth = &zlib_stateful_method;
  317|       |#endif
  318|       |
  319|      2|    return meth;
  320|      2|}
ossl_comp_zlib_cleanup:
  336|      2|{
  337|       |#ifdef ZLIB_SHARED
  338|       |    DSO_free(zlib_dso);
  339|       |    zlib_dso = NULL;
  340|       |#endif
  341|      2|}

ossl_comp_zstd_cleanup:
  428|      2|{
  429|       |#ifdef ZSTD_SHARED
  430|       |    DSO_free(zstd_dso);
  431|       |    zstd_dso = NULL;
  432|       |    p_createCStream = NULL;
  433|       |    p_initCStream = NULL;
  434|       |    p_freeCStream = NULL;
  435|       |    p_compressStream2 = NULL;
  436|       |    p_flushStream = NULL;
  437|       |    p_endStream = NULL;
  438|       |    p_compress = NULL;
  439|       |    p_createDStream = NULL;
  440|       |    p_initDStream = NULL;
  441|       |    p_freeDStream = NULL;
  442|       |    p_decompressStream = NULL;
  443|       |    p_decompress = NULL;
  444|       |    p_isError = NULL;
  445|       |    p_getErrorName = NULL;
  446|       |    p_DStreamInSize = NULL;
  447|       |    p_CStreamInSize = NULL;
  448|       |#endif
  449|      2|}

ossl_err_load_COMP_strings:
   45|      2|{
   46|      2|# ifndef OPENSSL_NO_ERR
   47|      2|    if (ERR_reason_error_string(COMP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (47:9): [True: 2, False: 0]
  ------------------
   48|      2|        ERR_load_strings_const(COMP_str_reasons);
   49|      2|# endif
   50|      2|    return 1;
   51|      2|}

COMP_get_type:
   41|      2|{
   42|      2|    if (meth == NULL)
  ------------------
  |  Branch (42:9): [True: 2, False: 0]
  ------------------
   43|      2|        return NID_undef;
  ------------------
  |  |   18|      2|#define NID_undef                       0
  ------------------
   44|      0|    return meth->type;
   45|      2|}

ossl_load_builtin_compressions:
   29|      2|{
   30|      2|    STACK_OF(SSL_COMP) *comp_methods = NULL;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
   31|      2|#ifndef OPENSSL_NO_COMP
   32|      2|    SSL_COMP *comp = NULL;
   33|      2|    COMP_METHOD *method = COMP_zlib();
   34|       |
   35|      2|    comp_methods = sk_SSL_COMP_new(sk_comp_cmp);
  ------------------
  |  |   69|      2|#define sk_SSL_COMP_new(cmp) ((STACK_OF(SSL_COMP) *)OPENSSL_sk_new(ossl_check_SSL_COMP_compfunc_type(cmp)))
  ------------------
   36|       |
   37|      2|    if (COMP_get_type(method) != NID_undef && comp_methods != NULL) {
  ------------------
  |  |   18|      4|#define NID_undef                       0
  ------------------
  |  Branch (37:9): [True: 0, False: 2]
  |  Branch (37:47): [True: 0, False: 0]
  ------------------
   38|      0|        comp = OPENSSL_malloc(sizeof(*comp));
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   39|      0|        if (comp != NULL) {
  ------------------
  |  Branch (39:13): [True: 0, False: 0]
  ------------------
   40|      0|            comp->method = method;
   41|      0|            comp->id = SSL_COMP_ZLIB_IDX;
  ------------------
  |  |   18|      0|#define SSL_COMP_ZLIB_IDX       1
  ------------------
   42|      0|            comp->name = COMP_get_name(method);
   43|      0|            if (!sk_SSL_COMP_push(comp_methods, comp))
  ------------------
  |  |   77|      0|#define sk_SSL_COMP_push(sk, ptr) OPENSSL_sk_push(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr))
  ------------------
  |  Branch (43:17): [True: 0, False: 0]
  ------------------
   44|      0|                OPENSSL_free(comp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   45|      0|        }
   46|      0|    }
   47|      2|#endif
   48|      2|    return comp_methods;
   49|      2|}
ossl_free_compression_methods_int:
   57|      2|{
   58|      2|    sk_SSL_COMP_pop_free(methods, cmeth_free);
  ------------------
  |  |   81|      2|#define sk_SSL_COMP_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_freefunc_type(freefunc))
  ------------------
   59|      2|}

ossl_err_load_CONF_strings:
   68|      2|{
   69|      2|#ifndef OPENSSL_NO_ERR
   70|      2|    if (ERR_reason_error_string(CONF_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (70:9): [True: 2, False: 0]
  ------------------
   71|      2|        ERR_load_strings_const(CONF_str_reasons);
   72|      2|#endif
   73|      2|    return 1;
   74|      2|}

CONF_modules_unload:
  517|      2|{
  518|      2|    int i;
  519|      2|    CONF_MODULE *md;
  520|      2|    STACK_OF(CONF_MODULE) *old_modules;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
  521|      2|    STACK_OF(CONF_MODULE) *new_modules;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
  522|      2|    STACK_OF(CONF_MODULE) *to_delete;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
  523|       |
  524|      2|    if (!conf_modules_finish_int()) /* also inits module list lock */
  ------------------
  |  Branch (524:9): [True: 0, False: 2]
  ------------------
  525|      0|        return;
  526|       |
  527|      2|    ossl_rcu_write_lock(module_list_lock);
  528|       |
  529|      2|    old_modules = ossl_rcu_deref(&supported_modules);
  ------------------
  |  |   30|      2|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  530|      2|    new_modules = sk_CONF_MODULE_dup(old_modules);
  531|       |
  532|      2|    if (new_modules == NULL) {
  ------------------
  |  Branch (532:9): [True: 0, False: 2]
  ------------------
  533|      0|        ossl_rcu_write_unlock(module_list_lock);
  534|      0|        return;
  535|      0|    }
  536|       |
  537|      2|    to_delete = sk_CONF_MODULE_new_null();
  538|       |
  539|       |    /* unload modules in reverse order */
  540|      2|    for (i = sk_CONF_MODULE_num(new_modules) - 1; i >= 0; i--) {
  ------------------
  |  Branch (540:51): [True: 0, False: 2]
  ------------------
  541|      0|        md = sk_CONF_MODULE_value(new_modules, i);
  542|       |        /* If static or in use and 'all' not set ignore it */
  543|      0|        if (((md->links > 0) || !md->dso) && !all)
  ------------------
  |  Branch (543:14): [True: 0, False: 0]
  |  Branch (543:33): [True: 0, False: 0]
  |  Branch (543:46): [True: 0, False: 0]
  ------------------
  544|      0|            continue;
  545|       |        /* Since we're working in reverse this is OK */
  546|      0|        (void)sk_CONF_MODULE_delete(new_modules, i);
  547|      0|        sk_CONF_MODULE_push(to_delete, md);
  548|      0|    }
  549|       |
  550|      2|    if (sk_CONF_MODULE_num(new_modules) == 0) {
  ------------------
  |  Branch (550:9): [True: 2, False: 0]
  ------------------
  551|      2|        sk_CONF_MODULE_free(new_modules);
  552|      2|        new_modules = NULL;
  553|      2|    }
  554|       |
  555|      2|    ossl_rcu_assign_ptr(&supported_modules, &new_modules);
  ------------------
  |  |   31|      2|#define ossl_rcu_assign_ptr(p,v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  556|      2|    ossl_rcu_write_unlock(module_list_lock);
  557|      2|    ossl_synchronize_rcu(module_list_lock);
  558|      2|    sk_CONF_MODULE_free(old_modules);
  559|      2|    sk_CONF_MODULE_pop_free(to_delete, module_free);
  560|       |
  561|      2|}
ossl_config_modules_free:
  632|      2|{
  633|      2|    CONF_modules_unload(1); /* calls CONF_modules_finish */
  634|      2|    module_lists_free();
  635|      2|}
conf_mod.c:do_init_module_list_lock:
  101|      2|{
  102|      2|    module_list_lock = ossl_rcu_lock_new(1, NULL);
  103|      2|    if (module_list_lock == NULL) {
  ------------------
  |  Branch (103:9): [True: 0, False: 2]
  ------------------
  104|      0|        ERR_raise(ERR_LIB_CONF, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  105|      0|        return 0;
  106|      0|    }
  107|       |
  108|      2|    return 1;
  109|      2|}
conf_mod.c:conf_modules_finish_int:
  574|      2|{
  575|      2|    CONF_IMODULE *imod;
  576|      2|    STACK_OF(CONF_IMODULE) *old_modules;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
  577|      2|    STACK_OF(CONF_IMODULE) *new_modules = NULL;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
  578|       |
  579|      2|    if (!RUN_ONCE(&init_module_list_lock, do_init_module_list_lock))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (579:9): [True: 0, False: 2]
  ------------------
  580|      0|        return 0;
  581|       |
  582|       |    /* If module_list_lock is NULL here it means we were already unloaded */
  583|      2|    if (module_list_lock == NULL)
  ------------------
  |  Branch (583:9): [True: 0, False: 2]
  ------------------
  584|      0|        return 0;
  585|       |
  586|      2|    ossl_rcu_write_lock(module_list_lock);
  587|      2|    old_modules = ossl_rcu_deref(&initialized_modules);
  ------------------
  |  |   30|      2|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  588|      2|    ossl_rcu_assign_ptr(&initialized_modules, &new_modules);
  ------------------
  |  |   31|      2|#define ossl_rcu_assign_ptr(p,v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  589|      2|    ossl_rcu_write_unlock(module_list_lock);
  590|      2|    ossl_synchronize_rcu(module_list_lock);
  591|       |
  592|      2|    while (sk_CONF_IMODULE_num(old_modules) > 0) {
  ------------------
  |  Branch (592:12): [True: 0, False: 2]
  ------------------
  593|      0|        imod = sk_CONF_IMODULE_pop(old_modules);
  594|      0|        module_finish(imod);
  595|      0|    }
  596|      2|    sk_CONF_IMODULE_free(old_modules);
  597|       |
  598|      2|    return 1;
  599|      2|}
conf_mod.c:module_lists_free:
   89|      2|{
   90|      2|    ossl_rcu_lock_free(module_list_lock);
   91|      2|    module_list_lock = NULL;
   92|       |
   93|      2|    sk_CONF_MODULE_free(supported_modules);
   94|      2|    supported_modules = NULL;
   95|       |
   96|      2|    sk_CONF_IMODULE_free(initialized_modules);
   97|      2|    initialized_modules = NULL;
   98|      2|}

ossl_lib_ctx_default_deinit:
  412|      2|{
  413|      2|    if (!default_context_inited)
  ------------------
  |  Branch (413:9): [True: 0, False: 2]
  ------------------
  414|      0|        return;
  415|      2|    context_deinit(&default_context_int);
  416|      2|    CRYPTO_THREAD_cleanup_local(&default_context_thread_local);
  417|      2|    default_context_inited = 0;
  418|      2|}
ossl_lib_ctx_get_concrete:
  543|  7.29k|{
  544|  7.29k|#ifndef FIPS_MODULE
  545|  7.29k|    if (ctx == NULL)
  ------------------
  |  Branch (545:9): [True: 7.27k, False: 22]
  ------------------
  546|  7.27k|        return get_default_context();
  547|     22|#endif
  548|     22|    return ctx;
  549|  7.29k|}
ossl_lib_ctx_get_data:
  570|     16|{
  571|     16|    ctx = ossl_lib_ctx_get_concrete(ctx);
  572|     16|    if (ctx == NULL)
  ------------------
  |  Branch (572:9): [True: 0, False: 16]
  ------------------
  573|      0|        return NULL;
  574|       |
  575|     16|    switch (index) {
  576|     16|    case OSSL_LIB_CTX_PROPERTY_STRING_INDEX:
  ------------------
  |  |  101|     16|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  |  Branch (576:5): [True: 16, False: 0]
  ------------------
  577|     16|        return ctx->property_string_data;
  578|      0|    case OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX:
  ------------------
  |  |   98|      0|# define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX         0
  ------------------
  |  Branch (578:5): [True: 0, False: 16]
  ------------------
  579|      0|        return ctx->evp_method_store;
  580|      0|    case OSSL_LIB_CTX_PROVIDER_STORE_INDEX:
  ------------------
  |  |   99|      0|# define OSSL_LIB_CTX_PROVIDER_STORE_INDEX           1
  ------------------
  |  Branch (580:5): [True: 0, False: 16]
  ------------------
  581|      0|        return ctx->provider_store;
  582|      0|    case OSSL_LIB_CTX_NAMEMAP_INDEX:
  ------------------
  |  |  102|      0|# define OSSL_LIB_CTX_NAMEMAP_INDEX                  4
  ------------------
  |  Branch (582:5): [True: 0, False: 16]
  ------------------
  583|      0|        return ctx->namemap;
  584|      0|    case OSSL_LIB_CTX_PROPERTY_DEFN_INDEX:
  ------------------
  |  |  100|      0|# define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX            2
  ------------------
  |  Branch (584:5): [True: 0, False: 16]
  ------------------
  585|      0|        return ctx->property_defns;
  586|      0|    case OSSL_LIB_CTX_GLOBAL_PROPERTIES:
  ------------------
  |  |  114|      0|# define OSSL_LIB_CTX_GLOBAL_PROPERTIES             14
  ------------------
  |  Branch (586:5): [True: 0, False: 16]
  ------------------
  587|      0|        return ctx->global_properties;
  588|      0|    case OSSL_LIB_CTX_DRBG_INDEX:
  ------------------
  |  |  103|      0|# define OSSL_LIB_CTX_DRBG_INDEX                     5
  ------------------
  |  Branch (588:5): [True: 0, False: 16]
  ------------------
  589|      0|        return ctx->drbg;
  590|      0|    case OSSL_LIB_CTX_DRBG_NONCE_INDEX:
  ------------------
  |  |  104|      0|# define OSSL_LIB_CTX_DRBG_NONCE_INDEX               6
  ------------------
  |  Branch (590:5): [True: 0, False: 16]
  ------------------
  591|      0|        return ctx->drbg_nonce;
  592|      0|#ifndef FIPS_MODULE
  593|      0|    case OSSL_LIB_CTX_PROVIDER_CONF_INDEX:
  ------------------
  |  |  116|      0|# define OSSL_LIB_CTX_PROVIDER_CONF_INDEX           16
  ------------------
  |  Branch (593:5): [True: 0, False: 16]
  ------------------
  594|      0|        return ctx->provider_conf;
  595|      0|    case OSSL_LIB_CTX_BIO_CORE_INDEX:
  ------------------
  |  |  117|      0|# define OSSL_LIB_CTX_BIO_CORE_INDEX                17
  ------------------
  |  Branch (595:5): [True: 0, False: 16]
  ------------------
  596|      0|        return ctx->bio_core;
  597|      0|    case OSSL_LIB_CTX_CHILD_PROVIDER_INDEX:
  ------------------
  |  |  118|      0|# define OSSL_LIB_CTX_CHILD_PROVIDER_INDEX          18
  ------------------
  |  Branch (597:5): [True: 0, False: 16]
  ------------------
  598|      0|        return ctx->child_provider;
  599|      0|    case OSSL_LIB_CTX_DECODER_STORE_INDEX:
  ------------------
  |  |  111|      0|# define OSSL_LIB_CTX_DECODER_STORE_INDEX           11
  ------------------
  |  Branch (599:5): [True: 0, False: 16]
  ------------------
  600|      0|        return ctx->decoder_store;
  601|      0|    case OSSL_LIB_CTX_DECODER_CACHE_INDEX:
  ------------------
  |  |  120|      0|# define OSSL_LIB_CTX_DECODER_CACHE_INDEX           20
  ------------------
  |  Branch (601:5): [True: 0, False: 16]
  ------------------
  602|      0|        return ctx->decoder_cache;
  603|      0|    case OSSL_LIB_CTX_ENCODER_STORE_INDEX:
  ------------------
  |  |  110|      0|# define OSSL_LIB_CTX_ENCODER_STORE_INDEX           10
  ------------------
  |  Branch (603:5): [True: 0, False: 16]
  ------------------
  604|      0|        return ctx->encoder_store;
  605|      0|    case OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX:
  ------------------
  |  |  115|      0|# define OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX      15
  ------------------
  |  Branch (605:5): [True: 0, False: 16]
  ------------------
  606|      0|        return ctx->store_loader_store;
  607|      0|    case OSSL_LIB_CTX_SELF_TEST_CB_INDEX:
  ------------------
  |  |  112|      0|# define OSSL_LIB_CTX_SELF_TEST_CB_INDEX            12
  ------------------
  |  Branch (607:5): [True: 0, False: 16]
  ------------------
  608|      0|        return ctx->self_test_cb;
  609|      0|    case OSSL_LIB_CTX_INDICATOR_CB_INDEX:
  ------------------
  |  |  122|      0|# define OSSL_LIB_CTX_INDICATOR_CB_INDEX            22
  ------------------
  |  Branch (609:5): [True: 0, False: 16]
  ------------------
  610|      0|        return ctx->indicator_cb;
  611|      0|#endif
  612|      0|#ifndef OPENSSL_NO_THREAD_POOL
  613|      0|    case OSSL_LIB_CTX_THREAD_INDEX:
  ------------------
  |  |  119|      0|# define OSSL_LIB_CTX_THREAD_INDEX                  19
  ------------------
  |  Branch (613:5): [True: 0, False: 16]
  ------------------
  614|      0|        return ctx->threads;
  615|      0|#endif
  616|       |
  617|       |#ifdef FIPS_MODULE
  618|       |    case OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX:
  619|       |        return ctx->thread_event_handler;
  620|       |
  621|       |    case OSSL_LIB_CTX_FIPS_PROV_INDEX:
  622|       |        return ctx->fips_prov;
  623|       |#endif
  624|       |
  625|      0|    case OSSL_LIB_CTX_COMP_METHODS:
  ------------------
  |  |  121|      0|# define OSSL_LIB_CTX_COMP_METHODS                  21
  ------------------
  |  Branch (625:5): [True: 0, False: 16]
  ------------------
  626|      0|        return (void *)&ctx->comp_methods;
  627|       |
  628|      0|    default:
  ------------------
  |  Branch (628:5): [True: 0, False: 16]
  ------------------
  629|      0|        return NULL;
  630|     16|    }
  631|     16|}
ossl_lib_ctx_get_ex_data_global:
  639|  7.27k|{
  640|  7.27k|    ctx = ossl_lib_ctx_get_concrete(ctx);
  641|  7.27k|    if (ctx == NULL)
  ------------------
  |  Branch (641:9): [True: 0, False: 7.27k]
  ------------------
  642|      0|        return NULL;
  643|  7.27k|    return &ctx->global;
  644|  7.27k|}
context.c:context_deinit:
  370|      2|{
  371|      2|    if (ctx == NULL)
  ------------------
  |  Branch (371:9): [True: 0, False: 2]
  ------------------
  372|      0|        return 1;
  373|       |
  374|      2|    ossl_ctx_thread_stop(ctx);
  375|       |
  376|      2|    context_deinit_objs(ctx);
  377|       |
  378|      2|    ossl_crypto_cleanup_all_ex_data_int(ctx);
  379|       |
  380|      2|    CRYPTO_THREAD_lock_free(ctx->lock);
  381|      2|    ctx->lock = NULL;
  382|      2|    CRYPTO_THREAD_cleanup_local(&ctx->rcu_local_key);
  383|      2|    return 1;
  384|      2|}
context.c:context_deinit_objs:
  235|      2|{
  236|       |    /* P2. We want evp_method_store to be cleaned up before the provider store */
  237|      2|    if (ctx->evp_method_store != NULL) {
  ------------------
  |  Branch (237:9): [True: 2, False: 0]
  ------------------
  238|      2|        ossl_method_store_free(ctx->evp_method_store);
  239|      2|        ctx->evp_method_store = NULL;
  240|      2|    }
  241|       |
  242|       |    /* P2. */
  243|      2|    if (ctx->drbg != NULL) {
  ------------------
  |  Branch (243:9): [True: 2, False: 0]
  ------------------
  244|      2|        ossl_rand_ctx_free(ctx->drbg);
  245|      2|        ctx->drbg = NULL;
  246|      2|    }
  247|       |
  248|      2|#ifndef FIPS_MODULE
  249|       |    /* P2. */
  250|      2|    if (ctx->provider_conf != NULL) {
  ------------------
  |  Branch (250:9): [True: 2, False: 0]
  ------------------
  251|      2|        ossl_prov_conf_ctx_free(ctx->provider_conf);
  252|      2|        ctx->provider_conf = NULL;
  253|      2|    }
  254|       |
  255|       |    /*
  256|       |     * P2. We want decoder_store/decoder_cache to be cleaned up before the
  257|       |     * provider store
  258|       |     */
  259|      2|    if (ctx->decoder_store != NULL) {
  ------------------
  |  Branch (259:9): [True: 2, False: 0]
  ------------------
  260|      2|        ossl_method_store_free(ctx->decoder_store);
  261|      2|        ctx->decoder_store = NULL;
  262|      2|    }
  263|      2|    if (ctx->decoder_cache != NULL) {
  ------------------
  |  Branch (263:9): [True: 2, False: 0]
  ------------------
  264|      2|        ossl_decoder_cache_free(ctx->decoder_cache);
  265|      2|        ctx->decoder_cache = NULL;
  266|      2|    }
  267|       |
  268|       |
  269|       |    /* P2. We want encoder_store to be cleaned up before the provider store */
  270|      2|    if (ctx->encoder_store != NULL) {
  ------------------
  |  Branch (270:9): [True: 2, False: 0]
  ------------------
  271|      2|        ossl_method_store_free(ctx->encoder_store);
  272|      2|        ctx->encoder_store = NULL;
  273|      2|    }
  274|       |
  275|       |    /* P2. We want loader_store to be cleaned up before the provider store */
  276|      2|    if (ctx->store_loader_store != NULL) {
  ------------------
  |  Branch (276:9): [True: 2, False: 0]
  ------------------
  277|      2|        ossl_method_store_free(ctx->store_loader_store);
  278|      2|        ctx->store_loader_store = NULL;
  279|      2|    }
  280|      2|#endif
  281|       |
  282|       |    /* P1. Needs to be freed before the child provider data is freed */
  283|      2|    if (ctx->provider_store != NULL) {
  ------------------
  |  Branch (283:9): [True: 2, False: 0]
  ------------------
  284|      2|        ossl_provider_store_free(ctx->provider_store);
  285|      2|        ctx->provider_store = NULL;
  286|      2|    }
  287|       |
  288|       |    /* Default priority. */
  289|      2|    if (ctx->property_string_data != NULL) {
  ------------------
  |  Branch (289:9): [True: 2, False: 0]
  ------------------
  290|      2|        ossl_property_string_data_free(ctx->property_string_data);
  291|      2|        ctx->property_string_data = NULL;
  292|      2|    }
  293|       |
  294|      2|    if (ctx->namemap != NULL) {
  ------------------
  |  Branch (294:9): [True: 2, False: 0]
  ------------------
  295|      2|        ossl_stored_namemap_free(ctx->namemap);
  296|      2|        ctx->namemap = NULL;
  297|      2|    }
  298|       |
  299|      2|    if (ctx->property_defns != NULL) {
  ------------------
  |  Branch (299:9): [True: 2, False: 0]
  ------------------
  300|      2|        ossl_property_defns_free(ctx->property_defns);
  301|      2|        ctx->property_defns = NULL;
  302|      2|    }
  303|       |
  304|      2|    if (ctx->global_properties != NULL) {
  ------------------
  |  Branch (304:9): [True: 2, False: 0]
  ------------------
  305|      2|        ossl_ctx_global_properties_free(ctx->global_properties);
  306|      2|        ctx->global_properties = NULL;
  307|      2|    }
  308|       |
  309|      2|#ifndef FIPS_MODULE
  310|      2|    if (ctx->bio_core != NULL) {
  ------------------
  |  Branch (310:9): [True: 2, False: 0]
  ------------------
  311|      2|        ossl_bio_core_globals_free(ctx->bio_core);
  312|      2|        ctx->bio_core = NULL;
  313|      2|    }
  314|      2|#endif
  315|       |
  316|      2|    if (ctx->drbg_nonce != NULL) {
  ------------------
  |  Branch (316:9): [True: 2, False: 0]
  ------------------
  317|      2|        ossl_prov_drbg_nonce_ctx_free(ctx->drbg_nonce);
  318|      2|        ctx->drbg_nonce = NULL;
  319|      2|    }
  320|       |
  321|      2|#ifndef FIPS_MODULE
  322|      2|    if (ctx->indicator_cb != NULL) {
  ------------------
  |  Branch (322:9): [True: 2, False: 0]
  ------------------
  323|      2|        ossl_indicator_set_callback_free(ctx->indicator_cb);
  324|      2|        ctx->indicator_cb = NULL;
  325|      2|    }
  326|       |
  327|      2|    if (ctx->self_test_cb != NULL) {
  ------------------
  |  Branch (327:9): [True: 2, False: 0]
  ------------------
  328|      2|        ossl_self_test_set_callback_free(ctx->self_test_cb);
  329|      2|        ctx->self_test_cb = NULL;
  330|      2|    }
  331|      2|#endif
  332|       |
  333|       |#ifdef FIPS_MODULE
  334|       |    if (ctx->thread_event_handler != NULL) {
  335|       |        ossl_thread_event_ctx_free(ctx->thread_event_handler);
  336|       |        ctx->thread_event_handler = NULL;
  337|       |    }
  338|       |
  339|       |    if (ctx->fips_prov != NULL) {
  340|       |        ossl_fips_prov_ossl_ctx_free(ctx->fips_prov);
  341|       |        ctx->fips_prov = NULL;
  342|       |    }
  343|       |#endif
  344|       |
  345|      2|#ifndef OPENSSL_NO_THREAD_POOL
  346|      2|    if (ctx->threads != NULL) {
  ------------------
  |  Branch (346:9): [True: 2, False: 0]
  ------------------
  347|      2|        ossl_threads_ctx_free(ctx->threads);
  348|      2|        ctx->threads = NULL;
  349|      2|    }
  350|      2|#endif
  351|       |
  352|       |    /* Low priority. */
  353|      2|#ifndef FIPS_MODULE
  354|      2|    if (ctx->child_provider != NULL) {
  ------------------
  |  Branch (354:9): [True: 2, False: 0]
  ------------------
  355|      2|        ossl_child_prov_ctx_free(ctx->child_provider);
  356|      2|        ctx->child_provider = NULL;
  357|      2|    }
  358|      2|#endif
  359|       |
  360|      2|#ifndef FIPS_MODULE
  361|      2|    if (ctx->comp_methods != NULL) {
  ------------------
  |  Branch (361:9): [True: 2, False: 0]
  ------------------
  362|      2|        ossl_free_compression_methods_int(ctx->comp_methods);
  363|      2|        ctx->comp_methods = NULL;
  364|      2|    }
  365|      2|#endif
  366|       |
  367|      2|}
context.c:context_init:
   92|      2|{
   93|      2|    int exdata_done = 0;
   94|       |
   95|      2|    if (!CRYPTO_THREAD_init_local(&ctx->rcu_local_key, NULL))
  ------------------
  |  Branch (95:9): [True: 0, False: 2]
  ------------------
   96|      0|        return 0;
   97|       |
   98|      2|    ctx->lock = CRYPTO_THREAD_lock_new();
   99|      2|    if (ctx->lock == NULL)
  ------------------
  |  Branch (99:9): [True: 0, False: 2]
  ------------------
  100|      0|        goto err;
  101|       |
  102|       |    /* Initialize ex_data. */
  103|      2|    if (!ossl_do_ex_data_init(ctx))
  ------------------
  |  Branch (103:9): [True: 0, False: 2]
  ------------------
  104|      0|        goto err;
  105|      2|    exdata_done = 1;
  106|       |
  107|       |    /* P2. We want evp_method_store to be cleaned up before the provider store */
  108|      2|    ctx->evp_method_store = ossl_method_store_new(ctx);
  109|      2|    if (ctx->evp_method_store == NULL)
  ------------------
  |  Branch (109:9): [True: 0, False: 2]
  ------------------
  110|      0|        goto err;
  111|      2|    OSSL_TRACE1(QUERY, "context_init: allocating store %p\n", ctx->evp_method_store);
  ------------------
  |  |  291|      2|    OSSL_TRACEV(category, (trc_out, format, arg1))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  112|       |
  113|      2|#ifndef FIPS_MODULE
  114|       |    /* P2. Must be freed before the provider store is freed */
  115|      2|    ctx->provider_conf = ossl_prov_conf_ctx_new(ctx);
  116|      2|    if (ctx->provider_conf == NULL)
  ------------------
  |  Branch (116:9): [True: 0, False: 2]
  ------------------
  117|      0|        goto err;
  118|      2|#endif
  119|       |
  120|       |    /* P2. */
  121|      2|    ctx->drbg = ossl_rand_ctx_new(ctx);
  122|      2|    if (ctx->drbg == NULL)
  ------------------
  |  Branch (122:9): [True: 0, False: 2]
  ------------------
  123|      0|        goto err;
  124|       |
  125|      2|#ifndef FIPS_MODULE
  126|       |    /*
  127|       |     * P2. We want decoder_store/decoder_cache to be cleaned up before the
  128|       |     * provider store
  129|       |     */
  130|      2|    ctx->decoder_store = ossl_method_store_new(ctx);
  131|      2|    if (ctx->decoder_store == NULL)
  ------------------
  |  Branch (131:9): [True: 0, False: 2]
  ------------------
  132|      0|        goto err;
  133|      2|    ctx->decoder_cache = ossl_decoder_cache_new(ctx);
  134|      2|    if (ctx->decoder_cache == NULL)
  ------------------
  |  Branch (134:9): [True: 0, False: 2]
  ------------------
  135|      0|        goto err;
  136|       |
  137|       |    /* P2. We want encoder_store to be cleaned up before the provider store */
  138|      2|    ctx->encoder_store = ossl_method_store_new(ctx);
  139|      2|    if (ctx->encoder_store == NULL)
  ------------------
  |  Branch (139:9): [True: 0, False: 2]
  ------------------
  140|      0|        goto err;
  141|       |
  142|       |    /* P2. We want loader_store to be cleaned up before the provider store */
  143|      2|    ctx->store_loader_store = ossl_method_store_new(ctx);
  144|      2|    if (ctx->store_loader_store == NULL)
  ------------------
  |  Branch (144:9): [True: 0, False: 2]
  ------------------
  145|      0|        goto err;
  146|      2|#endif
  147|       |
  148|       |    /* P1. Needs to be freed before the child provider data is freed */
  149|      2|    ctx->provider_store = ossl_provider_store_new(ctx);
  150|      2|    if (ctx->provider_store == NULL)
  ------------------
  |  Branch (150:9): [True: 0, False: 2]
  ------------------
  151|      0|        goto err;
  152|       |
  153|       |    /* Default priority. */
  154|      2|    ctx->property_string_data = ossl_property_string_data_new(ctx);
  155|      2|    if (ctx->property_string_data == NULL)
  ------------------
  |  Branch (155:9): [True: 0, False: 2]
  ------------------
  156|      0|        goto err;
  157|       |
  158|      2|    ctx->namemap = ossl_stored_namemap_new(ctx);
  159|      2|    if (ctx->namemap == NULL)
  ------------------
  |  Branch (159:9): [True: 0, False: 2]
  ------------------
  160|      0|        goto err;
  161|       |
  162|      2|    ctx->property_defns = ossl_property_defns_new(ctx);
  163|      2|    if (ctx->property_defns == NULL)
  ------------------
  |  Branch (163:9): [True: 0, False: 2]
  ------------------
  164|      0|        goto err;
  165|       |
  166|      2|    ctx->global_properties = ossl_ctx_global_properties_new(ctx);
  167|      2|    if (ctx->global_properties == NULL)
  ------------------
  |  Branch (167:9): [True: 0, False: 2]
  ------------------
  168|      0|        goto err;
  169|       |
  170|      2|#ifndef FIPS_MODULE
  171|      2|    ctx->bio_core = ossl_bio_core_globals_new(ctx);
  172|      2|    if (ctx->bio_core == NULL)
  ------------------
  |  Branch (172:9): [True: 0, False: 2]
  ------------------
  173|      0|        goto err;
  174|      2|#endif
  175|       |
  176|      2|    ctx->drbg_nonce = ossl_prov_drbg_nonce_ctx_new(ctx);
  177|      2|    if (ctx->drbg_nonce == NULL)
  ------------------
  |  Branch (177:9): [True: 0, False: 2]
  ------------------
  178|      0|        goto err;
  179|       |
  180|      2|#ifndef FIPS_MODULE
  181|      2|    ctx->self_test_cb = ossl_self_test_set_callback_new(ctx);
  182|      2|    if (ctx->self_test_cb == NULL)
  ------------------
  |  Branch (182:9): [True: 0, False: 2]
  ------------------
  183|      0|        goto err;
  184|      2|    ctx->indicator_cb = ossl_indicator_set_callback_new(ctx);
  185|      2|    if (ctx->indicator_cb == NULL)
  ------------------
  |  Branch (185:9): [True: 0, False: 2]
  ------------------
  186|      0|        goto err;
  187|      2|#endif
  188|       |
  189|       |#ifdef FIPS_MODULE
  190|       |    ctx->thread_event_handler = ossl_thread_event_ctx_new(ctx);
  191|       |    if (ctx->thread_event_handler == NULL)
  192|       |        goto err;
  193|       |
  194|       |    ctx->fips_prov = ossl_fips_prov_ossl_ctx_new(ctx);
  195|       |    if (ctx->fips_prov == NULL)
  196|       |        goto err;
  197|       |#endif
  198|       |
  199|      2|#ifndef OPENSSL_NO_THREAD_POOL
  200|      2|    ctx->threads = ossl_threads_ctx_new(ctx);
  201|      2|    if (ctx->threads == NULL)
  ------------------
  |  Branch (201:9): [True: 0, False: 2]
  ------------------
  202|      0|        goto err;
  203|      2|#endif
  204|       |
  205|       |    /* Low priority. */
  206|      2|#ifndef FIPS_MODULE
  207|      2|    ctx->child_provider = ossl_child_prov_ctx_new(ctx);
  208|      2|    if (ctx->child_provider == NULL)
  ------------------
  |  Branch (208:9): [True: 0, False: 2]
  ------------------
  209|      0|        goto err;
  210|      2|#endif
  211|       |
  212|       |    /* Everything depends on properties, so we also pre-initialise that */
  213|      2|    if (!ossl_property_parse_init(ctx))
  ------------------
  |  Branch (213:9): [True: 0, False: 2]
  ------------------
  214|      0|        goto err;
  215|       |
  216|      2|#ifndef FIPS_MODULE
  217|      2|    ctx->comp_methods = ossl_load_builtin_compressions();
  218|      2|#endif
  219|       |
  220|      2|    return 1;
  221|       |
  222|      0| err:
  223|      0|    context_deinit_objs(ctx);
  224|       |
  225|      0|    if (exdata_done)
  ------------------
  |  Branch (225:9): [True: 0, False: 0]
  ------------------
  226|      0|        ossl_crypto_cleanup_all_ex_data_int(ctx);
  227|       |
  228|      0|    CRYPTO_THREAD_lock_free(ctx->lock);
  229|      0|    CRYPTO_THREAD_cleanup_local(&ctx->rcu_local_key);
  230|      0|    memset(ctx, '\0', sizeof(*ctx));
  231|      0|    return 0;
  232|      2|}
context.c:default_context_do_init:
  395|      2|{
  396|      2|    if (!CRYPTO_THREAD_init_local(&default_context_thread_local, NULL))
  ------------------
  |  Branch (396:9): [True: 0, False: 2]
  ------------------
  397|      0|        goto err;
  398|       |
  399|      2|    if (!context_init(&default_context_int))
  ------------------
  |  Branch (399:9): [True: 0, False: 2]
  ------------------
  400|      0|        goto deinit_thread;
  401|       |
  402|      2|    default_context_inited = 1;
  403|      2|    return 1;
  404|       |
  405|      0|deinit_thread:
  406|      0|    CRYPTO_THREAD_cleanup_local(&default_context_thread_local);
  407|      0|err:
  408|      0|    return 0;
  409|      0|}
context.c:get_default_context:
  429|  7.27k|{
  430|  7.27k|    OSSL_LIB_CTX *current_defctx = get_thread_default_context();
  431|       |
  432|  7.27k|    if (current_defctx == NULL && default_context_inited)
  ------------------
  |  Branch (432:9): [True: 7.27k, False: 0]
  |  Branch (432:35): [True: 7.27k, False: 0]
  ------------------
  433|  7.27k|        current_defctx = &default_context_int;
  434|  7.27k|    return current_defctx;
  435|  7.27k|}
context.c:get_thread_default_context:
  421|  7.27k|{
  422|  7.27k|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|  7.27k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 7.27k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (422:9): [True: 0, False: 7.27k]
  ------------------
  423|      0|        return NULL;
  424|       |
  425|  7.27k|    return CRYPTO_THREAD_get_local(&default_context_thread_local);
  426|  7.27k|}

ossl_stored_namemap_new:
   56|      2|{
   57|      2|    OSSL_NAMEMAP *namemap = ossl_namemap_new(libctx);
   58|       |
   59|      2|    if (namemap != NULL)
  ------------------
  |  Branch (59:9): [True: 2, False: 0]
  ------------------
   60|      2|        namemap->stored = 1;
   61|       |
   62|      2|    return namemap;
   63|      2|}
ossl_stored_namemap_free:
   66|      2|{
   67|      2|    OSSL_NAMEMAP *namemap = vnamemap;
   68|       |
   69|      2|    if (namemap != NULL) {
  ------------------
  |  Branch (69:9): [True: 2, False: 0]
  ------------------
   70|       |        /* Pretend it isn't stored, or ossl_namemap_free() will do nothing */
   71|      2|        namemap->stored = 0;
   72|      2|        ossl_namemap_free(namemap);
   73|      2|    }
   74|      2|}
ossl_namemap_new:
  522|      2|{
  523|      2|    OSSL_NAMEMAP *namemap;
  524|      2|    HT_CONFIG htconf = { NULL, NULL, NULL, NAMEMAP_HT_BUCKETS, 1, 1 };
  ------------------
  |  |   16|      2|#define NAMEMAP_HT_BUCKETS 2048
  ------------------
  525|       |
  526|      2|    htconf.ctx = libctx;
  527|       |
  528|      2|    if ((namemap = OPENSSL_zalloc(sizeof(*namemap))) == NULL)
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (528:9): [True: 0, False: 2]
  ------------------
  529|      0|        goto err;
  530|       |
  531|      2|    if ((namemap->lock = CRYPTO_THREAD_lock_new()) == NULL)
  ------------------
  |  Branch (531:9): [True: 0, False: 2]
  ------------------
  532|      0|        goto err;
  533|       |
  534|      2|    if ((namemap->namenum_ht = ossl_ht_new(&htconf)) == NULL)
  ------------------
  |  Branch (534:9): [True: 0, False: 2]
  ------------------
  535|      0|        goto err;
  536|       |
  537|      2|    if ((namemap->numnames = sk_NAMES_new_null()) == NULL)
  ------------------
  |  Branch (537:9): [True: 0, False: 2]
  ------------------
  538|      0|        goto err;
  539|       |
  540|      2|    return namemap;
  541|       |
  542|      0| err:
  543|      0|    ossl_namemap_free(namemap);
  544|      0|    return NULL;
  545|      2|}
ossl_namemap_free:
  548|      2|{
  549|      2|    if (namemap == NULL || namemap->stored)
  ------------------
  |  Branch (549:9): [True: 0, False: 2]
  |  Branch (549:28): [True: 0, False: 2]
  ------------------
  550|      0|        return;
  551|       |
  552|      2|    sk_NAMES_pop_free(namemap->numnames, names_free);
  553|       |
  554|      2|    ossl_ht_free(namemap->namenum_ht);
  555|       |
  556|      2|    CRYPTO_THREAD_lock_free(namemap->lock);
  557|      2|    OPENSSL_free(namemap);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  558|      2|}

ossl_err_load_CRYPTO_strings:
   83|      2|{
   84|      2|#ifndef OPENSSL_NO_ERR
   85|      2|    if (ERR_reason_error_string(CRYPTO_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (85:9): [True: 2, False: 0]
  ------------------
   86|      2|        ERR_load_strings_const(CRYPTO_str_reasons);
   87|      2|#endif
   88|      2|    return 1;
   89|      2|}

OPENSSL_cpuid_setup:
   96|      2|{
   97|      2|    static int trigger = 0;
   98|      2|    IA32CAP OPENSSL_ia32_cpuid(unsigned int *);
   99|      2|    IA32CAP vec;
  100|      2|    const variant_char *env;
  101|      2|    int index = 2;
  102|       |
  103|      2|    if (trigger)
  ------------------
  |  Branch (103:9): [True: 0, False: 2]
  ------------------
  104|      0|        return;
  105|       |
  106|      2|    trigger = 1;
  107|      2|    if ((env = ossl_getenv("OPENSSL_ia32cap")) != NULL) {
  ------------------
  |  |   47|      2|#   define ossl_getenv getenv
  ------------------
  |  Branch (107:9): [True: 0, False: 2]
  ------------------
  108|      0|        int off = (env[0] == '~') ? 1 : 0;
  ------------------
  |  Branch (108:19): [True: 0, False: 0]
  ------------------
  109|       |
  110|      0|        vec = ossl_strtouint64(env + off);
  111|       |
  112|      0|        if (off) {
  ------------------
  |  Branch (112:13): [True: 0, False: 0]
  ------------------
  113|      0|            IA32CAP mask = vec;
  114|      0|            vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P) & ~mask;
  115|      0|            if (mask & (1<<24)) {
  ------------------
  |  Branch (115:17): [True: 0, False: 0]
  ------------------
  116|       |                /*
  117|       |                 * User disables FXSR bit, mask even other capabilities
  118|       |                 * that operate exclusively on XMM, so we don't have to
  119|       |                 * double-check all the time. We mask PCLMULQDQ, AMD XOP,
  120|       |                 * AES-NI and AVX. Formally speaking we don't have to
  121|       |                 * do it in x86_64 case, but we can safely assume that
  122|       |                 * x86_64 users won't actually flip this flag.
  123|       |                 */
  124|      0|                vec &= ~((IA32CAP)(1<<1|1<<11|1<<25|1<<28) << 32);
  125|      0|            }
  126|      0|        } else if (env[0] == ':') {
  ------------------
  |  Branch (126:20): [True: 0, False: 0]
  ------------------
  127|      0|            vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P);
  128|      0|        }
  129|       |
  130|       |        /* Processed indexes 0, 1 */
  131|      0|        if ((env = ossl_strchr(env, ':')) != NULL)
  ------------------
  |  Branch (131:13): [True: 0, False: 0]
  ------------------
  132|      0|            env++;
  133|      0|        for (; index < OPENSSL_IA32CAP_P_MAX_INDEXES; index += 2) {
  ------------------
  |  |   39|      0|#  define OPENSSL_IA32CAP_P_MAX_INDEXES 10
  ------------------
  |  Branch (133:16): [True: 0, False: 0]
  ------------------
  134|      0|            if ((env != NULL) && (env[0] != '\0')) {
  ------------------
  |  Branch (134:17): [True: 0, False: 0]
  |  Branch (134:34): [True: 0, False: 0]
  ------------------
  135|       |                /* if env[0] == ':' current index is skipped */
  136|      0|                if (env[0] != ':') {
  ------------------
  |  Branch (136:21): [True: 0, False: 0]
  ------------------
  137|      0|                    IA32CAP vecx;
  138|       |
  139|      0|                    off = (env[0] == '~') ? 1 : 0;
  ------------------
  |  Branch (139:27): [True: 0, False: 0]
  ------------------
  140|      0|                    vecx = ossl_strtouint64(env + off);
  141|      0|                    if (off) {
  ------------------
  |  Branch (141:25): [True: 0, False: 0]
  ------------------
  142|      0|                        OPENSSL_ia32cap_P[index] &= ~(unsigned int)vecx;
  143|      0|                        OPENSSL_ia32cap_P[index + 1] &= ~(unsigned int)(vecx >> 32);
  144|      0|                    } else {
  145|      0|                        OPENSSL_ia32cap_P[index] = (unsigned int)vecx;
  146|      0|                        OPENSSL_ia32cap_P[index + 1] = (unsigned int)(vecx >> 32);
  147|      0|                    }
  148|      0|                }
  149|       |                /* skip delimeter */
  150|      0|                if ((env = ossl_strchr(env, ':')) != NULL)
  ------------------
  |  Branch (150:21): [True: 0, False: 0]
  ------------------
  151|      0|                    env++;
  152|      0|            } else { /* zeroize the next two indexes */
  153|      0|                OPENSSL_ia32cap_P[index] = 0;
  154|      0|                OPENSSL_ia32cap_P[index + 1] = 0;
  155|      0|            }
  156|      0|        }
  157|       |
  158|       |        /* If AVX10 is disabled, zero out its detailed cap bits */
  159|      0|        if (!(OPENSSL_ia32cap_P[6] & (1 << 19)))
  ------------------
  |  Branch (159:13): [True: 0, False: 0]
  ------------------
  160|      0|            OPENSSL_ia32cap_P[9] = 0;
  161|      2|    } else {
  162|      2|        vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P);
  163|      2|    }
  164|       |
  165|       |    /*
  166|       |     * |(1<<10) sets a reserved bit to signal that variable
  167|       |     * was initialized already... This is to avoid interference
  168|       |     * with cpuid snippets in ELF .init segment.
  169|       |     */
  170|      2|    OPENSSL_ia32cap_P[0] = (unsigned int)vec | (1 << 10);
  171|      2|    OPENSSL_ia32cap_P[1] = (unsigned int)(vec >> 32);
  172|      2|}

ossl_err_load_CRMF_strings:
   78|      2|{
   79|      2|# ifndef OPENSSL_NO_ERR
   80|      2|    if (ERR_reason_error_string(CRMF_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (80:9): [True: 2, False: 0]
  ------------------
   81|      2|        ERR_load_strings_const(CRMF_str_reasons);
   82|      2|# endif
   83|      2|    return 1;
   84|      2|}

ossl_err_load_CT_strings:
   52|      2|{
   53|      2|# ifndef OPENSSL_NO_ERR
   54|      2|    if (ERR_reason_error_string(CT_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (54:9): [True: 2, False: 0]
  ------------------
   55|      2|        ERR_load_strings_const(CT_str_reasons);
   56|      2|# endif
   57|      2|    return 1;
   58|      2|}

ossl_ctype_check:
  253|  35.5M|{
  254|  35.5M|    const int max = sizeof(ctype_char_map) / sizeof(*ctype_char_map);
  255|  35.5M|    const int a = ossl_toascii(c);
  ------------------
  |  |   56|  35.5M|#  define ossl_toascii(c)       (c)
  ------------------
  256|       |
  257|  35.5M|    return a >= 0 && a < max && (ctype_char_map[a] & mask) != 0;
  ------------------
  |  Branch (257:12): [True: 31.7M, False: 3.76M]
  |  Branch (257:22): [True: 31.7M, False: 0]
  |  Branch (257:33): [True: 21.9M, False: 9.86M]
  ------------------
  258|  35.5M|}

ossl_err_load_DH_strings:
   68|      2|{
   69|      2|# ifndef OPENSSL_NO_ERR
   70|      2|    if (ERR_reason_error_string(DH_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (70:9): [True: 2, False: 0]
  ------------------
   71|      2|        ERR_load_strings_const(DH_str_reasons);
   72|      2|# endif
   73|      2|    return 1;
   74|      2|}

ossl_err_load_DSA_strings:
   46|      2|{
   47|      2|# ifndef OPENSSL_NO_ERR
   48|      2|    if (ERR_reason_error_string(DSA_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (48:9): [True: 2, False: 0]
  ------------------
   49|      2|        ERR_load_strings_const(DSA_str_reasons);
   50|      2|# endif
   51|      2|    return 1;
   52|      2|}

ossl_err_load_DSO_strings:
   50|      2|{
   51|      2|#ifndef OPENSSL_NO_ERR
   52|      2|    if (ERR_reason_error_string(DSO_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (52:9): [True: 2, False: 0]
  ------------------
   53|      2|        ERR_load_strings_const(DSO_str_reasons);
   54|      2|#endif
   55|      2|    return 1;
   56|      2|}

ossl_err_load_EC_strings:
  127|      2|{
  128|      2|# ifndef OPENSSL_NO_ERR
  129|      2|    if (ERR_reason_error_string(EC_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (129:9): [True: 2, False: 0]
  ------------------
  130|      2|        ERR_load_strings_const(EC_str_reasons);
  131|      2|# endif
  132|      2|    return 1;
  133|      2|}

ossl_decoder_cache_new:
  703|      2|{
  704|      2|    DECODER_CACHE *cache = OPENSSL_malloc(sizeof(*cache));
  ------------------
  |  |  102|      2|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  705|       |
  706|      2|    if (cache == NULL)
  ------------------
  |  Branch (706:9): [True: 0, False: 2]
  ------------------
  707|      0|        return NULL;
  708|       |
  709|      2|    cache->lock = CRYPTO_THREAD_lock_new();
  710|      2|    if (cache->lock == NULL) {
  ------------------
  |  Branch (710:9): [True: 0, False: 2]
  ------------------
  711|      0|        OPENSSL_free(cache);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  712|      0|        return NULL;
  713|      0|    }
  714|      2|    cache->hashtable = lh_DECODER_CACHE_ENTRY_new(decoder_cache_entry_hash,
  715|      2|                                                  decoder_cache_entry_cmp);
  716|      2|    if (cache->hashtable == NULL) {
  ------------------
  |  Branch (716:9): [True: 0, False: 2]
  ------------------
  717|      0|        CRYPTO_THREAD_lock_free(cache->lock);
  718|      0|        OPENSSL_free(cache);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  719|      0|        return NULL;
  720|      0|    }
  721|       |
  722|      2|    return cache;
  723|      2|}
ossl_decoder_cache_free:
  726|      2|{
  727|      2|    DECODER_CACHE *cache = (DECODER_CACHE *)vcache;
  728|       |
  729|      2|    lh_DECODER_CACHE_ENTRY_doall(cache->hashtable, decoder_cache_entry_free);
  730|      2|    lh_DECODER_CACHE_ENTRY_free(cache->hashtable);
  731|      2|    CRYPTO_THREAD_lock_free(cache->lock);
  732|      2|    OPENSSL_free(cache);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  733|      2|}

ossl_err_load_ENGINE_strings:
   85|      2|{
   86|      2|# ifndef OPENSSL_NO_ERR
   87|      2|    if (ERR_reason_error_string(ENGINE_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (87:9): [True: 2, False: 0]
  ------------------
   88|      2|        ERR_load_strings_const(ENGINE_str_reasons);
   89|      2|# endif
   90|      2|    return 1;
   91|      2|}

engine_cleanup_int:
  176|      2|{
  177|      2|    if (int_cleanup_check(0)) {
  ------------------
  |  Branch (177:9): [True: 0, False: 2]
  ------------------
  178|      0|        sk_ENGINE_CLEANUP_ITEM_pop_free(cleanup_stack,
  179|      0|                                        engine_cleanup_cb_free);
  180|      0|        cleanup_stack = NULL;
  181|      0|    }
  182|      2|    CRYPTO_THREAD_lock_free(global_engine_lock);
  183|      2|    global_engine_lock = NULL;
  184|      2|}
eng_lib.c:int_cleanup_check:
  119|      2|{
  120|      2|    if (cleanup_stack)
  ------------------
  |  Branch (120:9): [True: 0, False: 2]
  ------------------
  121|      0|        return 1;
  122|      2|    if (!create)
  ------------------
  |  Branch (122:9): [True: 2, False: 0]
  ------------------
  123|      2|        return 0;
  124|      0|    cleanup_stack = sk_ENGINE_CLEANUP_ITEM_new_null();
  125|      0|    return (cleanup_stack ? 1 : 0);
  ------------------
  |  Branch (125:13): [True: 0, False: 0]
  ------------------
  126|      2|}

OSSL_ERR_STATE_free:
  202|      2|{
  203|      2|    int i;
  204|       |
  205|      2|    if (state == NULL)
  ------------------
  |  Branch (205:9): [True: 0, False: 2]
  ------------------
  206|      0|        return;
  207|     34|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   55|     34|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (207:17): [True: 32, False: 2]
  ------------------
  208|     32|        err_clear(state, i, 1);
  209|     32|    }
  210|      2|    CRYPTO_free(state, OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  ------------------
                  CRYPTO_free(state, OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  ------------------
  211|      2|}
err_cleanup:
  233|      2|{
  234|      2|    if (set_err_thread_local != 0)
  ------------------
  |  Branch (234:9): [True: 2, False: 0]
  ------------------
  235|      2|        CRYPTO_THREAD_cleanup_local(&err_thread_local);
  236|      2|    CRYPTO_THREAD_lock_free(err_string_lock);
  237|      2|    err_string_lock = NULL;
  238|      2|#ifndef OPENSSL_NO_ERR
  239|      2|    lh_ERR_STRING_DATA_free(int_error_hash);
  ------------------
  |  |  376|      2|#define lh_ERR_STRING_DATA_free(lh) OPENSSL_LH_free(ossl_check_ERR_STRING_DATA_lh_type(lh))
  ------------------
  240|      2|    int_error_hash = NULL;
  241|      2|#endif
  242|      2|}
ossl_err_load_ERR_strings:
  272|     70|{
  273|     70|#ifndef OPENSSL_NO_ERR
  274|     70|    if (!RUN_ONCE(&err_string_init, do_err_strings_init))
  ------------------
  |  |  130|     70|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 70, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (274:9): [True: 0, False: 70]
  ------------------
  275|      0|        return 0;
  276|       |
  277|     70|    err_load_strings(ERR_str_libraries);
  278|     70|    err_load_strings(ERR_str_reasons);
  279|     70|#endif
  280|     70|    return 1;
  281|     70|}
ERR_load_strings_const:
  297|     68|{
  298|     68|#ifndef OPENSSL_NO_ERR
  299|     68|    if (ossl_err_load_ERR_strings() == 0)
  ------------------
  |  Branch (299:9): [True: 0, False: 68]
  ------------------
  300|      0|        return 0;
  301|     68|    err_load_strings(str);
  302|     68|#endif
  303|       |
  304|     68|    return 1;
  305|     68|}
ERR_clear_error:
  335|  1.21k|{
  336|  1.21k|    int i;
  337|  1.21k|    ERR_STATE *es;
  338|       |
  339|  1.21k|    es = ossl_err_get_state_int();
  340|  1.21k|    if (es == NULL)
  ------------------
  |  Branch (340:9): [True: 0, False: 1.21k]
  ------------------
  341|      0|        return;
  342|       |
  343|  20.6k|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   55|  20.6k|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (343:17): [True: 19.4k, False: 1.21k]
  ------------------
  344|  19.4k|        err_clear(es, i, 0);
  345|  19.4k|    }
  346|  1.21k|    es->top = es->bottom = 0;
  347|  1.21k|}
ERR_reason_error_string:
  613|     68|{
  614|     68|#ifndef OPENSSL_NO_ERR
  615|     68|    ERR_STRING_DATA d, *p = NULL;
  616|     68|    unsigned long l, r;
  617|       |
  618|     68|    if (!RUN_ONCE(&err_string_init, do_err_strings_init)) {
  ------------------
  |  |  130|     68|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 68, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (618:9): [True: 0, False: 68]
  ------------------
  619|      0|        return NULL;
  620|      0|    }
  621|       |
  622|       |    /*
  623|       |     * ERR_reason_error_string() can't safely return system error strings,
  624|       |     * since openssl_strerror_r() needs a buffer for thread safety, and we
  625|       |     * haven't got one that would serve any sensible purpose.
  626|       |     */
  627|     68|    if (ERR_SYSTEM_ERROR(e))
  ------------------
  |  |  239|     68|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|     68|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 68]
  |  |  ------------------
  ------------------
  628|      0|        return NULL;
  629|       |
  630|     68|    l = ERR_GET_LIB(e);
  631|     68|    r = ERR_GET_REASON(e);
  632|     68|    d.error = ERR_PACK(l, 0, r);
  ------------------
  |  |  279|     68|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|     68|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|     68|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|     68|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|     68|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
  633|     68|    p = int_err_get_item(&d);
  634|     68|    if (p == NULL) {
  ------------------
  |  Branch (634:9): [True: 68, False: 0]
  ------------------
  635|     68|        d.error = ERR_PACK(0, 0, r);
  ------------------
  |  |  279|     68|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|     68|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|     68|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|     68|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|     68|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
  636|     68|        p = int_err_get_item(&d);
  637|     68|    }
  638|     68|    return ((p == NULL) ? NULL : p->string);
  ------------------
  |  Branch (638:13): [True: 68, False: 0]
  ------------------
  639|       |#else
  640|       |    return NULL;
  641|       |#endif
  642|     68|}
ossl_err_get_state_int:
  673|  4.29k|{
  674|  4.29k|    ERR_STATE *state;
  675|  4.29k|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|  4.29k|# define get_last_sys_error()    errno
  ------------------
  676|       |
  677|  4.29k|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|  4.29k|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (677:9): [True: 0, False: 4.29k]
  ------------------
  678|      0|        return NULL;
  679|       |
  680|  4.29k|    if (!RUN_ONCE(&err_init, err_do_init))
  ------------------
  |  |  130|  4.29k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 4.29k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (680:9): [True: 0, False: 4.29k]
  ------------------
  681|      0|        return NULL;
  682|       |
  683|  4.29k|    state = CRYPTO_THREAD_get_local(&err_thread_local);
  684|  4.29k|    if (state == (ERR_STATE*)-1)
  ------------------
  |  Branch (684:9): [True: 0, False: 4.29k]
  ------------------
  685|      0|        return NULL;
  686|       |
  687|  4.29k|    if (state == NULL) {
  ------------------
  |  Branch (687:9): [True: 2, False: 4.29k]
  ------------------
  688|      2|        if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1))
  ------------------
  |  Branch (688:13): [True: 0, False: 2]
  ------------------
  689|      0|            return NULL;
  690|       |
  691|      2|        state = OSSL_ERR_STATE_new();
  692|      2|        if (state == NULL) {
  ------------------
  |  Branch (692:13): [True: 0, False: 2]
  ------------------
  693|      0|            CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  694|      0|            return NULL;
  695|      0|        }
  696|       |
  697|      2|        if (!ossl_init_thread_start(NULL, NULL, err_delete_thread_state)
  ------------------
  |  Branch (697:13): [True: 0, False: 2]
  ------------------
  698|      2|                || !CRYPTO_THREAD_set_local(&err_thread_local, state)) {
  ------------------
  |  Branch (698:20): [True: 0, False: 2]
  ------------------
  699|      0|            OSSL_ERR_STATE_free(state);
  700|      0|            CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  701|      0|            return NULL;
  702|      0|        }
  703|       |
  704|       |        /* Ignore failures from these */
  705|      2|        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
  ------------------
  |  |  467|      2|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
  706|      2|    }
  707|       |
  708|  4.29k|    set_sys_error(saveerrno);
  ------------------
  |  |   32|  4.29k|# define set_sys_error(e)        errno=(e)
  ------------------
  709|  4.29k|    return state;
  710|  4.29k|}
err_shelve_state:
  725|      2|{
  726|      2|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|      2|# define get_last_sys_error()    errno
  ------------------
  727|       |
  728|       |    /*
  729|       |     * Note, at present our only caller is OPENSSL_init_crypto(), indirectly
  730|       |     * via ossl_init_load_crypto_nodelete(), by which point the requested
  731|       |     * "base" initialization has already been performed, so the below call is a
  732|       |     * NOOP, that re-enters OPENSSL_init_crypto() only to quickly return.
  733|       |     *
  734|       |     * If are no other valid callers of this function, the call below can be
  735|       |     * removed, avoiding the re-entry into OPENSSL_init_crypto().  If there are
  736|       |     * potential uses that are not from inside OPENSSL_init_crypto(), then this
  737|       |     * call is needed, but some care is required to make sure that the re-entry
  738|       |     * remains a NOOP.
  739|       |     */
  740|      2|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|      2|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (740:9): [True: 0, False: 2]
  ------------------
  741|      0|        return 0;
  742|       |
  743|      2|    if (!RUN_ONCE(&err_init, err_do_init))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (743:9): [True: 0, False: 2]
  ------------------
  744|      0|        return 0;
  745|       |
  746|      2|    *state = CRYPTO_THREAD_get_local(&err_thread_local);
  747|      2|    if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1))
  ------------------
  |  Branch (747:9): [True: 0, False: 2]
  ------------------
  748|      0|        return 0;
  749|       |
  750|      2|    set_sys_error(saveerrno);
  ------------------
  |  |   32|      2|# define set_sys_error(e)        errno=(e)
  ------------------
  751|      2|    return 1;
  752|      2|}
err_unshelve_state:
  759|      2|{
  760|      2|    if (state != (void*)-1)
  ------------------
  |  Branch (760:9): [True: 2, False: 0]
  ------------------
  761|      2|        CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)state);
  762|      2|}
err.c:do_err_strings_init:
  214|      2|{
  215|      2|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|      2|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (215:9): [True: 0, False: 2]
  ------------------
  216|      0|        return 0;
  217|      2|    err_string_lock = CRYPTO_THREAD_lock_new();
  218|      2|    if (err_string_lock == NULL)
  ------------------
  |  Branch (218:9): [True: 0, False: 2]
  ------------------
  219|      0|        return 0;
  220|      2|#ifndef OPENSSL_NO_ERR
  221|      2|    int_error_hash = lh_ERR_STRING_DATA_new(err_string_data_hash,
  ------------------
  |  |  375|      2|#define lh_ERR_STRING_DATA_new(hfn, cmp) ((LHASH_OF(ERR_STRING_DATA) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new(ossl_check_ERR_STRING_DATA_lh_hashfunc_type(hfn), ossl_check_ERR_STRING_DATA_lh_compfunc_type(cmp)), lh_ERR_STRING_DATA_hash_thunk, lh_ERR_STRING_DATA_comp_thunk, lh_ERR_STRING_DATA_doall_thunk, lh_ERR_STRING_DATA_doall_arg_thunk))
  ------------------
  222|      2|                                            err_string_data_cmp);
  223|      2|    if (int_error_hash == NULL) {
  ------------------
  |  Branch (223:9): [True: 0, False: 2]
  ------------------
  224|      0|        CRYPTO_THREAD_lock_free(err_string_lock);
  225|      0|        err_string_lock = NULL;
  226|      0|        return 0;
  227|      0|    }
  228|      2|#endif
  229|      2|    return 1;
  230|      2|}
err.c:err_string_data_hash:
  172|  8.75k|{
  173|  8.75k|    unsigned long ret, l;
  174|       |
  175|  8.75k|    l = a->error;
  176|  8.75k|    ret = l ^ ERR_GET_LIB(l);
  177|  8.75k|    return (ret ^ ret % 19 * 13);
  178|  8.75k|}
err.c:err_string_data_cmp:
  182|  5.89k|{
  183|  5.89k|    if (a->error == b->error)
  ------------------
  |  Branch (183:9): [True: 5.57k, False: 316]
  ------------------
  184|  5.57k|        return 0;
  185|    316|    return a->error > b->error ? 1 : -1;
  ------------------
  |  Branch (185:12): [True: 168, False: 148]
  ------------------
  186|  5.89k|}
err.c:err_load_strings:
  260|    208|{
  261|    208|    if (!CRYPTO_THREAD_write_lock(err_string_lock))
  ------------------
  |  Branch (261:9): [True: 0, False: 208]
  ------------------
  262|      0|        return 0;
  263|  8.83k|    for (; str->error; str++)
  ------------------
  |  Branch (263:12): [True: 8.62k, False: 208]
  ------------------
  264|  8.62k|        (void)lh_ERR_STRING_DATA_insert(int_error_hash,
  ------------------
  |  |  378|  8.83k|#define lh_ERR_STRING_DATA_insert(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_insert(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_ERR_STRING_DATA_lh_plain_type(ptr)))
  ------------------
  265|    208|                                       (ERR_STRING_DATA *)str);
  266|    208|    CRYPTO_THREAD_unlock(err_string_lock);
  267|    208|    return 1;
  268|    208|}
err.c:int_err_get_item:
  189|    136|{
  190|    136|    ERR_STRING_DATA *p = NULL;
  191|       |
  192|    136|    if (!CRYPTO_THREAD_read_lock(err_string_lock))
  ------------------
  |  Branch (192:9): [True: 0, False: 136]
  ------------------
  193|      0|        return NULL;
  194|    136|    p = lh_ERR_STRING_DATA_retrieve(int_error_hash, d);
  ------------------
  |  |  380|    136|#define lh_ERR_STRING_DATA_retrieve(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_retrieve(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_const_ERR_STRING_DATA_lh_plain_type(ptr)))
  ------------------
  195|    136|    CRYPTO_THREAD_unlock(err_string_lock);
  196|       |
  197|    136|    return p;
  198|    136|}
err.c:err_do_init:
  667|      2|{
  668|      2|    set_err_thread_local = 1;
  669|      2|    return CRYPTO_THREAD_init_local(&err_thread_local, NULL);
  670|      2|}
err.c:err_delete_thread_state:
  645|      2|{
  646|      2|    ERR_STATE *state = CRYPTO_THREAD_get_local(&err_thread_local);
  647|      2|    if (state == NULL)
  ------------------
  |  Branch (647:9): [True: 0, False: 2]
  ------------------
  648|      0|        return;
  649|       |
  650|      2|    CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  651|      2|    OSSL_ERR_STATE_free(state);
  652|      2|}

ossl_err_load_crypto_strings:
   49|      2|{
   50|      2|    if (0
  ------------------
  |  Branch (50:9): [Folded - Ignored]
  ------------------
   51|      2|#ifndef OPENSSL_NO_ERR
   52|      2|        || ossl_err_load_ERR_strings() == 0 /* include error strings for SYSerr */
  ------------------
  |  Branch (52:12): [True: 0, False: 2]
  ------------------
   53|      2|        || ossl_err_load_BN_strings() == 0
  ------------------
  |  Branch (53:12): [True: 0, False: 2]
  ------------------
   54|      2|        || ossl_err_load_RSA_strings() == 0
  ------------------
  |  Branch (54:12): [True: 0, False: 2]
  ------------------
   55|      2|# ifndef OPENSSL_NO_DH
   56|      2|        || ossl_err_load_DH_strings() == 0
  ------------------
  |  Branch (56:12): [True: 0, False: 2]
  ------------------
   57|      2|# endif
   58|      2|        || ossl_err_load_EVP_strings() == 0
  ------------------
  |  Branch (58:12): [True: 0, False: 2]
  ------------------
   59|      2|        || ossl_err_load_BUF_strings() == 0
  ------------------
  |  Branch (59:12): [True: 0, False: 2]
  ------------------
   60|      2|        || ossl_err_load_OBJ_strings() == 0
  ------------------
  |  Branch (60:12): [True: 0, False: 2]
  ------------------
   61|      2|        || ossl_err_load_PEM_strings() == 0
  ------------------
  |  Branch (61:12): [True: 0, False: 2]
  ------------------
   62|      2|# ifndef OPENSSL_NO_DSA
   63|      2|        || ossl_err_load_DSA_strings() == 0
  ------------------
  |  Branch (63:12): [True: 0, False: 2]
  ------------------
   64|      2|# endif
   65|      2|        || ossl_err_load_X509_strings() == 0
  ------------------
  |  Branch (65:12): [True: 0, False: 2]
  ------------------
   66|      2|        || ossl_err_load_ASN1_strings() == 0
  ------------------
  |  Branch (66:12): [True: 0, False: 2]
  ------------------
   67|      2|        || ossl_err_load_CONF_strings() == 0
  ------------------
  |  Branch (67:12): [True: 0, False: 2]
  ------------------
   68|      2|        || ossl_err_load_CRYPTO_strings() == 0
  ------------------
  |  Branch (68:12): [True: 0, False: 2]
  ------------------
   69|      2|# ifndef OPENSSL_NO_COMP
   70|      2|        || ossl_err_load_COMP_strings() == 0
  ------------------
  |  Branch (70:12): [True: 0, False: 2]
  ------------------
   71|      2|# endif
   72|      2|# ifndef OPENSSL_NO_EC
   73|      2|        || ossl_err_load_EC_strings() == 0
  ------------------
  |  Branch (73:12): [True: 0, False: 2]
  ------------------
   74|      2|# endif
   75|       |        /* skip ossl_err_load_SSL_strings() because it is not in this library */
   76|      2|        || ossl_err_load_BIO_strings() == 0
  ------------------
  |  Branch (76:12): [True: 0, False: 2]
  ------------------
   77|      2|        || ossl_err_load_PKCS7_strings() == 0
  ------------------
  |  Branch (77:12): [True: 0, False: 2]
  ------------------
   78|      2|        || ossl_err_load_X509V3_strings() == 0
  ------------------
  |  Branch (78:12): [True: 0, False: 2]
  ------------------
   79|      2|        || ossl_err_load_PKCS12_strings() == 0
  ------------------
  |  Branch (79:12): [True: 0, False: 2]
  ------------------
   80|      2|        || ossl_err_load_RAND_strings() == 0
  ------------------
  |  Branch (80:12): [True: 0, False: 2]
  ------------------
   81|      2|        || ossl_err_load_DSO_strings() == 0
  ------------------
  |  Branch (81:12): [True: 0, False: 2]
  ------------------
   82|      2|# ifndef OPENSSL_NO_TS
   83|      2|        || ossl_err_load_TS_strings() == 0
  ------------------
  |  Branch (83:12): [True: 0, False: 2]
  ------------------
   84|      2|# endif
   85|      2|# ifndef OPENSSL_NO_ENGINE
   86|      2|        || ossl_err_load_ENGINE_strings() == 0
  ------------------
  |  Branch (86:12): [True: 0, False: 2]
  ------------------
   87|      2|# endif
   88|      2|# ifndef OPENSSL_NO_HTTP
   89|      2|        || ossl_err_load_HTTP_strings() == 0
  ------------------
  |  Branch (89:12): [True: 0, False: 2]
  ------------------
   90|      2|# endif
   91|      2|# ifndef OPENSSL_NO_OCSP
   92|      2|        || ossl_err_load_OCSP_strings() == 0
  ------------------
  |  Branch (92:12): [True: 0, False: 2]
  ------------------
   93|      2|# endif
   94|      2|        || ossl_err_load_UI_strings() == 0
  ------------------
  |  Branch (94:12): [True: 0, False: 2]
  ------------------
   95|      2|# ifndef OPENSSL_NO_CMS
   96|      2|        || ossl_err_load_CMS_strings() == 0
  ------------------
  |  Branch (96:12): [True: 0, False: 2]
  ------------------
   97|      2|# endif
   98|      2|# ifndef OPENSSL_NO_CRMF
   99|      2|        || ossl_err_load_CRMF_strings() == 0
  ------------------
  |  Branch (99:12): [True: 0, False: 2]
  ------------------
  100|      2|        || ossl_err_load_CMP_strings() == 0
  ------------------
  |  Branch (100:12): [True: 0, False: 2]
  ------------------
  101|      2|# endif
  102|      2|# ifndef OPENSSL_NO_CT
  103|      2|        || ossl_err_load_CT_strings() == 0
  ------------------
  |  Branch (103:12): [True: 0, False: 2]
  ------------------
  104|      2|# endif
  105|      2|        || ossl_err_load_ESS_strings() == 0
  ------------------
  |  Branch (105:12): [True: 0, False: 2]
  ------------------
  106|      2|        || ossl_err_load_ASYNC_strings() == 0
  ------------------
  |  Branch (106:12): [True: 0, False: 2]
  ------------------
  107|      2|        || ossl_err_load_OSSL_STORE_strings() == 0
  ------------------
  |  Branch (107:12): [True: 0, False: 2]
  ------------------
  108|      2|        || ossl_err_load_PROP_strings() == 0
  ------------------
  |  Branch (108:12): [True: 0, False: 2]
  ------------------
  109|      2|        || ossl_err_load_PROV_strings() == 0
  ------------------
  |  Branch (109:12): [True: 0, False: 2]
  ------------------
  110|      2|#endif
  111|      2|        )
  112|      0|        return 0;
  113|       |
  114|      2|    return 1;
  115|      2|}

ERR_new:
   17|  1.02k|{
   18|  1.02k|    ERR_STATE *es;
   19|       |
   20|  1.02k|    es = ossl_err_get_state_int();
   21|  1.02k|    if (es == NULL)
  ------------------
  |  Branch (21:9): [True: 0, False: 1.02k]
  ------------------
   22|      0|        return;
   23|       |
   24|       |    /* Allocate a slot */
   25|  1.02k|    err_get_slot(es);
   26|  1.02k|    err_clear(es, es->top, 0);
   27|  1.02k|}
ERR_set_debug:
   30|  1.02k|{
   31|  1.02k|    ERR_STATE *es;
   32|       |
   33|  1.02k|    es = ossl_err_get_state_int();
   34|  1.02k|    if (es == NULL)
  ------------------
  |  Branch (34:9): [True: 0, False: 1.02k]
  ------------------
   35|      0|        return;
   36|       |
   37|  1.02k|    err_set_debug(es, es->top, file, line, func);
   38|  1.02k|}
ERR_set_error:
   41|  1.02k|{
   42|  1.02k|    va_list args;
   43|       |
   44|  1.02k|    va_start(args, fmt);
   45|  1.02k|    ERR_vset_error(lib, reason, fmt, args);
   46|  1.02k|    va_end(args);
   47|  1.02k|}
ERR_vset_error:
   50|  1.02k|{
   51|  1.02k|    ERR_STATE *es;
   52|  1.02k|    char *buf = NULL;
   53|  1.02k|    size_t buf_size = 0;
   54|  1.02k|    unsigned long flags = 0;
   55|  1.02k|    size_t i;
   56|       |
   57|  1.02k|    es = ossl_err_get_state_int();
   58|  1.02k|    if (es == NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 1.02k]
  ------------------
   59|      0|        return;
   60|  1.02k|    i = es->top;
   61|       |
   62|  1.02k|    if (fmt != NULL) {
  ------------------
  |  Branch (62:9): [True: 0, False: 1.02k]
  ------------------
   63|      0|        int printed_len = 0;
   64|      0|        char *rbuf = NULL;
   65|       |
   66|      0|        buf = es->err_data[i];
   67|      0|        buf_size = es->err_data_size[i];
   68|       |
   69|       |        /*
   70|       |         * To protect the string we just grabbed from tampering by other
   71|       |         * functions we may call, or to protect them from freeing a pointer
   72|       |         * that may no longer be valid at that point, we clear away the
   73|       |         * data pointer and the flags.  We will set them again at the end
   74|       |         * of this function.
   75|       |         */
   76|      0|        es->err_data[i] = NULL;
   77|      0|        es->err_data_flags[i] = 0;
   78|       |
   79|       |        /*
   80|       |         * Try to maximize the space available.  If that fails, we use what
   81|       |         * we have.
   82|       |         */
   83|      0|        if (buf_size < ERR_MAX_DATA_SIZE
  ------------------
  |  |  392|      0|#define ERR_MAX_DATA_SIZE       1024
  ------------------
  |  Branch (83:13): [True: 0, False: 0]
  ------------------
   84|      0|            && (rbuf = OPENSSL_realloc(buf, ERR_MAX_DATA_SIZE)) != NULL) {
  ------------------
  |  |  109|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (84:16): [True: 0, False: 0]
  ------------------
   85|      0|            buf = rbuf;
   86|      0|            buf_size = ERR_MAX_DATA_SIZE;
  ------------------
  |  |  392|      0|#define ERR_MAX_DATA_SIZE       1024
  ------------------
   87|      0|        }
   88|       |
   89|      0|        if (buf != NULL) {
  ------------------
  |  Branch (89:13): [True: 0, False: 0]
  ------------------
   90|      0|            printed_len = BIO_vsnprintf(buf, buf_size, fmt, args);
   91|      0|        }
   92|      0|        if (printed_len < 0)
  ------------------
  |  Branch (92:13): [True: 0, False: 0]
  ------------------
   93|      0|            printed_len = 0;
   94|      0|        if (buf != NULL)
  ------------------
  |  Branch (94:13): [True: 0, False: 0]
  ------------------
   95|      0|            buf[printed_len] = '\0';
   96|       |
   97|       |        /*
   98|       |         * Try to reduce the size, but only if we maximized above.  If that
   99|       |         * fails, we keep what we have.
  100|       |         * (According to documentation, realloc leaves the old buffer untouched
  101|       |         * if it fails)
  102|       |         */
  103|      0|        if ((rbuf = OPENSSL_realloc(buf, printed_len + 1)) != NULL) {
  ------------------
  |  |  109|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (103:13): [True: 0, False: 0]
  ------------------
  104|      0|            buf = rbuf;
  105|      0|            buf_size = printed_len + 1;
  106|      0|            buf[printed_len] = '\0';
  107|      0|        }
  108|       |
  109|      0|        if (buf != NULL)
  ------------------
  |  Branch (109:13): [True: 0, False: 0]
  ------------------
  110|      0|            flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   48|      0|# define ERR_TXT_MALLOCED        0x01
  ------------------
                          flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   49|      0|# define ERR_TXT_STRING          0x02
  ------------------
  111|      0|    }
  112|       |
  113|  1.02k|    err_clear_data(es, es->top, 0);
  114|  1.02k|    err_set_error(es, es->top, lib, reason);
  115|  1.02k|    if (fmt != NULL)
  ------------------
  |  Branch (115:9): [True: 0, False: 1.02k]
  ------------------
  116|      0|        err_set_data(es, es->top, buf, buf_size, flags);
  117|  1.02k|}

err.c:err_clear:
   85|  19.4k|{
   86|  19.4k|    err_clear_data(es, i, (deall));
   87|  19.4k|    es->err_marks[i] = 0;
   88|  19.4k|    es->err_flags[i] = 0;
   89|  19.4k|    es->err_buffer[i] = 0;
   90|  19.4k|    es->err_line[i] = -1;
   91|  19.4k|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  115|  19.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  19.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  19.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   92|  19.4k|    es->err_file[i] = NULL;
   93|  19.4k|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  115|  19.4k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  19.4k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  19.4k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|  19.4k|    es->err_func[i] = NULL;
   95|  19.4k|}
err.c:err_clear_data:
   22|  19.4k|{
   23|  19.4k|    if (es->err_data_flags[i] & ERR_TXT_MALLOCED) {
  ------------------
  |  |   48|  19.4k|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (23:9): [True: 0, False: 19.4k]
  ------------------
   24|      0|        if (deall) {
  ------------------
  |  Branch (24:13): [True: 0, False: 0]
  ------------------
   25|      0|            OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|      0|            es->err_data[i] = NULL;
   27|      0|            es->err_data_size[i] = 0;
   28|      0|            es->err_data_flags[i] = 0;
   29|      0|        } else if (es->err_data[i] != NULL) {
  ------------------
  |  Branch (29:20): [True: 0, False: 0]
  ------------------
   30|      0|            es->err_data[i][0] = '\0';
   31|      0|            es->err_data_flags[i] = ERR_TXT_MALLOCED;
  ------------------
  |  |   48|      0|# define ERR_TXT_MALLOCED        0x01
  ------------------
   32|      0|        }
   33|  19.4k|    } else {
   34|  19.4k|        es->err_data[i] = NULL;
   35|  19.4k|        es->err_data_size[i] = 0;
   36|  19.4k|        es->err_data_flags[i] = 0;
   37|  19.4k|    }
   38|  19.4k|}
err_blocks.c:err_get_slot:
   15|  1.02k|{
   16|  1.02k|    es->top = (es->top + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|  1.02k|#  define ERR_NUM_ERRORS  16
  ------------------
   17|  1.02k|    if (es->top == es->bottom)
  ------------------
  |  Branch (17:9): [True: 0, False: 1.02k]
  ------------------
   18|      0|        es->bottom = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|      0|#  define ERR_NUM_ERRORS  16
  ------------------
   19|  1.02k|}
err_blocks.c:err_clear:
   85|  1.02k|{
   86|  1.02k|    err_clear_data(es, i, (deall));
   87|  1.02k|    es->err_marks[i] = 0;
   88|  1.02k|    es->err_flags[i] = 0;
   89|  1.02k|    es->err_buffer[i] = 0;
   90|  1.02k|    es->err_line[i] = -1;
   91|  1.02k|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  115|  1.02k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.02k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.02k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   92|  1.02k|    es->err_file[i] = NULL;
   93|  1.02k|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  115|  1.02k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.02k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.02k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|  1.02k|    es->err_func[i] = NULL;
   95|  1.02k|}
err_blocks.c:err_set_debug:
   52|  1.02k|{
   53|       |    /*
   54|       |     * We dup the file and fn strings because they may be provider owned. If the
   55|       |     * provider gets unloaded, they may not be valid anymore.
   56|       |     */
   57|  1.02k|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  115|  1.02k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.02k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.02k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   58|  1.02k|    if (file == NULL || file[0] == '\0')
  ------------------
  |  Branch (58:9): [True: 0, False: 1.02k]
  |  Branch (58:25): [True: 0, False: 1.02k]
  ------------------
   59|      0|        es->err_file[i] = NULL;
   60|  1.02k|    else if ((es->err_file[i] = CRYPTO_malloc(strlen(file) + 1,
  ------------------
  |  Branch (60:14): [True: 1.02k, False: 0]
  ------------------
   61|  1.02k|                                              NULL, 0)) != NULL)
   62|       |        /* We cannot use OPENSSL_strdup due to possible recursion */
   63|  1.02k|        strcpy(es->err_file[i], file);
   64|       |
   65|  1.02k|    es->err_line[i] = line;
   66|  1.02k|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  115|  1.02k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.02k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.02k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   67|  1.02k|    if (fn == NULL || fn[0] == '\0')
  ------------------
  |  Branch (67:9): [True: 0, False: 1.02k]
  |  Branch (67:23): [True: 0, False: 1.02k]
  ------------------
   68|      0|        es->err_func[i] = NULL;
   69|  1.02k|    else if ((es->err_func[i] = CRYPTO_malloc(strlen(fn) + 1,
  ------------------
  |  Branch (69:14): [True: 1.02k, False: 0]
  ------------------
   70|  1.02k|                                              NULL, 0)) != NULL)
   71|  1.02k|        strcpy(es->err_func[i], fn);
   72|  1.02k|}
err_blocks.c:err_clear_data:
   22|  2.05k|{
   23|  2.05k|    if (es->err_data_flags[i] & ERR_TXT_MALLOCED) {
  ------------------
  |  |   48|  2.05k|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (23:9): [True: 0, False: 2.05k]
  ------------------
   24|      0|        if (deall) {
  ------------------
  |  Branch (24:13): [True: 0, False: 0]
  ------------------
   25|      0|            OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|      0|            es->err_data[i] = NULL;
   27|      0|            es->err_data_size[i] = 0;
   28|      0|            es->err_data_flags[i] = 0;
   29|      0|        } else if (es->err_data[i] != NULL) {
  ------------------
  |  Branch (29:20): [True: 0, False: 0]
  ------------------
   30|      0|            es->err_data[i][0] = '\0';
   31|      0|            es->err_data_flags[i] = ERR_TXT_MALLOCED;
  ------------------
  |  |   48|      0|# define ERR_TXT_MALLOCED        0x01
  ------------------
   32|      0|        }
   33|  2.05k|    } else {
   34|  2.05k|        es->err_data[i] = NULL;
   35|  2.05k|        es->err_data_size[i] = 0;
   36|  2.05k|        es->err_data_flags[i] = 0;
   37|  2.05k|    }
   38|  2.05k|}
err_blocks.c:err_set_error:
   42|  1.02k|{
   43|  1.02k|    es->err_buffer[i] =
   44|  1.02k|        lib == ERR_LIB_SYS
  ------------------
  |  |   72|  1.02k|# define ERR_LIB_SYS             2
  ------------------
  |  Branch (44:9): [True: 0, False: 1.02k]
  ------------------
   45|  1.02k|        ? (unsigned int)(ERR_SYSTEM_FLAG |  reason)
  ------------------
  |  |  218|      0|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  ------------------
   46|  1.02k|        : ERR_PACK(lib, 0, reason);
  ------------------
  |  |  279|  2.05k|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|  1.02k|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|  1.02k|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|  2.05k|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|  1.02k|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
   47|  1.02k|}

OSSL_ERR_STATE_new:
   22|      2|{
   23|      2|    return CRYPTO_zalloc(sizeof(ERR_STATE), NULL, 0);
   24|      2|}

ossl_err_load_ESS_strings:
   42|      2|{
   43|      2|#ifndef OPENSSL_NO_ERR
   44|      2|    if (ERR_reason_error_string(ESS_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (44:9): [True: 2, False: 0]
  ------------------
   45|      2|        ERR_load_strings_const(ESS_str_reasons);
   46|      2|#endif
   47|      2|    return 1;
   48|      2|}

EVP_ENCODE_CTX_new:
  128|    251|{
  129|    251|    return OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
  ------------------
  |  |  104|    251|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    251|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    251|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  130|    251|}
EVP_ENCODE_CTX_free:
  133|  1.21k|{
  134|  1.21k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  1.21k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.21k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.21k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  135|  1.21k|}
EVP_DecodeInit:
  275|    251|{
  276|       |    /* Only ctx->num and ctx->flags are used during decoding. */
  277|    251|    ctx->num = 0;
  278|    251|    ctx->length = 0;
  279|    251|    ctx->line_num = 0;
  280|    251|    ctx->flags = 0;
  281|    251|}
EVP_DecodeUpdate:
  305|    251|{
  306|    251|    int seof = 0, eof = 0, rv = -1, ret = 0, i, v, tmp, n, decoded_len;
  307|    251|    unsigned char *d;
  308|    251|    const unsigned char *table;
  309|       |
  310|    251|    n = ctx->num;
  311|    251|    d = ctx->enc_data;
  312|       |
  313|    251|    if (n > 0 && d[n - 1] == '=') {
  ------------------
  |  Branch (313:9): [True: 0, False: 251]
  |  Branch (313:18): [True: 0, False: 0]
  ------------------
  314|      0|        eof++;
  315|      0|        if (n > 1 && d[n - 2] == '=')
  ------------------
  |  Branch (315:13): [True: 0, False: 0]
  |  Branch (315:22): [True: 0, False: 0]
  ------------------
  316|      0|            eof++;
  317|      0|    }
  318|       |
  319|       |     /* Legacy behaviour: an empty input chunk signals end of input. */
  320|    251|    if (inl == 0) {
  ------------------
  |  Branch (320:9): [True: 0, False: 251]
  ------------------
  321|      0|        rv = 0;
  322|      0|        goto end;
  323|      0|    }
  324|       |
  325|    251|    if ((ctx->flags & EVP_ENCODE_CTX_USE_SRP_ALPHABET) != 0)
  ------------------
  |  |  895|    251|#define EVP_ENCODE_CTX_USE_SRP_ALPHABET     2
  ------------------
  |  Branch (325:9): [True: 0, False: 251]
  ------------------
  326|      0|        table = srpdata_ascii2bin;
  327|    251|    else
  328|    251|        table = data_ascii2bin;
  329|       |
  330|  3.11M|    for (i = 0; i < inl; i++) {
  ------------------
  |  Branch (330:17): [True: 3.11M, False: 177]
  ------------------
  331|  3.11M|        tmp = *(in++);
  332|  3.11M|        v = conv_ascii2bin(tmp, table);
  333|  3.11M|        if (v == B64_ERROR) {
  ------------------
  |  |   68|  3.11M|#define B64_ERROR               0xFF
  ------------------
  |  Branch (333:13): [True: 19, False: 3.11M]
  ------------------
  334|     19|            rv = -1;
  335|     19|            goto end;
  336|     19|        }
  337|       |
  338|  3.11M|        if (tmp == '=') {
  ------------------
  |  Branch (338:13): [True: 114, False: 3.11M]
  ------------------
  339|    114|            eof++;
  340|  3.11M|        } else if (eof > 0 && B64_BASE64(v)) {
  ------------------
  |  |   70|    852|#define B64_BASE64(a)           (!B64_NOT_BASE64(a))
  |  |  ------------------
  |  |  |  |   69|    852|#define B64_NOT_BASE64(a)       (((a)|0x13) == 0xF3)
  |  |  ------------------
  |  |  |  Branch (70:33): [True: 5, False: 847]
  |  |  ------------------
  ------------------
  |  Branch (340:20): [True: 852, False: 3.11M]
  ------------------
  341|       |            /* More data after padding. */
  342|      5|            rv = -1;
  343|      5|            goto end;
  344|      5|        }
  345|       |
  346|  3.11M|        if (eof > 2) {
  ------------------
  |  Branch (346:13): [True: 2, False: 3.11M]
  ------------------
  347|      2|            rv = -1;
  348|      2|            goto end;
  349|      2|        }
  350|       |
  351|  3.11M|        if (v == B64_EOF) {
  ------------------
  |  |   66|  3.11M|#define B64_EOF                 0xF2
  ------------------
  |  Branch (351:13): [True: 48, False: 3.11M]
  ------------------
  352|     48|            seof = 1;
  353|     48|            goto tail;
  354|     48|        }
  355|       |
  356|       |        /* Only save valid base64 characters. */
  357|  3.11M|        if (B64_BASE64(v)) {
  ------------------
  |  |   70|  3.11M|#define B64_BASE64(a)           (!B64_NOT_BASE64(a))
  |  |  ------------------
  |  |  |  |   69|  3.11M|#define B64_NOT_BASE64(a)       (((a)|0x13) == 0xF3)
  |  |  ------------------
  |  |  |  Branch (70:33): [True: 3.00M, False: 106k]
  |  |  ------------------
  ------------------
  358|  3.00M|            if (n >= 64) {
  ------------------
  |  Branch (358:17): [True: 0, False: 3.00M]
  ------------------
  359|       |                /*
  360|       |                 * We increment n once per loop, and empty the buffer as soon as
  361|       |                 * we reach 64 characters, so this can only happen if someone's
  362|       |                 * manually messed with the ctx. Refuse to write any more data.
  363|       |                 */
  364|      0|                rv = -1;
  365|      0|                goto end;
  366|      0|            }
  367|  3.00M|            OPENSSL_assert(n < (int)sizeof(ctx->enc_data));
  ------------------
  |  |  438|  3.00M|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 3.00M, False: 0]
  |  |  ------------------
  ------------------
  368|  3.00M|            d[n++] = tmp;
  369|  3.00M|        }
  370|       |
  371|  3.11M|        if (n == 64) {
  ------------------
  |  Branch (371:13): [True: 46.9k, False: 3.06M]
  ------------------
  372|  46.9k|            decoded_len = evp_decodeblock_int(ctx, out, d, n, eof);
  373|  46.9k|            n = 0;
  374|  46.9k|            if (decoded_len < 0 || (decoded_len == 0 && eof > 0)) {
  ------------------
  |  Branch (374:17): [True: 0, False: 46.9k]
  |  Branch (374:37): [True: 0, False: 46.9k]
  |  Branch (374:57): [True: 0, False: 0]
  ------------------
  375|      0|                rv = -1;
  376|      0|                goto end;
  377|      0|            }
  378|  46.9k|            ret += decoded_len;
  379|  46.9k|            out += decoded_len;
  380|  46.9k|        }
  381|  3.11M|    }
  382|       |
  383|       |    /*
  384|       |     * Legacy behaviour: if the current line is a full base64-block (i.e., has
  385|       |     * 0 mod 4 base64 characters), it is processed immediately. We keep this
  386|       |     * behaviour as applications may not be calling EVP_DecodeFinal properly.
  387|       |     */
  388|    225|tail:
  389|    225|    if (n > 0) {
  ------------------
  |  Branch (389:9): [True: 203, False: 22]
  ------------------
  390|    203|        if ((n & 3) == 0) {
  ------------------
  |  Branch (390:13): [True: 152, False: 51]
  ------------------
  391|    152|            decoded_len = evp_decodeblock_int(ctx, out, d, n, eof);
  392|    152|            n = 0;
  393|    152|            if (decoded_len < 0 || (decoded_len == 0 && eof > 0)) {
  ------------------
  |  Branch (393:17): [True: 0, False: 152]
  |  Branch (393:37): [True: 0, False: 152]
  |  Branch (393:57): [True: 0, False: 0]
  ------------------
  394|      0|                rv = -1;
  395|      0|                goto end;
  396|      0|            }
  397|    152|            ret += decoded_len;
  398|    152|        } else if (seof) {
  ------------------
  |  Branch (398:20): [True: 6, False: 45]
  ------------------
  399|       |            /* EOF in the middle of a base64 block. */
  400|      6|            rv = -1;
  401|      6|            goto end;
  402|      6|        }
  403|    203|    }
  404|       |
  405|    219|    rv = seof || (n == 0 && eof) ? 0 : 1;
  ------------------
  |  Branch (405:10): [True: 42, False: 177]
  |  Branch (405:19): [True: 132, False: 45]
  |  Branch (405:29): [True: 16, False: 116]
  ------------------
  406|    251|end:
  407|       |    /* Legacy behaviour. This should probably rather be zeroed on error. */
  408|    251|    *outl = ret;
  409|    251|    ctx->num = n;
  410|    251|    return rv;
  411|    219|}
EVP_DecodeFinal:
  503|    219|{
  504|    219|    int i;
  505|       |
  506|    219|    *outl = 0;
  507|    219|    if (ctx->num != 0) {
  ------------------
  |  Branch (507:9): [True: 45, False: 174]
  ------------------
  508|     45|        i = evp_decodeblock_int(ctx, out, ctx->enc_data, ctx->num, -1);
  509|     45|        if (i < 0)
  ------------------
  |  Branch (509:13): [True: 45, False: 0]
  ------------------
  510|     45|            return -1;
  511|      0|        ctx->num = 0;
  512|      0|        *outl = i;
  513|      0|        return 1;
  514|     45|    } else
  515|    174|        return 1;
  516|    219|}
encode.c:conv_ascii2bin:
  112|  6.21M|{
  113|  6.21M|    if (a & 0x80)
  ------------------
  |  Branch (113:9): [True: 13, False: 6.21M]
  ------------------
  114|     13|        return B64_ERROR;
  ------------------
  |  |   68|     13|#define B64_ERROR               0xFF
  ------------------
  115|  6.21M|    return table[a];
  116|  6.21M|}
encode.c:evp_decodeblock_int:
  416|  47.1k|{
  417|  47.1k|    int i, ret = 0, a, b, c, d;
  418|  47.1k|    unsigned long l;
  419|  47.1k|    const unsigned char *table;
  420|       |
  421|  47.1k|    if (eof < -1 || eof > 2)
  ------------------
  |  Branch (421:9): [True: 0, False: 47.1k]
  |  Branch (421:21): [True: 0, False: 47.1k]
  ------------------
  422|      0|        return -1;
  423|       |
  424|  47.1k|    if (ctx != NULL && (ctx->flags & EVP_ENCODE_CTX_USE_SRP_ALPHABET) != 0)
  ------------------
  |  |  895|  47.1k|#define EVP_ENCODE_CTX_USE_SRP_ALPHABET     2
  ------------------
  |  Branch (424:9): [True: 47.1k, False: 0]
  |  Branch (424:24): [True: 0, False: 47.1k]
  ------------------
  425|      0|        table = srpdata_ascii2bin;
  426|  47.1k|    else
  427|  47.1k|        table = data_ascii2bin;
  428|       |
  429|       |    /* trim whitespace from the start of the line. */
  430|  47.1k|    while ((n > 0) && (conv_ascii2bin(*f, table) == B64_WS)) {
  ------------------
  |  |   67|  47.1k|#define B64_WS                  0xE0
  ------------------
  |  Branch (430:12): [True: 47.1k, False: 0]
  |  Branch (430:23): [True: 0, False: 47.1k]
  ------------------
  431|      0|        f++;
  432|      0|        n--;
  433|      0|    }
  434|       |
  435|       |    /*
  436|       |     * strip off stuff at the end of the line ascii2bin values B64_WS,
  437|       |     * B64_EOLN, B64_EOLN and B64_EOF
  438|       |     */
  439|  47.1k|    while ((n > 3) && (B64_NOT_BASE64(conv_ascii2bin(f[n - 1], table))))
  ------------------
  |  |   69|  47.1k|#define B64_NOT_BASE64(a)       (((a)|0x13) == 0xF3)
  ------------------
  |  Branch (439:12): [True: 47.1k, False: 28]
  |  Branch (439:23): [True: 0, False: 47.1k]
  ------------------
  440|      0|        n--;
  441|       |
  442|  47.1k|    if (n % 4 != 0)
  ------------------
  |  Branch (442:9): [True: 45, False: 47.1k]
  ------------------
  443|     45|        return -1;
  444|  47.1k|    if (n == 0)
  ------------------
  |  Branch (444:9): [True: 0, False: 47.1k]
  ------------------
  445|      0|        return 0;
  446|       |
  447|       |    /* all 4-byte blocks except the last one do not have padding. */
  448|   752k|    for (i = 0; i < n - 4; i += 4) {
  ------------------
  |  Branch (448:17): [True: 704k, False: 47.1k]
  ------------------
  449|   704k|        a = conv_ascii2bin(*(f++), table);
  450|   704k|        b = conv_ascii2bin(*(f++), table);
  451|   704k|        c = conv_ascii2bin(*(f++), table);
  452|   704k|        d = conv_ascii2bin(*(f++), table);
  453|   704k|        if ((a | b | c | d) & 0x80)
  ------------------
  |  Branch (453:13): [True: 0, False: 704k]
  ------------------
  454|      0|            return -1;
  455|   704k|        l = ((((unsigned long)a) << 18L) |
  456|   704k|             (((unsigned long)b) << 12L) |
  457|   704k|             (((unsigned long)c) << 6L) | (((unsigned long)d)));
  458|   704k|        *(t++) = (unsigned char)(l >> 16L) & 0xff;
  459|   704k|        *(t++) = (unsigned char)(l >> 8L) & 0xff;
  460|   704k|        *(t++) = (unsigned char)(l) & 0xff;
  461|   704k|        ret += 3;
  462|   704k|    }
  463|       |
  464|       |    /* process the last block that may have padding. */
  465|  47.1k|    a = conv_ascii2bin(*(f++), table);
  466|  47.1k|    b = conv_ascii2bin(*(f++), table);
  467|  47.1k|    c = conv_ascii2bin(*(f++), table);
  468|  47.1k|    d = conv_ascii2bin(*(f++), table);
  469|  47.1k|    if ((a | b | c | d) & 0x80)
  ------------------
  |  Branch (469:9): [True: 0, False: 47.1k]
  ------------------
  470|      0|        return -1;
  471|  47.1k|    l = ((((unsigned long)a) << 18L) |
  472|  47.1k|         (((unsigned long)b) << 12L) |
  473|  47.1k|         (((unsigned long)c) << 6L) | (((unsigned long)d)));
  474|       |
  475|  47.1k|    if (eof == -1)
  ------------------
  |  Branch (475:9): [True: 0, False: 47.1k]
  ------------------
  476|      0|        eof = (f[2] == '=') + (f[3] == '=');
  477|       |
  478|  47.1k|    switch (eof) {
  ------------------
  |  Branch (478:13): [True: 0, False: 47.1k]
  ------------------
  479|     38|    case 2:
  ------------------
  |  Branch (479:5): [True: 38, False: 47.0k]
  ------------------
  480|     38|        *(t++) = (unsigned char)(l >> 16L) & 0xff;
  481|     38|        break;
  482|      9|    case 1:
  ------------------
  |  Branch (482:5): [True: 9, False: 47.1k]
  ------------------
  483|      9|        *(t++) = (unsigned char)(l >> 16L) & 0xff;
  484|      9|        *(t++) = (unsigned char)(l >> 8L) & 0xff;
  485|      9|        break;
  486|  47.0k|    case 0:
  ------------------
  |  Branch (486:5): [True: 47.0k, False: 47]
  ------------------
  487|  47.0k|        *(t++) = (unsigned char)(l >> 16L) & 0xff;
  488|  47.0k|        *(t++) = (unsigned char)(l >> 8L) & 0xff;
  489|  47.0k|        *(t++) = (unsigned char)(l) & 0xff;
  490|  47.0k|        break;
  491|  47.1k|    }
  492|  47.1k|    ret += 3 - eof;
  493|       |
  494|  47.1k|    return ret;
  495|  47.1k|}

ossl_err_load_EVP_strings:
  227|      2|{
  228|      2|#ifndef OPENSSL_NO_ERR
  229|      2|    if (ERR_reason_error_string(EVP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (229:9): [True: 2, False: 0]
  ------------------
  230|      2|        ERR_load_strings_const(EVP_str_reasons);
  231|      2|#endif
  232|      2|    return 1;
  233|      2|}

EVP_PBE_cleanup:
  296|      2|{
  297|      2|    sk_EVP_PBE_CTL_pop_free(pbe_algs, free_evp_pbe_ctl);
  298|      2|    pbe_algs = NULL;
  299|      2|}

EVP_RAND_CTX_free:
  386|      4|{
  387|      4|    int ref = 0;
  388|      4|    EVP_RAND_CTX *parent;
  389|       |
  390|      4|    if (ctx == NULL)
  ------------------
  |  Branch (390:9): [True: 4, False: 0]
  ------------------
  391|      4|        return;
  392|       |
  393|      0|    CRYPTO_DOWN_REF(&ctx->refcnt, &ref);
  394|      0|    if (ref > 0)
  ------------------
  |  Branch (394:9): [True: 0, False: 0]
  ------------------
  395|      0|        return;
  396|      0|    parent = ctx->parent;
  397|      0|    ctx->meth->freectx(ctx->algctx);
  398|      0|    ctx->algctx = NULL;
  399|      0|    EVP_RAND_free(ctx->meth);
  400|      0|    CRYPTO_FREE_REF(&ctx->refcnt);
  401|      0|    OPENSSL_free(ctx);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  402|      0|    EVP_RAND_CTX_free(parent);
  403|      0|}

evp_cleanup_int:
  180|      2|{
  181|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_KDF_METH);
  ------------------
  |  |   30|      2|# define OBJ_NAME_TYPE_KDF_METH          0x06
  ------------------
  182|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_CIPHER_METH);
  ------------------
  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
  183|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_MD_METH);
  ------------------
  |  |   25|      2|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
  184|       |    /*
  185|       |     * The above calls will only clean out the contents of the name hash
  186|       |     * table, but not the hash table itself.  The following line does that
  187|       |     * part.  -- Richard Levitte
  188|       |     */
  189|      2|    OBJ_NAME_cleanup(-1);
  190|       |
  191|      2|    EVP_PBE_cleanup();
  192|      2|    OBJ_sigid_free();
  193|       |
  194|      2|    evp_app_cleanup_int();
  195|      2|}

evp_app_cleanup_int:
  633|      2|{
  634|      2|    if (app_pkey_methods != NULL)
  ------------------
  |  Branch (634:9): [True: 0, False: 2]
  ------------------
  635|      0|        sk_EVP_PKEY_METHOD_pop_free(app_pkey_methods, EVP_PKEY_meth_free);
  636|      2|}

ossl_do_ex_data_init:
   15|      2|{
   16|      2|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
   17|       |
   18|      2|    if (global == NULL)
  ------------------
  |  Branch (18:9): [True: 0, False: 2]
  ------------------
   19|      0|        return 0;
   20|       |
   21|      2|    global->ex_data_lock = CRYPTO_THREAD_lock_new();
   22|      2|    return global->ex_data_lock != NULL;
   23|      2|}
ossl_crypto_cleanup_all_ex_data_int:
   73|      2|{
   74|      2|    int i;
   75|      2|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
   76|       |
   77|      2|    if (global == NULL)
  ------------------
  |  Branch (77:9): [True: 0, False: 2]
  ------------------
   78|      0|        return;
   79|       |
   80|     38|    for (i = 0; i < CRYPTO_EX_INDEX__COUNT; ++i) {
  ------------------
  |  |  248|     38|# define CRYPTO_EX_INDEX__COUNT          18
  ------------------
  |  Branch (80:17): [True: 36, False: 2]
  ------------------
   81|     36|        EX_CALLBACKS *ip = &global->ex_data[i];
   82|       |
   83|     36|        sk_EX_CALLBACK_pop_free(ip->meth, cleanup_cb);
   84|     36|        ip->meth = NULL;
   85|     36|    }
   86|       |
   87|      2|    CRYPTO_THREAD_lock_free(global->ex_data_lock);
   88|      2|    global->ex_data_lock = NULL;
   89|      2|}
ossl_crypto_free_ex_index_ex:
  114|      2|{
  115|      2|    EX_CALLBACKS *ip;
  116|      2|    EX_CALLBACK *a;
  117|      2|    int toret = 0;
  118|      2|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
  119|       |
  120|      2|    if (global == NULL)
  ------------------
  |  Branch (120:9): [True: 0, False: 2]
  ------------------
  121|      0|        return 0;
  122|       |
  123|      2|    ip = get_and_lock(global, class_index, 0);
  124|      2|    if (ip == NULL)
  ------------------
  |  Branch (124:9): [True: 0, False: 2]
  ------------------
  125|      0|        return 0;
  126|       |
  127|      2|    if (idx < 0 || idx >= sk_EX_CALLBACK_num(ip->meth))
  ------------------
  |  Branch (127:9): [True: 2, False: 0]
  |  Branch (127:20): [True: 0, False: 0]
  ------------------
  128|      2|        goto err;
  129|      0|    a = sk_EX_CALLBACK_value(ip->meth, idx);
  130|      0|    if (a == NULL)
  ------------------
  |  Branch (130:9): [True: 0, False: 0]
  ------------------
  131|      0|        goto err;
  132|      0|    a->new_func = dummy_new;
  133|      0|    a->dup_func = dummy_dup;
  134|      0|    a->free_func = dummy_free;
  135|      0|    toret = 1;
  136|      2|err:
  137|      2|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  138|      2|    return toret;
  139|      0|}
CRYPTO_free_ex_index:
  142|      2|{
  143|      2|    return ossl_crypto_free_ex_index_ex(NULL, class_index, idx);
  144|      2|}
ossl_crypto_new_ex_data_ex:
  221|  3.63k|{
  222|  3.63k|    int mx, i;
  223|  3.63k|    void *ptr;
  224|  3.63k|    EX_CALLBACK **storage = NULL;
  225|  3.63k|    EX_CALLBACK *stack[10];
  226|  3.63k|    EX_CALLBACKS *ip;
  227|  3.63k|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
  228|       |
  229|  3.63k|    if (global == NULL)
  ------------------
  |  Branch (229:9): [True: 0, False: 3.63k]
  ------------------
  230|      0|        return 0;
  231|       |
  232|  3.63k|    ip = get_and_lock(global, class_index, 1);
  233|  3.63k|    if (ip == NULL)
  ------------------
  |  Branch (233:9): [True: 0, False: 3.63k]
  ------------------
  234|      0|        return 0;
  235|       |
  236|  3.63k|    ad->ctx = ctx;
  237|  3.63k|    ad->sk = NULL;
  238|  3.63k|    mx = sk_EX_CALLBACK_num(ip->meth);
  239|  3.63k|    if (mx > 0) {
  ------------------
  |  Branch (239:9): [True: 0, False: 3.63k]
  ------------------
  240|      0|        if (mx < (int)OSSL_NELEM(stack))
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (240:13): [True: 0, False: 0]
  ------------------
  241|      0|            storage = stack;
  242|      0|        else
  243|      0|            storage = OPENSSL_malloc(sizeof(*storage) * mx);
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  244|      0|        if (storage != NULL)
  ------------------
  |  Branch (244:13): [True: 0, False: 0]
  ------------------
  245|      0|            for (i = 0; i < mx; i++)
  ------------------
  |  Branch (245:25): [True: 0, False: 0]
  ------------------
  246|      0|                storage[i] = sk_EX_CALLBACK_value(ip->meth, i);
  247|      0|    }
  248|  3.63k|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  249|       |
  250|  3.63k|    if (mx > 0 && storage == NULL)
  ------------------
  |  Branch (250:9): [True: 0, False: 3.63k]
  |  Branch (250:19): [True: 0, False: 0]
  ------------------
  251|      0|        return 0;
  252|  3.63k|    for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (252:17): [True: 0, False: 3.63k]
  ------------------
  253|      0|        if (storage[i] != NULL && storage[i]->new_func != NULL) {
  ------------------
  |  Branch (253:13): [True: 0, False: 0]
  |  Branch (253:35): [True: 0, False: 0]
  ------------------
  254|      0|            ptr = CRYPTO_get_ex_data(ad, i);
  255|      0|            storage[i]->new_func(obj, ptr, ad, i,
  256|      0|                                 storage[i]->argl, storage[i]->argp);
  257|      0|        }
  258|      0|    }
  259|  3.63k|    if (storage != stack)
  ------------------
  |  Branch (259:9): [True: 3.63k, False: 0]
  ------------------
  260|  3.63k|        OPENSSL_free(storage);
  ------------------
  |  |  115|  3.63k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.63k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.63k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  261|  3.63k|    return 1;
  262|  3.63k|}
CRYPTO_new_ex_data:
  265|  3.63k|{
  266|  3.63k|    return ossl_crypto_new_ex_data_ex(NULL, class_index, obj, ad);
  267|  3.63k|}
CRYPTO_free_ex_data:
  368|  3.63k|{
  369|  3.63k|    int mx, i;
  370|  3.63k|    EX_CALLBACKS *ip;
  371|  3.63k|    void *ptr;
  372|  3.63k|    const EX_CALLBACK *f;
  373|  3.63k|    struct ex_callback_entry stack[10];
  374|  3.63k|    struct ex_callback_entry *storage = NULL;
  375|  3.63k|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ad->ctx);
  376|       |
  377|  3.63k|    if (global == NULL)
  ------------------
  |  Branch (377:9): [True: 0, False: 3.63k]
  ------------------
  378|      0|        goto err;
  379|       |
  380|  3.63k|    ip = get_and_lock(global, class_index, 1);
  381|  3.63k|    if (ip == NULL)
  ------------------
  |  Branch (381:9): [True: 0, False: 3.63k]
  ------------------
  382|      0|        goto err;
  383|       |
  384|  3.63k|    mx = sk_EX_CALLBACK_num(ip->meth);
  385|  3.63k|    if (mx > 0) {
  ------------------
  |  Branch (385:9): [True: 0, False: 3.63k]
  ------------------
  386|      0|        if (mx < (int)OSSL_NELEM(stack))
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (386:13): [True: 0, False: 0]
  ------------------
  387|      0|            storage = stack;
  388|      0|        else
  389|      0|            storage = OPENSSL_malloc(sizeof(*storage) * mx);
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  390|      0|        if (storage != NULL)
  ------------------
  |  Branch (390:13): [True: 0, False: 0]
  ------------------
  391|      0|            for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (391:25): [True: 0, False: 0]
  ------------------
  392|      0|                storage[i].excb = sk_EX_CALLBACK_value(ip->meth, i);
  393|      0|                storage[i].index = i;
  394|      0|            }
  395|      0|    }
  396|  3.63k|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  397|       |
  398|  3.63k|    if (storage != NULL) {
  ------------------
  |  Branch (398:9): [True: 0, False: 3.63k]
  ------------------
  399|       |        /* Sort according to priority. High priority first */
  400|      0|        qsort(storage, mx, sizeof(*storage), ex_callback_compare);
  401|      0|        for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (401:21): [True: 0, False: 0]
  ------------------
  402|      0|            f = storage[i].excb;
  403|       |
  404|      0|            if (f != NULL && f->free_func != NULL) {
  ------------------
  |  Branch (404:17): [True: 0, False: 0]
  |  Branch (404:30): [True: 0, False: 0]
  ------------------
  405|      0|                ptr = CRYPTO_get_ex_data(ad, storage[i].index);
  406|      0|                f->free_func(obj, ptr, ad, storage[i].index, f->argl, f->argp);
  407|      0|            }
  408|      0|        }
  409|      0|    }
  410|       |
  411|  3.63k|    if (storage != stack)
  ------------------
  |  Branch (411:9): [True: 3.63k, False: 0]
  ------------------
  412|  3.63k|        OPENSSL_free(storage);
  ------------------
  |  |  115|  3.63k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.63k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.63k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  413|  3.63k| err:
  414|  3.63k|    sk_void_free(ad->sk);
  ------------------
  |  |  204|  3.63k|#define sk_void_free(sk) OPENSSL_sk_free(ossl_check_void_sk_type(sk))
  ------------------
  415|  3.63k|    ad->sk = NULL;
  416|  3.63k|    ad->ctx = NULL;
  417|  3.63k|}
ex_data.c:get_and_lock:
   33|  7.27k|{
   34|  7.27k|    EX_CALLBACKS *ip;
   35|       |
   36|  7.27k|    if (class_index < 0 || class_index >= CRYPTO_EX_INDEX__COUNT) {
  ------------------
  |  |  248|  7.27k|# define CRYPTO_EX_INDEX__COUNT          18
  ------------------
  |  Branch (36:9): [True: 0, False: 7.27k]
  |  Branch (36:28): [True: 0, False: 7.27k]
  ------------------
   37|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   38|      0|        return NULL;
   39|      0|    }
   40|       |
   41|  7.27k|    if (global->ex_data_lock == NULL) {
  ------------------
  |  Branch (41:9): [True: 0, False: 7.27k]
  ------------------
   42|       |        /*
   43|       |         * If we get here, someone (who?) cleaned up the lock, so just
   44|       |         * treat it as an error.
   45|       |         */
   46|      0|         return NULL;
   47|      0|    }
   48|       |
   49|  7.27k|    if (read) {
  ------------------
  |  Branch (49:9): [True: 7.27k, False: 2]
  ------------------
   50|  7.27k|        if (!CRYPTO_THREAD_read_lock(global->ex_data_lock))
  ------------------
  |  Branch (50:13): [True: 0, False: 7.27k]
  ------------------
   51|      0|            return NULL;
   52|  7.27k|    } else {
   53|      2|        if (!CRYPTO_THREAD_write_lock(global->ex_data_lock))
  ------------------
  |  Branch (53:13): [True: 0, False: 2]
  ------------------
   54|      0|            return NULL;
   55|      2|    }
   56|       |
   57|  7.27k|    ip = &global->ex_data[class_index];
   58|  7.27k|    return ip;
   59|  7.27k|}

ossl_ht_new:
  176|      2|{
  177|      2|    HT *new = OPENSSL_zalloc(sizeof(*new));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  178|       |
  179|      2|    if (new == NULL)
  ------------------
  |  Branch (179:9): [True: 0, False: 2]
  ------------------
  180|      0|        return NULL;
  181|       |
  182|      2|    new->atomic_lock = CRYPTO_THREAD_lock_new();
  183|      2|    if (new->atomic_lock == NULL)
  ------------------
  |  Branch (183:9): [True: 0, False: 2]
  ------------------
  184|      0|        goto err;
  185|       |
  186|      2|    memcpy(&new->config, conf, sizeof(*conf));
  187|       |
  188|      2|    if (new->config.init_neighborhoods != 0) {
  ------------------
  |  Branch (188:9): [True: 2, False: 0]
  ------------------
  189|      2|        new->wpd.neighborhood_len = new->config.init_neighborhoods;
  190|       |        /* round up to the next power of 2 */
  191|      2|        new->wpd.neighborhood_len--;
  192|      2|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 1;
  193|      2|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 2;
  194|      2|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 4;
  195|      2|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 8;
  196|      2|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 16;
  197|      2|        new->wpd.neighborhood_len++;
  198|      2|    } else {
  199|      0|        new->wpd.neighborhood_len = DEFAULT_NEIGH_LEN;
  ------------------
  |  |   95|      0|#define DEFAULT_NEIGH_LEN (1 << DEFAULT_NEIGH_LEN_LOG)
  |  |  ------------------
  |  |  |  |   94|      0|#define DEFAULT_NEIGH_LEN_LOG 4
  |  |  ------------------
  ------------------
  200|      0|    }
  201|       |
  202|      2|    if (new->config.ht_free_fn == NULL)
  ------------------
  |  Branch (202:9): [True: 2, False: 0]
  ------------------
  203|      2|        new->config.ht_free_fn = internal_free_nop;
  204|       |
  205|      2|    new->md = OPENSSL_zalloc(sizeof(*new->md));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  206|      2|    if (new->md == NULL)
  ------------------
  |  Branch (206:9): [True: 0, False: 2]
  ------------------
  207|      0|        goto err;
  208|       |
  209|      2|    new->md->neighborhoods =
  210|      2|        alloc_new_neighborhood_list(new->wpd.neighborhood_len,
  211|      2|                                    &new->md->neighborhood_ptr_to_free);
  212|      2|    if (new->md->neighborhoods == NULL)
  ------------------
  |  Branch (212:9): [True: 0, False: 2]
  ------------------
  213|      0|        goto err;
  214|      2|    new->md->neighborhood_mask = new->wpd.neighborhood_len - 1;
  215|       |
  216|      2|    new->lock = ossl_rcu_lock_new(1, conf->ctx);
  217|      2|    if (new->lock == NULL)
  ------------------
  |  Branch (217:9): [True: 0, False: 2]
  ------------------
  218|      0|        goto err;
  219|       |
  220|      2|    if (new->config.ht_hash_fn == NULL)
  ------------------
  |  Branch (220:9): [True: 2, False: 0]
  ------------------
  221|      2|        new->config.ht_hash_fn = ossl_fnv1a_hash;
  222|       |
  223|      2|    return new;
  224|       |
  225|      0|err:
  226|      0|    CRYPTO_THREAD_lock_free(new->atomic_lock);
  227|      0|    ossl_rcu_lock_free(new->lock);
  228|      0|    if (new->md != NULL)
  ------------------
  |  Branch (228:9): [True: 0, False: 0]
  ------------------
  229|      0|        OPENSSL_free(new->md->neighborhood_ptr_to_free);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  230|      0|    OPENSSL_free(new->md);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  231|      0|    OPENSSL_free(new);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  232|      0|    return NULL;
  233|      2|}
ossl_ht_write_lock:
  246|      2|{
  247|      2|    ossl_rcu_write_lock(htable->lock);
  248|      2|    htable->wpd.need_sync = 0;
  249|      2|}
ossl_ht_write_unlock:
  252|      2|{
  253|      2|    int need_sync = htable->wpd.need_sync;
  254|       |
  255|      2|    htable->wpd.need_sync = 0;
  256|      2|    ossl_rcu_write_unlock(htable->lock);
  257|      2|    if (need_sync)
  ------------------
  |  Branch (257:9): [True: 2, False: 0]
  ------------------
  258|      2|        ossl_synchronize_rcu(htable->lock);
  259|      2|}
ossl_ht_free:
  320|      2|{
  321|      2|    if (h == NULL)
  ------------------
  |  Branch (321:9): [True: 0, False: 2]
  ------------------
  322|      0|        return;
  323|       |
  324|      2|    ossl_ht_write_lock(h);
  325|      2|    ossl_ht_flush_internal(h);
  326|      2|    ossl_ht_write_unlock(h);
  327|       |    /* Freeing the lock does a final sync for us */
  328|      2|    CRYPTO_THREAD_lock_free(h->atomic_lock);
  329|      2|    ossl_rcu_lock_free(h->lock);
  330|      2|    OPENSSL_free(h->md->neighborhood_ptr_to_free);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  331|      2|    OPENSSL_free(h->md);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  332|      2|    OPENSSL_free(h);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  333|      2|    return;
  334|      2|}
hashtable.c:alloc_new_neighborhood_list:
  154|      4|{
  155|      4|    struct ht_neighborhood_st *ret;
  156|       |
  157|      4|    ret = OPENSSL_aligned_alloc(sizeof(struct ht_neighborhood_st) * len,
  ------------------
  |  |  106|      4|        CRYPTO_aligned_alloc(num, alignment, freeptr, \
  |  |  107|      4|                             OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                                            OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  158|      4|                                CACHE_LINE_BYTES, freeptr);
  159|       |
  160|       |    /* fall back to regular malloc */
  161|      4|    if (ret == NULL) {
  ------------------
  |  Branch (161:9): [True: 0, False: 4]
  ------------------
  162|      0|        ret = *freeptr = OPENSSL_malloc(sizeof(struct ht_neighborhood_st) * len);
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  163|      0|        if (ret == NULL)
  ------------------
  |  Branch (163:13): [True: 0, False: 0]
  ------------------
  164|      0|            return NULL;
  165|      0|    }
  166|      4|    memset(ret, 0, sizeof(struct ht_neighborhood_st) * len);
  167|      4|    return ret;
  168|      4|}
hashtable.c:ossl_ht_flush_internal:
  284|      2|{
  285|      2|    struct ht_mutable_data_st *newmd = NULL;
  286|      2|    struct ht_mutable_data_st *oldmd = NULL;
  287|       |
  288|      2|    newmd = OPENSSL_zalloc(sizeof(*newmd));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  289|      2|    if (newmd == NULL)
  ------------------
  |  Branch (289:9): [True: 0, False: 2]
  ------------------
  290|      0|        return 0;
  291|       |
  292|      2|    newmd->neighborhoods = alloc_new_neighborhood_list(DEFAULT_NEIGH_LEN,
  ------------------
  |  |   95|      2|#define DEFAULT_NEIGH_LEN (1 << DEFAULT_NEIGH_LEN_LOG)
  |  |  ------------------
  |  |  |  |   94|      2|#define DEFAULT_NEIGH_LEN_LOG 4
  |  |  ------------------
  ------------------
  293|      2|                                                       &newmd->neighborhood_ptr_to_free);
  294|      2|    if (newmd->neighborhoods == NULL) {
  ------------------
  |  Branch (294:9): [True: 0, False: 2]
  ------------------
  295|      0|        OPENSSL_free(newmd);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  296|      0|        return 0;
  297|      0|    }
  298|       |
  299|      2|    newmd->neighborhood_mask = DEFAULT_NEIGH_LEN - 1;
  ------------------
  |  |   95|      2|#define DEFAULT_NEIGH_LEN (1 << DEFAULT_NEIGH_LEN_LOG)
  |  |  ------------------
  |  |  |  |   94|      2|#define DEFAULT_NEIGH_LEN_LOG 4
  |  |  ------------------
  ------------------
  300|       |
  301|       |    /* Swap the old and new mutable data sets */
  302|      2|    oldmd = ossl_rcu_deref(&h->md);
  ------------------
  |  |   30|      2|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  303|      2|    ossl_rcu_assign_ptr(&h->md, &newmd);
  ------------------
  |  |   31|      2|#define ossl_rcu_assign_ptr(p,v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  304|       |
  305|       |    /* Set the number of entries to 0 */
  306|      2|    h->wpd.value_count = 0;
  307|      2|    h->wpd.neighborhood_len = DEFAULT_NEIGH_LEN;
  ------------------
  |  |   95|      2|#define DEFAULT_NEIGH_LEN (1 << DEFAULT_NEIGH_LEN_LOG)
  |  |  ------------------
  |  |  |  |   94|      2|#define DEFAULT_NEIGH_LEN_LOG 4
  |  |  ------------------
  ------------------
  308|       |
  309|      2|    ossl_rcu_call(h->lock, free_oldmd, oldmd);
  310|      2|    h->wpd.need_sync = 1;
  311|      2|    return 1;
  312|      2|}
hashtable.c:free_oldmd:
  262|      2|{
  263|      2|    struct ht_mutable_data_st *oldmd = arg;
  264|      2|    size_t i, j;
  265|      2|    size_t neighborhood_len = (size_t)oldmd->neighborhood_mask + 1;
  266|      2|    struct ht_internal_value_st *v;
  267|       |
  268|  4.09k|    for (i = 0; i < neighborhood_len; i++) {
  ------------------
  |  Branch (268:17): [True: 4.09k, False: 2]
  ------------------
  269|  4.09k|        PREFETCH_NEIGHBORHOOD(oldmd->neighborhoods[i + 1]);
  ------------------
  |  |   83|  4.09k|# define PREFETCH_NEIGHBORHOOD(x) __builtin_prefetch(x.entries)
  ------------------
  270|  20.4k|        for (j = 0; j < NEIGHBORHOOD_LEN; j++) {
  ------------------
  |  |  103|  20.4k|#define NEIGHBORHOOD_LEN (CACHE_LINE_BYTES / sizeof(struct ht_neighborhood_entry_st))
  |  |  ------------------
  |  |  |  |  100|  20.4k|#define CACHE_LINE_BYTES 64
  |  |  ------------------
  ------------------
  |  Branch (270:21): [True: 16.3k, False: 4.09k]
  ------------------
  271|  16.3k|            if (oldmd->neighborhoods[i].entries[j].value != NULL) {
  ------------------
  |  Branch (271:17): [True: 0, False: 16.3k]
  ------------------
  272|      0|                v = oldmd->neighborhoods[i].entries[j].value;
  273|      0|                v->ht->config.ht_free_fn((HT_VALUE *)v);
  274|      0|                free_value(v);
  275|      0|            }
  276|  16.3k|        }
  277|  4.09k|    }
  278|       |
  279|      2|    OPENSSL_free(oldmd->neighborhood_ptr_to_free);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  280|      2|    OPENSSL_free(oldmd);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  281|      2|}

ossl_err_load_HTTP_strings:
   80|      2|{
   81|      2|# ifndef OPENSSL_NO_ERR
   82|      2|    if (ERR_reason_error_string(HTTP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (82:9): [True: 2, False: 0]
  ------------------
   83|      2|        ERR_load_strings_const(HTTP_str_reasons);
   84|      2|# endif
   85|      2|    return 1;
   86|      2|}

ossl_indicator_set_callback_new:
   22|      2|{
   23|      2|    INDICATOR_CB *cb;
   24|       |
   25|      2|    cb = OPENSSL_zalloc(sizeof(*cb));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|      2|    return cb;
   27|      2|}
ossl_indicator_set_callback_free:
   30|      2|{
   31|      2|    OPENSSL_free(cb);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   32|      2|}

OPENSSL_cleanup:
  378|      2|{
  379|      2|    OPENSSL_INIT_STOP *currhandler, *lasthandler;
  380|       |
  381|       |    /*
  382|       |     * At some point we should consider looking at this function with a view to
  383|       |     * moving most/all of this into onfree handlers in OSSL_LIB_CTX.
  384|       |     */
  385|       |
  386|       |    /* If we've not been inited then no need to deinit */
  387|      2|    if (!base_inited)
  ------------------
  |  Branch (387:9): [True: 0, False: 2]
  ------------------
  388|      0|        return;
  389|       |
  390|       |    /* Might be explicitly called and also by atexit */
  391|      2|    if (stopped)
  ------------------
  |  Branch (391:9): [True: 0, False: 2]
  ------------------
  392|      0|        return;
  393|      2|    stopped = 1;
  394|       |
  395|       |    /*
  396|       |     * Thread stop may not get automatically called by the thread library for
  397|       |     * the very last thread in some situations, so call it directly.
  398|       |     */
  399|      2|    OPENSSL_thread_stop();
  400|       |
  401|      2|    currhandler = stop_handlers;
  402|      2|    while (currhandler != NULL) {
  ------------------
  |  Branch (402:12): [True: 0, False: 2]
  ------------------
  403|      0|        currhandler->handler();
  404|      0|        lasthandler = currhandler;
  405|      0|        currhandler = currhandler->next;
  406|      0|        OPENSSL_free(lasthandler);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  407|      0|    }
  408|      2|    stop_handlers = NULL;
  409|       |
  410|      2|    CRYPTO_THREAD_lock_free(optsdone_lock);
  411|      2|    optsdone_lock = NULL;
  412|      2|    CRYPTO_THREAD_lock_free(init_lock);
  413|      2|    init_lock = NULL;
  414|       |
  415|      2|    CRYPTO_THREAD_cleanup_local(&in_init_config_local);
  416|       |
  417|       |    /*
  418|       |     * We assume we are single-threaded for this function, i.e. no race
  419|       |     * conditions for the various "*_inited" vars below.
  420|       |     */
  421|       |
  422|      2|#ifndef OPENSSL_NO_COMP
  423|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_zlib_cleanup()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  424|      2|    ossl_comp_zlib_cleanup();
  425|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_brotli_cleanup()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  426|      2|    ossl_comp_brotli_cleanup();
  427|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_zstd_cleanup()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  428|      2|    ossl_comp_zstd_cleanup();
  429|      2|#endif
  430|       |
  431|      2|    if (async_inited) {
  ------------------
  |  Branch (431:9): [True: 0, False: 2]
  ------------------
  432|      0|        OSSL_TRACE(INIT, "OPENSSL_cleanup: async_deinit()\n");
  ------------------
  |  |  288|      0|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  433|      0|        async_deinit();
  434|      0|    }
  435|       |
  436|       |    /*
  437|       |     * Note that cleanup order is important:
  438|       |     * - ossl_rand_cleanup_int could call an ENGINE's RAND cleanup function so
  439|       |     * must be called before engine_cleanup_int()
  440|       |     * - ENGINEs use CRYPTO_EX_DATA and therefore, must be cleaned up
  441|       |     * before the ex data handlers are wiped during default ossl_lib_ctx deinit.
  442|       |     * - ossl_config_modules_free() can end up in ENGINE code so must be called
  443|       |     * before engine_cleanup_int()
  444|       |     * - ENGINEs and additional EVP algorithms might use added OIDs names so
  445|       |     * ossl_obj_cleanup_int() must be called last
  446|       |     */
  447|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_rand_cleanup_int()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  448|      2|    ossl_rand_cleanup_int();
  449|       |
  450|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_config_modules_free()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  451|      2|    ossl_config_modules_free();
  452|       |
  453|      2|#ifndef OPENSSL_NO_ENGINE
  454|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: engine_cleanup_int()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  455|      2|    engine_cleanup_int();
  456|      2|#endif
  457|       |
  458|      2|#ifndef OPENSSL_NO_DEPRECATED_3_0
  459|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_store_cleanup_int()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  460|      2|    ossl_store_cleanup_int();
  461|      2|#endif
  462|       |
  463|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_lib_ctx_default_deinit()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  464|      2|    ossl_lib_ctx_default_deinit();
  465|       |
  466|      2|    ossl_cleanup_thread();
  467|       |
  468|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: bio_cleanup()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  469|      2|    bio_cleanup();
  470|       |
  471|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: evp_cleanup_int()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  472|      2|    evp_cleanup_int();
  473|       |
  474|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_obj_cleanup_int()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  475|      2|    ossl_obj_cleanup_int();
  476|       |
  477|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: err_int()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  478|      2|    err_cleanup();
  479|       |
  480|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: CRYPTO_secure_malloc_done()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  481|      2|    CRYPTO_secure_malloc_done();
  482|       |
  483|      2|#ifndef OPENSSL_NO_CMP
  484|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: OSSL_CMP_log_close()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  485|      2|    OSSL_CMP_log_close();
  486|      2|#endif
  487|       |
  488|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_trace_cleanup()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  489|      2|    ossl_trace_cleanup();
  490|       |
  491|      2|    base_inited = 0;
  492|      2|}
OPENSSL_init_crypto:
  500|  4.30k|{
  501|  4.30k|    uint64_t tmp;
  502|  4.30k|    int aloaddone = 0;
  503|       |
  504|       |   /* Applications depend on 0 being returned when cleanup was already done */
  505|  4.30k|    if (stopped) {
  ------------------
  |  Branch (505:9): [True: 0, False: 4.30k]
  ------------------
  506|      0|        if (!(opts & OPENSSL_INIT_BASE_ONLY))
  ------------------
  |  |   31|      0|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (506:13): [True: 0, False: 0]
  ------------------
  507|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_INIT_FAIL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  508|      0|        return 0;
  509|      0|    }
  510|       |
  511|       |    /*
  512|       |     * We ignore failures from this function. It is probably because we are
  513|       |     * on a platform that doesn't support lockless atomic loads (we may not
  514|       |     * have created optsdone_lock yet so we can't use it). This is just an
  515|       |     * optimisation to skip the full checks in this function if we don't need
  516|       |     * to, so we carry on regardless in the event of failure.
  517|       |     *
  518|       |     * There could be a race here with other threads, so that optsdone has not
  519|       |     * been updated yet, even though the options have in fact been initialised.
  520|       |     * This doesn't matter - it just means we will run the full function
  521|       |     * unnecessarily - but all the critical code is contained in RUN_ONCE
  522|       |     * functions anyway so we are safe.
  523|       |     */
  524|  4.30k|    if (CRYPTO_atomic_load(&optsdone, &tmp, NULL)) {
  ------------------
  |  Branch (524:9): [True: 4.30k, False: 0]
  ------------------
  525|  4.30k|        if ((tmp & opts) == opts)
  ------------------
  |  Branch (525:13): [True: 2, False: 4.30k]
  ------------------
  526|      2|            return 1;
  527|  4.30k|        aloaddone = 1;
  528|  4.30k|    }
  529|       |
  530|       |    /*
  531|       |     * At some point we should look at this function with a view to moving
  532|       |     * most/all of this into OSSL_LIB_CTX.
  533|       |     *
  534|       |     * When the caller specifies OPENSSL_INIT_BASE_ONLY, that should be the
  535|       |     * *only* option specified.  With that option we return immediately after
  536|       |     * doing the requested limited initialization.  Note that
  537|       |     * err_shelve_state() called by us via ossl_init_load_crypto_nodelete()
  538|       |     * re-enters OPENSSL_init_crypto() with OPENSSL_INIT_BASE_ONLY, but with
  539|       |     * base already initialized this is a harmless NOOP.
  540|       |     *
  541|       |     * If we remain the only caller of err_shelve_state() the recursion should
  542|       |     * perhaps be removed, but if in doubt, it can be left in place.
  543|       |     */
  544|  4.30k|    if (!RUN_ONCE(&base, ossl_init_base))
  ------------------
  |  |  130|  4.30k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 4.30k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (544:9): [True: 0, False: 4.30k]
  ------------------
  545|      0|        return 0;
  546|       |
  547|  4.30k|    if (opts & OPENSSL_INIT_BASE_ONLY)
  ------------------
  |  |   31|  4.30k|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (547:9): [True: 4.30k, False: 2]
  ------------------
  548|  4.30k|        return 1;
  549|       |
  550|       |    /*
  551|       |     * optsdone_lock should definitely be set up now, so we can now repeat the
  552|       |     * same check from above but be sure that it will work even on platforms
  553|       |     * without lockless CRYPTO_atomic_load
  554|       |     */
  555|      2|    if (!aloaddone) {
  ------------------
  |  Branch (555:9): [True: 0, False: 2]
  ------------------
  556|      0|        if (!CRYPTO_atomic_load(&optsdone, &tmp, optsdone_lock))
  ------------------
  |  Branch (556:13): [True: 0, False: 0]
  ------------------
  557|      0|            return 0;
  558|      0|        if ((tmp & opts) == opts)
  ------------------
  |  Branch (558:13): [True: 0, False: 0]
  ------------------
  559|      0|            return 1;
  560|      0|    }
  561|       |
  562|       |    /*
  563|       |     * Now we don't always set up exit handlers, the INIT_BASE_ONLY calls
  564|       |     * should not have the side-effect of setting up exit handlers, and
  565|       |     * therefore, this code block is below the INIT_BASE_ONLY-conditioned early
  566|       |     * return above.
  567|       |     */
  568|      2|    if ((opts & OPENSSL_INIT_NO_ATEXIT) != 0) {
  ------------------
  |  |  485|      2|# define OPENSSL_INIT_NO_ATEXIT              0x00080000L
  ------------------
  |  Branch (568:9): [True: 0, False: 2]
  ------------------
  569|      0|        if (!RUN_ONCE_ALT(&register_atexit, ossl_init_no_register_atexit,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (569:13): [True: 0, False: 0]
  ------------------
  570|      0|                          ossl_init_register_atexit))
  571|      0|            return 0;
  572|      2|    } else if (!RUN_ONCE(&register_atexit, ossl_init_register_atexit)) {
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (572:16): [True: 0, False: 2]
  ------------------
  573|      0|        return 0;
  574|      0|    }
  575|       |
  576|      2|    if (!RUN_ONCE(&load_crypto_nodelete, ossl_init_load_crypto_nodelete))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (576:9): [True: 0, False: 2]
  ------------------
  577|      0|        return 0;
  578|       |
  579|      2|    if ((opts & OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS)
  ------------------
  |  |  466|      2|# define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS 0x00000001L
  ------------------
  |  Branch (579:9): [True: 0, False: 2]
  ------------------
  580|      2|            && !RUN_ONCE_ALT(&load_crypto_strings,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (580:16): [True: 0, False: 0]
  ------------------
  581|      2|                             ossl_init_no_load_crypto_strings,
  582|      2|                             ossl_init_load_crypto_strings))
  583|      0|        return 0;
  584|       |
  585|      2|    if ((opts & OPENSSL_INIT_LOAD_CRYPTO_STRINGS)
  ------------------
  |  |  467|      2|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
  |  Branch (585:9): [True: 2, False: 0]
  ------------------
  586|      2|            && !RUN_ONCE(&load_crypto_strings, ossl_init_load_crypto_strings))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (586:16): [True: 0, False: 2]
  ------------------
  587|      0|        return 0;
  588|       |
  589|      2|    if ((opts & OPENSSL_INIT_NO_LOAD_SSL_STRINGS)
  ------------------
  |  | 2806|      2|# define OPENSSL_INIT_NO_LOAD_SSL_STRINGS    0x00100000L
  ------------------
  |  Branch (589:9): [True: 0, False: 2]
  ------------------
  590|      2|        && !RUN_ONCE_ALT(&ssl_strings, ossl_init_no_load_ssl_strings,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (590:12): [True: 0, False: 0]
  ------------------
  591|      2|                         ossl_init_load_ssl_strings))
  592|      0|        return 0;
  593|       |
  594|      2|    if ((opts & OPENSSL_INIT_LOAD_SSL_STRINGS)
  ------------------
  |  | 2807|      2|# define OPENSSL_INIT_LOAD_SSL_STRINGS       0x00200000L
  ------------------
  |  Branch (594:9): [True: 0, False: 2]
  ------------------
  595|      2|        && !RUN_ONCE(&ssl_strings, ossl_init_load_ssl_strings))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (595:12): [True: 0, False: 0]
  ------------------
  596|      0|        return 0;
  597|       |
  598|      2|    if ((opts & OPENSSL_INIT_NO_ADD_ALL_CIPHERS)
  ------------------
  |  |  470|      2|# define OPENSSL_INIT_NO_ADD_ALL_CIPHERS     0x00000010L
  ------------------
  |  Branch (598:9): [True: 0, False: 2]
  ------------------
  599|      2|            && !RUN_ONCE_ALT(&add_all_ciphers, ossl_init_no_add_all_ciphers,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (599:16): [True: 0, False: 0]
  ------------------
  600|      2|                             ossl_init_add_all_ciphers))
  601|      0|        return 0;
  602|       |
  603|      2|    if ((opts & OPENSSL_INIT_ADD_ALL_CIPHERS)
  ------------------
  |  |  468|      2|# define OPENSSL_INIT_ADD_ALL_CIPHERS        0x00000004L
  ------------------
  |  Branch (603:9): [True: 0, False: 2]
  ------------------
  604|      2|            && !RUN_ONCE(&add_all_ciphers, ossl_init_add_all_ciphers))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (604:16): [True: 0, False: 0]
  ------------------
  605|      0|        return 0;
  606|       |
  607|      2|    if ((opts & OPENSSL_INIT_NO_ADD_ALL_DIGESTS)
  ------------------
  |  |  471|      2|# define OPENSSL_INIT_NO_ADD_ALL_DIGESTS     0x00000020L
  ------------------
  |  Branch (607:9): [True: 0, False: 2]
  ------------------
  608|      2|            && !RUN_ONCE_ALT(&add_all_digests, ossl_init_no_add_all_digests,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (608:16): [True: 0, False: 0]
  ------------------
  609|      2|                             ossl_init_add_all_digests))
  610|      0|        return 0;
  611|       |
  612|      2|    if ((opts & OPENSSL_INIT_ADD_ALL_DIGESTS)
  ------------------
  |  |  469|      2|# define OPENSSL_INIT_ADD_ALL_DIGESTS        0x00000008L
  ------------------
  |  Branch (612:9): [True: 0, False: 2]
  ------------------
  613|      2|            && !RUN_ONCE(&add_all_digests, ossl_init_add_all_digests))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (613:16): [True: 0, False: 0]
  ------------------
  614|      0|        return 0;
  615|       |
  616|      2|    if ((opts & OPENSSL_INIT_ATFORK)
  ------------------
  |  |  483|      2|# define OPENSSL_INIT_ATFORK                 0x00020000L
  ------------------
  |  Branch (616:9): [True: 0, False: 2]
  ------------------
  617|      2|            && !openssl_init_fork_handlers())
  ------------------
  |  Branch (617:16): [True: 0, False: 0]
  ------------------
  618|      0|        return 0;
  619|       |
  620|      2|    if ((opts & OPENSSL_INIT_NO_LOAD_CONFIG)
  ------------------
  |  |  473|      2|# define OPENSSL_INIT_NO_LOAD_CONFIG         0x00000080L
  ------------------
  |  Branch (620:9): [True: 0, False: 2]
  ------------------
  621|      2|            && !RUN_ONCE_ALT(&config, ossl_init_no_config, ossl_init_config))
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (621:16): [True: 0, False: 0]
  ------------------
  622|      0|        return 0;
  623|       |
  624|      2|    if (opts & OPENSSL_INIT_LOAD_CONFIG) {
  ------------------
  |  |  472|      2|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  |  Branch (624:9): [True: 0, False: 2]
  ------------------
  625|      0|        int loading = CRYPTO_THREAD_get_local(&in_init_config_local) != NULL;
  626|       |
  627|       |        /* If called recursively from OBJ_ calls, just skip it. */
  628|      0|        if (!loading) {
  ------------------
  |  Branch (628:13): [True: 0, False: 0]
  ------------------
  629|      0|            int ret;
  630|       |
  631|      0|            if (!CRYPTO_THREAD_set_local(&in_init_config_local, (void *)-1))
  ------------------
  |  Branch (631:17): [True: 0, False: 0]
  ------------------
  632|      0|                return 0;
  633|      0|            if (settings == NULL) {
  ------------------
  |  Branch (633:17): [True: 0, False: 0]
  ------------------
  634|      0|                ret = RUN_ONCE(&config, ossl_init_config);
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  635|      0|            } else {
  636|      0|                if (!CRYPTO_THREAD_write_lock(init_lock))
  ------------------
  |  Branch (636:21): [True: 0, False: 0]
  ------------------
  637|      0|                    return 0;
  638|      0|                conf_settings = settings;
  639|      0|                ret = RUN_ONCE_ALT(&config, ossl_init_config_settings,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  640|      0|                                   ossl_init_config);
  641|      0|                conf_settings = NULL;
  642|      0|                CRYPTO_THREAD_unlock(init_lock);
  643|      0|            }
  644|       |
  645|      0|            if (ret <= 0)
  ------------------
  |  Branch (645:17): [True: 0, False: 0]
  ------------------
  646|      0|                return 0;
  647|      0|        }
  648|      0|    }
  649|       |
  650|      2|    if ((opts & OPENSSL_INIT_ASYNC)
  ------------------
  |  |  474|      2|# define OPENSSL_INIT_ASYNC                  0x00000100L
  ------------------
  |  Branch (650:9): [True: 0, False: 2]
  ------------------
  651|      2|            && !RUN_ONCE(&async, ossl_init_async))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (651:16): [True: 0, False: 0]
  ------------------
  652|      0|        return 0;
  653|       |
  654|      2|#ifndef OPENSSL_NO_ENGINE
  655|      2|    if ((opts & OPENSSL_INIT_ENGINE_OPENSSL)
  ------------------
  |  |  477|      2|# define OPENSSL_INIT_ENGINE_OPENSSL         0x00000800L
  ------------------
  |  Branch (655:9): [True: 0, False: 2]
  ------------------
  656|      2|            && !RUN_ONCE(&engine_openssl, ossl_init_engine_openssl))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (656:16): [True: 0, False: 0]
  ------------------
  657|      0|        return 0;
  658|      2|# ifndef OPENSSL_NO_RDRAND
  659|      2|    if ((opts & OPENSSL_INIT_ENGINE_RDRAND)
  ------------------
  |  |  475|      2|# define OPENSSL_INIT_ENGINE_RDRAND          0x00000200L
  ------------------
  |  Branch (659:9): [True: 0, False: 2]
  ------------------
  660|      2|            && !RUN_ONCE(&engine_rdrand, ossl_init_engine_rdrand))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (660:16): [True: 0, False: 0]
  ------------------
  661|      0|        return 0;
  662|      2|# endif
  663|      2|    if ((opts & OPENSSL_INIT_ENGINE_DYNAMIC)
  ------------------
  |  |  476|      2|# define OPENSSL_INIT_ENGINE_DYNAMIC         0x00000400L
  ------------------
  |  Branch (663:9): [True: 0, False: 2]
  ------------------
  664|      2|            && !RUN_ONCE(&engine_dynamic, ossl_init_engine_dynamic))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (664:16): [True: 0, False: 0]
  ------------------
  665|      0|        return 0;
  666|      2|# ifndef OPENSSL_NO_STATIC_ENGINE
  667|       |#  ifndef OPENSSL_NO_DEVCRYPTOENG
  668|       |    if ((opts & OPENSSL_INIT_ENGINE_CRYPTODEV)
  669|       |            && !RUN_ONCE(&engine_devcrypto, ossl_init_engine_devcrypto))
  670|       |        return 0;
  671|       |#  endif
  672|      2|#  if !defined(OPENSSL_NO_PADLOCKENG)
  673|      2|    if ((opts & OPENSSL_INIT_ENGINE_PADLOCK)
  ------------------
  |  |  480|      2|# define OPENSSL_INIT_ENGINE_PADLOCK         0x00004000L
  ------------------
  |  Branch (673:9): [True: 0, False: 2]
  ------------------
  674|      2|            && !RUN_ONCE(&engine_padlock, ossl_init_engine_padlock))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (674:16): [True: 0, False: 0]
  ------------------
  675|      0|        return 0;
  676|      2|#  endif
  677|       |#  if defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_NO_CAPIENG)
  678|       |    if ((opts & OPENSSL_INIT_ENGINE_CAPI)
  679|       |            && !RUN_ONCE(&engine_capi, ossl_init_engine_capi))
  680|       |        return 0;
  681|       |#  endif
  682|      2|#  if !defined(OPENSSL_NO_AFALGENG)
  683|      2|    if ((opts & OPENSSL_INIT_ENGINE_AFALG)
  ------------------
  |  |  481|      2|# define OPENSSL_INIT_ENGINE_AFALG           0x00008000L
  ------------------
  |  Branch (683:9): [True: 0, False: 2]
  ------------------
  684|      2|            && !RUN_ONCE(&engine_afalg, ossl_init_engine_afalg))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (684:16): [True: 0, False: 0]
  ------------------
  685|      0|        return 0;
  686|      2|#  endif
  687|      2|# endif
  688|      2|    if (opts & (OPENSSL_INIT_ENGINE_ALL_BUILTIN
  ------------------
  |  |  497|      2|    (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
  |  |  ------------------
  |  |  |  |  475|      2|# define OPENSSL_INIT_ENGINE_RDRAND          0x00000200L
  |  |  ------------------
  |  |                   (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
  |  |  ------------------
  |  |  |  |  476|      2|# define OPENSSL_INIT_ENGINE_DYNAMIC         0x00000400L
  |  |  ------------------
  |  |  498|      2|    | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | \
  |  |  ------------------
  |  |  |  |  478|      2|# define OPENSSL_INIT_ENGINE_CRYPTODEV       0x00001000L
  |  |  ------------------
  |  |                   | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | \
  |  |  ------------------
  |  |  |  |  479|      2|# define OPENSSL_INIT_ENGINE_CAPI            0x00002000L
  |  |  ------------------
  |  |  499|      2|    OPENSSL_INIT_ENGINE_PADLOCK)
  |  |  ------------------
  |  |  |  |  480|      2|# define OPENSSL_INIT_ENGINE_PADLOCK         0x00004000L
  |  |  ------------------
  ------------------
  |  Branch (688:9): [True: 0, False: 2]
  ------------------
  689|      2|                | OPENSSL_INIT_ENGINE_OPENSSL
  ------------------
  |  |  477|      2|# define OPENSSL_INIT_ENGINE_OPENSSL         0x00000800L
  ------------------
  690|      2|                | OPENSSL_INIT_ENGINE_AFALG)) {
  ------------------
  |  |  481|      2|# define OPENSSL_INIT_ENGINE_AFALG           0x00008000L
  ------------------
  691|      0|        ENGINE_register_all_complete();
  692|      0|    }
  693|      2|#endif
  694|       |
  695|      2|    if (!CRYPTO_atomic_or(&optsdone, opts, &tmp, optsdone_lock))
  ------------------
  |  Branch (695:9): [True: 0, False: 2]
  ------------------
  696|      0|        return 0;
  697|       |
  698|      2|    return 1;
  699|      2|}
init.c:ossl_init_base:
   58|      2|{
   59|       |    /* no need to init trace */
   60|       |
   61|      2|    OSSL_TRACE(INIT, "ossl_init_base: setting up stop handlers\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   62|       |#ifndef OPENSSL_NO_CRYPTO_MDEBUG
   63|       |    ossl_malloc_setup_failures();
   64|       |#endif
   65|       |
   66|      2|    if ((optsdone_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (66:9): [True: 0, False: 2]
  ------------------
   67|      2|        || (init_lock = CRYPTO_THREAD_lock_new()) == NULL)
  ------------------
  |  Branch (67:12): [True: 0, False: 2]
  ------------------
   68|      0|        goto err;
   69|       |
   70|      2|    OPENSSL_cpuid_setup();
   71|       |
   72|      2|    if (!ossl_init_thread())
  ------------------
  |  Branch (72:9): [True: 0, False: 2]
  ------------------
   73|      0|        goto err;
   74|       |
   75|      2|    if (!CRYPTO_THREAD_init_local(&in_init_config_local, NULL))
  ------------------
  |  Branch (75:9): [True: 0, False: 2]
  ------------------
   76|      0|        goto err;
   77|       |
   78|      2|    base_inited = 1;
   79|      2|    return 1;
   80|       |
   81|      0|err:
   82|      0|    OSSL_TRACE(INIT, "ossl_init_base failed!\n");
  ------------------
  |  |  288|      0|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   83|      0|    CRYPTO_THREAD_lock_free(optsdone_lock);
   84|      0|    optsdone_lock = NULL;
   85|      0|    CRYPTO_THREAD_lock_free(init_lock);
   86|      0|    init_lock = NULL;
   87|       |
   88|      0|    return 0;
   89|      2|}
init.c:ossl_init_register_atexit:
  101|      2|{
  102|      2|#ifndef OPENSSL_NO_ATEXIT
  103|       |# ifdef OPENSSL_INIT_DEBUG
  104|       |    fprintf(stderr, "OPENSSL_INIT: ossl_init_register_atexit()\n");
  105|       |# endif
  106|      2|# ifndef OPENSSL_SYS_UEFI
  107|       |#  if defined(_WIN32) && !defined(__BORLANDC__)
  108|       |    /* We use _onexit() in preference because it gets called on DLL unload */
  109|       |    if (_onexit(win32atexit) == NULL)
  110|       |        return 0;
  111|       |#  else
  112|      2|    if (atexit(OPENSSL_cleanup) != 0)
  ------------------
  |  Branch (112:9): [True: 0, False: 2]
  ------------------
  113|      0|        return 0;
  114|      2|#  endif
  115|      2|# endif
  116|      2|#endif
  117|       |
  118|      2|    return 1;
  119|      2|}
init.c:ossl_init_load_crypto_nodelete:
  133|      2|{
  134|      2|    OSSL_TRACE(INIT, "ossl_init_load_crypto_nodelete()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  135|       |
  136|       |#if !defined(OPENSSL_USE_NODELETE) \
  137|       |    && !defined(OPENSSL_NO_PINSHARED)
  138|       |# if defined(DSO_WIN32) && !defined(_WIN32_WCE)
  139|       |    {
  140|       |        HMODULE handle = NULL;
  141|       |        BOOL ret;
  142|       |
  143|       |        /* We don't use the DSO route for WIN32 because there is a better way */
  144|       |        ret = GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
  145|       |                                | GET_MODULE_HANDLE_EX_FLAG_PIN,
  146|       |                                (void *)&base_inited, &handle);
  147|       |
  148|       |        OSSL_TRACE1(INIT,
  149|       |                    "ossl_init_load_crypto_nodelete: "
  150|       |                    "obtained DSO reference? %s\n",
  151|       |                    (ret == TRUE ? "No!" : "Yes."));
  152|       |        return (ret == TRUE) ? 1 : 0;
  153|       |    }
  154|       |# elif !defined(DSO_NONE)
  155|       |    /*
  156|       |     * Deliberately leak a reference to ourselves. This will force the library
  157|       |     * to remain loaded until the atexit() handler is run at process exit.
  158|       |     */
  159|       |    {
  160|       |        DSO *dso;
  161|       |        void *err;
  162|       |
  163|       |        if (!err_shelve_state(&err))
  164|       |            return 0;
  165|       |
  166|       |        dso = DSO_dsobyaddr(&base_inited, DSO_FLAG_NO_UNLOAD_ON_FREE);
  167|       |        /*
  168|       |         * In case of No!, it is uncertain our exit()-handlers can still be
  169|       |         * called. After dlclose() the whole library might have been unloaded
  170|       |         * already.
  171|       |         */
  172|       |        OSSL_TRACE1(INIT, "obtained DSO reference? %s\n",
  173|       |                    (dso == NULL ? "No!" : "Yes."));
  174|       |        DSO_free(dso);
  175|       |        err_unshelve_state(err);
  176|       |    }
  177|       |# endif
  178|       |#endif
  179|       |
  180|      2|    return 1;
  181|      2|}
init.c:ossl_init_load_crypto_strings:
  186|      2|{
  187|      2|    int ret = 1;
  188|       |    /*
  189|       |     * OPENSSL_NO_AUTOERRINIT is provided here to prevent at compile time
  190|       |     * pulling in all the error strings during static linking
  191|       |     */
  192|      2|#if !defined(OPENSSL_NO_ERR) && !defined(OPENSSL_NO_AUTOERRINIT)
  193|      2|    void *err;
  194|       |
  195|      2|    if (!err_shelve_state(&err))
  ------------------
  |  Branch (195:9): [True: 0, False: 2]
  ------------------
  196|      0|        return 0;
  197|       |
  198|      2|    OSSL_TRACE(INIT, "ossl_err_load_crypto_strings()\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  199|      2|    ret = ossl_err_load_crypto_strings();
  200|       |
  201|      2|    err_unshelve_state(err);
  202|      2|#endif
  203|      2|    return ret;
  204|      2|}

ossl_init_thread:
  203|      2|{
  204|      2|    if (!CRYPTO_THREAD_init_local(&destructor_key.value,
  ------------------
  |  Branch (204:9): [True: 0, False: 2]
  ------------------
  205|      2|                                  init_thread_destructor))
  206|      0|        return 0;
  207|       |
  208|      2|    return 1;
  209|      2|}
ossl_cleanup_thread:
  212|      2|{
  213|      2|    init_thread_deregister(NULL, 1);
  214|      2|    CRYPTO_THREAD_cleanup_local(&destructor_key.value);
  215|      2|    destructor_key.sane = -1;
  216|      2|}
OPENSSL_thread_stop:
  230|      2|{
  231|      2|    if (destructor_key.sane != -1) {
  ------------------
  |  Branch (231:9): [True: 2, False: 0]
  ------------------
  232|      2|        THREAD_EVENT_HANDLER **hands
  233|      2|            = init_get_thread_local(&destructor_key.value, 0, 0);
  234|      2|        init_thread_stop(NULL, hands);
  235|       |
  236|      2|        init_thread_remove_handlers(hands);
  237|      2|        OPENSSL_free(hands);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  238|      2|    }
  239|      2|}
ossl_ctx_thread_stop:
  242|      2|{
  243|      2|    if (destructor_key.sane != -1) {
  ------------------
  |  Branch (243:9): [True: 2, False: 0]
  ------------------
  244|      2|        THREAD_EVENT_HANDLER **hands
  245|      2|            = init_get_thread_local(&destructor_key.value, 0, 1);
  246|      2|        init_thread_stop(ctx, hands);
  247|      2|    }
  248|      2|}
ossl_init_thread_start:
  369|      2|{
  370|      2|    THREAD_EVENT_HANDLER **hands;
  371|      2|    THREAD_EVENT_HANDLER *hand;
  372|       |#ifdef FIPS_MODULE
  373|       |    OSSL_LIB_CTX *ctx = arg;
  374|       |
  375|       |    /*
  376|       |     * In FIPS mode the list of THREAD_EVENT_HANDLERs is unique per combination
  377|       |     * of OSSL_LIB_CTX and thread. This is because in FIPS mode each
  378|       |     * OSSL_LIB_CTX gets informed about thread stop events individually.
  379|       |     */
  380|       |    CRYPTO_THREAD_LOCAL *local
  381|       |        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX);
  382|       |#else
  383|       |    /*
  384|       |     * Outside of FIPS mode the list of THREAD_EVENT_HANDLERs is unique per
  385|       |     * thread, but may hold multiple OSSL_LIB_CTXs. We only get told about
  386|       |     * thread stop events globally, so we have to ensure all affected
  387|       |     * OSSL_LIB_CTXs are informed.
  388|       |     */
  389|      2|    CRYPTO_THREAD_LOCAL *local = &destructor_key.value;
  390|      2|#endif
  391|       |
  392|      2|    hands = init_get_thread_local(local, 1, 0);
  393|      2|    if (hands == NULL)
  ------------------
  |  Branch (393:9): [True: 0, False: 2]
  ------------------
  394|      0|        return 0;
  395|       |
  396|       |#ifdef FIPS_MODULE
  397|       |    if (*hands == NULL) {
  398|       |        /*
  399|       |         * We've not yet registered any handlers for this thread. We need to get
  400|       |         * libcrypto to tell us about later thread stop events. c_thread_start
  401|       |         * is a callback to libcrypto defined in fipsprov.c
  402|       |         */
  403|       |        if (!ossl_thread_register_fips(ctx))
  404|       |            return 0;
  405|       |    }
  406|       |#endif
  407|       |
  408|      2|    hand = OPENSSL_malloc(sizeof(*hand));
  ------------------
  |  |  102|      2|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  409|      2|    if (hand == NULL)
  ------------------
  |  Branch (409:9): [True: 0, False: 2]
  ------------------
  410|      0|        return 0;
  411|       |
  412|      2|    hand->handfn = handfn;
  413|      2|    hand->arg = arg;
  414|      2|#ifndef FIPS_MODULE
  415|      2|    hand->index = index;
  416|      2|#endif
  417|      2|    hand->next = *hands;
  418|      2|    *hands = hand;
  419|       |
  420|      2|    return 1;
  421|      2|}
initthread.c:init_get_thread_local:
   95|      6|{
   96|      6|    THREAD_EVENT_HANDLER **hands = CRYPTO_THREAD_get_local(local);
   97|       |
   98|      6|    if (alloc) {
  ------------------
  |  Branch (98:9): [True: 2, False: 4]
  ------------------
   99|      2|        if (hands == NULL) {
  ------------------
  |  Branch (99:13): [True: 2, False: 0]
  ------------------
  100|       |
  101|      2|            if ((hands = OPENSSL_zalloc(sizeof(*hands))) == NULL)
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (101:17): [True: 0, False: 2]
  ------------------
  102|      0|                return NULL;
  103|       |
  104|      2|            if (!CRYPTO_THREAD_set_local(local, hands)) {
  ------------------
  |  Branch (104:17): [True: 0, False: 2]
  ------------------
  105|      0|                OPENSSL_free(hands);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  106|      0|                return NULL;
  107|      0|            }
  108|       |
  109|      2|#ifndef FIPS_MODULE
  110|      2|            if (!init_thread_push_handlers(hands)) {
  ------------------
  |  Branch (110:17): [True: 0, False: 2]
  ------------------
  111|      0|                CRYPTO_THREAD_set_local(local, NULL);
  112|      0|                OPENSSL_free(hands);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  113|      0|                return NULL;
  114|      0|            }
  115|      2|#endif
  116|      2|        }
  117|      4|    } else if (!keep) {
  ------------------
  |  Branch (117:16): [True: 2, False: 2]
  ------------------
  118|      2|        CRYPTO_THREAD_set_local(local, NULL);
  119|      2|    }
  120|       |
  121|      6|    return hands;
  122|      6|}
initthread.c:init_thread_push_handlers:
  155|      2|{
  156|      2|    int ret;
  157|      2|    GLOBAL_TEVENT_REGISTER *gtr;
  158|       |
  159|      2|    gtr = get_global_tevent_register();
  160|      2|    if (gtr == NULL)
  ------------------
  |  Branch (160:9): [True: 0, False: 2]
  ------------------
  161|      0|        return 0;
  162|       |
  163|      2|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (163:9): [True: 0, False: 2]
  ------------------
  164|      0|        return 0;
  165|      2|    ret = (sk_THREAD_EVENT_HANDLER_PTR_push(gtr->skhands, hands) != 0);
  166|      2|    CRYPTO_THREAD_unlock(gtr->lock);
  167|       |
  168|      2|    return ret;
  169|      2|}
initthread.c:get_global_tevent_register:
   78|      8|{
   79|      8|    if (!RUN_ONCE(&tevent_register_runonce, create_global_tevent_register))
  ------------------
  |  |  130|      8|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 8, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (79:9): [True: 0, False: 8]
  ------------------
   80|      0|        return NULL;
   81|      8|    return glob_tevent_reg;
   82|      8|}
initthread.c:create_global_tevent_register:
   59|      2|{
   60|      2|    glob_tevent_reg = OPENSSL_zalloc(sizeof(*glob_tevent_reg));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|      2|    if (glob_tevent_reg == NULL)
  ------------------
  |  Branch (61:9): [True: 0, False: 2]
  ------------------
   62|      0|        return 0;
   63|       |
   64|      2|    glob_tevent_reg->skhands = sk_THREAD_EVENT_HANDLER_PTR_new_null();
   65|      2|    glob_tevent_reg->lock = CRYPTO_THREAD_lock_new();
   66|      2|    if (glob_tevent_reg->skhands == NULL || glob_tevent_reg->lock == NULL) {
  ------------------
  |  Branch (66:9): [True: 0, False: 2]
  |  Branch (66:45): [True: 0, False: 2]
  ------------------
   67|      0|        sk_THREAD_EVENT_HANDLER_PTR_free(glob_tevent_reg->skhands);
   68|      0|        CRYPTO_THREAD_lock_free(glob_tevent_reg->lock);
   69|      0|        OPENSSL_free(glob_tevent_reg);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   70|      0|        glob_tevent_reg = NULL;
   71|      0|        return 0;
   72|      0|    }
   73|       |
   74|      2|    return 1;
   75|      2|}
initthread.c:init_thread_remove_handlers:
  172|      2|{
  173|      2|    GLOBAL_TEVENT_REGISTER *gtr;
  174|      2|    int i;
  175|       |
  176|      2|    gtr = get_global_tevent_register();
  177|      2|    if (gtr == NULL)
  ------------------
  |  Branch (177:9): [True: 0, False: 2]
  ------------------
  178|      0|        return;
  179|      2|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (179:9): [True: 0, False: 2]
  ------------------
  180|      0|        return;
  181|      2|    for (i = 0; i < sk_THREAD_EVENT_HANDLER_PTR_num(gtr->skhands); i++) {
  ------------------
  |  Branch (181:17): [True: 2, False: 0]
  ------------------
  182|      2|        THREAD_EVENT_HANDLER **hands
  183|      2|            = sk_THREAD_EVENT_HANDLER_PTR_value(gtr->skhands, i);
  184|       |
  185|      2|        if (hands == handsin) {
  ------------------
  |  Branch (185:13): [True: 2, False: 0]
  ------------------
  186|      2|            sk_THREAD_EVENT_HANDLER_PTR_delete(gtr->skhands, i);
  187|      2|            CRYPTO_THREAD_unlock(gtr->lock);
  188|      2|            return;
  189|      2|        }
  190|      2|    }
  191|      0|    CRYPTO_THREAD_unlock(gtr->lock);
  192|      0|    return;
  193|      2|}
initthread.c:init_thread_stop:
  325|      4|{
  326|      4|    THREAD_EVENT_HANDLER *curr, *prev = NULL, *tmp;
  327|      4|#ifndef FIPS_MODULE
  328|      4|    GLOBAL_TEVENT_REGISTER *gtr;
  329|      4|#endif
  330|       |
  331|       |    /* Can't do much about this */
  332|      4|    if (hands == NULL)
  ------------------
  |  Branch (332:9): [True: 2, False: 2]
  ------------------
  333|      2|        return;
  334|       |
  335|      2|#ifndef FIPS_MODULE
  336|      2|    gtr = get_global_tevent_register();
  337|      2|    if (gtr == NULL)
  ------------------
  |  Branch (337:9): [True: 0, False: 2]
  ------------------
  338|      0|        return;
  339|       |
  340|      2|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (340:9): [True: 0, False: 2]
  ------------------
  341|      0|        return;
  342|      2|#endif
  343|       |
  344|      2|    curr = *hands;
  345|      4|    while (curr != NULL) {
  ------------------
  |  Branch (345:12): [True: 2, False: 2]
  ------------------
  346|      2|        if (arg != NULL && curr->arg != arg) {
  ------------------
  |  Branch (346:13): [True: 0, False: 2]
  |  Branch (346:28): [True: 0, False: 0]
  ------------------
  347|      0|            prev = curr;
  348|      0|            curr = curr->next;
  349|      0|            continue;
  350|      0|        }
  351|      2|        curr->handfn(curr->arg);
  352|      2|        if (prev == NULL)
  ------------------
  |  Branch (352:13): [True: 2, False: 0]
  ------------------
  353|      2|            *hands = curr->next;
  354|      0|        else
  355|      0|            prev->next = curr->next;
  356|       |
  357|      2|        tmp = curr;
  358|      2|        curr = curr->next;
  359|       |
  360|      2|        OPENSSL_free(tmp);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  361|      2|    }
  362|      2|#ifndef FIPS_MODULE
  363|      2|    CRYPTO_THREAD_unlock(gtr->lock);
  364|      2|#endif
  365|      2|}
initthread.c:init_thread_deregister:
  425|      2|{
  426|      2|    GLOBAL_TEVENT_REGISTER *gtr;
  427|      2|    int i;
  428|       |
  429|      2|    gtr = get_global_tevent_register();
  430|      2|    if (gtr == NULL)
  ------------------
  |  Branch (430:9): [True: 0, False: 2]
  ------------------
  431|      0|        return 0;
  432|      2|    if (!all) {
  ------------------
  |  Branch (432:9): [True: 0, False: 2]
  ------------------
  433|      0|        if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (433:13): [True: 0, False: 0]
  ------------------
  434|      0|            return 0;
  435|      2|    } else {
  436|      2|        glob_tevent_reg = NULL;
  437|      2|    }
  438|      2|    for (i = 0; i < sk_THREAD_EVENT_HANDLER_PTR_num(gtr->skhands); i++) {
  ------------------
  |  Branch (438:17): [True: 0, False: 2]
  ------------------
  439|      0|        THREAD_EVENT_HANDLER **hands
  440|      0|            = sk_THREAD_EVENT_HANDLER_PTR_value(gtr->skhands, i);
  441|      0|        THREAD_EVENT_HANDLER *curr = NULL, *prev = NULL, *tmp;
  442|       |
  443|      0|        if (hands == NULL) {
  ------------------
  |  Branch (443:13): [True: 0, False: 0]
  ------------------
  444|      0|            if (!all)
  ------------------
  |  Branch (444:17): [True: 0, False: 0]
  ------------------
  445|      0|                CRYPTO_THREAD_unlock(gtr->lock);
  446|      0|            return 0;
  447|      0|        }
  448|      0|        curr = *hands;
  449|      0|        while (curr != NULL) {
  ------------------
  |  Branch (449:16): [True: 0, False: 0]
  ------------------
  450|      0|            if (all || curr->index == index) {
  ------------------
  |  Branch (450:17): [True: 0, False: 0]
  |  Branch (450:24): [True: 0, False: 0]
  ------------------
  451|      0|                if (prev != NULL)
  ------------------
  |  Branch (451:21): [True: 0, False: 0]
  ------------------
  452|      0|                    prev->next = curr->next;
  453|      0|                else
  454|      0|                    *hands = curr->next;
  455|      0|                tmp = curr;
  456|      0|                curr = curr->next;
  457|      0|                OPENSSL_free(tmp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  458|      0|                continue;
  459|      0|            }
  460|      0|            prev = curr;
  461|      0|            curr = curr->next;
  462|      0|        }
  463|      0|        if (all)
  ------------------
  |  Branch (463:13): [True: 0, False: 0]
  ------------------
  464|      0|            OPENSSL_free(hands);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  465|      0|    }
  466|      2|    if (all) {
  ------------------
  |  Branch (466:9): [True: 2, False: 0]
  ------------------
  467|      2|        CRYPTO_THREAD_lock_free(gtr->lock);
  468|      2|        sk_THREAD_EVENT_HANDLER_PTR_free(gtr->skhands);
  469|      2|        OPENSSL_free(gtr);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  470|      2|    } else {
  471|      0|        CRYPTO_THREAD_unlock(gtr->lock);
  472|      0|    }
  473|      2|    return 1;
  474|      2|}

OPENSSL_LH_set_thunks:
   52|     10|{
   53|       |
   54|     10|    if (lh == NULL)
  ------------------
  |  Branch (54:9): [True: 0, False: 10]
  ------------------
   55|      0|        return NULL;
   56|     10|    lh->compw = cw;
   57|     10|    lh->hashw = hw;
   58|     10|    lh->daw = daw;
   59|     10|    lh->daaw = daaw;
   60|     10|    return lh;
   61|     10|}
OPENSSL_LH_new:
   64|     10|{
   65|     10|    OPENSSL_LHASH *ret;
   66|       |
   67|     10|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  104|     10|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (67:9): [True: 0, False: 10]
  ------------------
   68|      0|        return NULL;
   69|     10|    if ((ret->b = OPENSSL_zalloc(sizeof(*ret->b) * MIN_NODES)) == NULL)
  ------------------
  |  |  104|     10|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (69:9): [True: 0, False: 10]
  ------------------
   70|      0|        goto err;
   71|     10|    ret->comp = ((c == NULL) ? (OPENSSL_LH_COMPFUNC)strcmp : c);
  ------------------
  |  Branch (71:18): [True: 0, False: 10]
  ------------------
   72|     10|    ret->hash = ((h == NULL) ? (OPENSSL_LH_HASHFUNC)OPENSSL_LH_strhash : h);
  ------------------
  |  Branch (72:18): [True: 0, False: 10]
  ------------------
   73|     10|    ret->num_nodes = MIN_NODES / 2;
  ------------------
  |  |   39|     10|#define MIN_NODES       16
  ------------------
   74|     10|    ret->num_alloc_nodes = MIN_NODES;
  ------------------
  |  |   39|     10|#define MIN_NODES       16
  ------------------
   75|     10|    ret->pmax = MIN_NODES / 2;
  ------------------
  |  |   39|     10|#define MIN_NODES       16
  ------------------
   76|     10|    ret->up_load = UP_LOAD;
  ------------------
  |  |   40|     10|#define UP_LOAD         (2*LH_LOAD_MULT) /* load times 256 (default 2) */
  |  |  ------------------
  |  |  |  |   85|     10|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   77|     10|    ret->down_load = DOWN_LOAD;
  ------------------
  |  |   41|     10|#define DOWN_LOAD       (LH_LOAD_MULT) /* load times 256 (default 1) */
  |  |  ------------------
  |  |  |  |   85|     10|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   78|     10|    return ret;
   79|       |
   80|      0|err:
   81|      0|    OPENSSL_free(ret->b);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   82|      0|    OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   83|      0|    return NULL;
   84|     10|}
OPENSSL_LH_free:
   87|     12|{
   88|     12|    if (lh == NULL)
  ------------------
  |  Branch (88:9): [True: 2, False: 10]
  ------------------
   89|      2|        return;
   90|       |
   91|     10|    OPENSSL_LH_flush(lh);
   92|     10|    OPENSSL_free(lh->b);
  ------------------
  |  |  115|     10|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|     10|    OPENSSL_free(lh);
  ------------------
  |  |  115|     10|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|     10|}
OPENSSL_LH_flush:
   97|     10|{
   98|     10|    unsigned int i;
   99|     10|    OPENSSL_LH_NODE *n, *nn;
  100|       |
  101|     10|    if (lh == NULL)
  ------------------
  |  Branch (101:9): [True: 0, False: 10]
  ------------------
  102|      0|        return;
  103|       |
  104|  1.59k|    for (i = 0; i < lh->num_nodes; i++) {
  ------------------
  |  Branch (104:17): [True: 1.58k, False: 10]
  ------------------
  105|  1.58k|        n = lh->b[i];
  106|  4.64k|        while (n != NULL) {
  ------------------
  |  Branch (106:16): [True: 3.06k, False: 1.58k]
  ------------------
  107|  3.06k|            nn = n->next;
  108|  3.06k|            OPENSSL_free(n);
  ------------------
  |  |  115|  3.06k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.06k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.06k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  109|  3.06k|            n = nn;
  110|  3.06k|        }
  111|  1.58k|        lh->b[i] = NULL;
  112|  1.58k|    }
  113|       |
  114|     10|    lh->num_items = 0;
  115|     10|}
OPENSSL_LH_insert:
  118|  8.63k|{
  119|  8.63k|    unsigned long hash;
  120|  8.63k|    OPENSSL_LH_NODE *nn, **rn;
  121|  8.63k|    void *ret;
  122|       |
  123|  8.63k|    lh->error = 0;
  124|  8.63k|    if ((lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) && !expand(lh))
  ------------------
  |  |   85|  8.63k|# define LH_LOAD_MULT    256
  ------------------
  |  Branch (124:9): [True: 1.50k, False: 7.13k]
  |  Branch (124:76): [True: 0, False: 1.50k]
  ------------------
  125|      0|        return NULL;        /* 'lh->error++' already done in 'expand' */
  126|       |
  127|  8.63k|    rn = getrn(lh, data, &hash);
  128|       |
  129|  8.63k|    if (*rn == NULL) {
  ------------------
  |  Branch (129:9): [True: 3.06k, False: 5.57k]
  ------------------
  130|  3.06k|        if ((nn = OPENSSL_malloc(sizeof(*nn))) == NULL) {
  ------------------
  |  |  102|  3.06k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.06k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.06k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (130:13): [True: 0, False: 3.06k]
  ------------------
  131|      0|            lh->error++;
  132|      0|            return NULL;
  133|      0|        }
  134|  3.06k|        nn->data = data;
  135|  3.06k|        nn->next = NULL;
  136|  3.06k|        nn->hash = hash;
  137|  3.06k|        *rn = nn;
  138|  3.06k|        ret = NULL;
  139|  3.06k|        lh->num_items++;
  140|  5.57k|    } else {                    /* replace same key */
  141|  5.57k|        ret = (*rn)->data;
  142|  5.57k|        (*rn)->data = data;
  143|  5.57k|    }
  144|  8.63k|    return ret;
  145|  8.63k|}
OPENSSL_LH_retrieve:
  174|    168|{
  175|    168|    unsigned long hash;
  176|    168|    OPENSSL_LH_NODE **rn;
  177|       |
  178|    168|    if (lh->error != 0)
  ------------------
  |  Branch (178:9): [True: 0, False: 168]
  ------------------
  179|      0|        lh->error = 0;
  180|       |
  181|    168|    rn = getrn(lh, data, &hash);
  182|       |
  183|    168|    return *rn == NULL ? NULL : (*rn)->data;
  ------------------
  |  Branch (183:12): [True: 168, False: 0]
  ------------------
  184|    168|}
OPENSSL_LH_doall:
  217|      8|{
  218|      8|    if (lh == NULL)
  ------------------
  |  Branch (218:9): [True: 0, False: 8]
  ------------------
  219|      0|        return;
  220|       |
  221|      8|    doall_util_fn(lh, 0, lh->daw, func, (OPENSSL_LH_DOALL_FUNCARG)NULL,
  222|      8|                  (OPENSSL_LH_DOALL_FUNCARG_THUNK)NULL, NULL);
  223|      8|}
OPENSSL_LH_strhash:
  362|     48|{
  363|     48|    unsigned long ret = 0;
  364|     48|    long n;
  365|     48|    unsigned long v;
  366|     48|    int r;
  367|       |
  368|     48|    if ((c == NULL) || (*c == '\0'))
  ------------------
  |  Branch (368:9): [True: 0, False: 48]
  |  Branch (368:24): [True: 0, False: 48]
  ------------------
  369|      0|        return ret;
  370|       |
  371|     48|    n = 0x100;
  372|    312|    while (*c) {
  ------------------
  |  Branch (372:12): [True: 264, False: 48]
  ------------------
  373|    264|        v = n | (*c);
  374|    264|        n += 0x100;
  375|    264|        r = (int)((v >> 2) ^ v) & 0x0f;
  376|       |        /* cast to uint64_t to avoid 32 bit shift of 32 bit value */
  377|    264|        ret = (ret << r) | (unsigned long)((uint64_t)ret >> (32 - r));
  378|    264|        ret &= 0xFFFFFFFFL;
  379|    264|        ret ^= v * v;
  380|    264|        c++;
  381|    264|    }
  382|     48|    return (ret >> 16) ^ ret;
  383|     48|}
OPENSSL_LH_error:
  442|     16|{
  443|     16|    return lh->error;
  444|     16|}
lhash.c:doall_util_fn:
  192|      8|{
  193|      8|    int i;
  194|      8|    OPENSSL_LH_NODE *a, *n;
  195|       |
  196|      8|    if (lh == NULL)
  ------------------
  |  Branch (196:9): [True: 0, False: 8]
  ------------------
  197|      0|        return;
  198|       |
  199|       |    /*
  200|       |     * reverse the order so we search from 'top to bottom' We were having
  201|       |     * memory leaks otherwise
  202|       |     */
  203|     72|    for (i = lh->num_nodes - 1; i >= 0; i--) {
  ------------------
  |  Branch (203:33): [True: 64, False: 8]
  ------------------
  204|     64|        a = lh->b[i];
  205|     80|        while (a != NULL) {
  ------------------
  |  Branch (205:16): [True: 16, False: 64]
  ------------------
  206|     16|            n = a->next;
  207|     16|            if (use_arg)
  ------------------
  |  Branch (207:17): [True: 0, False: 16]
  ------------------
  208|      0|                wfunc_arg(a->data, arg, func_arg);
  209|     16|            else
  210|     16|                wfunc(a->data, func);
  211|     16|            a = n;
  212|     16|        }
  213|     64|    }
  214|      8|}
lhash.c:expand:
  244|  1.50k|{
  245|  1.50k|    OPENSSL_LH_NODE **n, **n1, **n2, *np;
  246|  1.50k|    unsigned int p, pmax, nni, j;
  247|  1.50k|    unsigned long hash;
  248|       |
  249|  1.50k|    nni = lh->num_alloc_nodes;
  250|  1.50k|    p = lh->p;
  251|  1.50k|    pmax = lh->pmax;
  252|  1.50k|    if (p + 1 >= pmax) {
  ------------------
  |  Branch (252:9): [True: 12, False: 1.49k]
  ------------------
  253|     12|        j = nni * 2;
  254|     12|        n = OPENSSL_realloc(lh->b, sizeof(OPENSSL_LH_NODE *) * j);
  ------------------
  |  |  109|     12|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     12|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     12|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  255|     12|        if (n == NULL) {
  ------------------
  |  Branch (255:13): [True: 0, False: 12]
  ------------------
  256|      0|            lh->error++;
  257|      0|            return 0;
  258|      0|        }
  259|     12|        lh->b = n;
  260|     12|        memset(n + nni, 0, sizeof(*n) * (j - nni));
  261|     12|        lh->pmax = nni;
  262|     12|        lh->num_alloc_nodes = j;
  263|     12|        lh->p = 0;
  264|  1.49k|    } else {
  265|  1.49k|        lh->p++;
  266|  1.49k|    }
  267|       |
  268|  1.50k|    lh->num_nodes++;
  269|  1.50k|    n1 = &(lh->b[p]);
  270|  1.50k|    n2 = &(lh->b[p + pmax]);
  271|  1.50k|    *n2 = NULL;
  272|       |
  273|  6.97k|    for (np = *n1; np != NULL;) {
  ------------------
  |  Branch (273:20): [True: 5.47k, False: 1.50k]
  ------------------
  274|  5.47k|        hash = np->hash;
  275|  5.47k|        if ((hash % nni) != p) { /* move it */
  ------------------
  |  Branch (275:13): [True: 786, False: 4.68k]
  ------------------
  276|    786|            *n1 = (*n1)->next;
  277|    786|            np->next = *n2;
  278|    786|            *n2 = np;
  279|    786|        } else
  280|  4.68k|            n1 = &((*n1)->next);
  281|  5.47k|        np = *n1;
  282|  5.47k|    }
  283|       |
  284|  1.50k|    return 1;
  285|  1.50k|}
lhash.c:getrn:
  322|  8.80k|{
  323|  8.80k|    OPENSSL_LH_NODE **ret, *n1;
  324|  8.80k|    unsigned long hash, nn;
  325|       |
  326|  8.80k|    if (lh->hashw != NULL)
  ------------------
  |  Branch (326:9): [True: 8.80k, False: 0]
  ------------------
  327|  8.80k|        hash = lh->hashw(data, lh->hash);
  328|      0|    else
  329|      0|        hash = lh->hash(data);
  330|       |
  331|  8.80k|    *rhash = hash;
  332|       |
  333|  8.80k|    nn = hash % lh->pmax;
  334|  8.80k|    if (nn < lh->p)
  ------------------
  |  Branch (334:9): [True: 4.07k, False: 4.72k]
  ------------------
  335|  4.07k|        nn = hash % lh->num_alloc_nodes;
  336|       |
  337|  8.80k|    ret = &(lh->b[(int)nn]);
  338|  22.5k|    for (n1 = *ret; n1 != NULL; n1 = n1->next) {
  ------------------
  |  Branch (338:21): [True: 19.3k, False: 3.22k]
  ------------------
  339|  19.3k|        if (n1->hash != hash) {
  ------------------
  |  Branch (339:13): [True: 13.4k, False: 5.89k]
  ------------------
  340|  13.4k|            ret = &(n1->next);
  341|  13.4k|            continue;
  342|  13.4k|        }
  343|       |
  344|  5.89k|        if (lh->compw != NULL) {
  ------------------
  |  Branch (344:13): [True: 5.89k, False: 0]
  ------------------
  345|  5.89k|            if (lh->compw(n1->data, data, lh->comp) == 0)
  ------------------
  |  Branch (345:17): [True: 5.57k, False: 316]
  ------------------
  346|  5.57k|                break;
  347|  5.89k|        } else {
  348|      0|            if (lh->comp(n1->data, data) == 0)
  ------------------
  |  Branch (348:17): [True: 0, False: 0]
  ------------------
  349|      0|                break;
  350|      0|        }
  351|    316|        ret = &(n1->next);
  352|    316|    }
  353|  8.80k|    return ret;
  354|  8.80k|}

CRYPTO_malloc:
  187|  28.9k|{
  188|  28.9k|    void *ptr;
  189|       |
  190|  28.9k|    INCREMENT(malloc_count);
  191|  28.9k|    if (malloc_impl != CRYPTO_malloc) {
  ------------------
  |  Branch (191:9): [True: 0, False: 28.9k]
  ------------------
  192|      0|        ptr = malloc_impl(num, file, line);
  193|      0|        if (ptr != NULL || num == 0)
  ------------------
  |  Branch (193:13): [True: 0, False: 0]
  |  Branch (193:28): [True: 0, False: 0]
  ------------------
  194|      0|            return ptr;
  195|      0|        goto err;
  196|      0|    }
  197|       |
  198|  28.9k|    if (num == 0)
  ------------------
  |  Branch (198:9): [True: 10, False: 28.9k]
  ------------------
  199|     10|        return NULL;
  200|       |
  201|  28.9k|    FAILTEST();
  202|  28.9k|    if (allow_customize) {
  ------------------
  |  Branch (202:9): [True: 2, False: 28.9k]
  ------------------
  203|       |        /*
  204|       |         * Disallow customization after the first allocation. We only set this
  205|       |         * if necessary to avoid a store to the same cache line on every
  206|       |         * allocation.
  207|       |         */
  208|      2|        allow_customize = 0;
  209|      2|    }
  210|       |
  211|  28.9k|    ptr = malloc(num);
  212|  28.9k|    if (ptr != NULL)
  ------------------
  |  Branch (212:9): [True: 28.9k, False: 0]
  ------------------
  213|  28.9k|        return ptr;
  214|      0| err:
  215|       |    /*
  216|       |     * ossl_err_get_state_int() in err.c uses CRYPTO_zalloc(num, NULL, 0) for
  217|       |     * ERR_STATE allocation. Prevent mem alloc error loop while reporting error.
  218|       |     */
  219|      0|    if (file != NULL || line != 0) {
  ------------------
  |  Branch (219:9): [True: 0, False: 0]
  |  Branch (219:25): [True: 0, False: 0]
  ------------------
  220|      0|        ERR_new();
  221|      0|        ERR_set_debug(file, line, NULL);
  222|      0|        ERR_set_error(ERR_LIB_CRYPTO, ERR_R_MALLOC_FAILURE, NULL);
  ------------------
  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  ------------------
                      ERR_set_error(ERR_LIB_CRYPTO, ERR_R_MALLOC_FAILURE, NULL);
  ------------------
  |  |  351|      0|# define ERR_R_MALLOC_FAILURE                    (256|ERR_R_FATAL)
  |  |  ------------------
  |  |  |  |  350|      0|# define ERR_R_FATAL                             (ERR_RFLAG_FATAL|ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  236|      0|# define ERR_RFLAG_FATAL                (0x1 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define ERR_R_FATAL                             (ERR_RFLAG_FATAL|ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  223|      0|    }
  224|      0|    return NULL;
  225|  28.9k|}
CRYPTO_zalloc:
  228|  14.9k|{
  229|  14.9k|    void *ret;
  230|       |
  231|  14.9k|    ret = CRYPTO_malloc(num, file, line);
  232|  14.9k|    if (ret != NULL)
  ------------------
  |  Branch (232:9): [True: 14.9k, False: 0]
  ------------------
  233|  14.9k|        memset(ret, 0, num);
  234|       |
  235|  14.9k|    return ret;
  236|  14.9k|}
CRYPTO_aligned_alloc:
  240|      4|{
  241|      4|    void *ret;
  242|       |
  243|      4|    *freeptr = NULL;
  244|       |
  245|       |#if defined(OPENSSL_SMALL_FOOTPRINT)
  246|       |    ret = freeptr = NULL;
  247|       |    return ret;
  248|       |#endif
  249|       |
  250|       |    /* Allow non-malloc() allocations as long as no malloc_impl is provided. */
  251|      4|    if (malloc_impl == CRYPTO_malloc) {
  ------------------
  |  Branch (251:9): [True: 4, False: 0]
  ------------------
  252|      4|#if defined(_BSD_SOURCE) || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L)
  253|      4|        if (posix_memalign(&ret, alignment, num))
  ------------------
  |  Branch (253:13): [True: 0, False: 4]
  ------------------
  254|      0|            return NULL;
  255|      4|        *freeptr = ret;
  256|      4|        return ret;
  257|       |#elif defined(_ISOC11_SOURCE)
  258|       |        ret = *freeptr = aligned_alloc(alignment, num);
  259|       |        return ret;
  260|       |#endif
  261|      4|    }
  262|       |
  263|       |    /* we have to do this the hard way */
  264|       |
  265|       |    /*
  266|       |     * Note: Windows supports an _aligned_malloc call, but we choose
  267|       |     * not to use it here, because allocations from that function
  268|       |     * require that they be freed via _aligned_free.  Given that
  269|       |     * we can't differentiate plain malloc blocks from blocks obtained
  270|       |     * via _aligned_malloc, just avoid its use entirely
  271|       |     */
  272|       |
  273|       |    /*
  274|       |     * Step 1: Allocate an amount of memory that is <alignment>
  275|       |     * bytes bigger than requested
  276|       |     */
  277|      0|    *freeptr = CRYPTO_malloc(num + alignment, file, line);
  278|      0|    if (*freeptr == NULL)
  ------------------
  |  Branch (278:9): [True: 0, False: 0]
  ------------------
  279|      0|        return NULL;
  280|       |
  281|       |    /*
  282|       |     * Step 2: Add <alignment - 1> bytes to the pointer
  283|       |     * This will cross the alignment boundary that is
  284|       |     * requested
  285|       |     */
  286|      0|    ret = (void *)((char *)*freeptr + (alignment - 1));
  287|       |
  288|       |    /*
  289|       |     * Step 3: Use the alignment as a mask to translate the
  290|       |     * least significant bits of the allocation at the alignment
  291|       |     * boundary to 0.  ret now holds a pointer to the memory
  292|       |     * buffer at the requested alignment
  293|       |     * NOTE: It is a documented requirement that alignment be a
  294|       |     * power of 2, which is what allows this to work
  295|       |     */
  296|      0|    ret = (void *)((uintptr_t)ret & (uintptr_t)(~(alignment - 1)));
  297|      0|    return ret;
  298|      0|}
CRYPTO_realloc:
  301|     14|{
  302|     14|    INCREMENT(realloc_count);
  303|     14|    if (realloc_impl != CRYPTO_realloc)
  ------------------
  |  Branch (303:9): [True: 0, False: 14]
  ------------------
  304|      0|        return realloc_impl(str, num, file, line);
  305|       |
  306|     14|    if (str == NULL)
  ------------------
  |  Branch (306:9): [True: 0, False: 14]
  ------------------
  307|      0|        return CRYPTO_malloc(num, file, line);
  308|       |
  309|     14|    if (num == 0) {
  ------------------
  |  Branch (309:9): [True: 0, False: 14]
  ------------------
  310|      0|        CRYPTO_free(str, file, line);
  311|      0|        return NULL;
  312|      0|    }
  313|       |
  314|     14|    FAILTEST();
  315|     14|    return realloc(str, num);
  316|     14|}
CRYPTO_clear_realloc:
  320|  3.91k|{
  321|  3.91k|    void *ret = NULL;
  322|       |
  323|  3.91k|    if (str == NULL)
  ------------------
  |  Branch (323:9): [True: 1.62k, False: 2.28k]
  ------------------
  324|  1.62k|        return CRYPTO_malloc(num, file, line);
  325|       |
  326|  2.28k|    if (num == 0) {
  ------------------
  |  Branch (326:9): [True: 0, False: 2.28k]
  ------------------
  327|      0|        CRYPTO_clear_free(str, old_len, file, line);
  328|      0|        return NULL;
  329|      0|    }
  330|       |
  331|       |    /* Can't shrink the buffer since memcpy below copies |old_len| bytes. */
  332|  2.28k|    if (num < old_len) {
  ------------------
  |  Branch (332:9): [True: 0, False: 2.28k]
  ------------------
  333|      0|        OPENSSL_cleanse((char*)str + num, old_len - num);
  334|      0|        return str;
  335|      0|    }
  336|       |
  337|  2.28k|    ret = CRYPTO_malloc(num, file, line);
  338|  2.28k|    if (ret != NULL) {
  ------------------
  |  Branch (338:9): [True: 2.28k, False: 0]
  ------------------
  339|  2.28k|        memcpy(ret, str, old_len);
  340|  2.28k|        CRYPTO_clear_free(str, old_len, file, line);
  341|  2.28k|    }
  342|  2.28k|    return ret;
  343|  2.28k|}
CRYPTO_free:
  346|  80.3k|{
  347|  80.3k|    INCREMENT(free_count);
  348|  80.3k|    if (free_impl != CRYPTO_free) {
  ------------------
  |  Branch (348:9): [True: 0, False: 80.3k]
  ------------------
  349|      0|        free_impl(str, file, line);
  350|      0|        return;
  351|      0|    }
  352|       |
  353|  80.3k|    free(str);
  354|  80.3k|}
CRYPTO_clear_free:
  357|  3.91k|{
  358|  3.91k|    if (str == NULL)
  ------------------
  |  Branch (358:9): [True: 0, False: 3.91k]
  ------------------
  359|      0|        return;
  360|  3.91k|    if (num)
  ------------------
  |  Branch (360:9): [True: 3.91k, False: 0]
  ------------------
  361|  3.91k|        OPENSSL_cleanse(str, num);
  362|  3.91k|    CRYPTO_free(str, file, line);
  363|  3.91k|}

CRYPTO_secure_malloc_done:
  132|      2|{
  133|      2|#ifndef OPENSSL_NO_SECURE_MEMORY
  134|      2|    if (secure_mem_used == 0) {
  ------------------
  |  Branch (134:9): [True: 2, False: 0]
  ------------------
  135|      2|        sh_done();
  136|      2|        secure_mem_initialized = 0;
  137|      2|        CRYPTO_THREAD_lock_free(sec_malloc_lock);
  138|      2|        sec_malloc_lock = NULL;
  139|      2|        return 1;
  140|      2|    }
  141|      0|#endif /* OPENSSL_NO_SECURE_MEMORY */
  142|      0|    return 0;
  143|      2|}
CRYPTO_secure_malloc:
  155|  3.08k|{
  156|  3.08k|#ifndef OPENSSL_NO_SECURE_MEMORY
  157|  3.08k|    void *ret = NULL;
  158|  3.08k|    size_t actual_size;
  159|  3.08k|    int reason = CRYPTO_R_SECURE_MALLOC_FAILURE;
  ------------------
  |  |   47|  3.08k|# define CRYPTO_R_SECURE_MALLOC_FAILURE                   111
  ------------------
  160|       |
  161|  3.08k|    if (!secure_mem_initialized) {
  ------------------
  |  Branch (161:9): [True: 3.08k, False: 0]
  ------------------
  162|  3.08k|        return CRYPTO_malloc(num, file, line);
  163|  3.08k|    }
  164|      0|    if (!CRYPTO_THREAD_write_lock(sec_malloc_lock)) {
  ------------------
  |  Branch (164:9): [True: 0, False: 0]
  ------------------
  165|      0|        reason = ERR_R_CRYPTO_LIB;
  ------------------
  |  |  327|      0|# define ERR_R_CRYPTO_LIB       (ERR_LIB_CRYPTO/* 15 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  |  |  ------------------
  |  |               # define ERR_R_CRYPTO_LIB       (ERR_LIB_CRYPTO/* 15 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  166|      0|        goto err;
  167|      0|    }
  168|      0|    ret = sh_malloc(num);
  169|      0|    actual_size = ret ? sh_actual_size(ret) : 0;
  ------------------
  |  Branch (169:19): [True: 0, False: 0]
  ------------------
  170|      0|    secure_mem_used += actual_size;
  171|      0|    CRYPTO_THREAD_unlock(sec_malloc_lock);
  172|      0| err:
  173|      0|    if (ret == NULL && (file != NULL || line != 0)) {
  ------------------
  |  Branch (173:9): [True: 0, False: 0]
  |  Branch (173:25): [True: 0, False: 0]
  |  Branch (173:41): [True: 0, False: 0]
  ------------------
  174|      0|        ERR_new();
  175|      0|        ERR_set_debug(file, line, NULL);
  176|      0|        ERR_set_error(ERR_LIB_CRYPTO, reason, NULL);
  ------------------
  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  ------------------
  177|      0|    }
  178|      0|    return ret;
  179|       |#else
  180|       |    return CRYPTO_malloc(num, file, line);
  181|       |#endif /* OPENSSL_NO_SECURE_MEMORY */
  182|      0|}
CRYPTO_secure_free:
  195|  1.56k|{
  196|  1.56k|#ifndef OPENSSL_NO_SECURE_MEMORY
  197|  1.56k|    size_t actual_size;
  198|       |
  199|  1.56k|    if (ptr == NULL)
  ------------------
  |  Branch (199:9): [True: 1.32k, False: 237]
  ------------------
  200|  1.32k|        return;
  201|    237|    if (!CRYPTO_secure_allocated(ptr)) {
  ------------------
  |  Branch (201:9): [True: 237, False: 0]
  ------------------
  202|    237|        CRYPTO_free(ptr, file, line);
  203|    237|        return;
  204|    237|    }
  205|      0|    if (!CRYPTO_THREAD_write_lock(sec_malloc_lock))
  ------------------
  |  Branch (205:9): [True: 0, False: 0]
  ------------------
  206|      0|        return;
  207|      0|    actual_size = sh_actual_size(ptr);
  208|      0|    CLEAR(ptr, actual_size);
  ------------------
  |  |   82|      0|#define CLEAR(p, s) OPENSSL_cleanse(p, s)
  ------------------
  209|      0|    secure_mem_used -= actual_size;
  210|      0|    sh_free(ptr);
  211|      0|    CRYPTO_THREAD_unlock(sec_malloc_lock);
  212|       |#else
  213|       |    CRYPTO_free(ptr, file, line);
  214|       |#endif /* OPENSSL_NO_SECURE_MEMORY */
  215|      0|}
CRYPTO_secure_clear_free:
  219|  3.06k|{
  220|  3.06k|#ifndef OPENSSL_NO_SECURE_MEMORY
  221|  3.06k|    size_t actual_size;
  222|       |
  223|  3.06k|    if (ptr == NULL)
  ------------------
  |  Branch (223:9): [True: 227, False: 2.84k]
  ------------------
  224|    227|        return;
  225|  2.84k|    if (!CRYPTO_secure_allocated(ptr)) {
  ------------------
  |  Branch (225:9): [True: 2.84k, False: 0]
  ------------------
  226|  2.84k|        OPENSSL_cleanse(ptr, num);
  227|  2.84k|        CRYPTO_free(ptr, file, line);
  228|  2.84k|        return;
  229|  2.84k|    }
  230|      0|    if (!CRYPTO_THREAD_write_lock(sec_malloc_lock))
  ------------------
  |  Branch (230:9): [True: 0, False: 0]
  ------------------
  231|      0|        return;
  232|      0|    actual_size = sh_actual_size(ptr);
  233|      0|    CLEAR(ptr, actual_size);
  ------------------
  |  |   82|      0|#define CLEAR(p, s) OPENSSL_cleanse(p, s)
  ------------------
  234|      0|    secure_mem_used -= actual_size;
  235|      0|    sh_free(ptr);
  236|      0|    CRYPTO_THREAD_unlock(sec_malloc_lock);
  237|       |#else
  238|       |    if (ptr == NULL)
  239|       |        return;
  240|       |    OPENSSL_cleanse(ptr, num);
  241|       |    CRYPTO_free(ptr, file, line);
  242|       |#endif /* OPENSSL_NO_SECURE_MEMORY */
  243|      0|}
CRYPTO_secure_allocated:
  246|  3.07k|{
  247|  3.07k|#ifndef OPENSSL_NO_SECURE_MEMORY
  248|  3.07k|    if (!secure_mem_initialized)
  ------------------
  |  Branch (248:9): [True: 3.07k, False: 0]
  ------------------
  249|  3.07k|        return 0;
  250|       |    /*
  251|       |     * Only read accesses to the arena take place in sh_allocated() and this
  252|       |     * is only changed by the sh_init() and sh_done() calls which are not
  253|       |     * locked.  Hence, it is safe to make this check without a lock too.
  254|       |     */
  255|      0|    return sh_allocated(ptr);
  256|       |#else
  257|       |    return 0;
  258|       |#endif /* OPENSSL_NO_SECURE_MEMORY */
  259|  3.07k|}
mem_sec.c:sh_done:
  599|      2|{
  600|      2|    OPENSSL_free(sh.freelist);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  601|      2|    OPENSSL_free(sh.bittable);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  602|      2|    OPENSSL_free(sh.bitmalloc);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  603|      2|#if !defined(_WIN32)
  604|      2|    if (sh.map_result != MAP_FAILED && sh.map_size)
  ------------------
  |  Branch (604:9): [True: 2, False: 0]
  |  Branch (604:40): [True: 0, False: 2]
  ------------------
  605|      0|        munmap(sh.map_result, sh.map_size);
  606|       |#else
  607|       |    if (sh.map_result != NULL && sh.map_size)
  608|       |        VirtualFree(sh.map_result, 0, MEM_RELEASE);
  609|       |#endif
  610|      2|    memset(&sh, 0, sizeof(sh));
  611|      2|}

CRYPTO_strdup:
   23|      2|{
   24|      2|    char *ret;
   25|       |
   26|      2|    if (str == NULL)
  ------------------
  |  Branch (26:9): [True: 0, False: 2]
  ------------------
   27|      0|        return NULL;
   28|      2|    ret = CRYPTO_malloc(strlen(str) + 1, file, line);
   29|      2|    if (ret != NULL)
  ------------------
  |  Branch (29:9): [True: 2, False: 0]
  ------------------
   30|      2|        strcpy(ret, str);
   31|      2|    return ret;
   32|      2|}

OBJ_NAME_cleanup:
  368|      8|{
  369|      8|    unsigned long down_load;
  370|       |
  371|      8|    if (names_lh == NULL)
  ------------------
  |  Branch (371:9): [True: 8, False: 0]
  ------------------
  372|      8|        return;
  373|       |
  374|      0|    free_type = type;
  375|      0|    down_load = lh_OBJ_NAME_get_down_load(names_lh);
  376|      0|    lh_OBJ_NAME_set_down_load(names_lh, 0);
  377|       |
  378|      0|    lh_OBJ_NAME_doall(names_lh, names_lh_free_doall);
  379|      0|    if (type < 0) {
  ------------------
  |  Branch (379:9): [True: 0, False: 0]
  ------------------
  380|      0|        lh_OBJ_NAME_free(names_lh);
  381|      0|        sk_NAME_FUNCS_pop_free(name_funcs_stack, name_funcs_free);
  382|      0|        CRYPTO_THREAD_lock_free(obj_lock);
  383|      0|        names_lh = NULL;
  384|      0|        name_funcs_stack = NULL;
  385|      0|        obj_lock = NULL;
  386|      0|    } else
  387|      0|        lh_OBJ_NAME_set_down_load(names_lh, down_load);
  388|      0|}

ossl_obj_cleanup_int:
  212|      2|{
  213|      2|    if (added != NULL) {
  ------------------
  |  Branch (213:9): [True: 0, False: 2]
  ------------------
  214|      0|        lh_ADDED_OBJ_set_down_load(added, 0);
  215|      0|        lh_ADDED_OBJ_doall(added, cleanup1_doall); /* zero counters */
  216|      0|        lh_ADDED_OBJ_doall(added, cleanup2_doall); /* set counters */
  217|      0|        lh_ADDED_OBJ_doall(added, cleanup3_doall); /* free objects */
  218|      0|        lh_ADDED_OBJ_free(added);
  219|      0|        added = NULL;
  220|      0|    }
  221|      2|    objs_free_locks();
  222|      2|}
obj_dat.c:objs_free_locks:
   49|      2|{
   50|      2|    CRYPTO_THREAD_lock_free(ossl_obj_lock);
   51|      2|    ossl_obj_lock = NULL;
   52|       |#ifdef TSAN_REQUIRES_LOCKING
   53|       |    CRYPTO_THREAD_lock_free(ossl_obj_nid_lock);
   54|       |    ossl_obj_nid_lock = NULL;
   55|       |#endif
   56|      2|}

ossl_err_load_OBJ_strings:
   28|      2|{
   29|      2|#ifndef OPENSSL_NO_ERR
   30|      2|    if (ERR_reason_error_string(OBJ_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (30:9): [True: 2, False: 0]
  ------------------
   31|      2|        ERR_load_strings_const(OBJ_str_reasons);
   32|      2|#endif
   33|      2|    return 1;
   34|      2|}

OBJ_sigid_free:
  215|      2|{
  216|      2|    sk_nid_triple_pop_free(sig_app, sid_free);
  217|      2|    sk_nid_triple_free(sigx_app);
  218|      2|    CRYPTO_THREAD_lock_free(sig_lock);
  219|      2|    sig_app = NULL;
  220|      2|    sigx_app = NULL;
  221|      2|    sig_lock = NULL;
  222|      2|}

ossl_err_load_OCSP_strings:
   66|      2|{
   67|      2|# ifndef OPENSSL_NO_ERR
   68|      2|    if (ERR_reason_error_string(OCSP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (68:9): [True: 2, False: 0]
  ------------------
   69|      2|        ERR_load_strings_const(OCSP_str_reasons);
   70|      2|# endif
   71|      2|    return 1;
   72|      2|}

ossl_err_load_PEM_strings:
   70|      2|{
   71|      2|#ifndef OPENSSL_NO_ERR
   72|      2|    if (ERR_reason_error_string(PEM_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (72:9): [True: 2, False: 0]
  ------------------
   73|      2|        ERR_load_strings_const(PEM_str_reasons);
   74|      2|#endif
   75|      2|    return 1;
   76|      2|}

PEM_read_bio_ex:
  950|  1.21k|{
  951|  1.21k|    EVP_ENCODE_CTX *ctx = NULL;
  952|  1.21k|    const BIO_METHOD *bmeth;
  953|  1.21k|    BIO *headerB = NULL, *dataB = NULL;
  954|  1.21k|    char *name = NULL;
  955|  1.21k|    int len, taillen, headerlen, ret = 0;
  956|  1.21k|    BUF_MEM *buf_mem;
  957|       |
  958|  1.21k|    *len_out = 0;
  959|  1.21k|    *name_out = *header = NULL;
  960|  1.21k|    *data = NULL;
  961|  1.21k|    if ((flags & PEM_FLAG_EAY_COMPATIBLE) && (flags & PEM_FLAG_ONLY_B64)) {
  ------------------
  |  |  381|  1.21k|#   define PEM_FLAG_EAY_COMPATIBLE     0x2
  ------------------
                  if ((flags & PEM_FLAG_EAY_COMPATIBLE) && (flags & PEM_FLAG_ONLY_B64)) {
  ------------------
  |  |  382|    349|#   define PEM_FLAG_ONLY_B64           0x4
  ------------------
  |  Branch (961:9): [True: 349, False: 865]
  |  Branch (961:46): [True: 3, False: 346]
  ------------------
  962|       |        /* These two are mutually incompatible; bail out. */
  963|      3|        ERR_raise(ERR_LIB_PEM, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      3|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      3|    (ERR_new(),                                                 \
  |  |  |  |  404|      3|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      3|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      3|     ERR_set_error)
  |  |  ------------------
  ------------------
  964|      3|        goto end;
  965|      3|    }
  966|  1.21k|    bmeth = (flags & PEM_FLAG_SECURE) ? BIO_s_secmem() : BIO_s_mem();
  ------------------
  |  |  380|  1.21k|#   define PEM_FLAG_SECURE             0x1
  ------------------
  |  Branch (966:13): [True: 520, False: 691]
  ------------------
  967|       |
  968|  1.21k|    headerB = BIO_new(bmeth);
  969|  1.21k|    dataB = BIO_new(bmeth);
  970|  1.21k|    if (headerB == NULL || dataB == NULL) {
  ------------------
  |  Branch (970:9): [True: 0, False: 1.21k]
  |  Branch (970:28): [True: 0, False: 1.21k]
  ------------------
  971|      0|        ERR_raise(ERR_LIB_PEM, ERR_R_BIO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  972|      0|        goto end;
  973|      0|    }
  974|       |
  975|  1.21k|    if (!get_name(bp, &name, flags))
  ------------------
  |  Branch (975:9): [True: 338, False: 873]
  ------------------
  976|    338|        goto end;
  977|    873|    if (!get_header_and_data(bp, &headerB, &dataB, name, flags))
  ------------------
  |  Branch (977:9): [True: 615, False: 258]
  ------------------
  978|    615|        goto end;
  979|       |
  980|    258|    BIO_get_mem_ptr(dataB, &buf_mem);
  ------------------
  |  |  614|    258|# define BIO_get_mem_ptr(b,pp)   BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0, \
  |  |  ------------------
  |  |  |  |  446|    258|# define BIO_C_GET_BUF_MEM_PTR                   115
  |  |  ------------------
  |  |  615|    258|                                          (char *)(pp))
  ------------------
  981|    258|    len = buf_mem->length;
  982|       |
  983|       |    /* There was no data in the PEM file */
  984|    258|    if (len == 0)
  ------------------
  |  Branch (984:9): [True: 7, False: 251]
  ------------------
  985|      7|        goto end;
  986|       |
  987|    251|    ctx = EVP_ENCODE_CTX_new();
  988|    251|    if (ctx == NULL) {
  ------------------
  |  Branch (988:9): [True: 0, False: 251]
  ------------------
  989|      0|        ERR_raise(ERR_LIB_PEM, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  990|      0|        goto end;
  991|      0|    }
  992|       |
  993|    251|    EVP_DecodeInit(ctx);
  994|    251|    if (EVP_DecodeUpdate(ctx, (unsigned char*)buf_mem->data, &len,
  ------------------
  |  Branch (994:9): [True: 32, False: 219]
  ------------------
  995|    251|                         (unsigned char*)buf_mem->data, len) < 0
  996|    251|            || EVP_DecodeFinal(ctx, (unsigned char*)&(buf_mem->data[len]),
  ------------------
  |  Branch (996:16): [True: 45, False: 174]
  ------------------
  997|    219|                               &taillen) < 0) {
  998|     77|        ERR_raise(ERR_LIB_PEM, PEM_R_BAD_BASE64_DECODE);
  ------------------
  |  |  401|     77|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     77|    (ERR_new(),                                                 \
  |  |  |  |  404|     77|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     77|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     77|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     77|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     77|     ERR_set_error)
  |  |  ------------------
  ------------------
  999|     77|        goto end;
 1000|     77|    }
 1001|    174|    len += taillen;
 1002|    174|    buf_mem->length = len;
 1003|       |
 1004|    174|    headerlen = BIO_get_mem_data(headerB, NULL);
  ------------------
  |  |  612|    174|# define BIO_get_mem_data(b,pp)  BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)(pp))
  |  |  ------------------
  |  |  |  |   90|    174|# define BIO_CTRL_INFO           3/* opt - extra tit-bits */
  |  |  ------------------
  ------------------
 1005|    174|    *header = PEM_MALLOC(headerlen + 1, flags);
  ------------------
  |  |  233|    174|    pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    174|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    174|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1006|    174|    *data = PEM_MALLOC(len, flags);
  ------------------
  |  |  233|    174|    pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    174|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    174|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1007|    174|    if (*header == NULL || *data == NULL)
  ------------------
  |  Branch (1007:9): [True: 0, False: 174]
  |  Branch (1007:28): [True: 10, False: 164]
  ------------------
 1008|     10|        goto out_free;
 1009|    164|    if (headerlen != 0 && BIO_read(headerB, *header, headerlen) != headerlen)
  ------------------
  |  Branch (1009:9): [True: 46, False: 118]
  |  Branch (1009:27): [True: 0, False: 46]
  ------------------
 1010|      0|        goto out_free;
 1011|    164|    (*header)[headerlen] = '\0';
 1012|    164|    if (BIO_read(dataB, *data, len) != len)
  ------------------
  |  Branch (1012:9): [True: 0, False: 164]
  ------------------
 1013|      0|        goto out_free;
 1014|    164|    *len_out = len;
 1015|    164|    *name_out = name;
 1016|    164|    name = NULL;
 1017|    164|    ret = 1;
 1018|    164|    goto end;
 1019|       |
 1020|     10|out_free:
 1021|     10|    PEM_FREE(*header, flags, 0);
  ------------------
  |  |  222|     10|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1022|     10|    *header = NULL;
 1023|     10|    PEM_FREE(*data, flags, 0);
  ------------------
  |  |  222|     10|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1024|     10|    *data = NULL;
 1025|  1.21k|end:
 1026|  1.21k|    EVP_ENCODE_CTX_free(ctx);
 1027|  1.21k|    PEM_FREE(name, flags, 0);
  ------------------
  |  |  222|  1.21k|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.21k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.21k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1028|  1.21k|    BIO_free(headerB);
 1029|  1.21k|    BIO_free(dataB);
 1030|  1.21k|    return ret;
 1031|     10|}
pem_lib.c:get_name:
  779|  1.21k|{
  780|  1.21k|    char *linebuf;
  781|  1.21k|    int ret = 0;
  782|  1.21k|    int len;
  783|  1.21k|    int first_call = 1;
  784|       |
  785|       |    /*
  786|       |     * Need to hold trailing NUL (accounted for by BIO_gets() and the newline
  787|       |     * that will be added by sanitize_line() (the extra '1').
  788|       |     */
  789|  1.21k|    linebuf = PEM_MALLOC(LINESIZE + 1, flags);
  ------------------
  |  |  233|  1.21k|    pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.21k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.21k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  790|  1.21k|    if (linebuf == NULL)
  ------------------
  |  Branch (790:9): [True: 0, False: 1.21k]
  ------------------
  791|      0|        return 0;
  792|       |
  793|  80.3k|    do {
  794|  80.3k|        len = BIO_gets(bp, linebuf, LINESIZE);
  ------------------
  |  |  770|  80.3k|#define LINESIZE 255
  ------------------
  795|       |
  796|  80.3k|        if (len <= 0) {
  ------------------
  |  Branch (796:13): [True: 338, False: 80.0k]
  ------------------
  797|    338|            ERR_raise(ERR_LIB_PEM, PEM_R_NO_START_LINE);
  ------------------
  |  |  401|    338|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    338|    (ERR_new(),                                                 \
  |  |  |  |  404|    338|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    338|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    338|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    338|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    338|     ERR_set_error)
  |  |  ------------------
  ------------------
  798|    338|            goto err;
  799|    338|        }
  800|       |
  801|       |        /* Strip trailing garbage and standardize ending. */
  802|  80.0k|        len = sanitize_line(linebuf, len, flags & ~PEM_FLAG_ONLY_B64, first_call);
  ------------------
  |  |  382|  80.0k|#   define PEM_FLAG_ONLY_B64           0x4
  ------------------
  803|  80.0k|        first_call = 0;
  804|       |
  805|       |        /* Allow leading empty or non-matching lines. */
  806|  80.0k|    } while (!HAS_PREFIX(linebuf, BEGINSTR)
  ------------------
  |  |   58|   160k|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  ------------------
  |  Branch (806:14): [True: 78.8k, False: 1.24k]
  ------------------
  807|  80.0k|             || len < TAILLEN
  ------------------
  |  |  777|  81.3k|#define TAILLEN ((int)(sizeof(TAILSTR) - 1))
  |  |  ------------------
  |  |  |  |  774|  1.24k|#define TAILSTR "-----\n"
  |  |  ------------------
  ------------------
  |  Branch (807:17): [True: 0, False: 1.24k]
  ------------------
  808|  80.0k|             || !HAS_PREFIX(linebuf + len - TAILLEN, TAILSTR));
  ------------------
  |  |   58|  1.24k|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  ------------------
  |  Branch (808:17): [True: 376, False: 873]
  ------------------
  809|    873|    linebuf[len - TAILLEN] = '\0';
  ------------------
  |  |  777|    873|#define TAILLEN ((int)(sizeof(TAILSTR) - 1))
  |  |  ------------------
  |  |  |  |  774|    873|#define TAILSTR "-----\n"
  |  |  ------------------
  ------------------
  810|    873|    len = len - BEGINLEN - TAILLEN + 1;
  ------------------
  |  |  775|    873|#define BEGINLEN ((int)(sizeof(BEGINSTR) - 1))
  |  |  ------------------
  |  |  |  |  772|    873|#define BEGINSTR "-----BEGIN "
  |  |  ------------------
  ------------------
                  len = len - BEGINLEN - TAILLEN + 1;
  ------------------
  |  |  777|    873|#define TAILLEN ((int)(sizeof(TAILSTR) - 1))
  |  |  ------------------
  |  |  |  |  774|    873|#define TAILSTR "-----\n"
  |  |  ------------------
  ------------------
  811|    873|    *name = PEM_MALLOC(len, flags);
  ------------------
  |  |  233|    873|    pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    873|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    873|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  812|    873|    if (*name == NULL)
  ------------------
  |  Branch (812:9): [True: 0, False: 873]
  ------------------
  813|      0|        goto err;
  814|    873|    memcpy(*name, linebuf + BEGINLEN, len);
  ------------------
  |  |  775|    873|#define BEGINLEN ((int)(sizeof(BEGINSTR) - 1))
  |  |  ------------------
  |  |  |  |  772|    873|#define BEGINSTR "-----BEGIN "
  |  |  ------------------
  ------------------
  815|    873|    ret = 1;
  816|       |
  817|  1.21k|err:
  818|  1.21k|    PEM_FREE(linebuf, flags, LINESIZE + 1);
  ------------------
  |  |  222|  1.21k|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.21k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.21k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  819|  1.21k|    return ret;
  820|    873|}
pem_lib.c:sanitize_line:
  726|   373k|{
  727|   373k|    int i;
  728|   373k|    if (first_call) {
  ------------------
  |  Branch (728:9): [True: 1.21k, False: 372k]
  ------------------
  729|       |        /* Other BOMs imply unsupported multibyte encoding,
  730|       |         * so don't strip them and let the error raise */
  731|  1.21k|        const unsigned char utf8_bom[3] = {0xEF, 0xBB, 0xBF};
  732|       |
  733|  1.21k|        if (len > 3 && memcmp(linebuf, utf8_bom, 3) == 0) {
  ------------------
  |  Branch (733:13): [True: 1.08k, False: 122]
  |  Branch (733:24): [True: 1, False: 1.08k]
  ------------------
  734|      1|            memmove(linebuf, linebuf + 3, len - 3);
  735|      1|            linebuf[len - 3] = 0;
  736|      1|            len -= 3;
  737|      1|        }
  738|  1.21k|    }
  739|       |
  740|   373k|    if (flags & PEM_FLAG_EAY_COMPATIBLE) {
  ------------------
  |  |  381|   373k|#   define PEM_FLAG_EAY_COMPATIBLE     0x2
  ------------------
  |  Branch (740:9): [True: 52.5k, False: 320k]
  ------------------
  741|       |        /* Strip trailing whitespace */
  742|  1.25M|        while ((len >= 0) && (linebuf[len] <= ' '))
  ------------------
  |  Branch (742:16): [True: 1.24M, False: 8.87k]
  |  Branch (742:30): [True: 1.19M, False: 43.6k]
  ------------------
  743|  1.19M|            len--;
  744|       |        /* Go back to whitespace before applying uniform line ending. */
  745|  52.5k|        len++;
  746|   320k|    } else if (flags & PEM_FLAG_ONLY_B64) {
  ------------------
  |  |  382|   320k|#   define PEM_FLAG_ONLY_B64           0x4
  ------------------
  |  Branch (746:16): [True: 3.05k, False: 317k]
  ------------------
  747|   549k|        for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (747:21): [True: 547k, False: 2.02k]
  ------------------
  748|   547k|            if (!ossl_isbase64(linebuf[i]) || linebuf[i] == '\n'
  ------------------
  |  |   84|  1.09M|# define ossl_isbase64(c)       (ossl_ctype_check((c), CTYPE_MASK_base64))
  |  |  ------------------
  |  |  |  |   37|   547k|# define CTYPE_MASK_base64      0x400
  |  |  ------------------
  ------------------
  |  Branch (748:17): [True: 1.03k, False: 546k]
  |  Branch (748:47): [True: 0, False: 546k]
  ------------------
  749|   547k|                || linebuf[i] == '\r')
  ------------------
  |  Branch (749:20): [True: 0, False: 546k]
  ------------------
  750|  1.03k|                break;
  751|   547k|        }
  752|  3.05k|        len = i;
  753|   317k|    } else {
  754|       |        /* EVP_DecodeBlock strips leading and trailing whitespace, so just strip
  755|       |         * control characters in-place and let everything through. */
  756|  35.3M|        for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (756:21): [True: 35.2M, False: 127k]
  ------------------
  757|  35.2M|            if (linebuf[i] == '\n' || linebuf[i] == '\r')
  ------------------
  |  Branch (757:17): [True: 190k, False: 35.0M]
  |  Branch (757:39): [True: 623, False: 35.0M]
  ------------------
  758|   190k|                break;
  759|  35.0M|            if (ossl_iscntrl(linebuf[i]))
  ------------------
  |  |   78|  35.0M|# define ossl_iscntrl(c)        (ossl_ctype_check((c), CTYPE_MASK_cntrl))
  |  |  ------------------
  |  |  |  |   33|  35.0M|# define CTYPE_MASK_cntrl       0x40
  |  |  ------------------
  |  |  |  Branch (78:33): [True: 21.3M, False: 13.6M]
  |  |  ------------------
  ------------------
  760|  21.3M|                linebuf[i] = ' ';
  761|  35.0M|        }
  762|   317k|        len = i;
  763|   317k|    }
  764|       |    /* The caller allocated LINESIZE+1, so this is safe. */
  765|   373k|    linebuf[len++] = '\n';
  766|   373k|    linebuf[len] = '\0';
  767|   373k|    return len;
  768|   373k|}
pem_lib.c:get_header_and_data:
  842|    873|{
  843|    873|    BIO *tmp = *header;
  844|    873|    char *linebuf, *p;
  845|    873|    int len, ret = 0, end = 0, prev_partial_line_read = 0, partial_line_read = 0;
  846|       |    /* 0 if not seen (yet), 1 if reading header, 2 if finished header */
  847|    873|    enum header_status got_header = MAYBE_HEADER;
  848|    873|    unsigned int flags_mask;
  849|    873|    size_t namelen;
  850|       |
  851|       |    /* Need to hold trailing NUL (accounted for by BIO_gets() and the newline
  852|       |     * that will be added by sanitize_line() (the extra '1'). */
  853|    873|    linebuf = PEM_MALLOC(LINESIZE + 1, flags);
  ------------------
  |  |  233|    873|    pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    873|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    873|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  854|    873|    if (linebuf == NULL)
  ------------------
  |  Branch (854:9): [True: 0, False: 873]
  ------------------
  855|      0|        return 0;
  856|       |
  857|   293k|    while(1) {
  ------------------
  |  Branch (857:11): [Folded - Ignored]
  ------------------
  858|   293k|        flags_mask = ~0u;
  859|   293k|        len = BIO_gets(bp, linebuf, LINESIZE);
  ------------------
  |  |  770|   293k|#define LINESIZE 255
  ------------------
  860|   293k|        if (len <= 0) {
  ------------------
  |  Branch (860:13): [True: 379, False: 293k]
  ------------------
  861|    379|            ERR_raise(ERR_LIB_PEM, PEM_R_BAD_END_LINE);
  ------------------
  |  |  401|    379|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    379|    (ERR_new(),                                                 \
  |  |  |  |  404|    379|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    379|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    379|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    379|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    379|     ERR_set_error)
  |  |  ------------------
  ------------------
  862|    379|            goto err;
  863|    379|        }
  864|       |
  865|       |        /*
  866|       |         * Check if line has been read completely or if only part of the line
  867|       |         * has been read. Keep the previous value to ignore newlines that
  868|       |         * appear due to reading a line up until the char before the newline.
  869|       |         */
  870|   293k|        prev_partial_line_read = partial_line_read;
  871|   293k|        partial_line_read = len == LINESIZE-1 && linebuf[LINESIZE-2] != '\n';
  ------------------
  |  |  770|   293k|#define LINESIZE 255
  ------------------
                      partial_line_read = len == LINESIZE-1 && linebuf[LINESIZE-2] != '\n';
  ------------------
  |  |  770|   128k|#define LINESIZE 255
  ------------------
  |  Branch (871:29): [True: 128k, False: 164k]
  |  Branch (871:50): [True: 128k, False: 213]
  ------------------
  872|       |
  873|   293k|        if (got_header == MAYBE_HEADER) {
  ------------------
  |  Branch (873:13): [True: 231k, False: 62.2k]
  ------------------
  874|   231k|            if (memchr(linebuf, ':', len) != NULL)
  ------------------
  |  Branch (874:17): [True: 82, False: 230k]
  ------------------
  875|     82|                got_header = IN_HEADER;
  876|   231k|        }
  877|   293k|        if (HAS_PREFIX(linebuf, ENDSTR) || got_header == IN_HEADER)
  ------------------
  |  |   58|   586k|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 657, False: 292k]
  |  |  ------------------
  ------------------
  |  Branch (877:44): [True: 61.5k, False: 231k]
  ------------------
  878|  62.1k|            flags_mask &= ~PEM_FLAG_ONLY_B64;
  ------------------
  |  |  382|  62.1k|#   define PEM_FLAG_ONLY_B64           0x4
  ------------------
  879|   293k|        len = sanitize_line(linebuf, len, flags & flags_mask, 0);
  880|       |
  881|       |        /* Check for end of header. */
  882|   293k|        if (linebuf[0] == '\n') {
  ------------------
  |  Branch (882:13): [True: 891, False: 292k]
  ------------------
  883|       |            /*
  884|       |             * If previous line has been read only partially this newline is a
  885|       |             * regular newline at the end of a line and not an empty line.
  886|       |             */
  887|    891|            if (!prev_partial_line_read) {
  ------------------
  |  Branch (887:17): [True: 140, False: 751]
  ------------------
  888|    140|                if (got_header == POST_HEADER) {
  ------------------
  |  Branch (888:21): [True: 13, False: 127]
  ------------------
  889|       |                    /* Another blank line is an error. */
  890|     13|                    ERR_raise(ERR_LIB_PEM, PEM_R_BAD_END_LINE);
  ------------------
  |  |  401|     13|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     13|    (ERR_new(),                                                 \
  |  |  |  |  404|     13|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     13|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     13|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     13|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     13|     ERR_set_error)
  |  |  ------------------
  ------------------
  891|     13|                    goto err;
  892|     13|                }
  893|    127|                got_header = POST_HEADER;
  894|    127|                tmp = *data;
  895|    127|            }
  896|    878|            continue;
  897|    891|        }
  898|       |
  899|       |        /* Check for end of stream (which means there is no header). */
  900|   292k|        p = linebuf;
  901|   292k|        if (CHECK_AND_SKIP_PREFIX(p, ENDSTR)) {
  ------------------
  |  |   61|   292k|    (HAS_PREFIX(str, pre) ? ((str) += sizeof(pre) - 1, 1) : 0)
  |  |  ------------------
  |  |  |  |   58|   292k|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (58:30): [True: 469, False: 291k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:5): [True: 469, False: 291k]
  |  |  ------------------
  ------------------
  902|    469|            namelen = strlen(name);
  903|    469|            if (strncmp(p, name, namelen) != 0 ||
  ------------------
  |  Branch (903:17): [True: 153, False: 316]
  ------------------
  904|    469|                !HAS_PREFIX(p + namelen, TAILSTR)) {
  ------------------
  |  |   58|    316|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  ------------------
  |  Branch (904:17): [True: 58, False: 258]
  ------------------
  905|    211|                ERR_raise(ERR_LIB_PEM, PEM_R_BAD_END_LINE);
  ------------------
  |  |  401|    211|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    211|    (ERR_new(),                                                 \
  |  |  |  |  404|    211|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|    211|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|    211|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    211|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    211|     ERR_set_error)
  |  |  ------------------
  ------------------
  906|    211|                goto err;
  907|    211|            }
  908|    258|            if (got_header == MAYBE_HEADER) {
  ------------------
  |  Branch (908:17): [True: 204, False: 54]
  ------------------
  909|    204|                *header = *data;
  910|    204|                *data = tmp;
  911|    204|            }
  912|    258|            break;
  913|   291k|        } else if (end) {
  ------------------
  |  Branch (913:20): [True: 5, False: 291k]
  ------------------
  914|       |            /* Malformed input; short line not at end of data. */
  915|      5|            ERR_raise(ERR_LIB_PEM, PEM_R_BAD_END_LINE);
  ------------------
  |  |  401|      5|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      5|    (ERR_new(),                                                 \
  |  |  |  |  404|      5|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      5|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      5|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      5|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      5|     ERR_set_error)
  |  |  ------------------
  ------------------
  916|      5|            goto err;
  917|      5|        }
  918|       |        /*
  919|       |         * Else, a line of text -- could be header or data; we don't
  920|       |         * know yet.  Just pass it through.
  921|       |         */
  922|   291k|        if (BIO_puts(tmp, linebuf) < 0)
  ------------------
  |  Branch (922:13): [True: 0, False: 291k]
  ------------------
  923|      0|            goto err;
  924|       |        /*
  925|       |         * Only encrypted files need the line length check applied.
  926|       |         */
  927|   291k|        if (got_header == POST_HEADER) {
  ------------------
  |  Branch (927:13): [True: 400, False: 291k]
  ------------------
  928|       |            /* 65 includes the trailing newline */
  929|    400|            if (len > 65)
  ------------------
  |  Branch (929:17): [True: 7, False: 393]
  ------------------
  930|      7|                goto err;
  931|    393|            if (len < 65)
  ------------------
  |  Branch (931:17): [True: 88, False: 305]
  ------------------
  932|     88|                end = 1;
  933|    393|        }
  934|   291k|    }
  935|       |
  936|    258|    ret = 1;
  937|    873|err:
  938|    873|    PEM_FREE(linebuf, flags, LINESIZE + 1);
  ------------------
  |  |  222|    873|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    873|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    873|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  939|    873|    return ret;
  940|    258|}
pem_lib.c:pem_malloc:
  236|  3.30k|{
  237|  3.30k|    return (flags & PEM_FLAG_SECURE) ? CRYPTO_secure_malloc(num, file, line)
  ------------------
  |  |  380|  3.30k|#   define PEM_FLAG_SECURE             0x1
  ------------------
  |  Branch (237:12): [True: 1.45k, False: 1.85k]
  ------------------
  238|  3.30k|                                     : CRYPTO_malloc(num, file, line);
  239|       |
  240|  3.30k|}
pem_lib.c:pem_free:
  225|  3.31k|{
  226|  3.31k|    if (flags & PEM_FLAG_SECURE)
  ------------------
  |  |  380|  3.31k|#   define PEM_FLAG_SECURE             0x1
  ------------------
  |  Branch (226:9): [True: 1.43k, False: 1.88k]
  ------------------
  227|  1.43k|        CRYPTO_secure_clear_free(p, num, file, line);
  228|  1.88k|    else
  229|  1.88k|        CRYPTO_free(p, file, line);
  230|  3.31k|}

ossl_err_load_PKCS12_strings:
   56|      2|{
   57|      2|#ifndef OPENSSL_NO_ERR
   58|      2|    if (ERR_reason_error_string(PKCS12_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (58:9): [True: 2, False: 0]
  ------------------
   59|      2|        ERR_load_strings_const(PKCS12_str_reasons);
   60|      2|#endif
   61|      2|    return 1;
   62|      2|}

ossl_err_load_PKCS7_strings:
   92|      2|{
   93|      2|#ifndef OPENSSL_NO_ERR
   94|      2|    if (ERR_reason_error_string(PKCS7_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (94:9): [True: 2, False: 0]
  ------------------
   95|      2|        ERR_load_strings_const(PKCS7_str_reasons);
   96|      2|#endif
   97|      2|    return 1;
   98|      2|}

ossl_property_defns_free:
   52|      2|{
   53|      2|    LHASH_OF(PROPERTY_DEFN_ELEM) *property_defns = vproperty_defns;
  ------------------
  |  |  149|      2|# define LHASH_OF(type) struct lhash_st_##type
  ------------------
   54|       |
   55|      2|    if (property_defns != NULL) {
  ------------------
  |  Branch (55:9): [True: 2, False: 0]
  ------------------
   56|      2|        lh_PROPERTY_DEFN_ELEM_doall(property_defns,
   57|      2|                                    &property_defn_free);
   58|      2|        lh_PROPERTY_DEFN_ELEM_free(property_defns);
   59|      2|    }
   60|      2|}
ossl_property_defns_new:
   62|      2|void *ossl_property_defns_new(OSSL_LIB_CTX *ctx) {
   63|      2|    return lh_PROPERTY_DEFN_ELEM_new(&property_defn_hash, &property_defn_cmp);
   64|      2|}

ossl_ctx_global_properties_free:
  115|      2|{
  116|      2|    OSSL_GLOBAL_PROPERTIES *globp = vglobp;
  117|       |
  118|      2|    if (globp != NULL) {
  ------------------
  |  Branch (118:9): [True: 2, False: 0]
  ------------------
  119|      2|        ossl_property_free(globp->list);
  120|      2|        OPENSSL_free(globp);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  121|      2|    }
  122|      2|}
ossl_ctx_global_properties_new:
  125|      2|{
  126|      2|    return OPENSSL_zalloc(sizeof(OSSL_GLOBAL_PROPERTIES));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  127|      2|}
ossl_method_store_new:
  244|      8|{
  245|      8|    OSSL_METHOD_STORE *res;
  246|       |
  247|      8|    res = OPENSSL_zalloc(sizeof(*res));
  ------------------
  |  |  104|      8|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  248|      8|    if (res != NULL) {
  ------------------
  |  Branch (248:9): [True: 8, False: 0]
  ------------------
  249|      8|        res->ctx = ctx;
  250|      8|        if ((res->algs = ossl_sa_ALGORITHM_new()) == NULL
  ------------------
  |  Branch (250:13): [True: 0, False: 8]
  ------------------
  251|      8|            || (res->lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (251:16): [True: 0, False: 8]
  ------------------
  252|      8|            || (res->biglock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (252:16): [True: 0, False: 8]
  ------------------
  253|      0|            ossl_method_store_free(res);
  254|      0|            return NULL;
  255|      0|        }
  256|      8|    }
  257|      8|    return res;
  258|      8|}
ossl_method_store_free:
  261|      8|{
  262|      8|    if (store != NULL) {
  ------------------
  |  Branch (262:9): [True: 8, False: 0]
  ------------------
  263|      8|        if (store->algs != NULL)
  ------------------
  |  Branch (263:13): [True: 8, False: 0]
  ------------------
  264|      8|            ossl_sa_ALGORITHM_doall_arg(store->algs, &alg_cleanup, store);
  265|      8|        ossl_sa_ALGORITHM_free(store->algs);
  266|      8|        CRYPTO_THREAD_lock_free(store->lock);
  267|      8|        CRYPTO_THREAD_lock_free(store->biglock);
  268|      8|        OPENSSL_free(store);
  ------------------
  |  |  115|      8|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  269|      8|    }
  270|      8|}

ossl_err_load_PROP_strings:
   40|      2|{
   41|      2|#ifndef OPENSSL_NO_ERR
   42|      2|    if (ERR_reason_error_string(PROP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (42:9): [True: 2, False: 0]
  ------------------
   43|      2|        ERR_load_strings_const(PROP_str_reasons);
   44|      2|#endif
   45|      2|    return 1;
   46|      2|}

ossl_property_free:
  530|      2|{
  531|      2|    OPENSSL_free(p);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  532|      2|}
ossl_property_parse_init:
  575|      2|{
  576|      2|    static const char *const predefined_names[] = {
  577|      2|        "provider",     /* Name of provider (default, legacy, fips) */
  578|      2|        "version",      /* Version number of this provider */
  579|      2|        "fips",         /* FIPS validated or FIPS supporting algorithm */
  580|      2|        "output",       /* Output type for encoders */
  581|      2|        "input",        /* Input type for decoders */
  582|      2|        "structure",    /* Structure name for encoders and decoders */
  583|      2|    };
  584|      2|    size_t i;
  585|       |
  586|     14|    for (i = 0; i < OSSL_NELEM(predefined_names); i++)
  ------------------
  |  |   14|     14|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (586:17): [True: 12, False: 2]
  ------------------
  587|     12|        if (ossl_property_name(ctx, predefined_names[i], 1) == 0)
  ------------------
  |  Branch (587:13): [True: 0, False: 12]
  ------------------
  588|      0|            goto err;
  589|       |
  590|       |    /*
  591|       |     * Pre-populate the two Boolean values. We must do them before any other
  592|       |     * values and in this order so that we get the same index as the global
  593|       |     * OSSL_PROPERTY_TRUE and OSSL_PROPERTY_FALSE values
  594|       |     */
  595|      2|    if ((ossl_property_value(ctx, "yes", 1) != OSSL_PROPERTY_TRUE)
  ------------------
  |  |   37|      2|#define OSSL_PROPERTY_TRUE      1
  ------------------
  |  Branch (595:9): [True: 0, False: 2]
  ------------------
  596|      2|        || (ossl_property_value(ctx, "no", 1) != OSSL_PROPERTY_FALSE))
  ------------------
  |  |   38|      2|#define OSSL_PROPERTY_FALSE     2
  ------------------
  |  Branch (596:12): [True: 0, False: 2]
  ------------------
  597|      0|        goto err;
  598|       |
  599|      2|    return 1;
  600|      0|err:
  601|      0|    return 0;
  602|      2|}

ossl_property_string_data_free:
   77|      2|{
   78|      2|    PROPERTY_STRING_DATA *propdata = vpropdata;
   79|       |
   80|      2|    if (propdata == NULL)
  ------------------
  |  Branch (80:9): [True: 0, False: 2]
  ------------------
   81|      0|        return;
   82|       |
   83|      2|    CRYPTO_THREAD_lock_free(propdata->lock);
   84|      2|    property_table_free(&propdata->prop_names);
   85|      2|    property_table_free(&propdata->prop_values);
   86|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
   87|      2|    sk_OPENSSL_CSTRING_free(propdata->prop_namelist);
  ------------------
  |  |  261|      2|#define sk_OPENSSL_CSTRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_CSTRING_sk_type(sk))
  ------------------
   88|      2|    sk_OPENSSL_CSTRING_free(propdata->prop_valuelist);
  ------------------
  |  |  261|      2|#define sk_OPENSSL_CSTRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_CSTRING_sk_type(sk))
  ------------------
   89|      2|    propdata->prop_namelist = propdata->prop_valuelist = NULL;
   90|      2|#endif
   91|      2|    propdata->prop_name_idx = propdata->prop_value_idx = 0;
   92|       |
   93|      2|    OPENSSL_free(propdata);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|      2|}
ossl_property_string_data_new:
   96|      2|void *ossl_property_string_data_new(OSSL_LIB_CTX *ctx) {
   97|      2|    PROPERTY_STRING_DATA *propdata = OPENSSL_zalloc(sizeof(*propdata));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   98|       |
   99|      2|    if (propdata == NULL)
  ------------------
  |  Branch (99:9): [True: 0, False: 2]
  ------------------
  100|      0|        return NULL;
  101|       |
  102|      2|    propdata->lock = CRYPTO_THREAD_lock_new();
  103|      2|    propdata->prop_names = lh_PROPERTY_STRING_new(&property_hash,
  104|      2|                                                  &property_cmp);
  105|      2|    propdata->prop_values = lh_PROPERTY_STRING_new(&property_hash,
  106|      2|                                                   &property_cmp);
  107|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
  108|      2|    propdata->prop_namelist = sk_OPENSSL_CSTRING_new_null();
  ------------------
  |  |  258|      2|#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null())
  ------------------
  109|      2|    propdata->prop_valuelist = sk_OPENSSL_CSTRING_new_null();
  ------------------
  |  |  258|      2|#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null())
  ------------------
  110|      2|#endif
  111|      2|    if (propdata->lock == NULL
  ------------------
  |  Branch (111:9): [True: 0, False: 2]
  ------------------
  112|      2|#ifndef OPENSSL_SMALL_FOOTPRINT
  113|      2|            || propdata->prop_namelist == NULL
  ------------------
  |  Branch (113:16): [True: 0, False: 2]
  ------------------
  114|      2|            || propdata->prop_valuelist == NULL
  ------------------
  |  Branch (114:16): [True: 0, False: 2]
  ------------------
  115|      2|#endif
  116|      2|            || propdata->prop_names == NULL
  ------------------
  |  Branch (116:16): [True: 0, False: 2]
  ------------------
  117|      2|            || propdata->prop_values == NULL) {
  ------------------
  |  Branch (117:16): [True: 0, False: 2]
  ------------------
  118|      0|        ossl_property_string_data_free(propdata);
  119|      0|        return NULL;
  120|      0|    }
  121|      2|    return propdata;
  122|      2|}
ossl_property_name:
  253|     12|{
  254|     12|    return ossl_property_string(ctx, 1, create, s);
  255|     12|}
ossl_property_value:
  264|      4|{
  265|      4|    return ossl_property_string(ctx, 0, create, s);
  266|      4|}
property_string.c:property_table_free:
   66|      4|{
   67|      4|    PROP_TABLE *t = *pt;
   68|       |
   69|      4|    if (t != NULL) {
  ------------------
  |  Branch (69:9): [True: 4, False: 0]
  ------------------
   70|      4|        lh_PROPERTY_STRING_doall(t, &property_free);
   71|      4|        lh_PROPERTY_STRING_free(t);
   72|      4|        *pt = NULL;
   73|      4|    }
   74|      4|}
property_string.c:property_free:
   61|     16|{
   62|     16|    OPENSSL_free(ps);
  ------------------
  |  |  115|     16|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     16|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   63|     16|}
property_string.c:property_hash:
   51|     48|{
   52|     48|    return OPENSSL_LH_strhash(a->s);
   53|     48|}
property_string.c:ossl_property_string:
  144|     16|{
  145|     16|    PROPERTY_STRING p, *ps, *ps_new;
  146|     16|    PROP_TABLE *t;
  147|     16|    OSSL_PROPERTY_IDX *pidx;
  148|     16|    PROPERTY_STRING_DATA *propdata
  149|     16|        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_PROPERTY_STRING_INDEX);
  ------------------
  |  |  101|     16|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  150|       |
  151|     16|    if (propdata == NULL)
  ------------------
  |  Branch (151:9): [True: 0, False: 16]
  ------------------
  152|      0|        return 0;
  153|       |
  154|     16|    t = name ? propdata->prop_names : propdata->prop_values;
  ------------------
  |  Branch (154:9): [True: 12, False: 4]
  ------------------
  155|     16|    p.s = s;
  156|     16|    if (!CRYPTO_THREAD_read_lock(propdata->lock)) {
  ------------------
  |  Branch (156:9): [True: 0, False: 16]
  ------------------
  157|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  158|      0|        return 0;
  159|      0|    }
  160|     16|    ps = lh_PROPERTY_STRING_retrieve(t, &p);
  161|     16|    if (ps == NULL && create) {
  ------------------
  |  Branch (161:9): [True: 16, False: 0]
  |  Branch (161:23): [True: 16, False: 0]
  ------------------
  162|     16|        CRYPTO_THREAD_unlock(propdata->lock);
  163|     16|        if (!CRYPTO_THREAD_write_lock(propdata->lock)) {
  ------------------
  |  Branch (163:13): [True: 0, False: 16]
  ------------------
  164|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_UNABLE_TO_GET_WRITE_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  165|      0|            return 0;
  166|      0|        }
  167|     16|        pidx = name ? &propdata->prop_name_idx : &propdata->prop_value_idx;
  ------------------
  |  Branch (167:16): [True: 12, False: 4]
  ------------------
  168|     16|        ps = lh_PROPERTY_STRING_retrieve(t, &p);
  169|     16|        if (ps == NULL && (ps_new = new_property_string(s, pidx)) != NULL) {
  ------------------
  |  Branch (169:13): [True: 16, False: 0]
  |  Branch (169:27): [True: 16, False: 0]
  ------------------
  170|     16|#ifndef OPENSSL_SMALL_FOOTPRINT
  171|     16|            STACK_OF(OPENSSL_CSTRING) *slist;
  ------------------
  |  |   31|     16|# define STACK_OF(type) struct stack_st_##type
  ------------------
  172|       |
  173|     16|            slist = name ? propdata->prop_namelist : propdata->prop_valuelist;
  ------------------
  |  Branch (173:21): [True: 12, False: 4]
  ------------------
  174|     16|            if (sk_OPENSSL_CSTRING_push(slist, ps_new->s) <= 0) {
  ------------------
  |  |  265|     16|#define sk_OPENSSL_CSTRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))
  ------------------
  |  Branch (174:17): [True: 0, False: 16]
  ------------------
  175|      0|                property_free(ps_new);
  176|      0|                CRYPTO_THREAD_unlock(propdata->lock);
  177|      0|                return 0;
  178|      0|            }
  179|     16|#endif
  180|     16|            lh_PROPERTY_STRING_insert(t, ps_new);
  181|     16|            if (lh_PROPERTY_STRING_error(t)) {
  ------------------
  |  Branch (181:17): [True: 0, False: 16]
  ------------------
  182|       |                /*-
  183|       |                 * Undo the previous push which means also decrementing the
  184|       |                 * index and freeing the allocated storage.
  185|       |                 */
  186|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  187|      0|                sk_OPENSSL_CSTRING_pop(slist);
  ------------------
  |  |  267|      0|#define sk_OPENSSL_CSTRING_pop(sk) ((const char *)OPENSSL_sk_pop(ossl_check_OPENSSL_CSTRING_sk_type(sk)))
  ------------------
  188|      0|#endif
  189|      0|                property_free(ps_new);
  190|      0|                --*pidx;
  191|      0|                CRYPTO_THREAD_unlock(propdata->lock);
  192|      0|                return 0;
  193|      0|            }
  194|     16|            ps = ps_new;
  195|     16|        }
  196|     16|    }
  197|     16|    CRYPTO_THREAD_unlock(propdata->lock);
  198|     16|    return ps != NULL ? ps->idx : 0;
  ------------------
  |  Branch (198:12): [True: 16, False: 0]
  ------------------
  199|     16|}
property_string.c:new_property_string:
  126|     16|{
  127|     16|    const size_t l = strlen(s);
  128|     16|    PROPERTY_STRING *ps = OPENSSL_malloc(sizeof(*ps) + l);
  ------------------
  |  |  102|     16|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     16|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  129|       |
  130|     16|    if (ps != NULL) {
  ------------------
  |  Branch (130:9): [True: 16, False: 0]
  ------------------
  131|     16|        memcpy(ps->body, s, l + 1);
  132|     16|        ps->s = ps->body;
  133|     16|        ps->idx = ++*pidx;
  134|     16|        if (ps->idx == 0) {
  ------------------
  |  Branch (134:13): [True: 0, False: 16]
  ------------------
  135|      0|            OPENSSL_free(ps);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  136|      0|            return NULL;
  137|      0|        }
  138|     16|    }
  139|     16|    return ps;
  140|     16|}

ossl_child_prov_ctx_new:
   38|      2|{
   39|      2|    return OPENSSL_zalloc(sizeof(struct child_prov_globals));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|      2|}
ossl_child_prov_ctx_free:
   43|      2|{
   44|      2|    struct child_prov_globals *gbl = vgbl;
   45|       |
   46|      2|    CRYPTO_THREAD_lock_free(gbl->lock);
   47|      2|    OPENSSL_free(gbl);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   48|      2|}

ossl_prov_conf_ctx_new:
   31|      2|{
   32|      2|    PROVIDER_CONF_GLOBAL *pcgbl = OPENSSL_zalloc(sizeof(*pcgbl));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|       |
   34|      2|    if (pcgbl == NULL)
  ------------------
  |  Branch (34:9): [True: 0, False: 2]
  ------------------
   35|      0|        return NULL;
   36|       |
   37|      2|    pcgbl->lock = CRYPTO_THREAD_lock_new();
   38|      2|    if (pcgbl->lock == NULL) {
  ------------------
  |  Branch (38:9): [True: 0, False: 2]
  ------------------
   39|      0|        OPENSSL_free(pcgbl);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|      0|        return NULL;
   41|      0|    }
   42|       |
   43|      2|    return pcgbl;
   44|      2|}
ossl_prov_conf_ctx_free:
   47|      2|{
   48|      2|    PROVIDER_CONF_GLOBAL *pcgbl = vpcgbl;
   49|       |
   50|      2|    sk_OSSL_PROVIDER_pop_free(pcgbl->activated_providers,
   51|      2|                              ossl_provider_free);
   52|       |
   53|      2|    OSSL_TRACE(CONF, "Cleaned up providers\n");
  ------------------
  |  |  288|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   54|      2|    CRYPTO_THREAD_lock_free(pcgbl->lock);
   55|      2|    OPENSSL_free(pcgbl);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   56|      2|}

ossl_provider_store_free:
  288|      2|{
  289|      2|    struct provider_store_st *store = vstore;
  290|      2|    size_t i;
  291|       |
  292|      2|    if (store == NULL)
  ------------------
  |  Branch (292:9): [True: 0, False: 2]
  ------------------
  293|      0|        return;
  294|      2|    store->freeing = 1;
  295|      2|    OPENSSL_free(store->default_path);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  296|      2|    sk_OSSL_PROVIDER_pop_free(store->providers, provider_deactivate_free);
  297|      2|#ifndef FIPS_MODULE
  298|      2|    sk_OSSL_PROVIDER_CHILD_CB_pop_free(store->child_cbs,
  299|      2|                                       ossl_provider_child_cb_free);
  300|      2|#endif
  301|      2|    CRYPTO_THREAD_lock_free(store->default_path_lock);
  302|      2|    CRYPTO_THREAD_lock_free(store->lock);
  303|      2|    for (i = 0; i < store->numprovinfo; i++)
  ------------------
  |  Branch (303:17): [True: 0, False: 2]
  ------------------
  304|      0|        ossl_provider_info_clear(&store->provinfo[i]);
  305|      2|    OPENSSL_free(store->provinfo);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  306|      2|    OPENSSL_free(store);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  307|      2|}
ossl_provider_store_new:
  310|      2|{
  311|      2|    struct provider_store_st *store = OPENSSL_zalloc(sizeof(*store));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  312|       |
  313|      2|    if (store == NULL
  ------------------
  |  Branch (313:9): [True: 0, False: 2]
  ------------------
  314|      2|        || (store->providers = sk_OSSL_PROVIDER_new(ossl_provider_cmp)) == NULL
  ------------------
  |  Branch (314:12): [True: 0, False: 2]
  ------------------
  315|      2|        || (store->default_path_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (315:12): [True: 0, False: 2]
  ------------------
  316|      2|#ifndef FIPS_MODULE
  317|      2|        || (store->child_cbs = sk_OSSL_PROVIDER_CHILD_CB_new_null()) == NULL
  ------------------
  |  Branch (317:12): [True: 0, False: 2]
  ------------------
  318|      2|#endif
  319|      2|        || (store->lock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (319:12): [True: 0, False: 2]
  ------------------
  320|      0|        ossl_provider_store_free(store);
  321|      0|        return NULL;
  322|      0|    }
  323|      2|    store->libctx = ctx;
  324|      2|    store->use_fallbacks = 1;
  325|       |
  326|      2|    return store;
  327|      2|}

ossl_err_load_RAND_strings:
  105|      2|{
  106|      2|#ifndef OPENSSL_NO_ERR
  107|      2|    if (ERR_reason_error_string(RAND_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (107:9): [True: 2, False: 0]
  ------------------
  108|      2|        ERR_load_strings_const(RAND_str_reasons);
  109|      2|#endif
  110|      2|    return 1;
  111|      2|}

ossl_rand_cleanup_int:
  180|      2|{
  181|      2|# ifndef OPENSSL_NO_DEPRECATED_3_0
  182|      2|    const RAND_METHOD *meth = default_RAND_meth;
  183|       |
  184|      2|    if (!rand_inited)
  ------------------
  |  Branch (184:9): [True: 2, False: 0]
  ------------------
  185|      2|        return;
  186|       |
  187|      0|    if (meth != NULL && meth->cleanup != NULL)
  ------------------
  |  Branch (187:9): [True: 0, False: 0]
  |  Branch (187:25): [True: 0, False: 0]
  ------------------
  188|      0|        meth->cleanup();
  189|      0|    RAND_set_rand_method(NULL);
  190|      0|# endif     /* !OPENSSL_NO_DEPRECATED_3_0 */
  191|      0|    ossl_rand_pool_cleanup();
  192|      0|# ifndef OPENSSL_NO_ENGINE
  193|      0|    CRYPTO_THREAD_lock_free(rand_engine_lock);
  194|      0|    rand_engine_lock = NULL;
  195|      0|# endif     /* !OPENSSL_NO_ENGINE */
  196|      0|# ifndef OPENSSL_NO_DEPRECATED_3_0
  197|      0|    CRYPTO_THREAD_lock_free(rand_meth_lock);
  198|      0|    rand_meth_lock = NULL;
  199|      0|# endif     /* !OPENSSL_NO_DEPRECATED_3_0 */
  200|      0|    ossl_release_default_drbg_ctx();
  201|      0|    rand_inited = 0;
  202|      0|}
ossl_rand_ctx_new:
  520|      2|{
  521|      2|    RAND_GLOBAL *dgbl = OPENSSL_zalloc(sizeof(*dgbl));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  522|       |
  523|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (523:9): [True: 0, False: 2]
  ------------------
  524|      0|        return NULL;
  525|       |
  526|      2|#ifndef FIPS_MODULE
  527|       |    /*
  528|       |     * We need to ensure that base libcrypto thread handling has been
  529|       |     * initialised.
  530|       |     */
  531|      2|    OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL);
  ------------------
  |  |   31|      2|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  532|       |
  533|       |    /* Prepopulate the random provider name */
  534|      2|    dgbl->random_provider_name = OPENSSL_strdup(random_provider_fips_name);
  ------------------
  |  |  119|      2|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  535|      2|    if (dgbl->random_provider_name == NULL)
  ------------------
  |  Branch (535:9): [True: 0, False: 2]
  ------------------
  536|      0|        goto err0;
  537|      2|#endif
  538|       |
  539|      2|    dgbl->lock = CRYPTO_THREAD_lock_new();
  540|      2|    if (dgbl->lock == NULL)
  ------------------
  |  Branch (540:9): [True: 0, False: 2]
  ------------------
  541|      0|        goto err1;
  542|       |
  543|      2|    if (!CRYPTO_THREAD_init_local(&dgbl->private, NULL))
  ------------------
  |  Branch (543:9): [True: 0, False: 2]
  ------------------
  544|      0|        goto err1;
  545|       |
  546|      2|    if (!CRYPTO_THREAD_init_local(&dgbl->public, NULL))
  ------------------
  |  Branch (546:9): [True: 0, False: 2]
  ------------------
  547|      0|        goto err2;
  548|       |
  549|      2|    return dgbl;
  550|       |
  551|      0| err2:
  552|      0|    CRYPTO_THREAD_cleanup_local(&dgbl->private);
  553|      0| err1:
  554|      0|    CRYPTO_THREAD_lock_free(dgbl->lock);
  555|      0|#ifndef FIPS_MODULE
  556|      0| err0:
  557|      0|    OPENSSL_free(dgbl->random_provider_name);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  558|      0|#endif
  559|      0|    OPENSSL_free(dgbl);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  560|      0|    return NULL;
  561|      0|}
ossl_rand_ctx_free:
  564|      2|{
  565|      2|    RAND_GLOBAL *dgbl = vdgbl;
  566|       |
  567|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (567:9): [True: 0, False: 2]
  ------------------
  568|      0|        return;
  569|       |
  570|      2|    CRYPTO_THREAD_lock_free(dgbl->lock);
  571|      2|    CRYPTO_THREAD_cleanup_local(&dgbl->private);
  572|      2|    CRYPTO_THREAD_cleanup_local(&dgbl->public);
  573|      2|    EVP_RAND_CTX_free(dgbl->primary);
  574|      2|    EVP_RAND_CTX_free(dgbl->seed);
  575|      2|#ifndef FIPS_MODULE
  576|      2|    OPENSSL_free(dgbl->random_provider_name);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  577|      2|#endif      /* !FIPS_MODULE */
  578|      2|    OPENSSL_free(dgbl->rng_name);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  579|      2|    OPENSSL_free(dgbl->rng_cipher);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  580|      2|    OPENSSL_free(dgbl->rng_digest);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  581|      2|    OPENSSL_free(dgbl->rng_propq);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  582|      2|    OPENSSL_free(dgbl->seed_name);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  583|      2|    OPENSSL_free(dgbl->seed_propq);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  584|       |
  585|      2|    OPENSSL_free(dgbl);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  586|      2|}

ossl_err_load_RSA_strings:
  160|      2|{
  161|      2|#ifndef OPENSSL_NO_ERR
  162|      2|    if (ERR_reason_error_string(RSA_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (162:9): [True: 2, False: 0]
  ------------------
  163|      2|        ERR_load_strings_const(RSA_str_reasons);
  164|      2|#endif
  165|      2|    return 1;
  166|      2|}

ossl_self_test_set_callback_new:
   35|      2|{
   36|      2|    SELF_TEST_CB *stcb;
   37|       |
   38|      2|    stcb = OPENSSL_zalloc(sizeof(*stcb));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   39|      2|    return stcb;
   40|      2|}
ossl_self_test_set_callback_free:
   43|      2|{
   44|      2|    OPENSSL_free(stcb);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   45|      2|}

ossl_sa_new:
   59|      8|{
   60|      8|    OPENSSL_SA *res = OPENSSL_zalloc(sizeof(*res));
  ------------------
  |  |  104|      8|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|       |
   62|      8|    return res;
   63|      8|}
ossl_sa_free:
  111|      8|{
  112|      8|    if (sa != NULL) {
  ------------------
  |  Branch (112:9): [True: 8, False: 0]
  ------------------
  113|      8|        sa_doall(sa, &sa_free_node, NULL, NULL);
  114|      8|        OPENSSL_free(sa);
  ------------------
  |  |  115|      8|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  115|      8|    }
  116|      8|}
ossl_sa_doall_arg:
  146|      8|{
  147|      8|    if (sa != NULL)
  ------------------
  |  Branch (147:9): [True: 8, False: 0]
  ------------------
  148|      8|        sa_doall(sa, NULL, leaf, arg);
  149|      8|}
sparse_array.c:sa_doall:
   67|     16|{
   68|     16|    int i[SA_BLOCK_MAX_LEVELS];
   69|     16|    void *nodes[SA_BLOCK_MAX_LEVELS];
   70|     16|    ossl_uintmax_t idx = 0;
   71|     16|    int l = 0;
   72|       |
   73|     16|    i[0] = 0;
   74|     16|    nodes[0] = sa->nodes;
   75|    288|    while (l >= 0) {
  ------------------
  |  Branch (75:12): [True: 272, False: 16]
  ------------------
   76|    272|        const int n = i[l];
   77|    272|        void ** const p = nodes[l];
   78|       |
   79|    272|        if (n >= SA_BLOCK_MAX) {
  ------------------
  |  |   45|    272|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  ------------------
  |  |  |  |   34|    272|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  ------------------
  ------------------
  |  Branch (79:13): [True: 16, False: 256]
  ------------------
   80|     16|            if (p != NULL && node != NULL)
  ------------------
  |  Branch (80:17): [True: 0, False: 16]
  |  Branch (80:30): [True: 0, False: 0]
  ------------------
   81|      0|                (*node)(p);
   82|     16|            l--;
   83|     16|            idx >>= OPENSSL_SA_BLOCK_BITS;
  ------------------
  |  |   34|     16|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
   84|    256|        } else {
   85|    256|            i[l] = n + 1;
   86|    256|            if (p != NULL && p[n] != NULL) {
  ------------------
  |  Branch (86:17): [True: 0, False: 256]
  |  Branch (86:30): [True: 0, False: 0]
  ------------------
   87|      0|                idx = (idx & ~SA_BLOCK_MASK) | n;
  ------------------
  |  |   46|      0|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|      0|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|      0|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   88|      0|                if (l < sa->levels - 1) {
  ------------------
  |  Branch (88:21): [True: 0, False: 0]
  ------------------
   89|      0|                    i[++l] = 0;
   90|      0|                    nodes[l] = p[n];
   91|      0|                    idx <<= OPENSSL_SA_BLOCK_BITS;
  ------------------
  |  |   34|      0|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
   92|      0|                } else if (leaf != NULL) {
  ------------------
  |  Branch (92:28): [True: 0, False: 0]
  ------------------
   93|      0|                    (*leaf)(idx, p[n], arg);
   94|      0|                }
   95|      0|            }
   96|    256|        }
   97|    272|    }
   98|     16|}

OPENSSL_sk_dup:
   49|      2|{
   50|      2|    OPENSSL_STACK *ret;
   51|       |
   52|      2|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  102|      2|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (52:9): [True: 0, False: 2]
  ------------------
   53|      0|        goto err;
   54|       |
   55|      2|    if (sk == NULL) {
  ------------------
  |  Branch (55:9): [True: 2, False: 0]
  ------------------
   56|      2|        ret->num = 0;
   57|      2|        ret->sorted = 0;
   58|      2|        ret->comp = NULL;
   59|      2|    } else {
   60|       |        /* direct structure assignment */
   61|      0|        *ret = *sk;
   62|      0|    }
   63|       |
   64|      2|    if (sk == NULL || sk->num == 0) {
  ------------------
  |  Branch (64:9): [True: 2, False: 0]
  |  Branch (64:23): [True: 0, False: 0]
  ------------------
   65|       |        /* postpone |ret->data| allocation */
   66|      2|        ret->data = NULL;
   67|      2|        ret->num_alloc = 0;
   68|      2|        return ret;
   69|      2|    }
   70|       |
   71|       |    /* duplicate |sk->data| content */
   72|      0|    ret->data = OPENSSL_malloc(sizeof(*ret->data) * sk->num_alloc);
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   73|      0|    if (ret->data == NULL)
  ------------------
  |  Branch (73:9): [True: 0, False: 0]
  ------------------
   74|      0|        goto err;
   75|      0|    memcpy(ret->data, sk->data, sizeof(void *) * sk->num);
   76|      0|    return ret;
   77|       |
   78|      0| err:
   79|      0|    OPENSSL_sk_free(ret);
   80|      0|    return NULL;
   81|      0|}
OPENSSL_sk_new_null:
  132|     12|{
  133|     12|    return OPENSSL_sk_new_reserve(NULL, 0);
  134|     12|}
OPENSSL_sk_new:
  137|      4|{
  138|      4|    return OPENSSL_sk_new_reserve(c, 0);
  139|      4|}
OPENSSL_sk_new_reserve:
  228|     16|{
  229|     16|    OPENSSL_STACK *st = OPENSSL_zalloc(sizeof(OPENSSL_STACK));
  ------------------
  |  |  104|     16|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     16|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  230|       |
  231|     16|    if (st == NULL)
  ------------------
  |  Branch (231:9): [True: 0, False: 16]
  ------------------
  232|      0|        return NULL;
  233|       |
  234|     16|    st->comp = c;
  235|       |
  236|     16|    if (n <= 0)
  ------------------
  |  Branch (236:9): [True: 16, False: 0]
  ------------------
  237|     16|        return st;
  238|       |
  239|      0|    if (!sk_reserve(st, n, 1)) {
  ------------------
  |  Branch (239:9): [True: 0, False: 0]
  ------------------
  240|      0|        OPENSSL_sk_free(st);
  241|      0|        return NULL;
  242|      0|    }
  243|       |
  244|      0|    return st;
  245|      0|}
OPENSSL_sk_set_thunks:
  260|     52|{
  261|     52|    if (st != NULL)
  ------------------
  |  Branch (261:9): [True: 10, False: 42]
  ------------------
  262|     10|        st->free_thunk = f_thunk;
  263|       |
  264|     52|    return st;
  265|     52|}
OPENSSL_sk_insert:
  268|     18|{
  269|     18|    if (st == NULL) {
  ------------------
  |  Branch (269:9): [True: 0, False: 18]
  ------------------
  270|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  271|      0|        return 0;
  272|      0|    }
  273|     18|    if (st->num == max_nodes) {
  ------------------
  |  Branch (273:9): [True: 0, False: 18]
  ------------------
  274|      0|        ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  275|      0|        return 0;
  276|      0|    }
  277|       |
  278|     18|    if (!sk_reserve(st, 1, 0))
  ------------------
  |  Branch (278:9): [True: 0, False: 18]
  ------------------
  279|      0|        return 0;
  280|       |
  281|     18|    if ((loc >= st->num) || (loc < 0)) {
  ------------------
  |  Branch (281:9): [True: 18, False: 0]
  |  Branch (281:29): [True: 0, False: 0]
  ------------------
  282|     18|        st->data[st->num] = data;
  283|     18|    } else {
  284|      0|        memmove(&st->data[loc + 1], &st->data[loc],
  285|      0|                sizeof(st->data[0]) * (st->num - loc));
  286|      0|        st->data[loc] = data;
  287|      0|    }
  288|     18|    st->num++;
  289|     18|    st->sorted = 0;
  290|     18|    return st->num;
  291|     18|}
OPENSSL_sk_delete:
  319|      2|{
  320|      2|    if (st == NULL || loc < 0 || loc >= st->num)
  ------------------
  |  Branch (320:9): [True: 0, False: 2]
  |  Branch (320:23): [True: 0, False: 2]
  |  Branch (320:34): [True: 0, False: 2]
  ------------------
  321|      0|        return NULL;
  322|       |
  323|      2|    return internal_delete(st, loc);
  324|      2|}
OPENSSL_sk_push:
  407|     18|{
  408|     18|    if (st == NULL)
  ------------------
  |  Branch (408:9): [True: 0, False: 18]
  ------------------
  409|      0|        return 0;
  410|     18|    return OPENSSL_sk_insert(st, data, st->num);
  411|     18|}
OPENSSL_sk_pop_free:
  441|     52|{
  442|     52|    int i;
  443|       |
  444|     52|    if (st == NULL)
  ------------------
  |  Branch (444:9): [True: 42, False: 10]
  ------------------
  445|     42|        return;
  446|       |
  447|     10|    for (i = 0; i < st->num; i++) {
  ------------------
  |  Branch (447:17): [True: 0, False: 10]
  ------------------
  448|      0|        if (st->data[i] != NULL) {
  ------------------
  |  Branch (448:13): [True: 0, False: 0]
  ------------------
  449|      0|            if (st->free_thunk != NULL)
  ------------------
  |  Branch (449:17): [True: 0, False: 0]
  ------------------
  450|      0|                st->free_thunk(func, (void *)st->data[i]);
  451|      0|            else
  452|      0|                func((void *)st->data[i]);
  453|      0|        }
  454|      0|    }
  455|     10|    OPENSSL_sk_free(st);
  456|     10|}
OPENSSL_sk_free:
  459|  3.66k|{
  460|  3.66k|    if (st == NULL)
  ------------------
  |  Branch (460:9): [True: 3.64k, False: 18]
  ------------------
  461|  3.64k|        return;
  462|     18|    OPENSSL_free(st->data);
  ------------------
  |  |  115|     18|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     18|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     18|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  463|     18|    OPENSSL_free(st);
  ------------------
  |  |  115|     18|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     18|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     18|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  464|     18|}
OPENSSL_sk_num:
  467|  7.28k|{
  468|  7.28k|    return st == NULL ? -1 : st->num;
  ------------------
  |  Branch (468:12): [True: 7.27k, False: 8]
  ------------------
  469|  7.28k|}
OPENSSL_sk_value:
  472|      2|{
  473|      2|    if (st == NULL || i < 0 || i >= st->num)
  ------------------
  |  Branch (473:9): [True: 0, False: 2]
  |  Branch (473:23): [True: 0, False: 2]
  |  Branch (473:32): [True: 0, False: 2]
  ------------------
  474|      0|        return NULL;
  475|      2|    return (void *)st->data[i];
  476|      2|}
stack.c:sk_reserve:
  179|     18|{
  180|     18|    const void **tmpdata;
  181|     18|    int num_alloc;
  182|       |
  183|       |    /* Check to see the reservation isn't exceeding the hard limit */
  184|     18|    if (n > max_nodes - st->num) {
  ------------------
  |  Branch (184:9): [True: 0, False: 18]
  ------------------
  185|      0|        ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  186|      0|        return 0;
  187|      0|    }
  188|       |
  189|       |    /* Figure out the new size */
  190|     18|    num_alloc = st->num + n;
  191|     18|    if (num_alloc < min_nodes)
  ------------------
  |  Branch (191:9): [True: 12, False: 6]
  ------------------
  192|     12|        num_alloc = min_nodes;
  193|       |
  194|       |    /* If |st->data| allocation was postponed */
  195|     18|    if (st->data == NULL) {
  ------------------
  |  Branch (195:9): [True: 6, False: 12]
  ------------------
  196|       |        /*
  197|       |         * At this point, |st->num_alloc| and |st->num| are 0;
  198|       |         * so |num_alloc| value is |n| or |min_nodes| if greater than |n|.
  199|       |         */
  200|      6|        if ((st->data = OPENSSL_zalloc(sizeof(void *) * num_alloc)) == NULL)
  ------------------
  |  |  104|      6|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      6|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      6|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (200:13): [True: 0, False: 6]
  ------------------
  201|      0|            return 0;
  202|      6|        st->num_alloc = num_alloc;
  203|      6|        return 1;
  204|      6|    }
  205|       |
  206|     12|    if (!exact) {
  ------------------
  |  Branch (206:9): [True: 12, False: 0]
  ------------------
  207|     12|        if (num_alloc <= st->num_alloc)
  ------------------
  |  Branch (207:13): [True: 10, False: 2]
  ------------------
  208|     10|            return 1;
  209|      2|        num_alloc = compute_growth(num_alloc, st->num_alloc);
  210|      2|        if (num_alloc == 0) {
  ------------------
  |  Branch (210:13): [True: 0, False: 2]
  ------------------
  211|      0|            ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  212|      0|            return 0;
  213|      0|        }
  214|      2|    } else if (num_alloc == st->num_alloc) {
  ------------------
  |  Branch (214:16): [True: 0, False: 0]
  ------------------
  215|      0|        return 1;
  216|      0|    }
  217|       |
  218|      2|    tmpdata = OPENSSL_realloc((void *)st->data, sizeof(void *) * num_alloc);
  ------------------
  |  |  109|      2|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  219|      2|    if (tmpdata == NULL)
  ------------------
  |  Branch (219:9): [True: 0, False: 2]
  ------------------
  220|      0|        return 0;
  221|       |
  222|      2|    st->data = tmpdata;
  223|      2|    st->num_alloc = num_alloc;
  224|      2|    return 1;
  225|      2|}
stack.c:compute_growth:
  161|      2|{
  162|      2|    int err = 0;
  163|       |
  164|      4|    while (current < target) {
  ------------------
  |  Branch (164:12): [True: 2, False: 2]
  ------------------
  165|      2|        if (current >= max_nodes)
  ------------------
  |  Branch (165:13): [True: 0, False: 2]
  ------------------
  166|      0|            return 0;
  167|       |
  168|      2|        current = safe_muldiv_int(current, 8, 5, &err);
  169|      2|        if (err != 0)
  ------------------
  |  Branch (169:13): [True: 0, False: 2]
  ------------------
  170|      0|            return 0;
  171|      2|        if (current >= max_nodes)
  ------------------
  |  Branch (171:13): [True: 0, False: 2]
  ------------------
  172|      0|            current = max_nodes;
  173|      2|    }
  174|      2|    return current;
  175|      2|}
stack.c:internal_delete:
  294|      2|{
  295|      2|    const void *ret = st->data[loc];
  296|       |
  297|      2|    if (loc != st->num - 1)
  ------------------
  |  Branch (297:9): [True: 0, False: 2]
  ------------------
  298|      0|        memmove(&st->data[loc], &st->data[loc + 1],
  299|      0|                sizeof(st->data[0]) * (st->num - loc - 1));
  300|      2|    st->num--;
  301|       |
  302|      2|    return (void *)ret;
  303|      2|}

ossl_err_load_OSSL_STORE_strings:
   69|      2|{
   70|      2|#ifndef OPENSSL_NO_ERR
   71|      2|    if (ERR_reason_error_string(OSSL_STORE_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (71:9): [True: 2, False: 0]
  ------------------
   72|      2|        ERR_load_strings_const(OSSL_STORE_str_reasons);
   73|      2|#endif
   74|      2|    return 1;
   75|      2|}

ossl_store_cleanup_int:
   14|      2|{
   15|      2|    ossl_store_destroy_loaders_int();
   16|      2|}

ossl_store_destroy_loaders_int:
  281|      2|{
  282|      2|    lh_OSSL_STORE_LOADER_free(loader_register);
  283|      2|    loader_register = NULL;
  284|      2|    CRYPTO_THREAD_lock_free(registry_lock);
  285|      2|    registry_lock = NULL;
  286|      2|}

ossl_crypto_mutex_new:
   97|      2|{
   98|      2|    pthread_mutex_t *mutex;
   99|       |
  100|      2|    if ((mutex = OPENSSL_zalloc(sizeof(*mutex))) == NULL)
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (100:9): [True: 0, False: 2]
  ------------------
  101|      0|        return NULL;
  102|      2|    if (pthread_mutex_init(mutex, NULL) != 0) {
  ------------------
  |  Branch (102:9): [True: 0, False: 2]
  ------------------
  103|      0|        OPENSSL_free(mutex);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  104|      0|        return NULL;
  105|      0|    }
  106|      2|    return (CRYPTO_MUTEX *)mutex;
  107|      2|}
ossl_crypto_mutex_free:
  142|      2|{
  143|      2|    pthread_mutex_t **mutex_p;
  144|       |
  145|      2|    if (mutex == NULL)
  ------------------
  |  Branch (145:9): [True: 0, False: 2]
  ------------------
  146|      0|        return;
  147|       |
  148|      2|    mutex_p = (pthread_mutex_t **)mutex;
  149|      2|    if (*mutex_p != NULL)
  ------------------
  |  Branch (149:9): [True: 2, False: 0]
  ------------------
  150|      2|        pthread_mutex_destroy(*mutex_p);
  151|      2|    OPENSSL_free(*mutex_p);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  152|      2|    *mutex = NULL;
  153|      2|}
ossl_crypto_condvar_new:
  156|      2|{
  157|      2|    pthread_cond_t *cv_p;
  158|       |
  159|      2|    if ((cv_p = OPENSSL_zalloc(sizeof(*cv_p))) == NULL)
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (159:9): [True: 0, False: 2]
  ------------------
  160|      0|        return NULL;
  161|      2|    if (pthread_cond_init(cv_p, NULL) != 0) {
  ------------------
  |  Branch (161:9): [True: 0, False: 2]
  ------------------
  162|      0|        OPENSSL_free(cv_p);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  163|      0|        return NULL;
  164|      0|    }
  165|      2|    return (CRYPTO_CONDVAR *) cv_p;
  166|      2|}
ossl_crypto_condvar_free:
  220|      2|{
  221|      2|    pthread_cond_t **cv_p;
  222|       |
  223|      2|    if (cv == NULL)
  ------------------
  |  Branch (223:9): [True: 0, False: 2]
  ------------------
  224|      0|        return;
  225|       |
  226|      2|    cv_p = (pthread_cond_t **)cv;
  227|      2|    if (*cv_p != NULL)
  ------------------
  |  Branch (227:9): [True: 2, False: 0]
  ------------------
  228|      2|        pthread_cond_destroy(*cv_p);
  229|      2|    OPENSSL_free(*cv_p);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  230|      2|    *cv_p = NULL;
  231|      2|}

ossl_threads_ctx_new:
  128|      2|{
  129|      2|    struct openssl_threads_st *t = OPENSSL_zalloc(sizeof(*t));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  130|       |
  131|      2|    if (t == NULL)
  ------------------
  |  Branch (131:9): [True: 0, False: 2]
  ------------------
  132|      0|        return NULL;
  133|       |
  134|      2|    t->lock = ossl_crypto_mutex_new();
  135|      2|    t->cond_finished = ossl_crypto_condvar_new();
  136|       |
  137|      2|    if (t->lock == NULL || t->cond_finished == NULL)
  ------------------
  |  Branch (137:9): [True: 0, False: 2]
  |  Branch (137:28): [True: 0, False: 2]
  ------------------
  138|      0|        goto fail;
  139|       |
  140|      2|    return t;
  141|       |
  142|      0|fail:
  143|      0|    ossl_threads_ctx_free((void *)t);
  144|      0|    return NULL;
  145|      2|}
ossl_threads_ctx_free:
  148|      2|{
  149|      2|    OSSL_LIB_CTX_THREADS *t = (OSSL_LIB_CTX_THREADS *) vdata;
  150|       |
  151|      2|    if (t == NULL)
  ------------------
  |  Branch (151:9): [True: 0, False: 2]
  ------------------
  152|      0|        return;
  153|       |
  154|      2|    ossl_crypto_mutex_free(&t->lock);
  155|      2|    ossl_crypto_condvar_free(&t->cond_finished);
  156|      2|    OPENSSL_free(t);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  157|      2|}

ossl_rcu_write_lock:
  441|      6|{
  442|      6|    pthread_mutex_lock(&lock->write_lock);
  443|      6|    TSAN_FAKE_UNLOCK(&lock->write_lock);
  444|      6|}
ossl_rcu_write_unlock:
  447|      6|{
  448|      6|    TSAN_FAKE_LOCK(&lock->write_lock);
  449|      6|    pthread_mutex_unlock(&lock->write_lock);
  450|      6|}
ossl_synchronize_rcu:
  453|     10|{
  454|     10|    struct rcu_qp *qp;
  455|     10|    uint64_t count;
  456|     10|    uint32_t curr_id;
  457|     10|    struct rcu_cb_item *cb_items, *tmpcb;
  458|       |
  459|     10|    pthread_mutex_lock(&lock->write_lock);
  460|     10|    cb_items = lock->cb_items;
  461|     10|    lock->cb_items = NULL;
  462|     10|    pthread_mutex_unlock(&lock->write_lock);
  463|       |
  464|     10|    qp = update_qp(lock, &curr_id);
  465|       |
  466|       |    /* retire in order */
  467|     10|    pthread_mutex_lock(&lock->prior_lock);
  468|     10|    while (lock->next_to_retire != curr_id)
  ------------------
  |  Branch (468:12): [True: 0, False: 10]
  ------------------
  469|      0|        pthread_cond_wait(&lock->prior_signal, &lock->prior_lock);
  470|       |
  471|       |    /*
  472|       |     * wait for the reader count to reach zero
  473|       |     * Note the use of __ATOMIC_ACQUIRE here to ensure that any
  474|       |     * prior __ATOMIC_RELEASE write operation in ossl_rcu_read_unlock
  475|       |     * is visible prior to our read
  476|       |     * however this is likely just necessary to silence a tsan warning
  477|       |     * because the read side should not do any write operation
  478|       |     * outside the atomic itself
  479|       |     */
  480|     10|    do {
  481|     10|        count = ATOMIC_LOAD_N(uint64_t, &qp->users, __ATOMIC_ACQUIRE);
  ------------------
  |  |   96|     10|#  define ATOMIC_LOAD_N(t, p, o) __atomic_load_n(p, o)
  ------------------
  482|     10|    } while (count != (uint64_t)0);
  ------------------
  |  Branch (482:14): [True: 0, False: 10]
  ------------------
  483|       |
  484|     10|    lock->next_to_retire++;
  485|     10|    pthread_cond_broadcast(&lock->prior_signal);
  486|     10|    pthread_mutex_unlock(&lock->prior_lock);
  487|       |
  488|     10|    retire_qp(lock, qp);
  489|       |
  490|       |    /* handle any callbacks that we have */
  491|     12|    while (cb_items != NULL) {
  ------------------
  |  Branch (491:12): [True: 2, False: 10]
  ------------------
  492|      2|        tmpcb = cb_items;
  493|      2|        cb_items = cb_items->next;
  494|      2|        tmpcb->fn(tmpcb->data);
  495|      2|        OPENSSL_free(tmpcb);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  496|      2|    }
  497|     10|}
ossl_rcu_call:
  504|      2|{
  505|      2|    struct rcu_cb_item *new =
  506|      2|        OPENSSL_zalloc(sizeof(*new));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  507|       |
  508|      2|    if (new == NULL)
  ------------------
  |  Branch (508:9): [True: 0, False: 2]
  ------------------
  509|      0|        return 0;
  510|       |
  511|      2|    new->data = data;
  512|      2|    new->fn = cb;
  513|       |
  514|      2|    new->next = lock->cb_items;
  515|      2|    lock->cb_items = new;
  516|       |
  517|      2|    return 1;
  518|      2|}
ossl_rcu_uptr_deref:
  521|      6|{
  522|      6|    return ATOMIC_LOAD_N(pvoid, p, __ATOMIC_ACQUIRE);
  ------------------
  |  |   96|      6|#  define ATOMIC_LOAD_N(t, p, o) __atomic_load_n(p, o)
  ------------------
  523|      6|}
ossl_rcu_assign_uptr:
  526|      6|{
  527|      6|    ATOMIC_STORE(pvoid, p, v, __ATOMIC_RELEASE);
  ------------------
  |  |   98|      6|#  define ATOMIC_STORE(t, p, v, o) __atomic_store(p, v, o)
  ------------------
  528|      6|}
ossl_rcu_lock_new:
  531|      4|{
  532|      4|    struct rcu_lock_st *new;
  533|       |
  534|       |    /*
  535|       |     * We need a minimum of 2 qp's
  536|       |     */
  537|      4|    if (num_writers < 2)
  ------------------
  |  Branch (537:9): [True: 4, False: 0]
  ------------------
  538|      4|        num_writers = 2;
  539|       |
  540|      4|    ctx = ossl_lib_ctx_get_concrete(ctx);
  541|      4|    if (ctx == NULL)
  ------------------
  |  Branch (541:9): [True: 0, False: 4]
  ------------------
  542|      0|        return 0;
  543|       |
  544|      4|    new = OPENSSL_zalloc(sizeof(*new));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  545|      4|    if (new == NULL)
  ------------------
  |  Branch (545:9): [True: 0, False: 4]
  ------------------
  546|      0|        return NULL;
  547|       |
  548|      4|    new->ctx = ctx;
  549|      4|    pthread_mutex_init(&new->write_lock, NULL);
  550|      4|    pthread_mutex_init(&new->prior_lock, NULL);
  551|      4|    pthread_mutex_init(&new->alloc_lock, NULL);
  552|      4|    pthread_cond_init(&new->prior_signal, NULL);
  553|      4|    pthread_cond_init(&new->alloc_signal, NULL);
  554|       |
  555|      4|    new->qp_group = allocate_new_qp_group(new, num_writers);
  556|      4|    if (new->qp_group == NULL) {
  ------------------
  |  Branch (556:9): [True: 0, False: 4]
  ------------------
  557|      0|        OPENSSL_free(new);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  558|      0|        new = NULL;
  559|      0|    }
  560|       |
  561|      4|    return new;
  562|      4|}
ossl_rcu_lock_free:
  565|      4|{
  566|      4|    struct rcu_lock_st *rlock = (struct rcu_lock_st *)lock;
  567|       |
  568|      4|    if (lock == NULL)
  ------------------
  |  Branch (568:9): [True: 0, False: 4]
  ------------------
  569|      0|        return;
  570|       |
  571|       |    /* make sure we're synchronized */
  572|      4|    ossl_synchronize_rcu(rlock);
  573|       |
  574|      4|    OPENSSL_free(rlock->qp_group);
  ------------------
  |  |  115|      4|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  575|       |    /* There should only be a single qp left now */
  576|      4|    OPENSSL_free(rlock);
  ------------------
  |  |  115|      4|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  577|      4|}
CRYPTO_THREAD_lock_new:
  580|     46|{
  581|     46|# ifdef USE_RWLOCK
  582|     46|    CRYPTO_RWLOCK *lock;
  583|       |
  584|     46|    if ((lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t))) == NULL)
  ------------------
  |  |  104|     46|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     46|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     46|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (584:9): [True: 0, False: 46]
  ------------------
  585|       |        /* Don't set error, to avoid recursion blowup. */
  586|      0|        return NULL;
  587|       |
  588|     46|    if (pthread_rwlock_init(lock, NULL) != 0) {
  ------------------
  |  Branch (588:9): [True: 0, False: 46]
  ------------------
  589|      0|        OPENSSL_free(lock);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  590|      0|        return NULL;
  591|      0|    }
  592|       |# else
  593|       |    pthread_mutexattr_t attr;
  594|       |    CRYPTO_RWLOCK *lock;
  595|       |
  596|       |    if ((lock = OPENSSL_zalloc(sizeof(pthread_mutex_t))) == NULL)
  597|       |        /* Don't set error, to avoid recursion blowup. */
  598|       |        return NULL;
  599|       |
  600|       |    /*
  601|       |     * We don't use recursive mutexes, but try to catch errors if we do.
  602|       |     */
  603|       |    pthread_mutexattr_init(&attr);
  604|       |#  if !defined (__TANDEM) && !defined (_SPT_MODEL_)
  605|       |#   if !defined(NDEBUG) && !defined(OPENSSL_NO_MUTEX_ERRORCHECK)
  606|       |    pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
  607|       |#   endif
  608|       |#  else
  609|       |    /* The SPT Thread Library does not define MUTEX attributes. */
  610|       |#  endif
  611|       |
  612|       |    if (pthread_mutex_init(lock, &attr) != 0) {
  613|       |        pthread_mutexattr_destroy(&attr);
  614|       |        OPENSSL_free(lock);
  615|       |        return NULL;
  616|       |    }
  617|       |
  618|       |    pthread_mutexattr_destroy(&attr);
  619|       |# endif
  620|       |
  621|     46|    return lock;
  622|     46|}
CRYPTO_THREAD_read_lock:
  625|  7.42k|{
  626|  7.42k|# ifdef USE_RWLOCK
  627|  7.42k|    if (!ossl_assert(pthread_rwlock_rdlock(lock) == 0))
  ------------------
  |  |   52|  7.42k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  7.42k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (627:9): [True: 0, False: 7.42k]
  ------------------
  628|      0|        return 0;
  629|       |# else
  630|       |    if (pthread_mutex_lock(lock) != 0) {
  631|       |        assert(errno != EDEADLK && errno != EBUSY);
  632|       |        return 0;
  633|       |    }
  634|       |# endif
  635|       |
  636|  7.42k|    return 1;
  637|  7.42k|}
CRYPTO_THREAD_write_lock:
  640|    232|{
  641|    232|# ifdef USE_RWLOCK
  642|    232|    if (!ossl_assert(pthread_rwlock_wrlock(lock) == 0))
  ------------------
  |  |   52|    232|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    232|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (642:9): [True: 0, False: 232]
  ------------------
  643|      0|        return 0;
  644|       |# else
  645|       |    if (pthread_mutex_lock(lock) != 0) {
  646|       |        assert(errno != EDEADLK && errno != EBUSY);
  647|       |        return 0;
  648|       |    }
  649|       |# endif
  650|       |
  651|    232|    return 1;
  652|    232|}
CRYPTO_THREAD_unlock:
  655|  7.65k|{
  656|  7.65k|# ifdef USE_RWLOCK
  657|  7.65k|    if (pthread_rwlock_unlock(lock) != 0)
  ------------------
  |  Branch (657:9): [True: 0, False: 7.65k]
  ------------------
  658|      0|        return 0;
  659|       |# else
  660|       |    if (pthread_mutex_unlock(lock) != 0) {
  661|       |        assert(errno != EPERM);
  662|       |        return 0;
  663|       |    }
  664|       |# endif
  665|       |
  666|  7.65k|    return 1;
  667|  7.65k|}
CRYPTO_THREAD_lock_free:
  670|     60|{
  671|     60|    if (lock == NULL)
  ------------------
  |  Branch (671:9): [True: 14, False: 46]
  ------------------
  672|     14|        return;
  673|       |
  674|     46|# ifdef USE_RWLOCK
  675|     46|    pthread_rwlock_destroy(lock);
  676|       |# else
  677|       |    pthread_mutex_destroy(lock);
  678|       |# endif
  679|     46|    OPENSSL_free(lock);
  ------------------
  |  |  115|     46|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     46|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     46|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  680|       |
  681|     46|    return;
  682|     60|}
CRYPTO_THREAD_run_once:
  685|  16.0k|{
  686|  16.0k|    if (pthread_once(once, init) != 0)
  ------------------
  |  Branch (686:9): [True: 0, False: 16.0k]
  ------------------
  687|      0|        return 0;
  688|       |
  689|  16.0k|    return 1;
  690|  16.0k|}
CRYPTO_THREAD_init_local:
  693|     14|{
  694|     14|    if (pthread_key_create(key, cleanup) != 0)
  ------------------
  |  Branch (694:9): [True: 0, False: 14]
  ------------------
  695|      0|        return 0;
  696|       |
  697|     14|    return 1;
  698|     14|}
CRYPTO_THREAD_get_local:
  701|  11.5k|{
  702|  11.5k|    return pthread_getspecific(*key);
  703|  11.5k|}
CRYPTO_THREAD_set_local:
  706|     14|{
  707|     14|    if (pthread_setspecific(*key, val) != 0)
  ------------------
  |  Branch (707:9): [True: 0, False: 14]
  ------------------
  708|      0|        return 0;
  709|       |
  710|     14|    return 1;
  711|     14|}
CRYPTO_THREAD_cleanup_local:
  714|     14|{
  715|     14|    if (pthread_key_delete(*key) != 0)
  ------------------
  |  Branch (715:9): [True: 0, False: 14]
  ------------------
  716|      0|        return 0;
  717|       |
  718|     14|    return 1;
  719|     14|}
CRYPTO_atomic_or:
  811|      2|{
  812|      2|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  813|      2|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (813:9): [Folded - Ignored]
  ------------------
  814|      2|        *ret = __atomic_or_fetch(val, op, __ATOMIC_ACQ_REL);
  815|      2|        return 1;
  816|      2|    }
  817|       |# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
  818|       |    /* This will work for all future Solaris versions. */
  819|       |    if (ret != NULL) {
  820|       |        *ret = atomic_or_64_nv(val, op);
  821|       |        return 1;
  822|       |    }
  823|       |# endif
  824|      0|    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
  ------------------
  |  Branch (824:9): [True: 0, False: 0]
  |  Branch (824:25): [True: 0, False: 0]
  ------------------
  825|      0|        return 0;
  826|      0|    *val |= op;
  827|      0|    *ret  = *val;
  828|       |
  829|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (829:9): [True: 0, False: 0]
  ------------------
  830|      0|        return 0;
  831|       |
  832|      0|    return 1;
  833|      0|}
CRYPTO_atomic_load:
  836|  4.30k|{
  837|  4.30k|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  838|  4.30k|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (838:9): [Folded - Ignored]
  ------------------
  839|  4.30k|        __atomic_load(val, ret, __ATOMIC_ACQUIRE);
  840|  4.30k|        return 1;
  841|  4.30k|    }
  842|       |# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
  843|       |    /* This will work for all future Solaris versions. */
  844|       |    if (ret != NULL) {
  845|       |        *ret = atomic_or_64_nv(val, 0);
  846|       |        return 1;
  847|       |    }
  848|       |# endif
  849|      0|    if (lock == NULL || !CRYPTO_THREAD_read_lock(lock))
  ------------------
  |  Branch (849:9): [True: 0, False: 0]
  |  Branch (849:25): [True: 0, False: 0]
  ------------------
  850|      0|        return 0;
  851|      0|    *ret  = *val;
  852|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (852:9): [True: 0, False: 0]
  ------------------
  853|      0|        return 0;
  854|       |
  855|      0|    return 1;
  856|      0|}
threads_pthread.c:update_qp:
  380|     10|{
  381|     10|    uint32_t current_idx;
  382|       |
  383|     10|    pthread_mutex_lock(&lock->alloc_lock);
  384|       |
  385|       |    /*
  386|       |     * we need at least one qp to be available with one
  387|       |     * left over, so that readers can start working on
  388|       |     * one that isn't yet being waited on
  389|       |     */
  390|     10|    while (lock->group_count - lock->writers_alloced < 2)
  ------------------
  |  Branch (390:12): [True: 0, False: 10]
  ------------------
  391|       |        /* we have to wait for one to be free */
  392|      0|        pthread_cond_wait(&lock->alloc_signal, &lock->alloc_lock);
  393|       |
  394|     10|    current_idx = lock->current_alloc_idx;
  395|       |
  396|       |    /* Allocate the qp */
  397|     10|    lock->writers_alloced++;
  398|       |
  399|       |    /* increment the allocation index */
  400|     10|    lock->current_alloc_idx =
  401|     10|        (lock->current_alloc_idx + 1) % lock->group_count;
  402|       |
  403|     10|    *curr_id = lock->id_ctr;
  404|     10|    lock->id_ctr++;
  405|       |
  406|     10|    ATOMIC_STORE_N(uint32_t, &lock->reader_idx, lock->current_alloc_idx,
  ------------------
  |  |   97|     10|#  define ATOMIC_STORE_N(t, p, v, o) __atomic_store_n(p, v, o)
  ------------------
  407|     10|                   __ATOMIC_RELAXED);
  408|       |
  409|       |    /*
  410|       |     * this should make sure that the new value of reader_idx is visible in
  411|       |     * get_hold_current_qp, directly after incrementing the users count
  412|       |     */
  413|     10|    ATOMIC_ADD_FETCH(&lock->qp_group[current_idx].users, (uint64_t)0,
  ------------------
  |  |   99|     10|#  define ATOMIC_ADD_FETCH(p, v, o) __atomic_add_fetch(p, v, o)
  ------------------
  414|     10|                     __ATOMIC_RELEASE);
  415|       |
  416|       |    /* wake up any waiters */
  417|     10|    pthread_cond_signal(&lock->alloc_signal);
  418|     10|    pthread_mutex_unlock(&lock->alloc_lock);
  419|     10|    return &lock->qp_group[current_idx];
  420|     10|}
threads_pthread.c:retire_qp:
  423|     10|{
  424|     10|    pthread_mutex_lock(&lock->alloc_lock);
  425|     10|    lock->writers_alloced--;
  426|     10|    pthread_cond_signal(&lock->alloc_signal);
  427|     10|    pthread_mutex_unlock(&lock->alloc_lock);
  428|     10|}
threads_pthread.c:allocate_new_qp_group:
  432|      4|{
  433|      4|    struct rcu_qp *new =
  434|      4|        OPENSSL_zalloc(sizeof(*new) * count);
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  435|       |
  436|      4|    lock->group_count = count;
  437|      4|    return new;
  438|      4|}

ossl_trace_cleanup:
  340|      2|{
  341|       |#ifndef OPENSSL_NO_TRACE
  342|       |    int category;
  343|       |    BIO *channel = NULL;
  344|       |    const char *prefix = NULL;
  345|       |    const char *suffix = NULL;
  346|       |
  347|       |    for (category = 0; category < OSSL_TRACE_CATEGORY_NUM; category++) {
  348|       |        /* We force the TRACE category to be treated last */
  349|       |        if (category == OSSL_TRACE_CATEGORY_TRACE)
  350|       |            continue;
  351|       |        set_trace_data(category, 0, &channel, &prefix, &suffix,
  352|       |                       trace_attach_cb, trace_detach_cb);
  353|       |    }
  354|       |    set_trace_data(OSSL_TRACE_CATEGORY_TRACE, 0, &channel,
  355|       |                   &prefix, &suffix,
  356|       |                   trace_attach_cb, trace_detach_cb);
  357|       |    CRYPTO_THREAD_lock_free(trace_lock);
  358|       |#endif
  359|      2|}
OSSL_trace_set_channel:
  362|      2|{
  363|       |#ifndef OPENSSL_NO_TRACE
  364|       |    if (category >= 0 && category < OSSL_TRACE_CATEGORY_NUM)
  365|       |        return set_trace_data(category, SIMPLE_CHANNEL, &channel, NULL, NULL,
  366|       |                              trace_attach_cb, trace_detach_cb);
  367|       |#endif
  368|      2|    return 0;
  369|      2|}

ossl_err_load_TS_strings:
   82|      2|{
   83|      2|# ifndef OPENSSL_NO_ERR
   84|      2|    if (ERR_reason_error_string(TS_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (84:9): [True: 2, False: 0]
  ------------------
   85|      2|        ERR_load_strings_const(TS_str_reasons);
   86|      2|# endif
   87|      2|    return 1;
   88|      2|}

ossl_err_load_UI_strings:
   41|      2|{
   42|      2|#ifndef OPENSSL_NO_ERR
   43|      2|    if (ERR_reason_error_string(UI_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (43:9): [True: 2, False: 0]
  ------------------
   44|      2|        ERR_load_strings_const(UI_str_reasons);
   45|      2|#endif
   46|      2|    return 1;
   47|      2|}

ossl_err_load_X509V3_strings:
  146|      2|{
  147|      2|#ifndef OPENSSL_NO_ERR
  148|      2|    if (ERR_reason_error_string(X509V3_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (148:9): [True: 2, False: 0]
  ------------------
  149|      2|        ERR_load_strings_const(X509V3_str_reasons);
  150|      2|#endif
  151|      2|    return 1;
  152|      2|}

ossl_err_load_X509_strings:
   92|      2|{
   93|      2|#ifndef OPENSSL_NO_ERR
   94|      2|    if (ERR_reason_error_string(X509_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (94:9): [True: 2, False: 0]
  ------------------
   95|      2|        ERR_load_strings_const(X509_str_reasons);
   96|      2|#endif
   97|      2|    return 1;
   98|      2|}

LLVMFuzzerInitialize:
   22|      2|{
   23|      2|    return FuzzerInitialize(argc, argv);
   24|      2|}
LLVMFuzzerTestOneInput:
   27|  1.21k|{
   28|  1.21k|    return FuzzerTestOneInput(buf, len);
   29|  1.21k|}

FuzzerInitialize:
   16|      2|{
   17|      2|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
  ------------------
  |  |  467|      2|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
   18|      2|    ERR_clear_error();
   19|      2|    CRYPTO_free_ex_index(0, -1);
   20|      2|    return 1;
   21|      2|}
FuzzerTestOneInput:
   24|  1.21k|{
   25|  1.21k|    BIO *in;
   26|  1.21k|    char *name = NULL, *header = NULL;
   27|  1.21k|    unsigned char *data = NULL;
   28|  1.21k|    long outlen;
   29|       |
   30|  1.21k|    if (len <= 1)
  ------------------
  |  Branch (30:9): [True: 1, False: 1.21k]
  ------------------
   31|      1|        return 0;
   32|       |
   33|  1.21k|    in = BIO_new(BIO_s_mem());
   34|  1.21k|    OPENSSL_assert((size_t)BIO_write(in, buf + 1, len - 1) == len - 1);
  ------------------
  |  |  438|  1.21k|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 1.21k, False: 0]
  |  |  ------------------
  ------------------
   35|  1.21k|    if (PEM_read_bio_ex(in, &name, &header, &data, &outlen, buf[0]) == 1) {
  ------------------
  |  Branch (35:9): [True: 164, False: 1.05k]
  ------------------
   36|       |	/* Try to read all the data we get to see if allocated properly. */
   37|    164|        BIO_write(in, name, strlen(name));
   38|    164|	BIO_write(in, header, strlen(header));
   39|    164|	BIO_write(in, data, outlen);
   40|    164|    }
   41|  1.21k|    if (buf[0] & PEM_FLAG_SECURE) {
  ------------------
  |  |  380|  1.21k|#   define PEM_FLAG_SECURE             0x1
  ------------------
  |  Branch (41:9): [True: 522, False: 692]
  ------------------
   42|    522|        OPENSSL_secure_free(name);
  ------------------
  |  |  127|    522|        CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    522|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    522|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   43|    522|        OPENSSL_secure_free(header);
  ------------------
  |  |  127|    522|        CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    522|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    522|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   44|    522|        OPENSSL_secure_free(data);
  ------------------
  |  |  127|    522|        CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    522|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    522|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   45|    692|    } else {
   46|    692|        OPENSSL_free(name);
  ------------------
  |  |  115|    692|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    692|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    692|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   47|    692|        OPENSSL_free(header);
  ------------------
  |  |  115|    692|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    692|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    692|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   48|    692|        OPENSSL_free(data);
  ------------------
  |  |  115|    692|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    692|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    692|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   49|    692|    }
   50|       |
   51|  1.21k|    BIO_free(in);
   52|  1.21k|    ERR_clear_error();
   53|       |
   54|  1.21k|    return 0;
   55|  1.21k|}

property.c:ossl_sa_ALGORITHM_new:
   27|      8|    { \
   28|      8|        return (SPARSE_ARRAY_OF(type) *)ossl_sa_new(); \
   29|      8|    } \
property.c:ossl_sa_ALGORITHM_doall_arg:
   56|      8|    { \
   57|      8|        ossl_sa_doall_arg((OPENSSL_SA *)sa, \
   58|      8|                          (void (*)(ossl_uintmax_t, void *, void *))leaf, arg); \
   59|      8|    } \
property.c:ossl_sa_ALGORITHM_free:
   32|      8|    { \
   33|      8|        ossl_sa_free((OPENSSL_SA *)sa); \
   34|      8|    } \

threads_pthread.c:ossl_assert_int:
   45|  7.65k|{
   46|  7.65k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 7.65k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  7.65k|    return expr;
   50|  7.65k|}

bio_lib.c:CRYPTO_NEW_REF:
  280|  3.63k|{
  281|  3.63k|    refcnt->val = n;
  282|  3.63k|    return 1;
  283|  3.63k|}
bio_lib.c:CRYPTO_FREE_REF:
  285|  3.63k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|  3.63k|{
  287|  3.63k|}
bio_lib.c:CRYPTO_DOWN_REF:
   56|  3.63k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  3.63k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  3.63k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 3.63k, False: 0]
  ------------------
   66|  3.63k|        atomic_thread_fence(memory_order_acquire);
   67|  3.63k|#   endif
   68|  3.63k|    return 1;
   69|  3.63k|}

stack.c:safe_muldiv_int:
  324|      2|    {                                                                        \
  325|      2|        int e2 = 0;                                                          \
  326|      2|        type q, r, x, y;                                                     \
  327|      2|                                                                             \
  328|      2|        if (c == 0) {                                                        \
  ------------------
  |  Branch (328:13): [True: 0, False: 2]
  ------------------
  329|      0|            *err |= 1;                                                       \
  330|      0|            return a == 0 || b == 0 ? 0 : max;                               \
  ------------------
  |  Branch (330:20): [True: 0, False: 0]
  |  Branch (330:30): [True: 0, False: 0]
  ------------------
  331|      0|        }                                                                    \
  332|      2|        x = safe_mul_ ## type_name(a, b, &e2);                               \
  333|      2|        if (!e2)                                                             \
  ------------------
  |  Branch (333:13): [True: 2, False: 0]
  ------------------
  334|      2|            return safe_div_ ## type_name(x, c, err);                        \
  335|      2|        if (b > a) {                                                         \
  ------------------
  |  Branch (335:13): [True: 0, False: 0]
  ------------------
  336|      0|            x = b;                                                           \
  337|      0|            b = a;                                                           \
  338|      0|            a = x;                                                           \
  339|      0|        }                                                                    \
  340|      0|        q = safe_div_ ## type_name(a, c, err);                               \
  341|      0|        r = safe_mod_ ## type_name(a, c, err);                               \
  342|      0|        x = safe_mul_ ## type_name(r, b, err);                               \
  343|      0|        y = safe_mul_ ## type_name(q, b, err);                               \
  344|      0|        q = safe_div_ ## type_name(x, c, err);                               \
  345|      0|        return safe_add_ ## type_name(y, q, err);                            \
  346|      2|    }
stack.c:safe_mul_int:
  138|      2|    {                                                                        \
  139|      2|        type r;                                                              \
  140|      2|                                                                             \
  141|      2|        if (!__builtin_mul_overflow(a, b, &r))                               \
  ------------------
  |  Branch (141:13): [True: 2, False: 0]
  ------------------
  142|      2|            return r;                                                        \
  143|      2|        *err |= 1;                                                           \
  144|      0|        return (a < 0) ^ (b < 0) ? min : max;                                \
  ------------------
  |  Branch (144:16): [True: 0, False: 0]
  ------------------
  145|      2|    }
stack.c:safe_div_int:
  201|      2|    {                                                                        \
  202|      2|        if (b == 0) {                                                        \
  ------------------
  |  Branch (202:13): [True: 0, False: 2]
  ------------------
  203|      0|            *err |= 1;                                                       \
  204|      0|            return a < 0 ? min : max;                                        \
  ------------------
  |  Branch (204:20): [True: 0, False: 0]
  ------------------
  205|      0|        }                                                                    \
  206|      2|        if (b == -1 && a == min) {                                           \
  ------------------
  |  Branch (206:13): [True: 0, False: 2]
  |  Branch (206:24): [True: 0, False: 0]
  ------------------
  207|      0|            *err |= 1;                                                       \
  208|      0|            return max;                                                      \
  209|      0|        }                                                                    \
  210|      2|        return a / b;                                                        \
  211|      2|    }

err.c:do_err_strings_init_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
err.c:err_do_init_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_base_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_register_atexit_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_load_crypto_nodelete_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_load_crypto_strings_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
initthread.c:create_global_tevent_register_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
conf_mod.c:do_init_module_list_lock_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
context.c:default_context_do_init_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \

err.c:ERR_GET_LIB:
  242|  8.82k|{
  243|  8.82k|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|  8.82k|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|  8.82k|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 8.82k]
  |  |  ------------------
  ------------------
  244|      0|        return ERR_LIB_SYS;
  ------------------
  |  |   72|      0|# define ERR_LIB_SYS             2
  ------------------
  245|  8.82k|    return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  226|  8.82k|# define ERR_LIB_OFFSET                 23L
  ------------------
                  return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  227|  8.82k|# define ERR_LIB_MASK                   0xFF
  ------------------
  246|  8.82k|}
err.c:ERR_GET_REASON:
  256|     68|{
  257|     68|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|     68|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|     68|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 68]
  |  |  ------------------
  ------------------
  258|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  219|      0|# define ERR_SYSTEM_MASK                ((unsigned int)INT_MAX)
  ------------------
  259|     68|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  230|     68|# define ERR_REASON_MASK                0X7FFFFF
  ------------------
  260|     68|}

err.c:ossl_check_ERR_STRING_DATA_lh_type:
  196|  8.76k|    { \
  197|  8.76k|        return (OPENSSL_LHASH *)lh; \
  198|  8.76k|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_hashfunc_type:
  206|      2|    { \
  207|      2|        return (OPENSSL_LH_HASHFUNC)hfn; \
  208|      2|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_compfunc_type:
  201|      2|    { \
  202|      2|        return (OPENSSL_LH_COMPFUNC)cmp; \
  203|      2|    } \
err.c:lh_ERR_STRING_DATA_hash_thunk:
  160|  8.75k|    { \
  161|  8.75k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  162|  8.75k|        return hfn_conv((const type *)data); \
  163|  8.75k|    } \
err.c:lh_ERR_STRING_DATA_comp_thunk:
  165|  5.89k|    { \
  166|  5.89k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  167|  5.89k|        return cfn_conv((const type *)da, (const type *)db); \
  168|  5.89k|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_plain_type:
  181|  8.62k|    { \
  182|  8.62k|        return ptr; \
  183|  8.62k|    } \
err.c:ossl_check_const_ERR_STRING_DATA_lh_plain_type:
  186|    136|    { \
  187|    136|        return ptr; \
  188|    136|    } \
store_register.c:lh_OSSL_STORE_LOADER_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_doall:
  311|      2|    { \
  312|      2|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_new:
  317|      2|    { \
  318|      2|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      2|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      2|                                lh_##type##_doall_thunk, \
  321|      2|                                lh_##type##_doall_arg_thunk); \
  322|      2|    } \
property_string.c:lh_PROPERTY_STRING_doall:
  311|      4|    { \
  312|      4|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      4|    } \
property_string.c:lh_PROPERTY_STRING_free:
  254|      4|    { \
  255|      4|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      4|    } \
property_string.c:lh_PROPERTY_STRING_new:
  317|      4|    { \
  318|      4|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      4|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      4|                                lh_##type##_doall_thunk, \
  321|      4|                                lh_##type##_doall_arg_thunk); \
  322|      4|    } \
property_string.c:lh_PROPERTY_STRING_hfn_thunk:
  243|     48|    { \
  244|     48|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|     48|        return hfn_conv((const type *)data); \
  246|     48|    } \
property_string.c:lh_PROPERTY_STRING_doall_thunk:
  299|     16|    { \
  300|     16|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|     16|        doall_conv((type *)node); \
  302|     16|    } \
property_string.c:lh_PROPERTY_STRING_retrieve:
  274|     32|    { \
  275|     32|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|     32|    } \
property_string.c:lh_PROPERTY_STRING_insert:
  264|     16|    { \
  265|     16|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|     16|    } \
property_string.c:lh_PROPERTY_STRING_error:
  279|     16|    { \
  280|     16|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|     16|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_new:
  317|      2|    { \
  318|      2|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      2|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      2|                                lh_##type##_doall_thunk, \
  321|      2|                                lh_##type##_doall_arg_thunk); \
  322|      2|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_doall:
  311|      2|    { \
  312|      2|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      2|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \

ex_data.c:sk_EX_CALLBACK_pop_free:
  145|     36|    { \
  146|     36|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|     36|        \
  148|     36|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|     36|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|     36|        \
  151|     36|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|     36|    } \
ex_data.c:sk_EX_CALLBACK_num:
   80|  7.27k|    { \
   81|  7.27k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|  7.27k|    } \
ex_data.c:ossl_check_void_sk_type:
   53|  3.63k|    { \
   54|  3.63k|        return (OPENSSL_STACK *)sk; \
   55|  3.63k|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_new_null:
   96|      2|    { \
   97|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_free:
  112|      2|    { \
  113|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_push:
  129|      2|    { \
  130|      2|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_num:
   80|      4|    { \
   81|      4|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      4|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_value:
   84|      2|    { \
   85|      2|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_delete:
  120|      2|    { \
  121|      2|        return (t2 *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); \
  122|      2|    } \
conf_mod.c:sk_CONF_IMODULE_free:
  112|      4|    { \
  113|      4|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      4|    } \
conf_mod.c:sk_CONF_MODULE_dup:
  182|      2|    { \
  183|      2|        return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
  184|      2|    } \
conf_mod.c:sk_CONF_MODULE_new_null:
   96|      2|    { \
   97|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      2|    } \
conf_mod.c:sk_CONF_MODULE_num:
   80|      4|    { \
   81|      4|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      4|    } \
conf_mod.c:sk_CONF_MODULE_free:
  112|      6|    { \
  113|      6|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      6|    } \
conf_mod.c:sk_CONF_MODULE_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
conf_mod.c:sk_CONF_IMODULE_num:
   80|      2|    { \
   81|      2|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      2|    } \
core_namemap.c:sk_NAMES_new_null:
   96|      2|    { \
   97|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      2|    } \
core_namemap.c:sk_NAMES_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
provider_conf.c:sk_OSSL_PROVIDER_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_new:
   88|      2|    { \
   89|      2|        OPENSSL_STACK *ret = OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
   90|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
   91|      2|        \
   92|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
   93|      2|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk); \
   94|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_new_null:
   96|      2|    { \
   97|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      2|    } \
obj_xref.c:sk_nid_triple_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
obj_xref.c:sk_nid_triple_free:
  112|      2|    { \
  113|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      2|    } \
property_string.c:ossl_check_OPENSSL_CSTRING_sk_type:
   53|     20|    { \
   54|     20|        return (OPENSSL_STACK *)sk; \
   55|     20|    } \
property_string.c:ossl_check_OPENSSL_CSTRING_type:
   45|     16|    { \
   46|     16|        return ptr; \
   47|     16|    } \
evp_pbe.c:sk_EVP_PBE_CTL_pop_free:
  145|      2|    { \
  146|      2|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      2|        \
  148|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      2|        \
  151|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      2|    } \
comp_methods.c:ossl_check_SSL_COMP_compfunc_type:
   57|      2|    { \
   58|      2|        return (OPENSSL_sk_compfunc)cmp; \
   59|      2|    } \
comp_methods.c:ossl_check_SSL_COMP_sk_type:
   53|      2|    { \
   54|      2|        return (OPENSSL_STACK *)sk; \
   55|      2|    } \
comp_methods.c:ossl_check_SSL_COMP_freefunc_type:
   65|      2|    { \
   66|      2|        return (OPENSSL_sk_freefunc)fr; \
   67|      2|    }

ossl_err_load_PROV_strings:
  259|      2|{
  260|      2|#ifndef OPENSSL_NO_ERR
  261|      2|    if (ERR_reason_error_string(PROV_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (261:9): [True: 2, False: 0]
  ------------------
  262|      2|        ERR_load_strings_const(PROV_str_reasons);
  263|      2|#endif
  264|      2|    return 1;
  265|      2|}

ossl_prov_drbg_nonce_ctx_new:
  272|      2|{
  273|      2|    PROV_DRBG_NONCE_GLOBAL *dngbl = OPENSSL_zalloc(sizeof(*dngbl));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  274|       |
  275|      2|    if (dngbl == NULL)
  ------------------
  |  Branch (275:9): [True: 0, False: 2]
  ------------------
  276|      0|        return NULL;
  277|       |
  278|      2|    dngbl->rand_nonce_lock = CRYPTO_THREAD_lock_new();
  279|      2|    if (dngbl->rand_nonce_lock == NULL) {
  ------------------
  |  Branch (279:9): [True: 0, False: 2]
  ------------------
  280|      0|        OPENSSL_free(dngbl);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  281|      0|        return NULL;
  282|      0|    }
  283|       |
  284|      2|    return dngbl;
  285|      2|}
ossl_prov_drbg_nonce_ctx_free:
  288|      2|{
  289|      2|    PROV_DRBG_NONCE_GLOBAL *dngbl = vdngbl;
  290|       |
  291|      2|    if (dngbl == NULL)
  ------------------
  |  Branch (291:9): [True: 0, False: 2]
  ------------------
  292|      0|        return;
  293|       |
  294|      2|    CRYPTO_THREAD_lock_free(dngbl->rand_nonce_lock);
  295|       |
  296|      2|    OPENSSL_free(dngbl);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  297|      2|}

