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.75k|{
   83|  3.75k|    BIO *bio = OPENSSL_zalloc(sizeof(*bio));
  ------------------
  |  |  104|  3.75k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.75k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.75k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   84|       |
   85|  3.75k|    if (bio == NULL)
  ------------------
  |  Branch (85:9): [True: 0, False: 3.75k]
  ------------------
   86|      0|        return NULL;
   87|       |
   88|  3.75k|    bio->libctx = libctx;
   89|  3.75k|    bio->method = method;
   90|  3.75k|    bio->shutdown = 1;
   91|       |
   92|  3.75k|    if (!CRYPTO_NEW_REF(&bio->references, 1))
  ------------------
  |  Branch (92:9): [True: 0, False: 3.75k]
  ------------------
   93|      0|        goto err;
   94|       |
   95|  3.75k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data))
  ------------------
  |  |  240|  3.75k|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  |  Branch (95:9): [True: 0, False: 3.75k]
  ------------------
   96|      0|        goto err;
   97|       |
   98|  3.75k|    if (method->create != NULL && !method->create(bio)) {
  ------------------
  |  Branch (98:9): [True: 3.75k, False: 0]
  |  Branch (98:35): [True: 0, False: 3.75k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  100|      0|        CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data);
  ------------------
  |  |  240|      0|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  101|      0|        goto err;
  102|      0|    }
  103|  3.75k|    if (method->create == NULL)
  ------------------
  |  Branch (103:9): [True: 0, False: 3.75k]
  ------------------
  104|      0|        bio->init = 1;
  105|       |
  106|  3.75k|    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)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  111|      0|    return NULL;
  112|  3.75k|}
BIO_new:
  115|  3.75k|{
  116|  3.75k|    return BIO_new_ex(NULL, method);
  117|  3.75k|}
BIO_free:
  120|  3.76k|{
  121|  3.76k|    int ret;
  122|       |
  123|  3.76k|    if (a == NULL)
  ------------------
  |  Branch (123:9): [True: 8, False: 3.75k]
  ------------------
  124|      8|        return 0;
  125|       |
  126|  3.75k|    if (CRYPTO_DOWN_REF(&a->references, &ret) <= 0)
  ------------------
  |  Branch (126:9): [True: 0, False: 3.75k]
  ------------------
  127|      0|        return 0;
  128|       |
  129|  3.75k|    REF_PRINT_COUNT("BIO", a);
  ------------------
  |  |  289|  3.75k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|  3.75k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|  3.75k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|  3.75k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  130|  3.75k|    if (ret > 0)
  ------------------
  |  Branch (130:9): [True: 0, False: 3.75k]
  ------------------
  131|      0|        return 1;
  132|  3.75k|    REF_ASSERT_ISNT(ret < 0);
  ------------------
  |  |  281|  3.75k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 3.75k]
  |  |  ------------------
  ------------------
  133|       |
  134|  3.75k|    if (HAS_CALLBACK(a)) {
  ------------------
  |  |   26|  3.75k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 3.75k]
  |  |  |  Branch (26:52): [True: 0, False: 3.75k]
  |  |  ------------------
  ------------------
  135|      0|        ret = (int)bio_call_callback(a, BIO_CB_FREE, NULL, 0, 0, 0L, 1L, NULL);
  ------------------
  |  |  288|      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.75k|    if ((a->method != NULL) && (a->method->destroy != NULL))
  ------------------
  |  Branch (140:9): [True: 3.75k, False: 0]
  |  Branch (140:32): [True: 3.75k, False: 0]
  ------------------
  141|  3.75k|        a->method->destroy(a);
  142|       |
  143|  3.75k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data);
  ------------------
  |  |  240|  3.75k|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  144|       |
  145|  3.75k|    CRYPTO_FREE_REF(&a->references);
  146|       |
  147|  3.75k|    OPENSSL_free(a);
  ------------------
  |  |  115|  3.75k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.75k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.75k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  148|       |
  149|  3.75k|    return 1;
  150|  3.75k|}
BIO_clear_flags:
  200|  1.03M|{
  201|  1.03M|    b->flags &= ~flags;
  202|  1.03M|}
BIO_read:
  304|    196|{
  305|    196|    size_t readbytes;
  306|    196|    int ret;
  307|       |
  308|    196|    if (dlen < 0)
  ------------------
  |  Branch (308:9): [True: 0, False: 196]
  ------------------
  309|      0|        return 0;
  310|       |
  311|    196|    ret = bio_read_intern(b, data, (size_t)dlen, &readbytes);
  312|       |
  313|    196|    if (ret > 0) {
  ------------------
  |  Branch (313:9): [True: 196, False: 0]
  ------------------
  314|       |        /* *readbytes should always be <= dlen */
  315|    196|        ret = (int)readbytes;
  316|    196|    }
  317|       |
  318|    196|    return ret;
  319|    196|}
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: 251, False: 1.45k]
  ------------------
  376|    251|        return 0;
  377|       |
  378|  1.45k|    ret = bio_write_intern(b, data, (size_t)dlen, &written);
  379|       |
  380|  1.45k|    if (ret > 0) {
  ------------------
  |  Branch (380:9): [True: 1.45k, False: 0]
  ------------------
  381|       |        /* written should always be <= dlen */
  382|  1.45k|        ret = (int)written;
  383|  1.45k|    }
  384|       |
  385|  1.45k|    return ret;
  386|  1.70k|}
BIO_puts:
  499|   267k|{
  500|   267k|    int ret;
  501|   267k|    size_t written = 0;
  502|       |
  503|   267k|    if (b == NULL) {
  ------------------
  |  Branch (503:9): [True: 0, False: 267k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  505|      0|        return -1;
  506|      0|    }
  507|   267k|    if (b->method == NULL || b->method->bputs == NULL) {
  ------------------
  |  Branch (507:9): [True: 0, False: 267k]
  |  Branch (507:30): [True: 0, False: 267k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  509|      0|        return -2;
  510|      0|    }
  511|       |
  512|   267k|    if (HAS_CALLBACK(b)) {
  ------------------
  |  |   26|   267k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 267k]
  |  |  |  Branch (26:52): [True: 0, False: 267k]
  |  |  ------------------
  ------------------
  513|      0|        ret = (int)bio_call_callback(b, BIO_CB_PUTS, buf, 0, 0, 0L, 1L, NULL);
  ------------------
  |  |  291|      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|   267k|    if (!b->init) {
  ------------------
  |  Branch (518:9): [True: 0, False: 267k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  520|      0|        return -1;
  521|      0|    }
  522|       |
  523|   267k|    ret = b->method->bputs(b, buf);
  524|       |
  525|   267k|    if (ret > 0) {
  ------------------
  |  Branch (525:9): [True: 267k, False: 444]
  ------------------
  526|   267k|        b->num_write += (uint64_t)ret;
  527|   267k|        written = ret;
  528|   267k|        ret = 1;
  529|   267k|    }
  530|       |
  531|   267k|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|   267k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 267k]
  |  |  |  Branch (26:52): [True: 0, False: 267k]
  |  |  ------------------
  ------------------
  532|      0|        ret = (int)bio_call_callback(b, BIO_CB_PUTS | BIO_CB_RETURN, buf, 0, 0,
  ------------------
  |  |  291|      0|# define BIO_CB_PUTS        0x04
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_PUTS | BIO_CB_RETURN, buf, 0, 0,
  ------------------
  |  |  301|      0|# define BIO_CB_RETURN   0x80
  ------------------
  533|      0|                                     0L, ret, &written);
  534|       |
  535|   267k|    if (ret > 0) {
  ------------------
  |  Branch (535:9): [True: 267k, False: 444]
  ------------------
  536|   267k|        if (written > INT_MAX) {
  ------------------
  |  Branch (536:13): [True: 0, False: 267k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  538|      0|            ret = -1;
  539|   267k|        } else {
  540|   267k|            ret = (int)written;
  541|   267k|        }
  542|   267k|    }
  543|       |
  544|   267k|    return ret;
  545|   267k|}
BIO_gets:
  548|   381k|{
  549|   381k|    int ret;
  550|   381k|    size_t readbytes = 0;
  551|       |
  552|   381k|    if (b == NULL) {
  ------------------
  |  Branch (552:9): [True: 0, False: 381k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  554|      0|        return -1;
  555|      0|    }
  556|   381k|    if (b->method == NULL || b->method->bgets == NULL) {
  ------------------
  |  Branch (556:9): [True: 0, False: 381k]
  |  Branch (556:30): [True: 0, False: 381k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  558|      0|        return -2;
  559|      0|    }
  560|       |
  561|   381k|    if (size < 0) {
  ------------------
  |  Branch (561:9): [True: 0, False: 381k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  563|      0|        return -1;
  564|      0|    }
  565|       |
  566|   381k|    if (HAS_CALLBACK(b)) {
  ------------------
  |  |   26|   381k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 381k]
  |  |  |  Branch (26:52): [True: 0, False: 381k]
  |  |  ------------------
  ------------------
  567|      0|        ret = (int)bio_call_callback(b, BIO_CB_GETS, buf, size, 0, 0L, 1, NULL);
  ------------------
  |  |  292|      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|   381k|    if (!b->init) {
  ------------------
  |  Branch (572:9): [True: 0, False: 381k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  574|      0|        return -1;
  575|      0|    }
  576|       |
  577|   381k|    ret = b->method->bgets(b, buf, size);
  578|       |
  579|   381k|    if (ret > 0) {
  ------------------
  |  Branch (579:9): [True: 381k, False: 766]
  ------------------
  580|   381k|        readbytes = ret;
  581|   381k|        ret = 1;
  582|   381k|    }
  583|       |
  584|   381k|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|   381k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 381k]
  |  |  |  Branch (26:52): [True: 0, False: 381k]
  |  |  ------------------
  ------------------
  585|      0|        ret = (int)bio_call_callback(b, BIO_CB_GETS | BIO_CB_RETURN, buf, size,
  ------------------
  |  |  292|      0|# define BIO_CB_GETS        0x05
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_GETS | BIO_CB_RETURN, buf, size,
  ------------------
  |  |  301|      0|# define BIO_CB_RETURN   0x80
  ------------------
  586|      0|                                     0, 0L, ret, &readbytes);
  587|       |
  588|   381k|    if (ret > 0) {
  ------------------
  |  Branch (588:9): [True: 381k, False: 766]
  ------------------
  589|       |        /* Shouldn't happen */
  590|   381k|        if (readbytes > (size_t)size)
  ------------------
  |  Branch (590:13): [True: 0, False: 381k]
  ------------------
  591|      0|            ret = -1;
  592|   381k|        else
  593|   381k|            ret = (int)readbytes;
  594|   381k|    }
  595|       |
  596|   381k|    return ret;
  597|   381k|}
BIO_ctrl:
  661|    424|{
  662|    424|    long ret;
  663|       |
  664|    424|    if (b == NULL)
  ------------------
  |  Branch (664:9): [True: 0, False: 424]
  ------------------
  665|      0|        return -1;
  666|    424|    if (b->method == NULL || b->method->ctrl == NULL) {
  ------------------
  |  Branch (666:9): [True: 0, False: 424]
  |  Branch (666:30): [True: 0, False: 424]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  668|      0|        return -2;
  669|      0|    }
  670|       |
  671|    424|    if (HAS_CALLBACK(b)) {
  ------------------
  |  |   26|    424|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 424]
  |  |  |  Branch (26:52): [True: 0, False: 424]
  |  |  ------------------
  ------------------
  672|      0|        ret = bio_call_callback(b, BIO_CB_CTRL, parg, 0, cmd, larg, 1L, NULL);
  ------------------
  |  |  293|      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|    424|    ret = b->method->ctrl(b, cmd, larg, parg);
  678|       |
  679|    424|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|    424|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 424]
  |  |  |  Branch (26:52): [True: 0, False: 424]
  |  |  ------------------
  ------------------
  680|      0|        ret = bio_call_callback(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, 0, cmd,
  ------------------
  |  |  293|      0|# define BIO_CB_CTRL        0x06
  ------------------
                      ret = bio_call_callback(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, 0, cmd,
  ------------------
  |  |  301|      0|# define BIO_CB_RETURN   0x80
  ------------------
  681|      0|                                larg, ret, NULL);
  682|       |
  683|    424|    return ret;
  684|    424|}
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|    196|{
  264|    196|    int ret;
  265|       |
  266|    196|    if (b == NULL) {
  ------------------
  |  Branch (266:9): [True: 0, False: 196]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  268|      0|        return -1;
  269|      0|    }
  270|    196|    if (b->method == NULL || b->method->bread == NULL) {
  ------------------
  |  Branch (270:9): [True: 0, False: 196]
  |  Branch (270:30): [True: 0, False: 196]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|        return -2;
  273|      0|    }
  274|       |
  275|    196|    if (HAS_CALLBACK(b) &&
  ------------------
  |  |   26|    392|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 196]
  |  |  |  Branch (26:52): [True: 0, False: 196]
  |  |  ------------------
  ------------------
  276|    196|        ((ret = (int)bio_call_callback(b, BIO_CB_READ, data, dlen, 0, 0L, 1L,
  ------------------
  |  |  289|      0|# define BIO_CB_READ        0x02
  ------------------
  |  Branch (276:9): [True: 0, False: 0]
  ------------------
  277|      0|                                       NULL)) <= 0))
  278|      0|        return ret;
  279|       |
  280|    196|    if (!b->init) {
  ------------------
  |  Branch (280:9): [True: 0, False: 196]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  282|      0|        return -1;
  283|      0|    }
  284|       |
  285|    196|    ret = b->method->bread(b, data, dlen, readbytes);
  286|       |
  287|    196|    if (ret > 0)
  ------------------
  |  Branch (287:9): [True: 196, False: 0]
  ------------------
  288|    196|        b->num_read += (uint64_t)*readbytes;
  289|       |
  290|    196|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|    196|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 196]
  |  |  |  Branch (26:52): [True: 0, False: 196]
  |  |  ------------------
  ------------------
  291|      0|        ret = (int)bio_call_callback(b, BIO_CB_READ | BIO_CB_RETURN, data,
  ------------------
  |  |  289|      0|# define BIO_CB_READ        0x02
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_READ | BIO_CB_RETURN, data,
  ------------------
  |  |  301|      0|# define BIO_CB_RETURN   0x80
  ------------------
  292|      0|                                     dlen, 0, 0L, ret, readbytes);
  293|       |
  294|       |    /* Shouldn't happen */
  295|    196|    if (ret > 0 && *readbytes > dlen) {
  ------------------
  |  Branch (295:9): [True: 196, False: 0]
  |  Branch (295:20): [True: 0, False: 196]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  297|      0|        return -1;
  298|      0|    }
  299|       |
  300|    196|    return ret;
  301|    196|}
bio_lib.c:bio_write_intern:
  328|  1.45k|{
  329|  1.45k|    size_t local_written;
  330|  1.45k|    int ret;
  331|       |
  332|  1.45k|    if (written != NULL)
  ------------------
  |  Branch (332:9): [True: 1.45k, False: 0]
  ------------------
  333|  1.45k|        *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.45k|    if (b == NULL)
  ------------------
  |  Branch (338:9): [True: 0, False: 1.45k]
  ------------------
  339|      0|        return 0;
  340|       |
  341|  1.45k|    if (b->method == NULL || b->method->bwrite == NULL) {
  ------------------
  |  Branch (341:9): [True: 0, False: 1.45k]
  |  Branch (341:30): [True: 0, False: 1.45k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  343|      0|        return -2;
  344|      0|    }
  345|       |
  346|  1.45k|    if (HAS_CALLBACK(b) &&
  ------------------
  |  |   26|  2.90k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 1.45k]
  |  |  |  Branch (26:52): [True: 0, False: 1.45k]
  |  |  ------------------
  ------------------
  347|  1.45k|        ((ret = (int)bio_call_callback(b, BIO_CB_WRITE, data, dlen, 0, 0L, 1L,
  ------------------
  |  |  290|      0|# define BIO_CB_WRITE       0x03
  ------------------
  |  Branch (347:9): [True: 0, False: 0]
  ------------------
  348|      0|                                       NULL)) <= 0))
  349|      0|        return ret;
  350|       |
  351|  1.45k|    if (!b->init) {
  ------------------
  |  Branch (351:9): [True: 0, False: 1.45k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  353|      0|        return -1;
  354|      0|    }
  355|       |
  356|  1.45k|    ret = b->method->bwrite(b, data, dlen, &local_written);
  357|       |
  358|  1.45k|    if (ret > 0)
  ------------------
  |  Branch (358:9): [True: 1.45k, False: 0]
  ------------------
  359|  1.45k|        b->num_write += (uint64_t)local_written;
  360|       |
  361|  1.45k|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|  1.45k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 1.45k]
  |  |  |  Branch (26:52): [True: 0, False: 1.45k]
  |  |  ------------------
  ------------------
  362|      0|        ret = (int)bio_call_callback(b, BIO_CB_WRITE | BIO_CB_RETURN, data,
  ------------------
  |  |  290|      0|# define BIO_CB_WRITE       0x03
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_WRITE | BIO_CB_RETURN, data,
  ------------------
  |  |  301|      0|# define BIO_CB_RETURN   0x80
  ------------------
  363|      0|                                     dlen, 0, 0L, ret, &local_written);
  364|       |
  365|  1.45k|    if (written != NULL)
  ------------------
  |  Branch (365:9): [True: 1.45k, False: 0]
  ------------------
  366|  1.45k|        *written = local_written;
  367|  1.45k|    return ret;
  368|  1.45k|}

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

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

ossl_bio_core_globals_free:
   26|      2|{
   27|      2|    OPENSSL_free(vbcg);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|      2|}

BIO_s_mem:
   73|  1.92k|{
   74|  1.92k|    return &mem_method;
   75|  1.92k|}
BIO_s_secmem:
   78|    577|{
   79|    577|    return(&secmem_method);
   80|    577|}
bss_mem.c:mem_write:
  215|   269k|{
  216|   269k|    int ret = -1;
  217|   269k|    int blen;
  218|   269k|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  219|       |
  220|   269k|    if (b->flags & BIO_FLAGS_MEM_RDONLY) {
  ------------------
  |  |  236|   269k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (220:9): [True: 0, False: 269k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  222|      0|        goto end;
  223|      0|    }
  224|   269k|    BIO_clear_retry_flags(b);
  ------------------
  |  |  260|   269k|                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  222|   269k|# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|   269k|# define BIO_FLAGS_READ          0x01
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  220|   269k|# define BIO_FLAGS_WRITE         0x02
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  221|   269k|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  223|   269k|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  225|   269k|    if (inl == 0)
  ------------------
  |  Branch (225:9): [True: 444, False: 268k]
  ------------------
  226|    444|        return 0;
  227|   268k|    if (in == NULL) {
  ------------------
  |  Branch (227:9): [True: 0, False: 268k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  229|      0|        goto end;
  230|      0|    }
  231|   268k|    blen = bbm->readp->length;
  232|   268k|    mem_buf_sync(b);
  233|   268k|    if (BUF_MEM_grow_clean(bbm->buf, blen + inl) == 0)
  ------------------
  |  Branch (233:9): [True: 0, False: 268k]
  ------------------
  234|      0|        goto end;
  235|   268k|    memcpy(bbm->buf->data + blen, in, inl);
  236|   268k|    *bbm->readp = *bbm->buf;
  237|   268k|    ret = inl;
  238|   268k| end:
  239|   268k|    return ret;
  240|   268k|}
bss_mem.c:mem_buf_sync:
  178|   268k|{
  179|   268k|    if (b != NULL && b->init != 0 && b->ptr != NULL) {
  ------------------
  |  Branch (179:9): [True: 268k, False: 0]
  |  Branch (179:22): [True: 268k, False: 0]
  |  Branch (179:38): [True: 268k, False: 0]
  ------------------
  180|   268k|        BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  181|       |
  182|   268k|        if (bbm->readp->data != bbm->buf->data) {
  ------------------
  |  Branch (182:13): [True: 150, False: 268k]
  ------------------
  183|    150|            memmove(bbm->buf->data, bbm->readp->data, bbm->readp->length);
  184|    150|            bbm->buf->length = bbm->readp->length;
  185|    150|            bbm->readp->data = bbm->buf->data;
  186|    150|        }
  187|   268k|    }
  188|   268k|    return 0;
  189|   268k|}
bss_mem.c:mem_read:
  192|   381k|{
  193|   381k|    int ret = -1;
  194|   381k|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  195|   381k|    BUF_MEM *bm = bbm->readp;
  196|       |
  197|   381k|    if (b->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  236|   381k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (197:9): [True: 0, False: 381k]
  ------------------
  198|      0|        bm = bbm->buf;
  199|   381k|    BIO_clear_retry_flags(b);
  ------------------
  |  |  260|   381k|                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  222|   381k|# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|   381k|# define BIO_FLAGS_READ          0x01
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  220|   381k|# define BIO_FLAGS_WRITE         0x02
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  221|   381k|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  223|   381k|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  200|   381k|    ret = (outl >= 0 && (size_t)outl > bm->length) ? (int)bm->length : outl;
  ------------------
  |  Branch (200:12): [True: 381k, False: 0]
  |  Branch (200:25): [True: 0, False: 381k]
  ------------------
  201|   381k|    if ((out != NULL) && (ret > 0)) {
  ------------------
  |  Branch (201:9): [True: 381k, False: 0]
  |  Branch (201:26): [True: 381k, False: 0]
  ------------------
  202|   381k|        memcpy(out, bm->data, ret);
  203|   381k|        bm->length -= ret;
  204|   381k|        bm->max -= ret;
  205|   381k|        bm->data += ret;
  206|   381k|    } 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);
  ------------------
  |  |  254|      0|                BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  219|      0|# define BIO_FLAGS_READ          0x01
  |  |  ------------------
  |  |                               BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  223|      0|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  210|      0|    }
  211|   381k|    return ret;
  212|   381k|}
bss_mem.c:mem_puts:
  380|   267k|{
  381|   267k|    int n, ret;
  382|       |
  383|   267k|    n = strlen(str);
  384|   267k|    ret = mem_write(bp, str, n);
  385|       |    /* memory semantics is that it will always work */
  386|   267k|    return ret;
  387|   267k|}
bss_mem.c:mem_gets:
  342|   381k|{
  343|   381k|    int i, j;
  344|   381k|    int ret = -1;
  345|   381k|    char *p;
  346|   381k|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)bp->ptr;
  347|   381k|    BUF_MEM *bm = bbm->readp;
  348|       |
  349|   381k|    if (bp->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  236|   381k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (349:9): [True: 0, False: 381k]
  ------------------
  350|      0|        bm = bbm->buf;
  351|   381k|    BIO_clear_retry_flags(bp);
  ------------------
  |  |  260|   381k|                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  222|   381k|# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  219|   381k|# define BIO_FLAGS_READ          0x01
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  220|   381k|# define BIO_FLAGS_WRITE         0x02
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  221|   381k|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  223|   381k|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  352|   381k|    j = bm->length;
  353|   381k|    if ((size - 1) < j)
  ------------------
  |  Branch (353:9): [True: 373k, False: 8.28k]
  ------------------
  354|   373k|        j = size - 1;
  355|   381k|    if (j <= 0) {
  ------------------
  |  Branch (355:9): [True: 766, False: 381k]
  ------------------
  356|    766|        *buf = '\0';
  357|    766|        return 0;
  358|    766|    }
  359|   381k|    p = bm->data;
  360|  46.6M|    for (i = 0; i < j; i++) {
  ------------------
  |  Branch (360:17): [True: 46.4M, False: 168k]
  ------------------
  361|  46.4M|        if (p[i] == '\n') {
  ------------------
  |  Branch (361:13): [True: 212k, False: 46.2M]
  ------------------
  362|   212k|            i++;
  363|   212k|            break;
  364|   212k|        }
  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|   381k|    i = mem_read(bp, buf, i);
  373|   381k|    if (i > 0)
  ------------------
  |  Branch (373:9): [True: 381k, False: 0]
  ------------------
  374|   381k|        buf[i] = '\0';
  375|   381k|    ret = i;
  376|   381k|    return ret;
  377|   381k|}
bss_mem.c:mem_ctrl:
  243|    424|{
  244|    424|    long ret = 1;
  245|    424|    char **pptr;
  246|    424|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  247|    424|    BUF_MEM *bm, *bo;            /* bio_mem, bio_other */
  248|    424|    long off, remain;
  249|       |
  250|    424|    if (b->flags & BIO_FLAGS_MEM_RDONLY) {
  ------------------
  |  |  236|    424|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (250:9): [True: 0, False: 424]
  ------------------
  251|      0|        bm = bbm->buf;
  252|      0|        bo = bbm->readp;
  253|    424|    } else {
  254|    424|        bm = bbm->readp;
  255|    424|        bo = bbm->buf;
  256|    424|    }
  257|    424|    off = (bm->data == bo->data) ? 0 : bm->data - bo->data;
  ------------------
  |  Branch (257:11): [True: 424, False: 0]
  ------------------
  258|    424|    remain = bm->length;
  259|       |
  260|    424|    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: 424]
  ------------------
  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)) {
  ------------------
  |  |  236|      0|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (264:17): [True: 0, False: 0]
  ------------------
  265|      0|                if (!(b->flags & BIO_FLAGS_NONCLEAR_RST)) {
  ------------------
  |  |  237|      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:
  ------------------
  |  |  458|      0|# define BIO_C_FILE_SEEK                         128
  ------------------
  |  Branch (276:5): [True: 0, False: 424]
  ------------------
  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:
  ------------------
  |  |  464|      0|# define BIO_C_FILE_TELL                         133
  ------------------
  |  Branch (285:5): [True: 0, False: 424]
  ------------------
  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: 424]
  ------------------
  289|      0|        ret = (long)(bm->length == 0);
  290|      0|        break;
  291|      0|    case BIO_C_SET_BUF_MEM_EOF_RETURN:
  ------------------
  |  |  460|      0|# define BIO_C_SET_BUF_MEM_EOF_RETURN            130/* return end of input
  ------------------
  |  Branch (291:5): [True: 0, False: 424]
  ------------------
  292|      0|        b->num = (int)num;
  293|      0|        break;
  294|    172|    case BIO_CTRL_INFO:
  ------------------
  |  |   90|    172|# define BIO_CTRL_INFO           3/* opt - extra tit-bits */
  ------------------
  |  Branch (294:5): [True: 172, False: 252]
  ------------------
  295|    172|        ret = (long)bm->length;
  296|    172|        if (ptr != NULL) {
  ------------------
  |  Branch (296:13): [True: 0, False: 172]
  ------------------
  297|      0|            pptr = (char **)ptr;
  298|      0|            *pptr = (char *)(bm->data);
  299|      0|        }
  300|    172|        break;
  301|      0|    case BIO_C_SET_BUF_MEM:
  ------------------
  |  |  444|      0|# define BIO_C_SET_BUF_MEM                       114
  ------------------
  |  Branch (301:5): [True: 0, False: 424]
  ------------------
  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|    252|    case BIO_C_GET_BUF_MEM_PTR:
  ------------------
  |  |  445|    252|# define BIO_C_GET_BUF_MEM_PTR                   115
  ------------------
  |  Branch (307:5): [True: 252, False: 172]
  ------------------
  308|    252|        if (ptr != NULL) {
  ------------------
  |  Branch (308:13): [True: 252, False: 0]
  ------------------
  309|    252|            if (!(b->flags & BIO_FLAGS_MEM_RDONLY))
  ------------------
  |  |  236|    252|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (309:17): [True: 252, False: 0]
  ------------------
  310|    252|                mem_buf_sync(b);
  311|    252|            bm = bbm->buf;
  312|    252|            pptr = (char **)ptr;
  313|    252|            *pptr = (char *)bm;
  314|    252|        }
  315|    252|        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: 424]
  ------------------
  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: 424]
  ------------------
  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: 424]
  ------------------
  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: 424]
  ------------------
  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: 424]
  ------------------
  329|      0|    case BIO_CTRL_FLUSH:
  ------------------
  |  |   98|      0|# define BIO_CTRL_FLUSH          11/* opt - 'flush' buffered output */
  ------------------
  |  Branch (329:5): [True: 0, False: 424]
  ------------------
  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: 424]
  ------------------
  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: 424]
  ------------------
  334|      0|    default:
  ------------------
  |  Branch (334:5): [True: 0, False: 424]
  ------------------
  335|      0|        ret = 0;
  336|      0|        break;
  337|    424|    }
  338|    424|    return ret;
  339|    424|}
bss_mem.c:mem_buf_free:
  158|  3.75k|{
  159|  3.75k|    if (a == NULL)
  ------------------
  |  Branch (159:9): [True: 0, False: 3.75k]
  ------------------
  160|      0|        return 0;
  161|       |
  162|  3.75k|    if (a->shutdown && a->init && a->ptr != NULL) {
  ------------------
  |  Branch (162:9): [True: 3.75k, False: 0]
  |  Branch (162:24): [True: 3.75k, False: 0]
  |  Branch (162:35): [True: 3.75k, False: 0]
  ------------------
  163|  3.75k|        BIO_BUF_MEM *bb = (BIO_BUF_MEM *)a->ptr;
  164|  3.75k|        BUF_MEM *b = bb->buf;
  165|       |
  166|  3.75k|        if (a->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  236|  3.75k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (166:13): [True: 0, False: 3.75k]
  ------------------
  167|      0|            b->data = NULL;
  168|  3.75k|        BUF_MEM_free(b);
  169|  3.75k|    }
  170|  3.75k|    return 1;
  171|  3.75k|}
bss_mem.c:mem_new:
  133|  2.60k|{
  134|  2.60k|    return mem_init(bi, 0L);
  135|  2.60k|}
bss_mem.c:mem_init:
  110|  3.75k|{
  111|  3.75k|    BIO_BUF_MEM *bb = OPENSSL_zalloc(sizeof(*bb));
  ------------------
  |  |  104|  3.75k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.75k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.75k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  112|       |
  113|  3.75k|    if (bb == NULL)
  ------------------
  |  Branch (113:9): [True: 0, False: 3.75k]
  ------------------
  114|      0|        return 0;
  115|  3.75k|    if ((bb->buf = BUF_MEM_new_ex(flags)) == NULL) {
  ------------------
  |  Branch (115:9): [True: 0, False: 3.75k]
  ------------------
  116|      0|        OPENSSL_free(bb);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  117|      0|        return 0;
  118|      0|    }
  119|  3.75k|    if ((bb->readp = OPENSSL_zalloc(sizeof(*bb->readp))) == NULL) {
  ------------------
  |  |  104|  3.75k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.75k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.75k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (119:9): [True: 0, False: 3.75k]
  ------------------
  120|      0|        BUF_MEM_free(bb->buf);
  121|      0|        OPENSSL_free(bb);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  122|      0|        return 0;
  123|      0|    }
  124|  3.75k|    *bb->readp = *bb->buf;
  125|  3.75k|    bi->shutdown = 1;
  126|  3.75k|    bi->init = 1;
  127|  3.75k|    bi->num = -1;
  128|  3.75k|    bi->ptr = (char *)bb;
  129|  3.75k|    return 1;
  130|  3.75k|}
bss_mem.c:mem_free:
  143|  3.75k|{
  144|  3.75k|    BIO_BUF_MEM *bb;
  145|       |
  146|  3.75k|    if (a == NULL)
  ------------------
  |  Branch (146:9): [True: 0, False: 3.75k]
  ------------------
  147|      0|        return 0;
  148|       |
  149|  3.75k|    bb = (BIO_BUF_MEM *)a->ptr;
  150|  3.75k|    if (!mem_buf_free(a))
  ------------------
  |  Branch (150:9): [True: 0, False: 3.75k]
  ------------------
  151|      0|        return 0;
  152|  3.75k|    OPENSSL_free(bb->readp);
  ------------------
  |  |  115|  3.75k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.75k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.75k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  153|  3.75k|    OPENSSL_free(bb);
  ------------------
  |  |  115|  3.75k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.75k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.75k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  154|  3.75k|    return 1;
  155|  3.75k|}
bss_mem.c:secmem_new:
  138|  1.15k|{
  139|  1.15k|    return mem_init(bi, BUF_MEM_FLAG_SECURE);
  ------------------
  |  |   49|  1.15k|# define BUF_MEM_FLAG_SECURE  0x01
  ------------------
  140|  1.15k|}

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.75k|{
   23|  3.75k|    BUF_MEM *ret;
   24|       |
   25|  3.75k|    ret = BUF_MEM_new();
   26|  3.75k|    if (ret != NULL)
  ------------------
  |  Branch (26:9): [True: 3.75k, False: 0]
  ------------------
   27|  3.75k|        ret->flags = flags;
   28|  3.75k|    return ret;
   29|  3.75k|}
BUF_MEM_new:
   32|  3.75k|{
   33|  3.75k|    BUF_MEM *ret;
   34|       |
   35|  3.75k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  3.75k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.75k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.75k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   36|  3.75k|    if (ret == NULL)
  ------------------
  |  Branch (36:9): [True: 0, False: 3.75k]
  ------------------
   37|      0|        return NULL;
   38|  3.75k|    return ret;
   39|  3.75k|}
BUF_MEM_free:
   42|  3.75k|{
   43|  3.75k|    if (a == NULL)
  ------------------
  |  Branch (43:9): [True: 0, False: 3.75k]
  ------------------
   44|      0|        return;
   45|  3.75k|    if (a->data != NULL) {
  ------------------
  |  Branch (45:9): [True: 1.96k, False: 1.78k]
  ------------------
   46|  1.96k|        if (a->flags & BUF_MEM_FLAG_SECURE)
  ------------------
  |  |   49|  1.96k|# define BUF_MEM_FLAG_SECURE  0x01
  ------------------
  |  Branch (46:13): [True: 317, False: 1.65k]
  ------------------
   47|    317|            OPENSSL_secure_clear_free(a->data, a->max);
  ------------------
  |  |  129|    317|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    317|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    317|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   48|  1.65k|        else
   49|  1.65k|            OPENSSL_clear_free(a->data, a->max);
  ------------------
  |  |  113|  1.65k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.65k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.65k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   50|  1.96k|    }
   51|  3.75k|    OPENSSL_free(a);
  ------------------
  |  |  115|  3.75k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.75k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.75k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   52|  3.75k|}
BUF_MEM_grow_clean:
  108|   268k|{
  109|   268k|    char *ret;
  110|   268k|    size_t n;
  111|       |
  112|   268k|    if (str->length >= len) {
  ------------------
  |  Branch (112:9): [True: 0, False: 268k]
  ------------------
  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|   268k|    if (str->max >= len) {
  ------------------
  |  Branch (118:9): [True: 263k, False: 5.42k]
  ------------------
  119|   263k|        memset(&str->data[str->length], 0, len - str->length);
  120|   263k|        str->length = len;
  121|   263k|        return len;
  122|   263k|    }
  123|       |    /* This limit is sufficient to ensure (len+3)/3*4 < 2**31 */
  124|  5.42k|    if (len > LIMIT_BEFORE_EXPANSION) {
  ------------------
  |  |   19|  5.42k|#define LIMIT_BEFORE_EXPANSION 0x5ffffffc
  ------------------
  |  Branch (124:9): [True: 0, False: 5.42k]
  ------------------
  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  126|      0|        return 0;
  127|      0|    }
  128|  5.42k|    n = (len + 3) / 3 * 4;
  129|  5.42k|    if ((str->flags & BUF_MEM_FLAG_SECURE))
  ------------------
  |  |   49|  5.42k|# define BUF_MEM_FLAG_SECURE  0x01
  ------------------
  |  Branch (129:9): [True: 1.30k, False: 4.11k]
  ------------------
  130|  1.30k|        ret = sec_alloc_realloc(str, n);
  131|  4.11k|    else
  132|  4.11k|        ret = OPENSSL_clear_realloc(str->data, str->max, n);
  ------------------
  |  |  111|  4.11k|        CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  4.11k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  4.11k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  133|  5.42k|    if (ret == NULL) {
  ------------------
  |  Branch (133:9): [True: 0, False: 5.42k]
  ------------------
  134|      0|        len = 0;
  135|  5.42k|    } else {
  136|  5.42k|        str->data = ret;
  137|  5.42k|        str->max = n;
  138|  5.42k|        memset(&str->data[str->length], 0, len - str->length);
  139|  5.42k|        str->length = len;
  140|  5.42k|    }
  141|  5.42k|    return len;
  142|  5.42k|}
buffer.c:sec_alloc_realloc:
   57|  1.30k|{
   58|  1.30k|    char *ret;
   59|       |
   60|  1.30k|    ret = OPENSSL_secure_malloc(len);
  ------------------
  |  |  123|  1.30k|        CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.30k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.30k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|  1.30k|    if (str->data != NULL) {
  ------------------
  |  Branch (61:9): [True: 991, False: 317]
  ------------------
   62|    991|        if (ret != NULL) {
  ------------------
  |  Branch (62:13): [True: 991, False: 0]
  ------------------
   63|    991|            memcpy(ret, str->data, str->length);
   64|    991|            OPENSSL_secure_clear_free(str->data, str->length);
  ------------------
  |  |  129|    991|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    991|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    991|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   65|    991|            str->data = NULL;
   66|    991|        }
   67|    991|    }
   68|  1.30k|    return ret;
   69|  1.30k|}

ossl_err_load_CMP_strings:
  193|      2|{
  194|      2|# ifndef OPENSSL_NO_ERR
  195|      2|    if (ERR_reason_error_string(CMP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (195:9): [True: 2, False: 0]
  ------------------
  196|      2|        ERR_load_strings_const(CMP_str_reasons);
  197|      2|# endif
  198|      2|    return 1;
  199|      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:
  173|      2|{
  174|      2|# ifndef OPENSSL_NO_ERR
  175|      2|    if (ERR_reason_error_string(CMS_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (175:9): [True: 2, False: 0]
  ------------------
  176|      2|        ERR_load_strings_const(CMS_str_reasons);
  177|      2|# endif
  178|      2|    return 1;
  179|      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)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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:
  417|      2|{
  418|      2|    if (!default_context_inited)
  ------------------
  |  Branch (418:9): [True: 0, False: 2]
  ------------------
  419|      0|        return;
  420|      2|    context_deinit(&default_context_int);
  421|      2|    CRYPTO_THREAD_cleanup_local(&default_context_thread_local);
  422|      2|    default_context_inited = 0;
  423|      2|}
ossl_lib_ctx_get_concrete:
  548|  7.53k|{
  549|  7.53k|#ifndef FIPS_MODULE
  550|  7.53k|    if (ctx == NULL)
  ------------------
  |  Branch (550:9): [True: 7.51k, False: 20]
  ------------------
  551|  7.51k|        return get_default_context();
  552|     20|#endif
  553|     20|    return ctx;
  554|  7.53k|}
ossl_lib_ctx_get_data:
  575|     16|{
  576|     16|    void *p;
  577|       |
  578|     16|    ctx = ossl_lib_ctx_get_concrete(ctx);
  579|     16|    if (ctx == NULL)
  ------------------
  |  Branch (579:9): [True: 0, False: 16]
  ------------------
  580|      0|        return NULL;
  581|       |
  582|     16|    switch (index) {
  583|     16|    case OSSL_LIB_CTX_PROPERTY_STRING_INDEX:
  ------------------
  |  |   99|     16|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  |  Branch (583:5): [True: 16, False: 0]
  ------------------
  584|     16|        return ctx->property_string_data;
  585|      0|    case OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX:
  ------------------
  |  |   96|      0|# define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX         0
  ------------------
  |  Branch (585:5): [True: 0, False: 16]
  ------------------
  586|      0|        return ctx->evp_method_store;
  587|      0|    case OSSL_LIB_CTX_PROVIDER_STORE_INDEX:
  ------------------
  |  |   97|      0|# define OSSL_LIB_CTX_PROVIDER_STORE_INDEX           1
  ------------------
  |  Branch (587:5): [True: 0, False: 16]
  ------------------
  588|      0|        return ctx->provider_store;
  589|      0|    case OSSL_LIB_CTX_NAMEMAP_INDEX:
  ------------------
  |  |  100|      0|# define OSSL_LIB_CTX_NAMEMAP_INDEX                  4
  ------------------
  |  Branch (589:5): [True: 0, False: 16]
  ------------------
  590|      0|        return ctx->namemap;
  591|      0|    case OSSL_LIB_CTX_PROPERTY_DEFN_INDEX:
  ------------------
  |  |   98|      0|# define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX            2
  ------------------
  |  Branch (591:5): [True: 0, False: 16]
  ------------------
  592|      0|        return ctx->property_defns;
  593|      0|    case OSSL_LIB_CTX_GLOBAL_PROPERTIES:
  ------------------
  |  |  112|      0|# define OSSL_LIB_CTX_GLOBAL_PROPERTIES             14
  ------------------
  |  Branch (593:5): [True: 0, False: 16]
  ------------------
  594|      0|        return ctx->global_properties;
  595|      0|    case OSSL_LIB_CTX_DRBG_INDEX:
  ------------------
  |  |  101|      0|# define OSSL_LIB_CTX_DRBG_INDEX                     5
  ------------------
  |  Branch (595:5): [True: 0, False: 16]
  ------------------
  596|      0|        return ctx->drbg;
  597|      0|    case OSSL_LIB_CTX_DRBG_NONCE_INDEX:
  ------------------
  |  |  102|      0|# define OSSL_LIB_CTX_DRBG_NONCE_INDEX               6
  ------------------
  |  Branch (597:5): [True: 0, False: 16]
  ------------------
  598|      0|        return ctx->drbg_nonce;
  599|      0|#ifndef FIPS_MODULE
  600|      0|    case OSSL_LIB_CTX_PROVIDER_CONF_INDEX:
  ------------------
  |  |  114|      0|# define OSSL_LIB_CTX_PROVIDER_CONF_INDEX           16
  ------------------
  |  Branch (600:5): [True: 0, False: 16]
  ------------------
  601|      0|        return ctx->provider_conf;
  602|      0|    case OSSL_LIB_CTX_BIO_CORE_INDEX:
  ------------------
  |  |  115|      0|# define OSSL_LIB_CTX_BIO_CORE_INDEX                17
  ------------------
  |  Branch (602:5): [True: 0, False: 16]
  ------------------
  603|      0|        return ctx->bio_core;
  604|      0|    case OSSL_LIB_CTX_CHILD_PROVIDER_INDEX:
  ------------------
  |  |  116|      0|# define OSSL_LIB_CTX_CHILD_PROVIDER_INDEX          18
  ------------------
  |  Branch (604:5): [True: 0, False: 16]
  ------------------
  605|      0|        return ctx->child_provider;
  606|      0|    case OSSL_LIB_CTX_DECODER_STORE_INDEX:
  ------------------
  |  |  109|      0|# define OSSL_LIB_CTX_DECODER_STORE_INDEX           11
  ------------------
  |  Branch (606:5): [True: 0, False: 16]
  ------------------
  607|      0|        return ctx->decoder_store;
  608|      0|    case OSSL_LIB_CTX_DECODER_CACHE_INDEX:
  ------------------
  |  |  118|      0|# define OSSL_LIB_CTX_DECODER_CACHE_INDEX           20
  ------------------
  |  Branch (608:5): [True: 0, False: 16]
  ------------------
  609|      0|        return ctx->decoder_cache;
  610|      0|    case OSSL_LIB_CTX_ENCODER_STORE_INDEX:
  ------------------
  |  |  108|      0|# define OSSL_LIB_CTX_ENCODER_STORE_INDEX           10
  ------------------
  |  Branch (610:5): [True: 0, False: 16]
  ------------------
  611|      0|        return ctx->encoder_store;
  612|      0|    case OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX:
  ------------------
  |  |  113|      0|# define OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX      15
  ------------------
  |  Branch (612:5): [True: 0, False: 16]
  ------------------
  613|      0|        return ctx->store_loader_store;
  614|      0|    case OSSL_LIB_CTX_SELF_TEST_CB_INDEX:
  ------------------
  |  |  110|      0|# define OSSL_LIB_CTX_SELF_TEST_CB_INDEX            12
  ------------------
  |  Branch (614:5): [True: 0, False: 16]
  ------------------
  615|      0|        return ctx->self_test_cb;
  616|      0|    case OSSL_LIB_CTX_INDICATOR_CB_INDEX:
  ------------------
  |  |  120|      0|# define OSSL_LIB_CTX_INDICATOR_CB_INDEX            22
  ------------------
  |  Branch (616:5): [True: 0, False: 16]
  ------------------
  617|      0|        return ctx->indicator_cb;
  618|      0|#endif
  619|      0|#ifndef OPENSSL_NO_THREAD_POOL
  620|      0|    case OSSL_LIB_CTX_THREAD_INDEX:
  ------------------
  |  |  117|      0|# define OSSL_LIB_CTX_THREAD_INDEX                  19
  ------------------
  |  Branch (620:5): [True: 0, False: 16]
  ------------------
  621|      0|        return ctx->threads;
  622|      0|#endif
  623|       |
  624|      0|    case OSSL_LIB_CTX_RAND_CRNGT_INDEX: {
  ------------------
  |  |  103|      0|# define OSSL_LIB_CTX_RAND_CRNGT_INDEX               7
  ------------------
  |  Branch (624:5): [True: 0, False: 16]
  ------------------
  625|       |
  626|       |        /*
  627|       |         * rand_crngt must be lazily initialized because it calls into
  628|       |         * libctx, so must not be called from context_init, else a deadlock
  629|       |         * will occur.
  630|       |         *
  631|       |         * We use a separate lock because code called by the instantiation
  632|       |         * of rand_crngt is liable to try and take the libctx lock.
  633|       |         */
  634|      0|        if (CRYPTO_THREAD_read_lock(ctx->rand_crngt_lock) != 1)
  ------------------
  |  Branch (634:13): [True: 0, False: 0]
  ------------------
  635|      0|            return NULL;
  636|       |
  637|      0|        if (ctx->rand_crngt == NULL) {
  ------------------
  |  Branch (637:13): [True: 0, False: 0]
  ------------------
  638|      0|            CRYPTO_THREAD_unlock(ctx->rand_crngt_lock);
  639|       |
  640|      0|            if (CRYPTO_THREAD_write_lock(ctx->rand_crngt_lock) != 1)
  ------------------
  |  Branch (640:17): [True: 0, False: 0]
  ------------------
  641|      0|                return NULL;
  642|       |
  643|      0|            if (ctx->rand_crngt == NULL)
  ------------------
  |  Branch (643:17): [True: 0, False: 0]
  ------------------
  644|      0|                ctx->rand_crngt = ossl_rand_crng_ctx_new(ctx);
  645|      0|        }
  646|       |
  647|      0|        p = ctx->rand_crngt;
  648|       |
  649|      0|        CRYPTO_THREAD_unlock(ctx->rand_crngt_lock);
  650|       |
  651|      0|        return p;
  652|      0|    }
  653|       |
  654|       |#ifdef FIPS_MODULE
  655|       |    case OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX:
  656|       |        return ctx->thread_event_handler;
  657|       |
  658|       |    case OSSL_LIB_CTX_FIPS_PROV_INDEX:
  659|       |        return ctx->fips_prov;
  660|       |#endif
  661|       |
  662|      0|    case OSSL_LIB_CTX_COMP_METHODS:
  ------------------
  |  |  119|      0|# define OSSL_LIB_CTX_COMP_METHODS                  21
  ------------------
  |  Branch (662:5): [True: 0, False: 16]
  ------------------
  663|      0|        return (void *)&ctx->comp_methods;
  664|       |
  665|      0|    default:
  ------------------
  |  Branch (665:5): [True: 0, False: 16]
  ------------------
  666|      0|        return NULL;
  667|     16|    }
  668|     16|}
ossl_lib_ctx_get_ex_data_global:
  676|  7.52k|{
  677|  7.52k|    ctx = ossl_lib_ctx_get_concrete(ctx);
  678|  7.52k|    if (ctx == NULL)
  ------------------
  |  Branch (678:9): [True: 0, False: 7.52k]
  ------------------
  679|      0|        return NULL;
  680|  7.52k|    return &ctx->global;
  681|  7.52k|}
context.c:context_deinit:
  373|      2|{
  374|      2|    if (ctx == NULL)
  ------------------
  |  Branch (374:9): [True: 0, False: 2]
  ------------------
  375|      0|        return 1;
  376|       |
  377|      2|    ossl_ctx_thread_stop(ctx);
  378|       |
  379|      2|    context_deinit_objs(ctx);
  380|       |
  381|      2|    ossl_crypto_cleanup_all_ex_data_int(ctx);
  382|       |
  383|      2|    CRYPTO_THREAD_lock_free(ctx->rand_crngt_lock);
  384|      2|    CRYPTO_THREAD_lock_free(ctx->lock);
  385|      2|    ctx->rand_crngt_lock = NULL;
  386|      2|    ctx->lock = NULL;
  387|      2|    CRYPTO_THREAD_cleanup_local(&ctx->rcu_local_key);
  388|      2|    return 1;
  389|      2|}
context.c:context_deinit_objs:
  233|      2|{
  234|       |    /* P2. We want evp_method_store to be cleaned up before the provider store */
  235|      2|    if (ctx->evp_method_store != NULL) {
  ------------------
  |  Branch (235:9): [True: 2, False: 0]
  ------------------
  236|      2|        ossl_method_store_free(ctx->evp_method_store);
  237|      2|        ctx->evp_method_store = NULL;
  238|      2|    }
  239|       |
  240|       |    /* P2. */
  241|      2|    if (ctx->drbg != NULL) {
  ------------------
  |  Branch (241:9): [True: 2, False: 0]
  ------------------
  242|      2|        ossl_rand_ctx_free(ctx->drbg);
  243|      2|        ctx->drbg = NULL;
  244|      2|    }
  245|       |
  246|      2|#ifndef FIPS_MODULE
  247|       |    /* P2. */
  248|      2|    if (ctx->provider_conf != NULL) {
  ------------------
  |  Branch (248:9): [True: 2, False: 0]
  ------------------
  249|      2|        ossl_prov_conf_ctx_free(ctx->provider_conf);
  250|      2|        ctx->provider_conf = NULL;
  251|      2|    }
  252|       |
  253|       |    /*
  254|       |     * P2. We want decoder_store/decoder_cache to be cleaned up before the
  255|       |     * provider store
  256|       |     */
  257|      2|    if (ctx->decoder_store != NULL) {
  ------------------
  |  Branch (257:9): [True: 2, False: 0]
  ------------------
  258|      2|        ossl_method_store_free(ctx->decoder_store);
  259|      2|        ctx->decoder_store = NULL;
  260|      2|    }
  261|      2|    if (ctx->decoder_cache != NULL) {
  ------------------
  |  Branch (261:9): [True: 2, False: 0]
  ------------------
  262|      2|        ossl_decoder_cache_free(ctx->decoder_cache);
  263|      2|        ctx->decoder_cache = NULL;
  264|      2|    }
  265|       |
  266|       |
  267|       |    /* P2. We want encoder_store to be cleaned up before the provider store */
  268|      2|    if (ctx->encoder_store != NULL) {
  ------------------
  |  Branch (268:9): [True: 2, False: 0]
  ------------------
  269|      2|        ossl_method_store_free(ctx->encoder_store);
  270|      2|        ctx->encoder_store = NULL;
  271|      2|    }
  272|       |
  273|       |    /* P2. We want loader_store to be cleaned up before the provider store */
  274|      2|    if (ctx->store_loader_store != NULL) {
  ------------------
  |  Branch (274:9): [True: 2, False: 0]
  ------------------
  275|      2|        ossl_method_store_free(ctx->store_loader_store);
  276|      2|        ctx->store_loader_store = NULL;
  277|      2|    }
  278|      2|#endif
  279|       |
  280|       |    /* P1. Needs to be freed before the child provider data is freed */
  281|      2|    if (ctx->provider_store != NULL) {
  ------------------
  |  Branch (281:9): [True: 2, False: 0]
  ------------------
  282|      2|        ossl_provider_store_free(ctx->provider_store);
  283|      2|        ctx->provider_store = NULL;
  284|      2|    }
  285|       |
  286|       |    /* Default priority. */
  287|      2|    if (ctx->property_string_data != NULL) {
  ------------------
  |  Branch (287:9): [True: 2, False: 0]
  ------------------
  288|      2|        ossl_property_string_data_free(ctx->property_string_data);
  289|      2|        ctx->property_string_data = NULL;
  290|      2|    }
  291|       |
  292|      2|    if (ctx->namemap != NULL) {
  ------------------
  |  Branch (292:9): [True: 2, False: 0]
  ------------------
  293|      2|        ossl_stored_namemap_free(ctx->namemap);
  294|      2|        ctx->namemap = NULL;
  295|      2|    }
  296|       |
  297|      2|    if (ctx->property_defns != NULL) {
  ------------------
  |  Branch (297:9): [True: 2, False: 0]
  ------------------
  298|      2|        ossl_property_defns_free(ctx->property_defns);
  299|      2|        ctx->property_defns = NULL;
  300|      2|    }
  301|       |
  302|      2|    if (ctx->global_properties != NULL) {
  ------------------
  |  Branch (302:9): [True: 2, False: 0]
  ------------------
  303|      2|        ossl_ctx_global_properties_free(ctx->global_properties);
  304|      2|        ctx->global_properties = NULL;
  305|      2|    }
  306|       |
  307|      2|#ifndef FIPS_MODULE
  308|      2|    if (ctx->bio_core != NULL) {
  ------------------
  |  Branch (308:9): [True: 2, False: 0]
  ------------------
  309|      2|        ossl_bio_core_globals_free(ctx->bio_core);
  310|      2|        ctx->bio_core = NULL;
  311|      2|    }
  312|      2|#endif
  313|       |
  314|      2|    if (ctx->drbg_nonce != NULL) {
  ------------------
  |  Branch (314:9): [True: 2, False: 0]
  ------------------
  315|      2|        ossl_prov_drbg_nonce_ctx_free(ctx->drbg_nonce);
  316|      2|        ctx->drbg_nonce = NULL;
  317|      2|    }
  318|       |
  319|      2|#ifndef FIPS_MODULE
  320|      2|    if (ctx->indicator_cb != NULL) {
  ------------------
  |  Branch (320:9): [True: 2, False: 0]
  ------------------
  321|      2|        ossl_indicator_set_callback_free(ctx->indicator_cb);
  322|      2|        ctx->indicator_cb = NULL;
  323|      2|    }
  324|       |
  325|      2|    if (ctx->self_test_cb != NULL) {
  ------------------
  |  Branch (325:9): [True: 2, False: 0]
  ------------------
  326|      2|        ossl_self_test_set_callback_free(ctx->self_test_cb);
  327|      2|        ctx->self_test_cb = NULL;
  328|      2|    }
  329|      2|#endif
  330|       |
  331|      2|    if (ctx->rand_crngt != NULL) {
  ------------------
  |  Branch (331:9): [True: 0, False: 2]
  ------------------
  332|      0|        ossl_rand_crng_ctx_free(ctx->rand_crngt);
  333|      0|        ctx->rand_crngt = NULL;
  334|      0|    }
  335|       |
  336|       |#ifdef FIPS_MODULE
  337|       |    if (ctx->thread_event_handler != NULL) {
  338|       |        ossl_thread_event_ctx_free(ctx->thread_event_handler);
  339|       |        ctx->thread_event_handler = NULL;
  340|       |    }
  341|       |
  342|       |    if (ctx->fips_prov != NULL) {
  343|       |        ossl_fips_prov_ossl_ctx_free(ctx->fips_prov);
  344|       |        ctx->fips_prov = NULL;
  345|       |    }
  346|       |#endif
  347|       |
  348|      2|#ifndef OPENSSL_NO_THREAD_POOL
  349|      2|    if (ctx->threads != NULL) {
  ------------------
  |  Branch (349:9): [True: 2, False: 0]
  ------------------
  350|      2|        ossl_threads_ctx_free(ctx->threads);
  351|      2|        ctx->threads = NULL;
  352|      2|    }
  353|      2|#endif
  354|       |
  355|       |    /* Low priority. */
  356|      2|#ifndef FIPS_MODULE
  357|      2|    if (ctx->child_provider != NULL) {
  ------------------
  |  Branch (357:9): [True: 2, False: 0]
  ------------------
  358|      2|        ossl_child_prov_ctx_free(ctx->child_provider);
  359|      2|        ctx->child_provider = NULL;
  360|      2|    }
  361|      2|#endif
  362|       |
  363|      2|#ifndef FIPS_MODULE
  364|      2|    if (ctx->comp_methods != NULL) {
  ------------------
  |  Branch (364:9): [True: 2, False: 0]
  ------------------
  365|      2|        ossl_free_compression_methods_int(ctx->comp_methods);
  366|      2|        ctx->comp_methods = NULL;
  367|      2|    }
  368|      2|#endif
  369|       |
  370|      2|}
context.c:context_init:
   86|      2|{
   87|      2|    int exdata_done = 0;
   88|       |
   89|      2|    if (!CRYPTO_THREAD_init_local(&ctx->rcu_local_key, NULL))
  ------------------
  |  Branch (89:9): [True: 0, False: 2]
  ------------------
   90|      0|        return 0;
   91|       |
   92|      2|    ctx->lock = CRYPTO_THREAD_lock_new();
   93|      2|    if (ctx->lock == NULL)
  ------------------
  |  Branch (93:9): [True: 0, False: 2]
  ------------------
   94|      0|        goto err;
   95|       |
   96|      2|    ctx->rand_crngt_lock = CRYPTO_THREAD_lock_new();
   97|      2|    if (ctx->rand_crngt_lock == NULL)
  ------------------
  |  Branch (97:9): [True: 0, False: 2]
  ------------------
   98|      0|        goto err;
   99|       |
  100|       |    /* Initialize ex_data. */
  101|      2|    if (!ossl_do_ex_data_init(ctx))
  ------------------
  |  Branch (101:9): [True: 0, False: 2]
  ------------------
  102|      0|        goto err;
  103|      2|    exdata_done = 1;
  104|       |
  105|       |    /* P2. We want evp_method_store to be cleaned up before the provider store */
  106|      2|    ctx->evp_method_store = ossl_method_store_new(ctx);
  107|      2|    if (ctx->evp_method_store == NULL)
  ------------------
  |  Branch (107:9): [True: 0, False: 2]
  ------------------
  108|      0|        goto err;
  109|       |
  110|      2|#ifndef FIPS_MODULE
  111|       |    /* P2. Must be freed before the provider store is freed */
  112|      2|    ctx->provider_conf = ossl_prov_conf_ctx_new(ctx);
  113|      2|    if (ctx->provider_conf == NULL)
  ------------------
  |  Branch (113:9): [True: 0, False: 2]
  ------------------
  114|      0|        goto err;
  115|      2|#endif
  116|       |
  117|       |    /* P2. */
  118|      2|    ctx->drbg = ossl_rand_ctx_new(ctx);
  119|      2|    if (ctx->drbg == NULL)
  ------------------
  |  Branch (119:9): [True: 0, False: 2]
  ------------------
  120|      0|        goto err;
  121|       |
  122|      2|#ifndef FIPS_MODULE
  123|       |    /*
  124|       |     * P2. We want decoder_store/decoder_cache to be cleaned up before the
  125|       |     * provider store
  126|       |     */
  127|      2|    ctx->decoder_store = ossl_method_store_new(ctx);
  128|      2|    if (ctx->decoder_store == NULL)
  ------------------
  |  Branch (128:9): [True: 0, False: 2]
  ------------------
  129|      0|        goto err;
  130|      2|    ctx->decoder_cache = ossl_decoder_cache_new(ctx);
  131|      2|    if (ctx->decoder_cache == NULL)
  ------------------
  |  Branch (131:9): [True: 0, False: 2]
  ------------------
  132|      0|        goto err;
  133|       |
  134|       |    /* P2. We want encoder_store to be cleaned up before the provider store */
  135|      2|    ctx->encoder_store = ossl_method_store_new(ctx);
  136|      2|    if (ctx->encoder_store == NULL)
  ------------------
  |  Branch (136:9): [True: 0, False: 2]
  ------------------
  137|      0|        goto err;
  138|       |
  139|       |    /* P2. We want loader_store to be cleaned up before the provider store */
  140|      2|    ctx->store_loader_store = ossl_method_store_new(ctx);
  141|      2|    if (ctx->store_loader_store == NULL)
  ------------------
  |  Branch (141:9): [True: 0, False: 2]
  ------------------
  142|      0|        goto err;
  143|      2|#endif
  144|       |
  145|       |    /* P1. Needs to be freed before the child provider data is freed */
  146|      2|    ctx->provider_store = ossl_provider_store_new(ctx);
  147|      2|    if (ctx->provider_store == NULL)
  ------------------
  |  Branch (147:9): [True: 0, False: 2]
  ------------------
  148|      0|        goto err;
  149|       |
  150|       |    /* Default priority. */
  151|      2|    ctx->property_string_data = ossl_property_string_data_new(ctx);
  152|      2|    if (ctx->property_string_data == NULL)
  ------------------
  |  Branch (152:9): [True: 0, False: 2]
  ------------------
  153|      0|        goto err;
  154|       |
  155|      2|    ctx->namemap = ossl_stored_namemap_new(ctx);
  156|      2|    if (ctx->namemap == NULL)
  ------------------
  |  Branch (156:9): [True: 0, False: 2]
  ------------------
  157|      0|        goto err;
  158|       |
  159|      2|    ctx->property_defns = ossl_property_defns_new(ctx);
  160|      2|    if (ctx->property_defns == NULL)
  ------------------
  |  Branch (160:9): [True: 0, False: 2]
  ------------------
  161|      0|        goto err;
  162|       |
  163|      2|    ctx->global_properties = ossl_ctx_global_properties_new(ctx);
  164|      2|    if (ctx->global_properties == NULL)
  ------------------
  |  Branch (164:9): [True: 0, False: 2]
  ------------------
  165|      0|        goto err;
  166|       |
  167|      2|#ifndef FIPS_MODULE
  168|      2|    ctx->bio_core = ossl_bio_core_globals_new(ctx);
  169|      2|    if (ctx->bio_core == NULL)
  ------------------
  |  Branch (169:9): [True: 0, False: 2]
  ------------------
  170|      0|        goto err;
  171|      2|#endif
  172|       |
  173|      2|    ctx->drbg_nonce = ossl_prov_drbg_nonce_ctx_new(ctx);
  174|      2|    if (ctx->drbg_nonce == NULL)
  ------------------
  |  Branch (174:9): [True: 0, False: 2]
  ------------------
  175|      0|        goto err;
  176|       |
  177|      2|#ifndef FIPS_MODULE
  178|      2|    ctx->self_test_cb = ossl_self_test_set_callback_new(ctx);
  179|      2|    if (ctx->self_test_cb == NULL)
  ------------------
  |  Branch (179:9): [True: 0, False: 2]
  ------------------
  180|      0|        goto err;
  181|      2|    ctx->indicator_cb = ossl_indicator_set_callback_new(ctx);
  182|      2|    if (ctx->indicator_cb == NULL)
  ------------------
  |  Branch (182:9): [True: 0, False: 2]
  ------------------
  183|      0|        goto err;
  184|      2|#endif
  185|       |
  186|       |#ifdef FIPS_MODULE
  187|       |    ctx->thread_event_handler = ossl_thread_event_ctx_new(ctx);
  188|       |    if (ctx->thread_event_handler == NULL)
  189|       |        goto err;
  190|       |
  191|       |    ctx->fips_prov = ossl_fips_prov_ossl_ctx_new(ctx);
  192|       |    if (ctx->fips_prov == NULL)
  193|       |        goto err;
  194|       |#endif
  195|       |
  196|      2|#ifndef OPENSSL_NO_THREAD_POOL
  197|      2|    ctx->threads = ossl_threads_ctx_new(ctx);
  198|      2|    if (ctx->threads == NULL)
  ------------------
  |  Branch (198:9): [True: 0, False: 2]
  ------------------
  199|      0|        goto err;
  200|      2|#endif
  201|       |
  202|       |    /* Low priority. */
  203|      2|#ifndef FIPS_MODULE
  204|      2|    ctx->child_provider = ossl_child_prov_ctx_new(ctx);
  205|      2|    if (ctx->child_provider == NULL)
  ------------------
  |  Branch (205:9): [True: 0, False: 2]
  ------------------
  206|      0|        goto err;
  207|      2|#endif
  208|       |
  209|       |    /* Everything depends on properties, so we also pre-initialise that */
  210|      2|    if (!ossl_property_parse_init(ctx))
  ------------------
  |  Branch (210:9): [True: 0, False: 2]
  ------------------
  211|      0|        goto err;
  212|       |
  213|      2|#ifndef FIPS_MODULE
  214|      2|    ctx->comp_methods = ossl_load_builtin_compressions();
  215|      2|#endif
  216|       |
  217|      2|    return 1;
  218|       |
  219|      0| err:
  220|      0|    context_deinit_objs(ctx);
  221|       |
  222|      0|    if (exdata_done)
  ------------------
  |  Branch (222:9): [True: 0, False: 0]
  ------------------
  223|      0|        ossl_crypto_cleanup_all_ex_data_int(ctx);
  224|       |
  225|      0|    CRYPTO_THREAD_lock_free(ctx->rand_crngt_lock);
  226|      0|    CRYPTO_THREAD_lock_free(ctx->lock);
  227|      0|    CRYPTO_THREAD_cleanup_local(&ctx->rcu_local_key);
  228|      0|    memset(ctx, '\0', sizeof(*ctx));
  229|      0|    return 0;
  230|      2|}
context.c:default_context_do_init:
  400|      2|{
  401|      2|    if (!CRYPTO_THREAD_init_local(&default_context_thread_local, NULL))
  ------------------
  |  Branch (401:9): [True: 0, False: 2]
  ------------------
  402|      0|        goto err;
  403|       |
  404|      2|    if (!context_init(&default_context_int))
  ------------------
  |  Branch (404:9): [True: 0, False: 2]
  ------------------
  405|      0|        goto deinit_thread;
  406|       |
  407|      2|    default_context_inited = 1;
  408|      2|    return 1;
  409|       |
  410|      0|deinit_thread:
  411|      0|    CRYPTO_THREAD_cleanup_local(&default_context_thread_local);
  412|      0|err:
  413|      0|    return 0;
  414|      0|}
context.c:get_default_context:
  434|  7.51k|{
  435|  7.51k|    OSSL_LIB_CTX *current_defctx = get_thread_default_context();
  436|       |
  437|  7.51k|    if (current_defctx == NULL)
  ------------------
  |  Branch (437:9): [True: 7.51k, False: 0]
  ------------------
  438|  7.51k|        current_defctx = &default_context_int;
  439|  7.51k|    return current_defctx;
  440|  7.51k|}
context.c:get_thread_default_context:
  426|  7.51k|{
  427|  7.51k|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|  7.51k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 7.51k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (427:9): [True: 0, False: 7.51k]
  ------------------
  428|      0|        return NULL;
  429|       |
  430|  7.51k|    return CRYPTO_THREAD_get_local(&default_context_thread_local);
  431|  7.51k|}

ossl_stored_namemap_new:
   65|      2|{
   66|      2|    OSSL_NAMEMAP *namemap = ossl_namemap_new();
   67|       |
   68|      2|    if (namemap != NULL)
  ------------------
  |  Branch (68:9): [True: 2, False: 0]
  ------------------
   69|      2|        namemap->stored = 1;
   70|       |
   71|      2|    return namemap;
   72|      2|}
ossl_stored_namemap_free:
   75|      2|{
   76|      2|    OSSL_NAMEMAP *namemap = vnamemap;
   77|       |
   78|      2|    if (namemap != NULL) {
  ------------------
  |  Branch (78:9): [True: 2, False: 0]
  ------------------
   79|       |        /* Pretend it isn't stored, or ossl_namemap_free() will do nothing */
   80|      2|        namemap->stored = 0;
   81|      2|        ossl_namemap_free(namemap);
   82|      2|    }
   83|      2|}
ossl_namemap_new:
  512|      2|{
  513|      2|    OSSL_NAMEMAP *namemap;
  514|       |
  515|      2|    if ((namemap = OPENSSL_zalloc(sizeof(*namemap))) != NULL
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (515:9): [True: 2, False: 0]
  ------------------
  516|      2|        && (namemap->lock = CRYPTO_THREAD_lock_new()) != NULL
  ------------------
  |  Branch (516:12): [True: 2, False: 0]
  ------------------
  517|      2|        && (namemap->namenum =
  ------------------
  |  Branch (517:12): [True: 2, False: 0]
  ------------------
  518|      2|            lh_NAMENUM_ENTRY_new(namenum_hash, namenum_cmp)) != NULL)
  519|      2|        return namemap;
  520|       |
  521|      0|    ossl_namemap_free(namemap);
  522|      0|    return NULL;
  523|      2|}
ossl_namemap_free:
  526|      2|{
  527|      2|    if (namemap == NULL || namemap->stored)
  ------------------
  |  Branch (527:9): [True: 0, False: 2]
  |  Branch (527:28): [True: 0, False: 2]
  ------------------
  528|      0|        return;
  529|       |
  530|      2|    lh_NAMENUM_ENTRY_doall(namemap->namenum, namenum_free);
  531|      2|    lh_NAMENUM_ENTRY_free(namemap->namenum);
  532|       |
  533|      2|    CRYPTO_THREAD_lock_free(namemap->lock);
  534|      2|    OPENSSL_free(namemap);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  535|      2|}

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

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

ossl_err_load_CRMF_strings:
   65|      2|{
   66|      2|# ifndef OPENSSL_NO_ERR
   67|      2|    if (ERR_reason_error_string(CRMF_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (67:9): [True: 2, False: 0]
  ------------------
   68|      2|        ERR_load_strings_const(CRMF_str_reasons);
   69|      2|# endif
   70|      2|    return 1;
   71|      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|  31.2M|{
  254|  31.2M|    const int max = sizeof(ctype_char_map) / sizeof(*ctype_char_map);
  255|  31.2M|    const int a = ossl_toascii(c);
  ------------------
  |  |   56|  31.2M|#  define ossl_toascii(c)       (c)
  ------------------
  256|       |
  257|  31.2M|    return a >= 0 && a < max && (ctype_char_map[a] & mask) != 0;
  ------------------
  |  Branch (257:12): [True: 27.3M, False: 3.92M]
  |  Branch (257:22): [True: 27.3M, False: 0]
  |  Branch (257:33): [True: 19.2M, False: 8.13M]
  ------------------
  258|  31.2M|}

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:
  683|      2|{
  684|      2|    DECODER_CACHE *cache = OPENSSL_malloc(sizeof(*cache));
  ------------------
  |  |  102|      2|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  685|       |
  686|      2|    if (cache == NULL)
  ------------------
  |  Branch (686:9): [True: 0, False: 2]
  ------------------
  687|      0|        return NULL;
  688|       |
  689|      2|    cache->lock = CRYPTO_THREAD_lock_new();
  690|      2|    if (cache->lock == NULL) {
  ------------------
  |  Branch (690:9): [True: 0, False: 2]
  ------------------
  691|      0|        OPENSSL_free(cache);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  692|      0|        return NULL;
  693|      0|    }
  694|      2|    cache->hashtable = lh_DECODER_CACHE_ENTRY_new(decoder_cache_entry_hash,
  695|      2|                                                  decoder_cache_entry_cmp);
  696|      2|    if (cache->hashtable == NULL) {
  ------------------
  |  Branch (696:9): [True: 0, False: 2]
  ------------------
  697|      0|        CRYPTO_THREAD_lock_free(cache->lock);
  698|      0|        OPENSSL_free(cache);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  699|      0|        return NULL;
  700|      0|    }
  701|       |
  702|      2|    return cache;
  703|      2|}
ossl_decoder_cache_free:
  706|      2|{
  707|      2|    DECODER_CACHE *cache = (DECODER_CACHE *)vcache;
  708|       |
  709|      2|    lh_DECODER_CACHE_ENTRY_doall(cache->hashtable, decoder_cache_entry_free);
  710|      2|    lh_DECODER_CACHE_ENTRY_free(cache->hashtable);
  711|      2|    CRYPTO_THREAD_lock_free(cache->lock);
  712|      2|    OPENSSL_free(cache);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  713|      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);
  ------------------
  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  ------------------
                  CRYPTO_free(state, OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  292|      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.25k|{
  336|  1.25k|    int i;
  337|  1.25k|    ERR_STATE *es;
  338|       |
  339|  1.25k|    es = ossl_err_get_state_int();
  340|  1.25k|    if (es == NULL)
  ------------------
  |  Branch (340:9): [True: 0, False: 1.25k]
  ------------------
  341|      0|        return;
  342|       |
  343|  21.3k|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   55|  21.3k|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (343:17): [True: 20.1k, False: 1.25k]
  ------------------
  344|  20.1k|        err_clear(es, i, 0);
  345|  20.1k|    }
  346|  1.25k|    es->top = es->bottom = 0;
  347|  1.25k|}
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.47k|{
  674|  4.47k|    ERR_STATE *state;
  675|  4.47k|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|  4.47k|# define get_last_sys_error()    errno
  ------------------
  676|       |
  677|  4.47k|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|  4.47k|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (677:9): [True: 0, False: 4.47k]
  ------------------
  678|      0|        return NULL;
  679|       |
  680|  4.47k|    if (!RUN_ONCE(&err_init, err_do_init))
  ------------------
  |  |  130|  4.47k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 4.47k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (680:9): [True: 0, False: 4.47k]
  ------------------
  681|      0|        return NULL;
  682|       |
  683|  4.47k|    state = CRYPTO_THREAD_get_local(&err_thread_local);
  684|  4.47k|    if (state == (ERR_STATE*)-1)
  ------------------
  |  Branch (684:9): [True: 0, False: 4.47k]
  ------------------
  685|      0|        return NULL;
  686|       |
  687|  4.47k|    if (state == NULL) {
  ------------------
  |  Branch (687:9): [True: 2, False: 4.47k]
  ------------------
  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);
  ------------------
  |  |  463|      2|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
  706|      2|    }
  707|       |
  708|  4.47k|    set_sys_error(saveerrno);
  ------------------
  |  |   32|  4.47k|# define set_sys_error(e)        errno=(e)
  ------------------
  709|  4.47k|    return state;
  710|  4.47k|}
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.67k|{
  173|  8.67k|    unsigned long ret, l;
  174|       |
  175|  8.67k|    l = a->error;
  176|  8.67k|    ret = l ^ ERR_GET_LIB(l);
  177|  8.67k|    return (ret ^ ret % 19 * 13);
  178|  8.67k|}
err.c:err_string_data_cmp:
  182|  5.88k|{
  183|  5.88k|    if (a->error == b->error)
  ------------------
  |  Branch (183:9): [True: 5.57k, False: 304]
  ------------------
  184|  5.57k|        return 0;
  185|    304|    return a->error > b->error ? 1 : -1;
  ------------------
  |  Branch (185:12): [True: 164, False: 140]
  ------------------
  186|  5.88k|}
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.74k|    for (; str->error; str++)
  ------------------
  |  Branch (263:12): [True: 8.53k, False: 208]
  ------------------
  264|  8.53k|        (void)lh_ERR_STRING_DATA_insert(int_error_hash,
  ------------------
  |  |  378|  8.74k|#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.07k|{
   18|  1.07k|    ERR_STATE *es;
   19|       |
   20|  1.07k|    es = ossl_err_get_state_int();
   21|  1.07k|    if (es == NULL)
  ------------------
  |  Branch (21:9): [True: 0, False: 1.07k]
  ------------------
   22|      0|        return;
   23|       |
   24|       |    /* Allocate a slot */
   25|  1.07k|    err_get_slot(es);
   26|  1.07k|    err_clear(es, es->top, 0);
   27|  1.07k|}
ERR_set_debug:
   30|  1.07k|{
   31|  1.07k|    ERR_STATE *es;
   32|       |
   33|  1.07k|    es = ossl_err_get_state_int();
   34|  1.07k|    if (es == NULL)
  ------------------
  |  Branch (34:9): [True: 0, False: 1.07k]
  ------------------
   35|      0|        return;
   36|       |
   37|  1.07k|    err_set_debug(es, es->top, file, line, func);
   38|  1.07k|}
ERR_set_error:
   41|  1.07k|{
   42|  1.07k|    va_list args;
   43|       |
   44|  1.07k|    va_start(args, fmt);
   45|  1.07k|    ERR_vset_error(lib, reason, fmt, args);
   46|  1.07k|    va_end(args);
   47|  1.07k|}
ERR_vset_error:
   50|  1.07k|{
   51|  1.07k|    ERR_STATE *es;
   52|  1.07k|    char *buf = NULL;
   53|  1.07k|    size_t buf_size = 0;
   54|  1.07k|    unsigned long flags = 0;
   55|  1.07k|    size_t i;
   56|       |
   57|  1.07k|    es = ossl_err_get_state_int();
   58|  1.07k|    if (es == NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 1.07k]
  ------------------
   59|      0|        return;
   60|  1.07k|    i = es->top;
   61|       |
   62|  1.07k|    if (fmt != NULL) {
  ------------------
  |  Branch (62:9): [True: 0, False: 1.07k]
  ------------------
   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)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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.07k|    err_clear_data(es, es->top, 0);
  114|  1.07k|    err_set_error(es, es->top, lib, reason);
  115|  1.07k|    if (fmt != NULL)
  ------------------
  |  Branch (115:9): [True: 0, False: 1.07k]
  ------------------
  116|      0|        err_set_data(es, es->top, buf, buf_size, flags);
  117|  1.07k|}

err.c:err_clear:
   85|  20.1k|{
   86|  20.1k|    err_clear_data(es, i, (deall));
   87|  20.1k|    es->err_marks[i] = 0;
   88|  20.1k|    es->err_flags[i] = 0;
   89|  20.1k|    es->err_buffer[i] = 0;
   90|  20.1k|    es->err_line[i] = -1;
   91|  20.1k|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  115|  20.1k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  20.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  20.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   92|  20.1k|    es->err_file[i] = NULL;
   93|  20.1k|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  115|  20.1k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  20.1k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  20.1k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|  20.1k|    es->err_func[i] = NULL;
   95|  20.1k|}
err.c:err_clear_data:
   22|  20.1k|{
   23|  20.1k|    if (es->err_data_flags[i] & ERR_TXT_MALLOCED) {
  ------------------
  |  |   48|  20.1k|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (23:9): [True: 0, False: 20.1k]
  ------------------
   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)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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|  20.1k|    } else {
   34|  20.1k|        es->err_data[i] = NULL;
   35|  20.1k|        es->err_data_size[i] = 0;
   36|  20.1k|        es->err_data_flags[i] = 0;
   37|  20.1k|    }
   38|  20.1k|}
err_blocks.c:err_get_slot:
   15|  1.07k|{
   16|  1.07k|    es->top = (es->top + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|  1.07k|#  define ERR_NUM_ERRORS  16
  ------------------
   17|  1.07k|    if (es->top == es->bottom)
  ------------------
  |  Branch (17:9): [True: 0, False: 1.07k]
  ------------------
   18|      0|        es->bottom = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|      0|#  define ERR_NUM_ERRORS  16
  ------------------
   19|  1.07k|}
err_blocks.c:err_clear:
   85|  1.07k|{
   86|  1.07k|    err_clear_data(es, i, (deall));
   87|  1.07k|    es->err_marks[i] = 0;
   88|  1.07k|    es->err_flags[i] = 0;
   89|  1.07k|    es->err_buffer[i] = 0;
   90|  1.07k|    es->err_line[i] = -1;
   91|  1.07k|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  115|  1.07k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.07k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.07k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   92|  1.07k|    es->err_file[i] = NULL;
   93|  1.07k|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  115|  1.07k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.07k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.07k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|  1.07k|    es->err_func[i] = NULL;
   95|  1.07k|}
err_blocks.c:err_set_debug:
   52|  1.07k|{
   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.07k|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  115|  1.07k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.07k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.07k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   58|  1.07k|    if (file == NULL || file[0] == '\0')
  ------------------
  |  Branch (58:9): [True: 0, False: 1.07k]
  |  Branch (58:25): [True: 0, False: 1.07k]
  ------------------
   59|      0|        es->err_file[i] = NULL;
   60|  1.07k|    else if ((es->err_file[i] = CRYPTO_malloc(strlen(file) + 1,
  ------------------
  |  Branch (60:14): [True: 1.07k, False: 0]
  ------------------
   61|  1.07k|                                              NULL, 0)) != NULL)
   62|       |        /* We cannot use OPENSSL_strdup due to possible recursion */
   63|  1.07k|        strcpy(es->err_file[i], file);
   64|       |
   65|  1.07k|    es->err_line[i] = line;
   66|  1.07k|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  115|  1.07k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.07k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.07k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   67|  1.07k|    if (fn == NULL || fn[0] == '\0')
  ------------------
  |  Branch (67:9): [True: 0, False: 1.07k]
  |  Branch (67:23): [True: 0, False: 1.07k]
  ------------------
   68|      0|        es->err_func[i] = NULL;
   69|  1.07k|    else if ((es->err_func[i] = CRYPTO_malloc(strlen(fn) + 1,
  ------------------
  |  Branch (69:14): [True: 1.07k, False: 0]
  ------------------
   70|  1.07k|                                              NULL, 0)) != NULL)
   71|  1.07k|        strcpy(es->err_func[i], fn);
   72|  1.07k|}
err_blocks.c:err_clear_data:
   22|  2.14k|{
   23|  2.14k|    if (es->err_data_flags[i] & ERR_TXT_MALLOCED) {
  ------------------
  |  |   48|  2.14k|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (23:9): [True: 0, False: 2.14k]
  ------------------
   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)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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.14k|    } else {
   34|  2.14k|        es->err_data[i] = NULL;
   35|  2.14k|        es->err_data_size[i] = 0;
   36|  2.14k|        es->err_data_flags[i] = 0;
   37|  2.14k|    }
   38|  2.14k|}
err_blocks.c:err_set_error:
   42|  1.07k|{
   43|  1.07k|    es->err_buffer[i] =
   44|  1.07k|        lib == ERR_LIB_SYS
  ------------------
  |  |   72|  1.07k|# define ERR_LIB_SYS             2
  ------------------
  |  Branch (44:9): [True: 0, False: 1.07k]
  ------------------
   45|  1.07k|        ? (unsigned int)(ERR_SYSTEM_FLAG |  reason)
  ------------------
  |  |  218|      0|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  ------------------
   46|  1.07k|        : ERR_PACK(lib, 0, reason);
  ------------------
  |  |  279|  2.14k|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|  1.07k|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|  1.07k|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|  2.14k|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|  1.07k|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
   47|  1.07k|}

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|    249|{
  129|    249|    return OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
  ------------------
  |  |  104|    249|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    249|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    249|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  130|    249|}
EVP_ENCODE_CTX_free:
  133|  1.25k|{
  134|  1.25k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  1.25k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.25k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.25k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  135|  1.25k|}
EVP_DecodeInit:
  275|    249|{
  276|       |    /* Only ctx->num and ctx->flags are used during decoding. */
  277|    249|    ctx->num = 0;
  278|    249|    ctx->length = 0;
  279|    249|    ctx->line_num = 0;
  280|    249|    ctx->flags = 0;
  281|    249|}
EVP_DecodeUpdate:
  305|    249|{
  306|    249|    int seof = 0, eof = 0, rv = -1, ret = 0, i, v, tmp, n, decoded_len;
  307|    249|    unsigned char *d;
  308|    249|    const unsigned char *table;
  309|       |
  310|    249|    n = ctx->num;
  311|    249|    d = ctx->enc_data;
  312|       |
  313|    249|    if (n > 0 && d[n - 1] == '=') {
  ------------------
  |  Branch (313:9): [True: 0, False: 249]
  |  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|    249|    if (inl == 0) {
  ------------------
  |  Branch (320:9): [True: 0, False: 249]
  ------------------
  321|      0|        rv = 0;
  322|      0|        goto end;
  323|      0|    }
  324|       |
  325|    249|    if ((ctx->flags & EVP_ENCODE_CTX_USE_SRP_ALPHABET) != 0)
  ------------------
  |  |  863|    249|#define EVP_ENCODE_CTX_USE_SRP_ALPHABET     2
  ------------------
  |  Branch (325:9): [True: 0, False: 249]
  ------------------
  326|      0|        table = srpdata_ascii2bin;
  327|    249|    else
  328|    249|        table = data_ascii2bin;
  329|       |
  330|  4.00M|    for (i = 0; i < inl; i++) {
  ------------------
  |  Branch (330:17): [True: 4.00M, False: 172]
  ------------------
  331|  4.00M|        tmp = *(in++);
  332|  4.00M|        v = conv_ascii2bin(tmp, table);
  333|  4.00M|        if (v == B64_ERROR) {
  ------------------
  |  |   68|  4.00M|#define B64_ERROR               0xFF
  ------------------
  |  Branch (333:13): [True: 20, False: 4.00M]
  ------------------
  334|     20|            rv = -1;
  335|     20|            goto end;
  336|     20|        }
  337|       |
  338|  4.00M|        if (tmp == '=') {
  ------------------
  |  Branch (338:13): [True: 94, False: 4.00M]
  ------------------
  339|     94|            eof++;
  340|  4.00M|        } else if (eof > 0 && B64_BASE64(v)) {
  ------------------
  |  |   70|    373|#define B64_BASE64(a)           (!B64_NOT_BASE64(a))
  |  |  ------------------
  |  |  |  |   69|    373|#define B64_NOT_BASE64(a)       (((a)|0x13) == 0xF3)
  |  |  ------------------
  |  |  |  Branch (70:33): [True: 7, False: 366]
  |  |  ------------------
  ------------------
  |  Branch (340:20): [True: 373, False: 4.00M]
  ------------------
  341|       |            /* More data after padding. */
  342|      7|            rv = -1;
  343|      7|            goto end;
  344|      7|        }
  345|       |
  346|  4.00M|        if (eof > 2) {
  ------------------
  |  Branch (346:13): [True: 1, False: 4.00M]
  ------------------
  347|      1|            rv = -1;
  348|      1|            goto end;
  349|      1|        }
  350|       |
  351|  4.00M|        if (v == B64_EOF) {
  ------------------
  |  |   66|  4.00M|#define B64_EOF                 0xF2
  ------------------
  |  Branch (351:13): [True: 49, False: 4.00M]
  ------------------
  352|     49|            seof = 1;
  353|     49|            goto tail;
  354|     49|        }
  355|       |
  356|       |        /* Only save valid base64 characters. */
  357|  4.00M|        if (B64_BASE64(v)) {
  ------------------
  |  |   70|  4.00M|#define B64_BASE64(a)           (!B64_NOT_BASE64(a))
  |  |  ------------------
  |  |  |  |   69|  4.00M|#define B64_NOT_BASE64(a)       (((a)|0x13) == 0xF3)
  |  |  ------------------
  |  |  |  Branch (70:33): [True: 3.97M, False: 30.6k]
  |  |  ------------------
  ------------------
  358|  3.97M|            if (n >= 64) {
  ------------------
  |  Branch (358:17): [True: 0, False: 3.97M]
  ------------------
  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.97M|            OPENSSL_assert(n < (int)sizeof(ctx->enc_data));
  ------------------
  |  |  434|  3.97M|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (434:12): [True: 3.97M, False: 0]
  |  |  ------------------
  ------------------
  368|  3.97M|            d[n++] = tmp;
  369|  3.97M|        }
  370|       |
  371|  4.00M|        if (n == 64) {
  ------------------
  |  Branch (371:13): [True: 62.1k, False: 3.94M]
  ------------------
  372|  62.1k|            decoded_len = evp_decodeblock_int(ctx, out, d, n);
  373|  62.1k|            n = 0;
  374|  62.1k|            if (decoded_len < 0 || eof > decoded_len) {
  ------------------
  |  Branch (374:17): [True: 0, False: 62.1k]
  |  Branch (374:36): [True: 0, False: 62.1k]
  ------------------
  375|      0|                rv = -1;
  376|      0|                goto end;
  377|      0|            }
  378|  62.1k|            ret += decoded_len - eof;
  379|  62.1k|            out += decoded_len - eof;
  380|  62.1k|        }
  381|  4.00M|    }
  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|    221|tail:
  389|    221|    if (n > 0) {
  ------------------
  |  Branch (389:9): [True: 190, False: 31]
  ------------------
  390|    190|        if ((n & 3) == 0) {
  ------------------
  |  Branch (390:13): [True: 141, False: 49]
  ------------------
  391|    141|            decoded_len = evp_decodeblock_int(ctx, out, d, n);
  392|    141|            n = 0;
  393|    141|            if (decoded_len < 0 || eof > decoded_len) {
  ------------------
  |  Branch (393:17): [True: 0, False: 141]
  |  Branch (393:36): [True: 0, False: 141]
  ------------------
  394|      0|                rv = -1;
  395|      0|                goto end;
  396|      0|            }
  397|    141|            ret += (decoded_len - eof);
  398|    141|        } else if (seof) {
  ------------------
  |  Branch (398:20): [True: 3, False: 46]
  ------------------
  399|       |            /* EOF in the middle of a base64 block. */
  400|      3|            rv = -1;
  401|      3|            goto end;
  402|      3|        }
  403|    190|    }
  404|       |
  405|    218|    rv = seof || (n == 0 && eof) ? 0 : 1;
  ------------------
  |  Branch (405:10): [True: 46, False: 172]
  |  Branch (405:19): [True: 126, False: 46]
  |  Branch (405:29): [True: 8, False: 118]
  ------------------
  406|    249|end:
  407|       |    /* Legacy behaviour. This should probably rather be zeroed on error. */
  408|    249|    *outl = ret;
  409|    249|    ctx->num = n;
  410|    249|    return rv;
  411|    218|}
EVP_DecodeFinal:
  465|    218|{
  466|    218|    int i;
  467|       |
  468|    218|    *outl = 0;
  469|    218|    if (ctx->num != 0) {
  ------------------
  |  Branch (469:9): [True: 46, False: 172]
  ------------------
  470|     46|        i = evp_decodeblock_int(ctx, out, ctx->enc_data, ctx->num);
  471|     46|        if (i < 0)
  ------------------
  |  Branch (471:13): [True: 46, False: 0]
  ------------------
  472|     46|            return -1;
  473|      0|        ctx->num = 0;
  474|      0|        *outl = i;
  475|      0|        return 1;
  476|     46|    } else
  477|    172|        return 1;
  478|    218|}
encode.c:conv_ascii2bin:
  112|  8.10M|{
  113|  8.10M|    if (a & 0x80)
  ------------------
  |  Branch (113:9): [True: 14, False: 8.10M]
  ------------------
  114|     14|        return B64_ERROR;
  ------------------
  |  |   68|     14|#define B64_ERROR               0xFF
  ------------------
  115|  8.10M|    return table[a];
  116|  8.10M|}
encode.c:evp_decodeblock_int:
  415|  62.3k|{
  416|  62.3k|    int i, ret = 0, a, b, c, d;
  417|  62.3k|    unsigned long l;
  418|  62.3k|    const unsigned char *table;
  419|       |
  420|  62.3k|    if (ctx != NULL && (ctx->flags & EVP_ENCODE_CTX_USE_SRP_ALPHABET) != 0)
  ------------------
  |  |  863|  62.3k|#define EVP_ENCODE_CTX_USE_SRP_ALPHABET     2
  ------------------
  |  Branch (420:9): [True: 62.3k, False: 0]
  |  Branch (420:24): [True: 0, False: 62.3k]
  ------------------
  421|      0|        table = srpdata_ascii2bin;
  422|  62.3k|    else
  423|  62.3k|        table = data_ascii2bin;
  424|       |
  425|       |    /* trim whitespace from the start of the line. */
  426|  62.3k|    while ((n > 0) && (conv_ascii2bin(*f, table) == B64_WS)) {
  ------------------
  |  |   67|  62.3k|#define B64_WS                  0xE0
  ------------------
  |  Branch (426:12): [True: 62.3k, False: 0]
  |  Branch (426:23): [True: 0, False: 62.3k]
  ------------------
  427|      0|        f++;
  428|      0|        n--;
  429|      0|    }
  430|       |
  431|       |    /*
  432|       |     * strip off stuff at the end of the line ascii2bin values B64_WS,
  433|       |     * B64_EOLN, B64_EOLN and B64_EOF
  434|       |     */
  435|  62.3k|    while ((n > 3) && (B64_NOT_BASE64(conv_ascii2bin(f[n - 1], table))))
  ------------------
  |  |   69|  62.2k|#define B64_NOT_BASE64(a)       (((a)|0x13) == 0xF3)
  ------------------
  |  Branch (435:12): [True: 62.2k, False: 27]
  |  Branch (435:23): [True: 0, False: 62.2k]
  ------------------
  436|      0|        n--;
  437|       |
  438|  62.3k|    if (n % 4 != 0)
  ------------------
  |  Branch (438:9): [True: 46, False: 62.2k]
  ------------------
  439|     46|        return -1;
  440|       |
  441|  1.05M|    for (i = 0; i < n; i += 4) {
  ------------------
  |  Branch (441:17): [True: 994k, False: 62.2k]
  ------------------
  442|   994k|        a = conv_ascii2bin(*(f++), table);
  443|   994k|        b = conv_ascii2bin(*(f++), table);
  444|   994k|        c = conv_ascii2bin(*(f++), table);
  445|   994k|        d = conv_ascii2bin(*(f++), table);
  446|   994k|        if ((a & 0x80) || (b & 0x80) || (c & 0x80) || (d & 0x80))
  ------------------
  |  Branch (446:13): [True: 0, False: 994k]
  |  Branch (446:27): [True: 0, False: 994k]
  |  Branch (446:41): [True: 0, False: 994k]
  |  Branch (446:55): [True: 0, False: 994k]
  ------------------
  447|      0|            return -1;
  448|   994k|        l = ((((unsigned long)a) << 18L) |
  449|   994k|             (((unsigned long)b) << 12L) |
  450|   994k|             (((unsigned long)c) << 6L) | (((unsigned long)d)));
  451|   994k|        *(t++) = (unsigned char)(l >> 16L) & 0xff;
  452|   994k|        *(t++) = (unsigned char)(l >> 8L) & 0xff;
  453|   994k|        *(t++) = (unsigned char)(l) & 0xff;
  454|   994k|        ret += 3;
  455|   994k|    }
  456|  62.2k|    return ret;
  457|  62.2k|}

ossl_err_load_EVP_strings:
  206|      2|{
  207|      2|#ifndef OPENSSL_NO_ERR
  208|      2|    if (ERR_reason_error_string(EVP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (208:9): [True: 2, False: 0]
  ------------------
  209|      2|        ERR_load_strings_const(EVP_str_reasons);
  210|      2|#endif
  211|      2|    return 1;
  212|      2|}

EVP_PBE_cleanup:
  295|      2|{
  296|      2|    sk_EVP_PBE_CTL_pop_free(pbe_algs, free_evp_pbe_ctl);
  297|      2|    pbe_algs = NULL;
  298|      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)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  402|      0|    EVP_RAND_CTX_free(parent);
  403|      0|}

evp_cleanup_int:
  154|      2|{
  155|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_KDF_METH);
  ------------------
  |  |   30|      2|# define OBJ_NAME_TYPE_KDF_METH          0x06
  ------------------
  156|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_CIPHER_METH);
  ------------------
  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
  157|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_MD_METH);
  ------------------
  |  |   25|      2|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
  158|       |    /*
  159|       |     * The above calls will only clean out the contents of the name hash
  160|       |     * table, but not the hash table itself.  The following line does that
  161|       |     * part.  -- Richard Levitte
  162|       |     */
  163|      2|    OBJ_NAME_cleanup(-1);
  164|       |
  165|      2|    EVP_PBE_cleanup();
  166|      2|    OBJ_sigid_free();
  167|       |
  168|      2|    evp_app_cleanup_int();
  169|      2|}

evp_app_cleanup_int:
  618|      2|{
  619|      2|    if (app_pkey_methods != NULL)
  ------------------
  |  Branch (619:9): [True: 0, False: 2]
  ------------------
  620|      0|        sk_EVP_PKEY_METHOD_pop_free(app_pkey_methods, EVP_PKEY_meth_free);
  621|      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) {
  ------------------
  |  |  247|     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.75k|{
  222|  3.75k|    int mx, i;
  223|  3.75k|    void *ptr;
  224|  3.75k|    EX_CALLBACK **storage = NULL;
  225|  3.75k|    EX_CALLBACK *stack[10];
  226|  3.75k|    EX_CALLBACKS *ip;
  227|  3.75k|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
  228|       |
  229|  3.75k|    if (global == NULL)
  ------------------
  |  Branch (229:9): [True: 0, False: 3.75k]
  ------------------
  230|      0|        return 0;
  231|       |
  232|  3.75k|    ip = get_and_lock(global, class_index, 1);
  233|  3.75k|    if (ip == NULL)
  ------------------
  |  Branch (233:9): [True: 0, False: 3.75k]
  ------------------
  234|      0|        return 0;
  235|       |
  236|  3.75k|    ad->ctx = ctx;
  237|  3.75k|    ad->sk = NULL;
  238|  3.75k|    mx = sk_EX_CALLBACK_num(ip->meth);
  239|  3.75k|    if (mx > 0) {
  ------------------
  |  Branch (239:9): [True: 0, False: 3.75k]
  ------------------
  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)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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.75k|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  249|       |
  250|  3.75k|    if (mx > 0 && storage == NULL)
  ------------------
  |  Branch (250:9): [True: 0, False: 3.75k]
  |  Branch (250:19): [True: 0, False: 0]
  ------------------
  251|      0|        return 0;
  252|  3.75k|    for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (252:17): [True: 0, False: 3.75k]
  ------------------
  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.75k|    if (storage != stack)
  ------------------
  |  Branch (259:9): [True: 3.75k, False: 0]
  ------------------
  260|  3.75k|        OPENSSL_free(storage);
  ------------------
  |  |  115|  3.75k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.75k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.75k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  261|  3.75k|    return 1;
  262|  3.75k|}
CRYPTO_new_ex_data:
  265|  3.75k|{
  266|  3.75k|    return ossl_crypto_new_ex_data_ex(NULL, class_index, obj, ad);
  267|  3.75k|}
CRYPTO_free_ex_data:
  368|  3.75k|{
  369|  3.75k|    int mx, i;
  370|  3.75k|    EX_CALLBACKS *ip;
  371|  3.75k|    void *ptr;
  372|  3.75k|    const EX_CALLBACK *f;
  373|  3.75k|    struct ex_callback_entry stack[10];
  374|  3.75k|    struct ex_callback_entry *storage = NULL;
  375|  3.75k|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ad->ctx);
  376|       |
  377|  3.75k|    if (global == NULL)
  ------------------
  |  Branch (377:9): [True: 0, False: 3.75k]
  ------------------
  378|      0|        goto err;
  379|       |
  380|  3.75k|    ip = get_and_lock(global, class_index, 1);
  381|  3.75k|    if (ip == NULL)
  ------------------
  |  Branch (381:9): [True: 0, False: 3.75k]
  ------------------
  382|      0|        goto err;
  383|       |
  384|  3.75k|    mx = sk_EX_CALLBACK_num(ip->meth);
  385|  3.75k|    if (mx > 0) {
  ------------------
  |  Branch (385:9): [True: 0, False: 3.75k]
  ------------------
  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)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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.75k|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  397|       |
  398|  3.75k|    if (storage != NULL) {
  ------------------
  |  Branch (398:9): [True: 0, False: 3.75k]
  ------------------
  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.75k|    if (storage != stack)
  ------------------
  |  Branch (411:9): [True: 3.75k, False: 0]
  ------------------
  412|  3.75k|        OPENSSL_free(storage);
  ------------------
  |  |  115|  3.75k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  3.75k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  3.75k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  413|  3.75k| err:
  414|  3.75k|    sk_void_free(ad->sk);
  ------------------
  |  |  203|  3.75k|#define sk_void_free(sk) OPENSSL_sk_free(ossl_check_void_sk_type(sk))
  ------------------
  415|  3.75k|    ad->sk = NULL;
  416|  3.75k|    ad->ctx = NULL;
  417|  3.75k|}
ex_data.c:get_and_lock:
   33|  7.51k|{
   34|  7.51k|    EX_CALLBACKS *ip;
   35|       |
   36|  7.51k|    if (class_index < 0 || class_index >= CRYPTO_EX_INDEX__COUNT) {
  ------------------
  |  |  247|  7.51k|# define CRYPTO_EX_INDEX__COUNT          18
  ------------------
  |  Branch (36:9): [True: 0, False: 7.51k]
  |  Branch (36:28): [True: 0, False: 7.51k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   38|      0|        return NULL;
   39|      0|    }
   40|       |
   41|  7.51k|    if (global->ex_data_lock == NULL) {
  ------------------
  |  Branch (41:9): [True: 0, False: 7.51k]
  ------------------
   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.51k|    if (read) {
  ------------------
  |  Branch (49:9): [True: 7.51k, False: 2]
  ------------------
   50|  7.51k|        if (!CRYPTO_THREAD_read_lock(global->ex_data_lock))
  ------------------
  |  Branch (50:13): [True: 0, False: 7.51k]
  ------------------
   51|      0|            return NULL;
   52|  7.51k|    } 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.51k|    ip = &global->ex_data[class_index];
   58|  7.51k|    return ip;
   59|  7.51k|}

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)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   32|      2|}

OPENSSL_cleanup:
  354|      2|{
  355|      2|    OPENSSL_INIT_STOP *currhandler, *lasthandler;
  356|       |
  357|       |    /*
  358|       |     * At some point we should consider looking at this function with a view to
  359|       |     * moving most/all of this into onfree handlers in OSSL_LIB_CTX.
  360|       |     */
  361|       |
  362|       |    /* If we've not been inited then no need to deinit */
  363|      2|    if (!base_inited)
  ------------------
  |  Branch (363:9): [True: 0, False: 2]
  ------------------
  364|      0|        return;
  365|       |
  366|       |    /* Might be explicitly called and also by atexit */
  367|      2|    if (stopped)
  ------------------
  |  Branch (367:9): [True: 0, False: 2]
  ------------------
  368|      0|        return;
  369|      2|    stopped = 1;
  370|       |
  371|       |    /*
  372|       |     * Thread stop may not get automatically called by the thread library for
  373|       |     * the very last thread in some situations, so call it directly.
  374|       |     */
  375|      2|    OPENSSL_thread_stop();
  376|       |
  377|      2|    currhandler = stop_handlers;
  378|      2|    while (currhandler != NULL) {
  ------------------
  |  Branch (378:12): [True: 0, False: 2]
  ------------------
  379|      0|        currhandler->handler();
  380|      0|        lasthandler = currhandler;
  381|      0|        currhandler = currhandler->next;
  382|      0|        OPENSSL_free(lasthandler);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  383|      0|    }
  384|      2|    stop_handlers = NULL;
  385|       |
  386|      2|    CRYPTO_THREAD_lock_free(optsdone_lock);
  387|      2|    optsdone_lock = NULL;
  388|      2|    CRYPTO_THREAD_lock_free(init_lock);
  389|      2|    init_lock = NULL;
  390|       |
  391|      2|    CRYPTO_THREAD_cleanup_local(&in_init_config_local);
  392|       |
  393|       |    /*
  394|       |     * We assume we are single-threaded for this function, i.e. no race
  395|       |     * conditions for the various "*_inited" vars below.
  396|       |     */
  397|       |
  398|      2|#ifndef OPENSSL_NO_COMP
  399|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_zlib_cleanup()\n");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  400|      2|    ossl_comp_zlib_cleanup();
  401|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_brotli_cleanup()\n");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  402|      2|    ossl_comp_brotli_cleanup();
  403|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_zstd_cleanup()\n");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  404|      2|    ossl_comp_zstd_cleanup();
  405|      2|#endif
  406|       |
  407|      2|    if (async_inited) {
  ------------------
  |  Branch (407:9): [True: 0, False: 2]
  ------------------
  408|      0|        OSSL_TRACE(INIT, "OPENSSL_cleanup: async_deinit()\n");
  ------------------
  |  |  287|      0|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  409|      0|        async_deinit();
  410|      0|    }
  411|       |
  412|       |    /*
  413|       |     * Note that cleanup order is important:
  414|       |     * - ossl_rand_cleanup_int could call an ENGINE's RAND cleanup function so
  415|       |     * must be called before engine_cleanup_int()
  416|       |     * - ENGINEs use CRYPTO_EX_DATA and therefore, must be cleaned up
  417|       |     * before the ex data handlers are wiped during default ossl_lib_ctx deinit.
  418|       |     * - ossl_config_modules_free() can end up in ENGINE code so must be called
  419|       |     * before engine_cleanup_int()
  420|       |     * - ENGINEs and additional EVP algorithms might use added OIDs names so
  421|       |     * ossl_obj_cleanup_int() must be called last
  422|       |     */
  423|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_rand_cleanup_int()\n");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  424|      2|    ossl_rand_cleanup_int();
  425|       |
  426|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_config_modules_free()\n");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  427|      2|    ossl_config_modules_free();
  428|       |
  429|      2|#ifndef OPENSSL_NO_ENGINE
  430|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: engine_cleanup_int()\n");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  431|      2|    engine_cleanup_int();
  432|      2|#endif
  433|       |
  434|      2|#ifndef OPENSSL_NO_DEPRECATED_3_0
  435|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_store_cleanup_int()\n");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  436|      2|    ossl_store_cleanup_int();
  437|      2|#endif
  438|       |
  439|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_lib_ctx_default_deinit()\n");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  440|      2|    ossl_lib_ctx_default_deinit();
  441|       |
  442|      2|    ossl_cleanup_thread();
  443|       |
  444|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: bio_cleanup()\n");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  445|      2|    bio_cleanup();
  446|       |
  447|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: evp_cleanup_int()\n");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  448|      2|    evp_cleanup_int();
  449|       |
  450|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_obj_cleanup_int()\n");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  451|      2|    ossl_obj_cleanup_int();
  452|       |
  453|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: err_int()\n");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  454|      2|    err_cleanup();
  455|       |
  456|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: CRYPTO_secure_malloc_done()\n");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  457|      2|    CRYPTO_secure_malloc_done();
  458|       |
  459|      2|#ifndef OPENSSL_NO_CMP
  460|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: OSSL_CMP_log_close()\n");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  461|      2|    OSSL_CMP_log_close();
  462|      2|#endif
  463|       |
  464|      2|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_trace_cleanup()\n");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  465|      2|    ossl_trace_cleanup();
  466|       |
  467|      2|    base_inited = 0;
  468|      2|}
OPENSSL_init_crypto:
  476|  4.48k|{
  477|  4.48k|    uint64_t tmp;
  478|  4.48k|    int aloaddone = 0;
  479|       |
  480|       |   /* Applications depend on 0 being returned when cleanup was already done */
  481|  4.48k|    if (stopped) {
  ------------------
  |  Branch (481:9): [True: 0, False: 4.48k]
  ------------------
  482|      0|        if (!(opts & OPENSSL_INIT_BASE_ONLY))
  ------------------
  |  |   31|      0|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (482:13): [True: 0, False: 0]
  ------------------
  483|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  484|      0|        return 0;
  485|      0|    }
  486|       |
  487|       |    /*
  488|       |     * We ignore failures from this function. It is probably because we are
  489|       |     * on a platform that doesn't support lockless atomic loads (we may not
  490|       |     * have created optsdone_lock yet so we can't use it). This is just an
  491|       |     * optimisation to skip the full checks in this function if we don't need
  492|       |     * to, so we carry on regardless in the event of failure.
  493|       |     *
  494|       |     * There could be a race here with other threads, so that optsdone has not
  495|       |     * been updated yet, even though the options have in fact been initialised.
  496|       |     * This doesn't matter - it just means we will run the full function
  497|       |     * unnecessarily - but all the critical code is contained in RUN_ONCE
  498|       |     * functions anyway so we are safe.
  499|       |     */
  500|  4.48k|    if (CRYPTO_atomic_load(&optsdone, &tmp, NULL)) {
  ------------------
  |  Branch (500:9): [True: 4.48k, False: 0]
  ------------------
  501|  4.48k|        if ((tmp & opts) == opts)
  ------------------
  |  Branch (501:13): [True: 2, False: 4.48k]
  ------------------
  502|      2|            return 1;
  503|  4.48k|        aloaddone = 1;
  504|  4.48k|    }
  505|       |
  506|       |    /*
  507|       |     * At some point we should look at this function with a view to moving
  508|       |     * most/all of this into OSSL_LIB_CTX.
  509|       |     *
  510|       |     * When the caller specifies OPENSSL_INIT_BASE_ONLY, that should be the
  511|       |     * *only* option specified.  With that option we return immediately after
  512|       |     * doing the requested limited initialization.  Note that
  513|       |     * err_shelve_state() called by us via ossl_init_load_crypto_nodelete()
  514|       |     * re-enters OPENSSL_init_crypto() with OPENSSL_INIT_BASE_ONLY, but with
  515|       |     * base already initialized this is a harmless NOOP.
  516|       |     *
  517|       |     * If we remain the only caller of err_shelve_state() the recursion should
  518|       |     * perhaps be removed, but if in doubt, it can be left in place.
  519|       |     */
  520|  4.48k|    if (!RUN_ONCE(&base, ossl_init_base))
  ------------------
  |  |  130|  4.48k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 4.48k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (520:9): [True: 0, False: 4.48k]
  ------------------
  521|      0|        return 0;
  522|       |
  523|  4.48k|    if (opts & OPENSSL_INIT_BASE_ONLY)
  ------------------
  |  |   31|  4.48k|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (523:9): [True: 4.48k, False: 2]
  ------------------
  524|  4.48k|        return 1;
  525|       |
  526|       |    /*
  527|       |     * optsdone_lock should definitely be set up now, so we can now repeat the
  528|       |     * same check from above but be sure that it will work even on platforms
  529|       |     * without lockless CRYPTO_atomic_load
  530|       |     */
  531|      2|    if (!aloaddone) {
  ------------------
  |  Branch (531:9): [True: 0, False: 2]
  ------------------
  532|      0|        if (!CRYPTO_atomic_load(&optsdone, &tmp, optsdone_lock))
  ------------------
  |  Branch (532:13): [True: 0, False: 0]
  ------------------
  533|      0|            return 0;
  534|      0|        if ((tmp & opts) == opts)
  ------------------
  |  Branch (534:13): [True: 0, False: 0]
  ------------------
  535|      0|            return 1;
  536|      0|    }
  537|       |
  538|       |    /*
  539|       |     * Now we don't always set up exit handlers, the INIT_BASE_ONLY calls
  540|       |     * should not have the side-effect of setting up exit handlers, and
  541|       |     * therefore, this code block is below the INIT_BASE_ONLY-conditioned early
  542|       |     * return above.
  543|       |     */
  544|      2|    if ((opts & OPENSSL_INIT_NO_ATEXIT) != 0) {
  ------------------
  |  |  481|      2|# define OPENSSL_INIT_NO_ATEXIT              0x00080000L
  ------------------
  |  Branch (544:9): [True: 0, False: 2]
  ------------------
  545|      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 (545:13): [True: 0, False: 0]
  ------------------
  546|      0|                          ossl_init_register_atexit))
  547|      0|            return 0;
  548|      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 (548:16): [True: 0, False: 2]
  ------------------
  549|      0|        return 0;
  550|      0|    }
  551|       |
  552|      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 (552:9): [True: 0, False: 2]
  ------------------
  553|      0|        return 0;
  554|       |
  555|      2|    if ((opts & OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS)
  ------------------
  |  |  462|      2|# define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS 0x00000001L
  ------------------
  |  Branch (555:9): [True: 0, False: 2]
  ------------------
  556|      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 (556:16): [True: 0, False: 0]
  ------------------
  557|      2|                             ossl_init_no_load_crypto_strings,
  558|      2|                             ossl_init_load_crypto_strings))
  559|      0|        return 0;
  560|       |
  561|      2|    if ((opts & OPENSSL_INIT_LOAD_CRYPTO_STRINGS)
  ------------------
  |  |  463|      2|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
  |  Branch (561:9): [True: 2, False: 0]
  ------------------
  562|      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 (562:16): [True: 0, False: 2]
  ------------------
  563|      0|        return 0;
  564|       |
  565|      2|    if ((opts & OPENSSL_INIT_NO_ADD_ALL_CIPHERS)
  ------------------
  |  |  466|      2|# define OPENSSL_INIT_NO_ADD_ALL_CIPHERS     0x00000010L
  ------------------
  |  Branch (565:9): [True: 0, False: 2]
  ------------------
  566|      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 (566:16): [True: 0, False: 0]
  ------------------
  567|      2|                             ossl_init_add_all_ciphers))
  568|      0|        return 0;
  569|       |
  570|      2|    if ((opts & OPENSSL_INIT_ADD_ALL_CIPHERS)
  ------------------
  |  |  464|      2|# define OPENSSL_INIT_ADD_ALL_CIPHERS        0x00000004L
  ------------------
  |  Branch (570:9): [True: 0, False: 2]
  ------------------
  571|      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 (571:16): [True: 0, False: 0]
  ------------------
  572|      0|        return 0;
  573|       |
  574|      2|    if ((opts & OPENSSL_INIT_NO_ADD_ALL_DIGESTS)
  ------------------
  |  |  467|      2|# define OPENSSL_INIT_NO_ADD_ALL_DIGESTS     0x00000020L
  ------------------
  |  Branch (574:9): [True: 0, False: 2]
  ------------------
  575|      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 (575:16): [True: 0, False: 0]
  ------------------
  576|      2|                             ossl_init_add_all_digests))
  577|      0|        return 0;
  578|       |
  579|      2|    if ((opts & OPENSSL_INIT_ADD_ALL_DIGESTS)
  ------------------
  |  |  465|      2|# define OPENSSL_INIT_ADD_ALL_DIGESTS        0x00000008L
  ------------------
  |  Branch (579:9): [True: 0, False: 2]
  ------------------
  580|      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 (580:16): [True: 0, False: 0]
  ------------------
  581|      0|        return 0;
  582|       |
  583|      2|    if ((opts & OPENSSL_INIT_ATFORK)
  ------------------
  |  |  479|      2|# define OPENSSL_INIT_ATFORK                 0x00020000L
  ------------------
  |  Branch (583:9): [True: 0, False: 2]
  ------------------
  584|      2|            && !openssl_init_fork_handlers())
  ------------------
  |  Branch (584:16): [True: 0, False: 0]
  ------------------
  585|      0|        return 0;
  586|       |
  587|      2|    if ((opts & OPENSSL_INIT_NO_LOAD_CONFIG)
  ------------------
  |  |  469|      2|# define OPENSSL_INIT_NO_LOAD_CONFIG         0x00000080L
  ------------------
  |  Branch (587:9): [True: 0, False: 2]
  ------------------
  588|      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 (588:16): [True: 0, False: 0]
  ------------------
  589|      0|        return 0;
  590|       |
  591|      2|    if (opts & OPENSSL_INIT_LOAD_CONFIG) {
  ------------------
  |  |  468|      2|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  |  Branch (591:9): [True: 0, False: 2]
  ------------------
  592|      0|        int loading = CRYPTO_THREAD_get_local(&in_init_config_local) != NULL;
  593|       |
  594|       |        /* If called recursively from OBJ_ calls, just skip it. */
  595|      0|        if (!loading) {
  ------------------
  |  Branch (595:13): [True: 0, False: 0]
  ------------------
  596|      0|            int ret;
  597|       |
  598|      0|            if (!CRYPTO_THREAD_set_local(&in_init_config_local, (void *)-1))
  ------------------
  |  Branch (598:17): [True: 0, False: 0]
  ------------------
  599|      0|                return 0;
  600|      0|            if (settings == NULL) {
  ------------------
  |  Branch (600:17): [True: 0, False: 0]
  ------------------
  601|      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]
  |  |  ------------------
  ------------------
  602|      0|            } else {
  603|      0|                if (!CRYPTO_THREAD_write_lock(init_lock))
  ------------------
  |  Branch (603:21): [True: 0, False: 0]
  ------------------
  604|      0|                    return 0;
  605|      0|                conf_settings = settings;
  606|      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]
  |  |  ------------------
  ------------------
  607|      0|                                   ossl_init_config);
  608|      0|                conf_settings = NULL;
  609|      0|                CRYPTO_THREAD_unlock(init_lock);
  610|      0|            }
  611|       |
  612|      0|            if (ret <= 0)
  ------------------
  |  Branch (612:17): [True: 0, False: 0]
  ------------------
  613|      0|                return 0;
  614|      0|        }
  615|      0|    }
  616|       |
  617|      2|    if ((opts & OPENSSL_INIT_ASYNC)
  ------------------
  |  |  470|      2|# define OPENSSL_INIT_ASYNC                  0x00000100L
  ------------------
  |  Branch (617:9): [True: 0, False: 2]
  ------------------
  618|      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 (618:16): [True: 0, False: 0]
  ------------------
  619|      0|        return 0;
  620|       |
  621|      2|#ifndef OPENSSL_NO_ENGINE
  622|      2|    if ((opts & OPENSSL_INIT_ENGINE_OPENSSL)
  ------------------
  |  |  473|      2|# define OPENSSL_INIT_ENGINE_OPENSSL         0x00000800L
  ------------------
  |  Branch (622:9): [True: 0, False: 2]
  ------------------
  623|      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 (623:16): [True: 0, False: 0]
  ------------------
  624|      0|        return 0;
  625|      2|# ifndef OPENSSL_NO_RDRAND
  626|      2|    if ((opts & OPENSSL_INIT_ENGINE_RDRAND)
  ------------------
  |  |  471|      2|# define OPENSSL_INIT_ENGINE_RDRAND          0x00000200L
  ------------------
  |  Branch (626:9): [True: 0, False: 2]
  ------------------
  627|      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 (627:16): [True: 0, False: 0]
  ------------------
  628|      0|        return 0;
  629|      2|# endif
  630|      2|    if ((opts & OPENSSL_INIT_ENGINE_DYNAMIC)
  ------------------
  |  |  472|      2|# define OPENSSL_INIT_ENGINE_DYNAMIC         0x00000400L
  ------------------
  |  Branch (630:9): [True: 0, False: 2]
  ------------------
  631|      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 (631:16): [True: 0, False: 0]
  ------------------
  632|      0|        return 0;
  633|      2|# ifndef OPENSSL_NO_STATIC_ENGINE
  634|       |#  ifndef OPENSSL_NO_DEVCRYPTOENG
  635|       |    if ((opts & OPENSSL_INIT_ENGINE_CRYPTODEV)
  636|       |            && !RUN_ONCE(&engine_devcrypto, ossl_init_engine_devcrypto))
  637|       |        return 0;
  638|       |#  endif
  639|      2|#  if !defined(OPENSSL_NO_PADLOCKENG)
  640|      2|    if ((opts & OPENSSL_INIT_ENGINE_PADLOCK)
  ------------------
  |  |  476|      2|# define OPENSSL_INIT_ENGINE_PADLOCK         0x00004000L
  ------------------
  |  Branch (640:9): [True: 0, False: 2]
  ------------------
  641|      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 (641:16): [True: 0, False: 0]
  ------------------
  642|      0|        return 0;
  643|      2|#  endif
  644|       |#  if defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_NO_CAPIENG)
  645|       |    if ((opts & OPENSSL_INIT_ENGINE_CAPI)
  646|       |            && !RUN_ONCE(&engine_capi, ossl_init_engine_capi))
  647|       |        return 0;
  648|       |#  endif
  649|      2|#  if !defined(OPENSSL_NO_AFALGENG)
  650|      2|    if ((opts & OPENSSL_INIT_ENGINE_AFALG)
  ------------------
  |  |  477|      2|# define OPENSSL_INIT_ENGINE_AFALG           0x00008000L
  ------------------
  |  Branch (650:9): [True: 0, False: 2]
  ------------------
  651|      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 (651:16): [True: 0, False: 0]
  ------------------
  652|      0|        return 0;
  653|      2|#  endif
  654|      2|# endif
  655|      2|    if (opts & (OPENSSL_INIT_ENGINE_ALL_BUILTIN
  ------------------
  |  |  493|      2|    (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
  |  |  ------------------
  |  |  |  |  471|      2|# define OPENSSL_INIT_ENGINE_RDRAND          0x00000200L
  |  |  ------------------
  |  |                   (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
  |  |  ------------------
  |  |  |  |  472|      2|# define OPENSSL_INIT_ENGINE_DYNAMIC         0x00000400L
  |  |  ------------------
  |  |  494|      2|    | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | \
  |  |  ------------------
  |  |  |  |  474|      2|# define OPENSSL_INIT_ENGINE_CRYPTODEV       0x00001000L
  |  |  ------------------
  |  |                   | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | \
  |  |  ------------------
  |  |  |  |  475|      2|# define OPENSSL_INIT_ENGINE_CAPI            0x00002000L
  |  |  ------------------
  |  |  495|      2|    OPENSSL_INIT_ENGINE_PADLOCK)
  |  |  ------------------
  |  |  |  |  476|      2|# define OPENSSL_INIT_ENGINE_PADLOCK         0x00004000L
  |  |  ------------------
  ------------------
  |  Branch (655:9): [True: 0, False: 2]
  ------------------
  656|      2|                | OPENSSL_INIT_ENGINE_OPENSSL
  ------------------
  |  |  473|      2|# define OPENSSL_INIT_ENGINE_OPENSSL         0x00000800L
  ------------------
  657|      2|                | OPENSSL_INIT_ENGINE_AFALG)) {
  ------------------
  |  |  477|      2|# define OPENSSL_INIT_ENGINE_AFALG           0x00008000L
  ------------------
  658|      0|        ENGINE_register_all_complete();
  659|      0|    }
  660|      2|#endif
  661|       |
  662|      2|    if (!CRYPTO_atomic_or(&optsdone, opts, &tmp, optsdone_lock))
  ------------------
  |  Branch (662:9): [True: 0, False: 2]
  ------------------
  663|      0|        return 0;
  664|       |
  665|      2|    return 1;
  666|      2|}
init.c:ossl_init_base:
   56|      2|{
   57|       |    /* no need to init trace */
   58|       |
   59|      2|    OSSL_TRACE(INIT, "ossl_init_base: setting up stop handlers\n");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   60|       |#ifndef OPENSSL_NO_CRYPTO_MDEBUG
   61|       |    ossl_malloc_setup_failures();
   62|       |#endif
   63|       |
   64|      2|    if ((optsdone_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (64:9): [True: 0, False: 2]
  ------------------
   65|      2|        || (init_lock = CRYPTO_THREAD_lock_new()) == NULL)
  ------------------
  |  Branch (65:12): [True: 0, False: 2]
  ------------------
   66|      0|        goto err;
   67|       |
   68|      2|    OPENSSL_cpuid_setup();
   69|       |
   70|      2|    if (!ossl_init_thread())
  ------------------
  |  Branch (70:9): [True: 0, False: 2]
  ------------------
   71|      0|        goto err;
   72|       |
   73|      2|    if (!CRYPTO_THREAD_init_local(&in_init_config_local, NULL))
  ------------------
  |  Branch (73:9): [True: 0, False: 2]
  ------------------
   74|      0|        goto err;
   75|       |
   76|      2|    base_inited = 1;
   77|      2|    return 1;
   78|       |
   79|      0|err:
   80|      0|    OSSL_TRACE(INIT, "ossl_init_base failed!\n");
  ------------------
  |  |  287|      0|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   81|      0|    CRYPTO_THREAD_lock_free(optsdone_lock);
   82|      0|    optsdone_lock = NULL;
   83|      0|    CRYPTO_THREAD_lock_free(init_lock);
   84|      0|    init_lock = NULL;
   85|       |
   86|      0|    return 0;
   87|      2|}
init.c:ossl_init_register_atexit:
   99|      2|{
  100|      2|#ifndef OPENSSL_NO_ATEXIT
  101|       |# ifdef OPENSSL_INIT_DEBUG
  102|       |    fprintf(stderr, "OPENSSL_INIT: ossl_init_register_atexit()\n");
  103|       |# endif
  104|      2|# ifndef OPENSSL_SYS_UEFI
  105|       |#  if defined(_WIN32) && !defined(__BORLANDC__)
  106|       |    /* We use _onexit() in preference because it gets called on DLL unload */
  107|       |    if (_onexit(win32atexit) == NULL)
  108|       |        return 0;
  109|       |#  else
  110|      2|    if (atexit(OPENSSL_cleanup) != 0)
  ------------------
  |  Branch (110:9): [True: 0, False: 2]
  ------------------
  111|      0|        return 0;
  112|      2|#  endif
  113|      2|# endif
  114|      2|#endif
  115|       |
  116|      2|    return 1;
  117|      2|}
init.c:ossl_init_load_crypto_nodelete:
  131|      2|{
  132|      2|    OSSL_TRACE(INIT, "ossl_init_load_crypto_nodelete()\n");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  133|       |
  134|       |#if !defined(OPENSSL_USE_NODELETE) \
  135|       |    && !defined(OPENSSL_NO_PINSHARED)
  136|       |# if defined(DSO_WIN32) && !defined(_WIN32_WCE)
  137|       |    {
  138|       |        HMODULE handle = NULL;
  139|       |        BOOL ret;
  140|       |
  141|       |        /* We don't use the DSO route for WIN32 because there is a better way */
  142|       |        ret = GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
  143|       |                                | GET_MODULE_HANDLE_EX_FLAG_PIN,
  144|       |                                (void *)&base_inited, &handle);
  145|       |
  146|       |        OSSL_TRACE1(INIT,
  147|       |                    "ossl_init_load_crypto_nodelete: "
  148|       |                    "obtained DSO reference? %s\n",
  149|       |                    (ret == TRUE ? "No!" : "Yes."));
  150|       |        return (ret == TRUE) ? 1 : 0;
  151|       |    }
  152|       |# elif !defined(DSO_NONE)
  153|       |    /*
  154|       |     * Deliberately leak a reference to ourselves. This will force the library
  155|       |     * to remain loaded until the atexit() handler is run at process exit.
  156|       |     */
  157|       |    {
  158|       |        DSO *dso;
  159|       |        void *err;
  160|       |
  161|       |        if (!err_shelve_state(&err))
  162|       |            return 0;
  163|       |
  164|       |        dso = DSO_dsobyaddr(&base_inited, DSO_FLAG_NO_UNLOAD_ON_FREE);
  165|       |        /*
  166|       |         * In case of No!, it is uncertain our exit()-handlers can still be
  167|       |         * called. After dlclose() the whole library might have been unloaded
  168|       |         * already.
  169|       |         */
  170|       |        OSSL_TRACE1(INIT, "obtained DSO reference? %s\n",
  171|       |                    (dso == NULL ? "No!" : "Yes."));
  172|       |        DSO_free(dso);
  173|       |        err_unshelve_state(err);
  174|       |    }
  175|       |# endif
  176|       |#endif
  177|       |
  178|      2|    return 1;
  179|      2|}
init.c:ossl_init_load_crypto_strings:
  184|      2|{
  185|      2|    int ret = 1;
  186|       |    /*
  187|       |     * OPENSSL_NO_AUTOERRINIT is provided here to prevent at compile time
  188|       |     * pulling in all the error strings during static linking
  189|       |     */
  190|      2|#if !defined(OPENSSL_NO_ERR) && !defined(OPENSSL_NO_AUTOERRINIT)
  191|      2|    void *err;
  192|       |
  193|      2|    if (!err_shelve_state(&err))
  ------------------
  |  Branch (193:9): [True: 0, False: 2]
  ------------------
  194|      0|        return 0;
  195|       |
  196|      2|    OSSL_TRACE(INIT, "ossl_err_load_crypto_strings()\n");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      2|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  197|      2|    ret = ossl_err_load_crypto_strings();
  198|       |
  199|      2|    err_unshelve_state(err);
  200|      2|#endif
  201|      2|    return ret;
  202|      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)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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:
  367|      2|{
  368|      2|    THREAD_EVENT_HANDLER **hands;
  369|      2|    THREAD_EVENT_HANDLER *hand;
  370|       |#ifdef FIPS_MODULE
  371|       |    OSSL_LIB_CTX *ctx = arg;
  372|       |
  373|       |    /*
  374|       |     * In FIPS mode the list of THREAD_EVENT_HANDLERs is unique per combination
  375|       |     * of OSSL_LIB_CTX and thread. This is because in FIPS mode each
  376|       |     * OSSL_LIB_CTX gets informed about thread stop events individually.
  377|       |     */
  378|       |    CRYPTO_THREAD_LOCAL *local
  379|       |        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX);
  380|       |#else
  381|       |    /*
  382|       |     * Outside of FIPS mode the list of THREAD_EVENT_HANDLERs is unique per
  383|       |     * thread, but may hold multiple OSSL_LIB_CTXs. We only get told about
  384|       |     * thread stop events globally, so we have to ensure all affected
  385|       |     * OSSL_LIB_CTXs are informed.
  386|       |     */
  387|      2|    CRYPTO_THREAD_LOCAL *local = &destructor_key.value;
  388|      2|#endif
  389|       |
  390|      2|    hands = init_get_thread_local(local, 1, 0);
  391|      2|    if (hands == NULL)
  ------------------
  |  Branch (391:9): [True: 0, False: 2]
  ------------------
  392|      0|        return 0;
  393|       |
  394|       |#ifdef FIPS_MODULE
  395|       |    if (*hands == NULL) {
  396|       |        /*
  397|       |         * We've not yet registered any handlers for this thread. We need to get
  398|       |         * libcrypto to tell us about later thread stop events. c_thread_start
  399|       |         * is a callback to libcrypto defined in fipsprov.c
  400|       |         */
  401|       |        if (!ossl_thread_register_fips(ctx))
  402|       |            return 0;
  403|       |    }
  404|       |#endif
  405|       |
  406|      2|    hand = OPENSSL_malloc(sizeof(*hand));
  ------------------
  |  |  102|      2|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  407|      2|    if (hand == NULL)
  ------------------
  |  Branch (407:9): [True: 0, False: 2]
  ------------------
  408|      0|        return 0;
  409|       |
  410|      2|    hand->handfn = handfn;
  411|      2|    hand->arg = arg;
  412|      2|#ifndef FIPS_MODULE
  413|      2|    hand->index = index;
  414|      2|#endif
  415|      2|    hand->next = *hands;
  416|      2|    *hands = hand;
  417|       |
  418|      2|    return 1;
  419|      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)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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:
  323|      4|{
  324|      4|    THREAD_EVENT_HANDLER *curr, *prev = NULL, *tmp;
  325|      4|#ifndef FIPS_MODULE
  326|      4|    GLOBAL_TEVENT_REGISTER *gtr;
  327|      4|#endif
  328|       |
  329|       |    /* Can't do much about this */
  330|      4|    if (hands == NULL)
  ------------------
  |  Branch (330:9): [True: 2, False: 2]
  ------------------
  331|      2|        return;
  332|       |
  333|      2|#ifndef FIPS_MODULE
  334|      2|    gtr = get_global_tevent_register();
  335|      2|    if (gtr == NULL)
  ------------------
  |  Branch (335:9): [True: 0, False: 2]
  ------------------
  336|      0|        return;
  337|       |
  338|      2|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (338:9): [True: 0, False: 2]
  ------------------
  339|      0|        return;
  340|      2|#endif
  341|       |
  342|      2|    curr = *hands;
  343|      4|    while (curr != NULL) {
  ------------------
  |  Branch (343:12): [True: 2, False: 2]
  ------------------
  344|      2|        if (arg != NULL && curr->arg != arg) {
  ------------------
  |  Branch (344:13): [True: 0, False: 2]
  |  Branch (344:28): [True: 0, False: 0]
  ------------------
  345|      0|            prev = curr;
  346|      0|            curr = curr->next;
  347|      0|            continue;
  348|      0|        }
  349|      2|        curr->handfn(curr->arg);
  350|      2|        if (prev == NULL)
  ------------------
  |  Branch (350:13): [True: 2, False: 0]
  ------------------
  351|      2|            *hands = curr->next;
  352|      0|        else
  353|      0|            prev->next = curr->next;
  354|       |
  355|      2|        tmp = curr;
  356|      2|        curr = curr->next;
  357|       |
  358|      2|        OPENSSL_free(tmp);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  359|      2|    }
  360|      2|#ifndef FIPS_MODULE
  361|      2|    CRYPTO_THREAD_unlock(gtr->lock);
  362|      2|#endif
  363|      2|}
initthread.c:init_thread_deregister:
  423|      2|{
  424|      2|    GLOBAL_TEVENT_REGISTER *gtr;
  425|      2|    int i;
  426|       |
  427|      2|    gtr = get_global_tevent_register();
  428|      2|    if (gtr == NULL)
  ------------------
  |  Branch (428:9): [True: 0, False: 2]
  ------------------
  429|      0|        return 0;
  430|      2|    if (!all) {
  ------------------
  |  Branch (430:9): [True: 0, False: 2]
  ------------------
  431|      0|        if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (431:13): [True: 0, False: 0]
  ------------------
  432|      0|            return 0;
  433|      2|    } else {
  434|      2|        glob_tevent_reg = NULL;
  435|      2|    }
  436|      2|    for (i = 0; i < sk_THREAD_EVENT_HANDLER_PTR_num(gtr->skhands); i++) {
  ------------------
  |  Branch (436:17): [True: 0, False: 2]
  ------------------
  437|      0|        THREAD_EVENT_HANDLER **hands
  438|      0|            = sk_THREAD_EVENT_HANDLER_PTR_value(gtr->skhands, i);
  439|      0|        THREAD_EVENT_HANDLER *curr = NULL, *prev = NULL, *tmp;
  440|       |
  441|      0|        if (hands == NULL) {
  ------------------
  |  Branch (441:13): [True: 0, False: 0]
  ------------------
  442|      0|            if (!all)
  ------------------
  |  Branch (442:17): [True: 0, False: 0]
  ------------------
  443|      0|                CRYPTO_THREAD_unlock(gtr->lock);
  444|      0|            return 0;
  445|      0|        }
  446|      0|        curr = *hands;
  447|      0|        while (curr != NULL) {
  ------------------
  |  Branch (447:16): [True: 0, False: 0]
  ------------------
  448|      0|            if (all || curr->index == index) {
  ------------------
  |  Branch (448:17): [True: 0, False: 0]
  |  Branch (448:24): [True: 0, False: 0]
  ------------------
  449|      0|                if (prev != NULL)
  ------------------
  |  Branch (449:21): [True: 0, False: 0]
  ------------------
  450|      0|                    prev->next = curr->next;
  451|      0|                else
  452|      0|                    *hands = curr->next;
  453|      0|                tmp = curr;
  454|      0|                curr = curr->next;
  455|      0|                OPENSSL_free(tmp);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  456|      0|                continue;
  457|      0|            }
  458|      0|            prev = curr;
  459|      0|            curr = curr->next;
  460|      0|        }
  461|      0|        if (all)
  ------------------
  |  Branch (461:13): [True: 0, False: 0]
  ------------------
  462|      0|            OPENSSL_free(hands);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  463|      0|    }
  464|      2|    if (all) {
  ------------------
  |  Branch (464:9): [True: 2, False: 0]
  ------------------
  465|      2|        CRYPTO_THREAD_lock_free(gtr->lock);
  466|      2|        sk_THREAD_EVENT_HANDLER_PTR_free(gtr->skhands);
  467|      2|        OPENSSL_free(gtr);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  468|      2|    } else {
  469|      0|        CRYPTO_THREAD_unlock(gtr->lock);
  470|      0|    }
  471|      2|    return 1;
  472|      2|}

OPENSSL_LH_set_thunks:
   52|     12|{
   53|       |
   54|     12|    if (lh == NULL)
  ------------------
  |  Branch (54:9): [True: 0, False: 12]
  ------------------
   55|      0|        return NULL;
   56|     12|    lh->compw = cw;
   57|     12|    lh->hashw = hw;
   58|     12|    lh->daw = daw;
   59|     12|    lh->daaw = daaw;
   60|     12|    return lh;
   61|     12|}
OPENSSL_LH_new:
   64|     12|{
   65|     12|    OPENSSL_LHASH *ret;
   66|       |
   67|     12|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  104|     12|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     12|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     12|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (67:9): [True: 0, False: 12]
  ------------------
   68|      0|        return NULL;
   69|     12|    if ((ret->b = OPENSSL_zalloc(sizeof(*ret->b) * MIN_NODES)) == NULL)
  ------------------
  |  |  104|     12|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     12|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     12|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (69:9): [True: 0, False: 12]
  ------------------
   70|      0|        goto err;
   71|     12|    ret->comp = ((c == NULL) ? (OPENSSL_LH_COMPFUNC)strcmp : c);
  ------------------
  |  Branch (71:18): [True: 0, False: 12]
  ------------------
   72|     12|    ret->hash = ((h == NULL) ? (OPENSSL_LH_HASHFUNC)OPENSSL_LH_strhash : h);
  ------------------
  |  Branch (72:18): [True: 0, False: 12]
  ------------------
   73|     12|    ret->num_nodes = MIN_NODES / 2;
  ------------------
  |  |   39|     12|#define MIN_NODES       16
  ------------------
   74|     12|    ret->num_alloc_nodes = MIN_NODES;
  ------------------
  |  |   39|     12|#define MIN_NODES       16
  ------------------
   75|     12|    ret->pmax = MIN_NODES / 2;
  ------------------
  |  |   39|     12|#define MIN_NODES       16
  ------------------
   76|     12|    ret->up_load = UP_LOAD;
  ------------------
  |  |   40|     12|#define UP_LOAD         (2*LH_LOAD_MULT) /* load times 256 (default 2) */
  |  |  ------------------
  |  |  |  |   85|     12|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   77|     12|    ret->down_load = DOWN_LOAD;
  ------------------
  |  |   41|     12|#define DOWN_LOAD       (LH_LOAD_MULT) /* load times 256 (default 1) */
  |  |  ------------------
  |  |  |  |   85|     12|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   78|     12|    return ret;
   79|       |
   80|      0|err:
   81|      0|    OPENSSL_free(ret->b);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   82|      0|    OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   83|      0|    return NULL;
   84|     12|}
OPENSSL_LH_free:
   87|     14|{
   88|     14|    if (lh == NULL)
  ------------------
  |  Branch (88:9): [True: 2, False: 12]
  ------------------
   89|      2|        return;
   90|       |
   91|     12|    OPENSSL_LH_flush(lh);
   92|     12|    OPENSSL_free(lh->b);
  ------------------
  |  |  115|     12|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     12|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     12|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|     12|    OPENSSL_free(lh);
  ------------------
  |  |  115|     12|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     12|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     12|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|     12|}
OPENSSL_LH_flush:
   97|     12|{
   98|     12|    unsigned int i;
   99|     12|    OPENSSL_LH_NODE *n, *nn;
  100|       |
  101|     12|    if (lh == NULL)
  ------------------
  |  Branch (101:9): [True: 0, False: 12]
  ------------------
  102|      0|        return;
  103|       |
  104|  1.57k|    for (i = 0; i < lh->num_nodes; i++) {
  ------------------
  |  Branch (104:17): [True: 1.56k, False: 12]
  ------------------
  105|  1.56k|        n = lh->b[i];
  106|  4.53k|        while (n != NULL) {
  ------------------
  |  Branch (106:16): [True: 2.97k, False: 1.56k]
  ------------------
  107|  2.97k|            nn = n->next;
  108|  2.97k|            OPENSSL_free(n);
  ------------------
  |  |  115|  2.97k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  2.97k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  2.97k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  109|  2.97k|            n = nn;
  110|  2.97k|        }
  111|  1.56k|        lh->b[i] = NULL;
  112|  1.56k|    }
  113|       |
  114|     12|    lh->num_items = 0;
  115|     12|}
OPENSSL_LH_insert:
  118|  8.55k|{
  119|  8.55k|    unsigned long hash;
  120|  8.55k|    OPENSSL_LH_NODE *nn, **rn;
  121|  8.55k|    void *ret;
  122|       |
  123|  8.55k|    lh->error = 0;
  124|  8.55k|    if ((lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) && !expand(lh))
  ------------------
  |  |   85|  8.55k|# define LH_LOAD_MULT    256
  ------------------
  |  Branch (124:9): [True: 1.46k, False: 7.09k]
  |  Branch (124:76): [True: 0, False: 1.46k]
  ------------------
  125|      0|        return NULL;        /* 'lh->error++' already done in 'expand' */
  126|       |
  127|  8.55k|    rn = getrn(lh, data, &hash);
  128|       |
  129|  8.55k|    if (*rn == NULL) {
  ------------------
  |  Branch (129:9): [True: 2.97k, False: 5.57k]
  ------------------
  130|  2.97k|        if ((nn = OPENSSL_malloc(sizeof(*nn))) == NULL) {
  ------------------
  |  |  102|  2.97k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  2.97k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  2.97k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (130:13): [True: 0, False: 2.97k]
  ------------------
  131|      0|            lh->error++;
  132|      0|            return NULL;
  133|      0|        }
  134|  2.97k|        nn->data = data;
  135|  2.97k|        nn->next = NULL;
  136|  2.97k|        nn->hash = hash;
  137|  2.97k|        *rn = nn;
  138|  2.97k|        ret = NULL;
  139|  2.97k|        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.55k|    return ret;
  145|  8.55k|}
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|     10|{
  218|     10|    if (lh == NULL)
  ------------------
  |  Branch (218:9): [True: 0, False: 10]
  ------------------
  219|      0|        return;
  220|       |
  221|     10|    doall_util_fn(lh, 0, lh->daw, func, (OPENSSL_LH_DOALL_FUNCARG)NULL,
  222|     10|                  (OPENSSL_LH_DOALL_FUNCARG_THUNK)NULL, NULL);
  223|     10|}
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|     10|{
  193|     10|    int i;
  194|     10|    OPENSSL_LH_NODE *a, *n;
  195|       |
  196|     10|    if (lh == NULL)
  ------------------
  |  Branch (196:9): [True: 0, False: 10]
  ------------------
  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|     90|    for (i = lh->num_nodes - 1; i >= 0; i--) {
  ------------------
  |  Branch (203:33): [True: 80, False: 10]
  ------------------
  204|     80|        a = lh->b[i];
  205|     96|        while (a != NULL) {
  ------------------
  |  Branch (205:16): [True: 16, False: 80]
  ------------------
  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|     80|    }
  214|     10|}
lhash.c:expand:
  244|  1.46k|{
  245|  1.46k|    OPENSSL_LH_NODE **n, **n1, **n2, *np;
  246|  1.46k|    unsigned int p, pmax, nni, j;
  247|  1.46k|    unsigned long hash;
  248|       |
  249|  1.46k|    nni = lh->num_alloc_nodes;
  250|  1.46k|    p = lh->p;
  251|  1.46k|    pmax = lh->pmax;
  252|  1.46k|    if (p + 1 >= pmax) {
  ------------------
  |  Branch (252:9): [True: 12, False: 1.45k]
  ------------------
  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)
  |  |  ------------------
  |  |  |  |  291|     12|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     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.45k|    } else {
  265|  1.45k|        lh->p++;
  266|  1.45k|    }
  267|       |
  268|  1.46k|    lh->num_nodes++;
  269|  1.46k|    n1 = &(lh->b[p]);
  270|  1.46k|    n2 = &(lh->b[p + pmax]);
  271|  1.46k|    *n2 = NULL;
  272|       |
  273|  6.70k|    for (np = *n1; np != NULL;) {
  ------------------
  |  Branch (273:20): [True: 5.24k, False: 1.46k]
  ------------------
  274|  5.24k|        hash = np->hash;
  275|  5.24k|        if ((hash % nni) != p) { /* move it */
  ------------------
  |  Branch (275:13): [True: 788, False: 4.45k]
  ------------------
  276|    788|            *n1 = (*n1)->next;
  277|    788|            np->next = *n2;
  278|    788|            *n2 = np;
  279|    788|        } else
  280|  4.45k|            n1 = &((*n1)->next);
  281|  5.24k|        np = *n1;
  282|  5.24k|    }
  283|       |
  284|  1.46k|    return 1;
  285|  1.46k|}
lhash.c:getrn:
  322|  8.72k|{
  323|  8.72k|    OPENSSL_LH_NODE **ret, *n1;
  324|  8.72k|    unsigned long hash, nn;
  325|       |
  326|  8.72k|    if (lh->hashw != NULL)
  ------------------
  |  Branch (326:9): [True: 8.72k, False: 0]
  ------------------
  327|  8.72k|        hash = lh->hashw(data, lh->hash);
  328|      0|    else
  329|      0|        hash = lh->hash(data);
  330|       |
  331|  8.72k|    *rhash = hash;
  332|       |
  333|  8.72k|    nn = hash % lh->pmax;
  334|  8.72k|    if (nn < lh->p)
  ------------------
  |  Branch (334:9): [True: 3.82k, False: 4.89k]
  ------------------
  335|  3.82k|        nn = hash % lh->num_alloc_nodes;
  336|       |
  337|  8.72k|    ret = &(lh->b[(int)nn]);
  338|  21.9k|    for (n1 = *ret; n1 != NULL; n1 = n1->next) {
  ------------------
  |  Branch (338:21): [True: 18.7k, False: 3.14k]
  ------------------
  339|  18.7k|        if (n1->hash != hash) {
  ------------------
  |  Branch (339:13): [True: 12.8k, False: 5.88k]
  ------------------
  340|  12.8k|            ret = &(n1->next);
  341|  12.8k|            continue;
  342|  12.8k|        }
  343|       |
  344|  5.88k|        if (lh->compw != NULL) {
  ------------------
  |  Branch (344:13): [True: 5.88k, False: 0]
  ------------------
  345|  5.88k|            if (lh->compw(n1->data, data, lh->comp) == 0)
  ------------------
  |  Branch (345:17): [True: 5.57k, False: 304]
  ------------------
  346|  5.57k|                break;
  347|  5.88k|        } else {
  348|      0|            if (lh->comp(n1->data, data) == 0)
  ------------------
  |  Branch (348:17): [True: 0, False: 0]
  ------------------
  349|      0|                break;
  350|      0|        }
  351|    304|        ret = &(n1->next);
  352|    304|    }
  353|  8.72k|    return ret;
  354|  8.72k|}

CRYPTO_malloc:
  178|  29.3k|{
  179|  29.3k|    void *ptr;
  180|       |
  181|  29.3k|    INCREMENT(malloc_count);
  182|  29.3k|    if (malloc_impl != CRYPTO_malloc) {
  ------------------
  |  Branch (182:9): [True: 0, False: 29.3k]
  ------------------
  183|      0|        ptr = malloc_impl(num, file, line);
  184|      0|        if (ptr != NULL || num == 0)
  ------------------
  |  Branch (184:13): [True: 0, False: 0]
  |  Branch (184:28): [True: 0, False: 0]
  ------------------
  185|      0|            return ptr;
  186|      0|        goto err;
  187|      0|    }
  188|       |
  189|  29.3k|    if (num == 0)
  ------------------
  |  Branch (189:9): [True: 22, False: 29.3k]
  ------------------
  190|     22|        return NULL;
  191|       |
  192|  29.3k|    FAILTEST();
  193|  29.3k|    if (allow_customize) {
  ------------------
  |  Branch (193:9): [True: 2, False: 29.3k]
  ------------------
  194|       |        /*
  195|       |         * Disallow customization after the first allocation. We only set this
  196|       |         * if necessary to avoid a store to the same cache line on every
  197|       |         * allocation.
  198|       |         */
  199|      2|        allow_customize = 0;
  200|      2|    }
  201|       |
  202|  29.3k|    ptr = malloc(num);
  203|  29.3k|    if (ptr != NULL)
  ------------------
  |  Branch (203:9): [True: 29.3k, False: 0]
  ------------------
  204|  29.3k|        return ptr;
  205|      0| err:
  206|       |    /*
  207|       |     * ossl_err_get_state_int() in err.c uses CRYPTO_zalloc(num, NULL, 0) for
  208|       |     * ERR_STATE allocation. Prevent mem alloc error loop while reporting error.
  209|       |     */
  210|      0|    if (file != NULL || line != 0) {
  ------------------
  |  Branch (210:9): [True: 0, False: 0]
  |  Branch (210:25): [True: 0, False: 0]
  ------------------
  211|      0|        ERR_new();
  212|      0|        ERR_set_debug(file, line, NULL);
  213|      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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  214|      0|    }
  215|      0|    return NULL;
  216|  29.3k|}
CRYPTO_zalloc:
  219|  15.4k|{
  220|  15.4k|    void *ret;
  221|       |
  222|  15.4k|    ret = CRYPTO_malloc(num, file, line);
  223|  15.4k|    if (ret != NULL)
  ------------------
  |  Branch (223:9): [True: 15.4k, False: 0]
  ------------------
  224|  15.4k|        memset(ret, 0, num);
  225|       |
  226|  15.4k|    return ret;
  227|  15.4k|}
CRYPTO_realloc:
  289|     14|{
  290|     14|    INCREMENT(realloc_count);
  291|     14|    if (realloc_impl != CRYPTO_realloc)
  ------------------
  |  Branch (291:9): [True: 0, False: 14]
  ------------------
  292|      0|        return realloc_impl(str, num, file, line);
  293|       |
  294|     14|    if (str == NULL)
  ------------------
  |  Branch (294:9): [True: 0, False: 14]
  ------------------
  295|      0|        return CRYPTO_malloc(num, file, line);
  296|       |
  297|     14|    if (num == 0) {
  ------------------
  |  Branch (297:9): [True: 0, False: 14]
  ------------------
  298|      0|        CRYPTO_free(str, file, line);
  299|      0|        return NULL;
  300|      0|    }
  301|       |
  302|     14|    FAILTEST();
  303|     14|    return realloc(str, num);
  304|     14|}
CRYPTO_clear_realloc:
  308|  4.11k|{
  309|  4.11k|    void *ret = NULL;
  310|       |
  311|  4.11k|    if (str == NULL)
  ------------------
  |  Branch (311:9): [True: 1.65k, False: 2.46k]
  ------------------
  312|  1.65k|        return CRYPTO_malloc(num, file, line);
  313|       |
  314|  2.46k|    if (num == 0) {
  ------------------
  |  Branch (314:9): [True: 0, False: 2.46k]
  ------------------
  315|      0|        CRYPTO_clear_free(str, old_len, file, line);
  316|      0|        return NULL;
  317|      0|    }
  318|       |
  319|       |    /* Can't shrink the buffer since memcpy below copies |old_len| bytes. */
  320|  2.46k|    if (num < old_len) {
  ------------------
  |  Branch (320:9): [True: 0, False: 2.46k]
  ------------------
  321|      0|        OPENSSL_cleanse((char*)str + num, old_len - num);
  322|      0|        return str;
  323|      0|    }
  324|       |
  325|  2.46k|    ret = CRYPTO_malloc(num, file, line);
  326|  2.46k|    if (ret != NULL) {
  ------------------
  |  Branch (326:9): [True: 2.46k, False: 0]
  ------------------
  327|  2.46k|        memcpy(ret, str, old_len);
  328|  2.46k|        CRYPTO_clear_free(str, old_len, file, line);
  329|  2.46k|    }
  330|  2.46k|    return ret;
  331|  2.46k|}
CRYPTO_free:
  334|  82.3k|{
  335|  82.3k|    INCREMENT(free_count);
  336|  82.3k|    if (free_impl != CRYPTO_free) {
  ------------------
  |  Branch (336:9): [True: 0, False: 82.3k]
  ------------------
  337|      0|        free_impl(str, file, line);
  338|      0|        return;
  339|      0|    }
  340|       |
  341|  82.3k|    free(str);
  342|  82.3k|}
CRYPTO_clear_free:
  345|  4.11k|{
  346|  4.11k|    if (str == NULL)
  ------------------
  |  Branch (346:9): [True: 0, False: 4.11k]
  ------------------
  347|      0|        return;
  348|  4.11k|    if (num)
  ------------------
  |  Branch (348:9): [True: 4.11k, False: 0]
  ------------------
  349|  4.11k|        OPENSSL_cleanse(str, num);
  350|  4.11k|    CRYPTO_free(str, file, line);
  351|  4.11k|}

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|  2.85k|{
  156|  2.85k|#ifndef OPENSSL_NO_SECURE_MEMORY
  157|  2.85k|    void *ret = NULL;
  158|  2.85k|    size_t actual_size;
  159|  2.85k|    int reason = CRYPTO_R_SECURE_MALLOC_FAILURE;
  ------------------
  |  |   47|  2.85k|# define CRYPTO_R_SECURE_MALLOC_FAILURE                   111
  ------------------
  160|       |
  161|  2.85k|    if (!secure_mem_initialized) {
  ------------------
  |  Branch (161:9): [True: 2.85k, False: 0]
  ------------------
  162|  2.85k|        return CRYPTO_malloc(num, file, line);
  163|  2.85k|    }
  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.73k|{
  196|  1.73k|#ifndef OPENSSL_NO_SECURE_MEMORY
  197|  1.73k|    size_t actual_size;
  198|       |
  199|  1.73k|    if (ptr == NULL)
  ------------------
  |  Branch (199:9): [True: 1.51k, False: 222]
  ------------------
  200|  1.51k|        return;
  201|    222|    if (!CRYPTO_secure_allocated(ptr)) {
  ------------------
  |  Branch (201:9): [True: 222, False: 0]
  ------------------
  202|    222|        CRYPTO_free(ptr, file, line);
  203|    222|        return;
  204|    222|    }
  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|  2.88k|{
  220|  2.88k|#ifndef OPENSSL_NO_SECURE_MEMORY
  221|  2.88k|    size_t actual_size;
  222|       |
  223|  2.88k|    if (ptr == NULL)
  ------------------
  |  Branch (223:9): [True: 264, False: 2.61k]
  ------------------
  224|    264|        return;
  225|  2.61k|    if (!CRYPTO_secure_allocated(ptr)) {
  ------------------
  |  Branch (225:9): [True: 2.61k, False: 0]
  ------------------
  226|  2.61k|        OPENSSL_cleanse(ptr, num);
  227|  2.61k|        CRYPTO_free(ptr, file, line);
  228|  2.61k|        return;
  229|  2.61k|    }
  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|  2.84k|{
  247|  2.84k|#ifndef OPENSSL_NO_SECURE_MEMORY
  248|  2.84k|    if (!secure_mem_initialized)
  ------------------
  |  Branch (248:9): [True: 2.84k, False: 0]
  ------------------
  249|  2.84k|        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|  2.84k|}
mem_sec.c:sh_done:
  599|      2|{
  600|      2|    OPENSSL_free(sh.freelist);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  601|      2|    OPENSSL_free(sh.bittable);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  602|      2|    OPENSSL_free(sh.bitmalloc);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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|}

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

PEM_read_bio_ex:
  926|  1.25k|{
  927|  1.25k|    EVP_ENCODE_CTX *ctx = NULL;
  928|  1.25k|    const BIO_METHOD *bmeth;
  929|  1.25k|    BIO *headerB = NULL, *dataB = NULL;
  930|  1.25k|    char *name = NULL;
  931|  1.25k|    int len, taillen, headerlen, ret = 0;
  932|  1.25k|    BUF_MEM *buf_mem;
  933|       |
  934|  1.25k|    *len_out = 0;
  935|  1.25k|    *name_out = *header = NULL;
  936|  1.25k|    *data = NULL;
  937|  1.25k|    if ((flags & PEM_FLAG_EAY_COMPATIBLE) && (flags & PEM_FLAG_ONLY_B64)) {
  ------------------
  |  |  381|  1.25k|#   define PEM_FLAG_EAY_COMPATIBLE     0x2
  ------------------
                  if ((flags & PEM_FLAG_EAY_COMPATIBLE) && (flags & PEM_FLAG_ONLY_B64)) {
  ------------------
  |  |  382|    336|#   define PEM_FLAG_ONLY_B64           0x4
  ------------------
  |  Branch (937:9): [True: 336, False: 919]
  |  Branch (937:46): [True: 4, False: 332]
  ------------------
  938|       |        /* These two are mutually incompatible; bail out. */
  939|      4|        ERR_raise(ERR_LIB_PEM, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      4|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      4|    (ERR_new(),                                                 \
  |  |  |  |  404|      4|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      4|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      4|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      4|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      4|     ERR_set_error)
  |  |  ------------------
  ------------------
  940|      4|        goto end;
  941|      4|    }
  942|  1.25k|    bmeth = (flags & PEM_FLAG_SECURE) ? BIO_s_secmem() : BIO_s_mem();
  ------------------
  |  |  380|  1.25k|#   define PEM_FLAG_SECURE             0x1
  ------------------
  |  Branch (942:13): [True: 577, False: 674]
  ------------------
  943|       |
  944|  1.25k|    headerB = BIO_new(bmeth);
  945|  1.25k|    dataB = BIO_new(bmeth);
  946|  1.25k|    if (headerB == NULL || dataB == NULL) {
  ------------------
  |  Branch (946:9): [True: 0, False: 1.25k]
  |  Branch (946:28): [True: 0, False: 1.25k]
  ------------------
  947|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  948|      0|        goto end;
  949|      0|    }
  950|       |
  951|  1.25k|    if (!get_name(bp, &name, flags))
  ------------------
  |  Branch (951:9): [True: 370, False: 881]
  ------------------
  952|    370|        goto end;
  953|    881|    if (!get_header_and_data(bp, &headerB, &dataB, name, flags))
  ------------------
  |  Branch (953:9): [True: 629, False: 252]
  ------------------
  954|    629|        goto end;
  955|       |
  956|    252|    BIO_get_mem_ptr(dataB, &buf_mem);
  ------------------
  |  |  613|    252|# define BIO_get_mem_ptr(b,pp)   BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0, \
  |  |  ------------------
  |  |  |  |  445|    252|# define BIO_C_GET_BUF_MEM_PTR                   115
  |  |  ------------------
  |  |  614|    252|                                          (char *)(pp))
  ------------------
  957|    252|    len = buf_mem->length;
  958|       |
  959|       |    /* There was no data in the PEM file */
  960|    252|    if (len == 0)
  ------------------
  |  Branch (960:9): [True: 3, False: 249]
  ------------------
  961|      3|        goto end;
  962|       |
  963|    249|    ctx = EVP_ENCODE_CTX_new();
  964|    249|    if (ctx == NULL) {
  ------------------
  |  Branch (964:9): [True: 0, False: 249]
  ------------------
  965|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  966|      0|        goto end;
  967|      0|    }
  968|       |
  969|    249|    EVP_DecodeInit(ctx);
  970|    249|    if (EVP_DecodeUpdate(ctx, (unsigned char*)buf_mem->data, &len,
  ------------------
  |  Branch (970:9): [True: 31, False: 218]
  ------------------
  971|    249|                         (unsigned char*)buf_mem->data, len) < 0
  972|    249|            || EVP_DecodeFinal(ctx, (unsigned char*)&(buf_mem->data[len]),
  ------------------
  |  Branch (972:16): [True: 46, False: 172]
  ------------------
  973|    218|                               &taillen) < 0) {
  974|     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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     77|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     77|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     77|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     77|     ERR_set_error)
  |  |  ------------------
  ------------------
  975|     77|        goto end;
  976|     77|    }
  977|    172|    len += taillen;
  978|    172|    buf_mem->length = len;
  979|       |
  980|    172|    headerlen = BIO_get_mem_data(headerB, NULL);
  ------------------
  |  |  611|    172|# define BIO_get_mem_data(b,pp)  BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)(pp))
  |  |  ------------------
  |  |  |  |   90|    172|# define BIO_CTRL_INFO           3/* opt - extra tit-bits */
  |  |  ------------------
  ------------------
  981|    172|    *header = PEM_MALLOC(headerlen + 1, flags);
  ------------------
  |  |  233|    172|    pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    172|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    172|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  982|    172|    *data = PEM_MALLOC(len, flags);
  ------------------
  |  |  233|    172|    pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    172|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    172|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  983|    172|    if (*header == NULL || *data == NULL)
  ------------------
  |  Branch (983:9): [True: 0, False: 172]
  |  Branch (983:28): [True: 22, False: 150]
  ------------------
  984|     22|        goto out_free;
  985|    150|    if (headerlen != 0 && BIO_read(headerB, *header, headerlen) != headerlen)
  ------------------
  |  Branch (985:9): [True: 46, False: 104]
  |  Branch (985:27): [True: 0, False: 46]
  ------------------
  986|      0|        goto out_free;
  987|    150|    (*header)[headerlen] = '\0';
  988|    150|    if (BIO_read(dataB, *data, len) != len)
  ------------------
  |  Branch (988:9): [True: 0, False: 150]
  ------------------
  989|      0|        goto out_free;
  990|    150|    *len_out = len;
  991|    150|    *name_out = name;
  992|    150|    name = NULL;
  993|    150|    ret = 1;
  994|    150|    goto end;
  995|       |
  996|     22|out_free:
  997|     22|    PEM_FREE(*header, flags, 0);
  ------------------
  |  |  222|     22|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     22|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     22|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  998|     22|    *header = NULL;
  999|     22|    PEM_FREE(*data, flags, 0);
  ------------------
  |  |  222|     22|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     22|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     22|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1000|     22|    *data = NULL;
 1001|  1.25k|end:
 1002|  1.25k|    EVP_ENCODE_CTX_free(ctx);
 1003|  1.25k|    PEM_FREE(name, flags, 0);
  ------------------
  |  |  222|  1.25k|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.25k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.25k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1004|  1.25k|    BIO_free(headerB);
 1005|  1.25k|    BIO_free(dataB);
 1006|  1.25k|    return ret;
 1007|     22|}
pem_lib.c:get_name:
  755|  1.25k|{
  756|  1.25k|    char *linebuf;
  757|  1.25k|    int ret = 0;
  758|  1.25k|    int len;
  759|  1.25k|    int first_call = 1;
  760|       |
  761|       |    /*
  762|       |     * Need to hold trailing NUL (accounted for by BIO_gets() and the newline
  763|       |     * that will be added by sanitize_line() (the extra '1').
  764|       |     */
  765|  1.25k|    linebuf = PEM_MALLOC(LINESIZE + 1, flags);
  ------------------
  |  |  233|  1.25k|    pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.25k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.25k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  766|  1.25k|    if (linebuf == NULL)
  ------------------
  |  Branch (766:9): [True: 0, False: 1.25k]
  ------------------
  767|      0|        return 0;
  768|       |
  769|   111k|    do {
  770|   111k|        len = BIO_gets(bp, linebuf, LINESIZE);
  ------------------
  |  |  746|   111k|#define LINESIZE 255
  ------------------
  771|       |
  772|   111k|        if (len <= 0) {
  ------------------
  |  Branch (772:13): [True: 370, False: 111k]
  ------------------
  773|    370|            ERR_raise(ERR_LIB_PEM, PEM_R_NO_START_LINE);
  ------------------
  |  |  401|    370|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    370|    (ERR_new(),                                                 \
  |  |  |  |  404|    370|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    370|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    370|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    370|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    370|     ERR_set_error)
  |  |  ------------------
  ------------------
  774|    370|            goto err;
  775|    370|        }
  776|       |
  777|       |        /* Strip trailing garbage and standardize ending. */
  778|   111k|        len = sanitize_line(linebuf, len, flags & ~PEM_FLAG_ONLY_B64, first_call);
  ------------------
  |  |  382|   111k|#   define PEM_FLAG_ONLY_B64           0x4
  ------------------
  779|   111k|        first_call = 0;
  780|       |
  781|       |        /* Allow leading empty or non-matching lines. */
  782|   111k|    } while (!HAS_PREFIX(linebuf, BEGINSTR)
  ------------------
  |  |   58|   222k|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  ------------------
  |  Branch (782:14): [True: 110k, False: 1.14k]
  ------------------
  783|   111k|             || len < TAILLEN
  ------------------
  |  |  753|   112k|#define TAILLEN ((int)(sizeof(TAILSTR) - 1))
  |  |  ------------------
  |  |  |  |  750|  1.14k|#define TAILSTR "-----\n"
  |  |  ------------------
  ------------------
  |  Branch (783:17): [True: 0, False: 1.14k]
  ------------------
  784|   111k|             || !HAS_PREFIX(linebuf + len - TAILLEN, TAILSTR));
  ------------------
  |  |   58|  1.14k|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  ------------------
  |  Branch (784:17): [True: 264, False: 881]
  ------------------
  785|    881|    linebuf[len - TAILLEN] = '\0';
  ------------------
  |  |  753|    881|#define TAILLEN ((int)(sizeof(TAILSTR) - 1))
  |  |  ------------------
  |  |  |  |  750|    881|#define TAILSTR "-----\n"
  |  |  ------------------
  ------------------
  786|    881|    len = len - BEGINLEN - TAILLEN + 1;
  ------------------
  |  |  751|    881|#define BEGINLEN ((int)(sizeof(BEGINSTR) - 1))
  |  |  ------------------
  |  |  |  |  748|    881|#define BEGINSTR "-----BEGIN "
  |  |  ------------------
  ------------------
                  len = len - BEGINLEN - TAILLEN + 1;
  ------------------
  |  |  753|    881|#define TAILLEN ((int)(sizeof(TAILSTR) - 1))
  |  |  ------------------
  |  |  |  |  750|    881|#define TAILSTR "-----\n"
  |  |  ------------------
  ------------------
  787|    881|    *name = PEM_MALLOC(len, flags);
  ------------------
  |  |  233|    881|    pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    881|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    881|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  788|    881|    if (*name == NULL)
  ------------------
  |  Branch (788:9): [True: 0, False: 881]
  ------------------
  789|      0|        goto err;
  790|    881|    memcpy(*name, linebuf + BEGINLEN, len);
  ------------------
  |  |  751|    881|#define BEGINLEN ((int)(sizeof(BEGINSTR) - 1))
  |  |  ------------------
  |  |  |  |  748|    881|#define BEGINSTR "-----BEGIN "
  |  |  ------------------
  ------------------
  791|    881|    ret = 1;
  792|       |
  793|  1.25k|err:
  794|  1.25k|    PEM_FREE(linebuf, flags, LINESIZE + 1);
  ------------------
  |  |  222|  1.25k|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  1.25k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  1.25k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  795|  1.25k|    return ret;
  796|    881|}
pem_lib.c:sanitize_line:
  702|   381k|{
  703|   381k|    int i;
  704|   381k|    if (first_call) {
  ------------------
  |  Branch (704:9): [True: 1.25k, False: 379k]
  ------------------
  705|       |        /* Other BOMs imply unsupported multibyte encoding,
  706|       |         * so don't strip them and let the error raise */
  707|  1.25k|        const unsigned char utf8_bom[3] = {0xEF, 0xBB, 0xBF};
  708|       |
  709|  1.25k|        if (len > 3 && memcmp(linebuf, utf8_bom, 3) == 0) {
  ------------------
  |  Branch (709:13): [True: 1.11k, False: 134]
  |  Branch (709:24): [True: 1, False: 1.11k]
  ------------------
  710|      1|            memmove(linebuf, linebuf + 3, len - 3);
  711|      1|            linebuf[len - 3] = 0;
  712|      1|            len -= 3;
  713|      1|        }
  714|  1.25k|    }
  715|       |
  716|   381k|    if (flags & PEM_FLAG_EAY_COMPATIBLE) {
  ------------------
  |  |  381|   381k|#   define PEM_FLAG_EAY_COMPATIBLE     0x2
  ------------------
  |  Branch (716:9): [True: 65.8k, False: 315k]
  ------------------
  717|       |        /* Strip trailing whitespace */
  718|  2.04M|        while ((len >= 0) && (linebuf[len] <= ' '))
  ------------------
  |  Branch (718:16): [True: 2.03M, False: 9.02k]
  |  Branch (718:30): [True: 1.97M, False: 56.8k]
  ------------------
  719|  1.97M|            len--;
  720|       |        /* Go back to whitespace before applying uniform line ending. */
  721|  65.8k|        len++;
  722|   315k|    } else if (flags & PEM_FLAG_ONLY_B64) {
  ------------------
  |  |  382|   315k|#   define PEM_FLAG_ONLY_B64           0x4
  ------------------
  |  Branch (722:16): [True: 5.09k, False: 310k]
  ------------------
  723|   962k|        for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (723:21): [True: 958k, False: 3.48k]
  ------------------
  724|   958k|            if (!ossl_isbase64(linebuf[i]) || linebuf[i] == '\n'
  ------------------
  |  |   84|  1.91M|# define ossl_isbase64(c)       (ossl_ctype_check((c), CTYPE_MASK_base64))
  |  |  ------------------
  |  |  |  |   37|   958k|# define CTYPE_MASK_base64      0x400
  |  |  ------------------
  ------------------
  |  Branch (724:17): [True: 1.61k, False: 957k]
  |  Branch (724:47): [True: 0, False: 957k]
  ------------------
  725|   958k|                || linebuf[i] == '\r')
  ------------------
  |  Branch (725:20): [True: 0, False: 957k]
  ------------------
  726|  1.61k|                break;
  727|   958k|        }
  728|  5.09k|        len = i;
  729|   310k|    } else {
  730|       |        /* EVP_DecodeBlock strips leading and trailing whitespace, so just strip
  731|       |         * control characters in-place and let everything through. */
  732|  30.6M|        for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (732:21): [True: 30.5M, False: 106k]
  ------------------
  733|  30.5M|            if (linebuf[i] == '\n' || linebuf[i] == '\r')
  ------------------
  |  Branch (733:17): [True: 203k, False: 30.3M]
  |  Branch (733:39): [True: 613, False: 30.3M]
  ------------------
  734|   203k|                break;
  735|  30.3M|            if (ossl_iscntrl(linebuf[i]))
  ------------------
  |  |   78|  30.3M|# define ossl_iscntrl(c)        (ossl_ctype_check((c), CTYPE_MASK_cntrl))
  |  |  ------------------
  |  |  |  |   33|  30.3M|# define CTYPE_MASK_cntrl       0x40
  |  |  ------------------
  |  |  |  Branch (78:33): [True: 18.2M, False: 12.0M]
  |  |  ------------------
  ------------------
  736|  18.2M|                linebuf[i] = ' ';
  737|  30.3M|        }
  738|   310k|        len = i;
  739|   310k|    }
  740|       |    /* The caller allocated LINESIZE+1, so this is safe. */
  741|   381k|    linebuf[len++] = '\n';
  742|   381k|    linebuf[len] = '\0';
  743|   381k|    return len;
  744|   381k|}
pem_lib.c:get_header_and_data:
  818|    881|{
  819|    881|    BIO *tmp = *header;
  820|    881|    char *linebuf, *p;
  821|    881|    int len, ret = 0, end = 0, prev_partial_line_read = 0, partial_line_read = 0;
  822|       |    /* 0 if not seen (yet), 1 if reading header, 2 if finished header */
  823|    881|    enum header_status got_header = MAYBE_HEADER;
  824|    881|    unsigned int flags_mask;
  825|    881|    size_t namelen;
  826|       |
  827|       |    /* Need to hold trailing NUL (accounted for by BIO_gets() and the newline
  828|       |     * that will be added by sanitize_line() (the extra '1'). */
  829|    881|    linebuf = PEM_MALLOC(LINESIZE + 1, flags);
  ------------------
  |  |  233|    881|    pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    881|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    881|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  830|    881|    if (linebuf == NULL)
  ------------------
  |  Branch (830:9): [True: 0, False: 881]
  ------------------
  831|      0|        return 0;
  832|       |
  833|   270k|    while(1) {
  ------------------
  |  Branch (833:11): [Folded - Ignored]
  ------------------
  834|   270k|        flags_mask = ~0u;
  835|   270k|        len = BIO_gets(bp, linebuf, LINESIZE);
  ------------------
  |  |  746|   270k|#define LINESIZE 255
  ------------------
  836|   270k|        if (len <= 0) {
  ------------------
  |  Branch (836:13): [True: 396, False: 269k]
  ------------------
  837|    396|            ERR_raise(ERR_LIB_PEM, PEM_R_BAD_END_LINE);
  ------------------
  |  |  401|    396|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    396|    (ERR_new(),                                                 \
  |  |  |  |  404|    396|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    396|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    396|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    396|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    396|     ERR_set_error)
  |  |  ------------------
  ------------------
  838|    396|            goto err;
  839|    396|        }
  840|       |
  841|       |        /*
  842|       |         * Check if line has been read completely or if only part of the line
  843|       |         * has been read. Keep the previous value to ignore newlines that
  844|       |         * appear due to reading a line up until the char before the newline.
  845|       |         */
  846|   269k|        prev_partial_line_read = partial_line_read;
  847|   269k|        partial_line_read = len == LINESIZE-1 && linebuf[LINESIZE-2] != '\n';
  ------------------
  |  |  746|   269k|#define LINESIZE 255
  ------------------
                      partial_line_read = len == LINESIZE-1 && linebuf[LINESIZE-2] != '\n';
  ------------------
  |  |  746|   122k|#define LINESIZE 255
  ------------------
  |  Branch (847:29): [True: 122k, False: 147k]
  |  Branch (847:50): [True: 122k, False: 142]
  ------------------
  848|       |
  849|   269k|        if (got_header == MAYBE_HEADER) {
  ------------------
  |  Branch (849:13): [True: 203k, False: 65.8k]
  ------------------
  850|   203k|            if (memchr(linebuf, ':', len) != NULL)
  ------------------
  |  Branch (850:17): [True: 90, False: 203k]
  ------------------
  851|     90|                got_header = IN_HEADER;
  852|   203k|        }
  853|   269k|        if (HAS_PREFIX(linebuf, ENDSTR) || got_header == IN_HEADER)
  ------------------
  |  |   58|   539k|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 673, False: 269k]
  |  |  ------------------
  ------------------
  |  Branch (853:44): [True: 65.0k, False: 203k]
  ------------------
  854|  65.7k|            flags_mask &= ~PEM_FLAG_ONLY_B64;
  ------------------
  |  |  382|  65.7k|#   define PEM_FLAG_ONLY_B64           0x4
  ------------------
  855|   269k|        len = sanitize_line(linebuf, len, flags & flags_mask, 0);
  856|       |
  857|       |        /* Check for end of header. */
  858|   269k|        if (linebuf[0] == '\n') {
  ------------------
  |  Branch (858:13): [True: 1.69k, False: 268k]
  ------------------
  859|       |            /*
  860|       |             * If previous line has been read only partially this newline is a
  861|       |             * regular newline at the end of a line and not an empty line.
  862|       |             */
  863|  1.69k|            if (!prev_partial_line_read) {
  ------------------
  |  Branch (863:17): [True: 162, False: 1.53k]
  ------------------
  864|    162|                if (got_header == POST_HEADER) {
  ------------------
  |  Branch (864:21): [True: 16, False: 146]
  ------------------
  865|       |                    /* Another blank line is an error. */
  866|     16|                    ERR_raise(ERR_LIB_PEM, PEM_R_BAD_END_LINE);
  ------------------
  |  |  401|     16|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     16|    (ERR_new(),                                                 \
  |  |  |  |  404|     16|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|     16|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|     16|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|     16|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     16|     ERR_set_error)
  |  |  ------------------
  ------------------
  867|     16|                    goto err;
  868|     16|                }
  869|    146|                got_header = POST_HEADER;
  870|    146|                tmp = *data;
  871|    146|            }
  872|  1.67k|            continue;
  873|  1.69k|        }
  874|       |
  875|       |        /* Check for end of stream (which means there is no header). */
  876|   268k|        p = linebuf;
  877|   268k|        if (CHECK_AND_SKIP_PREFIX(p, ENDSTR)) {
  ------------------
  |  |   61|   268k|    (HAS_PREFIX(str, pre) ? ((str) += sizeof(pre) - 1, 1) : 0)
  |  |  ------------------
  |  |  |  |   58|   268k|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (58:30): [True: 459, False: 267k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:5): [True: 459, False: 267k]
  |  |  ------------------
  ------------------
  878|    459|            namelen = strlen(name);
  879|    459|            if (strncmp(p, name, namelen) != 0 ||
  ------------------
  |  Branch (879:17): [True: 149, False: 310]
  ------------------
  880|    459|                !HAS_PREFIX(p + namelen, TAILSTR)) {
  ------------------
  |  |   58|    310|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  ------------------
  |  Branch (880:17): [True: 58, False: 252]
  ------------------
  881|    207|                ERR_raise(ERR_LIB_PEM, PEM_R_BAD_END_LINE);
  ------------------
  |  |  401|    207|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    207|    (ERR_new(),                                                 \
  |  |  |  |  404|    207|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|    207|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|    207|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|    207|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    207|     ERR_set_error)
  |  |  ------------------
  ------------------
  882|    207|                goto err;
  883|    207|            }
  884|    252|            if (got_header == MAYBE_HEADER) {
  ------------------
  |  Branch (884:17): [True: 192, False: 60]
  ------------------
  885|    192|                *header = *data;
  886|    192|                *data = tmp;
  887|    192|            }
  888|    252|            break;
  889|   267k|        } else if (end) {
  ------------------
  |  Branch (889:20): [True: 4, False: 267k]
  ------------------
  890|       |            /* Malformed input; short line not at end of data. */
  891|      4|            ERR_raise(ERR_LIB_PEM, PEM_R_BAD_END_LINE);
  ------------------
  |  |  401|      4|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      4|    (ERR_new(),                                                 \
  |  |  |  |  404|      4|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      4|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      4|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      4|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      4|     ERR_set_error)
  |  |  ------------------
  ------------------
  892|      4|            goto err;
  893|      4|        }
  894|       |        /*
  895|       |         * Else, a line of text -- could be header or data; we don't
  896|       |         * know yet.  Just pass it through.
  897|       |         */
  898|   267k|        if (BIO_puts(tmp, linebuf) < 0)
  ------------------
  |  Branch (898:13): [True: 0, False: 267k]
  ------------------
  899|      0|            goto err;
  900|       |        /*
  901|       |         * Only encrypted files need the line length check applied.
  902|       |         */
  903|   267k|        if (got_header == POST_HEADER) {
  ------------------
  |  Branch (903:13): [True: 406, False: 267k]
  ------------------
  904|       |            /* 65 includes the trailing newline */
  905|    406|            if (len > 65)
  ------------------
  |  Branch (905:17): [True: 6, False: 400]
  ------------------
  906|      6|                goto err;
  907|    400|            if (len < 65)
  ------------------
  |  Branch (907:17): [True: 90, False: 310]
  ------------------
  908|     90|                end = 1;
  909|    400|        }
  910|   267k|    }
  911|       |
  912|    252|    ret = 1;
  913|    881|err:
  914|    881|    PEM_FREE(linebuf, flags, LINESIZE + 1);
  ------------------
  |  |  222|    881|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    881|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    881|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  915|    881|    return ret;
  916|    252|}
pem_lib.c:pem_malloc:
  236|  3.35k|{
  237|  3.35k|    return (flags & PEM_FLAG_SECURE) ? CRYPTO_secure_malloc(num, file, line)
  ------------------
  |  |  380|  3.35k|#   define PEM_FLAG_SECURE             0x1
  ------------------
  |  Branch (237:12): [True: 1.54k, False: 1.81k]
  ------------------
  238|  3.35k|                                     : CRYPTO_malloc(num, file, line);
  239|       |
  240|  3.35k|}
pem_lib.c:pem_free:
  225|  3.43k|{
  226|  3.43k|    if (flags & PEM_FLAG_SECURE)
  ------------------
  |  |  380|  3.43k|#   define PEM_FLAG_SECURE             0x1
  ------------------
  |  Branch (226:9): [True: 1.57k, False: 1.85k]
  ------------------
  227|  1.57k|        CRYPTO_secure_clear_free(p, num, file, line);
  228|  1.85k|    else
  229|  1.85k|        CRYPTO_free(p, file, line);
  230|  3.43k|}

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:
  114|      2|{
  115|      2|    OSSL_GLOBAL_PROPERTIES *globp = vglobp;
  116|       |
  117|      2|    if (globp != NULL) {
  ------------------
  |  Branch (117:9): [True: 2, False: 0]
  ------------------
  118|      2|        ossl_property_free(globp->list);
  119|      2|        OPENSSL_free(globp);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  120|      2|    }
  121|      2|}
ossl_ctx_global_properties_new:
  124|      2|{
  125|      2|    return OPENSSL_zalloc(sizeof(OSSL_GLOBAL_PROPERTIES));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  126|      2|}
ossl_method_store_new:
  243|      8|{
  244|      8|    OSSL_METHOD_STORE *res;
  245|       |
  246|      8|    res = OPENSSL_zalloc(sizeof(*res));
  ------------------
  |  |  104|      8|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  247|      8|    if (res != NULL) {
  ------------------
  |  Branch (247:9): [True: 8, False: 0]
  ------------------
  248|      8|        res->ctx = ctx;
  249|      8|        if ((res->algs = ossl_sa_ALGORITHM_new()) == NULL
  ------------------
  |  Branch (249:13): [True: 0, False: 8]
  ------------------
  250|      8|            || (res->lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (250:16): [True: 0, False: 8]
  ------------------
  251|      8|            || (res->biglock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (251:16): [True: 0, False: 8]
  ------------------
  252|      0|            ossl_method_store_free(res);
  253|      0|            return NULL;
  254|      0|        }
  255|      8|    }
  256|      8|    return res;
  257|      8|}
ossl_method_store_free:
  260|      8|{
  261|      8|    if (store != NULL) {
  ------------------
  |  Branch (261:9): [True: 8, False: 0]
  ------------------
  262|      8|        if (store->algs != NULL)
  ------------------
  |  Branch (262:13): [True: 8, False: 0]
  ------------------
  263|      8|            ossl_sa_ALGORITHM_doall_arg(store->algs, &alg_cleanup, store);
  264|      8|        ossl_sa_ALGORITHM_free(store->algs);
  265|      8|        CRYPTO_THREAD_lock_free(store->lock);
  266|      8|        CRYPTO_THREAD_lock_free(store->biglock);
  267|      8|        OPENSSL_free(store);
  ------------------
  |  |  115|      8|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  268|      8|    }
  269|      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)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  532|      2|}
ossl_property_parse_init:
  576|      2|{
  577|      2|    static const char *const predefined_names[] = {
  578|      2|        "provider",     /* Name of provider (default, legacy, fips) */
  579|      2|        "version",      /* Version number of this provider */
  580|      2|        "fips",         /* FIPS validated or FIPS supporting algorithm */
  581|      2|        "output",       /* Output type for encoders */
  582|      2|        "input",        /* Input type for decoders */
  583|      2|        "structure",    /* Structure name for encoders and decoders */
  584|      2|    };
  585|      2|    size_t i;
  586|       |
  587|     14|    for (i = 0; i < OSSL_NELEM(predefined_names); i++)
  ------------------
  |  |   14|     14|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (587:17): [True: 12, False: 2]
  ------------------
  588|     12|        if (ossl_property_name(ctx, predefined_names[i], 1) == 0)
  ------------------
  |  Branch (588:13): [True: 0, False: 12]
  ------------------
  589|      0|            goto err;
  590|       |
  591|       |    /*
  592|       |     * Pre-populate the two Boolean values. We must do them before any other
  593|       |     * values and in this order so that we get the same index as the global
  594|       |     * OSSL_PROPERTY_TRUE and OSSL_PROPERTY_FALSE values
  595|       |     */
  596|      2|    if ((ossl_property_value(ctx, "yes", 1) != OSSL_PROPERTY_TRUE)
  ------------------
  |  |   37|      2|#define OSSL_PROPERTY_TRUE      1
  ------------------
  |  Branch (596:9): [True: 0, False: 2]
  ------------------
  597|      2|        || (ossl_property_value(ctx, "no", 1) != OSSL_PROPERTY_FALSE))
  ------------------
  |  |   38|      2|#define OSSL_PROPERTY_FALSE     2
  ------------------
  |  Branch (597:12): [True: 0, False: 2]
  ------------------
  598|      0|        goto err;
  599|       |
  600|      2|    return 1;
  601|      0|err:
  602|      0|    return 0;
  603|      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);
  ------------------
  |  |  238|      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);
  ------------------
  |  |  238|      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)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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();
  ------------------
  |  |  235|      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();
  ------------------
  |  |  235|      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)
  |  |  ------------------
  |  |  |  |  291|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     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);
  ------------------
  |  |   99|     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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      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) {
  ------------------
  |  |  242|     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);
  ------------------
  |  |  244|      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)
  |  |  ------------------
  |  |  |  |  291|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     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)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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");
  ------------------
  |  |  287|      2|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  282|      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)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   56|      2|}

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

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

ossl_rand_cleanup_int:
   81|      2|{
   82|      2|# ifndef OPENSSL_NO_DEPRECATED_3_0
   83|      2|    const RAND_METHOD *meth = default_RAND_meth;
   84|       |
   85|      2|    if (!rand_inited)
  ------------------
  |  Branch (85:9): [True: 2, False: 0]
  ------------------
   86|      2|        return;
   87|       |
   88|      0|    if (meth != NULL && meth->cleanup != NULL)
  ------------------
  |  Branch (88:9): [True: 0, False: 0]
  |  Branch (88:25): [True: 0, False: 0]
  ------------------
   89|      0|        meth->cleanup();
   90|      0|    RAND_set_rand_method(NULL);
   91|      0|# endif
   92|      0|    ossl_rand_pool_cleanup();
   93|      0|# ifndef OPENSSL_NO_ENGINE
   94|      0|    CRYPTO_THREAD_lock_free(rand_engine_lock);
   95|      0|    rand_engine_lock = NULL;
   96|      0|# endif
   97|      0|# ifndef OPENSSL_NO_DEPRECATED_3_0
   98|      0|    CRYPTO_THREAD_lock_free(rand_meth_lock);
   99|      0|    rand_meth_lock = NULL;
  100|      0|# endif
  101|      0|    ossl_release_default_drbg_ctx();
  102|      0|    rand_inited = 0;
  103|      0|}
ossl_rand_ctx_new:
  454|      2|{
  455|      2|    RAND_GLOBAL *dgbl = OPENSSL_zalloc(sizeof(*dgbl));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  456|       |
  457|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (457:9): [True: 0, False: 2]
  ------------------
  458|      0|        return NULL;
  459|       |
  460|      2|#ifndef FIPS_MODULE
  461|       |    /*
  462|       |     * We need to ensure that base libcrypto thread handling has been
  463|       |     * initialised.
  464|       |     */
  465|      2|     OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL);
  ------------------
  |  |   31|      2|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  466|      2|#endif
  467|       |
  468|      2|    dgbl->lock = CRYPTO_THREAD_lock_new();
  469|      2|    if (dgbl->lock == NULL)
  ------------------
  |  Branch (469:9): [True: 0, False: 2]
  ------------------
  470|      0|        goto err1;
  471|       |
  472|      2|    if (!CRYPTO_THREAD_init_local(&dgbl->private, NULL))
  ------------------
  |  Branch (472:9): [True: 0, False: 2]
  ------------------
  473|      0|        goto err1;
  474|       |
  475|      2|    if (!CRYPTO_THREAD_init_local(&dgbl->public, NULL))
  ------------------
  |  Branch (475:9): [True: 0, False: 2]
  ------------------
  476|      0|        goto err2;
  477|       |
  478|      2|    return dgbl;
  479|       |
  480|      0| err2:
  481|      0|    CRYPTO_THREAD_cleanup_local(&dgbl->private);
  482|      0| err1:
  483|      0|    CRYPTO_THREAD_lock_free(dgbl->lock);
  484|      0|    OPENSSL_free(dgbl);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  485|      0|    return NULL;
  486|      0|}
ossl_rand_ctx_free:
  489|      2|{
  490|      2|    RAND_GLOBAL *dgbl = vdgbl;
  491|       |
  492|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (492:9): [True: 0, False: 2]
  ------------------
  493|      0|        return;
  494|       |
  495|      2|    CRYPTO_THREAD_lock_free(dgbl->lock);
  496|      2|    CRYPTO_THREAD_cleanup_local(&dgbl->private);
  497|      2|    CRYPTO_THREAD_cleanup_local(&dgbl->public);
  498|      2|    EVP_RAND_CTX_free(dgbl->primary);
  499|      2|    EVP_RAND_CTX_free(dgbl->seed);
  500|      2|    OPENSSL_free(dgbl->rng_name);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  501|      2|    OPENSSL_free(dgbl->rng_cipher);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  502|      2|    OPENSSL_free(dgbl->rng_digest);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  503|      2|    OPENSSL_free(dgbl->rng_propq);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  504|      2|    OPENSSL_free(dgbl->seed_name);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  505|      2|    OPENSSL_free(dgbl->seed_propq);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  506|       |
  507|      2|    OPENSSL_free(dgbl);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  508|      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)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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:
   48|      2|{
   49|      2|    OPENSSL_STACK *ret;
   50|       |
   51|      2|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  102|      2|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (51:9): [True: 0, False: 2]
  ------------------
   52|      0|        goto err;
   53|       |
   54|      2|    if (sk == NULL) {
  ------------------
  |  Branch (54:9): [True: 2, False: 0]
  ------------------
   55|      2|        ret->num = 0;
   56|      2|        ret->sorted = 0;
   57|      2|        ret->comp = NULL;
   58|      2|    } else {
   59|       |        /* direct structure assignment */
   60|      0|        *ret = *sk;
   61|      0|    }
   62|       |
   63|      2|    if (sk == NULL || sk->num == 0) {
  ------------------
  |  Branch (63:9): [True: 2, False: 0]
  |  Branch (63:23): [True: 0, False: 0]
  ------------------
   64|       |        /* postpone |ret->data| allocation */
   65|      2|        ret->data = NULL;
   66|      2|        ret->num_alloc = 0;
   67|      2|        return ret;
   68|      2|    }
   69|       |
   70|       |    /* duplicate |sk->data| content */
   71|      0|    ret->data = OPENSSL_malloc(sizeof(*ret->data) * sk->num_alloc);
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   72|      0|    if (ret->data == NULL)
  ------------------
  |  Branch (72:9): [True: 0, False: 0]
  ------------------
   73|      0|        goto err;
   74|      0|    memcpy(ret->data, sk->data, sizeof(void *) * sk->num);
   75|      0|    return ret;
   76|       |
   77|      0| err:
   78|      0|    OPENSSL_sk_free(ret);
   79|      0|    return NULL;
   80|      0|}
OPENSSL_sk_new_null:
  131|     10|{
  132|     10|    return OPENSSL_sk_new_reserve(NULL, 0);
  133|     10|}
OPENSSL_sk_new:
  136|      4|{
  137|      4|    return OPENSSL_sk_new_reserve(c, 0);
  138|      4|}
OPENSSL_sk_new_reserve:
  227|     14|{
  228|     14|    OPENSSL_STACK *st = OPENSSL_zalloc(sizeof(OPENSSL_STACK));
  ------------------
  |  |  104|     14|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     14|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     14|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  229|       |
  230|     14|    if (st == NULL)
  ------------------
  |  Branch (230:9): [True: 0, False: 14]
  ------------------
  231|      0|        return NULL;
  232|       |
  233|     14|    st->comp = c;
  234|       |
  235|     14|    if (n <= 0)
  ------------------
  |  Branch (235:9): [True: 14, False: 0]
  ------------------
  236|     14|        return st;
  237|       |
  238|      0|    if (!sk_reserve(st, n, 1)) {
  ------------------
  |  Branch (238:9): [True: 0, False: 0]
  ------------------
  239|      0|        OPENSSL_sk_free(st);
  240|      0|        return NULL;
  241|      0|    }
  242|       |
  243|      0|    return st;
  244|      0|}
OPENSSL_sk_insert:
  259|     18|{
  260|     18|    if (st == NULL) {
  ------------------
  |  Branch (260:9): [True: 0, False: 18]
  ------------------
  261|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  262|      0|        return 0;
  263|      0|    }
  264|     18|    if (st->num == max_nodes) {
  ------------------
  |  Branch (264:9): [True: 0, False: 18]
  ------------------
  265|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  266|      0|        return 0;
  267|      0|    }
  268|       |
  269|     18|    if (!sk_reserve(st, 1, 0))
  ------------------
  |  Branch (269:9): [True: 0, False: 18]
  ------------------
  270|      0|        return 0;
  271|       |
  272|     18|    if ((loc >= st->num) || (loc < 0)) {
  ------------------
  |  Branch (272:9): [True: 18, False: 0]
  |  Branch (272:29): [True: 0, False: 0]
  ------------------
  273|     18|        st->data[st->num] = data;
  274|     18|    } else {
  275|      0|        memmove(&st->data[loc + 1], &st->data[loc],
  276|      0|                sizeof(st->data[0]) * (st->num - loc));
  277|      0|        st->data[loc] = data;
  278|      0|    }
  279|     18|    st->num++;
  280|     18|    st->sorted = 0;
  281|     18|    return st->num;
  282|     18|}
OPENSSL_sk_delete:
  310|      2|{
  311|      2|    if (st == NULL || loc < 0 || loc >= st->num)
  ------------------
  |  Branch (311:9): [True: 0, False: 2]
  |  Branch (311:23): [True: 0, False: 2]
  |  Branch (311:34): [True: 0, False: 2]
  ------------------
  312|      0|        return NULL;
  313|       |
  314|      2|    return internal_delete(st, loc);
  315|      2|}
OPENSSL_sk_push:
  398|     18|{
  399|     18|    if (st == NULL)
  ------------------
  |  Branch (399:9): [True: 0, False: 18]
  ------------------
  400|      0|        return 0;
  401|     18|    return OPENSSL_sk_insert(st, data, st->num);
  402|     18|}
OPENSSL_sk_pop_free:
  432|     50|{
  433|     50|    int i;
  434|       |
  435|     50|    if (st == NULL)
  ------------------
  |  Branch (435:9): [True: 42, False: 8]
  ------------------
  436|     42|        return;
  437|      8|    for (i = 0; i < st->num; i++)
  ------------------
  |  Branch (437:17): [True: 0, False: 8]
  ------------------
  438|      0|        if (st->data[i] != NULL)
  ------------------
  |  Branch (438:13): [True: 0, False: 0]
  ------------------
  439|      0|            func((char *)st->data[i]);
  440|      8|    OPENSSL_sk_free(st);
  441|      8|}
OPENSSL_sk_free:
  444|  3.78k|{
  445|  3.78k|    if (st == NULL)
  ------------------
  |  Branch (445:9): [True: 3.76k, False: 16]
  ------------------
  446|  3.76k|        return;
  447|     16|    OPENSSL_free(st->data);
  ------------------
  |  |  115|     16|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     16|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  448|     16|    OPENSSL_free(st);
  ------------------
  |  |  115|     16|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     16|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  449|     16|}
OPENSSL_sk_num:
  452|  7.52k|{
  453|  7.52k|    return st == NULL ? -1 : st->num;
  ------------------
  |  Branch (453:12): [True: 7.51k, False: 8]
  ------------------
  454|  7.52k|}
OPENSSL_sk_value:
  457|      2|{
  458|      2|    if (st == NULL || i < 0 || i >= st->num)
  ------------------
  |  Branch (458:9): [True: 0, False: 2]
  |  Branch (458:23): [True: 0, False: 2]
  |  Branch (458:32): [True: 0, False: 2]
  ------------------
  459|      0|        return NULL;
  460|      2|    return (void *)st->data[i];
  461|      2|}
stack.c:sk_reserve:
  178|     18|{
  179|     18|    const void **tmpdata;
  180|     18|    int num_alloc;
  181|       |
  182|       |    /* Check to see the reservation isn't exceeding the hard limit */
  183|     18|    if (n > max_nodes - st->num) {
  ------------------
  |  Branch (183:9): [True: 0, False: 18]
  ------------------
  184|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  185|      0|        return 0;
  186|      0|    }
  187|       |
  188|       |    /* Figure out the new size */
  189|     18|    num_alloc = st->num + n;
  190|     18|    if (num_alloc < min_nodes)
  ------------------
  |  Branch (190:9): [True: 12, False: 6]
  ------------------
  191|     12|        num_alloc = min_nodes;
  192|       |
  193|       |    /* If |st->data| allocation was postponed */
  194|     18|    if (st->data == NULL) {
  ------------------
  |  Branch (194:9): [True: 6, False: 12]
  ------------------
  195|       |        /*
  196|       |         * At this point, |st->num_alloc| and |st->num| are 0;
  197|       |         * so |num_alloc| value is |n| or |min_nodes| if greater than |n|.
  198|       |         */
  199|      6|        if ((st->data = OPENSSL_zalloc(sizeof(void *) * num_alloc)) == NULL)
  ------------------
  |  |  104|      6|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      6|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      6|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (199:13): [True: 0, False: 6]
  ------------------
  200|      0|            return 0;
  201|      6|        st->num_alloc = num_alloc;
  202|      6|        return 1;
  203|      6|    }
  204|       |
  205|     12|    if (!exact) {
  ------------------
  |  Branch (205:9): [True: 12, False: 0]
  ------------------
  206|     12|        if (num_alloc <= st->num_alloc)
  ------------------
  |  Branch (206:13): [True: 10, False: 2]
  ------------------
  207|     10|            return 1;
  208|      2|        num_alloc = compute_growth(num_alloc, st->num_alloc);
  209|      2|        if (num_alloc == 0) {
  ------------------
  |  Branch (209:13): [True: 0, False: 2]
  ------------------
  210|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  312|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  211|      0|            return 0;
  212|      0|        }
  213|      2|    } else if (num_alloc == st->num_alloc) {
  ------------------
  |  Branch (213:16): [True: 0, False: 0]
  ------------------
  214|      0|        return 1;
  215|      0|    }
  216|       |
  217|      2|    tmpdata = OPENSSL_realloc((void *)st->data, sizeof(void *) * num_alloc);
  ------------------
  |  |  109|      2|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  218|      2|    if (tmpdata == NULL)
  ------------------
  |  Branch (218:9): [True: 0, False: 2]
  ------------------
  219|      0|        return 0;
  220|       |
  221|      2|    st->data = tmpdata;
  222|      2|    st->num_alloc = num_alloc;
  223|      2|    return 1;
  224|      2|}
stack.c:compute_growth:
  160|      2|{
  161|      2|    int err = 0;
  162|       |
  163|      4|    while (current < target) {
  ------------------
  |  Branch (163:12): [True: 2, False: 2]
  ------------------
  164|      2|        if (current >= max_nodes)
  ------------------
  |  Branch (164:13): [True: 0, False: 2]
  ------------------
  165|      0|            return 0;
  166|       |
  167|      2|        current = safe_muldiv_int(current, 8, 5, &err);
  168|      2|        if (err != 0)
  ------------------
  |  Branch (168:13): [True: 0, False: 2]
  ------------------
  169|      0|            return 0;
  170|      2|        if (current >= max_nodes)
  ------------------
  |  Branch (170:13): [True: 0, False: 2]
  ------------------
  171|      0|            current = max_nodes;
  172|      2|    }
  173|      2|    return current;
  174|      2|}
stack.c:internal_delete:
  285|      2|{
  286|      2|    const void *ret = st->data[loc];
  287|       |
  288|      2|    if (loc != st->num - 1)
  ------------------
  |  Branch (288:9): [True: 0, False: 2]
  ------------------
  289|      0|        memmove(&st->data[loc], &st->data[loc + 1],
  290|      0|                sizeof(st->data[0]) * (st->num - loc - 1));
  291|      2|    st->num--;
  292|       |
  293|      2|    return (void *)ret;
  294|      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)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      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)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  157|      2|}

ossl_rcu_write_lock:
  576|      4|{
  577|      4|    pthread_mutex_lock(&lock->write_lock);
  578|      4|    TSAN_FAKE_UNLOCK(&lock->write_lock);
  579|      4|}
ossl_rcu_write_unlock:
  582|      4|{
  583|      4|    TSAN_FAKE_LOCK(&lock->write_lock);
  584|      4|    pthread_mutex_unlock(&lock->write_lock);
  585|      4|}
ossl_synchronize_rcu:
  588|      6|{
  589|      6|    struct rcu_qp *qp;
  590|      6|    uint64_t count;
  591|      6|    struct rcu_cb_item *cb_items, *tmpcb;
  592|       |
  593|      6|    pthread_mutex_lock(&lock->write_lock);
  594|      6|    cb_items = lock->cb_items;
  595|      6|    lock->cb_items = NULL;
  596|      6|    pthread_mutex_unlock(&lock->write_lock);
  597|       |
  598|      6|    qp = update_qp(lock);
  599|       |
  600|       |    /*
  601|       |     * wait for the reader count to reach zero
  602|       |     * Note the use of __ATOMIC_ACQUIRE here to ensure that any
  603|       |     * prior __ATOMIC_RELEASE write operation in get_hold_current_qp
  604|       |     * is visible prior to our read
  605|       |     */
  606|      6|    do {
  607|      6|        count = ATOMIC_LOAD_N(uint64_t, &qp->users, __ATOMIC_ACQUIRE);
  ------------------
  |  |  122|      6|#   define ATOMIC_LOAD_N(t, p, o) __atomic_load_n(p, o)
  ------------------
  608|      6|    } while (READER_COUNT(count) != 0);
  ------------------
  |  |  281|      6|# define READER_COUNT(x) ((uint32_t)(((uint64_t)(x) >> READER_SHIFT) & \
  |  |  ------------------
  |  |  |  |  273|      6|# define READER_SHIFT 0
  |  |  ------------------
  |  |  282|      6|                                     READER_MASK))
  |  |  ------------------
  |  |  |  |  279|      6|# define READER_MASK     (((uint64_t)1 << READER_SIZE) - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  276|      6|# define READER_SIZE 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (608:14): [True: 0, False: 6]
  ------------------
  609|       |
  610|       |    /* retire in order */
  611|      6|    pthread_mutex_lock(&lock->prior_lock);
  612|      6|    while (lock->next_to_retire != ID_VAL(count))
  ------------------
  |  |  283|      6|# define ID_VAL(x)       ((uint32_t)(((uint64_t)(x) >> ID_SHIFT) & ID_MASK))
  |  |  ------------------
  |  |  |  |  274|      6|# define ID_SHIFT 32
  |  |  ------------------
  |  |               # define ID_VAL(x)       ((uint32_t)(((uint64_t)(x) >> ID_SHIFT) & ID_MASK))
  |  |  ------------------
  |  |  |  |  280|      6|# define ID_MASK         (((uint64_t)1 << ID_SIZE) - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  277|      6|# define ID_SIZE 32
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (612:12): [True: 0, False: 6]
  ------------------
  613|      0|        pthread_cond_wait(&lock->prior_signal, &lock->prior_lock);
  614|      6|    lock->next_to_retire++;
  615|      6|    pthread_cond_broadcast(&lock->prior_signal);
  616|      6|    pthread_mutex_unlock(&lock->prior_lock);
  617|       |
  618|      6|    retire_qp(lock, qp);
  619|       |
  620|       |    /* handle any callbacks that we have */
  621|      6|    while (cb_items != NULL) {
  ------------------
  |  Branch (621:12): [True: 0, False: 6]
  ------------------
  622|      0|        tmpcb = cb_items;
  623|      0|        cb_items = cb_items->next;
  624|      0|        tmpcb->fn(tmpcb->data);
  625|      0|        OPENSSL_free(tmpcb);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  626|      0|    }
  627|      6|}
ossl_rcu_uptr_deref:
  651|      4|{
  652|      4|    return ATOMIC_LOAD_N(pvoid, p, __ATOMIC_ACQUIRE);
  ------------------
  |  |  122|      4|#   define ATOMIC_LOAD_N(t, p, o) __atomic_load_n(p, o)
  ------------------
  653|      4|}
ossl_rcu_assign_uptr:
  656|      4|{
  657|      4|    ATOMIC_STORE(pvoid, p, v, __ATOMIC_RELEASE);
  ------------------
  |  |  125|      4|#  define ATOMIC_STORE(t, p, v, o) __atomic_store(p, v, o)
  ------------------
  658|      4|}
ossl_rcu_lock_new:
  661|      2|{
  662|      2|    struct rcu_lock_st *new;
  663|       |
  664|      2|    if (num_writers < 1)
  ------------------
  |  Branch (664:9): [True: 0, False: 2]
  ------------------
  665|      0|        num_writers = 1;
  666|       |
  667|      2|    ctx = ossl_lib_ctx_get_concrete(ctx);
  668|      2|    if (ctx == NULL)
  ------------------
  |  Branch (668:9): [True: 0, False: 2]
  ------------------
  669|      0|        return 0;
  670|       |
  671|      2|    new = OPENSSL_zalloc(sizeof(*new));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  672|      2|    if (new == NULL)
  ------------------
  |  Branch (672:9): [True: 0, False: 2]
  ------------------
  673|      0|        return NULL;
  674|       |
  675|      2|    new->ctx = ctx;
  676|      2|    pthread_mutex_init(&new->write_lock, NULL);
  677|      2|    pthread_mutex_init(&new->prior_lock, NULL);
  678|      2|    pthread_mutex_init(&new->alloc_lock, NULL);
  679|      2|    pthread_cond_init(&new->prior_signal, NULL);
  680|      2|    pthread_cond_init(&new->alloc_signal, NULL);
  681|      2|    new->qp_group = allocate_new_qp_group(new, num_writers + 1);
  682|      2|    if (new->qp_group == NULL) {
  ------------------
  |  Branch (682:9): [True: 0, False: 2]
  ------------------
  683|      0|        OPENSSL_free(new);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  684|      0|        new = NULL;
  685|      0|    }
  686|      2|    return new;
  687|      2|}
ossl_rcu_lock_free:
  690|      2|{
  691|      2|    struct rcu_lock_st *rlock = (struct rcu_lock_st *)lock;
  692|       |
  693|      2|    if (lock == NULL)
  ------------------
  |  Branch (693:9): [True: 0, False: 2]
  ------------------
  694|      0|        return;
  695|       |
  696|       |    /* make sure we're synchronized */
  697|      2|    ossl_synchronize_rcu(rlock);
  698|       |
  699|      2|    OPENSSL_free(rlock->qp_group);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  700|       |    /* There should only be a single qp left now */
  701|      2|    OPENSSL_free(rlock);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  702|      2|}
CRYPTO_THREAD_lock_new:
  705|     46|{
  706|     46|# ifdef USE_RWLOCK
  707|     46|    CRYPTO_RWLOCK *lock;
  708|       |
  709|     46|    if ((lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t))) == NULL)
  ------------------
  |  |  104|     46|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     46|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     46|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (709:9): [True: 0, False: 46]
  ------------------
  710|       |        /* Don't set error, to avoid recursion blowup. */
  711|      0|        return NULL;
  712|       |
  713|     46|    if (pthread_rwlock_init(lock, NULL) != 0) {
  ------------------
  |  Branch (713:9): [True: 0, False: 46]
  ------------------
  714|      0|        OPENSSL_free(lock);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  715|      0|        return NULL;
  716|      0|    }
  717|       |# else
  718|       |    pthread_mutexattr_t attr;
  719|       |    CRYPTO_RWLOCK *lock;
  720|       |
  721|       |    if ((lock = OPENSSL_zalloc(sizeof(pthread_mutex_t))) == NULL)
  722|       |        /* Don't set error, to avoid recursion blowup. */
  723|       |        return NULL;
  724|       |
  725|       |    /*
  726|       |     * We don't use recursive mutexes, but try to catch errors if we do.
  727|       |     */
  728|       |    pthread_mutexattr_init(&attr);
  729|       |#  if !defined (__TANDEM) && !defined (_SPT_MODEL_)
  730|       |#   if !defined(NDEBUG) && !defined(OPENSSL_NO_MUTEX_ERRORCHECK)
  731|       |    pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
  732|       |#   endif
  733|       |#  else
  734|       |    /* The SPT Thread Library does not define MUTEX attributes. */
  735|       |#  endif
  736|       |
  737|       |    if (pthread_mutex_init(lock, &attr) != 0) {
  738|       |        pthread_mutexattr_destroy(&attr);
  739|       |        OPENSSL_free(lock);
  740|       |        return NULL;
  741|       |    }
  742|       |
  743|       |    pthread_mutexattr_destroy(&attr);
  744|       |# endif
  745|       |
  746|     46|    return lock;
  747|     46|}
CRYPTO_THREAD_read_lock:
  750|  7.66k|{
  751|  7.66k|# ifdef USE_RWLOCK
  752|  7.66k|    if (pthread_rwlock_rdlock(lock) != 0)
  ------------------
  |  Branch (752:9): [True: 0, False: 7.66k]
  ------------------
  753|      0|        return 0;
  754|       |# else
  755|       |    if (pthread_mutex_lock(lock) != 0) {
  756|       |        assert(errno != EDEADLK && errno != EBUSY);
  757|       |        return 0;
  758|       |    }
  759|       |# endif
  760|       |
  761|  7.66k|    return 1;
  762|  7.66k|}
CRYPTO_THREAD_write_lock:
  765|    232|{
  766|    232|# ifdef USE_RWLOCK
  767|    232|    if (pthread_rwlock_wrlock(lock) != 0)
  ------------------
  |  Branch (767:9): [True: 0, False: 232]
  ------------------
  768|      0|        return 0;
  769|       |# else
  770|       |    if (pthread_mutex_lock(lock) != 0) {
  771|       |        assert(errno != EDEADLK && errno != EBUSY);
  772|       |        return 0;
  773|       |    }
  774|       |# endif
  775|       |
  776|    232|    return 1;
  777|    232|}
CRYPTO_THREAD_unlock:
  780|  7.89k|{
  781|  7.89k|# ifdef USE_RWLOCK
  782|  7.89k|    if (pthread_rwlock_unlock(lock) != 0)
  ------------------
  |  Branch (782:9): [True: 0, False: 7.89k]
  ------------------
  783|      0|        return 0;
  784|       |# else
  785|       |    if (pthread_mutex_unlock(lock) != 0) {
  786|       |        assert(errno != EPERM);
  787|       |        return 0;
  788|       |    }
  789|       |# endif
  790|       |
  791|  7.89k|    return 1;
  792|  7.89k|}
CRYPTO_THREAD_lock_free:
  795|     60|{
  796|     60|    if (lock == NULL)
  ------------------
  |  Branch (796:9): [True: 14, False: 46]
  ------------------
  797|     14|        return;
  798|       |
  799|     46|# ifdef USE_RWLOCK
  800|     46|    pthread_rwlock_destroy(lock);
  801|       |# else
  802|       |    pthread_mutex_destroy(lock);
  803|       |# endif
  804|     46|    OPENSSL_free(lock);
  ------------------
  |  |  115|     46|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     46|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     46|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  805|       |
  806|     46|    return;
  807|     60|}
CRYPTO_THREAD_run_once:
  810|  16.6k|{
  811|  16.6k|    if (pthread_once(once, init) != 0)
  ------------------
  |  Branch (811:9): [True: 0, False: 16.6k]
  ------------------
  812|      0|        return 0;
  813|       |
  814|  16.6k|    return 1;
  815|  16.6k|}
CRYPTO_THREAD_init_local:
  818|     14|{
  819|     14|    if (pthread_key_create(key, cleanup) != 0)
  ------------------
  |  Branch (819:9): [True: 0, False: 14]
  ------------------
  820|      0|        return 0;
  821|       |
  822|     14|    return 1;
  823|     14|}
CRYPTO_THREAD_get_local:
  826|  12.0k|{
  827|  12.0k|    return pthread_getspecific(*key);
  828|  12.0k|}
CRYPTO_THREAD_set_local:
  831|     14|{
  832|     14|    if (pthread_setspecific(*key, val) != 0)
  ------------------
  |  Branch (832:9): [True: 0, False: 14]
  ------------------
  833|      0|        return 0;
  834|       |
  835|     14|    return 1;
  836|     14|}
CRYPTO_THREAD_cleanup_local:
  839|     14|{
  840|     14|    if (pthread_key_delete(*key) != 0)
  ------------------
  |  Branch (840:9): [True: 0, False: 14]
  ------------------
  841|      0|        return 0;
  842|       |
  843|     14|    return 1;
  844|     14|}
CRYPTO_atomic_or:
  936|      2|{
  937|      2|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  938|      2|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (938:9): [Folded - Ignored]
  ------------------
  939|      2|        *ret = __atomic_or_fetch(val, op, __ATOMIC_ACQ_REL);
  940|      2|        return 1;
  941|      2|    }
  942|       |# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
  943|       |    /* This will work for all future Solaris versions. */
  944|       |    if (ret != NULL) {
  945|       |        *ret = atomic_or_64_nv(val, op);
  946|       |        return 1;
  947|       |    }
  948|       |# endif
  949|      0|    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
  ------------------
  |  Branch (949:9): [True: 0, False: 0]
  |  Branch (949:25): [True: 0, False: 0]
  ------------------
  950|      0|        return 0;
  951|      0|    *val |= op;
  952|      0|    *ret  = *val;
  953|       |
  954|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (954:9): [True: 0, False: 0]
  ------------------
  955|      0|        return 0;
  956|       |
  957|      0|    return 1;
  958|      0|}
CRYPTO_atomic_load:
  961|  4.48k|{
  962|  4.48k|# if defined(__GNUC__) && defined(__ATOMIC_ACQUIRE) && !defined(BROKEN_CLANG_ATOMICS)
  963|  4.48k|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (963:9): [Folded - Ignored]
  ------------------
  964|  4.48k|        __atomic_load(val, ret, __ATOMIC_ACQUIRE);
  965|  4.48k|        return 1;
  966|  4.48k|    }
  967|       |# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
  968|       |    /* This will work for all future Solaris versions. */
  969|       |    if (ret != NULL) {
  970|       |        *ret = atomic_or_64_nv(val, 0);
  971|       |        return 1;
  972|       |    }
  973|       |# endif
  974|      0|    if (lock == NULL || !CRYPTO_THREAD_read_lock(lock))
  ------------------
  |  Branch (974:9): [True: 0, False: 0]
  |  Branch (974:25): [True: 0, False: 0]
  ------------------
  975|      0|        return 0;
  976|      0|    *ret  = *val;
  977|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (977:9): [True: 0, False: 0]
  ------------------
  978|      0|        return 0;
  979|       |
  980|      0|    return 1;
  981|      0|}
threads_pthread.c:update_qp:
  501|      6|{
  502|      6|    uint64_t new_id;
  503|      6|    uint32_t current_idx;
  504|       |
  505|      6|    pthread_mutex_lock(&lock->alloc_lock);
  506|       |
  507|       |    /*
  508|       |     * we need at least one qp to be available with one
  509|       |     * left over, so that readers can start working on
  510|       |     * one that isn't yet being waited on
  511|       |     */
  512|      6|    while (lock->group_count - lock->writers_alloced < 2)
  ------------------
  |  Branch (512:12): [True: 0, False: 6]
  ------------------
  513|       |        /* we have to wait for one to be free */
  514|      0|        pthread_cond_wait(&lock->alloc_signal, &lock->alloc_lock);
  515|       |
  516|      6|    current_idx = lock->current_alloc_idx;
  517|       |
  518|       |    /* Allocate the qp */
  519|      6|    lock->writers_alloced++;
  520|       |
  521|       |    /* increment the allocation index */
  522|      6|    lock->current_alloc_idx =
  523|      6|        (lock->current_alloc_idx + 1) % lock->group_count;
  524|       |
  525|       |    /* get and insert a new id */
  526|      6|    new_id = VAL_ID(lock->id_ctr);
  ------------------
  |  |  285|      6|# define VAL_ID(x)       ((uint64_t)x << ID_SHIFT)
  |  |  ------------------
  |  |  |  |  274|      6|# define ID_SHIFT 32
  |  |  ------------------
  ------------------
  527|      6|    lock->id_ctr++;
  528|       |
  529|       |    /*
  530|       |     * Even though we are under a write side lock here
  531|       |     * We need to use atomic instructions to ensure that the results
  532|       |     * of this update are published to the read side prior to updating the
  533|       |     * reader idx below
  534|       |     */
  535|      6|    ATOMIC_AND_FETCH(&lock->qp_group[current_idx].users, ID_MASK,
  ------------------
  |  |  130|      6|#  define ATOMIC_AND_FETCH(p, m, o) __atomic_and_fetch(p, m, o)
  ------------------
  536|      6|                     __ATOMIC_RELEASE);
  537|      6|    ATOMIC_OR_FETCH(&lock->qp_group[current_idx].users, new_id,
  ------------------
  |  |  131|      6|#  define ATOMIC_OR_FETCH(p, m, o) __atomic_or_fetch(p, m, o)
  ------------------
  538|      6|                    __ATOMIC_RELEASE);
  539|       |
  540|       |    /*
  541|       |     * Update the reader index to be the prior qp.
  542|       |     * Note the use of __ATOMIC_RELEASE here is based on the corresponding use
  543|       |     * of __ATOMIC_ACQUIRE in get_hold_current_qp, as we want any publication
  544|       |     * of this value to be seen on the read side immediately after it happens
  545|       |     */
  546|      6|    ATOMIC_STORE_N(uint32_t, &lock->reader_idx, lock->current_alloc_idx,
  ------------------
  |  |  124|      6|#  define ATOMIC_STORE_N(t, p, v, o) __atomic_store_n(p, v, o)
  ------------------
  547|      6|                   __ATOMIC_RELEASE);
  548|       |
  549|       |    /* wake up any waiters */
  550|      6|    pthread_cond_signal(&lock->alloc_signal);
  551|      6|    pthread_mutex_unlock(&lock->alloc_lock);
  552|      6|    return &lock->qp_group[current_idx];
  553|      6|}
threads_pthread.c:retire_qp:
  556|      6|{
  557|      6|    pthread_mutex_lock(&lock->alloc_lock);
  558|      6|    lock->writers_alloced--;
  559|      6|    pthread_cond_signal(&lock->alloc_signal);
  560|      6|    pthread_mutex_unlock(&lock->alloc_lock);
  561|      6|}
threads_pthread.c:allocate_new_qp_group:
  567|      2|{
  568|      2|    struct rcu_qp *new =
  569|      2|        OPENSSL_zalloc(sizeof(*new) * count);
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  570|       |
  571|      2|    lock->group_count = count;
  572|      2|    return new;
  573|      2|}

ossl_trace_cleanup:
  338|      2|{
  339|       |#ifndef OPENSSL_NO_TRACE
  340|       |    int category;
  341|       |    BIO *channel = NULL;
  342|       |    const char *prefix = NULL;
  343|       |    const char *suffix = NULL;
  344|       |
  345|       |    for (category = 0; category < OSSL_TRACE_CATEGORY_NUM; category++) {
  346|       |        /* We force the TRACE category to be treated last */
  347|       |        if (category == OSSL_TRACE_CATEGORY_TRACE)
  348|       |            continue;
  349|       |        set_trace_data(category, 0, &channel, &prefix, &suffix,
  350|       |                       trace_attach_cb, trace_detach_cb);
  351|       |    }
  352|       |    set_trace_data(OSSL_TRACE_CATEGORY_TRACE, 0, &channel,
  353|       |                   &prefix, &suffix,
  354|       |                   trace_attach_cb, trace_detach_cb);
  355|       |    CRYPTO_THREAD_lock_free(trace_lock);
  356|       |#endif
  357|      2|}
OSSL_trace_set_channel:
  360|      2|{
  361|       |#ifndef OPENSSL_NO_TRACE
  362|       |    if (category >= 0 && category < OSSL_TRACE_CATEGORY_NUM)
  363|       |        return set_trace_data(category, SIMPLE_CHANNEL, &channel, NULL, NULL,
  364|       |                              trace_attach_cb, trace_detach_cb);
  365|       |#endif
  366|      2|    return 0;
  367|      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:
  144|      2|{
  145|      2|#ifndef OPENSSL_NO_ERR
  146|      2|    if (ERR_reason_error_string(X509V3_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (146:9): [True: 2, False: 0]
  ------------------
  147|      2|        ERR_load_strings_const(X509V3_str_reasons);
  148|      2|#endif
  149|      2|    return 1;
  150|      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.25k|{
   28|  1.25k|    return FuzzerTestOneInput(buf, len);
   29|  1.25k|}

FuzzerInitialize:
   16|      2|{
   17|      2|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
  ------------------
  |  |  463|      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.25k|{
   25|  1.25k|    BIO *in;
   26|  1.25k|    char *name = NULL, *header = NULL;
   27|  1.25k|    unsigned char *data = NULL;
   28|  1.25k|    long outlen;
   29|       |
   30|  1.25k|    if (len <= 1)
  ------------------
  |  Branch (30:9): [True: 1, False: 1.25k]
  ------------------
   31|      1|        return 0;
   32|       |
   33|  1.25k|    in = BIO_new(BIO_s_mem());
   34|  1.25k|    OPENSSL_assert((size_t)BIO_write(in, buf + 1, len - 1) == len - 1);
  ------------------
  |  |  434|  1.25k|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (434:12): [True: 1.25k, False: 0]
  |  |  ------------------
  ------------------
   35|  1.25k|    if (PEM_read_bio_ex(in, &name, &header, &data, &outlen, buf[0]) == 1) {
  ------------------
  |  Branch (35:9): [True: 150, False: 1.10k]
  ------------------
   36|       |	/* Try to read all the data we get to see if allocated properly. */
   37|    150|        BIO_write(in, name, strlen(name));
   38|    150|	BIO_write(in, header, strlen(header));
   39|    150|	BIO_write(in, data, outlen);
   40|    150|    }
   41|  1.25k|    if (buf[0] & PEM_FLAG_SECURE) {
  ------------------
  |  |  380|  1.25k|#   define PEM_FLAG_SECURE             0x1
  ------------------
  |  Branch (41:9): [True: 579, False: 676]
  ------------------
   42|    579|        OPENSSL_secure_free(name);
  ------------------
  |  |  127|    579|        CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    579|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    579|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   43|    579|        OPENSSL_secure_free(header);
  ------------------
  |  |  127|    579|        CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    579|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    579|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   44|    579|        OPENSSL_secure_free(data);
  ------------------
  |  |  127|    579|        CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    579|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    579|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   45|    676|    } else {
   46|    676|        OPENSSL_free(name);
  ------------------
  |  |  115|    676|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    676|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    676|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   47|    676|        OPENSSL_free(header);
  ------------------
  |  |  115|    676|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    676|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    676|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   48|    676|        OPENSSL_free(data);
  ------------------
  |  |  115|    676|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    676|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    676|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   49|    676|    }
   50|       |
   51|  1.25k|    BIO_free(in);
   52|  1.25k|    ERR_clear_error();
   53|       |
   54|  1.25k|    return 0;
   55|  1.25k|}

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|    } \

bio_lib.c:CRYPTO_NEW_REF:
  268|  3.75k|{
  269|  3.75k|    refcnt->val = n;
  270|  3.75k|    return 1;
  271|  3.75k|}
bio_lib.c:CRYPTO_FREE_REF:
  273|  3.75k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|  3.75k|{
  275|  3.75k|}
bio_lib.c:CRYPTO_DOWN_REF:
   50|  3.75k|{
   51|  3.75k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  3.75k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 3.75k, False: 0]
  ------------------
   53|  3.75k|        atomic_thread_fence(memory_order_acquire);
   54|  3.75k|    return 1;
   55|  3.75k|}

stack.c:safe_muldiv_int:
  322|      2|    {                                                                        \
  323|      2|        int e2 = 0;                                                          \
  324|      2|        type q, r, x, y;                                                     \
  325|      2|                                                                             \
  326|      2|        if (c == 0) {                                                        \
  ------------------
  |  Branch (326:13): [True: 0, False: 2]
  ------------------
  327|      0|            *err |= 1;                                                       \
  328|      0|            return a == 0 || b == 0 ? 0 : max;                               \
  ------------------
  |  Branch (328:20): [True: 0, False: 0]
  |  Branch (328:30): [True: 0, False: 0]
  ------------------
  329|      0|        }                                                                    \
  330|      2|        x = safe_mul_ ## type_name(a, b, &e2);                               \
  331|      2|        if (!e2)                                                             \
  ------------------
  |  Branch (331:13): [True: 2, False: 0]
  ------------------
  332|      2|            return safe_div_ ## type_name(x, c, err);                        \
  333|      2|        if (b > a) {                                                         \
  ------------------
  |  Branch (333:13): [True: 0, False: 0]
  ------------------
  334|      0|            x = b;                                                           \
  335|      0|            b = a;                                                           \
  336|      0|            a = x;                                                           \
  337|      0|        }                                                                    \
  338|      0|        q = safe_div_ ## type_name(a, c, err);                               \
  339|      0|        r = safe_mod_ ## type_name(a, c, err);                               \
  340|      0|        x = safe_mul_ ## type_name(r, b, err);                               \
  341|      0|        y = safe_mul_ ## type_name(q, b, err);                               \
  342|      0|        q = safe_div_ ## type_name(x, c, err);                               \
  343|      0|        return safe_add_ ## type_name(y, q, err);                            \
  344|      2|    }
stack.c:safe_mul_int:
  136|      2|    {                                                                        \
  137|      2|        type r;                                                              \
  138|      2|                                                                             \
  139|      2|        if (!__builtin_mul_overflow(a, b, &r))                               \
  ------------------
  |  Branch (139:13): [True: 2, False: 0]
  ------------------
  140|      2|            return r;                                                        \
  141|      2|        *err |= 1;                                                           \
  142|      0|        return (a < 0) ^ (b < 0) ? min : max;                                \
  ------------------
  |  Branch (142:16): [True: 0, False: 0]
  ------------------
  143|      2|    }
stack.c:safe_div_int:
  199|      2|    {                                                                        \
  200|      2|        if (b == 0) {                                                        \
  ------------------
  |  Branch (200:13): [True: 0, False: 2]
  ------------------
  201|      0|            *err |= 1;                                                       \
  202|      0|            return a < 0 ? min : max;                                        \
  ------------------
  |  Branch (202:20): [True: 0, False: 0]
  ------------------
  203|      0|        }                                                                    \
  204|      2|        if (b == -1 && a == min) {                                           \
  ------------------
  |  Branch (204:13): [True: 0, False: 2]
  |  Branch (204:24): [True: 0, False: 0]
  ------------------
  205|      0|            *err |= 1;                                                       \
  206|      0|            return max;                                                      \
  207|      0|        }                                                                    \
  208|      2|        return a / b;                                                        \
  209|      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.74k|{
  243|  8.74k|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  239|  8.74k|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|  8.74k|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 8.74k]
  |  |  ------------------
  ------------------
  244|      0|        return ERR_LIB_SYS;
  ------------------
  |  |   72|      0|# define ERR_LIB_SYS             2
  ------------------
  245|  8.74k|    return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  226|  8.74k|# define ERR_LIB_OFFSET                 23L
  ------------------
                  return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  227|  8.74k|# define ERR_LIB_MASK                   0xFF
  ------------------
  246|  8.74k|}
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.67k|    { \
  197|  8.67k|        return (OPENSSL_LHASH *)lh; \
  198|  8.67k|    } \
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.67k|    { \
  161|  8.67k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  162|  8.67k|        return hfn_conv((const type *)data); \
  163|  8.67k|    } \
err.c:lh_ERR_STRING_DATA_comp_thunk:
  165|  5.88k|    { \
  166|  5.88k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  167|  5.88k|        return cfn_conv((const type *)da, (const type *)db); \
  168|  5.88k|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_plain_type:
  181|  8.53k|    { \
  182|  8.53k|        return ptr; \
  183|  8.53k|    } \
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|    } \
core_namemap.c:lh_NAMENUM_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|    } \
core_namemap.c:lh_NAMENUM_ENTRY_doall:
  311|      2|    { \
  312|      2|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      2|    } \
core_namemap.c:lh_NAMENUM_ENTRY_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:
  127|     36|    { \
  128|     36|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|     36|    } \
ex_data.c:sk_EX_CALLBACK_num:
   70|  7.51k|    { \
   71|  7.51k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  7.51k|    } \
ex_data.c:ossl_check_void_sk_type:
   48|  3.75k|    { \
   49|  3.75k|        return (OPENSSL_STACK *)sk; \
   50|  3.75k|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_new_null:
   82|      2|    { \
   83|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_free:
   94|      2|    { \
   95|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_push:
  111|      2|    { \
  112|      2|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_num:
   70|      4|    { \
   71|      4|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|      4|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_value:
   74|      2|    { \
   75|      2|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_delete:
  102|      2|    { \
  103|      2|        return (t2 *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); \
  104|      2|    } \
conf_mod.c:sk_CONF_IMODULE_free:
   94|      4|    { \
   95|      4|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|      4|    } \
conf_mod.c:sk_CONF_MODULE_dup:
  159|      2|    { \
  160|      2|        return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
  161|      2|    } \
conf_mod.c:sk_CONF_MODULE_new_null:
   82|      2|    { \
   83|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|      2|    } \
conf_mod.c:sk_CONF_MODULE_num:
   70|      4|    { \
   71|      4|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|      4|    } \
conf_mod.c:sk_CONF_MODULE_free:
   94|      6|    { \
   95|      6|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|      6|    } \
conf_mod.c:sk_CONF_MODULE_pop_free:
  127|      2|    { \
  128|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|      2|    } \
conf_mod.c:sk_CONF_IMODULE_num:
   70|      2|    { \
   71|      2|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|      2|    } \
provider_conf.c:sk_OSSL_PROVIDER_pop_free:
  127|      2|    { \
  128|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_pop_free:
  127|      2|    { \
  128|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_pop_free:
  127|      2|    { \
  128|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_new:
   78|      2|    { \
   79|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
   80|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_new_null:
   82|      2|    { \
   83|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|      2|    } \
obj_xref.c:sk_nid_triple_pop_free:
  127|      2|    { \
  128|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|      2|    } \
obj_xref.c:sk_nid_triple_free:
   94|      2|    { \
   95|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|      2|    } \
property_string.c:ossl_check_OPENSSL_CSTRING_sk_type:
   48|     20|    { \
   49|     20|        return (OPENSSL_STACK *)sk; \
   50|     20|    } \
property_string.c:ossl_check_OPENSSL_CSTRING_type:
   40|     16|    { \
   41|     16|        return ptr; \
   42|     16|    } \
evp_pbe.c:sk_EVP_PBE_CTL_pop_free:
  127|      2|    { \
  128|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|      2|    } \
comp_methods.c:ossl_check_SSL_COMP_compfunc_type:
   52|      2|    { \
   53|      2|        return (OPENSSL_sk_compfunc)cmp; \
   54|      2|    } \
comp_methods.c:ossl_check_SSL_COMP_sk_type:
   48|      2|    { \
   49|      2|        return (OPENSSL_STACK *)sk; \
   50|      2|    } \
comp_methods.c:ossl_check_SSL_COMP_freefunc_type:
   60|      2|    { \
   61|      2|        return (OPENSSL_sk_freefunc)fr; \
   62|      2|    }

ossl_err_load_PROV_strings:
  230|      2|{
  231|      2|#ifndef OPENSSL_NO_ERR
  232|      2|    if (ERR_reason_error_string(PROV_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (232:9): [True: 2, False: 0]
  ------------------
  233|      2|        ERR_load_strings_const(PROV_str_reasons);
  234|      2|#endif
  235|      2|    return 1;
  236|      2|}

ossl_prov_drbg_nonce_ctx_new:
  282|      2|{
  283|      2|    PROV_DRBG_NONCE_GLOBAL *dngbl = OPENSSL_zalloc(sizeof(*dngbl));
  ------------------
  |  |  104|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  284|       |
  285|      2|    if (dngbl == NULL)
  ------------------
  |  Branch (285:9): [True: 0, False: 2]
  ------------------
  286|      0|        return NULL;
  287|       |
  288|      2|    dngbl->rand_nonce_lock = CRYPTO_THREAD_lock_new();
  289|      2|    if (dngbl->rand_nonce_lock == NULL) {
  ------------------
  |  Branch (289:9): [True: 0, False: 2]
  ------------------
  290|      0|        OPENSSL_free(dngbl);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  291|      0|        return NULL;
  292|      0|    }
  293|       |
  294|      2|    return dngbl;
  295|      2|}
ossl_prov_drbg_nonce_ctx_free:
  298|      2|{
  299|      2|    PROV_DRBG_NONCE_GLOBAL *dngbl = vdngbl;
  300|       |
  301|      2|    if (dngbl == NULL)
  ------------------
  |  Branch (301:9): [True: 0, False: 2]
  ------------------
  302|      0|        return;
  303|       |
  304|      2|    CRYPTO_THREAD_lock_free(dngbl->rand_nonce_lock);
  305|       |
  306|      2|    OPENSSL_free(dngbl);
  ------------------
  |  |  115|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  307|      2|}

