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

bn_mul_add_words:
  112|   105k|{
  113|   105k|    BN_ULONG c1 = 0;
  ------------------
  |  |   37|   105k|#  define BN_ULONG        unsigned long
  ------------------
  114|       |
  115|   105k|    if (num <= 0)
  ------------------
  |  Branch (115:9): [True: 0, False: 105k]
  ------------------
  116|      0|        return c1;
  117|       |
  118|   200M|    while (num & ~3) {
  ------------------
  |  Branch (118:12): [True: 199M, False: 105k]
  ------------------
  119|   199M|        mul_add(rp[0], ap[0], w, c1);
  ------------------
  |  |   74|   199M|# define mul_add(r,a,word,carry) do {   \
  |  |   75|   199M|        register BN_ULONG high,low;     \
  |  |   76|   199M|        asm ("mulq %3"                  \
  |  |   77|   199M|                : "=a"(low),"=d"(high)  \
  |  |   78|   199M|                : "a"(word),"m"(a)      \
  |  |   79|   199M|                : "cc");                \
  |  |   80|   199M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   81|   199M|                : "+r"(carry),"+d"(high)\
  |  |   82|   199M|                : "a"(low),"g"(0)       \
  |  |   83|   199M|                : "cc");                \
  |  |   84|   199M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   85|   199M|                : "+m"(r),"+d"(high)    \
  |  |   86|   199M|                : "r"(carry),"g"(0)     \
  |  |   87|   199M|                : "cc");                \
  |  |   88|   199M|        carry=high;                     \
  |  |   89|   199M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (89:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  120|   199M|        mul_add(rp[1], ap[1], w, c1);
  ------------------
  |  |   74|   199M|# define mul_add(r,a,word,carry) do {   \
  |  |   75|   199M|        register BN_ULONG high,low;     \
  |  |   76|   199M|        asm ("mulq %3"                  \
  |  |   77|   199M|                : "=a"(low),"=d"(high)  \
  |  |   78|   199M|                : "a"(word),"m"(a)      \
  |  |   79|   199M|                : "cc");                \
  |  |   80|   199M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   81|   199M|                : "+r"(carry),"+d"(high)\
  |  |   82|   199M|                : "a"(low),"g"(0)       \
  |  |   83|   199M|                : "cc");                \
  |  |   84|   199M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   85|   199M|                : "+m"(r),"+d"(high)    \
  |  |   86|   199M|                : "r"(carry),"g"(0)     \
  |  |   87|   199M|                : "cc");                \
  |  |   88|   199M|        carry=high;                     \
  |  |   89|   199M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (89:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  121|   199M|        mul_add(rp[2], ap[2], w, c1);
  ------------------
  |  |   74|   199M|# define mul_add(r,a,word,carry) do {   \
  |  |   75|   199M|        register BN_ULONG high,low;     \
  |  |   76|   199M|        asm ("mulq %3"                  \
  |  |   77|   199M|                : "=a"(low),"=d"(high)  \
  |  |   78|   199M|                : "a"(word),"m"(a)      \
  |  |   79|   199M|                : "cc");                \
  |  |   80|   199M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   81|   199M|                : "+r"(carry),"+d"(high)\
  |  |   82|   199M|                : "a"(low),"g"(0)       \
  |  |   83|   199M|                : "cc");                \
  |  |   84|   199M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   85|   199M|                : "+m"(r),"+d"(high)    \
  |  |   86|   199M|                : "r"(carry),"g"(0)     \
  |  |   87|   199M|                : "cc");                \
  |  |   88|   199M|        carry=high;                     \
  |  |   89|   199M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (89:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  122|   199M|        mul_add(rp[3], ap[3], w, c1);
  ------------------
  |  |   74|   199M|# define mul_add(r,a,word,carry) do {   \
  |  |   75|   199M|        register BN_ULONG high,low;     \
  |  |   76|   199M|        asm ("mulq %3"                  \
  |  |   77|   199M|                : "=a"(low),"=d"(high)  \
  |  |   78|   199M|                : "a"(word),"m"(a)      \
  |  |   79|   199M|                : "cc");                \
  |  |   80|   199M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   81|   199M|                : "+r"(carry),"+d"(high)\
  |  |   82|   199M|                : "a"(low),"g"(0)       \
  |  |   83|   199M|                : "cc");                \
  |  |   84|   199M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   85|   199M|                : "+m"(r),"+d"(high)    \
  |  |   86|   199M|                : "r"(carry),"g"(0)     \
  |  |   87|   199M|                : "cc");                \
  |  |   88|   199M|        carry=high;                     \
  |  |   89|   199M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (89:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  123|   199M|        ap += 4;
  124|   199M|        rp += 4;
  125|   199M|        num -= 4;
  126|   199M|    }
  127|   105k|    if (num) {
  ------------------
  |  Branch (127:9): [True: 75.4k, False: 30.3k]
  ------------------
  128|  75.4k|        mul_add(rp[0], ap[0], w, c1);
  ------------------
  |  |   74|  75.4k|# define mul_add(r,a,word,carry) do {   \
  |  |   75|  75.4k|        register BN_ULONG high,low;     \
  |  |   76|  75.4k|        asm ("mulq %3"                  \
  |  |   77|  75.4k|                : "=a"(low),"=d"(high)  \
  |  |   78|  75.4k|                : "a"(word),"m"(a)      \
  |  |   79|  75.4k|                : "cc");                \
  |  |   80|  75.4k|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   81|  75.4k|                : "+r"(carry),"+d"(high)\
  |  |   82|  75.4k|                : "a"(low),"g"(0)       \
  |  |   83|  75.4k|                : "cc");                \
  |  |   84|  75.4k|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   85|  75.4k|                : "+m"(r),"+d"(high)    \
  |  |   86|  75.4k|                : "r"(carry),"g"(0)     \
  |  |   87|  75.4k|                : "cc");                \
  |  |   88|  75.4k|        carry=high;                     \
  |  |   89|  75.4k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (89:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  129|  75.4k|        if (--num == 0)
  ------------------
  |  Branch (129:13): [True: 43.8k, False: 31.5k]
  ------------------
  130|  43.8k|            return c1;
  131|  31.5k|        mul_add(rp[1], ap[1], w, c1);
  ------------------
  |  |   74|  31.5k|# define mul_add(r,a,word,carry) do {   \
  |  |   75|  31.5k|        register BN_ULONG high,low;     \
  |  |   76|  31.5k|        asm ("mulq %3"                  \
  |  |   77|  31.5k|                : "=a"(low),"=d"(high)  \
  |  |   78|  31.5k|                : "a"(word),"m"(a)      \
  |  |   79|  31.5k|                : "cc");                \
  |  |   80|  31.5k|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   81|  31.5k|                : "+r"(carry),"+d"(high)\
  |  |   82|  31.5k|                : "a"(low),"g"(0)       \
  |  |   83|  31.5k|                : "cc");                \
  |  |   84|  31.5k|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   85|  31.5k|                : "+m"(r),"+d"(high)    \
  |  |   86|  31.5k|                : "r"(carry),"g"(0)     \
  |  |   87|  31.5k|                : "cc");                \
  |  |   88|  31.5k|        carry=high;                     \
  |  |   89|  31.5k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (89:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  132|  31.5k|        if (--num == 0)
  ------------------
  |  Branch (132:13): [True: 4.51k, False: 27.0k]
  ------------------
  133|  4.51k|            return c1;
  134|  27.0k|        mul_add(rp[2], ap[2], w, c1);
  ------------------
  |  |   74|  27.0k|# define mul_add(r,a,word,carry) do {   \
  |  |   75|  27.0k|        register BN_ULONG high,low;     \
  |  |   76|  27.0k|        asm ("mulq %3"                  \
  |  |   77|  27.0k|                : "=a"(low),"=d"(high)  \
  |  |   78|  27.0k|                : "a"(word),"m"(a)      \
  |  |   79|  27.0k|                : "cc");                \
  |  |   80|  27.0k|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   81|  27.0k|                : "+r"(carry),"+d"(high)\
  |  |   82|  27.0k|                : "a"(low),"g"(0)       \
  |  |   83|  27.0k|                : "cc");                \
  |  |   84|  27.0k|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   85|  27.0k|                : "+m"(r),"+d"(high)    \
  |  |   86|  27.0k|                : "r"(carry),"g"(0)     \
  |  |   87|  27.0k|                : "cc");                \
  |  |   88|  27.0k|        carry=high;                     \
  |  |   89|  27.0k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (89:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  135|  27.0k|        return c1;
  136|  31.5k|    }
  137|       |
  138|  30.3k|    return c1;
  139|   105k|}
bn_mul_words:
  142|  1.11M|{
  143|  1.11M|    BN_ULONG c1 = 0;
  ------------------
  |  |   37|  1.11M|#  define BN_ULONG        unsigned long
  ------------------
  144|       |
  145|  1.11M|    if (num <= 0)
  ------------------
  |  Branch (145:9): [True: 0, False: 1.11M]
  ------------------
  146|      0|        return c1;
  147|       |
  148|   833M|    while (num & ~3) {
  ------------------
  |  Branch (148:12): [True: 832M, False: 1.11M]
  ------------------
  149|   832M|        mul(rp[0], ap[0], w, c1);
  ------------------
  |  |   91|   832M|# define mul(r,a,word,carry) do {       \
  |  |   92|   832M|        register BN_ULONG high,low;     \
  |  |   93|   832M|        asm ("mulq %3"                  \
  |  |   94|   832M|                : "=a"(low),"=d"(high)  \
  |  |   95|   832M|                : "a"(word),"g"(a)      \
  |  |   96|   832M|                : "cc");                \
  |  |   97|   832M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   98|   832M|                : "+r"(carry),"+d"(high)\
  |  |   99|   832M|                : "a"(low),"g"(0)       \
  |  |  100|   832M|                : "cc");                \
  |  |  101|   832M|        (r)=carry, carry=high;          \
  |  |  102|   832M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (102:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  150|   832M|        mul(rp[1], ap[1], w, c1);
  ------------------
  |  |   91|   832M|# define mul(r,a,word,carry) do {       \
  |  |   92|   832M|        register BN_ULONG high,low;     \
  |  |   93|   832M|        asm ("mulq %3"                  \
  |  |   94|   832M|                : "=a"(low),"=d"(high)  \
  |  |   95|   832M|                : "a"(word),"g"(a)      \
  |  |   96|   832M|                : "cc");                \
  |  |   97|   832M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   98|   832M|                : "+r"(carry),"+d"(high)\
  |  |   99|   832M|                : "a"(low),"g"(0)       \
  |  |  100|   832M|                : "cc");                \
  |  |  101|   832M|        (r)=carry, carry=high;          \
  |  |  102|   832M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (102:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  151|   832M|        mul(rp[2], ap[2], w, c1);
  ------------------
  |  |   91|   832M|# define mul(r,a,word,carry) do {       \
  |  |   92|   832M|        register BN_ULONG high,low;     \
  |  |   93|   832M|        asm ("mulq %3"                  \
  |  |   94|   832M|                : "=a"(low),"=d"(high)  \
  |  |   95|   832M|                : "a"(word),"g"(a)      \
  |  |   96|   832M|                : "cc");                \
  |  |   97|   832M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   98|   832M|                : "+r"(carry),"+d"(high)\
  |  |   99|   832M|                : "a"(low),"g"(0)       \
  |  |  100|   832M|                : "cc");                \
  |  |  101|   832M|        (r)=carry, carry=high;          \
  |  |  102|   832M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (102:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  152|   832M|        mul(rp[3], ap[3], w, c1);
  ------------------
  |  |   91|   832M|# define mul(r,a,word,carry) do {       \
  |  |   92|   832M|        register BN_ULONG high,low;     \
  |  |   93|   832M|        asm ("mulq %3"                  \
  |  |   94|   832M|                : "=a"(low),"=d"(high)  \
  |  |   95|   832M|                : "a"(word),"g"(a)      \
  |  |   96|   832M|                : "cc");                \
  |  |   97|   832M|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   98|   832M|                : "+r"(carry),"+d"(high)\
  |  |   99|   832M|                : "a"(low),"g"(0)       \
  |  |  100|   832M|                : "cc");                \
  |  |  101|   832M|        (r)=carry, carry=high;          \
  |  |  102|   832M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (102:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  153|   832M|        ap += 4;
  154|   832M|        rp += 4;
  155|   832M|        num -= 4;
  156|   832M|    }
  157|  1.11M|    if (num) {
  ------------------
  |  Branch (157:9): [True: 774k, False: 340k]
  ------------------
  158|   774k|        mul(rp[0], ap[0], w, c1);
  ------------------
  |  |   91|   774k|# define mul(r,a,word,carry) do {       \
  |  |   92|   774k|        register BN_ULONG high,low;     \
  |  |   93|   774k|        asm ("mulq %3"                  \
  |  |   94|   774k|                : "=a"(low),"=d"(high)  \
  |  |   95|   774k|                : "a"(word),"g"(a)      \
  |  |   96|   774k|                : "cc");                \
  |  |   97|   774k|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   98|   774k|                : "+r"(carry),"+d"(high)\
  |  |   99|   774k|                : "a"(low),"g"(0)       \
  |  |  100|   774k|                : "cc");                \
  |  |  101|   774k|        (r)=carry, carry=high;          \
  |  |  102|   774k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (102:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  159|   774k|        if (--num == 0)
  ------------------
  |  Branch (159:13): [True: 339k, False: 435k]
  ------------------
  160|   339k|            return c1;
  161|   435k|        mul(rp[1], ap[1], w, c1);
  ------------------
  |  |   91|   435k|# define mul(r,a,word,carry) do {       \
  |  |   92|   435k|        register BN_ULONG high,low;     \
  |  |   93|   435k|        asm ("mulq %3"                  \
  |  |   94|   435k|                : "=a"(low),"=d"(high)  \
  |  |   95|   435k|                : "a"(word),"g"(a)      \
  |  |   96|   435k|                : "cc");                \
  |  |   97|   435k|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   98|   435k|                : "+r"(carry),"+d"(high)\
  |  |   99|   435k|                : "a"(low),"g"(0)       \
  |  |  100|   435k|                : "cc");                \
  |  |  101|   435k|        (r)=carry, carry=high;          \
  |  |  102|   435k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (102:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  162|   435k|        if (--num == 0)
  ------------------
  |  Branch (162:13): [True: 228k, False: 206k]
  ------------------
  163|   228k|            return c1;
  164|   206k|        mul(rp[2], ap[2], w, c1);
  ------------------
  |  |   91|   206k|# define mul(r,a,word,carry) do {       \
  |  |   92|   206k|        register BN_ULONG high,low;     \
  |  |   93|   206k|        asm ("mulq %3"                  \
  |  |   94|   206k|                : "=a"(low),"=d"(high)  \
  |  |   95|   206k|                : "a"(word),"g"(a)      \
  |  |   96|   206k|                : "cc");                \
  |  |   97|   206k|        asm ("addq %2,%0; adcq %3,%1"   \
  |  |   98|   206k|                : "+r"(carry),"+d"(high)\
  |  |   99|   206k|                : "a"(low),"g"(0)       \
  |  |  100|   206k|                : "cc");                \
  |  |  101|   206k|        (r)=carry, carry=high;          \
  |  |  102|   206k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (102:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  165|   206k|    }
  166|   546k|    return c1;
  167|  1.11M|}
bn_div_words:
  195|  1.10M|{
  196|  1.10M|    BN_ULONG ret, waste;
  ------------------
  |  |   37|  1.10M|#  define BN_ULONG        unsigned long
  ------------------
  197|       |
  198|  1.10M| asm("divq      %4":"=a"(ret), "=d"(waste)
  199|  1.10M| :     "a"(l), "d"(h), "r"(d)
  200|  1.10M| :     "cc");
  201|       |
  202|  1.10M|    return ret;
  203|  1.10M|}
bn_add_words:
  207|  4.97M|{
  208|  4.97M|    BN_ULONG ret;
  ------------------
  |  |   37|  4.97M|#  define BN_ULONG        unsigned long
  ------------------
  209|  4.97M|    size_t i = 0;
  210|       |
  211|  4.97M|    if (n <= 0)
  ------------------
  |  Branch (211:9): [True: 539, False: 4.97M]
  ------------------
  212|    539|        return 0;
  213|       |
  214|  4.97M|    asm volatile ("       subq    %0,%0           \n" /* clear carry */
  215|  4.97M|                  "       jmp     1f              \n"
  216|  4.97M|                  ".p2align 4                     \n"
  217|  4.97M|                  "1:     movq    (%4,%2,8),%0    \n"
  218|  4.97M|                  "       adcq    (%5,%2,8),%0    \n"
  219|  4.97M|                  "       movq    %0,(%3,%2,8)    \n"
  220|  4.97M|                  "       lea     1(%2),%2        \n"
  221|  4.97M|                  "       dec     %1              \n"
  222|  4.97M|                  "       jnz     1b              \n"
  223|  4.97M|                  "       sbbq    %0,%0           \n"
  224|  4.97M|                  :"=&r" (ret), "+c"(n), "+r"(i)
  225|  4.97M|                  :"r"(rp), "r"(ap), "r"(bp)
  226|  4.97M|                  :"cc", "memory");
  227|       |
  228|  4.97M|    return ret & 1;
  229|  4.97M|}
bn_sub_words:
  234|  4.46M|{
  235|  4.46M|    BN_ULONG ret;
  ------------------
  |  |   37|  4.46M|#  define BN_ULONG        unsigned long
  ------------------
  236|  4.46M|    size_t i = 0;
  237|       |
  238|  4.46M|    if (n <= 0)
  ------------------
  |  Branch (238:9): [True: 738, False: 4.46M]
  ------------------
  239|    738|        return 0;
  240|       |
  241|  4.46M|    asm volatile ("       subq    %0,%0           \n" /* clear borrow */
  242|  4.46M|                  "       jmp     1f              \n"
  243|  4.46M|                  ".p2align 4                     \n"
  244|  4.46M|                  "1:     movq    (%4,%2,8),%0    \n"
  245|  4.46M|                  "       sbbq    (%5,%2,8),%0    \n"
  246|  4.46M|                  "       movq    %0,(%3,%2,8)    \n"
  247|  4.46M|                  "       lea     1(%2),%2        \n"
  248|  4.46M|                  "       dec     %1              \n"
  249|  4.46M|                  "       jnz     1b              \n"
  250|  4.46M|                  "       sbbq    %0,%0           \n"
  251|  4.46M|                  :"=&r" (ret), "+c"(n), "+r"(i)
  252|  4.46M|                  :"r"(rp), "r"(ap), "r"(bp)
  253|  4.46M|                  :"cc", "memory");
  254|       |
  255|  4.46M|    return ret & 1;
  256|  4.46M|}
bn_mul_comba8:
  394|  2.84M|{
  395|  2.84M|    BN_ULONG c1, c2, c3;
  ------------------
  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  ------------------
  396|       |
  397|  2.84M|    c1 = 0;
  398|  2.84M|    c2 = 0;
  399|  2.84M|    c3 = 0;
  400|  2.84M|    mul_add_c(a[0], b[0], c1, c2, c3);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  401|  2.84M|    r[0] = c1;
  402|  2.84M|    c1 = 0;
  403|  2.84M|    mul_add_c(a[0], b[1], c2, c3, c1);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  404|  2.84M|    mul_add_c(a[1], b[0], c2, c3, c1);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  405|  2.84M|    r[1] = c2;
  406|  2.84M|    c2 = 0;
  407|  2.84M|    mul_add_c(a[2], b[0], c3, c1, c2);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  408|  2.84M|    mul_add_c(a[1], b[1], c3, c1, c2);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  409|  2.84M|    mul_add_c(a[0], b[2], c3, c1, c2);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  410|  2.84M|    r[2] = c3;
  411|  2.84M|    c3 = 0;
  412|  2.84M|    mul_add_c(a[0], b[3], c1, c2, c3);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  413|  2.84M|    mul_add_c(a[1], b[2], c1, c2, c3);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  414|  2.84M|    mul_add_c(a[2], b[1], c1, c2, c3);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  415|  2.84M|    mul_add_c(a[3], b[0], c1, c2, c3);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  416|  2.84M|    r[3] = c1;
  417|  2.84M|    c1 = 0;
  418|  2.84M|    mul_add_c(a[4], b[0], c2, c3, c1);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  419|  2.84M|    mul_add_c(a[3], b[1], c2, c3, c1);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  420|  2.84M|    mul_add_c(a[2], b[2], c2, c3, c1);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  421|  2.84M|    mul_add_c(a[1], b[3], c2, c3, c1);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  422|  2.84M|    mul_add_c(a[0], b[4], c2, c3, c1);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  423|  2.84M|    r[4] = c2;
  424|  2.84M|    c2 = 0;
  425|  2.84M|    mul_add_c(a[0], b[5], c3, c1, c2);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  426|  2.84M|    mul_add_c(a[1], b[4], c3, c1, c2);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  427|  2.84M|    mul_add_c(a[2], b[3], c3, c1, c2);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  428|  2.84M|    mul_add_c(a[3], b[2], c3, c1, c2);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  429|  2.84M|    mul_add_c(a[4], b[1], c3, c1, c2);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  430|  2.84M|    mul_add_c(a[5], b[0], c3, c1, c2);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  431|  2.84M|    r[5] = c3;
  432|  2.84M|    c3 = 0;
  433|  2.84M|    mul_add_c(a[6], b[0], c1, c2, c3);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  434|  2.84M|    mul_add_c(a[5], b[1], c1, c2, c3);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  435|  2.84M|    mul_add_c(a[4], b[2], c1, c2, c3);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  436|  2.84M|    mul_add_c(a[3], b[3], c1, c2, c3);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  437|  2.84M|    mul_add_c(a[2], b[4], c1, c2, c3);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  438|  2.84M|    mul_add_c(a[1], b[5], c1, c2, c3);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  439|  2.84M|    mul_add_c(a[0], b[6], c1, c2, c3);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  440|  2.84M|    r[6] = c1;
  441|  2.84M|    c1 = 0;
  442|  2.84M|    mul_add_c(a[0], b[7], c2, c3, c1);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  443|  2.84M|    mul_add_c(a[1], b[6], c2, c3, c1);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  444|  2.84M|    mul_add_c(a[2], b[5], c2, c3, c1);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  445|  2.84M|    mul_add_c(a[3], b[4], c2, c3, c1);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  446|  2.84M|    mul_add_c(a[4], b[3], c2, c3, c1);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  447|  2.84M|    mul_add_c(a[5], b[2], c2, c3, c1);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  448|  2.84M|    mul_add_c(a[6], b[1], c2, c3, c1);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  449|  2.84M|    mul_add_c(a[7], b[0], c2, c3, c1);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  450|  2.84M|    r[7] = c2;
  451|  2.84M|    c2 = 0;
  452|  2.84M|    mul_add_c(a[7], b[1], c3, c1, c2);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  453|  2.84M|    mul_add_c(a[6], b[2], c3, c1, c2);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  454|  2.84M|    mul_add_c(a[5], b[3], c3, c1, c2);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  455|  2.84M|    mul_add_c(a[4], b[4], c3, c1, c2);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  456|  2.84M|    mul_add_c(a[3], b[5], c3, c1, c2);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  457|  2.84M|    mul_add_c(a[2], b[6], c3, c1, c2);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  458|  2.84M|    mul_add_c(a[1], b[7], c3, c1, c2);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  459|  2.84M|    r[8] = c3;
  460|  2.84M|    c3 = 0;
  461|  2.84M|    mul_add_c(a[2], b[7], c1, c2, c3);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  462|  2.84M|    mul_add_c(a[3], b[6], c1, c2, c3);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  463|  2.84M|    mul_add_c(a[4], b[5], c1, c2, c3);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  464|  2.84M|    mul_add_c(a[5], b[4], c1, c2, c3);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  465|  2.84M|    mul_add_c(a[6], b[3], c1, c2, c3);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  466|  2.84M|    mul_add_c(a[7], b[2], c1, c2, c3);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  467|  2.84M|    r[9] = c1;
  468|  2.84M|    c1 = 0;
  469|  2.84M|    mul_add_c(a[7], b[3], c2, c3, c1);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  470|  2.84M|    mul_add_c(a[6], b[4], c2, c3, c1);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  471|  2.84M|    mul_add_c(a[5], b[5], c2, c3, c1);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  472|  2.84M|    mul_add_c(a[4], b[6], c2, c3, c1);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  473|  2.84M|    mul_add_c(a[3], b[7], c2, c3, c1);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  474|  2.84M|    r[10] = c2;
  475|  2.84M|    c2 = 0;
  476|  2.84M|    mul_add_c(a[4], b[7], c3, c1, c2);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  477|  2.84M|    mul_add_c(a[5], b[6], c3, c1, c2);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  478|  2.84M|    mul_add_c(a[6], b[5], c3, c1, c2);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  479|  2.84M|    mul_add_c(a[7], b[4], c3, c1, c2);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  480|  2.84M|    r[11] = c3;
  481|  2.84M|    c3 = 0;
  482|  2.84M|    mul_add_c(a[7], b[5], c1, c2, c3);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  483|  2.84M|    mul_add_c(a[6], b[6], c1, c2, c3);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  484|  2.84M|    mul_add_c(a[5], b[7], c1, c2, c3);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  485|  2.84M|    r[12] = c1;
  486|  2.84M|    c1 = 0;
  487|  2.84M|    mul_add_c(a[6], b[7], c2, c3, c1);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  488|  2.84M|    mul_add_c(a[7], b[6], c2, c3, c1);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  489|  2.84M|    r[13] = c2;
  490|  2.84M|    c2 = 0;
  491|  2.84M|    mul_add_c(a[7], b[7], c3, c1, c2);
  ------------------
  |  |  349|  2.84M|#  define mul_add_c(a,b,c0,c1,c2) do {  \
  |  |  350|  2.84M|        BN_ULONG t1,t2;                 \
  |  |  ------------------
  |  |  |  |   37|  2.84M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  351|  2.84M|        asm ("mulq %3"                  \
  |  |  352|  2.84M|                : "=a"(t1),"=d"(t2)     \
  |  |  353|  2.84M|                : "a"(a),"m"(b)         \
  |  |  354|  2.84M|                : "cc");                \
  |  |  355|  2.84M|        asm ("addq %3,%0; adcq %4,%1; adcq %5,%2"       \
  |  |  356|  2.84M|                : "+r"(c0),"+r"(c1),"+r"(c2)            \
  |  |  357|  2.84M|                : "r"(t1),"r"(t2),"g"(0)                \
  |  |  358|  2.84M|                : "cc");                                \
  |  |  359|  2.84M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (359:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
  492|  2.84M|    r[14] = c3;
  493|  2.84M|    r[15] = c1;
  494|  2.84M|}

BN_add:
   15|  2.62k|{
   16|  2.62k|    int ret, r_neg, cmp_res;
   17|       |
   18|  2.62k|    bn_check_top(a);
   19|  2.62k|    bn_check_top(b);
   20|       |
   21|  2.62k|    if (a->neg == b->neg) {
  ------------------
  |  Branch (21:9): [True: 2.32k, False: 298]
  ------------------
   22|  2.32k|        r_neg = a->neg;
   23|  2.32k|        ret = BN_uadd(r, a, b);
   24|  2.32k|    } else {
   25|    298|        cmp_res = BN_ucmp(a, b);
   26|    298|        if (cmp_res > 0) {
  ------------------
  |  Branch (26:13): [True: 176, False: 122]
  ------------------
   27|    176|            r_neg = a->neg;
   28|    176|            ret = BN_usub(r, a, b);
   29|    176|        } else if (cmp_res < 0) {
  ------------------
  |  Branch (29:20): [True: 122, False: 0]
  ------------------
   30|    122|            r_neg = b->neg;
   31|    122|            ret = BN_usub(r, b, a);
   32|    122|        } else {
   33|      0|            r_neg = 0;
   34|      0|            BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
   35|      0|            ret = 1;
   36|      0|        }
   37|    298|    }
   38|       |
   39|  2.62k|    r->neg = r_neg;
   40|  2.62k|    bn_check_top(r);
   41|  2.62k|    return ret;
   42|  2.62k|}
BN_uadd:
   77|  2.32k|{
   78|  2.32k|    int max, min, dif;
   79|  2.32k|    const BN_ULONG *ap, *bp;
   80|  2.32k|    BN_ULONG *rp, carry, t1, t2;
  ------------------
  |  |   37|  2.32k|#  define BN_ULONG        unsigned long
  ------------------
   81|       |
   82|  2.32k|    bn_check_top(a);
   83|  2.32k|    bn_check_top(b);
   84|       |
   85|  2.32k|    if (a->top < b->top) {
  ------------------
  |  Branch (85:9): [True: 53, False: 2.27k]
  ------------------
   86|     53|        const BIGNUM *tmp;
   87|       |
   88|     53|        tmp = a;
   89|     53|        a = b;
   90|     53|        b = tmp;
   91|     53|    }
   92|  2.32k|    max = a->top;
   93|  2.32k|    min = b->top;
   94|  2.32k|    dif = max - min;
   95|       |
   96|  2.32k|    if (bn_wexpand(r, max + 1) == NULL)
  ------------------
  |  Branch (96:9): [True: 0, False: 2.32k]
  ------------------
   97|      0|        return 0;
   98|       |
   99|  2.32k|    r->top = max;
  100|       |
  101|  2.32k|    ap = a->d;
  102|  2.32k|    bp = b->d;
  103|  2.32k|    rp = r->d;
  104|       |
  105|  2.32k|    carry = bn_add_words(rp, ap, bp, min);
  106|  2.32k|    rp += min;
  107|  2.32k|    ap += min;
  108|       |
  109|  1.04M|    while (dif) {
  ------------------
  |  Branch (109:12): [True: 1.04M, False: 2.32k]
  ------------------
  110|  1.04M|        dif--;
  111|  1.04M|        t1 = *(ap++);
  112|  1.04M|        t2 = (t1 + carry) & BN_MASK2;
  ------------------
  |  |   94|  1.04M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  113|  1.04M|        *(rp++) = t2;
  114|  1.04M|        carry &= (t2 == 0);
  115|  1.04M|    }
  116|  2.32k|    *rp = carry;
  117|  2.32k|    r->top += carry;
  118|       |
  119|  2.32k|    r->neg = 0;
  120|  2.32k|    bn_check_top(r);
  121|  2.32k|    return 1;
  122|  2.32k|}
BN_usub:
  126|    298|{
  127|    298|    int max, min, dif;
  128|    298|    BN_ULONG t1, t2, borrow, *rp;
  ------------------
  |  |   37|    298|#  define BN_ULONG        unsigned long
  ------------------
  129|    298|    const BN_ULONG *ap, *bp;
  130|       |
  131|    298|    bn_check_top(a);
  132|    298|    bn_check_top(b);
  133|       |
  134|    298|    max = a->top;
  135|    298|    min = b->top;
  136|    298|    dif = max - min;
  137|       |
  138|    298|    if (dif < 0) {              /* hmm... should not be happening */
  ------------------
  |  Branch (138:9): [True: 0, False: 298]
  ------------------
  139|      0|        ERR_raise(ERR_LIB_BN, BN_R_ARG2_LT_ARG3);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
  140|      0|        return 0;
  141|      0|    }
  142|       |
  143|    298|    if (bn_wexpand(r, max) == NULL)
  ------------------
  |  Branch (143:9): [True: 0, False: 298]
  ------------------
  144|      0|        return 0;
  145|       |
  146|    298|    ap = a->d;
  147|    298|    bp = b->d;
  148|    298|    rp = r->d;
  149|       |
  150|    298|    borrow = bn_sub_words(rp, ap, bp, min);
  151|    298|    ap += min;
  152|    298|    rp += min;
  153|       |
  154|   111k|    while (dif) {
  ------------------
  |  Branch (154:12): [True: 111k, False: 298]
  ------------------
  155|   111k|        dif--;
  156|   111k|        t1 = *(ap++);
  157|   111k|        t2 = (t1 - borrow) & BN_MASK2;
  ------------------
  |  |   94|   111k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  158|   111k|        *(rp++) = t2;
  159|   111k|        borrow &= (t1 == 0);
  160|   111k|    }
  161|       |
  162|    298|    while (max && *--rp == 0)
  ------------------
  |  Branch (162:12): [True: 298, False: 0]
  |  Branch (162:19): [True: 0, False: 298]
  ------------------
  163|      0|        max--;
  164|       |
  165|    298|    r->top = max;
  166|    298|    r->neg = 0;
  167|    298|    bn_pollute(r);
  168|       |
  169|    298|    return 1;
  170|    298|}

BN_CTX_new_ex:
  119|      2|{
  120|      2|    BN_CTX *ret;
  121|       |
  122|      2|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == 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 (122:9): [True: 0, False: 2]
  ------------------
  123|      0|        return NULL;
  124|       |    /* Initialise the structure */
  125|      2|    BN_POOL_init(&ret->pool);
  126|      2|    BN_STACK_init(&ret->stack);
  127|      2|    ret->libctx = ctx;
  128|      2|    return ret;
  129|      2|}
BN_CTX_new:
  133|      2|{
  134|      2|    return BN_CTX_new_ex(NULL);
  135|      2|}
BN_CTX_start:
  180|  4.76k|{
  181|  4.76k|    CTXDBG("ENTER BN_CTX_start()", ctx);
  ------------------
  |  |  110|  4.76k|    OSSL_TRACE_BEGIN(BN_CTX) {      \
  |  |  ------------------
  |  |  |  |  219|  4.76k|    do {                                        \
  |  |  |  |  220|  4.76k|        BIO *trc_out = NULL;                    \
  |  |  |  |  221|  4.76k|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|      0|        ctxdbg(trc_out, str, ctx);  \
  |  |  112|  4.76k|    } OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  224|  4.76k|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|       |    /* If we're already overflowing ... */
  183|  4.76k|    if (ctx->err_stack || ctx->too_many)
  ------------------
  |  Branch (183:9): [True: 0, False: 4.76k]
  |  Branch (183:27): [True: 0, False: 4.76k]
  ------------------
  184|      0|        ctx->err_stack++;
  185|       |    /* (Try to) get a new frame pointer */
  186|  4.76k|    else if (!BN_STACK_push(&ctx->stack, ctx->used)) {
  ------------------
  |  Branch (186:14): [True: 0, False: 4.76k]
  ------------------
  187|      0|        ERR_raise(ERR_LIB_BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
  188|      0|        ctx->err_stack++;
  189|      0|    }
  190|  4.76k|    CTXDBG("LEAVE BN_CTX_start()", ctx);
  ------------------
  |  |  110|  4.76k|    OSSL_TRACE_BEGIN(BN_CTX) {      \
  |  |  ------------------
  |  |  |  |  219|  4.76k|    do {                                        \
  |  |  |  |  220|  4.76k|        BIO *trc_out = NULL;                    \
  |  |  |  |  221|  4.76k|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|      0|        ctxdbg(trc_out, str, ctx);  \
  |  |  112|  4.76k|    } OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  224|  4.76k|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|  4.76k|}
BN_CTX_end:
  194|  4.76k|{
  195|  4.76k|    if (ctx == NULL)
  ------------------
  |  Branch (195:9): [True: 0, False: 4.76k]
  ------------------
  196|      0|        return;
  197|  4.76k|    CTXDBG("ENTER BN_CTX_end()", ctx);
  ------------------
  |  |  110|  4.76k|    OSSL_TRACE_BEGIN(BN_CTX) {      \
  |  |  ------------------
  |  |  |  |  219|  4.76k|    do {                                        \
  |  |  |  |  220|  4.76k|        BIO *trc_out = NULL;                    \
  |  |  |  |  221|  4.76k|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|      0|        ctxdbg(trc_out, str, ctx);  \
  |  |  112|  4.76k|    } OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  224|  4.76k|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  198|  4.76k|    if (ctx->err_stack)
  ------------------
  |  Branch (198:9): [True: 0, False: 4.76k]
  ------------------
  199|      0|        ctx->err_stack--;
  200|  4.76k|    else {
  201|  4.76k|        unsigned int fp = BN_STACK_pop(&ctx->stack);
  202|       |        /* Does this stack frame have anything to release? */
  203|  4.76k|        if (fp < ctx->used)
  ------------------
  |  Branch (203:13): [True: 3.66k, False: 1.10k]
  ------------------
  204|  3.66k|            BN_POOL_release(&ctx->pool, ctx->used - fp);
  205|  4.76k|        ctx->used = fp;
  206|       |        /* Unjam "too_many" in case "get" had failed */
  207|  4.76k|        ctx->too_many = 0;
  208|  4.76k|    }
  209|  4.76k|    CTXDBG("LEAVE BN_CTX_end()", ctx);
  ------------------
  |  |  110|  4.76k|    OSSL_TRACE_BEGIN(BN_CTX) {      \
  |  |  ------------------
  |  |  |  |  219|  4.76k|    do {                                        \
  |  |  |  |  220|  4.76k|        BIO *trc_out = NULL;                    \
  |  |  |  |  221|  4.76k|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|      0|        ctxdbg(trc_out, str, ctx);  \
  |  |  112|  4.76k|    } OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  224|  4.76k|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|  4.76k|}
BN_CTX_get:
  213|  8.90k|{
  214|  8.90k|    BIGNUM *ret;
  215|       |
  216|  8.90k|    CTXDBG("ENTER BN_CTX_get()", ctx);
  ------------------
  |  |  110|  8.90k|    OSSL_TRACE_BEGIN(BN_CTX) {      \
  |  |  ------------------
  |  |  |  |  219|  8.90k|    do {                                        \
  |  |  |  |  220|  8.90k|        BIO *trc_out = NULL;                    \
  |  |  |  |  221|  8.90k|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|      0|        ctxdbg(trc_out, str, ctx);  \
  |  |  112|  8.90k|    } OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  224|  8.90k|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  217|  8.90k|    if (ctx->err_stack || ctx->too_many)
  ------------------
  |  Branch (217:9): [True: 0, False: 8.90k]
  |  Branch (217:27): [True: 0, False: 8.90k]
  ------------------
  218|      0|        return NULL;
  219|  8.90k|    if ((ret = BN_POOL_get(&ctx->pool, ctx->flags)) == NULL) {
  ------------------
  |  Branch (219:9): [True: 0, False: 8.90k]
  ------------------
  220|       |        /*
  221|       |         * Setting too_many prevents repeated "get" attempts from cluttering
  222|       |         * the error stack.
  223|       |         */
  224|      0|        ctx->too_many = 1;
  225|      0|        ERR_raise(ERR_LIB_BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
  226|      0|        return NULL;
  227|      0|    }
  228|       |    /* OK, make sure the returned bignum is "zero" */
  229|  8.90k|    BN_zero(ret);
  ------------------
  |  |  202|  8.90k|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  230|       |    /* clear BN_FLG_CONSTTIME if leaked from previous frames */
  231|  8.90k|    ret->flags &= (~BN_FLG_CONSTTIME);
  ------------------
  |  |   67|  8.90k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  232|  8.90k|    ctx->used++;
  233|  8.90k|    CTXDBG("LEAVE BN_CTX_get()", ctx);
  ------------------
  |  |  110|  8.90k|    OSSL_TRACE_BEGIN(BN_CTX) {      \
  |  |  ------------------
  |  |  |  |  219|  8.90k|    do {                                        \
  |  |  |  |  220|  8.90k|        BIO *trc_out = NULL;                    \
  |  |  |  |  221|  8.90k|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (221:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|      0|        ctxdbg(trc_out, str, ctx);  \
  |  |  112|  8.90k|    } OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  224|  8.90k|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (224:13): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  234|  8.90k|    return ret;
  235|  8.90k|}
bn_ctx.c:BN_STACK_init:
  249|      2|{
  250|      2|    st->indexes = NULL;
  251|      2|    st->depth = st->size = 0;
  252|      2|}
bn_ctx.c:BN_STACK_push:
  262|  4.76k|{
  263|  4.76k|    if (st->depth == st->size) {
  ------------------
  |  Branch (263:9): [True: 1, False: 4.76k]
  ------------------
  264|       |        /* Need to expand */
  265|      1|        unsigned int newsize =
  266|      1|            st->size ? (st->size * 3 / 2) : BN_CTX_START_FRAMES;
  ------------------
  |  |   17|      1|#define BN_CTX_START_FRAMES     32
  ------------------
  |  Branch (266:13): [True: 0, False: 1]
  ------------------
  267|      1|        unsigned int *newitems;
  268|       |
  269|      1|        if ((newitems = OPENSSL_malloc(sizeof(*newitems) * newsize)) == NULL)
  ------------------
  |  |  102|      1|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (269:13): [True: 0, False: 1]
  ------------------
  270|      0|            return 0;
  271|      1|        if (st->depth)
  ------------------
  |  Branch (271:13): [True: 0, False: 1]
  ------------------
  272|      0|            memcpy(newitems, st->indexes, sizeof(*newitems) * st->depth);
  273|      1|        OPENSSL_free(st->indexes);
  ------------------
  |  |  115|      1|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  274|      1|        st->indexes = newitems;
  275|      1|        st->size = newsize;
  276|      1|    }
  277|  4.76k|    st->indexes[(st->depth)++] = idx;
  278|  4.76k|    return 1;
  279|  4.76k|}
bn_ctx.c:BN_STACK_pop:
  282|  4.76k|{
  283|  4.76k|    return st->indexes[--(st->depth)];
  284|  4.76k|}
bn_ctx.c:BN_POOL_init:
  291|      2|{
  292|      2|    p->head = p->current = p->tail = NULL;
  293|      2|    p->used = p->size = 0;
  294|      2|}
bn_ctx.c:BN_POOL_get:
  313|  8.90k|{
  314|  8.90k|    BIGNUM *bn;
  315|  8.90k|    unsigned int loop;
  316|       |
  317|       |    /* Full; allocate a new pool item and link it in. */
  318|  8.90k|    if (p->used == p->size) {
  ------------------
  |  Branch (318:9): [True: 1, False: 8.90k]
  ------------------
  319|      1|        BN_POOL_ITEM *item;
  320|       |
  321|      1|        if ((item = OPENSSL_malloc(sizeof(*item))) == NULL)
  ------------------
  |  |  102|      1|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (321:13): [True: 0, False: 1]
  ------------------
  322|      0|            return NULL;
  323|     17|        for (loop = 0, bn = item->vals; loop++ < BN_CTX_POOL_SIZE; bn++) {
  ------------------
  |  |   15|     17|#define BN_CTX_POOL_SIZE        16
  ------------------
  |  Branch (323:41): [True: 16, False: 1]
  ------------------
  324|     16|            bn_init(bn);
  325|     16|            if ((flag & BN_FLG_SECURE) != 0)
  ------------------
  |  |   68|     16|# define BN_FLG_SECURE           0x08
  ------------------
  |  Branch (325:17): [True: 0, False: 16]
  ------------------
  326|      0|                BN_set_flags(bn, BN_FLG_SECURE);
  ------------------
  |  |   68|      0|# define BN_FLG_SECURE           0x08
  ------------------
  327|     16|        }
  328|      1|        item->prev = p->tail;
  329|      1|        item->next = NULL;
  330|       |
  331|      1|        if (p->head == NULL)
  ------------------
  |  Branch (331:13): [True: 1, False: 0]
  ------------------
  332|      1|            p->head = p->current = p->tail = item;
  333|      0|        else {
  334|      0|            p->tail->next = item;
  335|      0|            p->tail = item;
  336|      0|            p->current = item;
  337|      0|        }
  338|      1|        p->size += BN_CTX_POOL_SIZE;
  ------------------
  |  |   15|      1|#define BN_CTX_POOL_SIZE        16
  ------------------
  339|      1|        p->used++;
  340|       |        /* Return the first bignum from the new pool */
  341|      1|        return item->vals;
  342|      1|    }
  343|       |
  344|  8.90k|    if (!p->used)
  ------------------
  |  Branch (344:9): [True: 3.65k, False: 5.24k]
  ------------------
  345|  3.65k|        p->current = p->head;
  346|  5.24k|    else if ((p->used % BN_CTX_POOL_SIZE) == 0)
  ------------------
  |  |   15|  5.24k|#define BN_CTX_POOL_SIZE        16
  ------------------
  |  Branch (346:14): [True: 0, False: 5.24k]
  ------------------
  347|      0|        p->current = p->current->next;
  348|  8.90k|    return p->current->vals + ((p->used++) % BN_CTX_POOL_SIZE);
  ------------------
  |  |   15|  8.90k|#define BN_CTX_POOL_SIZE        16
  ------------------
  349|  8.90k|}
bn_ctx.c:BN_POOL_release:
  352|  3.66k|{
  353|  3.66k|    unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE;
  ------------------
  |  |   15|  3.66k|#define BN_CTX_POOL_SIZE        16
  ------------------
  354|       |
  355|  3.66k|    p->used -= num;
  356|  12.5k|    while (num--) {
  ------------------
  |  Branch (356:12): [True: 8.90k, False: 3.66k]
  ------------------
  357|  8.90k|        bn_check_top(p->current->vals + offset);
  358|  8.90k|        if (offset == 0) {
  ------------------
  |  Branch (358:13): [True: 3.66k, False: 5.24k]
  ------------------
  359|  3.66k|            offset = BN_CTX_POOL_SIZE - 1;
  ------------------
  |  |   15|  3.66k|#define BN_CTX_POOL_SIZE        16
  ------------------
  360|  3.66k|            p->current = p->current->prev;
  361|  3.66k|        } else
  362|  5.24k|            offset--;
  363|  8.90k|    }
  364|  3.66k|}

BN_div:
  211|  2.62k|{
  212|  2.62k|    int ret;
  213|       |
  214|  2.62k|    if (BN_is_zero(divisor)) {
  ------------------
  |  Branch (214:9): [True: 0, False: 2.62k]
  ------------------
  215|      0|        ERR_raise(ERR_LIB_BN, BN_R_DIV_BY_ZERO);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
  216|      0|        return 0;
  217|      0|    }
  218|       |
  219|       |    /*
  220|       |     * Invalid zero-padding would have particularly bad consequences so don't
  221|       |     * just rely on bn_check_top() here (bn_check_top() works only for
  222|       |     * BN_DEBUG builds)
  223|       |     */
  224|  2.62k|    if (divisor->d[divisor->top - 1] == 0) {
  ------------------
  |  Branch (224:9): [True: 0, False: 2.62k]
  ------------------
  225|      0|        ERR_raise(ERR_LIB_BN, BN_R_NOT_INITIALIZED);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
  226|      0|        return 0;
  227|      0|    }
  228|       |
  229|  2.62k|    ret = bn_div_fixed_top(dv, rm, num, divisor, ctx);
  230|       |
  231|  2.62k|    if (ret) {
  ------------------
  |  Branch (231:9): [True: 2.62k, False: 0]
  ------------------
  232|  2.62k|        if (dv != NULL)
  ------------------
  |  Branch (232:13): [True: 2.62k, False: 0]
  ------------------
  233|  2.62k|            bn_correct_top(dv);
  234|  2.62k|        if (rm != NULL)
  ------------------
  |  Branch (234:13): [True: 2.62k, False: 0]
  ------------------
  235|  2.62k|            bn_correct_top(rm);
  236|  2.62k|    }
  237|       |
  238|  2.62k|    return ret;
  239|  2.62k|}
bn_div_fixed_top:
  266|  2.62k|{
  267|  2.62k|    int norm_shift, i, j, loop;
  268|  2.62k|    BIGNUM *tmp, *snum, *sdiv, *res;
  269|  2.62k|    BN_ULONG *resp, *wnum, *wnumtop;
  ------------------
  |  |   37|  2.62k|#  define BN_ULONG        unsigned long
  ------------------
  270|  2.62k|    BN_ULONG d0, d1;
  ------------------
  |  |   37|  2.62k|#  define BN_ULONG        unsigned long
  ------------------
  271|  2.62k|    int num_n, div_n, num_neg;
  272|       |
  273|  2.62k|    assert(divisor->top > 0 && divisor->d[divisor->top - 1] != 0);
  274|       |
  275|  2.62k|    bn_check_top(num);
  276|  2.62k|    bn_check_top(divisor);
  277|  2.62k|    bn_check_top(dv);
  278|  2.62k|    bn_check_top(rm);
  279|       |
  280|  2.62k|    BN_CTX_start(ctx);
  281|  2.62k|    res = (dv == NULL) ? BN_CTX_get(ctx) : dv;
  ------------------
  |  Branch (281:11): [True: 0, False: 2.62k]
  ------------------
  282|  2.62k|    tmp = BN_CTX_get(ctx);
  283|  2.62k|    snum = BN_CTX_get(ctx);
  284|  2.62k|    sdiv = BN_CTX_get(ctx);
  285|  2.62k|    if (sdiv == NULL)
  ------------------
  |  Branch (285:9): [True: 0, False: 2.62k]
  ------------------
  286|      0|        goto err;
  287|       |
  288|       |    /* First we normalise the numbers */
  289|  2.62k|    if (!BN_copy(sdiv, divisor))
  ------------------
  |  Branch (289:9): [True: 0, False: 2.62k]
  ------------------
  290|      0|        goto err;
  291|  2.62k|    norm_shift = bn_left_align(sdiv);
  292|  2.62k|    sdiv->neg = 0;
  293|       |    /*
  294|       |     * Note that bn_lshift_fixed_top's output is always one limb longer
  295|       |     * than input, even when norm_shift is zero. This means that amount of
  296|       |     * inner loop iterations is invariant of dividend value, and that one
  297|       |     * doesn't need to compare dividend and divisor if they were originally
  298|       |     * of the same bit length.
  299|       |     */
  300|  2.62k|    if (!(bn_lshift_fixed_top(snum, num, norm_shift)))
  ------------------
  |  Branch (300:9): [True: 0, False: 2.62k]
  ------------------
  301|      0|        goto err;
  302|       |
  303|  2.62k|    div_n = sdiv->top;
  304|  2.62k|    num_n = snum->top;
  305|       |
  306|  2.62k|    if (num_n <= div_n) {
  ------------------
  |  Branch (306:9): [True: 395, False: 2.22k]
  ------------------
  307|       |        /* caller didn't pad dividend -> no constant-time guarantee... */
  308|    395|        if (bn_wexpand(snum, div_n + 1) == NULL)
  ------------------
  |  Branch (308:13): [True: 0, False: 395]
  ------------------
  309|      0|            goto err;
  310|    395|        memset(&(snum->d[num_n]), 0, (div_n - num_n + 1) * sizeof(BN_ULONG));
  311|    395|        snum->top = num_n = div_n + 1;
  312|    395|    }
  313|       |
  314|  2.62k|    loop = num_n - div_n;
  315|       |    /*
  316|       |     * Lets setup a 'window' into snum This is the part that corresponds to
  317|       |     * the current 'area' being divided
  318|       |     */
  319|  2.62k|    wnum = &(snum->d[loop]);
  320|  2.62k|    wnumtop = &(snum->d[num_n - 1]);
  321|       |
  322|       |    /* Get the top 2 words of sdiv */
  323|  2.62k|    d0 = sdiv->d[div_n - 1];
  324|  2.62k|    d1 = (div_n == 1) ? 0 : sdiv->d[div_n - 2];
  ------------------
  |  Branch (324:10): [True: 671, False: 1.95k]
  ------------------
  325|       |
  326|       |    /* Setup quotient */
  327|  2.62k|    if (!bn_wexpand(res, loop))
  ------------------
  |  Branch (327:9): [True: 0, False: 2.62k]
  ------------------
  328|      0|        goto err;
  329|  2.62k|    num_neg = num->neg;
  330|  2.62k|    res->neg = (num_neg ^ divisor->neg);
  331|  2.62k|    res->top = loop;
  332|  2.62k|    res->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  2.62k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  333|  2.62k|    resp = &(res->d[loop]);
  334|       |
  335|       |    /* space for temp */
  336|  2.62k|    if (!bn_wexpand(tmp, (div_n + 1)))
  ------------------
  |  Branch (336:9): [True: 0, False: 2.62k]
  ------------------
  337|      0|        goto err;
  338|       |
  339|  1.11M|    for (i = 0; i < loop; i++, wnumtop--) {
  ------------------
  |  Branch (339:17): [True: 1.11M, False: 2.62k]
  ------------------
  340|  1.11M|        BN_ULONG q, l0;
  ------------------
  |  |   37|  1.11M|#  define BN_ULONG        unsigned long
  ------------------
  341|       |        /*
  342|       |         * the first part of the loop uses the top two words of snum and sdiv
  343|       |         * to calculate a BN_ULONG q such that | wnum - sdiv * q | < sdiv
  344|       |         */
  345|       |# if defined(BN_DIV3W)
  346|       |        q = bn_div_3_words(wnumtop, d1, d0);
  347|       |# else
  348|  1.11M|        BN_ULONG n0, n1, rem = 0;
  ------------------
  |  |   37|  1.11M|#  define BN_ULONG        unsigned long
  ------------------
  349|       |
  350|  1.11M|        n0 = wnumtop[0];
  351|  1.11M|        n1 = wnumtop[-1];
  352|  1.11M|        if (n0 == d0)
  ------------------
  |  Branch (352:13): [True: 6.28k, False: 1.10M]
  ------------------
  353|  6.28k|            q = BN_MASK2;
  ------------------
  |  |   94|  6.28k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  354|  1.10M|        else {                  /* n0 < d0 */
  355|  1.10M|            BN_ULONG n2 = (wnumtop == wnum) ? 0 : wnumtop[-2];
  ------------------
  |  |   37|  1.10M|#  define BN_ULONG        unsigned long
  ------------------
  |  Branch (355:27): [True: 180k, False: 925k]
  ------------------
  356|       |#  ifdef BN_LLONG
  357|       |            BN_ULLONG t2;
  358|       |
  359|       |#   if defined(BN_LLONG) && defined(BN_DIV2W) && !defined(bn_div_words)
  360|       |            q = (BN_ULONG)(((((BN_ULLONG) n0) << BN_BITS2) | n1) / d0);
  361|       |#   else
  362|       |            q = bn_div_words(n0, n1, d0);
  363|       |#   endif
  364|       |
  365|       |#   ifndef REMAINDER_IS_ALREADY_CALCULATED
  366|       |            /*
  367|       |             * rem doesn't have to be BN_ULLONG. The least we
  368|       |             * know it's less that d0, isn't it?
  369|       |             */
  370|       |            rem = (n1 - q * d0) & BN_MASK2;
  371|       |#   endif
  372|       |            t2 = (BN_ULLONG) d1 *q;
  373|       |
  374|       |            for (;;) {
  375|       |                if (t2 <= ((((BN_ULLONG) rem) << BN_BITS2) | n2))
  376|       |                    break;
  377|       |                q--;
  378|       |                rem += d0;
  379|       |                if (rem < d0)
  380|       |                    break;      /* don't let rem overflow */
  381|       |                t2 -= d1;
  382|       |            }
  383|       |#  else                         /* !BN_LLONG */
  384|  1.10M|            BN_ULONG t2l, t2h;
  ------------------
  |  |   37|  1.10M|#  define BN_ULONG        unsigned long
  ------------------
  385|       |
  386|  1.10M|            q = bn_div_words(n0, n1, d0);
  387|  1.10M|#   ifndef REMAINDER_IS_ALREADY_CALCULATED
  388|  1.10M|            rem = (n1 - q * d0) & BN_MASK2;
  ------------------
  |  |   94|  1.10M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  389|  1.10M|#   endif
  390|       |
  391|       |#   if defined(BN_UMULT_LOHI)
  392|       |            BN_UMULT_LOHI(t2l, t2h, d1, q);
  393|       |#   elif defined(BN_UMULT_HIGH)
  394|       |            t2l = d1 * q;
  395|       |            t2h = BN_UMULT_HIGH(d1, q);
  396|       |#   else
  397|  1.10M|            {
  398|  1.10M|                BN_ULONG ql, qh;
  ------------------
  |  |   37|  1.10M|#  define BN_ULONG        unsigned long
  ------------------
  399|  1.10M|                t2l = LBITS(d1);
  ------------------
  |  |  566|  1.10M|#  define LBITS(a)        ((a)&BN_MASK2l)
  |  |  ------------------
  |  |  |  |   95|  1.10M|#  define BN_MASK2l       (0xffffffffL)
  |  |  ------------------
  ------------------
  400|  1.10M|                t2h = HBITS(d1);
  ------------------
  |  |  567|  1.10M|#  define HBITS(a)        (((a)>>BN_BITS4)&BN_MASK2l)
  |  |  ------------------
  |  |  |  |   93|  1.10M|#  define BN_BITS4        32
  |  |  ------------------
  |  |               #  define HBITS(a)        (((a)>>BN_BITS4)&BN_MASK2l)
  |  |  ------------------
  |  |  |  |   95|  1.10M|#  define BN_MASK2l       (0xffffffffL)
  |  |  ------------------
  ------------------
  401|  1.10M|                ql = LBITS(q);
  ------------------
  |  |  566|  1.10M|#  define LBITS(a)        ((a)&BN_MASK2l)
  |  |  ------------------
  |  |  |  |   95|  1.10M|#  define BN_MASK2l       (0xffffffffL)
  |  |  ------------------
  ------------------
  402|  1.10M|                qh = HBITS(q);
  ------------------
  |  |  567|  1.10M|#  define HBITS(a)        (((a)>>BN_BITS4)&BN_MASK2l)
  |  |  ------------------
  |  |  |  |   93|  1.10M|#  define BN_BITS4        32
  |  |  ------------------
  |  |               #  define HBITS(a)        (((a)>>BN_BITS4)&BN_MASK2l)
  |  |  ------------------
  |  |  |  |   95|  1.10M|#  define BN_MASK2l       (0xffffffffL)
  |  |  ------------------
  ------------------
  403|  1.10M|                mul64(t2l, t2h, ql, qh); /* t2=(BN_ULLONG)d1*q; */
  ------------------
  |  |  575|  1.10M|        { \
  |  |  576|  1.10M|        BN_ULONG m,m1,lt,ht; \
  |  |  ------------------
  |  |  |  |   37|  1.10M|#  define BN_ULONG        unsigned long
  |  |  ------------------
  |  |  577|  1.10M| \
  |  |  578|  1.10M|        lt=l; \
  |  |  579|  1.10M|        ht=h; \
  |  |  580|  1.10M|        m =(bh)*(lt); \
  |  |  581|  1.10M|        lt=(bl)*(lt); \
  |  |  582|  1.10M|        m1=(bl)*(ht); \
  |  |  583|  1.10M|        ht =(bh)*(ht); \
  |  |  584|  1.10M|        m=(m+m1)&BN_MASK2; ht += L2HBITS((BN_ULONG)(m < m1)); \
  |  |  ------------------
  |  |  |  |   94|  1.10M|#  define BN_MASK2        (0xffffffffffffffffL)
  |  |  ------------------
  |  |                       m=(m+m1)&BN_MASK2; ht += L2HBITS((BN_ULONG)(m < m1)); \
  |  |  ------------------
  |  |  |  |  568|  1.10M|#  define L2HBITS(a)      (((a)<<BN_BITS4)&BN_MASK2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  1.10M|#  define BN_BITS4        32
  |  |  |  |  ------------------
  |  |  |  |               #  define L2HBITS(a)      (((a)<<BN_BITS4)&BN_MASK2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|  1.10M|#  define BN_MASK2        (0xffffffffffffffffL)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  585|  1.10M|        ht+=HBITS(m); \
  |  |  ------------------
  |  |  |  |  567|  1.10M|#  define HBITS(a)        (((a)>>BN_BITS4)&BN_MASK2l)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  1.10M|#  define BN_BITS4        32
  |  |  |  |  ------------------
  |  |  |  |               #  define HBITS(a)        (((a)>>BN_BITS4)&BN_MASK2l)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  1.10M|#  define BN_MASK2l       (0xffffffffL)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  586|  1.10M|        m1=L2HBITS(m); \
  |  |  ------------------
  |  |  |  |  568|  1.10M|#  define L2HBITS(a)      (((a)<<BN_BITS4)&BN_MASK2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  1.10M|#  define BN_BITS4        32
  |  |  |  |  ------------------
  |  |  |  |               #  define L2HBITS(a)      (((a)<<BN_BITS4)&BN_MASK2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|  1.10M|#  define BN_MASK2        (0xffffffffffffffffL)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  587|  1.10M|        lt=(lt+m1)&BN_MASK2; ht += (lt < m1); \
  |  |  ------------------
  |  |  |  |   94|  1.10M|#  define BN_MASK2        (0xffffffffffffffffL)
  |  |  ------------------
  |  |  588|  1.10M|        (l)=lt; \
  |  |  589|  1.10M|        (h)=ht; \
  |  |  590|  1.10M|        }
  ------------------
  404|  1.10M|            }
  405|  1.10M|#   endif
  406|       |
  407|  1.13M|            for (;;) {
  408|  1.13M|                if ((t2h < rem) || ((t2h == rem) && (t2l <= n2)))
  ------------------
  |  Branch (408:21): [True: 889k, False: 250k]
  |  Branch (408:37): [True: 139k, False: 111k]
  |  Branch (408:53): [True: 138k, False: 131]
  ------------------
  409|  1.02M|                    break;
  410|   111k|                q--;
  411|   111k|                rem += d0;
  412|   111k|                if (rem < d0)
  ------------------
  |  Branch (412:21): [True: 78.2k, False: 33.4k]
  ------------------
  413|  78.2k|                    break;      /* don't let rem overflow */
  414|  33.4k|                if (t2l < d1)
  ------------------
  |  Branch (414:21): [True: 23.8k, False: 9.63k]
  ------------------
  415|  23.8k|                    t2h--;
  416|  33.4k|                t2l -= d1;
  417|  33.4k|            }
  418|  1.10M|#  endif                        /* !BN_LLONG */
  419|  1.10M|        }
  420|  1.11M|# endif                         /* !BN_DIV3W */
  421|       |
  422|  1.11M|        l0 = bn_mul_words(tmp->d, sdiv->d, div_n, q);
  423|  1.11M|        tmp->d[div_n] = l0;
  424|  1.11M|        wnum--;
  425|       |        /*
  426|       |         * ignore top values of the bignums just sub the two BN_ULONG arrays
  427|       |         * with bn_sub_words
  428|       |         */
  429|  1.11M|        l0 = bn_sub_words(wnum, wnum, tmp->d, div_n + 1);
  430|  1.11M|        q -= l0;
  431|       |        /*
  432|       |         * Note: As we have considered only the leading two BN_ULONGs in
  433|       |         * the calculation of q, sdiv * q might be greater than wnum (but
  434|       |         * then (q-1) * sdiv is less or equal than wnum)
  435|       |         */
  436|  3.33G|        for (l0 = 0 - l0, j = 0; j < div_n; j++)
  ------------------
  |  Branch (436:34): [True: 3.32G, False: 1.11M]
  ------------------
  437|  3.32G|            tmp->d[j] = sdiv->d[j] & l0;
  438|  1.11M|        l0 = bn_add_words(wnum, wnum, tmp->d, div_n);
  439|  1.11M|        (*wnumtop) += l0;
  440|  1.11M|        assert((*wnumtop) == 0);
  441|       |
  442|       |        /* store part of the result */
  443|  1.11M|        *--resp = q;
  444|  1.11M|    }
  445|       |    /* snum holds remainder, it's as wide as divisor */
  446|  2.62k|    snum->neg = num_neg;
  447|  2.62k|    snum->top = div_n;
  448|  2.62k|    snum->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  2.62k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  449|       |
  450|  2.62k|    if (rm != NULL && bn_rshift_fixed_top(rm, snum, norm_shift) == 0)
  ------------------
  |  Branch (450:9): [True: 2.62k, False: 0]
  |  Branch (450:23): [True: 0, False: 2.62k]
  ------------------
  451|      0|        goto err;
  452|       |
  453|  2.62k|    BN_CTX_end(ctx);
  454|  2.62k|    return 1;
  455|      0| err:
  456|      0|    bn_check_top(rm);
  457|      0|    BN_CTX_end(ctx);
  458|      0|    return 0;
  459|  2.62k|}
bn_div.c:bn_left_align:
  142|  2.62k|{
  143|  2.62k|    BN_ULONG *d = num->d, n, m, rmask;
  ------------------
  |  |   37|  2.62k|#  define BN_ULONG        unsigned long
  ------------------
  144|  2.62k|    int top = num->top;
  145|  2.62k|    int rshift = BN_num_bits_word(d[top - 1]), lshift, i;
  146|       |
  147|  2.62k|    lshift = BN_BITS2 - rshift;
  ------------------
  |  |   54|  2.62k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  2.62k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  148|  2.62k|    rshift %= BN_BITS2;            /* say no to undefined behaviour */
  ------------------
  |  |   54|  2.62k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  2.62k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  149|  2.62k|    rmask = (BN_ULONG)0 - rshift;  /* rmask = 0 - (rshift != 0) */
  150|  2.62k|    rmask |= rmask >> 8;
  151|       |
  152|   943k|    for (i = 0, m = 0; i < top; i++) {
  ------------------
  |  Branch (152:24): [True: 940k, False: 2.62k]
  ------------------
  153|   940k|        n = d[i];
  154|   940k|        d[i] = ((n << lshift) | m) & BN_MASK2;
  ------------------
  |  |   94|   940k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  155|   940k|        m = (n >> rshift) & rmask;
  156|   940k|    }
  157|       |
  158|  2.62k|    return lshift;
  159|  2.62k|}

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

BN_num_bits_word:
  102|  3.66k|{
  103|  3.66k|    BN_ULONG x, mask;
  ------------------
  |  |   37|  3.66k|#  define BN_ULONG        unsigned long
  ------------------
  104|  3.66k|    int bits = (l != 0);
  105|       |
  106|  3.66k|#if BN_BITS2 > 32
  107|  3.66k|    x = l >> 32;
  108|  3.66k|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  3.66k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  109|  3.66k|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  3.66k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  3.66k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  110|  3.66k|    bits += 32 & mask;
  111|  3.66k|    l ^= (x ^ l) & mask;
  112|  3.66k|#endif
  113|       |
  114|  3.66k|    x = l >> 16;
  115|  3.66k|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  3.66k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  116|  3.66k|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  3.66k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  3.66k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  117|  3.66k|    bits += 16 & mask;
  118|  3.66k|    l ^= (x ^ l) & mask;
  119|       |
  120|  3.66k|    x = l >> 8;
  121|  3.66k|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  3.66k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  122|  3.66k|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  3.66k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  3.66k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  123|  3.66k|    bits += 8 & mask;
  124|  3.66k|    l ^= (x ^ l) & mask;
  125|       |
  126|  3.66k|    x = l >> 4;
  127|  3.66k|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  3.66k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  128|  3.66k|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  3.66k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  3.66k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  129|  3.66k|    bits += 4 & mask;
  130|  3.66k|    l ^= (x ^ l) & mask;
  131|       |
  132|  3.66k|    x = l >> 2;
  133|  3.66k|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  3.66k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  134|  3.66k|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  3.66k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  3.66k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  135|  3.66k|    bits += 2 & mask;
  136|  3.66k|    l ^= (x ^ l) & mask;
  137|       |
  138|  3.66k|    x = l >> 1;
  139|  3.66k|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   94|  3.66k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  140|  3.66k|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  3.66k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  3.66k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  141|  3.66k|    bits += 1 & mask;
  142|       |
  143|  3.66k|    return bits;
  144|  3.66k|}
bn_init:
  237|     16|{
  238|     16|    static BIGNUM nilbn;
  239|       |
  240|     16|    *a = nilbn;
  241|     16|    bn_check_top(a);
  242|     16|}
BN_new:
  245|     10|{
  246|     10|    BIGNUM *ret;
  247|       |
  248|     10|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  104|     10|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (248:9): [True: 0, False: 10]
  ------------------
  249|      0|        return NULL;
  250|     10|    ret->flags = BN_FLG_MALLOCED;
  ------------------
  |  |   58|     10|# define BN_FLG_MALLOCED         0x01
  ------------------
  251|     10|    bn_check_top(ret);
  252|     10|    return ret;
  253|     10|}
bn_expand2:
  300|    626|{
  301|    626|    if (words > b->dmax) {
  ------------------
  |  Branch (301:9): [True: 626, False: 0]
  ------------------
  302|    626|        BN_ULONG *a = bn_expand_internal(b, words);
  ------------------
  |  |   37|    626|#  define BN_ULONG        unsigned long
  ------------------
  303|    626|        if (!a)
  ------------------
  |  Branch (303:13): [True: 0, False: 626]
  ------------------
  304|      0|            return NULL;
  305|    626|        if (b->d != NULL)
  ------------------
  |  Branch (305:13): [True: 618, False: 8]
  ------------------
  306|    618|            bn_free_d(b, 1);
  307|    626|        b->d = a;
  308|    626|        b->dmax = words;
  309|    626|    }
  310|       |
  311|    626|    return b;
  312|    626|}
BN_copy:
  334|  2.62k|{
  335|  2.62k|    int bn_words;
  336|       |
  337|  2.62k|    bn_check_top(b);
  338|       |
  339|  2.62k|    bn_words = BN_get_flags(b, BN_FLG_CONSTTIME) ? b->dmax : b->top;
  ------------------
  |  |   67|  2.62k|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (339:16): [True: 0, False: 2.62k]
  ------------------
  340|       |
  341|  2.62k|    if (a == b)
  ------------------
  |  Branch (341:9): [True: 0, False: 2.62k]
  ------------------
  342|      0|        return a;
  343|  2.62k|    if (bn_wexpand(a, bn_words) == NULL)
  ------------------
  |  Branch (343:9): [True: 0, False: 2.62k]
  ------------------
  344|      0|        return NULL;
  345|       |
  346|  2.62k|    if (b->top > 0)
  ------------------
  |  Branch (346:9): [True: 2.62k, False: 0]
  ------------------
  347|  2.62k|        memcpy(a->d, b->d, sizeof(b->d[0]) * bn_words);
  348|       |
  349|  2.62k|    a->neg = b->neg;
  350|  2.62k|    a->top = b->top;
  351|  2.62k|    a->flags |= b->flags & BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  2.62k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  352|  2.62k|    bn_check_top(a);
  353|  2.62k|    return a;
  354|  2.62k|}
BN_clear:
  396|    322|{
  397|    322|    if (a == NULL)
  ------------------
  |  Branch (397:9): [True: 0, False: 322]
  ------------------
  398|      0|        return;
  399|    322|    bn_check_top(a);
  400|    322|    if (a->d != NULL)
  ------------------
  |  Branch (400:9): [True: 315, False: 7]
  ------------------
  401|    315|        OPENSSL_cleanse(a->d, sizeof(*a->d) * a->dmax);
  402|    322|    a->neg = 0;
  403|    322|    a->top = 0;
  404|    322|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|    322|#  define BN_FLG_FIXED_TOP 0
  ------------------
  405|    322|}
BN_bin2bn:
  536|  5.27k|{
  537|  5.27k|    return bin2bn(s, len, ret, BIG, UNSIGNED);
  538|  5.27k|}
BN_ucmp:
  708|    298|{
  709|    298|    int i;
  710|    298|    BN_ULONG t1, t2, *ap, *bp;
  ------------------
  |  |   37|    298|#  define BN_ULONG        unsigned long
  ------------------
  711|       |
  712|    298|    ap = a->d;
  713|    298|    bp = b->d;
  714|       |
  715|    298|    if (BN_get_flags(a, BN_FLG_CONSTTIME)
  ------------------
  |  |   67|    298|# define BN_FLG_CONSTTIME        0x04
  ------------------
  |  Branch (715:9): [True: 0, False: 298]
  ------------------
  716|    298|            && a->top == b->top) {
  ------------------
  |  Branch (716:16): [True: 0, False: 0]
  ------------------
  717|      0|        int res = 0;
  718|       |
  719|      0|        for (i = 0; i < b->top; i++) {
  ------------------
  |  Branch (719:21): [True: 0, False: 0]
  ------------------
  720|      0|            res = constant_time_select_int(constant_time_lt_bn(ap[i], bp[i]),
  721|      0|                                           -1, res);
  722|      0|            res = constant_time_select_int(constant_time_lt_bn(bp[i], ap[i]),
  723|      0|                                           1, res);
  724|      0|        }
  725|      0|        return res;
  726|      0|    }
  727|       |
  728|    298|    bn_check_top(a);
  729|    298|    bn_check_top(b);
  730|       |
  731|    298|    i = a->top - b->top;
  732|    298|    if (i != 0)
  ------------------
  |  Branch (732:9): [True: 298, False: 0]
  ------------------
  733|    298|        return i;
  734|       |
  735|      0|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (735:26): [True: 0, False: 0]
  ------------------
  736|      0|        t1 = ap[i];
  737|      0|        t2 = bp[i];
  738|      0|        if (t1 != t2)
  ------------------
  |  Branch (738:13): [True: 0, False: 0]
  ------------------
  739|      0|            return ((t1 > t2) ? 1 : -1);
  ------------------
  |  Branch (739:21): [True: 0, False: 0]
  ------------------
  740|      0|    }
  741|      0|    return 0;
  742|      0|}
BN_cmp:
  745|  2.62k|{
  746|  2.62k|    int i;
  747|  2.62k|    int gt, lt;
  748|  2.62k|    BN_ULONG t1, t2;
  ------------------
  |  |   37|  2.62k|#  define BN_ULONG        unsigned long
  ------------------
  749|       |
  750|  2.62k|    if ((a == NULL) || (b == NULL)) {
  ------------------
  |  Branch (750:9): [True: 0, False: 2.62k]
  |  Branch (750:24): [True: 0, False: 2.62k]
  ------------------
  751|      0|        if (a != NULL)
  ------------------
  |  Branch (751:13): [True: 0, False: 0]
  ------------------
  752|      0|            return -1;
  753|      0|        else if (b != NULL)
  ------------------
  |  Branch (753:18): [True: 0, False: 0]
  ------------------
  754|      0|            return 1;
  755|      0|        else
  756|      0|            return 0;
  757|      0|    }
  758|       |
  759|  2.62k|    bn_check_top(a);
  760|  2.62k|    bn_check_top(b);
  761|       |
  762|  2.62k|    if (a->neg != b->neg) {
  ------------------
  |  Branch (762:9): [True: 0, False: 2.62k]
  ------------------
  763|      0|        if (a->neg)
  ------------------
  |  Branch (763:13): [True: 0, False: 0]
  ------------------
  764|      0|            return -1;
  765|      0|        else
  766|      0|            return 1;
  767|      0|    }
  768|  2.62k|    if (a->neg == 0) {
  ------------------
  |  Branch (768:9): [True: 1.05k, False: 1.57k]
  ------------------
  769|  1.05k|        gt = 1;
  770|  1.05k|        lt = -1;
  771|  1.57k|    } else {
  772|  1.57k|        gt = -1;
  773|  1.57k|        lt = 1;
  774|  1.57k|    }
  775|       |
  776|  2.62k|    if (a->top > b->top)
  ------------------
  |  Branch (776:9): [True: 0, False: 2.62k]
  ------------------
  777|      0|        return gt;
  778|  2.62k|    if (a->top < b->top)
  ------------------
  |  Branch (778:9): [True: 0, False: 2.62k]
  ------------------
  779|      0|        return lt;
  780|  1.82M|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (780:26): [True: 1.81M, False: 2.62k]
  ------------------
  781|  1.81M|        t1 = a->d[i];
  782|  1.81M|        t2 = b->d[i];
  783|  1.81M|        if (t1 > t2)
  ------------------
  |  Branch (783:13): [True: 0, False: 1.81M]
  ------------------
  784|      0|            return gt;
  785|  1.81M|        if (t1 < t2)
  ------------------
  |  Branch (785:13): [True: 0, False: 1.81M]
  ------------------
  786|      0|            return lt;
  787|  1.81M|    }
  788|  2.62k|    return 0;
  789|  2.62k|}
BN_set_negative:
  879|  5.27k|{
  880|  5.27k|    if (b && !BN_is_zero(a))
  ------------------
  |  Branch (880:9): [True: 3.26k, False: 2.01k]
  |  Branch (880:14): [True: 3.21k, False: 50]
  ------------------
  881|  3.21k|        a->neg = 1;
  882|  2.06k|    else
  883|  2.06k|        a->neg = 0;
  884|  5.27k|}
bn_cmp_words:
  887|  3.03M|{
  888|  3.03M|    int i;
  889|  3.03M|    BN_ULONG aa, bb;
  ------------------
  |  |   37|  3.03M|#  define BN_ULONG        unsigned long
  ------------------
  890|       |
  891|  3.03M|    if (n == 0)
  ------------------
  |  Branch (891:9): [True: 0, False: 3.03M]
  ------------------
  892|      0|        return 0;
  893|       |
  894|  3.03M|    aa = a[n - 1];
  895|  3.03M|    bb = b[n - 1];
  896|  3.03M|    if (aa != bb)
  ------------------
  |  Branch (896:9): [True: 2.56M, False: 470k]
  ------------------
  897|  2.56M|        return ((aa > bb) ? 1 : -1);
  ------------------
  |  Branch (897:17): [True: 1.33M, False: 1.23M]
  ------------------
  898|  4.90M|    for (i = n - 2; i >= 0; i--) {
  ------------------
  |  Branch (898:21): [True: 4.69M, False: 209k]
  ------------------
  899|  4.69M|        aa = a[i];
  900|  4.69M|        bb = b[i];
  901|  4.69M|        if (aa != bb)
  ------------------
  |  Branch (901:13): [True: 260k, False: 4.43M]
  ------------------
  902|   260k|            return ((aa > bb) ? 1 : -1);
  ------------------
  |  Branch (902:21): [True: 121k, False: 139k]
  ------------------
  903|  4.69M|    }
  904|   209k|    return 0;
  905|   470k|}
bn_cmp_part_words:
  917|  3.03M|{
  918|  3.03M|    int n, i;
  919|  3.03M|    n = cl - 1;
  920|       |
  921|  3.03M|    if (dl < 0) {
  ------------------
  |  Branch (921:9): [True: 1.76k, False: 3.03M]
  ------------------
  922|  63.4k|        for (i = dl; i < 0; i++) {
  ------------------
  |  Branch (922:22): [True: 63.0k, False: 390]
  ------------------
  923|  63.0k|            if (b[n - i] != 0)
  ------------------
  |  Branch (923:17): [True: 1.37k, False: 61.6k]
  ------------------
  924|  1.37k|                return -1;      /* a < b */
  925|  63.0k|        }
  926|  1.76k|    }
  927|  3.03M|    if (dl > 0) {
  ------------------
  |  Branch (927:9): [True: 1.65k, False: 3.03M]
  ------------------
  928|  12.0k|        for (i = dl; i > 0; i--) {
  ------------------
  |  Branch (928:22): [True: 11.8k, False: 231]
  ------------------
  929|  11.8k|            if (a[n + i] != 0)
  ------------------
  |  Branch (929:17): [True: 1.41k, False: 10.4k]
  ------------------
  930|  1.41k|                return 1;       /* a > b */
  931|  11.8k|        }
  932|  1.65k|    }
  933|  3.03M|    return bn_cmp_words(a, b, cl);
  934|  3.03M|}
BN_zero_ex:
 1025|  9.39k|{
 1026|  9.39k|    a->neg = 0;
 1027|  9.39k|    a->top = 0;
 1028|  9.39k|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  9.39k|#  define BN_FLG_FIXED_TOP 0
  ------------------
 1029|  9.39k|}
BN_is_zero:
 1037|  12.0k|{
 1038|  12.0k|    return a->top == 0;
 1039|  12.0k|}
BN_is_negative:
 1073|  9.25k|{
 1074|  9.25k|    return (a->neg != 0);
 1075|  9.25k|}
BN_get_flags:
 1117|  4.79k|{
 1118|  4.79k|    return b->flags & n;
 1119|  4.79k|}
bn_wexpand:
 1147|  24.2k|{
 1148|  24.2k|    return (words <= a->dmax) ? a : bn_expand2(a, words);
  ------------------
  |  Branch (1148:12): [True: 23.6k, False: 626]
  ------------------
 1149|  24.2k|}
bn_correct_top:
 1174|  12.8k|{
 1175|  12.8k|    BN_ULONG *ftl;
  ------------------
  |  |   37|  12.8k|#  define BN_ULONG        unsigned long
  ------------------
 1176|  12.8k|    int tmp_top = a->top;
 1177|       |
 1178|  12.8k|    if (tmp_top > 0) {
  ------------------
  |  Branch (1178:9): [True: 12.3k, False: 484]
  ------------------
 1179|   251k|        for (ftl = &(a->d[tmp_top]); tmp_top > 0; tmp_top--) {
  ------------------
  |  Branch (1179:38): [True: 250k, False: 1.14k]
  ------------------
 1180|   250k|            ftl--;
 1181|   250k|            if (*ftl != 0)
  ------------------
  |  Branch (1181:17): [True: 11.1k, False: 239k]
  ------------------
 1182|  11.1k|                break;
 1183|   250k|        }
 1184|  12.3k|        a->top = tmp_top;
 1185|  12.3k|    }
 1186|  12.8k|    if (a->top == 0)
  ------------------
  |  Branch (1186:9): [True: 1.63k, False: 11.1k]
  ------------------
 1187|  1.63k|        a->neg = 0;
 1188|  12.8k|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  12.8k|#  define BN_FLG_FIXED_TOP 0
  ------------------
 1189|  12.8k|    bn_pollute(a);
 1190|  12.8k|}
bn_lib.c:bn_free_d:
  204|    618|{
  205|    618|    if (BN_get_flags(a, BN_FLG_SECURE))
  ------------------
  |  |   68|    618|# define BN_FLG_SECURE           0x08
  ------------------
  |  Branch (205:9): [True: 0, False: 618]
  ------------------
  206|      0|        OPENSSL_secure_clear_free(a->d, a->dmax * sizeof(a->d[0]));
  ------------------
  |  |  129|      0|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  207|    618|    else if (clear != 0)
  ------------------
  |  Branch (207:14): [True: 618, False: 0]
  ------------------
  208|    618|        OPENSSL_clear_free(a->d, a->dmax * sizeof(a->d[0]));
  ------------------
  |  |  113|    618|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    618|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    618|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  209|      0|    else
  210|      0|        OPENSSL_free(a->d);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  211|    618|}
bn_lib.c:bn_expand_internal:
  266|    626|{
  267|    626|    BN_ULONG *a = NULL;
  ------------------
  |  |   37|    626|#  define BN_ULONG        unsigned long
  ------------------
  268|       |
  269|    626|    if (words > (INT_MAX / (4 * BN_BITS2))) {
  ------------------
  |  |   54|    626|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|    626|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  |  Branch (269:9): [True: 0, False: 626]
  ------------------
  270|      0|        ERR_raise(ERR_LIB_BN, BN_R_BIGNUM_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)
  |  |  ------------------
  ------------------
  271|      0|        return NULL;
  272|      0|    }
  273|    626|    if (BN_get_flags(b, BN_FLG_STATIC_DATA)) {
  ------------------
  |  |   59|    626|# define BN_FLG_STATIC_DATA      0x02
  ------------------
  |  Branch (273:9): [True: 0, False: 626]
  ------------------
  274|      0|        ERR_raise(ERR_LIB_BN, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA);
  ------------------
  |  |  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)
  |  |  ------------------
  ------------------
  275|      0|        return NULL;
  276|      0|    }
  277|    626|    if (BN_get_flags(b, BN_FLG_SECURE))
  ------------------
  |  |   68|    626|# define BN_FLG_SECURE           0x08
  ------------------
  |  Branch (277:9): [True: 0, False: 626]
  ------------------
  278|      0|        a = OPENSSL_secure_zalloc(words * sizeof(*a));
  ------------------
  |  |  125|      0|        CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  279|    626|    else
  280|    626|        a = OPENSSL_zalloc(words * sizeof(*a));
  ------------------
  |  |  104|    626|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|    626|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|    626|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  281|    626|    if (a == NULL)
  ------------------
  |  Branch (281:9): [True: 0, False: 626]
  ------------------
  282|      0|        return NULL;
  283|       |
  284|    626|    assert(b->top <= words);
  285|    626|    if (b->top > 0)
  ------------------
  |  Branch (285:9): [True: 383, False: 243]
  ------------------
  286|    383|        memcpy(a, b->d, sizeof(*a) * b->top);
  287|       |
  288|    626|    return a;
  289|    626|}
bn_lib.c:bin2bn:
  435|  5.27k|{
  436|  5.27k|    int inc;
  437|  5.27k|    const unsigned char *s2;
  438|  5.27k|    int inc2;
  439|  5.27k|    int neg = 0, xor = 0, carry = 0;
  440|  5.27k|    unsigned int i;
  441|  5.27k|    unsigned int n;
  442|  5.27k|    BIGNUM *bn = NULL;
  443|       |
  444|       |    /* Negative length is not acceptable */
  445|  5.27k|    if (len < 0)
  ------------------
  |  Branch (445:9): [True: 0, False: 5.27k]
  ------------------
  446|      0|        return NULL;
  447|       |
  448|  5.27k|    if (ret == NULL)
  ------------------
  |  Branch (448:9): [True: 0, False: 5.27k]
  ------------------
  449|      0|        ret = bn = BN_new();
  450|  5.27k|    if (ret == NULL)
  ------------------
  |  Branch (450:9): [True: 0, False: 5.27k]
  ------------------
  451|      0|        return NULL;
  452|  5.27k|    bn_check_top(ret);
  453|       |
  454|       |    /*
  455|       |     * If the input has no bits, the number is considered zero.
  456|       |     * This makes calls with s==NULL and len==0 safe.
  457|       |     */
  458|  5.27k|    if (len == 0) {
  ------------------
  |  Branch (458:9): [True: 322, False: 4.95k]
  ------------------
  459|    322|        BN_clear(ret);
  460|    322|        return ret;
  461|    322|    }
  462|       |
  463|       |    /*
  464|       |     * The loop that does the work iterates from least to most
  465|       |     * significant BIGNUM chunk, so we adapt parameters to transfer
  466|       |     * input bytes accordingly.
  467|       |     */
  468|  4.95k|    if (endianness == LITTLE) {
  ------------------
  |  Branch (468:9): [True: 0, False: 4.95k]
  ------------------
  469|      0|        s2 = s + len - 1;
  470|      0|        inc2 = -1;
  471|      0|        inc = 1;
  472|  4.95k|    } else {
  473|  4.95k|        s2 = s;
  474|  4.95k|        inc2 = 1;
  475|  4.95k|        inc = -1;
  476|  4.95k|        s += len - 1;
  477|  4.95k|    }
  478|       |
  479|       |    /* Take note of the signedness of the input bytes*/
  480|  4.95k|    if (signedness == SIGNED) {
  ------------------
  |  Branch (480:9): [True: 0, False: 4.95k]
  ------------------
  481|      0|        neg = !!(*s2 & 0x80);
  482|      0|        xor = neg ? 0xff : 0x00;
  ------------------
  |  Branch (482:15): [True: 0, False: 0]
  ------------------
  483|      0|        carry = neg;
  484|      0|    }
  485|       |
  486|       |    /*
  487|       |     * Skip leading sign extensions (the value of |xor|).
  488|       |     * This is the only spot where |s2| and |inc2| are used.
  489|       |     */
  490|  64.1k|    for ( ; len > 0 && *s2 == xor; s2 += inc2, len--)
  ------------------
  |  Branch (490:13): [True: 64.1k, False: 15]
  |  Branch (490:24): [True: 59.1k, False: 4.94k]
  ------------------
  491|  59.1k|        continue;
  492|       |
  493|       |    /*
  494|       |     * If there was a set of 0xff, we backtrack one byte unless the next
  495|       |     * one has a sign bit, as the last 0xff is then part of the actual
  496|       |     * number, rather then a mere sign extension.
  497|       |     */
  498|  4.95k|    if (xor == 0xff) {
  ------------------
  |  Branch (498:9): [True: 0, False: 4.95k]
  ------------------
  499|      0|        if (len == 0 || !(*s2 & 0x80))
  ------------------
  |  Branch (499:13): [True: 0, False: 0]
  |  Branch (499:25): [True: 0, False: 0]
  ------------------
  500|      0|            len++;
  501|      0|    }
  502|       |    /* If it was all zeros, we're done */
  503|  4.95k|    if (len == 0) {
  ------------------
  |  Branch (503:9): [True: 15, False: 4.94k]
  ------------------
  504|     15|        ret->top = 0;
  505|     15|        return ret;
  506|     15|    }
  507|  4.94k|    n = ((len - 1) / BN_BYTES) + 1; /* Number of resulting bignum chunks */
  ------------------
  |  |   38|  4.94k|#  define BN_BYTES        8
  ------------------
  508|  4.94k|    if (bn_wexpand(ret, (int)n) == NULL) {
  ------------------
  |  Branch (508:9): [True: 0, False: 4.94k]
  ------------------
  509|      0|        BN_free(bn);
  510|      0|        return NULL;
  511|      0|    }
  512|  4.94k|    ret->top = n;
  513|  4.94k|    ret->neg = neg;
  514|  2.76M|    for (i = 0; n-- > 0; i++) {
  ------------------
  |  Branch (514:17): [True: 2.75M, False: 4.94k]
  ------------------
  515|  2.75M|        BN_ULONG l = 0;        /* Accumulator */
  ------------------
  |  |   37|  2.75M|#  define BN_ULONG        unsigned long
  ------------------
  516|  2.75M|        unsigned int m = 0;    /* Offset in a bignum chunk, in bits */
  517|       |
  518|  24.7M|        for (; len > 0 && m < BN_BYTES * 8; len--, s += inc, m += 8) {
  ------------------
  |  |   38|  24.7M|#  define BN_BYTES        8
  ------------------
  |  Branch (518:16): [True: 24.7M, False: 4.94k]
  |  Branch (518:27): [True: 22.0M, False: 2.75M]
  ------------------
  519|  22.0M|            BN_ULONG byte_xored = *s ^ xor;
  ------------------
  |  |   37|  22.0M|#  define BN_ULONG        unsigned long
  ------------------
  520|  22.0M|            BN_ULONG byte = (byte_xored + carry) & 0xff;
  ------------------
  |  |   37|  22.0M|#  define BN_ULONG        unsigned long
  ------------------
  521|       |
  522|  22.0M|            carry = byte_xored > byte; /* Implicit 1 or 0 */
  523|  22.0M|            l |= (byte << m);
  524|  22.0M|        }
  525|  2.75M|        ret->d[i] = l;
  526|  2.75M|    }
  527|       |    /*
  528|       |     * need to call this due to clear byte at top if avoiding having the top
  529|       |     * bit set (-ve number)
  530|       |     */
  531|  4.94k|    bn_correct_top(ret);
  532|  4.94k|    return ret;
  533|  4.94k|}

bn_sub_part_words:
   30|  2.66M|{
   31|  2.66M|    BN_ULONG c, t;
  ------------------
  |  |   37|  2.66M|#  define BN_ULONG        unsigned long
  ------------------
   32|       |
   33|  2.66M|    assert(cl >= 0);
   34|  2.66M|    c = bn_sub_words(r, a, b, cl);
   35|       |
   36|  2.66M|    if (dl == 0)
  ------------------
  |  Branch (36:9): [True: 2.65M, False: 3.35k]
  ------------------
   37|  2.65M|        return c;
   38|       |
   39|  3.35k|    r += cl;
   40|  3.35k|    a += cl;
   41|  3.35k|    b += cl;
   42|       |
   43|  3.35k|    if (dl < 0) {
  ------------------
  |  Branch (43:9): [True: 431, False: 2.92k]
  ------------------
   44|  13.9k|        for (;;) {
   45|  13.9k|            t = b[0];
   46|  13.9k|            r[0] = (0 - t - c) & BN_MASK2;
  ------------------
  |  |   94|  13.9k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   47|  13.9k|            if (t != 0)
  ------------------
  |  Branch (47:17): [True: 0, False: 13.9k]
  ------------------
   48|      0|                c = 1;
   49|  13.9k|            if (++dl >= 0)
  ------------------
  |  Branch (49:17): [True: 122, False: 13.8k]
  ------------------
   50|    122|                break;
   51|       |
   52|  13.8k|            t = b[1];
   53|  13.8k|            r[1] = (0 - t - c) & BN_MASK2;
  ------------------
  |  |   94|  13.8k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   54|  13.8k|            if (t != 0)
  ------------------
  |  Branch (54:17): [True: 0, False: 13.8k]
  ------------------
   55|      0|                c = 1;
   56|  13.8k|            if (++dl >= 0)
  ------------------
  |  Branch (56:17): [True: 89, False: 13.7k]
  ------------------
   57|     89|                break;
   58|       |
   59|  13.7k|            t = b[2];
   60|  13.7k|            r[2] = (0 - t - c) & BN_MASK2;
  ------------------
  |  |   94|  13.7k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   61|  13.7k|            if (t != 0)
  ------------------
  |  Branch (61:17): [True: 0, False: 13.7k]
  ------------------
   62|      0|                c = 1;
   63|  13.7k|            if (++dl >= 0)
  ------------------
  |  Branch (63:17): [True: 166, False: 13.5k]
  ------------------
   64|    166|                break;
   65|       |
   66|  13.5k|            t = b[3];
   67|  13.5k|            r[3] = (0 - t - c) & BN_MASK2;
  ------------------
  |  |   94|  13.5k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   68|  13.5k|            if (t != 0)
  ------------------
  |  Branch (68:17): [True: 0, False: 13.5k]
  ------------------
   69|      0|                c = 1;
   70|  13.5k|            if (++dl >= 0)
  ------------------
  |  Branch (70:17): [True: 54, False: 13.5k]
  ------------------
   71|     54|                break;
   72|       |
   73|  13.5k|            b += 4;
   74|  13.5k|            r += 4;
   75|  13.5k|        }
   76|  2.92k|    } else {
   77|  2.92k|        int save_dl = dl;
   78|  5.11k|        while (c) {
  ------------------
  |  Branch (78:16): [True: 2.50k, False: 2.60k]
  ------------------
   79|  2.50k|            t = a[0];
   80|  2.50k|            r[0] = (t - c) & BN_MASK2;
  ------------------
  |  |   94|  2.50k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   81|  2.50k|            if (t != 0)
  ------------------
  |  Branch (81:17): [True: 577, False: 1.93k]
  ------------------
   82|    577|                c = 0;
   83|  2.50k|            if (--dl <= 0)
  ------------------
  |  Branch (83:17): [True: 77, False: 2.43k]
  ------------------
   84|     77|                break;
   85|       |
   86|  2.43k|            t = a[1];
   87|  2.43k|            r[1] = (t - c) & BN_MASK2;
  ------------------
  |  |   94|  2.43k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   88|  2.43k|            if (t != 0)
  ------------------
  |  Branch (88:17): [True: 496, False: 1.93k]
  ------------------
   89|    496|                c = 0;
   90|  2.43k|            if (--dl <= 0)
  ------------------
  |  Branch (90:17): [True: 77, False: 2.35k]
  ------------------
   91|     77|                break;
   92|       |
   93|  2.35k|            t = a[2];
   94|  2.35k|            r[2] = (t - c) & BN_MASK2;
  ------------------
  |  |   94|  2.35k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
   95|  2.35k|            if (t != 0)
  ------------------
  |  Branch (95:17): [True: 491, False: 1.86k]
  ------------------
   96|    491|                c = 0;
   97|  2.35k|            if (--dl <= 0)
  ------------------
  |  Branch (97:17): [True: 118, False: 2.23k]
  ------------------
   98|    118|                break;
   99|       |
  100|  2.23k|            t = a[3];
  101|  2.23k|            r[3] = (t - c) & BN_MASK2;
  ------------------
  |  |   94|  2.23k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  102|  2.23k|            if (t != 0)
  ------------------
  |  Branch (102:17): [True: 397, False: 1.84k]
  ------------------
  103|    397|                c = 0;
  104|  2.23k|            if (--dl <= 0)
  ------------------
  |  Branch (104:17): [True: 50, False: 2.18k]
  ------------------
  105|     50|                break;
  106|       |
  107|  2.18k|            save_dl = dl;
  108|  2.18k|            a += 4;
  109|  2.18k|            r += 4;
  110|  2.18k|        }
  111|  2.92k|        if (dl > 0) {
  ------------------
  |  Branch (111:13): [True: 2.60k, False: 322]
  ------------------
  112|  2.60k|            if (save_dl > dl) {
  ------------------
  |  Branch (112:17): [True: 0, False: 2.60k]
  ------------------
  113|      0|                switch (save_dl - dl) {
  ------------------
  |  Branch (113:25): [True: 0, False: 0]
  ------------------
  114|      0|                case 1:
  ------------------
  |  Branch (114:17): [True: 0, False: 0]
  ------------------
  115|      0|                    r[1] = a[1];
  116|      0|                    if (--dl <= 0)
  ------------------
  |  Branch (116:25): [True: 0, False: 0]
  ------------------
  117|      0|                        break;
  118|       |                    /* fall through */
  119|      0|                case 2:
  ------------------
  |  Branch (119:17): [True: 0, False: 0]
  ------------------
  120|      0|                    r[2] = a[2];
  121|      0|                    if (--dl <= 0)
  ------------------
  |  Branch (121:25): [True: 0, False: 0]
  ------------------
  122|      0|                        break;
  123|       |                    /* fall through */
  124|      0|                case 3:
  ------------------
  |  Branch (124:17): [True: 0, False: 0]
  ------------------
  125|      0|                    r[3] = a[3];
  126|      0|                    if (--dl <= 0)
  ------------------
  |  Branch (126:25): [True: 0, False: 0]
  ------------------
  127|      0|                        break;
  128|      0|                }
  129|      0|                a += 4;
  130|      0|                r += 4;
  131|      0|            }
  132|  2.60k|        }
  133|  2.92k|        if (dl > 0) {
  ------------------
  |  Branch (133:13): [True: 2.60k, False: 322]
  ------------------
  134|   123k|            for (;;) {
  135|   123k|                r[0] = a[0];
  136|   123k|                if (--dl <= 0)
  ------------------
  |  Branch (136:21): [True: 453, False: 123k]
  ------------------
  137|    453|                    break;
  138|   123k|                r[1] = a[1];
  139|   123k|                if (--dl <= 0)
  ------------------
  |  Branch (139:21): [True: 326, False: 123k]
  ------------------
  140|    326|                    break;
  141|   123k|                r[2] = a[2];
  142|   123k|                if (--dl <= 0)
  ------------------
  |  Branch (142:21): [True: 1.13k, False: 122k]
  ------------------
  143|  1.13k|                    break;
  144|   122k|                r[3] = a[3];
  145|   122k|                if (--dl <= 0)
  ------------------
  |  Branch (145:21): [True: 695, False: 121k]
  ------------------
  146|    695|                    break;
  147|       |
  148|   121k|                a += 4;
  149|   121k|                r += 4;
  150|   121k|            }
  151|  2.60k|        }
  152|  2.92k|    }
  153|  3.35k|    return c;
  154|  3.35k|}
bn_mul_recursive:
  177|  1.51M|{
  178|  1.51M|    int n = n2 / 2, c1, c2;
  179|  1.51M|    int tna = n + dna, tnb = n + dnb;
  180|  1.51M|    unsigned int neg, zero;
  181|  1.51M|    BN_ULONG ln, lo, *p;
  ------------------
  |  |   37|  1.51M|#  define BN_ULONG        unsigned long
  ------------------
  182|       |
  183|  1.51M|# ifdef BN_MUL_COMBA
  184|       |#  if 0
  185|       |    if (n2 == 4) {
  186|       |        bn_mul_comba4(r, a, b);
  187|       |        return;
  188|       |    }
  189|       |#  endif
  190|       |    /*
  191|       |     * Only call bn_mul_comba 8 if n2 == 8 and the two arrays are complete
  192|       |     * [steve]
  193|       |     */
  194|  1.51M|    if (n2 == 8 && dna == 0 && dnb == 0) {
  ------------------
  |  Branch (194:9): [True: 179, False: 1.51M]
  |  Branch (194:20): [True: 167, False: 12]
  |  Branch (194:32): [True: 109, False: 58]
  ------------------
  195|    109|        bn_mul_comba8(r, a, b);
  196|    109|        return;
  197|    109|    }
  198|  1.51M|# endif                         /* BN_MUL_COMBA */
  199|       |    /* Else do normal multiply */
  200|  1.51M|    if (n2 < BN_MUL_RECURSIVE_SIZE_NORMAL) {
  ------------------
  |  |  365|  1.51M|# define BN_MUL_RECURSIVE_SIZE_NORMAL            (16)/* 32 less than */
  ------------------
  |  Branch (200:9): [True: 70, False: 1.51M]
  ------------------
  201|     70|        bn_mul_normal(r, a, n2 + dna, b, n2 + dnb);
  202|     70|        if ((dna + dnb) < 0)
  ------------------
  |  Branch (202:13): [True: 70, False: 0]
  ------------------
  203|     70|            memset(&r[2 * n2 + dna + dnb], 0,
  204|     70|                   sizeof(BN_ULONG) * -(dna + dnb));
  205|     70|        return;
  206|     70|    }
  207|       |    /* r=(a[0]-a[1])*(b[1]-b[0]) */
  208|  1.51M|    c1 = bn_cmp_part_words(a, &(a[n]), tna, n - tna);
  209|  1.51M|    c2 = bn_cmp_part_words(&(b[n]), b, tnb, tnb - n);
  210|  1.51M|    zero = neg = 0;
  211|  1.51M|    switch (c1 * 3 + c2) {
  ------------------
  |  Branch (211:13): [True: 0, False: 1.51M]
  ------------------
  212|   300k|    case -4:
  ------------------
  |  Branch (212:5): [True: 300k, False: 1.21M]
  ------------------
  213|   300k|        bn_sub_part_words(t, &(a[n]), a, tna, tna - n); /* - */
  214|   300k|        bn_sub_part_words(&(t[n]), b, &(b[n]), tnb, n - tnb); /* - */
  215|   300k|        break;
  216|  77.0k|    case -3:
  ------------------
  |  Branch (216:5): [True: 77.0k, False: 1.43M]
  ------------------
  217|  77.0k|        zero = 1;
  218|  77.0k|        break;
  219|   250k|    case -2:
  ------------------
  |  Branch (219:5): [True: 250k, False: 1.26M]
  ------------------
  220|   250k|        bn_sub_part_words(t, &(a[n]), a, tna, tna - n); /* - */
  221|   250k|        bn_sub_part_words(&(t[n]), &(b[n]), b, tnb, tnb - n); /* + */
  222|   250k|        neg = 1;
  223|   250k|        break;
  224|    451|    case -1:
  ------------------
  |  Branch (224:5): [True: 451, False: 1.51M]
  ------------------
  225|  23.4k|    case 0:
  ------------------
  |  Branch (225:5): [True: 23.0k, False: 1.49M]
  ------------------
  226|  23.9k|    case 1:
  ------------------
  |  Branch (226:5): [True: 523, False: 1.51M]
  ------------------
  227|  23.9k|        zero = 1;
  228|  23.9k|        break;
  229|   440k|    case 2:
  ------------------
  |  Branch (229:5): [True: 440k, False: 1.07M]
  ------------------
  230|   440k|        bn_sub_part_words(t, a, &(a[n]), tna, n - tna); /* + */
  231|   440k|        bn_sub_part_words(&(t[n]), b, &(b[n]), tnb, n - tnb); /* - */
  232|   440k|        neg = 1;
  233|   440k|        break;
  234|  85.2k|    case 3:
  ------------------
  |  Branch (234:5): [True: 85.2k, False: 1.43M]
  ------------------
  235|  85.2k|        zero = 1;
  236|  85.2k|        break;
  237|   337k|    case 4:
  ------------------
  |  Branch (237:5): [True: 337k, False: 1.17M]
  ------------------
  238|   337k|        bn_sub_part_words(t, a, &(a[n]), tna, n - tna);
  239|   337k|        bn_sub_part_words(&(t[n]), &(b[n]), b, tnb, tnb - n);
  240|   337k|        break;
  241|  1.51M|    }
  242|       |
  243|  1.51M|# ifdef BN_MUL_COMBA
  244|  1.51M|    if (n == 4 && dna == 0 && dnb == 0) { /* XXX: bn_mul_comba4 could take
  ------------------
  |  Branch (244:9): [True: 0, False: 1.51M]
  |  Branch (244:19): [True: 0, False: 0]
  |  Branch (244:31): [True: 0, False: 0]
  ------------------
  245|       |                                           * extra args to do this well */
  246|      0|        if (!zero)
  ------------------
  |  Branch (246:13): [True: 0, False: 0]
  ------------------
  247|      0|            bn_mul_comba4(&(t[n2]), t, &(t[n]));
  248|      0|        else
  249|      0|            memset(&t[n2], 0, sizeof(*t) * 8);
  250|       |
  251|      0|        bn_mul_comba4(r, a, b);
  252|      0|        bn_mul_comba4(&(r[n2]), &(a[n]), &(b[n]));
  253|  1.51M|    } else if (n == 8 && dna == 0 && dnb == 0) { /* XXX: bn_mul_comba8 could
  ------------------
  |  Branch (253:16): [True: 991k, False: 523k]
  |  Branch (253:26): [True: 991k, False: 11]
  |  Branch (253:38): [True: 991k, False: 55]
  ------------------
  254|       |                                                  * take extra args to do
  255|       |                                                  * this well */
  256|   991k|        if (!zero)
  ------------------
  |  Branch (256:13): [True: 864k, False: 127k]
  ------------------
  257|   864k|            bn_mul_comba8(&(t[n2]), t, &(t[n]));
  258|   127k|        else
  259|   127k|            memset(&t[n2], 0, sizeof(*t) * 16);
  260|       |
  261|   991k|        bn_mul_comba8(r, a, b);
  262|   991k|        bn_mul_comba8(&(r[n2]), &(a[n]), &(b[n]));
  263|   991k|    } else
  264|   523k|# endif                         /* BN_MUL_COMBA */
  265|   523k|    {
  266|   523k|        p = &(t[n2 * 2]);
  267|   523k|        if (!zero)
  ------------------
  |  Branch (267:13): [True: 464k, False: 59.2k]
  ------------------
  268|   464k|            bn_mul_recursive(&(t[n2]), t, &(t[n]), n, 0, 0, p);
  269|  59.2k|        else
  270|  59.2k|            memset(&t[n2], 0, sizeof(*t) * n2);
  271|   523k|        bn_mul_recursive(r, a, b, n, 0, 0, p);
  272|   523k|        bn_mul_recursive(&(r[n2]), &(a[n]), &(b[n]), n, dna, dnb, p);
  273|   523k|    }
  274|       |
  275|       |    /*-
  276|       |     * t[32] holds (a[0]-a[1])*(b[1]-b[0]), c1 is the sign
  277|       |     * r[10] holds (a[0]*b[0])
  278|       |     * r[32] holds (b[1]*b[1])
  279|       |     */
  280|       |
  281|  1.51M|    c1 = (int)(bn_add_words(t, r, &(r[n2]), n2));
  282|       |
  283|  1.51M|    if (neg) {                  /* if t[32] is negative */
  ------------------
  |  Branch (283:9): [True: 690k, False: 824k]
  ------------------
  284|   690k|        c1 -= (int)(bn_sub_words(&(t[n2]), t, &(t[n2]), n2));
  285|   824k|    } else {
  286|       |        /* Might have a carry */
  287|   824k|        c1 += (int)(bn_add_words(&(t[n2]), &(t[n2]), t, n2));
  288|   824k|    }
  289|       |
  290|       |    /*-
  291|       |     * t[32] holds (a[0]-a[1])*(b[1]-b[0])+(a[0]*b[0])+(a[1]*b[1])
  292|       |     * r[10] holds (a[0]*b[0])
  293|       |     * r[32] holds (b[1]*b[1])
  294|       |     * c1 holds the carry bits
  295|       |     */
  296|  1.51M|    c1 += (int)(bn_add_words(&(r[n]), &(r[n]), &(t[n2]), n2));
  297|  1.51M|    if (c1) {
  ------------------
  |  Branch (297:9): [True: 541k, False: 974k]
  ------------------
  298|   541k|        p = &(r[n + n2]);
  299|   541k|        lo = *p;
  300|   541k|        ln = (lo + c1) & BN_MASK2;
  ------------------
  |  |   94|   541k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  301|   541k|        *p = ln;
  302|       |
  303|       |        /*
  304|       |         * The overflow will stop before we over write words we should not
  305|       |         * overwrite
  306|       |         */
  307|   541k|        if (ln < (BN_ULONG)c1) {
  ------------------
  |  Branch (307:13): [True: 932, False: 540k]
  ------------------
  308|  5.39k|            do {
  309|  5.39k|                p++;
  310|  5.39k|                lo = *p;
  311|  5.39k|                ln = (lo + 1) & BN_MASK2;
  ------------------
  |  |   94|  5.39k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  312|  5.39k|                *p = ln;
  313|  5.39k|            } while (ln == 0);
  ------------------
  |  Branch (313:22): [True: 4.45k, False: 932]
  ------------------
  314|    932|        }
  315|   541k|    }
  316|  1.51M|}
bn_mul_part_recursive:
  324|  1.59k|{
  325|  1.59k|    int i, j, n2 = n * 2;
  326|  1.59k|    int c1, c2, neg;
  327|  1.59k|    BN_ULONG ln, lo, *p;
  ------------------
  |  |   37|  1.59k|#  define BN_ULONG        unsigned long
  ------------------
  328|       |
  329|  1.59k|    if (n < 8) {
  ------------------
  |  Branch (329:9): [True: 0, False: 1.59k]
  ------------------
  330|      0|        bn_mul_normal(r, a, n + tna, b, n + tnb);
  331|      0|        return;
  332|      0|    }
  333|       |
  334|       |    /* r=(a[0]-a[1])*(b[1]-b[0]) */
  335|  1.59k|    c1 = bn_cmp_part_words(a, &(a[n]), tna, n - tna);
  336|  1.59k|    c2 = bn_cmp_part_words(&(b[n]), b, tnb, tnb - n);
  337|  1.59k|    neg = 0;
  338|  1.59k|    switch (c1 * 3 + c2) {
  ------------------
  |  Branch (338:13): [True: 0, False: 1.59k]
  ------------------
  339|     64|    case -4:
  ------------------
  |  Branch (339:5): [True: 64, False: 1.53k]
  ------------------
  340|     64|        bn_sub_part_words(t, &(a[n]), a, tna, tna - n); /* - */
  341|     64|        bn_sub_part_words(&(t[n]), b, &(b[n]), tnb, n - tnb); /* - */
  342|     64|        break;
  343|     19|    case -3:
  ------------------
  |  Branch (343:5): [True: 19, False: 1.57k]
  ------------------
  344|    105|    case -2:
  ------------------
  |  Branch (344:5): [True: 86, False: 1.50k]
  ------------------
  345|    105|        bn_sub_part_words(t, &(a[n]), a, tna, tna - n); /* - */
  346|    105|        bn_sub_part_words(&(t[n]), &(b[n]), b, tnb, tnb - n); /* + */
  347|    105|        neg = 1;
  348|    105|        break;
  349|     12|    case -1:
  ------------------
  |  Branch (349:5): [True: 12, False: 1.58k]
  ------------------
  350|     23|    case 0:
  ------------------
  |  Branch (350:5): [True: 11, False: 1.58k]
  ------------------
  351|     47|    case 1:
  ------------------
  |  Branch (351:5): [True: 24, False: 1.57k]
  ------------------
  352|  1.30k|    case 2:
  ------------------
  |  Branch (352:5): [True: 1.25k, False: 340]
  ------------------
  353|  1.30k|        bn_sub_part_words(t, a, &(a[n]), tna, n - tna); /* + */
  354|  1.30k|        bn_sub_part_words(&(t[n]), b, &(b[n]), tnb, n - tnb); /* - */
  355|  1.30k|        neg = 1;
  356|  1.30k|        break;
  357|     21|    case 3:
  ------------------
  |  Branch (357:5): [True: 21, False: 1.57k]
  ------------------
  358|    124|    case 4:
  ------------------
  |  Branch (358:5): [True: 103, False: 1.49k]
  ------------------
  359|    124|        bn_sub_part_words(t, a, &(a[n]), tna, n - tna);
  360|    124|        bn_sub_part_words(&(t[n]), &(b[n]), b, tnb, tnb - n);
  361|    124|        break;
  362|  1.59k|    }
  363|       |    /*
  364|       |     * The zero case isn't yet implemented here. The speedup would probably
  365|       |     * be negligible.
  366|       |     */
  367|       |# if 0
  368|       |    if (n == 4) {
  369|       |        bn_mul_comba4(&(t[n2]), t, &(t[n]));
  370|       |        bn_mul_comba4(r, a, b);
  371|       |        bn_mul_normal(&(r[n2]), &(a[n]), tn, &(b[n]), tn);
  372|       |        memset(&r[n2 + tn * 2], 0, sizeof(*r) * (n2 - tn * 2));
  373|       |    } else
  374|       |# endif
  375|  1.59k|    if (n == 8) {
  ------------------
  |  Branch (375:9): [True: 270, False: 1.32k]
  ------------------
  376|    270|        bn_mul_comba8(&(t[n2]), t, &(t[n]));
  377|    270|        bn_mul_comba8(r, a, b);
  378|    270|        bn_mul_normal(&(r[n2]), &(a[n]), tna, &(b[n]), tnb);
  379|    270|        memset(&r[n2 + tna + tnb], 0, sizeof(*r) * (n2 - tna - tnb));
  380|  1.32k|    } else {
  381|  1.32k|        p = &(t[n2 * 2]);
  382|  1.32k|        bn_mul_recursive(&(t[n2]), t, &(t[n]), n, 0, 0, p);
  383|  1.32k|        bn_mul_recursive(r, a, b, n, 0, 0, p);
  384|  1.32k|        i = n / 2;
  385|       |        /*
  386|       |         * If there is only a bottom half to the number, just do it
  387|       |         */
  388|  1.32k|        if (tna > tnb)
  ------------------
  |  Branch (388:13): [True: 701, False: 623]
  ------------------
  389|    701|            j = tna - i;
  390|    623|        else
  391|    623|            j = tnb - i;
  392|  1.32k|        if (j == 0) {
  ------------------
  |  Branch (392:13): [True: 22, False: 1.30k]
  ------------------
  393|     22|            bn_mul_recursive(&(r[n2]), &(a[n]), &(b[n]),
  394|     22|                             i, tna - i, tnb - i, p);
  395|     22|            memset(&r[n2 + i * 2], 0, sizeof(*r) * (n2 - i * 2));
  396|  1.30k|        } else if (j > 0) {     /* eg, n == 16, i == 8 and tn == 11 */
  ------------------
  |  Branch (396:20): [True: 688, False: 614]
  ------------------
  397|    688|            bn_mul_part_recursive(&(r[n2]), &(a[n]), &(b[n]),
  398|    688|                                  i, tna - i, tnb - i, p);
  399|    688|            memset(&(r[n2 + tna + tnb]), 0,
  400|    688|                   sizeof(BN_ULONG) * (n2 - tna - tnb));
  401|    688|        } else {                /* (j < 0) eg, n == 16, i == 8 and tn == 5 */
  402|       |
  403|    614|            memset(&r[n2], 0, sizeof(*r) * n2);
  404|    614|            if (tna < BN_MUL_RECURSIVE_SIZE_NORMAL
  ------------------
  |  |  365|  1.22k|# define BN_MUL_RECURSIVE_SIZE_NORMAL            (16)/* 32 less than */
  ------------------
  |  Branch (404:17): [True: 527, False: 87]
  ------------------
  405|    614|                && tnb < BN_MUL_RECURSIVE_SIZE_NORMAL) {
  ------------------
  |  |  365|    527|# define BN_MUL_RECURSIVE_SIZE_NORMAL            (16)/* 32 less than */
  ------------------
  |  Branch (405:20): [True: 525, False: 2]
  ------------------
  406|    525|                bn_mul_normal(&(r[n2]), &(a[n]), tna, &(b[n]), tnb);
  407|    525|            } else {
  408|    149|                for (;;) {
  409|    149|                    i /= 2;
  410|       |                    /*
  411|       |                     * these simplified conditions work exclusively because
  412|       |                     * difference between tna and tnb is 1 or 0
  413|       |                     */
  414|    149|                    if (i < tna || i < tnb) {
  ------------------
  |  Branch (414:25): [True: 72, False: 77]
  |  Branch (414:36): [True: 2, False: 75]
  ------------------
  415|     74|                        bn_mul_part_recursive(&(r[n2]),
  416|     74|                                              &(a[n]), &(b[n]),
  417|     74|                                              i, tna - i, tnb - i, p);
  418|     74|                        break;
  419|     75|                    } else if (i == tna || i == tnb) {
  ------------------
  |  Branch (419:32): [True: 13, False: 62]
  |  Branch (419:44): [True: 2, False: 60]
  ------------------
  420|     15|                        bn_mul_recursive(&(r[n2]),
  421|     15|                                         &(a[n]), &(b[n]),
  422|     15|                                         i, tna - i, tnb - i, p);
  423|     15|                        break;
  424|     15|                    }
  425|    149|                }
  426|     89|            }
  427|    614|        }
  428|  1.32k|    }
  429|       |
  430|       |    /*-
  431|       |     * t[32] holds (a[0]-a[1])*(b[1]-b[0]), c1 is the sign
  432|       |     * r[10] holds (a[0]*b[0])
  433|       |     * r[32] holds (b[1]*b[1])
  434|       |     */
  435|       |
  436|  1.59k|    c1 = (int)(bn_add_words(t, r, &(r[n2]), n2));
  437|       |
  438|  1.59k|    if (neg) {                  /* if t[32] is negative */
  ------------------
  |  Branch (438:9): [True: 1.40k, False: 188]
  ------------------
  439|  1.40k|        c1 -= (int)(bn_sub_words(&(t[n2]), t, &(t[n2]), n2));
  440|  1.40k|    } else {
  441|       |        /* Might have a carry */
  442|    188|        c1 += (int)(bn_add_words(&(t[n2]), &(t[n2]), t, n2));
  443|    188|    }
  444|       |
  445|       |    /*-
  446|       |     * t[32] holds (a[0]-a[1])*(b[1]-b[0])+(a[0]*b[0])+(a[1]*b[1])
  447|       |     * r[10] holds (a[0]*b[0])
  448|       |     * r[32] holds (b[1]*b[1])
  449|       |     * c1 holds the carry bits
  450|       |     */
  451|  1.59k|    c1 += (int)(bn_add_words(&(r[n]), &(r[n]), &(t[n2]), n2));
  452|  1.59k|    if (c1) {
  ------------------
  |  Branch (452:9): [True: 232, False: 1.36k]
  ------------------
  453|    232|        p = &(r[n + n2]);
  454|    232|        lo = *p;
  455|    232|        ln = (lo + c1) & BN_MASK2;
  ------------------
  |  |   94|    232|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  456|    232|        *p = ln;
  457|       |
  458|       |        /*
  459|       |         * The overflow will stop before we over write words we should not
  460|       |         * overwrite
  461|       |         */
  462|    232|        if (ln < (BN_ULONG)c1) {
  ------------------
  |  Branch (462:13): [True: 93, False: 139]
  ------------------
  463|  2.20k|            do {
  464|  2.20k|                p++;
  465|  2.20k|                lo = *p;
  466|  2.20k|                ln = (lo + 1) & BN_MASK2;
  ------------------
  |  |   94|  2.20k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  467|  2.20k|                *p = ln;
  468|  2.20k|            } while (ln == 0);
  ------------------
  |  Branch (468:22): [True: 2.11k, False: 93]
  ------------------
  469|     93|        }
  470|    232|    }
  471|  1.59k|}
BN_mul:
  498|  2.62k|{
  499|  2.62k|    int ret = bn_mul_fixed_top(r, a, b, ctx);
  500|       |
  501|  2.62k|    bn_correct_top(r);
  502|  2.62k|    bn_check_top(r);
  503|       |
  504|  2.62k|    return ret;
  505|  2.62k|}
bn_mul_fixed_top:
  508|  2.62k|{
  509|  2.62k|    int ret = 0;
  510|  2.62k|    int top, al, bl;
  511|  2.62k|    BIGNUM *rr;
  512|  2.62k|#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
  513|  2.62k|    int i;
  514|  2.62k|#endif
  515|  2.62k|#ifdef BN_RECURSION
  516|  2.62k|    BIGNUM *t = NULL;
  517|  2.62k|    int j = 0, k;
  518|  2.62k|#endif
  519|       |
  520|  2.62k|    bn_check_top(a);
  521|  2.62k|    bn_check_top(b);
  522|  2.62k|    bn_check_top(r);
  523|       |
  524|  2.62k|    al = a->top;
  525|  2.62k|    bl = b->top;
  526|       |
  527|  2.62k|    if ((al == 0) || (bl == 0)) {
  ------------------
  |  Branch (527:9): [True: 484, False: 2.13k]
  |  Branch (527:22): [True: 0, False: 2.13k]
  ------------------
  528|    484|        BN_zero(r);
  ------------------
  |  |  202|    484|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  529|    484|        return 1;
  530|    484|    }
  531|  2.13k|    top = al + bl;
  532|       |
  533|  2.13k|    BN_CTX_start(ctx);
  534|  2.13k|    if ((r == a) || (r == b)) {
  ------------------
  |  Branch (534:9): [True: 0, False: 2.13k]
  |  Branch (534:21): [True: 0, False: 2.13k]
  ------------------
  535|      0|        if ((rr = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (535:13): [True: 0, False: 0]
  ------------------
  536|      0|            goto err;
  537|      0|    } else
  538|  2.13k|        rr = r;
  539|       |
  540|  2.13k|#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
  541|  2.13k|    i = al - bl;
  542|  2.13k|#endif
  543|  2.13k|#ifdef BN_MUL_COMBA
  544|  2.13k|    if (i == 0) {
  ------------------
  |  Branch (544:9): [True: 646, False: 1.49k]
  ------------------
  545|       |# if 0
  546|       |        if (al == 4) {
  547|       |            if (bn_wexpand(rr, 8) == NULL)
  548|       |                goto err;
  549|       |            rr->top = 8;
  550|       |            bn_mul_comba4(rr->d, a->d, b->d);
  551|       |            goto end;
  552|       |        }
  553|       |# endif
  554|    646|        if (al == 8) {
  ------------------
  |  Branch (554:13): [True: 1, False: 645]
  ------------------
  555|      1|            if (bn_wexpand(rr, 16) == NULL)
  ------------------
  |  Branch (555:17): [True: 0, False: 1]
  ------------------
  556|      0|                goto err;
  557|      1|            rr->top = 16;
  558|      1|            bn_mul_comba8(rr->d, a->d, b->d);
  559|      1|            goto end;
  560|      1|        }
  561|    646|    }
  562|  2.13k|#endif                          /* BN_MUL_COMBA */
  563|  2.13k|#ifdef BN_RECURSION
  564|  2.13k|    if ((al >= BN_MULL_SIZE_NORMAL) && (bl >= BN_MULL_SIZE_NORMAL)) {
  ------------------
  |  |  364|  2.13k|# define BN_MULL_SIZE_NORMAL                     (16)/* 32 */
  ------------------
                  if ((al >= BN_MULL_SIZE_NORMAL) && (bl >= BN_MULL_SIZE_NORMAL)) {
  ------------------
  |  |  364|  1.30k|# define BN_MULL_SIZE_NORMAL                     (16)/* 32 */
  ------------------
  |  Branch (564:9): [True: 1.30k, False: 834]
  |  Branch (564:40): [True: 1.17k, False: 132]
  ------------------
  565|  1.17k|        if (i >= -1 && i <= 1) {
  ------------------
  |  Branch (565:13): [True: 1.12k, False: 44]
  |  Branch (565:24): [True: 1.03k, False: 91]
  ------------------
  566|       |            /*
  567|       |             * Find out the power of two lower or equal to the longest of the
  568|       |             * two numbers
  569|       |             */
  570|  1.03k|            if (i >= 0) {
  ------------------
  |  Branch (570:17): [True: 892, False: 145]
  ------------------
  571|    892|                j = BN_num_bits_word((BN_ULONG)al);
  572|    892|            }
  573|  1.03k|            if (i == -1) {
  ------------------
  |  Branch (573:17): [True: 145, False: 892]
  ------------------
  574|    145|                j = BN_num_bits_word((BN_ULONG)bl);
  575|    145|            }
  576|  1.03k|            j = 1 << (j - 1);
  577|  1.03k|            assert(j <= al || j <= bl);
  578|  1.03k|            k = j + j;
  579|  1.03k|            t = BN_CTX_get(ctx);
  580|  1.03k|            if (t == NULL)
  ------------------
  |  Branch (580:17): [True: 0, False: 1.03k]
  ------------------
  581|      0|                goto err;
  582|  1.03k|            if (al > j || bl > j) {
  ------------------
  |  Branch (582:17): [True: 757, False: 280]
  |  Branch (582:27): [True: 75, False: 205]
  ------------------
  583|    832|                if (bn_wexpand(t, k * 4) == NULL)
  ------------------
  |  Branch (583:21): [True: 0, False: 832]
  ------------------
  584|      0|                    goto err;
  585|    832|                if (bn_wexpand(rr, k * 4) == NULL)
  ------------------
  |  Branch (585:21): [True: 0, False: 832]
  ------------------
  586|      0|                    goto err;
  587|    832|                bn_mul_part_recursive(rr->d, a->d, b->d,
  588|    832|                                      j, al - j, bl - j, t->d);
  589|    832|            } else {            /* al <= j || bl <= j */
  590|       |
  591|    205|                if (bn_wexpand(t, k * 2) == NULL)
  ------------------
  |  Branch (591:21): [True: 0, False: 205]
  ------------------
  592|      0|                    goto err;
  593|    205|                if (bn_wexpand(rr, k * 2) == NULL)
  ------------------
  |  Branch (593:21): [True: 0, False: 205]
  ------------------
  594|      0|                    goto err;
  595|    205|                bn_mul_recursive(rr->d, a->d, b->d, j, al - j, bl - j, t->d);
  596|    205|            }
  597|  1.03k|            rr->top = top;
  598|  1.03k|            goto end;
  599|  1.03k|        }
  600|  1.17k|    }
  601|  1.10k|#endif                          /* BN_RECURSION */
  602|  1.10k|    if (bn_wexpand(rr, top) == NULL)
  ------------------
  |  Branch (602:9): [True: 0, False: 1.10k]
  ------------------
  603|      0|        goto err;
  604|  1.10k|    rr->top = top;
  605|  1.10k|    bn_mul_normal(rr->d, a->d, al, b->d, bl);
  606|       |
  607|  1.10k|#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
  608|  2.13k| end:
  609|  2.13k|#endif
  610|  2.13k|    rr->neg = a->neg ^ b->neg;
  611|  2.13k|    rr->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  2.13k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  612|  2.13k|    if (r != rr && BN_copy(r, rr) == NULL)
  ------------------
  |  Branch (612:9): [True: 0, False: 2.13k]
  |  Branch (612:20): [True: 0, False: 0]
  ------------------
  613|      0|        goto err;
  614|       |
  615|  2.13k|    ret = 1;
  616|  2.13k| err:
  617|  2.13k|    bn_check_top(r);
  618|  2.13k|    BN_CTX_end(ctx);
  619|  2.13k|    return ret;
  620|  2.13k|}
bn_mul_normal:
  623|  1.96k|{
  624|  1.96k|    BN_ULONG *rr;
  ------------------
  |  |   37|  1.96k|#  define BN_ULONG        unsigned long
  ------------------
  625|       |
  626|  1.96k|    if (na < nb) {
  ------------------
  |  Branch (626:9): [True: 666, False: 1.30k]
  ------------------
  627|    666|        int itmp;
  628|    666|        BN_ULONG *ltmp;
  ------------------
  |  |   37|    666|#  define BN_ULONG        unsigned long
  ------------------
  629|       |
  630|    666|        itmp = na;
  631|    666|        na = nb;
  632|    666|        nb = itmp;
  633|    666|        ltmp = a;
  634|    666|        a = b;
  635|    666|        b = ltmp;
  636|       |
  637|    666|    }
  638|  1.96k|    rr = &(r[na]);
  639|  1.96k|    if (nb <= 0) {
  ------------------
  |  Branch (639:9): [True: 440, False: 1.52k]
  ------------------
  640|    440|        (void)bn_mul_words(r, a, na, 0);
  641|    440|        return;
  642|    440|    } else
  643|  1.52k|        rr[0] = bn_mul_words(r, a, na, b[0]);
  644|       |
  645|  27.7k|    for (;;) {
  646|  27.7k|        if (--nb <= 0)
  ------------------
  |  Branch (646:13): [True: 1.07k, False: 26.6k]
  ------------------
  647|  1.07k|            return;
  648|  26.6k|        rr[1] = bn_mul_add_words(&(r[1]), a, na, b[1]);
  649|  26.6k|        if (--nb <= 0)
  ------------------
  |  Branch (649:13): [True: 196, False: 26.4k]
  ------------------
  650|    196|            return;
  651|  26.4k|        rr[2] = bn_mul_add_words(&(r[2]), a, na, b[2]);
  652|  26.4k|        if (--nb <= 0)
  ------------------
  |  Branch (652:13): [True: 140, False: 26.3k]
  ------------------
  653|    140|            return;
  654|  26.3k|        rr[3] = bn_mul_add_words(&(r[3]), a, na, b[3]);
  655|  26.3k|        if (--nb <= 0)
  ------------------
  |  Branch (655:13): [True: 117, False: 26.2k]
  ------------------
  656|    117|            return;
  657|  26.2k|        rr[4] = bn_mul_add_words(&(r[4]), a, na, b[4]);
  658|  26.2k|        rr += 4;
  659|  26.2k|        r += 4;
  660|  26.2k|        b += 4;
  661|  26.2k|    }
  662|  1.52k|}

bn_lshift_fixed_top:
  105|  2.62k|{
  106|  2.62k|    int i, nw;
  107|  2.62k|    unsigned int lb, rb;
  108|  2.62k|    BN_ULONG *t, *f;
  ------------------
  |  |   37|  2.62k|#  define BN_ULONG        unsigned long
  ------------------
  109|  2.62k|    BN_ULONG l, m, rmask = 0;
  ------------------
  |  |   37|  2.62k|#  define BN_ULONG        unsigned long
  ------------------
  110|       |
  111|  2.62k|    assert(n >= 0);
  112|       |
  113|  2.62k|    bn_check_top(r);
  114|  2.62k|    bn_check_top(a);
  115|       |
  116|  2.62k|    nw = n / BN_BITS2;
  ------------------
  |  |   54|  2.62k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  2.62k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  117|  2.62k|    if (bn_wexpand(r, a->top + nw + 1) == NULL)
  ------------------
  |  Branch (117:9): [True: 0, False: 2.62k]
  ------------------
  118|      0|        return 0;
  119|       |
  120|  2.62k|    if (a->top != 0) {
  ------------------
  |  Branch (120:9): [True: 2.31k, False: 309]
  ------------------
  121|  2.31k|        lb = (unsigned int)n % BN_BITS2;
  ------------------
  |  |   54|  2.31k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  2.31k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  122|  2.31k|        rb = BN_BITS2 - lb;
  ------------------
  |  |   54|  2.31k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  2.31k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  123|  2.31k|        rb %= BN_BITS2;            /* say no to undefined behaviour */
  ------------------
  |  |   54|  2.31k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  2.31k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  124|  2.31k|        rmask = (BN_ULONG)0 - rb;  /* rmask = 0 - (rb != 0) */
  125|  2.31k|        rmask |= rmask >> 8;
  126|  2.31k|        f = &(a->d[0]);
  127|  2.31k|        t = &(r->d[nw]);
  128|  2.31k|        l = f[a->top - 1];
  129|  2.31k|        t[a->top] = (l >> rb) & rmask;
  130|  1.81M|        for (i = a->top - 1; i > 0; i--) {
  ------------------
  |  Branch (130:30): [True: 1.81M, False: 2.31k]
  ------------------
  131|  1.81M|            m = l << lb;
  132|  1.81M|            l = f[i - 1];
  133|  1.81M|            t[i] = (m | ((l >> rb) & rmask)) & BN_MASK2;
  ------------------
  |  |   94|  1.81M|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  134|  1.81M|        }
  135|  2.31k|        t[0] = (l << lb) & BN_MASK2;
  ------------------
  |  |   94|  2.31k|#  define BN_MASK2        (0xffffffffffffffffL)
  ------------------
  136|  2.31k|    } else {
  137|       |        /* shouldn't happen, but formally required */
  138|    309|        r->d[nw] = 0;
  139|    309|    }
  140|  2.62k|    if (nw != 0)
  ------------------
  |  Branch (140:9): [True: 0, False: 2.62k]
  ------------------
  141|      0|        memset(r->d, 0, sizeof(*t) * nw);
  142|       |
  143|  2.62k|    r->neg = a->neg;
  144|  2.62k|    r->top = a->top + nw + 1;
  145|  2.62k|    r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  2.62k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  146|       |
  147|  2.62k|    return 1;
  148|  2.62k|}
bn_rshift_fixed_top:
  177|  2.62k|{
  178|  2.62k|    int i, top, nw;
  179|  2.62k|    unsigned int lb, rb;
  180|  2.62k|    BN_ULONG *t, *f;
  ------------------
  |  |   37|  2.62k|#  define BN_ULONG        unsigned long
  ------------------
  181|  2.62k|    BN_ULONG l, m, mask;
  ------------------
  |  |   37|  2.62k|#  define BN_ULONG        unsigned long
  ------------------
  182|       |
  183|  2.62k|    assert(n >= 0);
  184|       |
  185|  2.62k|    nw = n / BN_BITS2;
  ------------------
  |  |   54|  2.62k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  2.62k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  186|  2.62k|    if (nw >= a->top) {
  ------------------
  |  Branch (186:9): [True: 0, False: 2.62k]
  ------------------
  187|       |        /* shouldn't happen, but formally required */
  188|      0|        BN_zero(r);
  ------------------
  |  |  202|      0|#  define BN_zero(a)      BN_zero_ex(a)
  ------------------
  189|      0|        return 1;
  190|      0|    }
  191|       |
  192|  2.62k|    rb = (unsigned int)n % BN_BITS2;
  ------------------
  |  |   54|  2.62k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  2.62k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  193|  2.62k|    lb = BN_BITS2 - rb;
  ------------------
  |  |   54|  2.62k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  2.62k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  194|  2.62k|    lb %= BN_BITS2;            /* say no to undefined behaviour */
  ------------------
  |  |   54|  2.62k|# define BN_BITS2       (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  2.62k|#  define BN_BYTES        8
  |  |  ------------------
  ------------------
  195|  2.62k|    mask = (BN_ULONG)0 - lb;   /* mask = 0 - (lb != 0) */
  196|  2.62k|    mask |= mask >> 8;
  197|  2.62k|    top = a->top - nw;
  198|  2.62k|    if (r != a && bn_wexpand(r, top) == NULL)
  ------------------
  |  Branch (198:9): [True: 2.62k, False: 0]
  |  Branch (198:19): [True: 0, False: 2.62k]
  ------------------
  199|      0|        return 0;
  200|       |
  201|  2.62k|    t = &(r->d[0]);
  202|  2.62k|    f = &(a->d[nw]);
  203|  2.62k|    l = f[0];
  204|   940k|    for (i = 0; i < top - 1; i++) {
  ------------------
  |  Branch (204:17): [True: 938k, False: 2.62k]
  ------------------
  205|   938k|        m = f[i + 1];
  206|   938k|        t[i] = (l >> rb) | ((m << lb) & mask);
  207|   938k|        l = m;
  208|   938k|    }
  209|  2.62k|    t[i] = l >> rb;
  210|       |
  211|  2.62k|    r->neg = a->neg;
  212|  2.62k|    r->top = top;
  213|  2.62k|    r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  226|  2.62k|#  define BN_FLG_FIXED_TOP 0
  ------------------
  214|       |
  215|  2.62k|    return 1;
  216|  2.62k|}

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

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|     22|{
  549|     22|#ifndef FIPS_MODULE
  550|     22|    if (ctx == NULL)
  ------------------
  |  Branch (550:9): [True: 2, False: 20]
  ------------------
  551|      2|        return get_default_context();
  552|     20|#endif
  553|     20|    return ctx;
  554|     22|}
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|      4|{
  677|      4|    ctx = ossl_lib_ctx_get_concrete(ctx);
  678|      4|    if (ctx == NULL)
  ------------------
  |  Branch (678:9): [True: 0, False: 4]
  ------------------
  679|      0|        return NULL;
  680|      4|    return &ctx->global;
  681|      4|}
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|      2|{
  435|      2|    OSSL_LIB_CTX *current_defctx = get_thread_default_context();
  436|       |
  437|      2|    if (current_defctx == NULL)
  ------------------
  |  Branch (437:9): [True: 2, False: 0]
  ------------------
  438|      2|        current_defctx = &default_context_int;
  439|      2|    return current_defctx;
  440|      2|}
context.c:get_thread_default_context:
  426|      2|{
  427|      2|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (427:9): [True: 0, False: 2]
  ------------------
  428|      0|        return NULL;
  429|       |
  430|      2|    return CRYPTO_THREAD_get_local(&default_context_thread_local);
  431|      2|}

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_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|  2.64k|{
  336|  2.64k|    int i;
  337|  2.64k|    ERR_STATE *es;
  338|       |
  339|  2.64k|    es = ossl_err_get_state_int();
  340|  2.64k|    if (es == NULL)
  ------------------
  |  Branch (340:9): [True: 0, False: 2.64k]
  ------------------
  341|      0|        return;
  342|       |
  343|  44.8k|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   55|  44.8k|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (343:17): [True: 42.2k, False: 2.64k]
  ------------------
  344|  42.2k|        err_clear(es, i, 0);
  345|  42.2k|    }
  346|  2.64k|    es->top = es->bottom = 0;
  347|  2.64k|}
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|  2.64k|{
  674|  2.64k|    ERR_STATE *state;
  675|  2.64k|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|  2.64k|# define get_last_sys_error()    errno
  ------------------
  676|       |
  677|  2.64k|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|  2.64k|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (677:9): [True: 0, False: 2.64k]
  ------------------
  678|      0|        return NULL;
  679|       |
  680|  2.64k|    if (!RUN_ONCE(&err_init, err_do_init))
  ------------------
  |  |  130|  2.64k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2.64k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (680:9): [True: 0, False: 2.64k]
  ------------------
  681|      0|        return NULL;
  682|       |
  683|  2.64k|    state = CRYPTO_THREAD_get_local(&err_thread_local);
  684|  2.64k|    if (state == (ERR_STATE*)-1)
  ------------------
  |  Branch (684:9): [True: 0, False: 2.64k]
  ------------------
  685|      0|        return NULL;
  686|       |
  687|  2.64k|    if (state == NULL) {
  ------------------
  |  Branch (687:9): [True: 2, False: 2.63k]
  ------------------
  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|  2.64k|    set_sys_error(saveerrno);
  ------------------
  |  |   32|  2.64k|# define set_sys_error(e)        errno=(e)
  ------------------
  709|  2.64k|    return state;
  710|  2.64k|}
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.c:err_clear:
   85|  42.2k|{
   86|  42.2k|    err_clear_data(es, i, (deall));
   87|  42.2k|    es->err_marks[i] = 0;
   88|  42.2k|    es->err_flags[i] = 0;
   89|  42.2k|    es->err_buffer[i] = 0;
   90|  42.2k|    es->err_line[i] = -1;
   91|  42.2k|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  115|  42.2k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  42.2k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  42.2k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   92|  42.2k|    es->err_file[i] = NULL;
   93|  42.2k|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  115|  42.2k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  291|  42.2k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  292|  42.2k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|  42.2k|    es->err_func[i] = NULL;
   95|  42.2k|}
err.c:err_clear_data:
   22|  42.2k|{
   23|  42.2k|    if (es->err_data_flags[i] & ERR_TXT_MALLOCED) {
  ------------------
  |  |   48|  42.2k|# define ERR_TXT_MALLOCED        0x01
  ------------------
  |  Branch (23:9): [True: 0, False: 42.2k]
  ------------------
   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|  42.2k|    } else {
   34|  42.2k|        es->err_data[i] = NULL;
   35|  42.2k|        es->err_data_size[i] = 0;
   36|  42.2k|        es->err_data_flags[i] = 0;
   37|  42.2k|    }
   38|  42.2k|}

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

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_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|  2.65k|{
  477|  2.65k|    uint64_t tmp;
  478|  2.65k|    int aloaddone = 0;
  479|       |
  480|       |   /* Applications depend on 0 being returned when cleanup was already done */
  481|  2.65k|    if (stopped) {
  ------------------
  |  Branch (481:9): [True: 2, False: 2.64k]
  ------------------
  482|      2|        if (!(opts & OPENSSL_INIT_BASE_ONLY))
  ------------------
  |  |   31|      2|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (482:13): [True: 0, False: 2]
  ------------------
  483|      2|            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|      2|        return 0;
  485|      2|    }
  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|  2.64k|    if (CRYPTO_atomic_load(&optsdone, &tmp, NULL)) {
  ------------------
  |  Branch (500:9): [True: 2.64k, False: 0]
  ------------------
  501|  2.64k|        if ((tmp & opts) == opts)
  ------------------
  |  Branch (501:13): [True: 2, False: 2.64k]
  ------------------
  502|      2|            return 1;
  503|  2.64k|        aloaddone = 1;
  504|  2.64k|    }
  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|  2.64k|    if (!RUN_ONCE(&base, ossl_init_base))
  ------------------
  |  |  130|  2.64k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2.64k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (520:9): [True: 0, False: 2.64k]
  ------------------
  521|      0|        return 0;
  522|       |
  523|  2.64k|    if (opts & OPENSSL_INIT_BASE_ONLY)
  ------------------
  |  |   31|  2.64k|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (523:9): [True: 2.64k, False: 2]
  ------------------
  524|  2.64k|        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|  3.78k|{
  179|  3.78k|    void *ptr;
  180|       |
  181|  3.78k|    INCREMENT(malloc_count);
  182|  3.78k|    if (malloc_impl != CRYPTO_malloc) {
  ------------------
  |  Branch (182:9): [True: 0, False: 3.78k]
  ------------------
  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|  3.78k|    if (num == 0)
  ------------------
  |  Branch (189:9): [True: 0, False: 3.78k]
  ------------------
  190|      0|        return NULL;
  191|       |
  192|  3.78k|    FAILTEST();
  193|  3.78k|    if (allow_customize) {
  ------------------
  |  Branch (193:9): [True: 2, False: 3.78k]
  ------------------
  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|  3.78k|    ptr = malloc(num);
  203|  3.78k|    if (ptr != NULL)
  ------------------
  |  Branch (203:9): [True: 3.78k, False: 0]
  ------------------
  204|  3.78k|        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|  3.78k|}
CRYPTO_zalloc:
  219|    782|{
  220|    782|    void *ret;
  221|       |
  222|    782|    ret = CRYPTO_malloc(num, file, line);
  223|    782|    if (ret != NULL)
  ------------------
  |  Branch (223:9): [True: 782, False: 0]
  ------------------
  224|    782|        memset(ret, 0, num);
  225|       |
  226|    782|    return ret;
  227|    782|}
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_free:
  334|  88.3k|{
  335|  88.3k|    INCREMENT(free_count);
  336|  88.3k|    if (free_impl != CRYPTO_free) {
  ------------------
  |  Branch (336:9): [True: 0, False: 88.3k]
  ------------------
  337|      0|        free_impl(str, file, line);
  338|      0|        return;
  339|      0|    }
  340|       |
  341|  88.3k|    free(str);
  342|  88.3k|}
CRYPTO_clear_free:
  345|    618|{
  346|    618|    if (str == NULL)
  ------------------
  |  Branch (346:9): [True: 0, False: 618]
  ------------------
  347|      0|        return;
  348|    618|    if (num)
  ------------------
  |  Branch (348:9): [True: 618, False: 0]
  ------------------
  349|    618|        OPENSSL_cleanse(str, num);
  350|    618|    CRYPTO_free(str, file, line);
  351|    618|}

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

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|     26|{
  445|     26|    if (st == NULL)
  ------------------
  |  Branch (445:9): [True: 10, False: 16]
  ------------------
  446|     10|        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|     10|{
  453|     10|    return st == NULL ? -1 : st->num;
  ------------------
  |  Branch (453:12): [True: 2, False: 8]
  ------------------
  454|     10|}
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|    152|{
  751|    152|# ifdef USE_RWLOCK
  752|    152|    if (pthread_rwlock_rdlock(lock) != 0)
  ------------------
  |  Branch (752:9): [True: 0, False: 152]
  ------------------
  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|    152|    return 1;
  762|    152|}
CRYPTO_THREAD_write_lock:
  765|    230|{
  766|    230|# ifdef USE_RWLOCK
  767|    230|    if (pthread_rwlock_wrlock(lock) != 0)
  ------------------
  |  Branch (767:9): [True: 0, False: 230]
  ------------------
  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|    230|    return 1;
  777|    230|}
CRYPTO_THREAD_unlock:
  780|    382|{
  781|    382|# ifdef USE_RWLOCK
  782|    382|    if (pthread_rwlock_unlock(lock) != 0)
  ------------------
  |  Branch (782:9): [True: 0, False: 382]
  ------------------
  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|    382|    return 1;
  792|    382|}
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|  5.44k|{
  811|  5.44k|    if (pthread_once(once, init) != 0)
  ------------------
  |  Branch (811:9): [True: 0, False: 5.44k]
  ------------------
  812|      0|        return 0;
  813|       |
  814|  5.44k|    return 1;
  815|  5.44k|}
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|  2.65k|{
  827|  2.65k|    return pthread_getspecific(*key);
  828|  2.65k|}
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|  2.64k|{
  962|  2.64k|# if defined(__GNUC__) && defined(__ATOMIC_ACQUIRE) && !defined(BROKEN_CLANG_ATOMICS)
  963|  2.64k|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (963:9): [Folded - Ignored]
  ------------------
  964|  2.64k|        __atomic_load(val, ret, __ATOMIC_ACQUIRE);
  965|  2.64k|        return 1;
  966|  2.64k|    }
  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|}

FuzzerInitialize:
   32|      2|{
   33|      2|    b1 = BN_new();
   34|      2|    b2 = BN_new();
   35|      2|    b3 = BN_new();
   36|      2|    b4 = BN_new();
   37|      2|    b5 = BN_new();
   38|      2|    ctx = BN_CTX_new();
   39|       |
   40|      2|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
  ------------------
  |  |  463|      2|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
   41|      2|    ERR_clear_error();
   42|       |
   43|      2|    return 1;
   44|      2|}
FuzzerTestOneInput:
   47|  2.63k|{
   48|  2.63k|    int success = 0;
   49|  2.63k|    size_t l1 = 0, l2 = 0;
   50|       |    /* s1 and s2 will be the signs for b1 and b2. */
   51|  2.63k|    int s1 = 0, s2 = 0;
   52|       |
   53|       |    /* limit the size of the input to avoid timeout */
   54|  2.63k|    if (len > MAX_LEN)
  ------------------
  |  |   22|  2.63k|#define MAX_LEN (256 * 1000)
  ------------------
  |  Branch (54:9): [True: 2, False: 2.63k]
  ------------------
   55|      2|        len = MAX_LEN;
  ------------------
  |  |   22|      2|#define MAX_LEN (256 * 1000)
  ------------------
   56|       |
   57|       |    /* We are going to split the buffer in two, sizes l1 and l2, giving b1 and
   58|       |     * b2.
   59|       |     */
   60|  2.63k|    if (len > 0) {
  ------------------
  |  Branch (60:9): [True: 2.63k, False: 0]
  ------------------
   61|  2.63k|        --len;
   62|       |        /* Use first byte to divide the remaining buffer into 3Fths. I admit
   63|       |         * this disallows some number sizes. If it matters, better ideas are
   64|       |         * welcome (Ben).
   65|       |         */
   66|  2.63k|        l1 = ((buf[0] & 0x3f) * len) / 0x3f;
   67|  2.63k|        s1 = buf[0] & 0x40;
   68|  2.63k|        s2 = buf[0] & 0x80;
   69|  2.63k|        ++buf;
   70|  2.63k|        l2 = len - l1;
   71|  2.63k|    }
   72|  2.63k|    OPENSSL_assert(BN_bin2bn(buf, l1, b1) == b1);
  ------------------
  |  |  434|  2.63k|    (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: 2.63k, False: 0]
  |  |  ------------------
  ------------------
   73|  2.63k|    BN_set_negative(b1, s1);
   74|  2.63k|    OPENSSL_assert(BN_bin2bn(buf + l1, l2, b2) == b2);
  ------------------
  |  |  434|  2.63k|    (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: 2.63k, False: 0]
  |  |  ------------------
  ------------------
   75|  2.63k|    BN_set_negative(b2, s2);
   76|       |
   77|       |    /* divide by 0 is an error */
   78|  2.63k|    if (BN_is_zero(b2)) {
  ------------------
  |  Branch (78:9): [True: 16, False: 2.62k]
  ------------------
   79|     16|        success = 1;
   80|     16|        goto done;
   81|     16|    }
   82|       |
   83|  2.62k|    OPENSSL_assert(BN_div(b3, b4, b1, b2, ctx));
  ------------------
  |  |  434|  2.62k|    (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: 2.62k, False: 0]
  |  |  ------------------
  ------------------
   84|  2.62k|    if (BN_is_zero(b1))
  ------------------
  |  Branch (84:9): [True: 309, False: 2.31k]
  ------------------
   85|    309|        success = BN_is_zero(b3) && BN_is_zero(b4);
  ------------------
  |  Branch (85:19): [True: 309, False: 0]
  |  Branch (85:37): [True: 309, False: 0]
  ------------------
   86|  2.31k|    else if (BN_is_negative(b1))
  ------------------
  |  Branch (86:14): [True: 1.57k, False: 742]
  ------------------
   87|  1.57k|        success = (BN_is_negative(b3) != BN_is_negative(b2) || BN_is_zero(b3))
  ------------------
  |  Branch (87:20): [True: 1.50k, False: 67]
  |  Branch (87:64): [True: 67, False: 0]
  ------------------
   88|  1.57k|            && (BN_is_negative(b4) || BN_is_zero(b4));
  ------------------
  |  Branch (88:17): [True: 1.39k, False: 176]
  |  Branch (88:39): [True: 176, False: 0]
  ------------------
   89|    742|    else
   90|    742|        success = (BN_is_negative(b3) == BN_is_negative(b2)  || BN_is_zero(b3))
  ------------------
  |  Branch (90:20): [True: 720, False: 22]
  |  Branch (90:65): [True: 22, False: 0]
  ------------------
   91|    742|            && (!BN_is_negative(b4) || BN_is_zero(b4));
  ------------------
  |  Branch (91:17): [True: 742, False: 0]
  |  Branch (91:40): [True: 0, False: 0]
  ------------------
   92|  2.62k|    OPENSSL_assert(BN_mul(b5, b3, b2, ctx));
  ------------------
  |  |  434|  2.62k|    (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: 2.62k, False: 0]
  |  |  ------------------
  ------------------
   93|  2.62k|    OPENSSL_assert(BN_add(b5, b5, b4));
  ------------------
  |  |  434|  2.62k|    (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: 2.62k, False: 0]
  |  |  ------------------
  ------------------
   94|       |
   95|  2.62k|    success = success && BN_cmp(b5, b1) == 0;
  ------------------
  |  Branch (95:15): [True: 2.62k, False: 0]
  |  Branch (95:26): [True: 2.62k, False: 0]
  ------------------
   96|  2.62k|    if (!success) {
  ------------------
  |  Branch (96:9): [True: 0, False: 2.62k]
  ------------------
   97|      0|        BN_print_fp(stdout, b1);
   98|      0|        putchar('\n');
   99|      0|        BN_print_fp(stdout, b2);
  100|      0|        putchar('\n');
  101|      0|        BN_print_fp(stdout, b3);
  102|      0|        putchar('\n');
  103|      0|        BN_print_fp(stdout, b4);
  104|      0|        putchar('\n');
  105|      0|        BN_print_fp(stdout, b5);
  106|      0|        putchar('\n');
  107|      0|        printf("%d %d %d %d %d %d %d\n", BN_is_negative(b1),
  108|      0|               BN_is_negative(b2),
  109|      0|               BN_is_negative(b3), BN_is_negative(b4), BN_is_zero(b4),
  110|      0|               BN_is_negative(b3) != BN_is_negative(b2)
  ------------------
  |  Branch (110:16): [True: 0, False: 0]
  ------------------
  111|      0|               && (BN_is_negative(b4) || BN_is_zero(b4)),
  ------------------
  |  Branch (111:20): [True: 0, False: 0]
  |  Branch (111:42): [True: 0, False: 0]
  ------------------
  112|      0|               BN_cmp(b5, b1));
  113|      0|        puts("----\n");
  114|      0|    }
  115|       |
  116|  2.63k| done:
  117|  2.63k|    OPENSSL_assert(success);
  ------------------
  |  |  434|  2.63k|    (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: 2.63k, False: 0]
  |  |  ------------------
  ------------------
  118|  2.63k|    ERR_clear_error();
  119|       |
  120|  2.63k|    return 0;
  121|  2.62k|}

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

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_FREE_REF:
  273|      2|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|      2|{
  275|      2|}

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

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

