_Z7to_charPKh:
   11|  4.88k|char *to_char(const uint8_t *x) {
   12|  4.88k|  return reinterpret_cast<char *>(const_cast<unsigned char *>(x));
   13|  4.88k|}
_Z11check_equalP9bignum_stP6mp_intm:
   22|  9.72k|void check_equal(BIGNUM *b, mp_int *m, size_t max_size) {
   23|  9.72k|  char *bnBc = BN_bn2hex(b);
   24|  9.72k|  char mpiMc[max_size];
   25|  9.72k|  mp_tohex(m, mpiMc);
  ------------------
  |  |  294|  9.72k|#define mp_tohex(M, S) mp_toradix((M), (S), 16)
  ------------------
   26|  9.72k|  std::string bnA(bnBc);
   27|  9.72k|  std::string mpiA(mpiMc);
   28|  9.72k|  OPENSSL_free(bnBc);
   29|       |  // We have to strip leading zeros from bignums, ignoring the sign.
   30|  9.72k|  if (bnA.at(0) != '-') {
  ------------------
  |  Branch (30:7): [True: 9.72k, False: 0]
  ------------------
   31|  9.72k|    bnA.erase(0, std::min(bnA.find_first_not_of('0'), bnA.size() - 1));
   32|  9.72k|  } else if (bnA.at(1) == '0') {
  ------------------
  |  Branch (32:14): [True: 0, False: 0]
  ------------------
   33|      0|    bnA.erase(1, std::min(bnA.find_first_not_of('0', 1) - 1, bnA.size() - 1));
   34|      0|  }
   35|       |
   36|  9.72k|  if (mpiA != bnA) {
  ------------------
  |  Branch (36:7): [True: 0, False: 9.72k]
  ------------------
   37|      0|    std::cout << "openssl: " << std::hex << bnA << std::endl;
   38|      0|    std::cout << "nss:     " << std::hex << mpiA << std::endl;
   39|      0|  }
   40|       |
   41|  9.72k|  assert(mpiA == bnA);
   42|  9.72k|}
_Z11parse_inputPKhmP9bignum_stP6mp_int:
   65|  4.88k|void parse_input(const uint8_t *data, size_t size, BIGNUM *A, mp_int *a) {
   66|  4.88k|  assert(mp_read_raw(a, to_char(data), size) == MP_OKAY);
   67|       |
   68|       |  // Force a positive sign.
   69|       |  // TODO: add tests for negatives.
   70|  4.88k|  MP_SIGN(a) = MP_ZPOS;
  ------------------
  |  |  144|  4.88k|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
                MP_SIGN(a) = MP_ZPOS;
  ------------------
  |  |   37|  4.88k|#define MP_ZPOS 0
  ------------------
   71|       |
   72|       |  // Skip the first byte as it's interpreted as sign by NSS.
   73|  4.88k|  assert(BN_bin2bn(data + 1, size - 1, A) != nullptr);
   74|       |
   75|  4.88k|  check_equal(A, a, 4 * size + 1);
   76|  4.88k|}

LLVMFuzzerTestOneInput:
   15|  4.88k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   16|       |  // We require at least size 4 to get everything we need from data.
   17|  4.88k|  if (size < 4) {
  ------------------
  |  Branch (17:7): [True: 2, False: 4.88k]
  ------------------
   18|      2|    return 0;
   19|      2|  }
   20|       |
   21|  19.5k|  INIT_THREE_NUMBERS
  ------------------
  |  |   52|  4.88k|  mp_int a, b, c;                 \
  |  |   53|  4.88k|  BN_CTX *ctx = BN_CTX_new();     \
  |  |   54|  4.88k|  BN_CTX_start(ctx);              \
  |  |   55|  4.88k|  BIGNUM *A = BN_CTX_get(ctx);    \
  |  |   56|  4.88k|  BIGNUM *B = BN_CTX_get(ctx);    \
  |  |   57|  4.88k|  BIGNUM *C = BN_CTX_get(ctx);    \
  |  |   58|  4.88k|  assert(mp_init(&a) == MP_OKAY); \
  |  |   59|  4.88k|  assert(mp_init(&b) == MP_OKAY); \
  |  |   60|  4.88k|  assert(mp_init(&c) == MP_OKAY); \
  |  |   61|  4.88k|  size_t max_size = 4 * size + 1; \
  |  |   62|  4.88k|  parse_input(data, size, A, &a); \
  |  |   63|  4.88k|  do {                            \
  |  |   64|  4.88k|    (void)(B);                    \
  |  |   65|  4.88k|  } while (0);
  |  |  ------------------
  |  |  |  Branch (65:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
   22|       |
   23|       |  // Make a prime of length size.
   24|  19.5k|  int count = 0;
   25|  19.5k|  mp_err res = MP_NO;
  ------------------
  |  |   41|  4.88k|#define MP_NO -1     /* no (boolean result)   */
  ------------------
   26|       |  // mpp_make_prime is so slow :( use something smaller than size.
   27|  19.5k|  int primeLen = std::max(static_cast<int>(size / 4), 3);
   28|  19.5k|  uint8_t bp[primeLen];
   29|  19.5k|  memcpy(bp, data, primeLen);
   30|  19.5k|  do {
   31|  4.88k|    bp[0] |= 0x80;            /* set high-order bit */
   32|  4.88k|    bp[primeLen - 1] |= 0x01; /* set low-order bit  */
   33|  4.88k|    ++count;
   34|  4.88k|    assert(mp_read_unsigned_octets(&b, bp, primeLen) == MP_OKAY);
   35|  4.88k|  } while ((res = mpp_make_prime(&b, primeLen * 8, PR_FALSE)) != MP_YES &&
  ------------------
  |  |  440|  4.88k|#define PR_FALSE 0
  ------------------
                } while ((res = mpp_make_prime(&b, primeLen * 8, PR_FALSE)) != MP_YES &&
  ------------------
  |  |   40|  9.76k|#define MP_YES 0     /* yes (boolean result)  */
  ------------------
  |  Branch (35:12): [True: 0, False: 4.88k]
  ------------------
   36|  4.88k|           count < 10);
  ------------------
  |  Branch (36:12): [True: 0, False: 0]
  ------------------
   37|  4.88k|  if (res != MP_YES) {
  ------------------
  |  |   40|  4.88k|#define MP_YES 0     /* yes (boolean result)  */
  ------------------
  |  Branch (37:7): [True: 0, False: 4.88k]
  ------------------
   38|      0|    return 0;
   39|      0|  }
   40|       |
   41|       |  // Use the same prime in OpenSSL B
   42|  4.88k|  char tmp[max_size];
   43|  4.88k|  mp_toradix(&b, tmp, 16);
   44|  4.88k|  int tmpLen;
   45|  4.88k|  assert((tmpLen = BN_hex2bn(&B, tmp)) != 0);
   46|       |
   47|       |  // Compare with OpenSSL invmod
   48|  4.88k|  res = mp_invmod(&a, &b, &c);
   49|  4.88k|  BIGNUM *X = BN_mod_inverse(C, A, B, ctx);
   50|  4.88k|  if (res != MP_OKAY) {
  ------------------
  |  |   39|  4.88k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (50:7): [True: 39, False: 4.84k]
  ------------------
   51|       |    // In case we couldn't compute the inverse, OpenSSL shouldn't be able to
   52|       |    // either.
   53|     39|    assert(X == nullptr);
   54|  4.84k|  } else {
   55|  4.84k|    check_equal(C, &c, max_size);
   56|       |
   57|       |    // Check a * c mod b == 1
   58|  4.84k|    assert(mp_mulmod(&a, &c, &b, &c) == MP_OKAY);
   59|  4.84k|    bool eq = mp_cmp_d(&c, 1) == 0;
   60|  4.84k|    if (!eq) {
  ------------------
  |  Branch (60:9): [True: 0, False: 4.84k]
  ------------------
   61|      0|      char cC[max_size];
   62|      0|      mp_tohex(&c, cC);
  ------------------
  |  |  294|      0|#define mp_tohex(M, S) mp_toradix((M), (S), 16)
  ------------------
   63|      0|      std::cout << "c = " << std::hex << cC << std::endl;
   64|      0|    }
   65|  4.84k|    assert(eq);
   66|  4.84k|  }
   67|       |
   68|  4.88k|  CLEANUP_AND_RETURN_THREE
  ------------------
  |  |   80|  4.88k|  mp_clear(&a);                  \
  |  |   81|  4.88k|  mp_clear(&b);                  \
  |  |   82|  4.88k|  mp_clear(&c);                  \
  |  |   83|  4.88k|  BN_CTX_end(ctx);               \
  |  |   84|  4.88k|  BN_CTX_free(ctx);              \
  |  |   85|  4.88k|  return 0;
  ------------------
   69|  4.88k|}

s_mp_mul_comba_4:
  142|      5|{
  143|      5|    mp_digit c0, c1, c2, at[8];
  144|       |
  145|      5|    memcpy(at, A->dp, 4 * sizeof(mp_digit));
  146|      5|    memcpy(at + 4, B->dp, 4 * sizeof(mp_digit));
  147|      5|    COMBA_START;
  148|       |
  149|      5|    COMBA_CLEAR;
  ------------------
  |  |   37|      5|    c0 = c1 = c2 = 0;
  ------------------
  150|       |    /* 0 */
  151|      5|    MULADD(at[0], at[4]);
  ------------------
  |  |   52|      5|    __asm__(                                        \
  |  |   53|      5|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|      5|        "mulq  %7           \n\t"                   \
  |  |   55|      5|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|      5|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|      5|        "adcq  $0,%2        \n\t"                   \
  |  |   58|      5|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|      5|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|      5|        : "%rax", "%rdx", "cc");
  ------------------
  152|      5|    COMBA_STORE(C->dp[0]);
  ------------------
  |  |   67|      5|    x = c0;
  ------------------
  153|       |    /* 1 */
  154|      5|    COMBA_FORWARD;
  ------------------
  |  |   41|      5|    do {              \
  |  |   42|      5|        c0 = c1;      \
  |  |   43|      5|        c1 = c2;      \
  |  |   44|      5|        c2 = 0;       \
  |  |   45|      5|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  155|      5|    MULADD(at[0], at[5]);
  ------------------
  |  |   52|      5|    __asm__(                                        \
  |  |   53|      5|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|      5|        "mulq  %7           \n\t"                   \
  |  |   55|      5|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|      5|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|      5|        "adcq  $0,%2        \n\t"                   \
  |  |   58|      5|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|      5|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|      5|        : "%rax", "%rdx", "cc");
  ------------------
  156|      5|    MULADD(at[1], at[4]);
  ------------------
  |  |   52|      5|    __asm__(                                        \
  |  |   53|      5|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|      5|        "mulq  %7           \n\t"                   \
  |  |   55|      5|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|      5|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|      5|        "adcq  $0,%2        \n\t"                   \
  |  |   58|      5|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|      5|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|      5|        : "%rax", "%rdx", "cc");
  ------------------
  157|      5|    COMBA_STORE(C->dp[1]);
  ------------------
  |  |   67|      5|    x = c0;
  ------------------
  158|       |    /* 2 */
  159|      5|    COMBA_FORWARD;
  ------------------
  |  |   41|      5|    do {              \
  |  |   42|      5|        c0 = c1;      \
  |  |   43|      5|        c1 = c2;      \
  |  |   44|      5|        c2 = 0;       \
  |  |   45|      5|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  160|      5|    MULADD(at[0], at[6]);
  ------------------
  |  |   52|      5|    __asm__(                                        \
  |  |   53|      5|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|      5|        "mulq  %7           \n\t"                   \
  |  |   55|      5|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|      5|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|      5|        "adcq  $0,%2        \n\t"                   \
  |  |   58|      5|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|      5|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|      5|        : "%rax", "%rdx", "cc");
  ------------------
  161|      5|    MULADD(at[1], at[5]);
  ------------------
  |  |   52|      5|    __asm__(                                        \
  |  |   53|      5|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|      5|        "mulq  %7           \n\t"                   \
  |  |   55|      5|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|      5|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|      5|        "adcq  $0,%2        \n\t"                   \
  |  |   58|      5|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|      5|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|      5|        : "%rax", "%rdx", "cc");
  ------------------
  162|      5|    MULADD(at[2], at[4]);
  ------------------
  |  |   52|      5|    __asm__(                                        \
  |  |   53|      5|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|      5|        "mulq  %7           \n\t"                   \
  |  |   55|      5|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|      5|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|      5|        "adcq  $0,%2        \n\t"                   \
  |  |   58|      5|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|      5|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|      5|        : "%rax", "%rdx", "cc");
  ------------------
  163|      5|    COMBA_STORE(C->dp[2]);
  ------------------
  |  |   67|      5|    x = c0;
  ------------------
  164|       |    /* 3 */
  165|      5|    COMBA_FORWARD;
  ------------------
  |  |   41|      5|    do {              \
  |  |   42|      5|        c0 = c1;      \
  |  |   43|      5|        c1 = c2;      \
  |  |   44|      5|        c2 = 0;       \
  |  |   45|      5|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  166|      5|    MULADD(at[0], at[7]);
  ------------------
  |  |   52|      5|    __asm__(                                        \
  |  |   53|      5|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|      5|        "mulq  %7           \n\t"                   \
  |  |   55|      5|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|      5|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|      5|        "adcq  $0,%2        \n\t"                   \
  |  |   58|      5|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|      5|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|      5|        : "%rax", "%rdx", "cc");
  ------------------
  167|      5|    MULADD(at[1], at[6]);
  ------------------
  |  |   52|      5|    __asm__(                                        \
  |  |   53|      5|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|      5|        "mulq  %7           \n\t"                   \
  |  |   55|      5|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|      5|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|      5|        "adcq  $0,%2        \n\t"                   \
  |  |   58|      5|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|      5|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|      5|        : "%rax", "%rdx", "cc");
  ------------------
  168|      5|    MULADD(at[2], at[5]);
  ------------------
  |  |   52|      5|    __asm__(                                        \
  |  |   53|      5|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|      5|        "mulq  %7           \n\t"                   \
  |  |   55|      5|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|      5|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|      5|        "adcq  $0,%2        \n\t"                   \
  |  |   58|      5|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|      5|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|      5|        : "%rax", "%rdx", "cc");
  ------------------
  169|      5|    MULADD(at[3], at[4]);
  ------------------
  |  |   52|      5|    __asm__(                                        \
  |  |   53|      5|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|      5|        "mulq  %7           \n\t"                   \
  |  |   55|      5|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|      5|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|      5|        "adcq  $0,%2        \n\t"                   \
  |  |   58|      5|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|      5|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|      5|        : "%rax", "%rdx", "cc");
  ------------------
  170|      5|    COMBA_STORE(C->dp[3]);
  ------------------
  |  |   67|      5|    x = c0;
  ------------------
  171|       |    /* 4 */
  172|      5|    COMBA_FORWARD;
  ------------------
  |  |   41|      5|    do {              \
  |  |   42|      5|        c0 = c1;      \
  |  |   43|      5|        c1 = c2;      \
  |  |   44|      5|        c2 = 0;       \
  |  |   45|      5|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  173|      5|    MULADD(at[1], at[7]);
  ------------------
  |  |   52|      5|    __asm__(                                        \
  |  |   53|      5|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|      5|        "mulq  %7           \n\t"                   \
  |  |   55|      5|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|      5|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|      5|        "adcq  $0,%2        \n\t"                   \
  |  |   58|      5|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|      5|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|      5|        : "%rax", "%rdx", "cc");
  ------------------
  174|      5|    MULADD(at[2], at[6]);
  ------------------
  |  |   52|      5|    __asm__(                                        \
  |  |   53|      5|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|      5|        "mulq  %7           \n\t"                   \
  |  |   55|      5|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|      5|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|      5|        "adcq  $0,%2        \n\t"                   \
  |  |   58|      5|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|      5|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|      5|        : "%rax", "%rdx", "cc");
  ------------------
  175|      5|    MULADD(at[3], at[5]);
  ------------------
  |  |   52|      5|    __asm__(                                        \
  |  |   53|      5|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|      5|        "mulq  %7           \n\t"                   \
  |  |   55|      5|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|      5|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|      5|        "adcq  $0,%2        \n\t"                   \
  |  |   58|      5|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|      5|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|      5|        : "%rax", "%rdx", "cc");
  ------------------
  176|      5|    COMBA_STORE(C->dp[4]);
  ------------------
  |  |   67|      5|    x = c0;
  ------------------
  177|       |    /* 5 */
  178|      5|    COMBA_FORWARD;
  ------------------
  |  |   41|      5|    do {              \
  |  |   42|      5|        c0 = c1;      \
  |  |   43|      5|        c1 = c2;      \
  |  |   44|      5|        c2 = 0;       \
  |  |   45|      5|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  179|      5|    MULADD(at[2], at[7]);
  ------------------
  |  |   52|      5|    __asm__(                                        \
  |  |   53|      5|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|      5|        "mulq  %7           \n\t"                   \
  |  |   55|      5|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|      5|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|      5|        "adcq  $0,%2        \n\t"                   \
  |  |   58|      5|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|      5|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|      5|        : "%rax", "%rdx", "cc");
  ------------------
  180|      5|    MULADD(at[3], at[6]);
  ------------------
  |  |   52|      5|    __asm__(                                        \
  |  |   53|      5|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|      5|        "mulq  %7           \n\t"                   \
  |  |   55|      5|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|      5|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|      5|        "adcq  $0,%2        \n\t"                   \
  |  |   58|      5|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|      5|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|      5|        : "%rax", "%rdx", "cc");
  ------------------
  181|      5|    COMBA_STORE(C->dp[5]);
  ------------------
  |  |   67|      5|    x = c0;
  ------------------
  182|       |    /* 6 */
  183|      5|    COMBA_FORWARD;
  ------------------
  |  |   41|      5|    do {              \
  |  |   42|      5|        c0 = c1;      \
  |  |   43|      5|        c1 = c2;      \
  |  |   44|      5|        c2 = 0;       \
  |  |   45|      5|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  184|      5|    MULADD(at[3], at[7]);
  ------------------
  |  |   52|      5|    __asm__(                                        \
  |  |   53|      5|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|      5|        "mulq  %7           \n\t"                   \
  |  |   55|      5|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|      5|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|      5|        "adcq  $0,%2        \n\t"                   \
  |  |   58|      5|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|      5|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|      5|        : "%rax", "%rdx", "cc");
  ------------------
  185|      5|    COMBA_STORE(C->dp[6]);
  ------------------
  |  |   67|      5|    x = c0;
  ------------------
  186|      5|    COMBA_STORE2(C->dp[7]);
  ------------------
  |  |   70|      5|    x = c1;
  ------------------
  187|      5|    C->used = 8;
  188|      5|    C->sign = A->sign ^ B->sign;
  189|      5|    mp_clamp(C);
  ------------------
  |  |   26|      5|    {                                                    \
  |  |   27|      7|        while ((a)->used && (a)->dp[(a)->used - 1] == 0) \
  |  |  ------------------
  |  |  |  Branch (27:16): [True: 7, False: 0]
  |  |  |  Branch (27:29): [True: 2, False: 5]
  |  |  ------------------
  |  |   28|      5|            --((a)->used);                               \
  |  |   29|      5|        (a)->sign = (a)->used ? (a)->sign : ZPOS;        \
  |  |  ------------------
  |  |  |  |  321|      0|#define ZPOS MP_ZPOS
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|      5|#define MP_ZPOS 0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (29:21): [True: 5, False: 0]
  |  |  ------------------
  |  |   30|      5|    }
  ------------------
  190|      5|    COMBA_FINI;
  191|      5|}
s_mp_mul_comba_8:
  195|     58|{
  196|     58|    mp_digit c0, c1, c2, at[16];
  197|       |
  198|     58|    memcpy(at, A->dp, 8 * sizeof(mp_digit));
  199|     58|    memcpy(at + 8, B->dp, 8 * sizeof(mp_digit));
  200|     58|    COMBA_START;
  201|       |
  202|     58|    COMBA_CLEAR;
  ------------------
  |  |   37|     58|    c0 = c1 = c2 = 0;
  ------------------
  203|       |    /* 0 */
  204|     58|    MULADD(at[0], at[8]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  205|     58|    COMBA_STORE(C->dp[0]);
  ------------------
  |  |   67|     58|    x = c0;
  ------------------
  206|       |    /* 1 */
  207|     58|    COMBA_FORWARD;
  ------------------
  |  |   41|     58|    do {              \
  |  |   42|     58|        c0 = c1;      \
  |  |   43|     58|        c1 = c2;      \
  |  |   44|     58|        c2 = 0;       \
  |  |   45|     58|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  208|     58|    MULADD(at[0], at[9]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  209|     58|    MULADD(at[1], at[8]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  210|     58|    COMBA_STORE(C->dp[1]);
  ------------------
  |  |   67|     58|    x = c0;
  ------------------
  211|       |    /* 2 */
  212|     58|    COMBA_FORWARD;
  ------------------
  |  |   41|     58|    do {              \
  |  |   42|     58|        c0 = c1;      \
  |  |   43|     58|        c1 = c2;      \
  |  |   44|     58|        c2 = 0;       \
  |  |   45|     58|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  213|     58|    MULADD(at[0], at[10]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  214|     58|    MULADD(at[1], at[9]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  215|     58|    MULADD(at[2], at[8]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  216|     58|    COMBA_STORE(C->dp[2]);
  ------------------
  |  |   67|     58|    x = c0;
  ------------------
  217|       |    /* 3 */
  218|     58|    COMBA_FORWARD;
  ------------------
  |  |   41|     58|    do {              \
  |  |   42|     58|        c0 = c1;      \
  |  |   43|     58|        c1 = c2;      \
  |  |   44|     58|        c2 = 0;       \
  |  |   45|     58|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  219|     58|    MULADD(at[0], at[11]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  220|     58|    MULADD(at[1], at[10]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  221|     58|    MULADD(at[2], at[9]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  222|     58|    MULADD(at[3], at[8]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  223|     58|    COMBA_STORE(C->dp[3]);
  ------------------
  |  |   67|     58|    x = c0;
  ------------------
  224|       |    /* 4 */
  225|     58|    COMBA_FORWARD;
  ------------------
  |  |   41|     58|    do {              \
  |  |   42|     58|        c0 = c1;      \
  |  |   43|     58|        c1 = c2;      \
  |  |   44|     58|        c2 = 0;       \
  |  |   45|     58|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  226|     58|    MULADD(at[0], at[12]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  227|     58|    MULADD(at[1], at[11]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  228|     58|    MULADD(at[2], at[10]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  229|     58|    MULADD(at[3], at[9]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  230|     58|    MULADD(at[4], at[8]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  231|     58|    COMBA_STORE(C->dp[4]);
  ------------------
  |  |   67|     58|    x = c0;
  ------------------
  232|       |    /* 5 */
  233|     58|    COMBA_FORWARD;
  ------------------
  |  |   41|     58|    do {              \
  |  |   42|     58|        c0 = c1;      \
  |  |   43|     58|        c1 = c2;      \
  |  |   44|     58|        c2 = 0;       \
  |  |   45|     58|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  234|     58|    MULADD(at[0], at[13]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  235|     58|    MULADD(at[1], at[12]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  236|     58|    MULADD(at[2], at[11]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  237|     58|    MULADD(at[3], at[10]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  238|     58|    MULADD(at[4], at[9]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  239|     58|    MULADD(at[5], at[8]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  240|     58|    COMBA_STORE(C->dp[5]);
  ------------------
  |  |   67|     58|    x = c0;
  ------------------
  241|       |    /* 6 */
  242|     58|    COMBA_FORWARD;
  ------------------
  |  |   41|     58|    do {              \
  |  |   42|     58|        c0 = c1;      \
  |  |   43|     58|        c1 = c2;      \
  |  |   44|     58|        c2 = 0;       \
  |  |   45|     58|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  243|     58|    MULADD(at[0], at[14]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  244|     58|    MULADD(at[1], at[13]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  245|     58|    MULADD(at[2], at[12]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  246|     58|    MULADD(at[3], at[11]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  247|     58|    MULADD(at[4], at[10]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  248|     58|    MULADD(at[5], at[9]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  249|     58|    MULADD(at[6], at[8]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  250|     58|    COMBA_STORE(C->dp[6]);
  ------------------
  |  |   67|     58|    x = c0;
  ------------------
  251|       |    /* 7 */
  252|     58|    COMBA_FORWARD;
  ------------------
  |  |   41|     58|    do {              \
  |  |   42|     58|        c0 = c1;      \
  |  |   43|     58|        c1 = c2;      \
  |  |   44|     58|        c2 = 0;       \
  |  |   45|     58|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  253|     58|    MULADD(at[0], at[15]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  254|     58|    MULADD(at[1], at[14]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  255|     58|    MULADD(at[2], at[13]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  256|     58|    MULADD(at[3], at[12]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  257|     58|    MULADD(at[4], at[11]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  258|     58|    MULADD(at[5], at[10]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  259|     58|    MULADD(at[6], at[9]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  260|     58|    MULADD(at[7], at[8]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  261|     58|    COMBA_STORE(C->dp[7]);
  ------------------
  |  |   67|     58|    x = c0;
  ------------------
  262|       |    /* 8 */
  263|     58|    COMBA_FORWARD;
  ------------------
  |  |   41|     58|    do {              \
  |  |   42|     58|        c0 = c1;      \
  |  |   43|     58|        c1 = c2;      \
  |  |   44|     58|        c2 = 0;       \
  |  |   45|     58|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  264|     58|    MULADD(at[1], at[15]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  265|     58|    MULADD(at[2], at[14]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  266|     58|    MULADD(at[3], at[13]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  267|     58|    MULADD(at[4], at[12]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  268|     58|    MULADD(at[5], at[11]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  269|     58|    MULADD(at[6], at[10]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  270|     58|    MULADD(at[7], at[9]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  271|     58|    COMBA_STORE(C->dp[8]);
  ------------------
  |  |   67|     58|    x = c0;
  ------------------
  272|       |    /* 9 */
  273|     58|    COMBA_FORWARD;
  ------------------
  |  |   41|     58|    do {              \
  |  |   42|     58|        c0 = c1;      \
  |  |   43|     58|        c1 = c2;      \
  |  |   44|     58|        c2 = 0;       \
  |  |   45|     58|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  274|     58|    MULADD(at[2], at[15]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  275|     58|    MULADD(at[3], at[14]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  276|     58|    MULADD(at[4], at[13]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  277|     58|    MULADD(at[5], at[12]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  278|     58|    MULADD(at[6], at[11]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  279|     58|    MULADD(at[7], at[10]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  280|     58|    COMBA_STORE(C->dp[9]);
  ------------------
  |  |   67|     58|    x = c0;
  ------------------
  281|       |    /* 10 */
  282|     58|    COMBA_FORWARD;
  ------------------
  |  |   41|     58|    do {              \
  |  |   42|     58|        c0 = c1;      \
  |  |   43|     58|        c1 = c2;      \
  |  |   44|     58|        c2 = 0;       \
  |  |   45|     58|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  283|     58|    MULADD(at[3], at[15]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  284|     58|    MULADD(at[4], at[14]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  285|     58|    MULADD(at[5], at[13]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  286|     58|    MULADD(at[6], at[12]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  287|     58|    MULADD(at[7], at[11]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  288|     58|    COMBA_STORE(C->dp[10]);
  ------------------
  |  |   67|     58|    x = c0;
  ------------------
  289|       |    /* 11 */
  290|     58|    COMBA_FORWARD;
  ------------------
  |  |   41|     58|    do {              \
  |  |   42|     58|        c0 = c1;      \
  |  |   43|     58|        c1 = c2;      \
  |  |   44|     58|        c2 = 0;       \
  |  |   45|     58|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  291|     58|    MULADD(at[4], at[15]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  292|     58|    MULADD(at[5], at[14]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  293|     58|    MULADD(at[6], at[13]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  294|     58|    MULADD(at[7], at[12]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  295|     58|    COMBA_STORE(C->dp[11]);
  ------------------
  |  |   67|     58|    x = c0;
  ------------------
  296|       |    /* 12 */
  297|     58|    COMBA_FORWARD;
  ------------------
  |  |   41|     58|    do {              \
  |  |   42|     58|        c0 = c1;      \
  |  |   43|     58|        c1 = c2;      \
  |  |   44|     58|        c2 = 0;       \
  |  |   45|     58|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  298|     58|    MULADD(at[5], at[15]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  299|     58|    MULADD(at[6], at[14]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  300|     58|    MULADD(at[7], at[13]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  301|     58|    COMBA_STORE(C->dp[12]);
  ------------------
  |  |   67|     58|    x = c0;
  ------------------
  302|       |    /* 13 */
  303|     58|    COMBA_FORWARD;
  ------------------
  |  |   41|     58|    do {              \
  |  |   42|     58|        c0 = c1;      \
  |  |   43|     58|        c1 = c2;      \
  |  |   44|     58|        c2 = 0;       \
  |  |   45|     58|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  304|     58|    MULADD(at[6], at[15]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  305|     58|    MULADD(at[7], at[14]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  306|     58|    COMBA_STORE(C->dp[13]);
  ------------------
  |  |   67|     58|    x = c0;
  ------------------
  307|       |    /* 14 */
  308|     58|    COMBA_FORWARD;
  ------------------
  |  |   41|     58|    do {              \
  |  |   42|     58|        c0 = c1;      \
  |  |   43|     58|        c1 = c2;      \
  |  |   44|     58|        c2 = 0;       \
  |  |   45|     58|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  309|     58|    MULADD(at[7], at[15]);
  ------------------
  |  |   52|     58|    __asm__(                                        \
  |  |   53|     58|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     58|        "mulq  %7           \n\t"                   \
  |  |   55|     58|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     58|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     58|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     58|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     58|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     58|        : "%rax", "%rdx", "cc");
  ------------------
  310|     58|    COMBA_STORE(C->dp[14]);
  ------------------
  |  |   67|     58|    x = c0;
  ------------------
  311|     58|    COMBA_STORE2(C->dp[15]);
  ------------------
  |  |   70|     58|    x = c1;
  ------------------
  312|     58|    C->used = 16;
  313|     58|    C->sign = A->sign ^ B->sign;
  314|     58|    mp_clamp(C);
  ------------------
  |  |   26|     58|    {                                                    \
  |  |   27|    111|        while ((a)->used && (a)->dp[(a)->used - 1] == 0) \
  |  |  ------------------
  |  |  |  Branch (27:16): [True: 111, False: 0]
  |  |  |  Branch (27:29): [True: 53, False: 58]
  |  |  ------------------
  |  |   28|     58|            --((a)->used);                               \
  |  |   29|     58|        (a)->sign = (a)->used ? (a)->sign : ZPOS;        \
  |  |  ------------------
  |  |  |  |  321|      0|#define ZPOS MP_ZPOS
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     58|#define MP_ZPOS 0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (29:21): [True: 58, False: 0]
  |  |  ------------------
  |  |   30|     58|    }
  ------------------
  315|     58|    COMBA_FINI;
  316|     58|}
s_mp_sqr_comba_4:
 1914|  7.70M|{
 1915|  7.70M|    mp_digit *a, b[8], c0, c1, c2;
 1916|       |
 1917|  7.70M|    a = A->dp;
 1918|  7.70M|    COMBA_START;
 1919|       |
 1920|       |    /* clear carries */
 1921|  7.70M|    CLEAR_CARRY;
  ------------------
  |  |   64|  7.70M|    c0 = c1 = c2 = 0;
  ------------------
 1922|       |
 1923|       |    /* output 0 */
 1924|  7.70M|    SQRADD(a[0], a[0]);
  ------------------
  |  |   82|  7.70M|    __asm__(                                \
  |  |   83|  7.70M|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  7.70M|        "mulq  %%rax        \n\t"           \
  |  |   85|  7.70M|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  7.70M|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  7.70M|        "adcq  $0,%2        \n\t"           \
  |  |   88|  7.70M|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  7.70M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  7.70M|        : "%rax", "%rdx", "cc");
  ------------------
 1925|  7.70M|    COMBA_STORE(b[0]);
  ------------------
  |  |   67|  7.70M|    x = c0;
  ------------------
 1926|       |
 1927|       |    /* output 1 */
 1928|  7.70M|    CARRY_FORWARD;
  ------------------
  |  |   73|  7.70M|    do {              \
  |  |   74|  7.70M|        c0 = c1;      \
  |  |   75|  7.70M|        c1 = c2;      \
  |  |   76|  7.70M|        c2 = 0;       \
  |  |   77|  7.70M|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1929|  7.70M|    SQRADD2(a[0], a[1]);
  ------------------
  |  |   93|  7.70M|    __asm__(                                        \
  |  |   94|  7.70M|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  7.70M|        "mulq  %7           \n\t"                   \
  |  |   96|  7.70M|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  7.70M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  7.70M|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  7.70M|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  7.70M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  7.70M|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  7.70M|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  7.70M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  7.70M|        : "%rax", "%rdx", "cc");
  ------------------
 1930|  7.70M|    COMBA_STORE(b[1]);
  ------------------
  |  |   67|  7.70M|    x = c0;
  ------------------
 1931|       |
 1932|       |    /* output 2 */
 1933|  7.70M|    CARRY_FORWARD;
  ------------------
  |  |   73|  7.70M|    do {              \
  |  |   74|  7.70M|        c0 = c1;      \
  |  |   75|  7.70M|        c1 = c2;      \
  |  |   76|  7.70M|        c2 = 0;       \
  |  |   77|  7.70M|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1934|  7.70M|    SQRADD2(a[0], a[2]);
  ------------------
  |  |   93|  7.70M|    __asm__(                                        \
  |  |   94|  7.70M|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  7.70M|        "mulq  %7           \n\t"                   \
  |  |   96|  7.70M|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  7.70M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  7.70M|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  7.70M|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  7.70M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  7.70M|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  7.70M|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  7.70M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  7.70M|        : "%rax", "%rdx", "cc");
  ------------------
 1935|  7.70M|    SQRADD(a[1], a[1]);
  ------------------
  |  |   82|  7.70M|    __asm__(                                \
  |  |   83|  7.70M|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  7.70M|        "mulq  %%rax        \n\t"           \
  |  |   85|  7.70M|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  7.70M|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  7.70M|        "adcq  $0,%2        \n\t"           \
  |  |   88|  7.70M|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  7.70M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  7.70M|        : "%rax", "%rdx", "cc");
  ------------------
 1936|  7.70M|    COMBA_STORE(b[2]);
  ------------------
  |  |   67|  7.70M|    x = c0;
  ------------------
 1937|       |
 1938|       |    /* output 3 */
 1939|  7.70M|    CARRY_FORWARD;
  ------------------
  |  |   73|  7.70M|    do {              \
  |  |   74|  7.70M|        c0 = c1;      \
  |  |   75|  7.70M|        c1 = c2;      \
  |  |   76|  7.70M|        c2 = 0;       \
  |  |   77|  7.70M|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1940|  7.70M|    SQRADD2(a[0], a[3]);
  ------------------
  |  |   93|  7.70M|    __asm__(                                        \
  |  |   94|  7.70M|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  7.70M|        "mulq  %7           \n\t"                   \
  |  |   96|  7.70M|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  7.70M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  7.70M|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  7.70M|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  7.70M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  7.70M|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  7.70M|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  7.70M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  7.70M|        : "%rax", "%rdx", "cc");
  ------------------
 1941|  7.70M|    SQRADD2(a[1], a[2]);
  ------------------
  |  |   93|  7.70M|    __asm__(                                        \
  |  |   94|  7.70M|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  7.70M|        "mulq  %7           \n\t"                   \
  |  |   96|  7.70M|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  7.70M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  7.70M|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  7.70M|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  7.70M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  7.70M|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  7.70M|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  7.70M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  7.70M|        : "%rax", "%rdx", "cc");
  ------------------
 1942|  7.70M|    COMBA_STORE(b[3]);
  ------------------
  |  |   67|  7.70M|    x = c0;
  ------------------
 1943|       |
 1944|       |    /* output 4 */
 1945|  7.70M|    CARRY_FORWARD;
  ------------------
  |  |   73|  7.70M|    do {              \
  |  |   74|  7.70M|        c0 = c1;      \
  |  |   75|  7.70M|        c1 = c2;      \
  |  |   76|  7.70M|        c2 = 0;       \
  |  |   77|  7.70M|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1946|  7.70M|    SQRADD2(a[1], a[3]);
  ------------------
  |  |   93|  7.70M|    __asm__(                                        \
  |  |   94|  7.70M|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  7.70M|        "mulq  %7           \n\t"                   \
  |  |   96|  7.70M|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  7.70M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  7.70M|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  7.70M|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  7.70M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  7.70M|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  7.70M|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  7.70M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  7.70M|        : "%rax", "%rdx", "cc");
  ------------------
 1947|  7.70M|    SQRADD(a[2], a[2]);
  ------------------
  |  |   82|  7.70M|    __asm__(                                \
  |  |   83|  7.70M|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  7.70M|        "mulq  %%rax        \n\t"           \
  |  |   85|  7.70M|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  7.70M|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  7.70M|        "adcq  $0,%2        \n\t"           \
  |  |   88|  7.70M|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  7.70M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  7.70M|        : "%rax", "%rdx", "cc");
  ------------------
 1948|  7.70M|    COMBA_STORE(b[4]);
  ------------------
  |  |   67|  7.70M|    x = c0;
  ------------------
 1949|       |
 1950|       |    /* output 5 */
 1951|  7.70M|    CARRY_FORWARD;
  ------------------
  |  |   73|  7.70M|    do {              \
  |  |   74|  7.70M|        c0 = c1;      \
  |  |   75|  7.70M|        c1 = c2;      \
  |  |   76|  7.70M|        c2 = 0;       \
  |  |   77|  7.70M|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1952|  7.70M|    SQRADD2(a[2], a[3]);
  ------------------
  |  |   93|  7.70M|    __asm__(                                        \
  |  |   94|  7.70M|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  7.70M|        "mulq  %7           \n\t"                   \
  |  |   96|  7.70M|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  7.70M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  7.70M|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  7.70M|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  7.70M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  7.70M|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  7.70M|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  7.70M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  7.70M|        : "%rax", "%rdx", "cc");
  ------------------
 1953|  7.70M|    COMBA_STORE(b[5]);
  ------------------
  |  |   67|  7.70M|    x = c0;
  ------------------
 1954|       |
 1955|       |    /* output 6 */
 1956|  7.70M|    CARRY_FORWARD;
  ------------------
  |  |   73|  7.70M|    do {              \
  |  |   74|  7.70M|        c0 = c1;      \
  |  |   75|  7.70M|        c1 = c2;      \
  |  |   76|  7.70M|        c2 = 0;       \
  |  |   77|  7.70M|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1957|  7.70M|    SQRADD(a[3], a[3]);
  ------------------
  |  |   82|  7.70M|    __asm__(                                \
  |  |   83|  7.70M|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  7.70M|        "mulq  %%rax        \n\t"           \
  |  |   85|  7.70M|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  7.70M|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  7.70M|        "adcq  $0,%2        \n\t"           \
  |  |   88|  7.70M|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  7.70M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  7.70M|        : "%rax", "%rdx", "cc");
  ------------------
 1958|  7.70M|    COMBA_STORE(b[6]);
  ------------------
  |  |   67|  7.70M|    x = c0;
  ------------------
 1959|  7.70M|    COMBA_STORE2(b[7]);
  ------------------
  |  |   70|  7.70M|    x = c1;
  ------------------
 1960|  7.70M|    COMBA_FINI;
 1961|       |
 1962|  7.70M|    B->used = 8;
 1963|  7.70M|    B->sign = ZPOS;
  ------------------
  |  |  321|  7.70M|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  7.70M|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 1964|  7.70M|    memcpy(B->dp, b, 8 * sizeof(mp_digit));
 1965|  7.70M|    mp_clamp(B);
  ------------------
  |  |   26|  7.70M|    {                                                    \
  |  |   27|  11.8M|        while ((a)->used && (a)->dp[(a)->used - 1] == 0) \
  |  |  ------------------
  |  |  |  Branch (27:16): [True: 11.8M, False: 0]
  |  |  |  Branch (27:29): [True: 4.10M, False: 7.70M]
  |  |  ------------------
  |  |   28|  7.70M|            --((a)->used);                               \
  |  |   29|  7.70M|        (a)->sign = (a)->used ? (a)->sign : ZPOS;        \
  |  |  ------------------
  |  |  |  |  321|      0|#define ZPOS MP_ZPOS
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  7.70M|#define MP_ZPOS 0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (29:21): [True: 7.70M, False: 0]
  |  |  ------------------
  |  |   30|  7.70M|    }
  ------------------
 1966|  7.70M|}
s_mp_sqr_comba_8:
 1970|  1.58M|{
 1971|  1.58M|    mp_digit *a, b[16], c0, c1, c2, sc0, sc1, sc2;
 1972|       |
 1973|  1.58M|    a = A->dp;
 1974|  1.58M|    COMBA_START;
 1975|       |
 1976|       |    /* clear carries */
 1977|  1.58M|    CLEAR_CARRY;
  ------------------
  |  |   64|  1.58M|    c0 = c1 = c2 = 0;
  ------------------
 1978|       |
 1979|       |    /* output 0 */
 1980|  1.58M|    SQRADD(a[0], a[0]);
  ------------------
  |  |   82|  1.58M|    __asm__(                                \
  |  |   83|  1.58M|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  1.58M|        "mulq  %%rax        \n\t"           \
  |  |   85|  1.58M|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  1.58M|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  1.58M|        "adcq  $0,%2        \n\t"           \
  |  |   88|  1.58M|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 1981|  1.58M|    COMBA_STORE(b[0]);
  ------------------
  |  |   67|  1.58M|    x = c0;
  ------------------
 1982|       |
 1983|       |    /* output 1 */
 1984|  1.58M|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.58M|    do {              \
  |  |   74|  1.58M|        c0 = c1;      \
  |  |   75|  1.58M|        c1 = c2;      \
  |  |   76|  1.58M|        c2 = 0;       \
  |  |   77|  1.58M|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1985|  1.58M|    SQRADD2(a[0], a[1]);
  ------------------
  |  |   93|  1.58M|    __asm__(                                        \
  |  |   94|  1.58M|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.58M|        "mulq  %7           \n\t"                   \
  |  |   96|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.58M|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 1986|  1.58M|    COMBA_STORE(b[1]);
  ------------------
  |  |   67|  1.58M|    x = c0;
  ------------------
 1987|       |
 1988|       |    /* output 2 */
 1989|  1.58M|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.58M|    do {              \
  |  |   74|  1.58M|        c0 = c1;      \
  |  |   75|  1.58M|        c1 = c2;      \
  |  |   76|  1.58M|        c2 = 0;       \
  |  |   77|  1.58M|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1990|  1.58M|    SQRADD2(a[0], a[2]);
  ------------------
  |  |   93|  1.58M|    __asm__(                                        \
  |  |   94|  1.58M|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.58M|        "mulq  %7           \n\t"                   \
  |  |   96|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.58M|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 1991|  1.58M|    SQRADD(a[1], a[1]);
  ------------------
  |  |   82|  1.58M|    __asm__(                                \
  |  |   83|  1.58M|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  1.58M|        "mulq  %%rax        \n\t"           \
  |  |   85|  1.58M|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  1.58M|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  1.58M|        "adcq  $0,%2        \n\t"           \
  |  |   88|  1.58M|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 1992|  1.58M|    COMBA_STORE(b[2]);
  ------------------
  |  |   67|  1.58M|    x = c0;
  ------------------
 1993|       |
 1994|       |    /* output 3 */
 1995|  1.58M|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.58M|    do {              \
  |  |   74|  1.58M|        c0 = c1;      \
  |  |   75|  1.58M|        c1 = c2;      \
  |  |   76|  1.58M|        c2 = 0;       \
  |  |   77|  1.58M|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1996|  1.58M|    SQRADD2(a[0], a[3]);
  ------------------
  |  |   93|  1.58M|    __asm__(                                        \
  |  |   94|  1.58M|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.58M|        "mulq  %7           \n\t"                   \
  |  |   96|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.58M|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 1997|  1.58M|    SQRADD2(a[1], a[2]);
  ------------------
  |  |   93|  1.58M|    __asm__(                                        \
  |  |   94|  1.58M|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.58M|        "mulq  %7           \n\t"                   \
  |  |   96|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.58M|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 1998|  1.58M|    COMBA_STORE(b[3]);
  ------------------
  |  |   67|  1.58M|    x = c0;
  ------------------
 1999|       |
 2000|       |    /* output 4 */
 2001|  1.58M|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.58M|    do {              \
  |  |   74|  1.58M|        c0 = c1;      \
  |  |   75|  1.58M|        c1 = c2;      \
  |  |   76|  1.58M|        c2 = 0;       \
  |  |   77|  1.58M|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2002|  1.58M|    SQRADD2(a[0], a[4]);
  ------------------
  |  |   93|  1.58M|    __asm__(                                        \
  |  |   94|  1.58M|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.58M|        "mulq  %7           \n\t"                   \
  |  |   96|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.58M|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2003|  1.58M|    SQRADD2(a[1], a[3]);
  ------------------
  |  |   93|  1.58M|    __asm__(                                        \
  |  |   94|  1.58M|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.58M|        "mulq  %7           \n\t"                   \
  |  |   96|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.58M|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2004|  1.58M|    SQRADD(a[2], a[2]);
  ------------------
  |  |   82|  1.58M|    __asm__(                                \
  |  |   83|  1.58M|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  1.58M|        "mulq  %%rax        \n\t"           \
  |  |   85|  1.58M|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  1.58M|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  1.58M|        "adcq  $0,%2        \n\t"           \
  |  |   88|  1.58M|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2005|  1.58M|    COMBA_STORE(b[4]);
  ------------------
  |  |   67|  1.58M|    x = c0;
  ------------------
 2006|       |
 2007|       |    /* output 5 */
 2008|  1.58M|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.58M|    do {              \
  |  |   74|  1.58M|        c0 = c1;      \
  |  |   75|  1.58M|        c1 = c2;      \
  |  |   76|  1.58M|        c2 = 0;       \
  |  |   77|  1.58M|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2009|  1.58M|    SQRADDSC(a[0], a[5]);
  ------------------
  |  |  107|  1.58M|    __asm__(                              \
  |  |  108|  1.58M|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  1.58M|        "mulq  %4           \n\t"         \
  |  |  110|  1.58M|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  1.58M|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  1.58M|        "xorq  %2,%2        \n\t"         \
  |  |  113|  1.58M|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  1.58M|        : "g"(i), "g"(j)                  \
  |  |  115|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2010|  1.58M|    SQRADDAC(a[1], a[4]);
  ------------------
  |  |  118|  1.58M|    __asm__(                                           \
  |  |  119|  1.58M|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  1.58M|        "mulq  %7           \n\t"                      \
  |  |  121|  1.58M|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  1.58M|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  1.58M|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  1.58M|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  1.58M|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2011|  1.58M|    SQRADDAC(a[2], a[3]);
  ------------------
  |  |  118|  1.58M|    __asm__(                                           \
  |  |  119|  1.58M|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  1.58M|        "mulq  %7           \n\t"                      \
  |  |  121|  1.58M|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  1.58M|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  1.58M|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  1.58M|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  1.58M|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2012|  1.58M|    SQRADDDB;
  ------------------
  |  |  129|  1.58M|    __asm__(                                                      \
  |  |  130|  1.58M|        "addq %6,%0         \n\t"                                 \
  |  |  131|  1.58M|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  1.58M|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  1.58M|        "addq %6,%0         \n\t"                                 \
  |  |  134|  1.58M|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  1.58M|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  1.58M|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  1.58M|        : "cc");
  ------------------
 2013|  1.58M|    COMBA_STORE(b[5]);
  ------------------
  |  |   67|  1.58M|    x = c0;
  ------------------
 2014|       |
 2015|       |    /* output 6 */
 2016|  1.58M|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.58M|    do {              \
  |  |   74|  1.58M|        c0 = c1;      \
  |  |   75|  1.58M|        c1 = c2;      \
  |  |   76|  1.58M|        c2 = 0;       \
  |  |   77|  1.58M|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2017|  1.58M|    SQRADDSC(a[0], a[6]);
  ------------------
  |  |  107|  1.58M|    __asm__(                              \
  |  |  108|  1.58M|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  1.58M|        "mulq  %4           \n\t"         \
  |  |  110|  1.58M|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  1.58M|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  1.58M|        "xorq  %2,%2        \n\t"         \
  |  |  113|  1.58M|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  1.58M|        : "g"(i), "g"(j)                  \
  |  |  115|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2018|  1.58M|    SQRADDAC(a[1], a[5]);
  ------------------
  |  |  118|  1.58M|    __asm__(                                           \
  |  |  119|  1.58M|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  1.58M|        "mulq  %7           \n\t"                      \
  |  |  121|  1.58M|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  1.58M|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  1.58M|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  1.58M|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  1.58M|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2019|  1.58M|    SQRADDAC(a[2], a[4]);
  ------------------
  |  |  118|  1.58M|    __asm__(                                           \
  |  |  119|  1.58M|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  1.58M|        "mulq  %7           \n\t"                      \
  |  |  121|  1.58M|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  1.58M|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  1.58M|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  1.58M|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  1.58M|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2020|  1.58M|    SQRADDDB;
  ------------------
  |  |  129|  1.58M|    __asm__(                                                      \
  |  |  130|  1.58M|        "addq %6,%0         \n\t"                                 \
  |  |  131|  1.58M|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  1.58M|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  1.58M|        "addq %6,%0         \n\t"                                 \
  |  |  134|  1.58M|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  1.58M|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  1.58M|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  1.58M|        : "cc");
  ------------------
 2021|  1.58M|    SQRADD(a[3], a[3]);
  ------------------
  |  |   82|  1.58M|    __asm__(                                \
  |  |   83|  1.58M|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  1.58M|        "mulq  %%rax        \n\t"           \
  |  |   85|  1.58M|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  1.58M|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  1.58M|        "adcq  $0,%2        \n\t"           \
  |  |   88|  1.58M|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2022|  1.58M|    COMBA_STORE(b[6]);
  ------------------
  |  |   67|  1.58M|    x = c0;
  ------------------
 2023|       |
 2024|       |    /* output 7 */
 2025|  1.58M|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.58M|    do {              \
  |  |   74|  1.58M|        c0 = c1;      \
  |  |   75|  1.58M|        c1 = c2;      \
  |  |   76|  1.58M|        c2 = 0;       \
  |  |   77|  1.58M|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2026|  1.58M|    SQRADDSC(a[0], a[7]);
  ------------------
  |  |  107|  1.58M|    __asm__(                              \
  |  |  108|  1.58M|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  1.58M|        "mulq  %4           \n\t"         \
  |  |  110|  1.58M|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  1.58M|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  1.58M|        "xorq  %2,%2        \n\t"         \
  |  |  113|  1.58M|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  1.58M|        : "g"(i), "g"(j)                  \
  |  |  115|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2027|  1.58M|    SQRADDAC(a[1], a[6]);
  ------------------
  |  |  118|  1.58M|    __asm__(                                           \
  |  |  119|  1.58M|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  1.58M|        "mulq  %7           \n\t"                      \
  |  |  121|  1.58M|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  1.58M|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  1.58M|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  1.58M|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  1.58M|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2028|  1.58M|    SQRADDAC(a[2], a[5]);
  ------------------
  |  |  118|  1.58M|    __asm__(                                           \
  |  |  119|  1.58M|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  1.58M|        "mulq  %7           \n\t"                      \
  |  |  121|  1.58M|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  1.58M|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  1.58M|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  1.58M|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  1.58M|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2029|  1.58M|    SQRADDAC(a[3], a[4]);
  ------------------
  |  |  118|  1.58M|    __asm__(                                           \
  |  |  119|  1.58M|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  1.58M|        "mulq  %7           \n\t"                      \
  |  |  121|  1.58M|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  1.58M|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  1.58M|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  1.58M|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  1.58M|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2030|  1.58M|    SQRADDDB;
  ------------------
  |  |  129|  1.58M|    __asm__(                                                      \
  |  |  130|  1.58M|        "addq %6,%0         \n\t"                                 \
  |  |  131|  1.58M|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  1.58M|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  1.58M|        "addq %6,%0         \n\t"                                 \
  |  |  134|  1.58M|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  1.58M|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  1.58M|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  1.58M|        : "cc");
  ------------------
 2031|  1.58M|    COMBA_STORE(b[7]);
  ------------------
  |  |   67|  1.58M|    x = c0;
  ------------------
 2032|       |
 2033|       |    /* output 8 */
 2034|  1.58M|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.58M|    do {              \
  |  |   74|  1.58M|        c0 = c1;      \
  |  |   75|  1.58M|        c1 = c2;      \
  |  |   76|  1.58M|        c2 = 0;       \
  |  |   77|  1.58M|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2035|  1.58M|    SQRADDSC(a[1], a[7]);
  ------------------
  |  |  107|  1.58M|    __asm__(                              \
  |  |  108|  1.58M|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  1.58M|        "mulq  %4           \n\t"         \
  |  |  110|  1.58M|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  1.58M|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  1.58M|        "xorq  %2,%2        \n\t"         \
  |  |  113|  1.58M|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  1.58M|        : "g"(i), "g"(j)                  \
  |  |  115|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2036|  1.58M|    SQRADDAC(a[2], a[6]);
  ------------------
  |  |  118|  1.58M|    __asm__(                                           \
  |  |  119|  1.58M|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  1.58M|        "mulq  %7           \n\t"                      \
  |  |  121|  1.58M|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  1.58M|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  1.58M|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  1.58M|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  1.58M|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2037|  1.58M|    SQRADDAC(a[3], a[5]);
  ------------------
  |  |  118|  1.58M|    __asm__(                                           \
  |  |  119|  1.58M|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  1.58M|        "mulq  %7           \n\t"                      \
  |  |  121|  1.58M|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  1.58M|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  1.58M|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  1.58M|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  1.58M|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2038|  1.58M|    SQRADDDB;
  ------------------
  |  |  129|  1.58M|    __asm__(                                                      \
  |  |  130|  1.58M|        "addq %6,%0         \n\t"                                 \
  |  |  131|  1.58M|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  1.58M|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  1.58M|        "addq %6,%0         \n\t"                                 \
  |  |  134|  1.58M|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  1.58M|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  1.58M|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  1.58M|        : "cc");
  ------------------
 2039|  1.58M|    SQRADD(a[4], a[4]);
  ------------------
  |  |   82|  1.58M|    __asm__(                                \
  |  |   83|  1.58M|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  1.58M|        "mulq  %%rax        \n\t"           \
  |  |   85|  1.58M|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  1.58M|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  1.58M|        "adcq  $0,%2        \n\t"           \
  |  |   88|  1.58M|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2040|  1.58M|    COMBA_STORE(b[8]);
  ------------------
  |  |   67|  1.58M|    x = c0;
  ------------------
 2041|       |
 2042|       |    /* output 9 */
 2043|  1.58M|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.58M|    do {              \
  |  |   74|  1.58M|        c0 = c1;      \
  |  |   75|  1.58M|        c1 = c2;      \
  |  |   76|  1.58M|        c2 = 0;       \
  |  |   77|  1.58M|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2044|  1.58M|    SQRADDSC(a[2], a[7]);
  ------------------
  |  |  107|  1.58M|    __asm__(                              \
  |  |  108|  1.58M|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  1.58M|        "mulq  %4           \n\t"         \
  |  |  110|  1.58M|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  1.58M|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  1.58M|        "xorq  %2,%2        \n\t"         \
  |  |  113|  1.58M|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  1.58M|        : "g"(i), "g"(j)                  \
  |  |  115|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2045|  1.58M|    SQRADDAC(a[3], a[6]);
  ------------------
  |  |  118|  1.58M|    __asm__(                                           \
  |  |  119|  1.58M|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  1.58M|        "mulq  %7           \n\t"                      \
  |  |  121|  1.58M|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  1.58M|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  1.58M|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  1.58M|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  1.58M|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2046|  1.58M|    SQRADDAC(a[4], a[5]);
  ------------------
  |  |  118|  1.58M|    __asm__(                                           \
  |  |  119|  1.58M|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  1.58M|        "mulq  %7           \n\t"                      \
  |  |  121|  1.58M|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  1.58M|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  1.58M|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  1.58M|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  1.58M|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2047|  1.58M|    SQRADDDB;
  ------------------
  |  |  129|  1.58M|    __asm__(                                                      \
  |  |  130|  1.58M|        "addq %6,%0         \n\t"                                 \
  |  |  131|  1.58M|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  1.58M|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  1.58M|        "addq %6,%0         \n\t"                                 \
  |  |  134|  1.58M|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  1.58M|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  1.58M|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  1.58M|        : "cc");
  ------------------
 2048|  1.58M|    COMBA_STORE(b[9]);
  ------------------
  |  |   67|  1.58M|    x = c0;
  ------------------
 2049|       |
 2050|       |    /* output 10 */
 2051|  1.58M|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.58M|    do {              \
  |  |   74|  1.58M|        c0 = c1;      \
  |  |   75|  1.58M|        c1 = c2;      \
  |  |   76|  1.58M|        c2 = 0;       \
  |  |   77|  1.58M|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2052|  1.58M|    SQRADD2(a[3], a[7]);
  ------------------
  |  |   93|  1.58M|    __asm__(                                        \
  |  |   94|  1.58M|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.58M|        "mulq  %7           \n\t"                   \
  |  |   96|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.58M|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2053|  1.58M|    SQRADD2(a[4], a[6]);
  ------------------
  |  |   93|  1.58M|    __asm__(                                        \
  |  |   94|  1.58M|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.58M|        "mulq  %7           \n\t"                   \
  |  |   96|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.58M|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2054|  1.58M|    SQRADD(a[5], a[5]);
  ------------------
  |  |   82|  1.58M|    __asm__(                                \
  |  |   83|  1.58M|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  1.58M|        "mulq  %%rax        \n\t"           \
  |  |   85|  1.58M|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  1.58M|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  1.58M|        "adcq  $0,%2        \n\t"           \
  |  |   88|  1.58M|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2055|  1.58M|    COMBA_STORE(b[10]);
  ------------------
  |  |   67|  1.58M|    x = c0;
  ------------------
 2056|       |
 2057|       |    /* output 11 */
 2058|  1.58M|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.58M|    do {              \
  |  |   74|  1.58M|        c0 = c1;      \
  |  |   75|  1.58M|        c1 = c2;      \
  |  |   76|  1.58M|        c2 = 0;       \
  |  |   77|  1.58M|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2059|  1.58M|    SQRADD2(a[4], a[7]);
  ------------------
  |  |   93|  1.58M|    __asm__(                                        \
  |  |   94|  1.58M|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.58M|        "mulq  %7           \n\t"                   \
  |  |   96|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.58M|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2060|  1.58M|    SQRADD2(a[5], a[6]);
  ------------------
  |  |   93|  1.58M|    __asm__(                                        \
  |  |   94|  1.58M|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.58M|        "mulq  %7           \n\t"                   \
  |  |   96|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.58M|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2061|  1.58M|    COMBA_STORE(b[11]);
  ------------------
  |  |   67|  1.58M|    x = c0;
  ------------------
 2062|       |
 2063|       |    /* output 12 */
 2064|  1.58M|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.58M|    do {              \
  |  |   74|  1.58M|        c0 = c1;      \
  |  |   75|  1.58M|        c1 = c2;      \
  |  |   76|  1.58M|        c2 = 0;       \
  |  |   77|  1.58M|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2065|  1.58M|    SQRADD2(a[5], a[7]);
  ------------------
  |  |   93|  1.58M|    __asm__(                                        \
  |  |   94|  1.58M|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.58M|        "mulq  %7           \n\t"                   \
  |  |   96|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.58M|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2066|  1.58M|    SQRADD(a[6], a[6]);
  ------------------
  |  |   82|  1.58M|    __asm__(                                \
  |  |   83|  1.58M|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  1.58M|        "mulq  %%rax        \n\t"           \
  |  |   85|  1.58M|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  1.58M|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  1.58M|        "adcq  $0,%2        \n\t"           \
  |  |   88|  1.58M|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2067|  1.58M|    COMBA_STORE(b[12]);
  ------------------
  |  |   67|  1.58M|    x = c0;
  ------------------
 2068|       |
 2069|       |    /* output 13 */
 2070|  1.58M|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.58M|    do {              \
  |  |   74|  1.58M|        c0 = c1;      \
  |  |   75|  1.58M|        c1 = c2;      \
  |  |   76|  1.58M|        c2 = 0;       \
  |  |   77|  1.58M|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2071|  1.58M|    SQRADD2(a[6], a[7]);
  ------------------
  |  |   93|  1.58M|    __asm__(                                        \
  |  |   94|  1.58M|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.58M|        "mulq  %7           \n\t"                   \
  |  |   96|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.58M|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.58M|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.58M|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.58M|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2072|  1.58M|    COMBA_STORE(b[13]);
  ------------------
  |  |   67|  1.58M|    x = c0;
  ------------------
 2073|       |
 2074|       |    /* output 14 */
 2075|  1.58M|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.58M|    do {              \
  |  |   74|  1.58M|        c0 = c1;      \
  |  |   75|  1.58M|        c1 = c2;      \
  |  |   76|  1.58M|        c2 = 0;       \
  |  |   77|  1.58M|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2076|  1.58M|    SQRADD(a[7], a[7]);
  ------------------
  |  |   82|  1.58M|    __asm__(                                \
  |  |   83|  1.58M|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  1.58M|        "mulq  %%rax        \n\t"           \
  |  |   85|  1.58M|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  1.58M|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  1.58M|        "adcq  $0,%2        \n\t"           \
  |  |   88|  1.58M|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  1.58M|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  1.58M|        : "%rax", "%rdx", "cc");
  ------------------
 2077|  1.58M|    COMBA_STORE(b[14]);
  ------------------
  |  |   67|  1.58M|    x = c0;
  ------------------
 2078|  1.58M|    COMBA_STORE2(b[15]);
  ------------------
  |  |   70|  1.58M|    x = c1;
  ------------------
 2079|  1.58M|    COMBA_FINI;
 2080|       |
 2081|  1.58M|    B->used = 16;
 2082|  1.58M|    B->sign = ZPOS;
  ------------------
  |  |  321|  1.58M|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  1.58M|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 2083|  1.58M|    memcpy(B->dp, b, 16 * sizeof(mp_digit));
 2084|  1.58M|    mp_clamp(B);
  ------------------
  |  |   26|  1.58M|    {                                                    \
  |  |   27|  2.79M|        while ((a)->used && (a)->dp[(a)->used - 1] == 0) \
  |  |  ------------------
  |  |  |  Branch (27:16): [True: 2.79M, False: 0]
  |  |  |  Branch (27:29): [True: 1.20M, False: 1.58M]
  |  |  ------------------
  |  |   28|  1.58M|            --((a)->used);                               \
  |  |   29|  1.58M|        (a)->sign = (a)->used ? (a)->sign : ZPOS;        \
  |  |  ------------------
  |  |  |  |  321|      0|#define ZPOS MP_ZPOS
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  1.58M|#define MP_ZPOS 0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (29:21): [True: 1.58M, False: 0]
  |  |  ------------------
  |  |   30|  1.58M|    }
  ------------------
 2085|  1.58M|}

freebl_cpuid:
   41|      3|{
   42|      3|    __asm__("xor %%ecx, %%ecx\n\t"
   43|      3|            "cpuid\n\t"
   44|      3|            : "=a"(*eax),
   45|      3|              "=b"(*ebx),
   46|      3|              "=c"(*ecx),
   47|      3|              "=d"(*edx)
   48|      3|            : "0"(op));
   49|      3|}
s_mpi_getProcessorLineSize:
  653|      1|{
  654|      1|    unsigned long eax, ebx, ecx, edx;
  655|      1|    PRUint32 cpuid[3];
  656|      1|    unsigned long cpuidLevel;
  657|      1|    unsigned long cacheLineSize = 0;
  658|      1|    int manufacturer = MAN_UNKNOWN;
  ------------------
  |  |  627|      1|#define MAN_UNKNOWN 9
  ------------------
  659|      1|    int i;
  660|      1|    char string[13];
  661|       |
  662|       |#if !defined(AMD_64)
  663|       |    if (is386()) {
  664|       |        return 0; /* 386 had no cache */
  665|       |    }
  666|       |    if (is486()) {
  667|       |        return 32; /* really? need more info */
  668|       |    }
  669|       |#endif
  670|       |
  671|       |    /* Pentium, cpuid command is available */
  672|      1|    freebl_cpuid(0, &eax, &ebx, &ecx, &edx);
  673|      1|    cpuidLevel = eax;
  674|       |    /* string holds the CPU's manufacturer ID string - a twelve
  675|       |     * character ASCII string stored in ebx, edx, ecx, and
  676|       |     * the 32-bit extended feature flags are in edx, ecx.
  677|       |     */
  678|      1|    cpuid[0] = ebx;
  679|      1|    cpuid[1] = ecx;
  680|      1|    cpuid[2] = edx;
  681|      1|    memcpy(string, cpuid, sizeof(cpuid));
  682|      1|    string[12] = 0;
  683|       |
  684|      1|    manufacturer = MAN_UNKNOWN;
  ------------------
  |  |  627|      1|#define MAN_UNKNOWN 9
  ------------------
  685|     11|    for (i = 0; i < n_manufacturers; i++) {
  ------------------
  |  Branch (685:17): [True: 10, False: 1]
  ------------------
  686|     10|        if (strcmp(manMap[i], string) == 0) {
  ------------------
  |  Branch (686:13): [True: 0, False: 10]
  ------------------
  687|      0|            manufacturer = i;
  688|      0|        }
  689|     10|    }
  690|       |
  691|      1|    if (manufacturer == INTEL) {
  ------------------
  |  |  603|      1|#define INTEL 0
  ------------------
  |  Branch (691:9): [True: 0, False: 1]
  ------------------
  692|      0|        cacheLineSize = getIntelCacheLineSize(cpuidLevel);
  693|      1|    } else {
  694|      1|        cacheLineSize = getOtherCacheLineSize(cpuidLevel);
  695|      1|    }
  696|       |    /* doesn't support cache info based on cpuid. This means
  697|       |     * an old pentium class processor, which have cache lines of
  698|       |     * 32. If we learn differently, we can use a switch based on
  699|       |     * the Manufacturer id  */
  700|      1|    if (cacheLineSize == 0) {
  ------------------
  |  Branch (700:9): [True: 1, False: 0]
  ------------------
  701|      1|        cacheLineSize = 32;
  702|      1|    }
  703|      1|    return cacheLineSize;
  704|      1|}
mpcpucache.c:getOtherCacheLineSize:
  587|      1|{
  588|      1|    unsigned long lineSize = 0;
  589|      1|    unsigned long eax, ebx, ecx, edx;
  590|       |
  591|       |    /* get the Extended CPUID level */
  592|      1|    freebl_cpuid(0x80000000, &eax, &ebx, &ecx, &edx);
  593|      1|    cpuidLevel = eax;
  594|       |
  595|      1|    if (cpuidLevel >= 0x80000005) {
  ------------------
  |  Branch (595:9): [True: 1, False: 0]
  ------------------
  596|      1|        freebl_cpuid(0x80000005, &eax, &ebx, &ecx, &edx);
  597|      1|        lineSize = ecx & 0xff; /* line Size, L1 Data Cache */
  598|      1|    }
  599|      1|    return lineSize;
  600|      1|}

mp_init:
  121|   106k|{
  122|   106k|    return mp_init_size(mp, s_mp_defprec);
  123|       |
  124|   106k|} /* end mp_init() */
mp_init_size:
  140|  28.3M|{
  141|  28.3M|    ARGCHK(mp != NULL && prec > 0, MP_BADARG);
  ------------------
  |  |  350|  28.3M|#define ARGCHK(X, Y) assert(X)
  ------------------
  142|       |
  143|  28.3M|    prec = MP_ROUNDUP(prec, s_mp_defprec);
  ------------------
  |  |   89|  28.3M|#define MP_ROUNDUP(a, b) (MP_HOWMANY(a, b) * (b))
  |  |  ------------------
  |  |  |  |   88|  28.3M|#define MP_HOWMANY(a, b) (((a) + (b)-1) / (b))
  |  |  ------------------
  ------------------
  144|  28.3M|    if ((DIGITS(mp) = s_mp_alloc(prec, sizeof(mp_digit))) == NULL)
  ------------------
  |  |  330|  28.3M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|  28.3M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
  |  Branch (144:9): [True: 0, False: 28.3M]
  ------------------
  145|      0|        return MP_MEM;
  ------------------
  |  |   42|      0|#define MP_MEM -2    /* out of memory         */
  ------------------
  146|       |
  147|  28.3M|    SIGN(mp) = ZPOS;
  ------------------
  |  |  327|  28.3M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  28.3M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  SIGN(mp) = ZPOS;
  ------------------
  |  |  321|  28.3M|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  28.3M|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
  148|  28.3M|    USED(mp) = 1;
  ------------------
  |  |  328|  28.3M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  28.3M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  149|  28.3M|    ALLOC(mp) = prec;
  ------------------
  |  |  329|  28.3M|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  146|  28.3M|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  150|       |
  151|  28.3M|    return MP_OKAY;
  ------------------
  |  |   39|  28.3M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  152|       |
  153|  28.3M|} /* end mp_init_size() */
mp_init_copy:
  169|  62.2M|{
  170|  62.2M|    ARGCHK(mp != NULL && from != NULL, MP_BADARG);
  ------------------
  |  |  350|  62.2M|#define ARGCHK(X, Y) assert(X)
  ------------------
  171|       |
  172|  62.2M|    if (mp == from)
  ------------------
  |  Branch (172:9): [True: 0, False: 62.2M]
  ------------------
  173|      0|        return MP_OKAY;
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  174|       |
  175|  62.2M|    if ((DIGITS(mp) = s_mp_alloc(ALLOC(from), sizeof(mp_digit))) == NULL)
  ------------------
  |  |  330|  62.2M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|  62.2M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                  if ((DIGITS(mp) = s_mp_alloc(ALLOC(from), sizeof(mp_digit))) == NULL)
  ------------------
  |  |  329|  62.2M|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  146|  62.2M|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  |  Branch (175:9): [True: 0, False: 62.2M]
  ------------------
  176|      0|        return MP_MEM;
  ------------------
  |  |   42|      0|#define MP_MEM -2    /* out of memory         */
  ------------------
  177|       |
  178|  62.2M|    s_mp_copy(DIGITS(from), DIGITS(mp), USED(from));
  ------------------
  |  |  330|  62.2M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|  62.2M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                  s_mp_copy(DIGITS(from), DIGITS(mp), USED(from));
  ------------------
  |  |  330|  62.2M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|  62.2M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                  s_mp_copy(DIGITS(from), DIGITS(mp), USED(from));
  ------------------
  |  |  328|  62.2M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  62.2M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  179|  62.2M|    USED(mp) = USED(from);
  ------------------
  |  |  328|  62.2M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  62.2M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                  USED(mp) = USED(from);
  ------------------
  |  |  328|  62.2M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  62.2M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  180|  62.2M|    ALLOC(mp) = ALLOC(from);
  ------------------
  |  |  329|  62.2M|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  146|  62.2M|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
                  ALLOC(mp) = ALLOC(from);
  ------------------
  |  |  329|  62.2M|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  146|  62.2M|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  181|  62.2M|    SIGN(mp) = SIGN(from);
  ------------------
  |  |  327|  62.2M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  62.2M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  SIGN(mp) = SIGN(from);
  ------------------
  |  |  327|  62.2M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  62.2M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
  182|       |
  183|  62.2M|    return MP_OKAY;
  ------------------
  |  |   39|  62.2M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  184|       |
  185|  62.2M|} /* end mp_init_copy() */
mp_copy:
  201|  14.7M|{
  202|  14.7M|    ARGCHK(from != NULL && to != NULL, MP_BADARG);
  ------------------
  |  |  350|  14.7M|#define ARGCHK(X, Y) assert(X)
  ------------------
  203|       |
  204|  14.7M|    if (from == to)
  ------------------
  |  Branch (204:9): [True: 1.14M, False: 13.6M]
  ------------------
  205|  1.14M|        return MP_OKAY;
  ------------------
  |  |   39|  1.14M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  206|       |
  207|  13.6M|    { /* copy */
  208|  13.6M|        mp_digit *tmp;
  209|       |
  210|       |        /*
  211|       |          If the allocated buffer in 'to' already has enough space to hold
  212|       |          all the used digits of 'from', we'll re-use it to avoid hitting
  213|       |          the memory allocater more than necessary; otherwise, we'd have
  214|       |          to grow anyway, so we just allocate a hunk and make the copy as
  215|       |          usual
  216|       |         */
  217|  13.6M|        if (ALLOC(to) >= USED(from)) {
  ------------------
  |  |  329|  13.6M|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  146|  13.6M|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
                      if (ALLOC(to) >= USED(from)) {
  ------------------
  |  |  328|  13.6M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  13.6M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (217:13): [True: 13.6M, False: 0]
  ------------------
  218|  13.6M|            s_mp_setz(DIGITS(to) + USED(from), ALLOC(to) - USED(from));
  ------------------
  |  |  330|  13.6M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|  13.6M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                          s_mp_setz(DIGITS(to) + USED(from), ALLOC(to) - USED(from));
  ------------------
  |  |  328|  13.6M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  13.6M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                          s_mp_setz(DIGITS(to) + USED(from), ALLOC(to) - USED(from));
  ------------------
  |  |  329|  13.6M|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  146|  13.6M|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
                          s_mp_setz(DIGITS(to) + USED(from), ALLOC(to) - USED(from));
  ------------------
  |  |  328|  13.6M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  13.6M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  219|  13.6M|            s_mp_copy(DIGITS(from), DIGITS(to), USED(from));
  ------------------
  |  |  330|  13.6M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|  13.6M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                          s_mp_copy(DIGITS(from), DIGITS(to), USED(from));
  ------------------
  |  |  330|  13.6M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|  13.6M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                          s_mp_copy(DIGITS(from), DIGITS(to), USED(from));
  ------------------
  |  |  328|  13.6M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  13.6M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  220|       |
  221|  13.6M|        } else {
  222|      0|            if ((tmp = s_mp_alloc(ALLOC(from), sizeof(mp_digit))) == NULL)
  ------------------
  |  |  329|      0|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  146|      0|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  |  Branch (222:17): [True: 0, False: 0]
  ------------------
  223|      0|                return MP_MEM;
  ------------------
  |  |   42|      0|#define MP_MEM -2    /* out of memory         */
  ------------------
  224|       |
  225|      0|            s_mp_copy(DIGITS(from), tmp, USED(from));
  ------------------
  |  |  330|      0|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|      0|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                          s_mp_copy(DIGITS(from), tmp, USED(from));
  ------------------
  |  |  328|      0|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|      0|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  226|       |
  227|      0|            if (DIGITS(to) != NULL) {
  ------------------
  |  |  330|      0|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|      0|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
  |  Branch (227:17): [True: 0, False: 0]
  ------------------
  228|      0|                s_mp_setz(DIGITS(to), ALLOC(to));
  ------------------
  |  |  330|      0|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|      0|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                              s_mp_setz(DIGITS(to), ALLOC(to));
  ------------------
  |  |  329|      0|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  146|      0|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  229|      0|                s_mp_free(DIGITS(to));
  ------------------
  |  |  330|      0|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|      0|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
  230|      0|            }
  231|       |
  232|      0|            DIGITS(to) = tmp;
  ------------------
  |  |  330|      0|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|      0|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
  233|      0|            ALLOC(to) = ALLOC(from);
  ------------------
  |  |  329|      0|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  146|      0|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
                          ALLOC(to) = ALLOC(from);
  ------------------
  |  |  329|      0|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  146|      0|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  234|      0|        }
  235|       |
  236|       |        /* Copy the precision and sign from the original */
  237|  13.6M|        USED(to) = USED(from);
  ------------------
  |  |  328|  13.6M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  13.6M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                      USED(to) = USED(from);
  ------------------
  |  |  328|  13.6M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  13.6M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  238|  13.6M|        SIGN(to) = SIGN(from);
  ------------------
  |  |  327|  13.6M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  13.6M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(to) = SIGN(from);
  ------------------
  |  |  327|  13.6M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  13.6M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
  239|  13.6M|    } /* end copy */
  240|       |
  241|  13.6M|    return MP_OKAY;
  ------------------
  |  |   39|  13.6M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  242|       |
  243|  13.6M|} /* end mp_copy() */
mp_exch:
  259|  18.7M|{
  260|  18.7M|#if MP_ARGCHK == 2
  261|  18.7M|    assert(mp1 != NULL && mp2 != NULL);
  262|       |#else
  263|       |    if (mp1 == NULL || mp2 == NULL)
  264|       |        return;
  265|       |#endif
  266|       |
  267|  18.7M|    s_mp_exch(mp1, mp2);
  268|       |
  269|  18.7M|} /* end mp_exch() */
mp_clear:
  285|   113M|{
  286|   113M|    if (mp == NULL)
  ------------------
  |  Branch (286:9): [True: 0, False: 113M]
  ------------------
  287|      0|        return;
  288|       |
  289|   113M|    if (DIGITS(mp) != NULL) {
  ------------------
  |  |  330|   113M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|   113M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
  |  Branch (289:9): [True: 90.5M, False: 23.3M]
  ------------------
  290|  90.5M|        s_mp_setz(DIGITS(mp), ALLOC(mp));
  ------------------
  |  |  330|  90.5M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|  90.5M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                      s_mp_setz(DIGITS(mp), ALLOC(mp));
  ------------------
  |  |  329|  90.5M|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  146|  90.5M|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  291|  90.5M|        s_mp_free(DIGITS(mp));
  ------------------
  |  |  330|  90.5M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|  90.5M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
  292|  90.5M|        DIGITS(mp) = NULL;
  ------------------
  |  |  330|  90.5M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|  90.5M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
  293|  90.5M|    }
  294|       |
  295|   113M|    USED(mp) = 0;
  ------------------
  |  |  328|   113M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|   113M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  296|   113M|    ALLOC(mp) = 0;
  ------------------
  |  |  329|   113M|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  146|   113M|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  297|       |
  298|   113M|} /* end mp_clear() */
mp_zero:
  312|   238k|{
  313|   238k|    if (mp == NULL)
  ------------------
  |  Branch (313:9): [True: 0, False: 238k]
  ------------------
  314|      0|        return;
  315|       |
  316|   238k|    s_mp_setz(DIGITS(mp), ALLOC(mp));
  ------------------
  |  |  330|   238k|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|   238k|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                  s_mp_setz(DIGITS(mp), ALLOC(mp));
  ------------------
  |  |  329|   238k|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  146|   238k|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  317|   238k|    USED(mp) = 1;
  ------------------
  |  |  328|   238k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|   238k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  318|   238k|    SIGN(mp) = ZPOS;
  ------------------
  |  |  327|   238k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|   238k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  SIGN(mp) = ZPOS;
  ------------------
  |  |  321|   238k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|   238k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
  319|       |
  320|   238k|} /* end mp_zero() */
mp_set:
  328|   228k|{
  329|   228k|    if (mp == NULL)
  ------------------
  |  Branch (329:9): [True: 0, False: 228k]
  ------------------
  330|      0|        return;
  331|       |
  332|   228k|    mp_zero(mp);
  333|   228k|    DIGIT(mp, 0) = d;
  ------------------
  |  |  331|   228k|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|   228k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
  334|       |
  335|   228k|} /* end mp_set() */
mp_add_d:
  408|   328k|{
  409|   328k|    mp_int tmp;
  410|   328k|    mp_err res;
  411|       |
  412|   328k|    ARGCHK(a != NULL && b != NULL, MP_BADARG);
  ------------------
  |  |  350|   328k|#define ARGCHK(X, Y) assert(X)
  ------------------
  413|       |
  414|   328k|    if ((res = mp_init_copy(&tmp, a)) != MP_OKAY)
  ------------------
  |  |   39|   328k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (414:9): [True: 0, False: 328k]
  ------------------
  415|      0|        return res;
  416|       |
  417|   328k|    if (SIGN(&tmp) == ZPOS) {
  ------------------
  |  |  327|   328k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|   328k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  if (SIGN(&tmp) == ZPOS) {
  ------------------
  |  |  321|   328k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|   328k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
  |  Branch (417:9): [True: 328k, False: 0]
  ------------------
  418|   328k|        if ((res = s_mp_add_d(&tmp, d)) != MP_OKAY)
  ------------------
  |  |   39|   328k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (418:13): [True: 0, False: 328k]
  ------------------
  419|      0|            goto CLEANUP;
  420|   328k|    } else if (s_mp_cmp_d(&tmp, d) >= 0) {
  ------------------
  |  Branch (420:16): [True: 0, False: 0]
  ------------------
  421|      0|        if ((res = s_mp_sub_d(&tmp, d)) != MP_OKAY)
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (421:13): [True: 0, False: 0]
  ------------------
  422|      0|            goto CLEANUP;
  423|      0|    } else {
  424|      0|        mp_neg(&tmp, &tmp);
  425|       |
  426|      0|        DIGIT(&tmp, 0) = d - DIGIT(&tmp, 0);
  ------------------
  |  |  331|      0|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|      0|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
                      DIGIT(&tmp, 0) = d - DIGIT(&tmp, 0);
  ------------------
  |  |  331|      0|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|      0|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
  427|      0|    }
  428|       |
  429|   328k|    if (s_mp_cmp_d(&tmp, 0) == 0)
  ------------------
  |  Branch (429:9): [True: 41.6k, False: 286k]
  ------------------
  430|  41.6k|        SIGN(&tmp) = ZPOS;
  ------------------
  |  |  327|  41.6k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  41.6k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(&tmp) = ZPOS;
  ------------------
  |  |  321|  41.6k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  41.6k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
  431|       |
  432|   328k|    s_mp_exch(&tmp, b);
  433|       |
  434|   328k|CLEANUP:
  435|   328k|    mp_clear(&tmp);
  436|   328k|    return res;
  437|       |
  438|   328k|} /* end mp_add_d() */
mp_sub_d:
  453|  5.07k|{
  454|  5.07k|    mp_int tmp;
  455|  5.07k|    mp_err res;
  456|       |
  457|  5.07k|    ARGCHK(a != NULL && b != NULL, MP_BADARG);
  ------------------
  |  |  350|  5.07k|#define ARGCHK(X, Y) assert(X)
  ------------------
  458|       |
  459|  5.07k|    if ((res = mp_init_copy(&tmp, a)) != MP_OKAY)
  ------------------
  |  |   39|  5.07k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (459:9): [True: 0, False: 5.07k]
  ------------------
  460|      0|        return res;
  461|       |
  462|  5.07k|    if (SIGN(&tmp) == NEG) {
  ------------------
  |  |  327|  5.07k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  5.07k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  if (SIGN(&tmp) == NEG) {
  ------------------
  |  |  320|  5.07k|#define NEG MP_NEG
  |  |  ------------------
  |  |  |  |   36|  5.07k|#define MP_NEG 1
  |  |  ------------------
  ------------------
  |  Branch (462:9): [True: 0, False: 5.07k]
  ------------------
  463|      0|        if ((res = s_mp_add_d(&tmp, d)) != MP_OKAY)
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (463:13): [True: 0, False: 0]
  ------------------
  464|      0|            goto CLEANUP;
  465|  5.07k|    } else if (s_mp_cmp_d(&tmp, d) >= 0) {
  ------------------
  |  Branch (465:16): [True: 5.07k, False: 0]
  ------------------
  466|  5.07k|        if ((res = s_mp_sub_d(&tmp, d)) != MP_OKAY)
  ------------------
  |  |   39|  5.07k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (466:13): [True: 0, False: 5.07k]
  ------------------
  467|      0|            goto CLEANUP;
  468|  5.07k|    } else {
  469|      0|        mp_neg(&tmp, &tmp);
  470|       |
  471|      0|        DIGIT(&tmp, 0) = d - DIGIT(&tmp, 0);
  ------------------
  |  |  331|      0|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|      0|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
                      DIGIT(&tmp, 0) = d - DIGIT(&tmp, 0);
  ------------------
  |  |  331|      0|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|      0|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
  472|      0|        SIGN(&tmp) = NEG;
  ------------------
  |  |  327|      0|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|      0|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(&tmp) = NEG;
  ------------------
  |  |  320|      0|#define NEG MP_NEG
  |  |  ------------------
  |  |  |  |   36|      0|#define MP_NEG 1
  |  |  ------------------
  ------------------
  473|      0|    }
  474|       |
  475|  5.07k|    if (s_mp_cmp_d(&tmp, 0) == 0)
  ------------------
  |  Branch (475:9): [True: 0, False: 5.07k]
  ------------------
  476|      0|        SIGN(&tmp) = ZPOS;
  ------------------
  |  |  327|      0|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|      0|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(&tmp) = ZPOS;
  ------------------
  |  |  321|      0|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|      0|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
  477|       |
  478|  5.07k|    s_mp_exch(&tmp, b);
  479|       |
  480|  5.07k|CLEANUP:
  481|  5.07k|    mp_clear(&tmp);
  482|  5.07k|    return res;
  483|       |
  484|  5.07k|} /* end mp_sub_d() */
mp_mul_d:
  499|   302k|{
  500|   302k|    mp_err res;
  501|       |
  502|   302k|    ARGCHK(a != NULL && b != NULL, MP_BADARG);
  ------------------
  |  |  350|   302k|#define ARGCHK(X, Y) assert(X)
  ------------------
  503|       |
  504|   302k|    if (d == 0) {
  ------------------
  |  Branch (504:9): [True: 0, False: 302k]
  ------------------
  505|      0|        mp_zero(b);
  506|      0|        return MP_OKAY;
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  507|      0|    }
  508|       |
  509|   302k|    if ((res = mp_copy(a, b)) != MP_OKAY)
  ------------------
  |  |   39|   302k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (509:9): [True: 0, False: 302k]
  ------------------
  510|      0|        return res;
  511|       |
  512|   302k|    res = s_mp_mul_d(b, d);
  513|       |
  514|   302k|    return res;
  515|       |
  516|   302k|} /* end mp_mul_d() */
mp_div_d:
  550|  32.7M|{
  551|  32.7M|    mp_err res;
  552|  32.7M|    mp_int qp;
  553|  32.7M|    mp_digit rem = 0;
  554|  32.7M|    int pow;
  555|       |
  556|  32.7M|    ARGCHK(a != NULL, MP_BADARG);
  ------------------
  |  |  350|  32.7M|#define ARGCHK(X, Y) assert(X)
  ------------------
  557|       |
  558|  32.7M|    if (d == 0)
  ------------------
  |  Branch (558:9): [True: 0, False: 32.7M]
  ------------------
  559|      0|        return MP_RANGE;
  ------------------
  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  ------------------
  560|       |
  561|       |    /* Shortcut for powers of two ... */
  562|  32.7M|    if ((pow = s_mp_ispow2d(d)) >= 0) {
  ------------------
  |  Branch (562:9): [True: 822k, False: 31.9M]
  ------------------
  563|   822k|        mp_digit mask;
  564|       |
  565|   822k|        mask = ((mp_digit)1 << pow) - 1;
  566|   822k|        rem = DIGIT(a, 0) & mask;
  ------------------
  |  |  331|   822k|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|   822k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
  567|       |
  568|   822k|        if (q) {
  ------------------
  |  Branch (568:13): [True: 822k, False: 0]
  ------------------
  569|   822k|            if ((res = mp_copy(a, q)) != MP_OKAY) {
  ------------------
  |  |   39|   822k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (569:17): [True: 0, False: 822k]
  ------------------
  570|      0|                return res;
  571|      0|            }
  572|   822k|            s_mp_div_2d(q, pow);
  573|   822k|        }
  574|       |
  575|   822k|        if (r)
  ------------------
  |  Branch (575:13): [True: 822k, False: 0]
  ------------------
  576|   822k|            *r = rem;
  577|       |
  578|   822k|        return MP_OKAY;
  ------------------
  |  |   39|   822k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  579|   822k|    }
  580|       |
  581|  31.9M|    if ((res = mp_init_copy(&qp, a)) != MP_OKAY)
  ------------------
  |  |   39|  31.9M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (581:9): [True: 0, False: 31.9M]
  ------------------
  582|      0|        return res;
  583|       |
  584|  31.9M|    res = s_mp_div_d(&qp, d, &rem);
  585|       |
  586|  31.9M|    if (s_mp_cmp_d(&qp, 0) == 0)
  ------------------
  |  Branch (586:9): [True: 0, False: 31.9M]
  ------------------
  587|      0|        SIGN(q) = ZPOS;
  ------------------
  |  |  327|      0|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|      0|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(q) = ZPOS;
  ------------------
  |  |  321|      0|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|      0|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
  588|       |
  589|  31.9M|    if (r) {
  ------------------
  |  Branch (589:9): [True: 31.9M, False: 0]
  ------------------
  590|  31.9M|        *r = rem;
  591|  31.9M|    }
  592|       |
  593|  31.9M|    if (q)
  ------------------
  |  Branch (593:9): [True: 0, False: 31.9M]
  ------------------
  594|      0|        s_mp_exch(&qp, q);
  595|       |
  596|  31.9M|    mp_clear(&qp);
  597|  31.9M|    return res;
  598|       |
  599|  31.9M|} /* end mp_div_d() */
mp_add:
  741|  18.9M|{
  742|  18.9M|    mp_err res;
  743|       |
  744|  18.9M|    ARGCHK(a != NULL && b != NULL && c != NULL, MP_BADARG);
  ------------------
  |  |  350|  18.9M|#define ARGCHK(X, Y) assert(X)
  ------------------
  745|       |
  746|  18.9M|    if (SIGN(a) == SIGN(b)) { /* same sign:  add values, keep sign */
  ------------------
  |  |  327|  18.9M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  18.9M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  if (SIGN(a) == SIGN(b)) { /* same sign:  add values, keep sign */
  ------------------
  |  |  327|  18.9M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  18.9M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
  |  Branch (746:9): [True: 13.8M, False: 5.06M]
  ------------------
  747|  13.8M|        MP_CHECKOK(s_mp_add_3arg(a, b, c));
  ------------------
  |  |  314|  13.8M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  13.8M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 13.8M]
  |  |  ------------------
  |  |  315|  13.8M|    goto CLEANUP
  ------------------
  748|  13.8M|    } else if (s_mp_cmp(a, b) >= 0) { /* different sign: |a| >= |b|   */
  ------------------
  |  Branch (748:16): [True: 1.84M, False: 3.21M]
  ------------------
  749|  1.84M|        MP_CHECKOK(s_mp_sub_3arg(a, b, c));
  ------------------
  |  |  314|  1.84M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  1.84M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 1.84M]
  |  |  ------------------
  |  |  315|  1.84M|    goto CLEANUP
  ------------------
  750|  3.21M|    } else { /* different sign: |a|  < |b|   */
  751|  3.21M|        MP_CHECKOK(s_mp_sub_3arg(b, a, c));
  ------------------
  |  |  314|  3.21M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  3.21M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 3.21M]
  |  |  ------------------
  |  |  315|  3.21M|    goto CLEANUP
  ------------------
  752|  3.21M|    }
  753|       |
  754|  18.9M|    if (s_mp_cmp_d(c, 0) == MP_EQ)
  ------------------
  |  |   96|  18.9M|#define MP_EQ 0
  ------------------
  |  Branch (754:9): [True: 8.40k, False: 18.9M]
  ------------------
  755|  8.40k|        SIGN(c) = ZPOS;
  ------------------
  |  |  327|  8.40k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  8.40k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(c) = ZPOS;
  ------------------
  |  |  321|  8.40k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  8.40k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
  756|       |
  757|  18.9M|CLEANUP:
  758|  18.9M|    return res;
  759|       |
  760|  18.9M|} /* end mp_add() */
s_mp_mulg:
  819|  4.84k|{
  820|  4.84k|    mp_digit *pb;
  821|  4.84k|    mp_int tmp;
  822|  4.84k|    mp_err res;
  823|  4.84k|    mp_size ib;
  824|  4.84k|    mp_size useda, usedb;
  825|       |
  826|  4.84k|    ARGCHK(a != NULL && b != NULL && c != NULL, MP_BADARG);
  ------------------
  |  |  350|  4.84k|#define ARGCHK(X, Y) assert(X)
  ------------------
  827|       |
  828|  4.84k|    if (a == c) {
  ------------------
  |  Branch (828:9): [True: 0, False: 4.84k]
  ------------------
  829|      0|        if ((res = mp_init_copy(&tmp, a)) != MP_OKAY)
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (829:13): [True: 0, False: 0]
  ------------------
  830|      0|            return res;
  831|      0|        if (a == b)
  ------------------
  |  Branch (831:13): [True: 0, False: 0]
  ------------------
  832|      0|            b = &tmp;
  833|      0|        a = &tmp;
  834|  4.84k|    } else if (b == c) {
  ------------------
  |  Branch (834:16): [True: 4.84k, False: 0]
  ------------------
  835|  4.84k|        if ((res = mp_init_copy(&tmp, b)) != MP_OKAY)
  ------------------
  |  |   39|  4.84k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (835:13): [True: 0, False: 4.84k]
  ------------------
  836|      0|            return res;
  837|  4.84k|        b = &tmp;
  838|  4.84k|    } else {
  839|      0|        MP_DIGITS(&tmp) = 0;
  ------------------
  |  |  147|      0|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  840|      0|    }
  841|       |
  842|  4.84k|    if (MP_USED(a) < MP_USED(b)) {
  ------------------
  |  |  145|  4.84k|#define MP_USED(MP) ((MP)->used)
  ------------------
                  if (MP_USED(a) < MP_USED(b)) {
  ------------------
  |  |  145|  4.84k|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (842:9): [True: 119, False: 4.72k]
  ------------------
  843|    119|        const mp_int *xch = b; /* switch a and b, to do fewer outer loops */
  844|    119|        b = a;
  845|    119|        a = xch;
  846|    119|    }
  847|       |
  848|  4.84k|    MP_USED(c) = 1;
  ------------------
  |  |  145|  4.84k|#define MP_USED(MP) ((MP)->used)
  ------------------
  849|  4.84k|    MP_DIGIT(c, 0) = 0;
  ------------------
  |  |  148|  4.84k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
  850|  4.84k|    if ((res = s_mp_pad(c, USED(a) + USED(b))) != MP_OKAY)
  ------------------
  |  |  328|  4.84k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  4.84k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                  if ((res = s_mp_pad(c, USED(a) + USED(b))) != MP_OKAY)
  ------------------
  |  |  328|  4.84k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  4.84k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                  if ((res = s_mp_pad(c, USED(a) + USED(b))) != MP_OKAY)
  ------------------
  |  |   39|  4.84k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (850:9): [True: 0, False: 4.84k]
  ------------------
  851|      0|        goto CLEANUP;
  852|       |
  853|  4.84k|#ifdef NSS_USE_COMBA
  854|       |    /* comba isn't constant time because it clamps! If we cared
  855|       |     * (we needed a constant time version of multiply that was 'faster'
  856|       |     * we could easily pass constantTime down to the comba code and
  857|       |     * get it to skip the clamp... but here are assembler versions
  858|       |     * which add comba to platforms that can't compile the normal
  859|       |     * comba's imbedded assembler which would also need to change, so
  860|       |     * for now we just skip comba when we are running constant time. */
  861|  4.84k|    if (!constantTime && (MP_USED(a) == MP_USED(b)) && IS_POWER_OF_2(MP_USED(b))) {
  ------------------
  |  |  145|  4.84k|#define MP_USED(MP) ((MP)->used)
  ------------------
                  if (!constantTime && (MP_USED(a) == MP_USED(b)) && IS_POWER_OF_2(MP_USED(b))) {
  ------------------
  |  |  145|  4.84k|#define MP_USED(MP) ((MP)->used)
  ------------------
                  if (!constantTime && (MP_USED(a) == MP_USED(b)) && IS_POWER_OF_2(MP_USED(b))) {
  ------------------
  |  |  161|    659|#define IS_POWER_OF_2(a) ((a) && !((a) & ((a)-1)))
  |  |  ------------------
  |  |  |  Branch (161:27): [True: 659, False: 0]
  |  |  |  Branch (161:34): [True: 653, False: 6]
  |  |  ------------------
  ------------------
  |  Branch (861:9): [True: 4.84k, False: 0]
  |  Branch (861:26): [True: 659, False: 4.18k]
  ------------------
  862|    653|        if (MP_USED(a) == 4) {
  ------------------
  |  |  145|    653|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (862:13): [True: 5, False: 648]
  ------------------
  863|      5|            s_mp_mul_comba_4(a, b, c);
  864|      5|            goto CLEANUP;
  865|      5|        }
  866|    648|        if (MP_USED(a) == 8) {
  ------------------
  |  |  145|    648|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (866:13): [True: 58, False: 590]
  ------------------
  867|     58|            s_mp_mul_comba_8(a, b, c);
  868|     58|            goto CLEANUP;
  869|     58|        }
  870|    590|        if (MP_USED(a) == 16) {
  ------------------
  |  |  145|    590|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (870:13): [True: 0, False: 590]
  ------------------
  871|      0|            s_mp_mul_comba_16(a, b, c);
  872|      0|            goto CLEANUP;
  873|      0|        }
  874|    590|        if (MP_USED(a) == 32) {
  ------------------
  |  |  145|    590|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (874:13): [True: 0, False: 590]
  ------------------
  875|      0|            s_mp_mul_comba_32(a, b, c);
  876|      0|            goto CLEANUP;
  877|      0|        }
  878|    590|    }
  879|  4.78k|#endif
  880|       |
  881|  4.78k|    pb = MP_DIGITS(b);
  ------------------
  |  |  147|  4.78k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  882|  4.78k|    s_mpv_mul_d(MP_DIGITS(a), MP_USED(a), *pb++, MP_DIGITS(c));
  ------------------
  |  |  189|  4.78k|    ((mp_digit *)c)[a_len] = s_mpv_mul_set_vec64(c, a, a_len, b)
  ------------------
  883|       |
  884|       |    /* Outer loop:  Digits of b */
  885|  4.78k|    useda = MP_USED(a);
  ------------------
  |  |  145|  4.78k|#define MP_USED(MP) ((MP)->used)
  ------------------
  886|  4.78k|    usedb = MP_USED(b);
  ------------------
  |  |  145|  4.78k|#define MP_USED(MP) ((MP)->used)
  ------------------
  887|  10.8k|    for (ib = 1; ib < usedb; ib++) {
  ------------------
  |  Branch (887:18): [True: 6.02k, False: 4.78k]
  ------------------
  888|  6.02k|        mp_digit b_i = *pb++;
  889|       |
  890|       |        /* Inner product:  Digits of a */
  891|  6.02k|        if (constantTime || b_i)
  ------------------
  |  Branch (891:13): [True: 0, False: 6.02k]
  |  Branch (891:29): [True: 5.94k, False: 77]
  ------------------
  892|  5.94k|            s_mpv_mul_d_add(MP_DIGITS(a), useda, b_i, MP_DIGITS(c) + ib);
  ------------------
  |  |  193|  5.94k|    ((mp_digit *)c)[a_len] = s_mpv_mul_add_vec64(c, a, a_len, b)
  ------------------
  893|     77|        else
  894|     77|            MP_DIGIT(c, ib + useda) = b_i;
  ------------------
  |  |  148|     77|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
  895|  6.02k|    }
  896|       |
  897|  4.78k|    if (!constantTime) {
  ------------------
  |  Branch (897:9): [True: 4.78k, False: 0]
  ------------------
  898|  4.78k|        s_mp_clamp(c);
  899|  4.78k|    }
  900|       |
  901|  4.78k|    if (SIGN(a) == SIGN(b) || s_mp_cmp_d(c, 0) == MP_EQ)
  ------------------
  |  |  327|  4.78k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  4.78k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  if (SIGN(a) == SIGN(b) || s_mp_cmp_d(c, 0) == MP_EQ)
  ------------------
  |  |  327|  4.78k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  9.56k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  if (SIGN(a) == SIGN(b) || s_mp_cmp_d(c, 0) == MP_EQ)
  ------------------
  |  |   96|      0|#define MP_EQ 0
  ------------------
  |  Branch (901:9): [True: 4.78k, False: 0]
  |  Branch (901:31): [True: 0, False: 0]
  ------------------
  902|  4.78k|        SIGN(c) = ZPOS;
  ------------------
  |  |  327|  4.78k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  4.78k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(c) = ZPOS;
  ------------------
  |  |  321|  4.78k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  4.78k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
  903|      0|    else
  904|      0|        SIGN(c) = NEG;
  ------------------
  |  |  327|      0|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|      0|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(c) = NEG;
  ------------------
  |  |  320|      0|#define NEG MP_NEG
  |  |  ------------------
  |  |  |  |   36|      0|#define MP_NEG 1
  |  |  ------------------
  ------------------
  905|       |
  906|  4.84k|CLEANUP:
  907|  4.84k|    mp_clear(&tmp);
  908|  4.84k|    return res;
  909|  4.78k|} /* end smp_mulg() */
mp_mul:
  923|  4.84k|{
  924|  4.84k|    return s_mp_mulg(a, b, c, 0);
  925|  4.84k|} /* end mp_mul() */
mp_sqr:
  971|  26.3M|{
  972|  26.3M|    mp_digit *pa;
  973|  26.3M|    mp_digit d;
  974|  26.3M|    mp_err res;
  975|  26.3M|    mp_size ix;
  976|  26.3M|    mp_int tmp;
  977|  26.3M|    int count;
  978|       |
  979|  26.3M|    ARGCHK(a != NULL && sqr != NULL, MP_BADARG);
  ------------------
  |  |  350|  26.3M|#define ARGCHK(X, Y) assert(X)
  ------------------
  980|       |
  981|  26.3M|    if (a == sqr) {
  ------------------
  |  Branch (981:9): [True: 3.38M, False: 22.9M]
  ------------------
  982|  3.38M|        if ((res = mp_init_copy(&tmp, a)) != MP_OKAY)
  ------------------
  |  |   39|  3.38M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (982:13): [True: 0, False: 3.38M]
  ------------------
  983|      0|            return res;
  984|  3.38M|        a = &tmp;
  985|  22.9M|    } else {
  986|  22.9M|        DIGITS(&tmp) = 0;
  ------------------
  |  |  330|  22.9M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|  22.9M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
  987|  22.9M|        res = MP_OKAY;
  ------------------
  |  |   39|  22.9M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  988|  22.9M|    }
  989|       |
  990|  26.3M|    ix = 2 * MP_USED(a);
  ------------------
  |  |  145|  26.3M|#define MP_USED(MP) ((MP)->used)
  ------------------
  991|  26.3M|    if (ix > MP_ALLOC(sqr)) {
  ------------------
  |  |  146|  26.3M|#define MP_ALLOC(MP) ((MP)->alloc)
  ------------------
  |  Branch (991:9): [True: 0, False: 26.3M]
  ------------------
  992|      0|        MP_USED(sqr) = 1;
  ------------------
  |  |  145|      0|#define MP_USED(MP) ((MP)->used)
  ------------------
  993|      0|        MP_CHECKOK(s_mp_grow(sqr, ix));
  ------------------
  |  |  314|      0|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  315|      0|    goto CLEANUP
  ------------------
  994|      0|    }
  995|  26.3M|    MP_USED(sqr) = ix;
  ------------------
  |  |  145|  26.3M|#define MP_USED(MP) ((MP)->used)
  ------------------
  996|  26.3M|    MP_DIGIT(sqr, 0) = 0;
  ------------------
  |  |  148|  26.3M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
  997|       |
  998|  26.3M|#ifdef NSS_USE_COMBA
  999|  26.3M|    if (IS_POWER_OF_2(MP_USED(a))) {
  ------------------
  |  |  161|  26.3M|#define IS_POWER_OF_2(a) ((a) && !((a) & ((a)-1)))
  |  |  ------------------
  |  |  |  Branch (161:27): [True: 26.3M, False: 0]
  |  |  |  Branch (161:34): [True: 18.2M, False: 8.00M]
  |  |  ------------------
  ------------------
 1000|  18.2M|        if (MP_USED(a) == 4) {
  ------------------
  |  |  145|  18.2M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (1000:13): [True: 7.70M, False: 10.5M]
  ------------------
 1001|  7.70M|            s_mp_sqr_comba_4(a, sqr);
 1002|  7.70M|            goto CLEANUP;
 1003|  7.70M|        }
 1004|  10.5M|        if (MP_USED(a) == 8) {
  ------------------
  |  |  145|  10.5M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (1004:13): [True: 1.58M, False: 9.00M]
  ------------------
 1005|  1.58M|            s_mp_sqr_comba_8(a, sqr);
 1006|  1.58M|            goto CLEANUP;
 1007|  1.58M|        }
 1008|  9.00M|        if (MP_USED(a) == 16) {
  ------------------
  |  |  145|  9.00M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (1008:13): [True: 0, False: 9.00M]
  ------------------
 1009|      0|            s_mp_sqr_comba_16(a, sqr);
 1010|      0|            goto CLEANUP;
 1011|      0|        }
 1012|  9.00M|        if (MP_USED(a) == 32) {
  ------------------
  |  |  145|  9.00M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (1012:13): [True: 0, False: 9.00M]
  ------------------
 1013|      0|            s_mp_sqr_comba_32(a, sqr);
 1014|      0|            goto CLEANUP;
 1015|      0|        }
 1016|  9.00M|    }
 1017|  17.0M|#endif
 1018|       |
 1019|  17.0M|    pa = MP_DIGITS(a);
  ------------------
  |  |  147|  17.0M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 1020|  17.0M|    count = MP_USED(a) - 1;
  ------------------
  |  |  145|  17.0M|#define MP_USED(MP) ((MP)->used)
  ------------------
 1021|  17.0M|    if (count > 0) {
  ------------------
  |  Branch (1021:9): [True: 12.9M, False: 4.07M]
  ------------------
 1022|  12.9M|        d = *pa++;
 1023|  12.9M|        s_mpv_mul_d(pa, count, d, MP_DIGITS(sqr) + 1);
  ------------------
  |  |  189|  12.9M|    ((mp_digit *)c)[a_len] = s_mpv_mul_set_vec64(c, a, a_len, b)
  ------------------
 1024|  35.8M|        for (ix = 3; --count > 0; ix += 2) {
  ------------------
  |  Branch (1024:22): [True: 22.9M, False: 12.9M]
  ------------------
 1025|  22.9M|            d = *pa++;
 1026|  22.9M|            s_mpv_mul_d_add(pa, count, d, MP_DIGITS(sqr) + ix);
  ------------------
  |  |  193|  22.9M|    ((mp_digit *)c)[a_len] = s_mpv_mul_add_vec64(c, a, a_len, b)
  ------------------
 1027|  22.9M|        }                                    /* for(ix ...) */
 1028|  12.9M|        MP_DIGIT(sqr, MP_USED(sqr) - 1) = 0; /* above loop stopped short of this. */
  ------------------
  |  |  148|  12.9M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 1029|       |
 1030|       |        /* now sqr *= 2 */
 1031|  12.9M|        s_mp_mul_2(sqr);
 1032|  12.9M|    } else {
 1033|  4.07M|        MP_DIGIT(sqr, 1) = 0;
  ------------------
  |  |  148|  4.07M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 1034|  4.07M|    }
 1035|       |
 1036|       |    /* now add the squares of the digits of a to sqr. */
 1037|  17.0M|    s_mpv_sqr_add_prop(MP_DIGITS(a), MP_USED(a), MP_DIGITS(sqr));
  ------------------
  |  |  147|  17.0M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
                  s_mpv_sqr_add_prop(MP_DIGITS(a), MP_USED(a), MP_DIGITS(sqr));
  ------------------
  |  |  145|  17.0M|#define MP_USED(MP) ((MP)->used)
  ------------------
                  s_mpv_sqr_add_prop(MP_DIGITS(a), MP_USED(a), MP_DIGITS(sqr));
  ------------------
  |  |  147|  17.0M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 1038|       |
 1039|  17.0M|    SIGN(sqr) = ZPOS;
  ------------------
  |  |  327|  17.0M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  17.0M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  SIGN(sqr) = ZPOS;
  ------------------
  |  |  321|  17.0M|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  17.0M|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 1040|  17.0M|    s_mp_clamp(sqr);
 1041|       |
 1042|  26.3M|CLEANUP:
 1043|  26.3M|    mp_clear(&tmp);
 1044|  26.3M|    return res;
 1045|       |
 1046|  17.0M|} /* end mp_sqr() */
mp_div:
 1062|  3.99M|{
 1063|  3.99M|    mp_err res;
 1064|  3.99M|    mp_int *pQ, *pR;
 1065|  3.99M|    mp_int qtmp, rtmp, btmp;
 1066|  3.99M|    int cmp;
 1067|  3.99M|    mp_sign signA;
 1068|  3.99M|    mp_sign signB;
 1069|       |
 1070|  3.99M|    ARGCHK(a != NULL && b != NULL, MP_BADARG);
  ------------------
  |  |  350|  3.99M|#define ARGCHK(X, Y) assert(X)
  ------------------
 1071|       |
 1072|  3.99M|    signA = MP_SIGN(a);
  ------------------
  |  |  144|  3.99M|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
 1073|  3.99M|    signB = MP_SIGN(b);
  ------------------
  |  |  144|  3.99M|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
 1074|       |
 1075|  3.99M|    if (mp_cmp_z(b) == MP_EQ)
  ------------------
  |  |   96|  3.99M|#define MP_EQ 0
  ------------------
  |  Branch (1075:9): [True: 0, False: 3.99M]
  ------------------
 1076|      0|        return MP_RANGE;
  ------------------
  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  ------------------
 1077|       |
 1078|  3.99M|    DIGITS(&qtmp) = 0;
  ------------------
  |  |  330|  3.99M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|  3.99M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
 1079|  3.99M|    DIGITS(&rtmp) = 0;
  ------------------
  |  |  330|  3.99M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|  3.99M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
 1080|  3.99M|    DIGITS(&btmp) = 0;
  ------------------
  |  |  330|  3.99M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|  3.99M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
 1081|       |
 1082|       |    /* Set up some temporaries... */
 1083|  3.99M|    if (!r || r == a || r == b) {
  ------------------
  |  Branch (1083:9): [True: 0, False: 3.99M]
  |  Branch (1083:15): [True: 3.99M, False: 632]
  |  Branch (1083:25): [True: 0, False: 632]
  ------------------
 1084|  3.99M|        MP_CHECKOK(mp_init_copy(&rtmp, a));
  ------------------
  |  |  314|  3.99M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  3.99M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 3.99M]
  |  |  ------------------
  |  |  315|  3.99M|    goto CLEANUP
  ------------------
 1085|  3.99M|        pR = &rtmp;
 1086|  3.99M|    } else {
 1087|    632|        MP_CHECKOK(mp_copy(a, r));
  ------------------
  |  |  314|    632|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    632|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 632]
  |  |  ------------------
  |  |  315|    632|    goto CLEANUP
  ------------------
 1088|    632|        pR = r;
 1089|    632|    }
 1090|       |
 1091|  3.99M|    if (!q || q == a || q == b) {
  ------------------
  |  Branch (1091:9): [True: 3.99M, False: 0]
  |  Branch (1091:15): [True: 0, False: 0]
  |  Branch (1091:25): [True: 0, False: 0]
  ------------------
 1092|  3.99M|        MP_CHECKOK(mp_init_size(&qtmp, MP_USED(a)));
  ------------------
  |  |  314|  3.99M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  3.99M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 3.99M]
  |  |  ------------------
  |  |  315|  3.99M|    goto CLEANUP
  ------------------
 1093|  3.99M|        pQ = &qtmp;
 1094|  3.99M|    } else {
 1095|      0|        MP_CHECKOK(s_mp_pad(q, MP_USED(a)));
  ------------------
  |  |  314|      0|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  315|      0|    goto CLEANUP
  ------------------
 1096|      0|        pQ = q;
 1097|      0|        mp_zero(pQ);
 1098|      0|    }
 1099|       |
 1100|       |    /*
 1101|       |      If |a| <= |b|, we can compute the solution without division;
 1102|       |      otherwise, we actually do the work required.
 1103|       |     */
 1104|  3.99M|    if ((cmp = s_mp_cmp(a, b)) <= 0) {
  ------------------
  |  Branch (1104:9): [True: 0, False: 3.99M]
  ------------------
 1105|      0|        if (cmp) {
  ------------------
  |  Branch (1105:13): [True: 0, False: 0]
  ------------------
 1106|       |            /* r was set to a above. */
 1107|      0|            mp_zero(pQ);
 1108|      0|        } else {
 1109|      0|            mp_set(pQ, 1);
 1110|      0|            mp_zero(pR);
 1111|      0|        }
 1112|  3.99M|    } else {
 1113|  3.99M|        MP_CHECKOK(mp_init_copy(&btmp, b));
  ------------------
  |  |  314|  3.99M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  3.99M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 3.99M]
  |  |  ------------------
  |  |  315|  3.99M|    goto CLEANUP
  ------------------
 1114|  3.99M|        MP_CHECKOK(s_mp_div(pR, &btmp, pQ));
  ------------------
  |  |  314|  3.99M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  3.99M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 3.99M]
  |  |  ------------------
  |  |  315|  3.99M|    goto CLEANUP
  ------------------
 1115|  3.99M|    }
 1116|       |
 1117|       |    /* Compute the signs for the output  */
 1118|  3.99M|    MP_SIGN(pR) = signA;        /* Sr = Sa              */
  ------------------
  |  |  144|  3.99M|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
 1119|       |    /* Sq = ZPOS if Sa == Sb */ /* Sq = NEG if Sa != Sb */
 1120|  3.99M|    MP_SIGN(pQ) = (signA == signB) ? ZPOS : NEG;
  ------------------
  |  |  144|  3.99M|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
                  MP_SIGN(pQ) = (signA == signB) ? ZPOS : NEG;
  ------------------
  |  |  321|  3.99M|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  3.99M|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
                  MP_SIGN(pQ) = (signA == signB) ? ZPOS : NEG;
  ------------------
  |  |  320|    231|#define NEG MP_NEG
  |  |  ------------------
  |  |  |  |   36|  3.99M|#define MP_NEG 1
  |  |  ------------------
  ------------------
  |  Branch (1120:19): [True: 3.99M, False: 231]
  ------------------
 1121|       |
 1122|  3.99M|    if (s_mp_cmp_d(pQ, 0) == MP_EQ)
  ------------------
  |  |   96|  3.99M|#define MP_EQ 0
  ------------------
  |  Branch (1122:9): [True: 0, False: 3.99M]
  ------------------
 1123|      0|        SIGN(pQ) = ZPOS;
  ------------------
  |  |  327|      0|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|      0|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(pQ) = ZPOS;
  ------------------
  |  |  321|      0|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|      0|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 1124|  3.99M|    if (s_mp_cmp_d(pR, 0) == MP_EQ)
  ------------------
  |  |   96|  3.99M|#define MP_EQ 0
  ------------------
  |  Branch (1124:9): [True: 0, False: 3.99M]
  ------------------
 1125|      0|        SIGN(pR) = ZPOS;
  ------------------
  |  |  327|      0|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|      0|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(pR) = ZPOS;
  ------------------
  |  |  321|      0|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|      0|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 1126|       |
 1127|       |    /* Copy output, if it is needed      */
 1128|  3.99M|    if (q && q != pQ)
  ------------------
  |  Branch (1128:9): [True: 0, False: 3.99M]
  |  Branch (1128:14): [True: 0, False: 0]
  ------------------
 1129|      0|        s_mp_exch(pQ, q);
 1130|       |
 1131|  3.99M|    if (r && r != pR)
  ------------------
  |  Branch (1131:9): [True: 3.99M, False: 0]
  |  Branch (1131:14): [True: 3.99M, False: 632]
  ------------------
 1132|  3.99M|        s_mp_exch(pR, r);
 1133|       |
 1134|  3.99M|CLEANUP:
 1135|  3.99M|    mp_clear(&btmp);
 1136|  3.99M|    mp_clear(&rtmp);
 1137|  3.99M|    mp_clear(&qtmp);
 1138|       |
 1139|  3.99M|    return res;
 1140|       |
 1141|  3.99M|} /* end mp_div() */
mp_div_2d:
 1149|  5.07k|{
 1150|  5.07k|    mp_err res;
 1151|       |
 1152|  5.07k|    ARGCHK(a != NULL, MP_BADARG);
  ------------------
  |  |  350|  5.07k|#define ARGCHK(X, Y) assert(X)
  ------------------
 1153|       |
 1154|  5.07k|    if (q) {
  ------------------
  |  Branch (1154:9): [True: 5.07k, False: 0]
  ------------------
 1155|  5.07k|        if ((res = mp_copy(a, q)) != MP_OKAY)
  ------------------
  |  |   39|  5.07k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1155:13): [True: 0, False: 5.07k]
  ------------------
 1156|      0|            return res;
 1157|  5.07k|    }
 1158|  5.07k|    if (r) {
  ------------------
  |  Branch (1158:9): [True: 0, False: 5.07k]
  ------------------
 1159|      0|        if ((res = mp_copy(a, r)) != MP_OKAY)
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1159:13): [True: 0, False: 0]
  ------------------
 1160|      0|            return res;
 1161|      0|    }
 1162|  5.07k|    if (q) {
  ------------------
  |  Branch (1162:9): [True: 5.07k, False: 0]
  ------------------
 1163|  5.07k|        s_mp_div_2d(q, d);
 1164|  5.07k|    }
 1165|  5.07k|    if (r) {
  ------------------
  |  Branch (1165:9): [True: 0, False: 5.07k]
  ------------------
 1166|      0|        s_mp_mod_2d(r, d);
 1167|      0|    }
 1168|       |
 1169|  5.07k|    return MP_OKAY;
  ------------------
  |  |   39|  5.07k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 1170|       |
 1171|  5.07k|} /* end mp_div_2d() */
mp_mod:
 1279|  3.60M|{
 1280|  3.60M|    mp_err res;
 1281|  3.60M|    int mag;
 1282|       |
 1283|  3.60M|    ARGCHK(a != NULL && m != NULL && c != NULL, MP_BADARG);
  ------------------
  |  |  350|  3.60M|#define ARGCHK(X, Y) assert(X)
  ------------------
 1284|       |
 1285|  3.60M|    if (SIGN(m) == NEG)
  ------------------
  |  |  327|  3.60M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  3.60M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  if (SIGN(m) == NEG)
  ------------------
  |  |  320|  3.60M|#define NEG MP_NEG
  |  |  ------------------
  |  |  |  |   36|  3.60M|#define MP_NEG 1
  |  |  ------------------
  ------------------
  |  Branch (1285:9): [True: 0, False: 3.60M]
  ------------------
 1286|      0|        return MP_RANGE;
  ------------------
  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  ------------------
 1287|       |
 1288|       |    /*
 1289|       |     If |a| > m, we need to divide to get the remainder and take the
 1290|       |     absolute value.
 1291|       |
 1292|       |     If |a| < m, we don't need to do any division, just copy and adjust
 1293|       |     the sign (if a is negative).
 1294|       |
 1295|       |     If |a| == m, we can simply set the result to zero.
 1296|       |
 1297|       |     This order is intended to minimize the average path length of the
 1298|       |     comparison chain on common workloads -- the most frequent cases are
 1299|       |     that |a| != m, so we do those first.
 1300|       |     */
 1301|  3.60M|    if ((mag = s_mp_cmp(a, m)) > 0) {
  ------------------
  |  Branch (1301:9): [True: 3.57M, False: 27.1k]
  ------------------
 1302|  3.57M|        if ((res = mp_div(a, m, NULL, c)) != MP_OKAY)
  ------------------
  |  |   39|  3.57M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1302:13): [True: 0, False: 3.57M]
  ------------------
 1303|      0|            return res;
 1304|       |
 1305|  3.57M|        if (SIGN(c) == NEG) {
  ------------------
  |  |  327|  3.57M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  3.57M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      if (SIGN(c) == NEG) {
  ------------------
  |  |  320|  3.57M|#define NEG MP_NEG
  |  |  ------------------
  |  |  |  |   36|  3.57M|#define MP_NEG 1
  |  |  ------------------
  ------------------
  |  Branch (1305:13): [True: 231, False: 3.57M]
  ------------------
 1306|    231|            if ((res = mp_add(c, m, c)) != MP_OKAY)
  ------------------
  |  |   39|    231|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1306:17): [True: 0, False: 231]
  ------------------
 1307|      0|                return res;
 1308|    231|        }
 1309|       |
 1310|  3.57M|    } else if (mag < 0) {
  ------------------
  |  Branch (1310:16): [True: 27.1k, False: 0]
  ------------------
 1311|  27.1k|        if ((res = mp_copy(a, c)) != MP_OKAY)
  ------------------
  |  |   39|  27.1k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1311:13): [True: 0, False: 27.1k]
  ------------------
 1312|      0|            return res;
 1313|       |
 1314|  27.1k|        if (mp_cmp_z(a) < 0) {
  ------------------
  |  Branch (1314:13): [True: 2.10k, False: 25.0k]
  ------------------
 1315|  2.10k|            if ((res = mp_add(c, m, c)) != MP_OKAY)
  ------------------
  |  |   39|  2.10k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1315:17): [True: 0, False: 2.10k]
  ------------------
 1316|      0|                return res;
 1317|  2.10k|        }
 1318|       |
 1319|  27.1k|    } else {
 1320|      0|        mp_zero(c);
 1321|      0|    }
 1322|       |
 1323|  3.60M|    return MP_OKAY;
  ------------------
  |  |   39|  3.60M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 1324|       |
 1325|  3.60M|} /* end mp_mod() */
mp_mod_d:
 1470|  31.9M|{
 1471|  31.9M|    mp_err res;
 1472|  31.9M|    mp_digit rem;
 1473|       |
 1474|  31.9M|    ARGCHK(a != NULL && c != NULL, MP_BADARG);
  ------------------
  |  |  350|  31.9M|#define ARGCHK(X, Y) assert(X)
  ------------------
 1475|       |
 1476|  31.9M|    if (s_mp_cmp_d(a, d) > 0) {
  ------------------
  |  Branch (1476:9): [True: 31.9M, False: 0]
  ------------------
 1477|  31.9M|        if ((res = mp_div_d(a, d, NULL, &rem)) != MP_OKAY)
  ------------------
  |  |   39|  31.9M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1477:13): [True: 0, False: 31.9M]
  ------------------
 1478|      0|            return res;
 1479|       |
 1480|  31.9M|    } else {
 1481|      0|        if (SIGN(a) == NEG)
  ------------------
  |  |  327|      0|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|      0|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      if (SIGN(a) == NEG)
  ------------------
  |  |  320|      0|#define NEG MP_NEG
  |  |  ------------------
  |  |  |  |   36|      0|#define MP_NEG 1
  |  |  ------------------
  ------------------
  |  Branch (1481:13): [True: 0, False: 0]
  ------------------
 1482|      0|            rem = d - DIGIT(a, 0);
  ------------------
  |  |  331|      0|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|      0|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 1483|      0|        else
 1484|      0|            rem = DIGIT(a, 0);
  ------------------
  |  |  331|      0|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|      0|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 1485|      0|    }
 1486|       |
 1487|  31.9M|    if (c)
  ------------------
  |  Branch (1487:9): [True: 31.9M, False: 0]
  ------------------
 1488|  31.9M|        *c = rem;
 1489|       |
 1490|  31.9M|    return MP_OKAY;
  ------------------
  |  |   39|  31.9M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 1491|       |
 1492|  31.9M|} /* end mp_mod_d() */
mp_mulmod:
 1562|  4.84k|{
 1563|  4.84k|    mp_err res;
 1564|       |
 1565|  4.84k|    ARGCHK(a != NULL && b != NULL && m != NULL && c != NULL, MP_BADARG);
  ------------------
  |  |  350|  4.84k|#define ARGCHK(X, Y) assert(X)
  ------------------
 1566|       |
 1567|  4.84k|    if ((res = mp_mul(a, b, c)) != MP_OKAY)
  ------------------
  |  |   39|  4.84k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1567:9): [True: 0, False: 4.84k]
  ------------------
 1568|      0|        return res;
 1569|  4.84k|    if ((res = mp_mod(c, m, c)) != MP_OKAY)
  ------------------
  |  |   39|  4.84k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1569:9): [True: 0, False: 4.84k]
  ------------------
 1570|      0|        return res;
 1571|       |
 1572|  4.84k|    return MP_OKAY;
  ------------------
  |  |   39|  4.84k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 1573|  4.84k|}
mp_sqrmod:
 1613|  3.38M|{
 1614|  3.38M|    mp_err res;
 1615|       |
 1616|  3.38M|    ARGCHK(a != NULL && m != NULL && c != NULL, MP_BADARG);
  ------------------
  |  |  350|  3.38M|#define ARGCHK(X, Y) assert(X)
  ------------------
 1617|       |
 1618|  3.38M|    if ((res = mp_sqr(a, c)) != MP_OKAY)
  ------------------
  |  |   39|  3.38M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1618:9): [True: 0, False: 3.38M]
  ------------------
 1619|      0|        return res;
 1620|  3.38M|    if ((res = mp_mod(c, m, c)) != MP_OKAY)
  ------------------
  |  |   39|  3.38M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1620:9): [True: 0, False: 3.38M]
  ------------------
 1621|      0|        return res;
 1622|       |
 1623|  3.38M|    return MP_OKAY;
  ------------------
  |  |   39|  3.38M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 1624|       |
 1625|  3.38M|} /* end mp_sqrmod() */
mp_cmp_z:
 1790|  9.13M|{
 1791|  9.13M|    ARGMPCHK(a != NULL);
  ------------------
  |  |  349|  9.13M|#define ARGMPCHK(X) assert(X)
  ------------------
 1792|       |
 1793|  9.13M|    if (SIGN(a) == NEG)
  ------------------
  |  |  327|  9.13M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  9.13M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  if (SIGN(a) == NEG)
  ------------------
  |  |  320|  9.13M|#define NEG MP_NEG
  |  |  ------------------
  |  |  |  |   36|  9.13M|#define MP_NEG 1
  |  |  ------------------
  ------------------
  |  Branch (1793:9): [True: 2.10k, False: 9.12M]
  ------------------
 1794|  2.10k|        return MP_LT;
  ------------------
  |  |   95|  2.10k|#define MP_LT -1
  ------------------
 1795|  9.12M|    else if (USED(a) == 1 && DIGIT(a, 0) == 0)
  ------------------
  |  |  328|  9.12M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  9.12M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                  else if (USED(a) == 1 && DIGIT(a, 0) == 0)
  ------------------
  |  |  331|  1.69M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|  1.69M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
  |  Branch (1795:14): [True: 1.69M, False: 7.43M]
  |  Branch (1795:30): [True: 15.4k, False: 1.68M]
  ------------------
 1796|  15.4k|        return MP_EQ;
  ------------------
  |  |   96|  15.4k|#define MP_EQ 0
  ------------------
 1797|  9.11M|    else
 1798|  9.11M|        return MP_GT;
  ------------------
  |  |   97|  9.11M|#define MP_GT 1
  ------------------
 1799|       |
 1800|  9.13M|} /* end mp_cmp_z() */
mp_cmp_d:
 1814|  3.81M|{
 1815|  3.81M|    ARGCHK(a != NULL, MP_EQ);
  ------------------
  |  |  350|  3.81M|#define ARGCHK(X, Y) assert(X)
  ------------------
 1816|       |
 1817|  3.81M|    if (SIGN(a) == NEG)
  ------------------
  |  |  327|  3.81M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  3.81M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  if (SIGN(a) == NEG)
  ------------------
  |  |  320|  3.81M|#define NEG MP_NEG
  |  |  ------------------
  |  |  |  |   36|  3.81M|#define MP_NEG 1
  |  |  ------------------
  ------------------
  |  Branch (1817:9): [True: 0, False: 3.81M]
  ------------------
 1818|      0|        return MP_LT;
  ------------------
  |  |   95|      0|#define MP_LT -1
  ------------------
 1819|       |
 1820|  3.81M|    return s_mp_cmp_d(a, d);
 1821|       |
 1822|  3.81M|} /* end mp_cmp_d() */
mp_cmp:
 1830|  4.96M|{
 1831|  4.96M|    ARGCHK(a != NULL && b != NULL, MP_EQ);
  ------------------
  |  |  350|  4.96M|#define ARGCHK(X, Y) assert(X)
  ------------------
 1832|       |
 1833|  4.96M|    if (SIGN(a) == SIGN(b)) {
  ------------------
  |  |  327|  4.96M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  4.96M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  if (SIGN(a) == SIGN(b)) {
  ------------------
  |  |  327|  4.96M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  4.96M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
  |  Branch (1833:9): [True: 4.96M, False: 0]
  ------------------
 1834|  4.96M|        int mag;
 1835|       |
 1836|  4.96M|        if ((mag = s_mp_cmp(a, b)) == MP_EQ)
  ------------------
  |  |   96|  4.96M|#define MP_EQ 0
  ------------------
  |  Branch (1836:13): [True: 157k, False: 4.80M]
  ------------------
 1837|   157k|            return MP_EQ;
  ------------------
  |  |   96|   157k|#define MP_EQ 0
  ------------------
 1838|       |
 1839|  4.80M|        if (SIGN(a) == ZPOS)
  ------------------
  |  |  327|  4.80M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  4.80M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      if (SIGN(a) == ZPOS)
  ------------------
  |  |  321|  4.80M|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  4.80M|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
  |  Branch (1839:13): [True: 4.80M, False: 0]
  ------------------
 1840|  4.80M|            return mag;
 1841|      0|        else
 1842|      0|            return -mag;
 1843|       |
 1844|  4.80M|    } else if (SIGN(a) == ZPOS) {
  ------------------
  |  |  327|      0|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|      0|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  } else if (SIGN(a) == ZPOS) {
  ------------------
  |  |  321|      0|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|      0|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
  |  Branch (1844:16): [True: 0, False: 0]
  ------------------
 1845|      0|        return MP_GT;
  ------------------
  |  |   97|      0|#define MP_GT 1
  ------------------
 1846|      0|    } else {
 1847|      0|        return MP_LT;
  ------------------
  |  |   95|      0|#define MP_LT -1
  ------------------
 1848|      0|    }
 1849|       |
 1850|  4.96M|} /* end mp_cmp() */
mp_isodd:
 1882|   239k|{
 1883|   239k|    ARGMPCHK(a != NULL);
  ------------------
  |  |  349|   239k|#define ARGMPCHK(X) assert(X)
  ------------------
 1884|       |
 1885|   239k|    return (int)(DIGIT(a, 0) & 1);
  ------------------
  |  |  331|   239k|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|   239k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 1886|       |
 1887|   239k|} /* end mp_isodd() */
mp_iseven:
 1895|  4.87k|{
 1896|  4.87k|    return !mp_isodd(a);
 1897|       |
 1898|  4.87k|} /* end mp_iseven() */
mp_trailing_zeros:
 2185|  5.07k|{
 2186|  5.07k|    mp_digit d;
 2187|  5.07k|    mp_size n = 0;
 2188|  5.07k|    unsigned int ix;
 2189|       |
 2190|  5.07k|    if (!mp || !MP_DIGITS(mp) || !mp_cmp_z(mp))
  ------------------
  |  |  147|  10.1k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  |  Branch (2190:9): [True: 0, False: 5.07k]
  |  Branch (2190:16): [True: 0, False: 5.07k]
  |  Branch (2190:34): [True: 0, False: 5.07k]
  ------------------
 2191|      0|        return n;
 2192|       |
 2193|  6.46k|    for (ix = 0; !(d = MP_DIGIT(mp, ix)) && (ix < MP_USED(mp)); ++ix)
  ------------------
  |  |  148|  6.46k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
                  for (ix = 0; !(d = MP_DIGIT(mp, ix)) && (ix < MP_USED(mp)); ++ix)
  ------------------
  |  |  145|  1.39k|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (2193:18): [True: 1.39k, False: 5.07k]
  |  Branch (2193:45): [True: 1.39k, False: 0]
  ------------------
 2194|  1.39k|        n += MP_DIGIT_BIT;
  ------------------
  |  |  132|  6.46k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  131|  1.39k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
 2195|  5.07k|    if (!d)
  ------------------
  |  Branch (2195:9): [True: 0, False: 5.07k]
  ------------------
 2196|      0|        return 0; /* shouldn't happen, but ... */
 2197|  5.07k|#if !defined(MP_USE_UINT_DIGIT)
 2198|  5.07k|    if (!(d & 0xffffffffU)) {
  ------------------
  |  Branch (2198:9): [True: 420, False: 4.65k]
  ------------------
 2199|    420|        d >>= 32;
 2200|    420|        n += 32;
 2201|    420|    }
 2202|  5.07k|#endif
 2203|  5.07k|    if (!(d & 0xffffU)) {
  ------------------
  |  Branch (2203:9): [True: 290, False: 4.78k]
  ------------------
 2204|    290|        d >>= 16;
 2205|    290|        n += 16;
 2206|    290|    }
 2207|  5.07k|    if (!(d & 0xffU)) {
  ------------------
  |  Branch (2207:9): [True: 504, False: 4.56k]
  ------------------
 2208|    504|        d >>= 8;
 2209|    504|        n += 8;
 2210|    504|    }
 2211|  5.07k|    if (!(d & 0xfU)) {
  ------------------
  |  Branch (2211:9): [True: 835, False: 4.23k]
  ------------------
 2212|    835|        d >>= 4;
 2213|    835|        n += 4;
 2214|    835|    }
 2215|  5.07k|    if (!(d & 0x3U)) {
  ------------------
  |  Branch (2215:9): [True: 1.69k, False: 3.37k]
  ------------------
 2216|  1.69k|        d >>= 2;
 2217|  1.69k|        n += 2;
 2218|  1.69k|    }
 2219|  5.07k|    if (!(d & 0x1U)) {
  ------------------
  |  Branch (2219:9): [True: 2.71k, False: 2.36k]
  ------------------
 2220|  2.71k|        d >>= 1;
 2221|  2.71k|        n += 1;
 2222|  2.71k|    }
 2223|  5.07k|#if MP_ARGCHK == 2
 2224|  5.07k|    assert(0 != (d & 1));
 2225|  5.07k|#endif
 2226|  5.07k|    return n;
 2227|  5.07k|}
s_mp_invmod_radix:
 2311|   229k|{
 2312|   229k|    mp_digit T = P;
 2313|   229k|    T *= 2 - (P * T);
 2314|   229k|    T *= 2 - (P * T);
 2315|   229k|    T *= 2 - (P * T);
 2316|   229k|    T *= 2 - (P * T);
 2317|   229k|#if !defined(MP_USE_UINT_DIGIT)
 2318|   229k|    T *= 2 - (P * T);
 2319|   229k|    T *= 2 - (P * T);
 2320|   229k|#endif
 2321|   229k|    return T;
 2322|   229k|}
s_mp_invmod_odd_m:
 2374|  4.87k|{
 2375|  4.87k|    mp_err res;
 2376|  4.87k|    mp_digit cond = 0;
 2377|  4.87k|    mp_int g, f, v, r, temp;
 2378|  4.87k|    int i, its, delta = 1, last = -1;
 2379|  4.87k|    mp_size top, flen, glen;
 2380|  4.87k|    mp_int *clear[6];
 2381|       |
 2382|  4.87k|    ARGCHK(a != NULL && m != NULL && c != NULL, MP_BADARG);
  ------------------
  |  |  350|  4.87k|#define ARGCHK(X, Y) assert(X)
  ------------------
 2383|       |    /* Check for invalid inputs. */
 2384|  4.87k|    if (mp_cmp_z(a) == MP_EQ || mp_cmp_d(m, 2) == MP_LT)
  ------------------
  |  |   96|  9.74k|#define MP_EQ 0
  ------------------
                  if (mp_cmp_z(a) == MP_EQ || mp_cmp_d(m, 2) == MP_LT)
  ------------------
  |  |   95|  4.87k|#define MP_LT -1
  ------------------
  |  Branch (2384:9): [True: 0, False: 4.87k]
  |  Branch (2384:33): [True: 0, False: 4.87k]
  ------------------
 2385|      0|        return MP_RANGE;
  ------------------
  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  ------------------
 2386|       |
 2387|  4.87k|    if (a == m || mp_iseven(m))
  ------------------
  |  Branch (2387:9): [True: 0, False: 4.87k]
  |  Branch (2387:19): [True: 0, False: 4.87k]
  ------------------
 2388|      0|        return MP_UNDEF;
  ------------------
  |  |   45|      0|#define MP_UNDEF -5  /* answer is undefined   */
  ------------------
 2389|       |
 2390|  4.87k|    MP_CHECKOK(mp_init(&temp));
  ------------------
  |  |  314|  4.87k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  4.87k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 4.87k]
  |  |  ------------------
  |  |  315|  4.87k|    goto CLEANUP
  ------------------
 2391|  4.87k|    clear[++last] = &temp;
 2392|  4.87k|    MP_CHECKOK(mp_init(&v));
  ------------------
  |  |  314|  4.87k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  4.87k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 4.87k]
  |  |  ------------------
  |  |  315|  4.87k|    goto CLEANUP
  ------------------
 2393|  4.87k|    clear[++last] = &v;
 2394|  4.87k|    MP_CHECKOK(mp_init(&r));
  ------------------
  |  |  314|  4.87k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  4.87k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 4.87k]
  |  |  ------------------
  |  |  315|  4.87k|    goto CLEANUP
  ------------------
 2395|  4.87k|    clear[++last] = &r;
 2396|  4.87k|    MP_CHECKOK(mp_init_copy(&g, a));
  ------------------
  |  |  314|  4.87k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  4.87k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 4.87k]
  |  |  ------------------
  |  |  315|  4.87k|    goto CLEANUP
  ------------------
 2397|  4.87k|    clear[++last] = &g;
 2398|  4.87k|    MP_CHECKOK(mp_init_copy(&f, m));
  ------------------
  |  |  314|  4.87k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  4.87k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 4.87k]
  |  |  ------------------
  |  |  315|  4.87k|    goto CLEANUP
  ------------------
 2399|  4.87k|    clear[++last] = &f;
 2400|       |
 2401|  4.87k|    mp_set(&v, 0);
 2402|  4.87k|    mp_set(&r, 1);
 2403|       |
 2404|       |    /* Allocate to the size of largest mp_int. */
 2405|  4.87k|    top = (mp_size)1 + ((USED(&f) >= USED(&g)) ? USED(&f) : USED(&g));
  ------------------
  |  |  328|  4.87k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  4.87k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                  top = (mp_size)1 + ((USED(&f) >= USED(&g)) ? USED(&f) : USED(&g));
  ------------------
  |  |  328|  4.87k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  4.87k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                  top = (mp_size)1 + ((USED(&f) >= USED(&g)) ? USED(&f) : USED(&g));
  ------------------
  |  |  328|    803|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|    803|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                  top = (mp_size)1 + ((USED(&f) >= USED(&g)) ? USED(&f) : USED(&g));
  ------------------
  |  |  328|  4.06k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  4.06k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (2405:25): [True: 803, False: 4.06k]
  ------------------
 2406|  4.87k|    MP_CHECKOK(s_mp_grow(&f, top));
  ------------------
  |  |  314|  4.87k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  4.87k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 4.87k]
  |  |  ------------------
  |  |  315|  4.87k|    goto CLEANUP
  ------------------
 2407|  4.87k|    MP_CHECKOK(s_mp_grow(&g, top));
  ------------------
  |  |  314|  4.87k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  4.87k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 4.87k]
  |  |  ------------------
  |  |  315|  4.87k|    goto CLEANUP
  ------------------
 2408|  4.87k|    MP_CHECKOK(s_mp_grow(&temp, top));
  ------------------
  |  |  314|  4.87k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  4.87k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 4.87k]
  |  |  ------------------
  |  |  315|  4.87k|    goto CLEANUP
  ------------------
 2409|  4.87k|    MP_CHECKOK(s_mp_grow(&v, top));
  ------------------
  |  |  314|  4.87k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  4.87k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 4.87k]
  |  |  ------------------
  |  |  315|  4.87k|    goto CLEANUP
  ------------------
 2410|  4.87k|    MP_CHECKOK(s_mp_grow(&r, top));
  ------------------
  |  |  314|  4.87k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  4.87k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 4.87k]
  |  |  ------------------
  |  |  315|  4.87k|    goto CLEANUP
  ------------------
 2411|       |
 2412|       |    /* Upper bound for the total iterations. */
 2413|  4.87k|    flen = mpl_significant_bits(&f);
 2414|  4.87k|    glen = mpl_significant_bits(&g);
 2415|  4.87k|    its = 4 + 3 * ((flen >= glen) ? flen : glen);
  ------------------
  |  Branch (2415:20): [True: 333, False: 4.53k]
  ------------------
 2416|       |
 2417|       |#if defined(_MSC_VER)
 2418|       |#pragma warning(push)
 2419|       |#pragma warning(disable : 4146) // Thanks MSVC, we know what we're negating an unsigned mp_digit
 2420|       |#endif
 2421|       |
 2422|  6.31M|    for (i = 0; i < its; i++) {
  ------------------
  |  Branch (2422:17): [True: 6.31M, False: 4.87k]
  ------------------
 2423|       |        /* Step 1: conditional swap. */
 2424|       |        /* Set cond if delta > 0 and g is odd. */
 2425|  6.31M|        cond = (-delta >> (8 * sizeof(delta) - 1)) & DIGIT(&g, 0) & 1;
  ------------------
  |  |  331|  6.31M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|  6.31M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 2426|       |        /* If cond is set replace (delta,f,v) with (-delta,-f,-v). */
 2427|  6.31M|        delta = (-cond & -delta) | ((cond - 1) & delta);
 2428|  6.31M|        SIGN(&f) ^= cond;
  ------------------
  |  |  327|  6.31M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  6.31M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
 2429|  6.31M|        SIGN(&v) ^= cond;
  ------------------
  |  |  327|  6.31M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  6.31M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
 2430|       |        /* If cond is set swap (f,v) with (g,r). */
 2431|  6.31M|        MP_CHECKOK(mp_cswap(cond, &f, &g, top));
  ------------------
  |  |  314|  6.31M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  6.31M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 6.31M]
  |  |  ------------------
  |  |  315|  6.31M|    goto CLEANUP
  ------------------
 2432|  6.31M|        MP_CHECKOK(mp_cswap(cond, &v, &r, top));
  ------------------
  |  |  314|  6.31M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  6.31M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 6.31M]
  |  |  ------------------
  |  |  315|  6.31M|    goto CLEANUP
  ------------------
 2433|       |
 2434|       |        /* Step 2: elemination. */
 2435|       |        /* Update delta */
 2436|  6.31M|        delta++;
 2437|       |        /* If g is odd replace r with (r+v). */
 2438|  6.31M|        MP_CHECKOK(mp_add(&r, &v, &temp));
  ------------------
  |  |  314|  6.31M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  6.31M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 6.31M]
  |  |  ------------------
  |  |  315|  6.31M|    goto CLEANUP
  ------------------
 2439|  6.31M|        MP_CHECKOK(mp_cswap((DIGIT(&g, 0) & 1), &r, &temp, top));
  ------------------
  |  |  314|  6.31M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  6.31M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 6.31M]
  |  |  ------------------
  |  |  315|  6.31M|    goto CLEANUP
  ------------------
 2440|       |        /* If g is odd, right shift (g+f) else right shift g. */
 2441|  6.31M|        MP_CHECKOK(mp_add(&g, &f, &temp));
  ------------------
  |  |  314|  6.31M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  6.31M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 6.31M]
  |  |  ------------------
  |  |  315|  6.31M|    goto CLEANUP
  ------------------
 2442|  6.31M|        MP_CHECKOK(mp_cswap((DIGIT(&g, 0) & 1), &g, &temp, top));
  ------------------
  |  |  314|  6.31M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  6.31M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 6.31M]
  |  |  ------------------
  |  |  315|  6.31M|    goto CLEANUP
  ------------------
 2443|  6.31M|        s_mp_div_2(&g);
 2444|       |        /*
 2445|       |        If r is even, right shift it.
 2446|       |        If r is odd, right shift (r+m) which is even because m is odd.
 2447|       |        We want the result modulo m so adding in multiples of m here vanish.
 2448|       |        */
 2449|  6.31M|        MP_CHECKOK(mp_add(&r, m, &temp));
  ------------------
  |  |  314|  6.31M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  6.31M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 6.31M]
  |  |  ------------------
  |  |  315|  6.31M|    goto CLEANUP
  ------------------
 2450|  6.31M|        MP_CHECKOK(mp_cswap((DIGIT(&r, 0) & 1), &r, &temp, top));
  ------------------
  |  |  314|  6.31M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  6.31M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 6.31M]
  |  |  ------------------
  |  |  315|  6.31M|    goto CLEANUP
  ------------------
 2451|  6.31M|        s_mp_div_2(&r);
 2452|  6.31M|    }
 2453|       |
 2454|       |#if defined(_MSC_VER)
 2455|       |#pragma warning(pop)
 2456|       |#endif
 2457|       |
 2458|       |    /* We have the inverse in v, propagate sign from f. */
 2459|  4.87k|    SIGN(&v) ^= SIGN(&f);
  ------------------
  |  |  327|  4.87k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  4.87k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  SIGN(&v) ^= SIGN(&f);
  ------------------
  |  |  327|  4.87k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  4.87k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
 2460|       |    /* GCD is in f, take the absolute value. */
 2461|  4.87k|    SIGN(&f) = ZPOS;
  ------------------
  |  |  327|  4.87k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  4.87k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  SIGN(&f) = ZPOS;
  ------------------
  |  |  321|  4.87k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  4.87k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 2462|       |
 2463|       |    /* If gcd != 1, not invertible. */
 2464|  4.87k|    if (mp_cmp_d(&f, 1) != MP_EQ) {
  ------------------
  |  |   96|  4.87k|#define MP_EQ 0
  ------------------
  |  Branch (2464:9): [True: 27, False: 4.84k]
  ------------------
 2465|     27|        res = MP_UNDEF;
  ------------------
  |  |   45|     27|#define MP_UNDEF -5  /* answer is undefined   */
  ------------------
 2466|     27|        goto CLEANUP;
 2467|     27|    }
 2468|       |
 2469|       |    /* Return inverse modulo m. */
 2470|  4.84k|    MP_CHECKOK(mp_mod(&v, m, c));
  ------------------
  |  |  314|  4.84k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  4.84k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 4.84k]
  |  |  ------------------
  |  |  315|  4.84k|    goto CLEANUP
  ------------------
 2471|       |
 2472|  4.87k|CLEANUP:
 2473|  29.2k|    while (last >= 0)
  ------------------
  |  Branch (2473:12): [True: 24.3k, False: 4.87k]
  ------------------
 2474|  24.3k|        mp_clear(clear[last--]);
 2475|  4.87k|    return res;
 2476|  4.84k|}
mp_invmod:
 2671|  4.88k|{
 2672|  4.88k|    ARGCHK(a != NULL && m != NULL && c != NULL, MP_BADARG);
  ------------------
  |  |  350|  4.88k|#define ARGCHK(X, Y) assert(X)
  ------------------
 2673|       |
 2674|  4.88k|    if (mp_cmp_z(a) == 0 || mp_cmp_z(m) == 0)
  ------------------
  |  Branch (2674:9): [True: 12, False: 4.87k]
  |  Branch (2674:29): [True: 0, False: 4.87k]
  ------------------
 2675|     12|        return MP_RANGE;
  ------------------
  |  |   43|     12|#define MP_RANGE -3  /* argument out of range */
  ------------------
 2676|       |
 2677|  4.87k|    if (mp_isodd(m)) {
  ------------------
  |  Branch (2677:9): [True: 4.87k, False: 0]
  ------------------
 2678|  4.87k|        return s_mp_invmod_odd_m(a, m, c);
 2679|  4.87k|    }
 2680|      0|    if (mp_iseven(a))
  ------------------
  |  Branch (2680:9): [True: 0, False: 0]
  ------------------
 2681|      0|        return MP_UNDEF; /* not invertable */
  ------------------
  |  |   45|      0|#define MP_UNDEF -5  /* answer is undefined   */
  ------------------
 2682|       |
 2683|      0|    return s_mp_invmod_even_m(a, m, c);
 2684|       |
 2685|      0|} /* end mp_invmod() */
mp_read_raw:
 2735|  4.88k|{
 2736|  4.88k|    int ix;
 2737|  4.88k|    mp_err res;
 2738|  4.88k|    unsigned char *ustr = (unsigned char *)str;
 2739|       |
 2740|  4.88k|    ARGCHK(mp != NULL && str != NULL && len > 0, MP_BADARG);
  ------------------
  |  |  350|  4.88k|#define ARGCHK(X, Y) assert(X)
  ------------------
 2741|       |
 2742|  4.88k|    mp_zero(mp);
 2743|       |
 2744|       |    /* Read the rest of the digits */
 2745|   307k|    for (ix = 1; ix < len; ix++) {
  ------------------
  |  Branch (2745:18): [True: 302k, False: 4.88k]
  ------------------
 2746|   302k|        if ((res = mp_mul_d(mp, 256, mp)) != MP_OKAY)
  ------------------
  |  |   39|   302k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (2746:13): [True: 0, False: 302k]
  ------------------
 2747|      0|            return res;
 2748|   302k|        if ((res = mp_add_d(mp, ustr[ix], mp)) != MP_OKAY)
  ------------------
  |  |   39|   302k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (2748:13): [True: 0, False: 302k]
  ------------------
 2749|      0|            return res;
 2750|   302k|    }
 2751|       |
 2752|       |    /* Get sign from first byte */
 2753|  4.88k|    if (ustr[0])
  ------------------
  |  Branch (2753:9): [True: 4.14k, False: 744]
  ------------------
 2754|  4.14k|        SIGN(mp) = NEG;
  ------------------
  |  |  327|  4.14k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  4.14k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(mp) = NEG;
  ------------------
  |  |  320|  4.14k|#define NEG MP_NEG
  |  |  ------------------
  |  |  |  |   36|  4.14k|#define MP_NEG 1
  |  |  ------------------
  ------------------
 2755|    744|    else
 2756|    744|        SIGN(mp) = ZPOS;
  ------------------
  |  |  327|    744|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|    744|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(mp) = ZPOS;
  ------------------
  |  |  321|    744|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|    744|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 2757|       |
 2758|  4.88k|    return MP_OKAY;
  ------------------
  |  |   39|  4.88k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 2759|       |
 2760|  4.88k|} /* end mp_read_raw() */
mp_toradix:
 2924|  14.6k|{
 2925|  14.6k|    int ix, pos = 0;
 2926|       |
 2927|  14.6k|    ARGCHK(mp != NULL && str != NULL, MP_BADARG);
  ------------------
  |  |  350|  14.6k|#define ARGCHK(X, Y) assert(X)
  ------------------
 2928|  14.6k|    ARGCHK(radix > 1 && radix <= MAX_RADIX, MP_RANGE);
  ------------------
  |  |  350|  14.6k|#define ARGCHK(X, Y) assert(X)
  ------------------
 2929|       |
 2930|  14.6k|    if (mp_cmp_z(mp) == MP_EQ) {
  ------------------
  |  |   96|  14.6k|#define MP_EQ 0
  ------------------
  |  Branch (2930:9): [True: 12, False: 14.6k]
  ------------------
 2931|     12|        str[0] = '0';
 2932|     12|        str[1] = '\0';
 2933|  14.6k|    } else {
 2934|  14.6k|        mp_err res;
 2935|  14.6k|        mp_int tmp;
 2936|  14.6k|        mp_sign sgn;
 2937|  14.6k|        mp_digit rem, rdx = (mp_digit)radix;
 2938|  14.6k|        char ch;
 2939|       |
 2940|  14.6k|        if ((res = mp_init_copy(&tmp, mp)) != MP_OKAY)
  ------------------
  |  |   39|  14.6k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (2940:13): [True: 0, False: 14.6k]
  ------------------
 2941|      0|            return res;
 2942|       |
 2943|       |        /* Save sign for later, and take absolute value */
 2944|  14.6k|        sgn = SIGN(&tmp);
  ------------------
  |  |  327|  14.6k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  14.6k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
 2945|  14.6k|        SIGN(&tmp) = ZPOS;
  ------------------
  |  |  327|  14.6k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  14.6k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(&tmp) = ZPOS;
  ------------------
  |  |  321|  14.6k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  14.6k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 2946|       |
 2947|       |        /* Generate output digits in reverse order      */
 2948|   836k|        while (mp_cmp_z(&tmp) != 0) {
  ------------------
  |  Branch (2948:16): [True: 822k, False: 14.6k]
  ------------------
 2949|   822k|            if ((res = mp_div_d(&tmp, rdx, &tmp, &rem)) != MP_OKAY) {
  ------------------
  |  |   39|   822k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (2949:17): [True: 0, False: 822k]
  ------------------
 2950|      0|                mp_clear(&tmp);
 2951|      0|                return res;
 2952|      0|            }
 2953|       |
 2954|       |            /* Generate digits, use capital letters */
 2955|   822k|            ch = s_mp_todigit(rem, radix, 0);
 2956|       |
 2957|   822k|            str[pos++] = ch;
 2958|   822k|        }
 2959|       |
 2960|       |        /* Add - sign if original value was negative */
 2961|  14.6k|        if (sgn == NEG)
  ------------------
  |  |  320|  14.6k|#define NEG MP_NEG
  |  |  ------------------
  |  |  |  |   36|  14.6k|#define MP_NEG 1
  |  |  ------------------
  ------------------
  |  Branch (2961:13): [True: 0, False: 14.6k]
  ------------------
 2962|      0|            str[pos++] = '-';
 2963|       |
 2964|       |        /* Add trailing NUL to end the string        */
 2965|  14.6k|        str[pos--] = '\0';
 2966|       |
 2967|       |        /* Reverse the digits and sign indicator     */
 2968|  14.6k|        ix = 0;
 2969|   424k|        while (ix < pos) {
  ------------------
  |  Branch (2969:16): [True: 410k, False: 14.6k]
  ------------------
 2970|   410k|            char tmpc = str[ix];
 2971|       |
 2972|   410k|            str[ix] = str[pos];
 2973|   410k|            str[pos] = tmpc;
 2974|   410k|            ++ix;
 2975|   410k|            --pos;
 2976|   410k|        }
 2977|       |
 2978|  14.6k|        mp_clear(&tmp);
 2979|  14.6k|    }
 2980|       |
 2981|  14.6k|    return MP_OKAY;
  ------------------
  |  |   39|  14.6k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 2982|       |
 2983|  14.6k|} /* end mp_toradix() */
s_mp_grow:
 3038|  24.3k|{
 3039|  24.3k|    ARGCHK(mp != NULL, MP_BADARG);
  ------------------
  |  |  350|  24.3k|#define ARGCHK(X, Y) assert(X)
  ------------------
 3040|       |
 3041|  24.3k|    if (min > ALLOC(mp)) {
  ------------------
  |  |  329|  24.3k|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  146|  24.3k|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  |  Branch (3041:9): [True: 0, False: 24.3k]
  ------------------
 3042|      0|        mp_digit *tmp;
 3043|       |
 3044|       |        /* Set min to next nearest default precision block size */
 3045|      0|        min = MP_ROUNDUP(min, s_mp_defprec);
  ------------------
  |  |   89|      0|#define MP_ROUNDUP(a, b) (MP_HOWMANY(a, b) * (b))
  |  |  ------------------
  |  |  |  |   88|      0|#define MP_HOWMANY(a, b) (((a) + (b)-1) / (b))
  |  |  ------------------
  ------------------
 3046|       |
 3047|      0|        if ((tmp = s_mp_alloc(min, sizeof(mp_digit))) == NULL)
  ------------------
  |  Branch (3047:13): [True: 0, False: 0]
  ------------------
 3048|      0|            return MP_MEM;
  ------------------
  |  |   42|      0|#define MP_MEM -2    /* out of memory         */
  ------------------
 3049|       |
 3050|      0|        s_mp_copy(DIGITS(mp), tmp, USED(mp));
  ------------------
  |  |  330|      0|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|      0|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                      s_mp_copy(DIGITS(mp), tmp, USED(mp));
  ------------------
  |  |  328|      0|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|      0|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
 3051|       |
 3052|      0|        s_mp_setz(DIGITS(mp), ALLOC(mp));
  ------------------
  |  |  330|      0|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|      0|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                      s_mp_setz(DIGITS(mp), ALLOC(mp));
  ------------------
  |  |  329|      0|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  146|      0|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
 3053|      0|        s_mp_free(DIGITS(mp));
  ------------------
  |  |  330|      0|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|      0|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
 3054|      0|        DIGITS(mp) = tmp;
  ------------------
  |  |  330|      0|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|      0|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
 3055|      0|        ALLOC(mp) = min;
  ------------------
  |  |  329|      0|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  146|      0|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
 3056|      0|    }
 3057|       |
 3058|  24.3k|    return MP_OKAY;
  ------------------
  |  |   39|  24.3k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3059|       |
 3060|  24.3k|} /* end s_mp_grow() */
s_mp_pad:
 3069|   147M|{
 3070|   147M|    ARGCHK(mp != NULL, MP_BADARG);
  ------------------
  |  |  350|   147M|#define ARGCHK(X, Y) assert(X)
  ------------------
 3071|       |
 3072|   147M|    if (min > USED(mp)) {
  ------------------
  |  |  328|   147M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|   147M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (3072:9): [True: 101M, False: 46.3M]
  ------------------
 3073|   101M|        mp_err res;
 3074|       |
 3075|       |        /* Make sure there is room to increase precision  */
 3076|   101M|        if (min > ALLOC(mp)) {
  ------------------
  |  |  329|   101M|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  146|   101M|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  |  Branch (3076:13): [True: 0, False: 101M]
  ------------------
 3077|      0|            if ((res = s_mp_grow(mp, min)) != MP_OKAY)
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (3077:17): [True: 0, False: 0]
  ------------------
 3078|      0|                return res;
 3079|   101M|        } else {
 3080|   101M|            s_mp_setz(DIGITS(mp) + USED(mp), min - USED(mp));
  ------------------
  |  |  330|   101M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|   101M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                          s_mp_setz(DIGITS(mp) + USED(mp), min - USED(mp));
  ------------------
  |  |  328|   101M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|   101M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                          s_mp_setz(DIGITS(mp) + USED(mp), min - USED(mp));
  ------------------
  |  |  328|   101M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|   101M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
 3081|   101M|        }
 3082|       |
 3083|       |        /* Increase precision; should already be 0-filled */
 3084|   101M|        USED(mp) = min;
  ------------------
  |  |  328|   101M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|   101M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
 3085|   101M|    }
 3086|       |
 3087|   147M|    return MP_OKAY;
  ------------------
  |  |   39|   147M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3088|       |
 3089|   147M|} /* end s_mp_pad() */
s_mp_setz:
 3098|   212M|{
 3099|   212M|    memset(dp, 0, count * sizeof(mp_digit));
 3100|   212M|} /* end s_mp_setz() */
s_mp_copy:
 3109|  75.8M|{
 3110|  75.8M|    memcpy(dp, sp, count * sizeof(mp_digit));
 3111|  75.8M|} /* end s_mp_copy() */
s_mp_alloc:
 3120|  90.5M|{
 3121|  90.5M|    return calloc(nb, ni);
 3122|       |
 3123|  90.5M|} /* end s_mp_alloc() */
s_mp_free:
 3132|  90.5M|{
 3133|  90.5M|    if (ptr) {
  ------------------
  |  Branch (3133:9): [True: 90.5M, False: 0]
  ------------------
 3134|  90.5M|        free(ptr);
 3135|  90.5M|    }
 3136|  90.5M|} /* end s_mp_free() */
s_mp_clamp:
 3145|   182M|{
 3146|   182M|    mp_size used = MP_USED(mp);
  ------------------
  |  |  145|   182M|#define MP_USED(MP) ((MP)->used)
  ------------------
 3147|   494M|    while (used > 1 && DIGIT(mp, used - 1) == 0)
  ------------------
  |  |  331|   460M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|   460M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
  |  Branch (3147:12): [True: 460M, False: 33.7M]
  |  Branch (3147:24): [True: 312M, False: 148M]
  ------------------
 3148|   312M|        --used;
 3149|   182M|    MP_USED(mp) = used;
  ------------------
  |  |  145|   182M|#define MP_USED(MP) ((MP)->used)
  ------------------
 3150|   182M|    if (used == 1 && DIGIT(mp, 0) == 0)
  ------------------
  |  |  331|  33.7M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|  33.7M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
  |  Branch (3150:9): [True: 33.7M, False: 148M]
  |  Branch (3150:22): [True: 3.22M, False: 30.5M]
  ------------------
 3151|  3.22M|        MP_SIGN(mp) = ZPOS;
  ------------------
  |  |  144|  3.22M|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
                      MP_SIGN(mp) = ZPOS;
  ------------------
  |  |  321|  3.22M|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  3.22M|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 3152|   182M|} /* end s_mp_clamp() */
s_mp_exch:
 3161|  23.1M|{
 3162|  23.1M|    mp_int tmp;
 3163|  23.1M|    if (!a || !b) {
  ------------------
  |  Branch (3163:9): [True: 0, False: 23.1M]
  |  Branch (3163:15): [True: 0, False: 23.1M]
  ------------------
 3164|      0|        return;
 3165|      0|    }
 3166|       |
 3167|  23.1M|    tmp = *a;
 3168|  23.1M|    *a = *b;
 3169|  23.1M|    *b = tmp;
 3170|       |
 3171|  23.1M|} /* end s_mp_exch() */
s_mp_lshd:
 3189|  76.6M|{
 3190|  76.6M|    mp_err res;
 3191|  76.6M|    unsigned int ix;
 3192|       |
 3193|  76.6M|    ARGCHK(mp != NULL, MP_BADARG);
  ------------------
  |  |  350|  76.6M|#define ARGCHK(X, Y) assert(X)
  ------------------
 3194|       |
 3195|  76.6M|    if (p == 0)
  ------------------
  |  Branch (3195:9): [True: 0, False: 76.6M]
  ------------------
 3196|      0|        return MP_OKAY;
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3197|       |
 3198|  76.6M|    if (MP_USED(mp) == 1 && MP_DIGIT(mp, 0) == 0)
  ------------------
  |  |  145|  76.6M|#define MP_USED(MP) ((MP)->used)
  ------------------
                  if (MP_USED(mp) == 1 && MP_DIGIT(mp, 0) == 0)
  ------------------
  |  |  148|  52.9M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
  |  Branch (3198:9): [True: 52.9M, False: 23.6M]
  |  Branch (3198:29): [True: 36.5M, False: 16.3M]
  ------------------
 3199|  36.5M|        return MP_OKAY;
  ------------------
  |  |   39|  36.5M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3200|       |
 3201|  40.0M|    if ((res = s_mp_pad(mp, USED(mp) + p)) != MP_OKAY)
  ------------------
  |  |  328|  40.0M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  40.0M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                  if ((res = s_mp_pad(mp, USED(mp) + p)) != MP_OKAY)
  ------------------
  |  |   39|  40.0M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (3201:9): [True: 0, False: 40.0M]
  ------------------
 3202|      0|        return res;
 3203|       |
 3204|       |    /* Shift all the significant figures over as needed */
 3205|   130M|    for (ix = USED(mp) - p; ix-- > 0;) {
  ------------------
  |  |  328|  40.0M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  40.0M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (3205:29): [True: 90.7M, False: 40.0M]
  ------------------
 3206|  90.7M|        DIGIT(mp, ix + p) = DIGIT(mp, ix);
  ------------------
  |  |  331|  90.7M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|  90.7M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
                      DIGIT(mp, ix + p) = DIGIT(mp, ix);
  ------------------
  |  |  331|  90.7M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|  90.7M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 3207|  90.7M|    }
 3208|       |
 3209|       |    /* Fill the bottom digits with zeroes */
 3210|  80.6M|    for (ix = 0; (mp_size)ix < p; ix++)
  ------------------
  |  Branch (3210:18): [True: 40.5M, False: 40.0M]
  ------------------
 3211|  40.5M|        DIGIT(mp, ix) = 0;
  ------------------
  |  |  331|  40.5M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|  40.5M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 3212|       |
 3213|  40.0M|    return MP_OKAY;
  ------------------
  |  |   39|  40.0M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3214|       |
 3215|  40.0M|} /* end s_mp_lshd() */
s_mp_mul_2d:
 3227|  44.7M|{
 3228|  44.7M|    mp_err res;
 3229|  44.7M|    mp_digit dshift, rshift, mask, x, prev = 0;
 3230|  44.7M|    mp_digit *pa = NULL;
 3231|  44.7M|    int i;
 3232|       |
 3233|  44.7M|    ARGCHK(mp != NULL, MP_BADARG);
  ------------------
  |  |  350|  44.7M|#define ARGCHK(X, Y) assert(X)
  ------------------
 3234|       |
 3235|  44.7M|    dshift = d / MP_DIGIT_BIT;
  ------------------
  |  |  132|  44.7M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  131|  44.7M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
 3236|  44.7M|    d %= MP_DIGIT_BIT;
  ------------------
  |  |  132|  44.7M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  131|  44.7M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
 3237|       |    /* mp_digit >> rshift is undefined behavior for rshift >= MP_DIGIT_BIT */
 3238|       |    /* mod and corresponding mask logic avoid that when d = 0 */
 3239|  44.7M|    rshift = MP_DIGIT_BIT - d;
  ------------------
  |  |  132|  44.7M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  131|  44.7M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
 3240|  44.7M|    rshift %= MP_DIGIT_BIT;
  ------------------
  |  |  132|  44.7M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  131|  44.7M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
 3241|       |    /* mask = (2**d - 1) * 2**(w-d) mod 2**w */
 3242|  44.7M|    mask = (DIGIT_MAX << rshift) + 1;
  ------------------
  |  |  322|  44.7M|#define DIGIT_MAX MP_DIGIT_MAX
  |  |  ------------------
  |  |  |  |   74|  44.7M|#define MP_DIGIT_MAX ULONG_MAX
  |  |  ------------------
  ------------------
 3243|  44.7M|    mask &= DIGIT_MAX - 1;
  ------------------
  |  |  322|  44.7M|#define DIGIT_MAX MP_DIGIT_MAX
  |  |  ------------------
  |  |  |  |   74|  44.7M|#define MP_DIGIT_MAX ULONG_MAX
  |  |  ------------------
  ------------------
 3244|       |    /* bits to be shifted out of the top word */
 3245|  44.7M|    x = MP_DIGIT(mp, MP_USED(mp) - 1) & mask;
  ------------------
  |  |  148|  44.7M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 3246|       |
 3247|  44.7M|    if (MP_OKAY != (res = s_mp_pad(mp, MP_USED(mp) + dshift + (x != 0))))
  ------------------
  |  |   39|  44.7M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
                  if (MP_OKAY != (res = s_mp_pad(mp, MP_USED(mp) + dshift + (x != 0))))
  ------------------
  |  |  145|  44.7M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (3247:9): [True: 0, False: 44.7M]
  ------------------
 3248|      0|        return res;
 3249|       |
 3250|  44.7M|    if (dshift && MP_OKAY != (res = s_mp_lshd(mp, dshift)))
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (3250:9): [True: 0, False: 44.7M]
  |  Branch (3250:19): [True: 0, False: 0]
  ------------------
 3251|      0|        return res;
 3252|       |
 3253|  44.7M|    pa = MP_DIGITS(mp) + dshift;
  ------------------
  |  |  147|  44.7M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 3254|       |
 3255|   178M|    for (i = MP_USED(mp) - dshift; i > 0; i--) {
  ------------------
  |  |  145|  44.7M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (3255:36): [True: 133M, False: 44.7M]
  ------------------
 3256|   133M|        x = *pa;
 3257|   133M|        *pa++ = (x << d) | prev;
 3258|   133M|        prev = (x & mask) >> rshift;
 3259|   133M|    }
 3260|       |
 3261|  44.7M|    s_mp_clamp(mp);
 3262|  44.7M|    return MP_OKAY;
  ------------------
  |  |   39|  44.7M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3263|  44.7M|} /* end s_mp_mul_2d() */
s_mp_rshd:
 3275|  46.8M|{
 3276|  46.8M|    mp_size ix;
 3277|  46.8M|    mp_digit *src, *dst;
 3278|       |
 3279|  46.8M|    if (p == 0)
  ------------------
  |  Branch (3279:9): [True: 17.0M, False: 29.8M]
  ------------------
 3280|  17.0M|        return;
 3281|       |
 3282|       |    /* Shortcut when all digits are to be shifted off */
 3283|  29.8M|    if (p >= USED(mp)) {
  ------------------
  |  |  328|  29.8M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  29.8M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (3283:9): [True: 0, False: 29.8M]
  ------------------
 3284|      0|        s_mp_setz(DIGITS(mp), ALLOC(mp));
  ------------------
  |  |  330|      0|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|      0|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                      s_mp_setz(DIGITS(mp), ALLOC(mp));
  ------------------
  |  |  329|      0|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  146|      0|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
 3285|      0|        USED(mp) = 1;
  ------------------
  |  |  328|      0|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|      0|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
 3286|      0|        SIGN(mp) = ZPOS;
  ------------------
  |  |  327|      0|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|      0|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(mp) = ZPOS;
  ------------------
  |  |  321|      0|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|      0|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 3287|      0|        return;
 3288|      0|    }
 3289|       |
 3290|       |    /* Shift all the significant figures over as needed */
 3291|  29.8M|    dst = MP_DIGITS(mp);
  ------------------
  |  |  147|  29.8M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 3292|  29.8M|    src = dst + p;
 3293|   138M|    for (ix = USED(mp) - p; ix > 0; ix--)
  ------------------
  |  |  328|  29.8M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  29.8M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (3293:29): [True: 108M, False: 29.8M]
  ------------------
 3294|   108M|        *dst++ = *src++;
 3295|       |
 3296|  29.8M|    MP_USED(mp) -= p;
  ------------------
  |  |  145|  29.8M|#define MP_USED(MP) ((MP)->used)
  ------------------
 3297|       |    /* Fill the top digits with zeroes */
 3298|   138M|    while (p-- > 0)
  ------------------
  |  Branch (3298:12): [True: 109M, False: 29.8M]
  ------------------
 3299|   109M|        *dst++ = 0;
 3300|       |
 3301|  29.8M|} /* end s_mp_rshd() */
s_mp_div_2:
 3310|  12.6M|{
 3311|  12.6M|    s_mp_div_2d(mp, 1);
 3312|       |
 3313|  12.6M|} /* end s_mp_div_2() */
s_mp_mul_2:
 3321|  12.9M|{
 3322|  12.9M|    mp_digit *pd;
 3323|  12.9M|    unsigned int ix, used;
 3324|  12.9M|    mp_digit kin = 0;
 3325|       |
 3326|  12.9M|    ARGCHK(mp != NULL, MP_BADARG);
  ------------------
  |  |  350|  12.9M|#define ARGCHK(X, Y) assert(X)
  ------------------
 3327|       |
 3328|       |    /* Shift digits leftward by 1 bit */
 3329|  12.9M|    used = MP_USED(mp);
  ------------------
  |  |  145|  12.9M|#define MP_USED(MP) ((MP)->used)
  ------------------
 3330|  12.9M|    pd = MP_DIGITS(mp);
  ------------------
  |  |  147|  12.9M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 3331|   110M|    for (ix = 0; ix < used; ix++) {
  ------------------
  |  Branch (3331:18): [True: 97.5M, False: 12.9M]
  ------------------
 3332|  97.5M|        mp_digit d = *pd;
 3333|  97.5M|        *pd++ = (d << 1) | kin;
 3334|  97.5M|        kin = (d >> (DIGIT_BIT - 1));
  ------------------
  |  |  323|  97.5M|#define DIGIT_BIT MP_DIGIT_BIT
  |  |  ------------------
  |  |  |  |  132|  97.5M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  97.5M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3335|  97.5M|    }
 3336|       |
 3337|       |    /* Deal with rollover from last digit */
 3338|  12.9M|    if (kin) {
  ------------------
  |  Branch (3338:9): [True: 0, False: 12.9M]
  ------------------
 3339|      0|        if (ix >= ALLOC(mp)) {
  ------------------
  |  |  329|      0|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  146|      0|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  |  Branch (3339:13): [True: 0, False: 0]
  ------------------
 3340|      0|            mp_err res;
 3341|      0|            if ((res = s_mp_grow(mp, ALLOC(mp) + 1)) != MP_OKAY)
  ------------------
  |  |  329|      0|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  146|      0|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
                          if ((res = s_mp_grow(mp, ALLOC(mp) + 1)) != MP_OKAY)
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (3341:17): [True: 0, False: 0]
  ------------------
 3342|      0|                return res;
 3343|      0|        }
 3344|       |
 3345|      0|        DIGIT(mp, ix) = kin;
  ------------------
  |  |  331|      0|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|      0|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 3346|      0|        USED(mp) += 1;
  ------------------
  |  |  328|      0|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|      0|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
 3347|      0|    }
 3348|       |
 3349|  12.9M|    return MP_OKAY;
  ------------------
  |  |   39|  12.9M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3350|       |
 3351|  12.9M|} /* end s_mp_mul_2() */
s_mp_div_2d:
 3395|  17.0M|{
 3396|  17.0M|    int ix;
 3397|  17.0M|    mp_digit save, next, mask, lshift;
 3398|       |
 3399|  17.0M|    s_mp_rshd(mp, d / DIGIT_BIT);
  ------------------
  |  |  323|  17.0M|#define DIGIT_BIT MP_DIGIT_BIT
  |  |  ------------------
  |  |  |  |  132|  17.0M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  17.0M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3400|  17.0M|    d %= DIGIT_BIT;
  ------------------
  |  |  323|  17.0M|#define DIGIT_BIT MP_DIGIT_BIT
  |  |  ------------------
  |  |  |  |  132|  17.0M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  17.0M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3401|       |    /* mp_digit << lshift is undefined behavior for lshift >= MP_DIGIT_BIT */
 3402|       |    /* mod and corresponding mask logic avoid that when d = 0 */
 3403|  17.0M|    lshift = DIGIT_BIT - d;
  ------------------
  |  |  323|  17.0M|#define DIGIT_BIT MP_DIGIT_BIT
  |  |  ------------------
  |  |  |  |  132|  17.0M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  17.0M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3404|  17.0M|    lshift %= DIGIT_BIT;
  ------------------
  |  |  323|  17.0M|#define DIGIT_BIT MP_DIGIT_BIT
  |  |  ------------------
  |  |  |  |  132|  17.0M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  17.0M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3405|  17.0M|    mask = ((mp_digit)1 << d) - 1;
 3406|  17.0M|    save = 0;
 3407|  87.7M|    for (ix = USED(mp) - 1; ix >= 0; ix--) {
  ------------------
  |  |  328|  17.0M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  17.0M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (3407:29): [True: 70.7M, False: 17.0M]
  ------------------
 3408|  70.7M|        next = DIGIT(mp, ix) & mask;
  ------------------
  |  |  331|  70.7M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|  70.7M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 3409|  70.7M|        DIGIT(mp, ix) = (save << lshift) | (DIGIT(mp, ix) >> d);
  ------------------
  |  |  331|  70.7M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|  70.7M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
                      DIGIT(mp, ix) = (save << lshift) | (DIGIT(mp, ix) >> d);
  ------------------
  |  |  331|  70.7M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|  70.7M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 3410|  70.7M|        save = next;
 3411|  70.7M|    }
 3412|  17.0M|    s_mp_clamp(mp);
 3413|       |
 3414|  17.0M|} /* end s_mp_div_2d() */
s_mp_norm:
 3433|  22.5M|{
 3434|  22.5M|    mp_digit d;
 3435|  22.5M|    mp_digit mask;
 3436|  22.5M|    mp_digit b_msd;
 3437|  22.5M|    mp_err res = MP_OKAY;
  ------------------
  |  |   39|  22.5M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3438|       |
 3439|  22.5M|    ARGCHK(a != NULL && b != NULL && pd != NULL, MP_BADARG);
  ------------------
  |  |  350|  22.5M|#define ARGCHK(X, Y) assert(X)
  ------------------
 3440|       |
 3441|  22.5M|    d = 0;
 3442|  22.5M|    mask = DIGIT_MAX & ~(DIGIT_MAX >> 1); /* mask is msb of digit */
  ------------------
  |  |  322|  22.5M|#define DIGIT_MAX MP_DIGIT_MAX
  |  |  ------------------
  |  |  |  |   74|  22.5M|#define MP_DIGIT_MAX ULONG_MAX
  |  |  ------------------
  ------------------
                  mask = DIGIT_MAX & ~(DIGIT_MAX >> 1); /* mask is msb of digit */
  ------------------
  |  |  322|  22.5M|#define DIGIT_MAX MP_DIGIT_MAX
  |  |  ------------------
  |  |  |  |   74|  22.5M|#define MP_DIGIT_MAX ULONG_MAX
  |  |  ------------------
  ------------------
 3443|  22.5M|    b_msd = DIGIT(b, USED(b) - 1);
  ------------------
  |  |  331|  22.5M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|  22.5M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 3444|  1.05G|    while (!(b_msd & mask)) {
  ------------------
  |  Branch (3444:12): [True: 1.03G, False: 22.5M]
  ------------------
 3445|  1.03G|        b_msd <<= 1;
 3446|  1.03G|        ++d;
 3447|  1.03G|    }
 3448|       |
 3449|  22.5M|    if (d) {
  ------------------
  |  Branch (3449:9): [True: 22.1M, False: 416k]
  ------------------
 3450|  22.1M|        MP_CHECKOK(s_mp_mul_2d(a, d));
  ------------------
  |  |  314|  22.1M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  22.1M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 22.1M]
  |  |  ------------------
  |  |  315|  22.1M|    goto CLEANUP
  ------------------
 3451|  22.1M|        MP_CHECKOK(s_mp_mul_2d(b, d));
  ------------------
  |  |  314|  22.1M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  22.1M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 22.1M]
  |  |  ------------------
  |  |  315|  22.1M|    goto CLEANUP
  ------------------
 3452|  22.1M|    }
 3453|       |
 3454|  22.5M|    *pd = d;
 3455|  22.5M|CLEANUP:
 3456|  22.5M|    return res;
 3457|       |
 3458|  22.5M|} /* end s_mp_norm() */
s_mp_add_d:
 3471|   328k|{
 3472|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_ADD_WORD)
 3473|       |    mp_word w, k = 0;
 3474|       |    mp_size ix = 1;
 3475|       |
 3476|       |    w = (mp_word)DIGIT(mp, 0) + d;
 3477|       |    DIGIT(mp, 0) = ACCUM(w);
 3478|       |    k = CARRYOUT(w);
 3479|       |
 3480|       |    while (ix < USED(mp) && k) {
 3481|       |        w = (mp_word)DIGIT(mp, ix) + k;
 3482|       |        DIGIT(mp, ix) = ACCUM(w);
 3483|       |        k = CARRYOUT(w);
 3484|       |        ++ix;
 3485|       |    }
 3486|       |
 3487|       |    if (k != 0) {
 3488|       |        mp_err res;
 3489|       |
 3490|       |        if ((res = s_mp_pad(mp, USED(mp) + 1)) != MP_OKAY)
 3491|       |            return res;
 3492|       |
 3493|       |        DIGIT(mp, ix) = (mp_digit)k;
 3494|       |    }
 3495|       |
 3496|       |    return MP_OKAY;
 3497|       |#else
 3498|   328k|    mp_digit *pmp = MP_DIGITS(mp);
  ------------------
  |  |  147|   328k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 3499|   328k|    mp_digit sum, mp_i, carry = 0;
 3500|   328k|    mp_err res = MP_OKAY;
  ------------------
  |  |   39|   328k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3501|   328k|    int used = (int)MP_USED(mp);
  ------------------
  |  |  145|   328k|#define MP_USED(MP) ((MP)->used)
  ------------------
 3502|       |
 3503|   328k|    mp_i = *pmp;
 3504|   328k|    *pmp++ = sum = d + mp_i;
 3505|   328k|    carry = (sum < d);
 3506|   337k|    while (carry && --used > 0) {
  ------------------
  |  Branch (3506:12): [True: 10.0k, False: 327k]
  |  Branch (3506:21): [True: 8.76k, False: 1.24k]
  ------------------
 3507|  8.76k|        mp_i = *pmp;
 3508|  8.76k|        *pmp++ = sum = carry + mp_i;
 3509|  8.76k|        carry = !sum;
 3510|  8.76k|    }
 3511|   328k|    if (carry && !used) {
  ------------------
  |  Branch (3511:9): [True: 1.24k, False: 327k]
  |  Branch (3511:18): [True: 1.24k, False: 0]
  ------------------
 3512|       |        /* mp is growing */
 3513|  1.24k|        used = MP_USED(mp);
  ------------------
  |  |  145|  1.24k|#define MP_USED(MP) ((MP)->used)
  ------------------
 3514|  1.24k|        MP_CHECKOK(s_mp_pad(mp, used + 1));
  ------------------
  |  |  314|  1.24k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  1.24k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 1.24k]
  |  |  ------------------
  |  |  315|  1.24k|    goto CLEANUP
  ------------------
 3515|  1.24k|        MP_DIGIT(mp, used) = carry;
  ------------------
  |  |  148|  1.24k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 3516|  1.24k|    }
 3517|   328k|CLEANUP:
 3518|   328k|    return res;
 3519|   328k|#endif
 3520|   328k|} /* end s_mp_add_d() */
s_mp_sub_d:
 3529|  5.07k|{
 3530|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_SUB_WORD)
 3531|       |    mp_word w, b = 0;
 3532|       |    mp_size ix = 1;
 3533|       |
 3534|       |    /* Compute initial subtraction    */
 3535|       |    w = (RADIX + (mp_word)DIGIT(mp, 0)) - d;
 3536|       |    b = CARRYOUT(w) ? 0 : 1;
 3537|       |    DIGIT(mp, 0) = ACCUM(w);
 3538|       |
 3539|       |    /* Propagate borrows leftward     */
 3540|       |    while (b && ix < USED(mp)) {
 3541|       |        w = (RADIX + (mp_word)DIGIT(mp, ix)) - b;
 3542|       |        b = CARRYOUT(w) ? 0 : 1;
 3543|       |        DIGIT(mp, ix) = ACCUM(w);
 3544|       |        ++ix;
 3545|       |    }
 3546|       |
 3547|       |    /* Remove leading zeroes          */
 3548|       |    s_mp_clamp(mp);
 3549|       |
 3550|       |    /* If we have a borrow out, it's a violation of the input invariant */
 3551|       |    if (b)
 3552|       |        return MP_RANGE;
 3553|       |    else
 3554|       |        return MP_OKAY;
 3555|       |#else
 3556|  5.07k|    mp_digit *pmp = MP_DIGITS(mp);
  ------------------
  |  |  147|  5.07k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 3557|  5.07k|    mp_digit mp_i, diff, borrow;
 3558|  5.07k|    mp_size used = MP_USED(mp);
  ------------------
  |  |  145|  5.07k|#define MP_USED(MP) ((MP)->used)
  ------------------
 3559|       |
 3560|  5.07k|    mp_i = *pmp;
 3561|  5.07k|    *pmp++ = diff = mp_i - d;
 3562|  5.07k|    borrow = (diff > mp_i);
 3563|  5.07k|    while (borrow && --used) {
  ------------------
  |  Branch (3563:12): [True: 0, False: 5.07k]
  |  Branch (3563:22): [True: 0, False: 0]
  ------------------
 3564|      0|        mp_i = *pmp;
 3565|      0|        *pmp++ = diff = mp_i - borrow;
 3566|      0|        borrow = (diff > mp_i);
 3567|      0|    }
 3568|  5.07k|    s_mp_clamp(mp);
 3569|  5.07k|    return (borrow && !used) ? MP_RANGE : MP_OKAY;
  ------------------
  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  ------------------
                  return (borrow && !used) ? MP_RANGE : MP_OKAY;
  ------------------
  |  |   39|  5.07k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (3569:13): [True: 0, False: 5.07k]
  |  Branch (3569:23): [True: 0, False: 0]
  ------------------
 3570|  5.07k|#endif
 3571|  5.07k|} /* end s_mp_sub_d() */
s_mp_mul_d:
 3580|  13.0M|{
 3581|  13.0M|    mp_err res;
 3582|  13.0M|    mp_size used;
 3583|  13.0M|    int pow;
 3584|       |
 3585|  13.0M|    if (!d) {
  ------------------
  |  Branch (3585:9): [True: 0, False: 13.0M]
  ------------------
 3586|      0|        mp_zero(a);
 3587|      0|        return MP_OKAY;
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3588|      0|    }
 3589|  13.0M|    if (d == 1)
  ------------------
  |  Branch (3589:9): [True: 59.1k, False: 13.0M]
  ------------------
 3590|  59.1k|        return MP_OKAY;
  ------------------
  |  |   39|  59.1k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3591|  13.0M|    if (0 <= (pow = s_mp_ispow2d(d))) {
  ------------------
  |  Branch (3591:9): [True: 438k, False: 12.5M]
  ------------------
 3592|   438k|        return s_mp_mul_2d(a, (mp_digit)pow);
 3593|   438k|    }
 3594|       |
 3595|  12.5M|    used = MP_USED(a);
  ------------------
  |  |  145|  12.5M|#define MP_USED(MP) ((MP)->used)
  ------------------
 3596|  12.5M|    MP_CHECKOK(s_mp_pad(a, used + 1));
  ------------------
  |  |  314|  12.5M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  12.5M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 12.5M]
  |  |  ------------------
  |  |  315|  12.5M|    goto CLEANUP
  ------------------
 3597|       |
 3598|  12.5M|    s_mpv_mul_d(MP_DIGITS(a), used, d, MP_DIGITS(a));
  ------------------
  |  |  189|  12.5M|    ((mp_digit *)c)[a_len] = s_mpv_mul_set_vec64(c, a, a_len, b)
  ------------------
 3599|       |
 3600|  12.5M|    s_mp_clamp(a);
 3601|       |
 3602|  12.5M|CLEANUP:
 3603|  12.5M|    return res;
 3604|       |
 3605|  12.5M|} /* end s_mp_mul_d() */
s_mp_div_d:
 3620|  31.9M|{
 3621|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_DIV_WORD)
 3622|       |    mp_word w = 0, q;
 3623|       |#else
 3624|  31.9M|    mp_digit w = 0, q;
 3625|  31.9M|#endif
 3626|  31.9M|    int ix;
 3627|  31.9M|    mp_err res;
 3628|  31.9M|    mp_int quot;
 3629|  31.9M|    mp_int rem;
 3630|       |
 3631|  31.9M|    if (d == 0)
  ------------------
  |  Branch (3631:9): [True: 0, False: 31.9M]
  ------------------
 3632|      0|        return MP_RANGE;
  ------------------
  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  ------------------
 3633|  31.9M|    if (d == 1) {
  ------------------
  |  Branch (3633:9): [True: 0, False: 31.9M]
  ------------------
 3634|      0|        if (r)
  ------------------
  |  Branch (3634:13): [True: 0, False: 0]
  ------------------
 3635|      0|            *r = 0;
 3636|      0|        return MP_OKAY;
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3637|      0|    }
 3638|       |    /* could check for power of 2 here, but mp_div_d does that. */
 3639|  31.9M|    if (MP_USED(mp) == 1) {
  ------------------
  |  |  145|  31.9M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (3639:9): [True: 13.3M, False: 18.5M]
  ------------------
 3640|  13.3M|        mp_digit n = MP_DIGIT(mp, 0);
  ------------------
  |  |  148|  13.3M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 3641|  13.3M|        mp_digit remdig;
 3642|       |
 3643|  13.3M|        q = n / d;
 3644|  13.3M|        remdig = n % d;
 3645|  13.3M|        MP_DIGIT(mp, 0) = q;
  ------------------
  |  |  148|  13.3M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 3646|  13.3M|        if (r) {
  ------------------
  |  Branch (3646:13): [True: 13.3M, False: 0]
  ------------------
 3647|  13.3M|            *r = remdig;
 3648|  13.3M|        }
 3649|  13.3M|        return MP_OKAY;
  ------------------
  |  |   39|  13.3M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3650|  13.3M|    }
 3651|       |
 3652|  18.5M|    MP_DIGITS(&rem) = 0;
  ------------------
  |  |  147|  18.5M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 3653|  18.5M|    MP_DIGITS(&quot) = 0;
  ------------------
  |  |  147|  18.5M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 3654|       |    /* Make room for the quotient */
 3655|  18.5M|    MP_CHECKOK(mp_init_size(&quot, USED(mp)));
  ------------------
  |  |  314|  18.5M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  18.5M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 18.5M]
  |  |  ------------------
  |  |  315|  18.5M|    goto CLEANUP
  ------------------
 3656|       |
 3657|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_DIV_WORD)
 3658|       |    for (ix = USED(mp) - 1; ix >= 0; ix--) {
 3659|       |        w = (w << DIGIT_BIT) | DIGIT(mp, ix);
 3660|       |
 3661|       |        if (w >= d) {
 3662|       |            q = w / d;
 3663|       |            w = w % d;
 3664|       |        } else {
 3665|       |            q = 0;
 3666|       |        }
 3667|       |
 3668|       |        s_mp_lshd(&quot, 1);
 3669|       |        DIGIT(&quot, 0) = (mp_digit)q;
 3670|       |    }
 3671|       |#else
 3672|  18.5M|    {
 3673|  18.5M|        mp_digit p;
 3674|  18.5M|#if !defined(MP_ASSEMBLY_DIV_2DX1D)
 3675|  18.5M|        mp_digit norm;
 3676|  18.5M|#endif
 3677|       |
 3678|  18.5M|        MP_CHECKOK(mp_init_copy(&rem, mp));
  ------------------
  |  |  314|  18.5M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  18.5M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 18.5M]
  |  |  ------------------
  |  |  315|  18.5M|    goto CLEANUP
  ------------------
 3679|       |
 3680|  18.5M|#if !defined(MP_ASSEMBLY_DIV_2DX1D)
 3681|  18.5M|        MP_DIGIT(&quot, 0) = d;
  ------------------
  |  |  148|  18.5M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 3682|  18.5M|        MP_CHECKOK(s_mp_norm(&rem, &quot, &norm));
  ------------------
  |  |  314|  18.5M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  18.5M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 18.5M]
  |  |  ------------------
  |  |  315|  18.5M|    goto CLEANUP
  ------------------
 3683|  18.5M|        if (norm)
  ------------------
  |  Branch (3683:13): [True: 18.5M, False: 0]
  ------------------
 3684|  18.5M|            d <<= norm;
 3685|  18.5M|        MP_DIGIT(&quot, 0) = 0;
  ------------------
  |  |  148|  18.5M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 3686|  18.5M|#endif
 3687|       |
 3688|  18.5M|        p = 0;
 3689|  94.7M|        for (ix = USED(&rem) - 1; ix >= 0; ix--) {
  ------------------
  |  |  328|  18.5M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  18.5M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (3689:35): [True: 76.1M, False: 18.5M]
  ------------------
 3690|  76.1M|            w = DIGIT(&rem, ix);
  ------------------
  |  |  331|  76.1M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|  76.1M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 3691|       |
 3692|  76.1M|            if (p) {
  ------------------
  |  Branch (3692:17): [True: 57.6M, False: 18.5M]
  ------------------
 3693|  57.6M|                MP_CHECKOK(s_mpv_div_2dx1d(p, w, d, &q, &w));
  ------------------
  |  |  314|  57.6M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  57.6M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 57.6M]
  |  |  ------------------
  |  |  315|  57.6M|    goto CLEANUP
  ------------------
 3694|  57.6M|            } else if (w >= d) {
  ------------------
  |  Branch (3694:24): [True: 508k, False: 18.0M]
  ------------------
 3695|   508k|                q = w / d;
 3696|   508k|                w = w % d;
 3697|  18.0M|            } else {
 3698|  18.0M|                q = 0;
 3699|  18.0M|            }
 3700|       |
 3701|  76.1M|            MP_CHECKOK(s_mp_lshd(&quot, 1));
  ------------------
  |  |  314|  76.1M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  76.1M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 76.1M]
  |  |  ------------------
  |  |  315|  76.1M|    goto CLEANUP
  ------------------
 3702|  76.1M|            DIGIT(&quot, 0) = q;
  ------------------
  |  |  331|  76.1M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|  76.1M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 3703|  76.1M|            p = w;
 3704|  76.1M|        }
 3705|  18.5M|#if !defined(MP_ASSEMBLY_DIV_2DX1D)
 3706|  18.5M|        if (norm)
  ------------------
  |  Branch (3706:13): [True: 18.5M, False: 0]
  ------------------
 3707|  18.5M|            w >>= norm;
 3708|  18.5M|#endif
 3709|  18.5M|    }
 3710|      0|#endif
 3711|       |
 3712|       |    /* Deliver the remainder, if desired */
 3713|  18.5M|    if (r) {
  ------------------
  |  Branch (3713:9): [True: 18.5M, False: 0]
  ------------------
 3714|  18.5M|        *r = (mp_digit)w;
 3715|  18.5M|    }
 3716|       |
 3717|  18.5M|    s_mp_clamp(&quot);
 3718|  18.5M|    mp_exch(&quot, mp);
 3719|  18.5M|CLEANUP:
 3720|  18.5M|    mp_clear(&quot);
 3721|  18.5M|    mp_clear(&rem);
 3722|       |
 3723|  18.5M|    return res;
 3724|  18.5M|} /* end s_mp_div_d() */
s_mp_add_3arg:
 3824|  13.8M|{
 3825|  13.8M|    mp_digit *pa, *pb, *pc;
 3826|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_ADD_WORD)
 3827|       |    mp_word w = 0;
 3828|       |#else
 3829|  13.8M|    mp_digit sum, carry = 0, d;
 3830|  13.8M|#endif
 3831|  13.8M|    mp_size ix;
 3832|  13.8M|    mp_size used;
 3833|  13.8M|    mp_err res;
 3834|       |
 3835|  13.8M|    MP_SIGN(c) = MP_SIGN(a);
  ------------------
  |  |  144|  13.8M|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
                  MP_SIGN(c) = MP_SIGN(a);
  ------------------
  |  |  144|  13.8M|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
 3836|  13.8M|    if (MP_USED(a) < MP_USED(b)) {
  ------------------
  |  |  145|  13.8M|#define MP_USED(MP) ((MP)->used)
  ------------------
                  if (MP_USED(a) < MP_USED(b)) {
  ------------------
  |  |  145|  13.8M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (3836:9): [True: 2.39M, False: 11.4M]
  ------------------
 3837|  2.39M|        const mp_int *xch = a;
 3838|  2.39M|        a = b;
 3839|  2.39M|        b = xch;
 3840|  2.39M|    }
 3841|       |
 3842|       |    /* Make sure a has enough precision for the output value */
 3843|  13.8M|    if (MP_OKAY != (res = s_mp_pad(c, MP_USED(a))))
  ------------------
  |  |   39|  13.8M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
                  if (MP_OKAY != (res = s_mp_pad(c, MP_USED(a))))
  ------------------
  |  |  145|  13.8M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (3843:9): [True: 0, False: 13.8M]
  ------------------
 3844|      0|        return res;
 3845|       |
 3846|       |    /*
 3847|       |     Add up all digits up to the precision of b.  If b had initially
 3848|       |     the same precision as a, or greater, we took care of it by the
 3849|       |     exchange step above, so there is no problem.  If b had initially
 3850|       |     less precision, we'll have to make sure the carry out is duly
 3851|       |     propagated upward among the higher-order digits of the sum.
 3852|       |    */
 3853|  13.8M|    pa = MP_DIGITS(a);
  ------------------
  |  |  147|  13.8M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 3854|  13.8M|    pb = MP_DIGITS(b);
  ------------------
  |  |  147|  13.8M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 3855|  13.8M|    pc = MP_DIGITS(c);
  ------------------
  |  |  147|  13.8M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 3856|  13.8M|    used = MP_USED(b);
  ------------------
  |  |  145|  13.8M|#define MP_USED(MP) ((MP)->used)
  ------------------
 3857|  64.0M|    for (ix = 0; ix < used; ix++) {
  ------------------
  |  Branch (3857:18): [True: 50.1M, False: 13.8M]
  ------------------
 3858|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_ADD_WORD)
 3859|       |        w = w + *pa++ + *pb++;
 3860|       |        *pc++ = ACCUM(w);
 3861|       |        w = CARRYOUT(w);
 3862|       |#else
 3863|  50.1M|        d = *pa++;
 3864|  50.1M|        sum = d + *pb++;
 3865|  50.1M|        d = (sum < d); /* detect overflow */
 3866|  50.1M|        *pc++ = sum += carry;
 3867|  50.1M|        carry = d + (sum < carry); /* detect overflow */
 3868|  50.1M|#endif
 3869|  50.1M|    }
 3870|       |
 3871|       |    /* If we run out of 'b' digits before we're actually done, make
 3872|       |     sure the carries get propagated upward...
 3873|       |   */
 3874|  23.0M|    for (used = MP_USED(a); ix < used; ++ix) {
  ------------------
  |  |  145|  13.8M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (3874:29): [True: 9.16M, False: 13.8M]
  ------------------
 3875|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_ADD_WORD)
 3876|       |        w = w + *pa++;
 3877|       |        *pc++ = ACCUM(w);
 3878|       |        w = CARRYOUT(w);
 3879|       |#else
 3880|  9.16M|        *pc++ = sum = carry + *pa++;
 3881|  9.16M|        carry = (sum < carry);
 3882|  9.16M|#endif
 3883|  9.16M|    }
 3884|       |
 3885|       |/* If there's an overall carry out, increase precision and include
 3886|       |     it.  We could have done this initially, but why touch the memory
 3887|       |     allocator unless we're sure we have to?
 3888|       |   */
 3889|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_ADD_WORD)
 3890|       |    if (w) {
 3891|       |        if ((res = s_mp_pad(c, used + 1)) != MP_OKAY)
 3892|       |            return res;
 3893|       |
 3894|       |        DIGIT(c, used) = (mp_digit)w;
 3895|       |        ++used;
 3896|       |    }
 3897|       |#else
 3898|  13.8M|    if (carry) {
  ------------------
  |  Branch (3898:9): [True: 1.15M, False: 12.7M]
  ------------------
 3899|  1.15M|        if ((res = s_mp_pad(c, used + 1)) != MP_OKAY)
  ------------------
  |  |   39|  1.15M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (3899:13): [True: 0, False: 1.15M]
  ------------------
 3900|      0|            return res;
 3901|       |
 3902|  1.15M|        DIGIT(c, used) = carry;
  ------------------
  |  |  331|  1.15M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|  1.15M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 3903|  1.15M|        ++used;
 3904|  1.15M|    }
 3905|  13.8M|#endif
 3906|  13.8M|    MP_USED(c) = used;
  ------------------
  |  |  145|  13.8M|#define MP_USED(MP) ((MP)->used)
  ------------------
 3907|  13.8M|    return MP_OKAY;
  ------------------
  |  |   39|  13.8M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3908|  13.8M|}
s_mp_sub:
 4001|  14.8M|{
 4002|  14.8M|    mp_digit *pa, *pb, *limit;
 4003|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_SUB_WORD)
 4004|       |    mp_sword w = 0;
 4005|       |#else
 4006|  14.8M|    mp_digit d, diff, borrow = 0;
 4007|  14.8M|#endif
 4008|       |
 4009|       |    /*
 4010|       |    Subtract and propagate borrow.  Up to the precision of b, this
 4011|       |    accounts for the digits of b; after that, we just make sure the
 4012|       |    carries get to the right place.  This saves having to pad b out to
 4013|       |    the precision of a just to make the loops work right...
 4014|       |   */
 4015|  14.8M|    pa = MP_DIGITS(a);
  ------------------
  |  |  147|  14.8M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 4016|  14.8M|    pb = MP_DIGITS(b);
  ------------------
  |  |  147|  14.8M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 4017|  14.8M|    limit = pb + MP_USED(b);
  ------------------
  |  |  145|  14.8M|#define MP_USED(MP) ((MP)->used)
  ------------------
 4018|  86.2M|    while (pb < limit) {
  ------------------
  |  Branch (4018:12): [True: 71.3M, False: 14.8M]
  ------------------
 4019|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_SUB_WORD)
 4020|       |        w = w + *pa - *pb++;
 4021|       |        *pa++ = ACCUM(w);
 4022|       |        w >>= MP_DIGIT_BIT;
 4023|       |#else
 4024|  71.3M|        d = *pa;
 4025|  71.3M|        diff = d - *pb++;
 4026|  71.3M|        d = (diff > d); /* detect borrow */
 4027|  71.3M|        if (borrow && --diff == MP_DIGIT_MAX)
  ------------------
  |  |   74|  15.5M|#define MP_DIGIT_MAX ULONG_MAX
  ------------------
  |  Branch (4027:13): [True: 15.5M, False: 55.8M]
  |  Branch (4027:23): [True: 89.4k, False: 15.4M]
  ------------------
 4028|  89.4k|            ++d;
 4029|  71.3M|        *pa++ = diff;
 4030|  71.3M|        borrow = d;
 4031|  71.3M|#endif
 4032|  71.3M|    }
 4033|  14.8M|    limit = MP_DIGITS(a) + MP_USED(a);
  ------------------
  |  |  147|  14.8M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
                  limit = MP_DIGITS(a) + MP_USED(a);
  ------------------
  |  |  145|  14.8M|#define MP_USED(MP) ((MP)->used)
  ------------------
 4034|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_SUB_WORD)
 4035|       |    while (w && pa < limit) {
 4036|       |        w = w + *pa;
 4037|       |        *pa++ = ACCUM(w);
 4038|       |        w >>= MP_DIGIT_BIT;
 4039|       |    }
 4040|       |#else
 4041|  16.6M|    while (borrow && pa < limit) {
  ------------------
  |  Branch (4041:12): [True: 1.78M, False: 14.8M]
  |  Branch (4041:22): [True: 1.78M, False: 0]
  ------------------
 4042|  1.78M|        d = *pa;
 4043|  1.78M|        *pa++ = diff = d - borrow;
 4044|  1.78M|        borrow = (diff > d);
 4045|  1.78M|    }
 4046|  14.8M|#endif
 4047|       |
 4048|       |    /* Clobber any leading zeroes we created    */
 4049|  14.8M|    s_mp_clamp(a);
 4050|       |
 4051|       |/*
 4052|       |     If there was a borrow out, then |b| > |a| in violation
 4053|       |     of our input invariant.  We've already done the work,
 4054|       |     but we'll at least complain about it...
 4055|       |   */
 4056|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_SUB_WORD)
 4057|       |    return w ? MP_RANGE : MP_OKAY;
 4058|       |#else
 4059|  14.8M|    return borrow ? MP_RANGE : MP_OKAY;
  ------------------
  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  ------------------
                  return borrow ? MP_RANGE : MP_OKAY;
  ------------------
  |  |   39|  14.8M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (4059:12): [True: 0, False: 14.8M]
  ------------------
 4060|  14.8M|#endif
 4061|  14.8M|} /* end s_mp_sub() */
s_mp_sub_3arg:
 4068|  5.06M|{
 4069|  5.06M|    mp_digit *pa, *pb, *pc;
 4070|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_SUB_WORD)
 4071|       |    mp_sword w = 0;
 4072|       |#else
 4073|  5.06M|    mp_digit d, diff, borrow = 0;
 4074|  5.06M|#endif
 4075|  5.06M|    int ix, limit;
 4076|  5.06M|    mp_err res;
 4077|       |
 4078|  5.06M|    MP_SIGN(c) = MP_SIGN(a);
  ------------------
  |  |  144|  5.06M|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
                  MP_SIGN(c) = MP_SIGN(a);
  ------------------
  |  |  144|  5.06M|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
 4079|       |
 4080|       |    /* Make sure a has enough precision for the output value */
 4081|  5.06M|    if (MP_OKAY != (res = s_mp_pad(c, MP_USED(a))))
  ------------------
  |  |   39|  5.06M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
                  if (MP_OKAY != (res = s_mp_pad(c, MP_USED(a))))
  ------------------
  |  |  145|  5.06M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (4081:9): [True: 0, False: 5.06M]
  ------------------
 4082|      0|        return res;
 4083|       |
 4084|       |    /*
 4085|       |    Subtract and propagate borrow.  Up to the precision of b, this
 4086|       |    accounts for the digits of b; after that, we just make sure the
 4087|       |    carries get to the right place.  This saves having to pad b out to
 4088|       |    the precision of a just to make the loops work right...
 4089|       |   */
 4090|  5.06M|    pa = MP_DIGITS(a);
  ------------------
  |  |  147|  5.06M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 4091|  5.06M|    pb = MP_DIGITS(b);
  ------------------
  |  |  147|  5.06M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 4092|  5.06M|    pc = MP_DIGITS(c);
  ------------------
  |  |  147|  5.06M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 4093|  5.06M|    limit = MP_USED(b);
  ------------------
  |  |  145|  5.06M|#define MP_USED(MP) ((MP)->used)
  ------------------
 4094|  27.8M|    for (ix = 0; ix < limit; ++ix) {
  ------------------
  |  Branch (4094:18): [True: 22.8M, False: 5.06M]
  ------------------
 4095|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_SUB_WORD)
 4096|       |        w = w + *pa++ - *pb++;
 4097|       |        *pc++ = ACCUM(w);
 4098|       |        w >>= MP_DIGIT_BIT;
 4099|       |#else
 4100|  22.8M|        d = *pa++;
 4101|  22.8M|        diff = d - *pb++;
 4102|  22.8M|        d = (diff > d);
 4103|  22.8M|        if (borrow && --diff == MP_DIGIT_MAX)
  ------------------
  |  |   74|  8.94M|#define MP_DIGIT_MAX ULONG_MAX
  ------------------
  |  Branch (4103:13): [True: 8.94M, False: 13.8M]
  |  Branch (4103:23): [True: 312k, False: 8.63M]
  ------------------
 4104|   312k|            ++d;
 4105|  22.8M|        *pc++ = diff;
 4106|  22.8M|        borrow = d;
 4107|  22.8M|#endif
 4108|  22.8M|    }
 4109|  5.85M|    for (limit = MP_USED(a); ix < limit; ++ix) {
  ------------------
  |  |  145|  5.06M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (4109:30): [True: 784k, False: 5.06M]
  ------------------
 4110|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_SUB_WORD)
 4111|       |        w = w + *pa++;
 4112|       |        *pc++ = ACCUM(w);
 4113|       |        w >>= MP_DIGIT_BIT;
 4114|       |#else
 4115|   784k|        d = *pa++;
 4116|   784k|        *pc++ = diff = d - borrow;
 4117|   784k|        borrow = (diff > d);
 4118|   784k|#endif
 4119|   784k|    }
 4120|       |
 4121|       |    /* Clobber any leading zeroes we created    */
 4122|  5.06M|    MP_USED(c) = ix;
  ------------------
  |  |  145|  5.06M|#define MP_USED(MP) ((MP)->used)
  ------------------
 4123|  5.06M|    s_mp_clamp(c);
 4124|       |
 4125|       |/*
 4126|       |     If there was a borrow out, then |b| > |a| in violation
 4127|       |     of our input invariant.  We've already done the work,
 4128|       |     but we'll at least complain about it...
 4129|       |   */
 4130|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_SUB_WORD)
 4131|       |    return w ? MP_RANGE : MP_OKAY;
 4132|       |#else
 4133|  5.06M|    return borrow ? MP_RANGE : MP_OKAY;
  ------------------
  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  ------------------
                  return borrow ? MP_RANGE : MP_OKAY;
  ------------------
  |  |   39|  5.06M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (4133:12): [True: 0, False: 5.06M]
  ------------------
 4134|  5.06M|#endif
 4135|  5.06M|}
s_mpv_sqr_add_prop:
 4364|  17.0M|{
 4365|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_MUL_WORD)
 4366|       |    mp_word w;
 4367|       |    mp_digit d;
 4368|       |    mp_size ix;
 4369|       |
 4370|       |    w = 0;
 4371|       |#define ADD_SQUARE(n)                     \
 4372|       |    d = pa[n];                            \
 4373|       |    w += (d * (mp_word)d) + ps[2 * n];    \
 4374|       |    ps[2 * n] = ACCUM(w);                 \
 4375|       |    w = (w >> DIGIT_BIT) + ps[2 * n + 1]; \
 4376|       |    ps[2 * n + 1] = ACCUM(w);             \
 4377|       |    w = (w >> DIGIT_BIT)
 4378|       |
 4379|       |    for (ix = a_len; ix >= 4; ix -= 4) {
 4380|       |        ADD_SQUARE(0);
 4381|       |        ADD_SQUARE(1);
 4382|       |        ADD_SQUARE(2);
 4383|       |        ADD_SQUARE(3);
 4384|       |        pa += 4;
 4385|       |        ps += 8;
 4386|       |    }
 4387|       |    if (ix) {
 4388|       |        ps += 2 * ix;
 4389|       |        pa += ix;
 4390|       |        switch (ix) {
 4391|       |            case 3:
 4392|       |                ADD_SQUARE(-3); /* FALLTHRU */
 4393|       |            case 2:
 4394|       |                ADD_SQUARE(-2); /* FALLTHRU */
 4395|       |            case 1:
 4396|       |                ADD_SQUARE(-1); /* FALLTHRU */
 4397|       |            case 0:
 4398|       |                break;
 4399|       |        }
 4400|       |    }
 4401|       |    while (w) {
 4402|       |        w += *ps;
 4403|       |        *ps++ = ACCUM(w);
 4404|       |        w = (w >> DIGIT_BIT);
 4405|       |    }
 4406|       |#else
 4407|  17.0M|    mp_digit carry = 0;
 4408|  69.8M|    while (a_len--) {
  ------------------
  |  Branch (4408:12): [True: 52.8M, False: 17.0M]
  ------------------
 4409|  52.8M|        mp_digit a_i = *pa++;
 4410|  52.8M|        mp_digit a0a0, a1a1;
 4411|       |
 4412|  52.8M|        MP_SQR_D(a_i, a1a1, a0a0);
  ------------------
  |  | 4347|  52.8M|    {                                                              \
  |  | 4348|  52.8M|        mp_digit Pmid;                                             \
  |  | 4349|  52.8M|        Plo = (a & MP_HALF_DIGIT_MAX) * (a & MP_HALF_DIGIT_MAX);   \
  |  |  ------------------
  |  |  |  |   76|  52.8M|#define MP_HALF_DIGIT_MAX UINT_MAX
  |  |  ------------------
  |  |                       Plo = (a & MP_HALF_DIGIT_MAX) * (a & MP_HALF_DIGIT_MAX);   \
  |  |  ------------------
  |  |  |  |   76|  52.8M|#define MP_HALF_DIGIT_MAX UINT_MAX
  |  |  ------------------
  |  | 4350|  52.8M|        Phi = (a >> MP_HALF_DIGIT_BIT) * (a >> MP_HALF_DIGIT_BIT); \
  |  |  ------------------
  |  |  |  |  136|  52.8M|#define MP_HALF_DIGIT_BIT (MP_DIGIT_BIT / 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  52.8M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  52.8M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       Phi = (a >> MP_HALF_DIGIT_BIT) * (a >> MP_HALF_DIGIT_BIT); \
  |  |  ------------------
  |  |  |  |  136|  52.8M|#define MP_HALF_DIGIT_BIT (MP_DIGIT_BIT / 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  52.8M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  52.8M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 4351|  52.8M|        Pmid = (a & MP_HALF_DIGIT_MAX) * (a >> MP_HALF_DIGIT_BIT); \
  |  |  ------------------
  |  |  |  |   76|  52.8M|#define MP_HALF_DIGIT_MAX UINT_MAX
  |  |  ------------------
  |  |                       Pmid = (a & MP_HALF_DIGIT_MAX) * (a >> MP_HALF_DIGIT_BIT); \
  |  |  ------------------
  |  |  |  |  136|  52.8M|#define MP_HALF_DIGIT_BIT (MP_DIGIT_BIT / 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  52.8M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  52.8M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 4352|  52.8M|        Phi += Pmid >> (MP_HALF_DIGIT_BIT - 1);                    \
  |  |  ------------------
  |  |  |  |  136|  52.8M|#define MP_HALF_DIGIT_BIT (MP_DIGIT_BIT / 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  52.8M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  52.8M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 4353|  52.8M|        Pmid <<= (MP_HALF_DIGIT_BIT + 1);                          \
  |  |  ------------------
  |  |  |  |  136|  52.8M|#define MP_HALF_DIGIT_BIT (MP_DIGIT_BIT / 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  52.8M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  52.8M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 4354|  52.8M|        Plo += Pmid;                                               \
  |  | 4355|  52.8M|        if (Plo < Pmid)                                            \
  |  |  ------------------
  |  |  |  Branch (4355:13): [True: 14.6M, False: 38.1M]
  |  |  ------------------
  |  | 4356|  52.8M|            ++Phi;                                                 \
  |  | 4357|  52.8M|    }
  ------------------
 4413|       |
 4414|       |        /* here a1a1 and a0a0 constitute a_i ** 2 */
 4415|  52.8M|        a0a0 += carry;
 4416|  52.8M|        if (a0a0 < carry)
  ------------------
  |  Branch (4416:13): [True: 0, False: 52.8M]
  ------------------
 4417|      0|            ++a1a1;
 4418|       |
 4419|       |        /* now add to ps */
 4420|  52.8M|        a0a0 += a_i = *ps;
 4421|  52.8M|        if (a0a0 < a_i)
  ------------------
  |  Branch (4421:13): [True: 12.5M, False: 40.3M]
  ------------------
 4422|  12.5M|            ++a1a1;
 4423|  52.8M|        *ps++ = a0a0;
 4424|  52.8M|        a1a1 += a_i = *ps;
 4425|  52.8M|        carry = (a1a1 < a_i);
 4426|  52.8M|        *ps++ = a1a1;
 4427|  52.8M|    }
 4428|  17.0M|    while (carry) {
  ------------------
  |  Branch (4428:12): [True: 0, False: 17.0M]
  ------------------
 4429|      0|        mp_digit s_i = *ps;
 4430|      0|        carry += s_i;
 4431|      0|        *ps++ = carry;
 4432|      0|        carry = carry < s_i;
 4433|      0|    }
 4434|  17.0M|#endif
 4435|  17.0M|}
s_mpv_div_2dx1d:
 4446|  70.3M|{
 4447|  70.3M|    mp_digit d1, d0, q1, q0;
 4448|  70.3M|    mp_digit r1, r0, m;
 4449|       |
 4450|  70.3M|    d1 = divisor >> MP_HALF_DIGIT_BIT;
  ------------------
  |  |  136|  70.3M|#define MP_HALF_DIGIT_BIT (MP_DIGIT_BIT / 2)
  |  |  ------------------
  |  |  |  |  132|  70.3M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  70.3M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4451|  70.3M|    d0 = divisor & MP_HALF_DIGIT_MAX;
  ------------------
  |  |   76|  70.3M|#define MP_HALF_DIGIT_MAX UINT_MAX
  ------------------
 4452|  70.3M|    r1 = Nhi % d1;
 4453|  70.3M|    q1 = Nhi / d1;
 4454|  70.3M|    m = q1 * d0;
 4455|  70.3M|    r1 = (r1 << MP_HALF_DIGIT_BIT) | (Nlo >> MP_HALF_DIGIT_BIT);
  ------------------
  |  |  136|  70.3M|#define MP_HALF_DIGIT_BIT (MP_DIGIT_BIT / 2)
  |  |  ------------------
  |  |  |  |  132|  70.3M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  70.3M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  r1 = (r1 << MP_HALF_DIGIT_BIT) | (Nlo >> MP_HALF_DIGIT_BIT);
  ------------------
  |  |  136|  70.3M|#define MP_HALF_DIGIT_BIT (MP_DIGIT_BIT / 2)
  |  |  ------------------
  |  |  |  |  132|  70.3M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  70.3M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4456|  70.3M|    if (r1 < m) {
  ------------------
  |  Branch (4456:9): [True: 726k, False: 69.6M]
  ------------------
 4457|   726k|        q1--, r1 += divisor;
 4458|   726k|        if (r1 >= divisor && r1 < m) {
  ------------------
  |  Branch (4458:13): [True: 307k, False: 418k]
  |  Branch (4458:30): [True: 66.3k, False: 240k]
  ------------------
 4459|  66.3k|            q1--, r1 += divisor;
 4460|  66.3k|        }
 4461|   726k|    }
 4462|  70.3M|    r1 -= m;
 4463|  70.3M|    r0 = r1 % d1;
 4464|  70.3M|    q0 = r1 / d1;
 4465|  70.3M|    m = q0 * d0;
 4466|  70.3M|    r0 = (r0 << MP_HALF_DIGIT_BIT) | (Nlo & MP_HALF_DIGIT_MAX);
  ------------------
  |  |  136|  70.3M|#define MP_HALF_DIGIT_BIT (MP_DIGIT_BIT / 2)
  |  |  ------------------
  |  |  |  |  132|  70.3M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  70.3M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  r0 = (r0 << MP_HALF_DIGIT_BIT) | (Nlo & MP_HALF_DIGIT_MAX);
  ------------------
  |  |   76|  70.3M|#define MP_HALF_DIGIT_MAX UINT_MAX
  ------------------
 4467|  70.3M|    if (r0 < m) {
  ------------------
  |  Branch (4467:9): [True: 872k, False: 69.5M]
  ------------------
 4468|   872k|        q0--, r0 += divisor;
 4469|   872k|        if (r0 >= divisor && r0 < m) {
  ------------------
  |  Branch (4469:13): [True: 389k, False: 483k]
  |  Branch (4469:30): [True: 82.4k, False: 306k]
  ------------------
 4470|  82.4k|            q0--, r0 += divisor;
 4471|  82.4k|        }
 4472|   872k|    }
 4473|  70.3M|    if (qp)
  ------------------
  |  Branch (4473:9): [True: 70.3M, False: 0]
  ------------------
 4474|  70.3M|        *qp = (q1 << MP_HALF_DIGIT_BIT) | q0;
  ------------------
  |  |  136|  70.3M|#define MP_HALF_DIGIT_BIT (MP_DIGIT_BIT / 2)
  |  |  ------------------
  |  |  |  |  132|  70.3M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  70.3M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4475|  70.3M|    if (rp)
  ------------------
  |  Branch (4475:9): [True: 70.3M, False: 0]
  ------------------
 4476|  70.3M|        *rp = r0 - m;
 4477|  70.3M|    return MP_OKAY;
  ------------------
  |  |   39|  70.3M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 4478|  70.3M|}
s_mp_div:
 4515|  3.99M|{
 4516|  3.99M|    mp_int part, t;
 4517|  3.99M|    mp_digit q_msd;
 4518|  3.99M|    mp_err res;
 4519|  3.99M|    mp_digit d;
 4520|  3.99M|    mp_digit div_msd;
 4521|  3.99M|    int ix;
 4522|       |
 4523|  3.99M|    if (mp_cmp_z(div) == 0)
  ------------------
  |  Branch (4523:9): [True: 0, False: 3.99M]
  ------------------
 4524|      0|        return MP_RANGE;
  ------------------
  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  ------------------
 4525|       |
 4526|  3.99M|    DIGITS(&t) = 0;
  ------------------
  |  |  330|  3.99M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  147|  3.99M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
 4527|       |    /* Shortcut if divisor is power of two */
 4528|  3.99M|    if ((ix = s_mp_ispow2(div)) >= 0) {
  ------------------
  |  Branch (4528:9): [True: 0, False: 3.99M]
  ------------------
 4529|      0|        MP_CHECKOK(mp_copy(rem, quot));
  ------------------
  |  |  314|      0|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  315|      0|    goto CLEANUP
  ------------------
 4530|      0|        s_mp_div_2d(quot, (mp_digit)ix);
 4531|      0|        s_mp_mod_2d(rem, (mp_digit)ix);
 4532|       |
 4533|      0|        return MP_OKAY;
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 4534|      0|    }
 4535|       |
 4536|  3.99M|    MP_SIGN(rem) = ZPOS;
  ------------------
  |  |  144|  3.99M|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
                  MP_SIGN(rem) = ZPOS;
  ------------------
  |  |  321|  3.99M|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  3.99M|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 4537|  3.99M|    MP_SIGN(div) = ZPOS;
  ------------------
  |  |  144|  3.99M|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
                  MP_SIGN(div) = ZPOS;
  ------------------
  |  |  321|  3.99M|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  3.99M|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 4538|  3.99M|    MP_SIGN(&part) = ZPOS;
  ------------------
  |  |  144|  3.99M|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
                  MP_SIGN(&part) = ZPOS;
  ------------------
  |  |  321|  3.99M|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  3.99M|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 4539|       |
 4540|       |    /* A working temporary for division     */
 4541|  3.99M|    MP_CHECKOK(mp_init_size(&t, MP_ALLOC(rem)));
  ------------------
  |  |  314|  3.99M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  3.99M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 3.99M]
  |  |  ------------------
  |  |  315|  3.99M|    goto CLEANUP
  ------------------
 4542|       |
 4543|       |    /* Normalize to optimize guessing       */
 4544|  3.99M|    MP_CHECKOK(s_mp_norm(rem, div, &d));
  ------------------
  |  |  314|  3.99M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  3.99M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 3.99M]
  |  |  ------------------
  |  |  315|  3.99M|    goto CLEANUP
  ------------------
 4545|       |
 4546|       |    /* Perform the division itself...woo!   */
 4547|  3.99M|    MP_USED(quot) = MP_ALLOC(quot);
  ------------------
  |  |  145|  3.99M|#define MP_USED(MP) ((MP)->used)
  ------------------
                  MP_USED(quot) = MP_ALLOC(quot);
  ------------------
  |  |  146|  3.99M|#define MP_ALLOC(MP) ((MP)->alloc)
  ------------------
 4548|       |
 4549|       |    /* Find a partial substring of rem which is at least div */
 4550|       |    /* If we didn't find one, we're finished dividing    */
 4551|  16.7M|    while (MP_USED(rem) > MP_USED(div) || s_mp_cmp(rem, div) >= 0) {
  ------------------
  |  |  145|  16.7M|#define MP_USED(MP) ((MP)->used)
  ------------------
                  while (MP_USED(rem) > MP_USED(div) || s_mp_cmp(rem, div) >= 0) {
  ------------------
  |  |  145|  33.5M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (4551:12): [True: 12.7M, False: 3.99M]
  |  Branch (4551:43): [True: 2.21k, False: 3.99M]
  ------------------
 4552|  12.7M|        int i;
 4553|  12.7M|        int unusedRem;
 4554|  12.7M|        int partExtended = 0; /* set to true if we need to extend part */
 4555|       |
 4556|  12.7M|        unusedRem = MP_USED(rem) - MP_USED(div);
  ------------------
  |  |  145|  12.7M|#define MP_USED(MP) ((MP)->used)
  ------------------
                      unusedRem = MP_USED(rem) - MP_USED(div);
  ------------------
  |  |  145|  12.7M|#define MP_USED(MP) ((MP)->used)
  ------------------
 4557|  12.7M|        MP_DIGITS(&part) = MP_DIGITS(rem) + unusedRem;
  ------------------
  |  |  147|  12.7M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
                      MP_DIGITS(&part) = MP_DIGITS(rem) + unusedRem;
  ------------------
  |  |  147|  12.7M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 4558|  12.7M|        MP_ALLOC(&part) = MP_ALLOC(rem) - unusedRem;
  ------------------
  |  |  146|  12.7M|#define MP_ALLOC(MP) ((MP)->alloc)
  ------------------
                      MP_ALLOC(&part) = MP_ALLOC(rem) - unusedRem;
  ------------------
  |  |  146|  12.7M|#define MP_ALLOC(MP) ((MP)->alloc)
  ------------------
 4559|  12.7M|        MP_USED(&part) = MP_USED(div);
  ------------------
  |  |  145|  12.7M|#define MP_USED(MP) ((MP)->used)
  ------------------
                      MP_USED(&part) = MP_USED(div);
  ------------------
  |  |  145|  12.7M|#define MP_USED(MP) ((MP)->used)
  ------------------
 4560|       |
 4561|       |        /* We have now truncated the part of the remainder to the same length as
 4562|       |         * the divisor. If part is smaller than div, extend part by one digit. */
 4563|  12.7M|        if (s_mp_cmp(&part, div) < 0) {
  ------------------
  |  Branch (4563:13): [True: 12.7M, False: 25.9k]
  ------------------
 4564|  12.7M|            --unusedRem;
 4565|  12.7M|#if MP_ARGCHK == 2
 4566|  12.7M|            assert(unusedRem >= 0);
 4567|  12.7M|#endif
 4568|  12.7M|            --MP_DIGITS(&part);
  ------------------
  |  |  147|  12.7M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 4569|  12.7M|            ++MP_USED(&part);
  ------------------
  |  |  145|  12.7M|#define MP_USED(MP) ((MP)->used)
  ------------------
 4570|  12.7M|            ++MP_ALLOC(&part);
  ------------------
  |  |  146|  12.7M|#define MP_ALLOC(MP) ((MP)->alloc)
  ------------------
 4571|  12.7M|            partExtended = 1;
 4572|  12.7M|        }
 4573|       |
 4574|       |        /* Compute a guess for the next quotient digit       */
 4575|  12.7M|        q_msd = MP_DIGIT(&part, MP_USED(&part) - 1);
  ------------------
  |  |  148|  12.7M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 4576|  12.7M|        div_msd = MP_DIGIT(div, MP_USED(div) - 1);
  ------------------
  |  |  148|  12.7M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 4577|  12.7M|        if (!partExtended) {
  ------------------
  |  Branch (4577:13): [True: 25.9k, False: 12.7M]
  ------------------
 4578|       |            /* In this case, q_msd /= div_msd is always 1. First, since div_msd is
 4579|       |             * normalized to have the high bit set, 2*div_msd > MP_DIGIT_MAX. Since
 4580|       |             * we didn't extend part, q_msd >= div_msd. Therefore we know that
 4581|       |             * div_msd <= q_msd <= MP_DIGIT_MAX < 2*div_msd. Dividing by div_msd we
 4582|       |             * get 1 <= q_msd/div_msd < 2. So q_msd /= div_msd must be 1. */
 4583|  25.9k|            q_msd = 1;
 4584|  12.7M|        } else {
 4585|  12.7M|            if (q_msd == div_msd) {
  ------------------
  |  Branch (4585:17): [True: 4.15k, False: 12.7M]
  ------------------
 4586|  4.15k|                q_msd = MP_DIGIT_MAX;
  ------------------
  |  |   74|  4.15k|#define MP_DIGIT_MAX ULONG_MAX
  ------------------
 4587|  12.7M|            } else {
 4588|  12.7M|                mp_digit r;
 4589|  12.7M|                MP_CHECKOK(s_mpv_div_2dx1d(q_msd, MP_DIGIT(&part, MP_USED(&part) - 2),
  ------------------
  |  |  314|  12.7M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  12.7M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 12.7M]
  |  |  ------------------
  |  |  315|  12.7M|    goto CLEANUP
  ------------------
 4590|  12.7M|                                           div_msd, &q_msd, &r));
 4591|  12.7M|            }
 4592|  12.7M|        }
 4593|  12.7M|#if MP_ARGCHK == 2
 4594|  12.7M|        assert(q_msd > 0); /* This case should never occur any more. */
 4595|  12.7M|#endif
 4596|  12.7M|        if (q_msd <= 0)
  ------------------
  |  Branch (4596:13): [True: 0, False: 12.7M]
  ------------------
 4597|      0|            break;
 4598|       |
 4599|       |        /* See what that multiplies out to                   */
 4600|  12.7M|        mp_copy(div, &t);
 4601|  12.7M|        MP_CHECKOK(s_mp_mul_d(&t, q_msd));
  ------------------
  |  |  314|  12.7M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  12.7M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 12.7M]
  |  |  ------------------
  |  |  315|  12.7M|    goto CLEANUP
  ------------------
 4602|       |
 4603|       |        /*
 4604|       |           If it's too big, back it off.  We should not have to do this
 4605|       |           more than once, or, in rare cases, twice.  Knuth describes a
 4606|       |           method by which this could be reduced to a maximum of once, but
 4607|       |           I didn't implement that here.
 4608|       |           When using s_mpv_div_2dx1d, we may have to do this 3 times.
 4609|       |         */
 4610|  13.5M|        for (i = 4; s_mp_cmp(&t, &part) > 0 && i > 0; --i) {
  ------------------
  |  Branch (4610:21): [True: 813k, False: 12.7M]
  |  Branch (4610:48): [True: 813k, False: 0]
  ------------------
 4611|   813k|            --q_msd;
 4612|   813k|            MP_CHECKOK(s_mp_sub(&t, div)); /* t -= div */
  ------------------
  |  |  314|   813k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   813k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 813k]
  |  |  ------------------
  |  |  315|   813k|    goto CLEANUP
  ------------------
 4613|   813k|        }
 4614|  12.7M|        if (i < 0) {
  ------------------
  |  Branch (4614:13): [True: 0, False: 12.7M]
  ------------------
 4615|      0|            res = MP_RANGE;
  ------------------
  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  ------------------
 4616|      0|            goto CLEANUP;
 4617|      0|        }
 4618|       |
 4619|       |        /* At this point, q_msd should be the right next digit   */
 4620|  12.7M|        MP_CHECKOK(s_mp_sub(&part, &t)); /* part -= t */
  ------------------
  |  |  314|  12.7M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  12.7M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 12.7M]
  |  |  ------------------
  |  |  315|  12.7M|    goto CLEANUP
  ------------------
 4621|  12.7M|        s_mp_clamp(rem);
 4622|       |
 4623|       |        /*
 4624|       |          Include the digit in the quotient.  We allocated enough memory
 4625|       |          for any quotient we could ever possibly get, so we should not
 4626|       |          have to check for failures here
 4627|       |         */
 4628|  12.7M|        MP_DIGIT(quot, unusedRem) = q_msd;
  ------------------
  |  |  148|  12.7M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 4629|  12.7M|    }
 4630|       |
 4631|       |    /* Denormalize remainder                */
 4632|  3.99M|    if (d) {
  ------------------
  |  Branch (4632:9): [True: 3.58M, False: 416k]
  ------------------
 4633|  3.58M|        s_mp_div_2d(rem, d);
 4634|  3.58M|    }
 4635|       |
 4636|  3.99M|    s_mp_clamp(quot);
 4637|       |
 4638|  3.99M|CLEANUP:
 4639|  3.99M|    mp_clear(&t);
 4640|       |
 4641|  3.99M|    return res;
 4642|       |
 4643|  3.99M|} /* end s_mp_div() */
s_mp_cmp:
 4742|  77.8M|{
 4743|  77.8M|    ARGMPCHK(a != NULL && b != NULL);
  ------------------
  |  |  349|  77.8M|#define ARGMPCHK(X) assert(X)
  ------------------
 4744|       |
 4745|  77.8M|    mp_size used_a = MP_USED(a);
  ------------------
  |  |  145|  77.8M|#define MP_USED(MP) ((MP)->used)
  ------------------
 4746|  77.8M|    {
 4747|  77.8M|        mp_size used_b = MP_USED(b);
  ------------------
  |  |  145|  77.8M|#define MP_USED(MP) ((MP)->used)
  ------------------
 4748|       |
 4749|  77.8M|        if (used_a > used_b)
  ------------------
  |  Branch (4749:13): [True: 8.13M, False: 69.6M]
  ------------------
 4750|  8.13M|            goto IS_GT;
 4751|  69.6M|        if (used_a < used_b)
  ------------------
  |  Branch (4751:13): [True: 2.23M, False: 67.4M]
  ------------------
 4752|  2.23M|            goto IS_LT;
 4753|  69.6M|    }
 4754|  67.4M|    {
 4755|  67.4M|        mp_digit *pa, *pb;
 4756|  67.4M|        mp_digit da = 0, db = 0;
 4757|       |
 4758|  67.4M|#define CMP_AB(n)                     \
 4759|  67.4M|    if ((da = pa[n]) != (db = pb[n])) \
 4760|  67.4M|    goto done
 4761|       |
 4762|  67.4M|        pa = MP_DIGITS(a) + used_a;
  ------------------
  |  |  147|  67.4M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 4763|  67.4M|        pb = MP_DIGITS(b) + used_a;
  ------------------
  |  |  147|  67.4M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 4764|  67.5M|        while (used_a >= 4) {
  ------------------
  |  Branch (4764:16): [True: 43.9M, False: 23.5M]
  ------------------
 4765|  43.9M|            pa -= 4;
 4766|  43.9M|            pb -= 4;
 4767|  43.9M|            used_a -= 4;
 4768|  43.9M|            CMP_AB(3);
  ------------------
  |  | 4759|  43.9M|    if ((da = pa[n]) != (db = pb[n])) \
  |  |  ------------------
  |  |  |  Branch (4759:9): [True: 36.3M, False: 7.64M]
  |  |  ------------------
  |  | 4760|  43.9M|    goto done
  ------------------
 4769|  7.64M|            CMP_AB(2);
  ------------------
  |  | 4759|  7.64M|    if ((da = pa[n]) != (db = pb[n])) \
  |  |  ------------------
  |  |  |  Branch (4759:9): [True: 7.47M, False: 170k]
  |  |  ------------------
  |  | 4760|  7.64M|    goto done
  ------------------
 4770|   170k|            CMP_AB(1);
  ------------------
  |  | 4759|   170k|    if ((da = pa[n]) != (db = pb[n])) \
  |  |  ------------------
  |  |  |  Branch (4759:9): [True: 34.9k, False: 135k]
  |  |  ------------------
  |  | 4760|   170k|    goto done
  ------------------
 4771|   135k|            CMP_AB(0);
  ------------------
  |  | 4759|   135k|    if ((da = pa[n]) != (db = pb[n])) \
  |  |  ------------------
  |  |  |  Branch (4759:9): [True: 55.4k, False: 80.1k]
  |  |  ------------------
  |  | 4760|   135k|    goto done
  ------------------
 4772|   135k|        }
 4773|  24.7M|        while (used_a-- > 0 && ((da = *--pa) == (db = *--pb)))
  ------------------
  |  Branch (4773:16): [True: 24.5M, False: 166k]
  |  Branch (4773:32): [True: 1.15M, False: 23.4M]
  ------------------
 4774|  1.15M|            /* do nothing */;
 4775|  67.4M|    done:
 4776|  67.4M|        if (da > db)
  ------------------
  |  Branch (4776:13): [True: 3.41M, False: 64.0M]
  ------------------
 4777|  3.41M|            goto IS_GT;
 4778|  64.0M|        if (da < db)
  ------------------
  |  Branch (4778:13): [True: 63.8M, False: 166k]
  ------------------
 4779|  63.8M|            goto IS_LT;
 4780|  64.0M|    }
 4781|   166k|    return MP_EQ;
  ------------------
  |  |   96|   166k|#define MP_EQ 0
  ------------------
 4782|  66.1M|IS_LT:
 4783|  66.1M|    return MP_LT;
  ------------------
  |  |   95|  66.1M|#define MP_LT -1
  ------------------
 4784|  11.5M|IS_GT:
 4785|  11.5M|    return MP_GT;
  ------------------
  |  |   97|  11.5M|#define MP_GT 1
  ------------------
 4786|  64.0M|} /* end s_mp_cmp() */
s_mp_cmp_d:
 4795|  94.9M|{
 4796|  94.9M|    ARGMPCHK(a != NULL);
  ------------------
  |  |  349|  94.9M|#define ARGMPCHK(X) assert(X)
  ------------------
 4797|       |
 4798|  94.9M|    if (USED(a) > 1)
  ------------------
  |  |  328|  94.9M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  94.9M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (4798:9): [True: 59.4M, False: 35.5M]
  ------------------
 4799|  59.4M|        return MP_GT;
  ------------------
  |  |   97|  59.4M|#define MP_GT 1
  ------------------
 4800|       |
 4801|  35.5M|    if (DIGIT(a, 0) < d)
  ------------------
  |  |  331|  35.5M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|  35.5M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
  |  Branch (4801:9): [True: 0, False: 35.5M]
  ------------------
 4802|      0|        return MP_LT;
  ------------------
  |  |   95|      0|#define MP_LT -1
  ------------------
 4803|  35.5M|    else if (DIGIT(a, 0) > d)
  ------------------
  |  |  331|  35.5M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|  35.5M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
  |  Branch (4803:14): [True: 35.4M, False: 110k]
  ------------------
 4804|  35.4M|        return MP_GT;
  ------------------
  |  |   97|  35.4M|#define MP_GT 1
  ------------------
 4805|   110k|    else
 4806|   110k|        return MP_EQ;
  ------------------
  |  |   96|   110k|#define MP_EQ 0
  ------------------
 4807|       |
 4808|  35.5M|} /* end s_mp_cmp_d() */
s_mp_ispow2:
 4820|  3.99M|{
 4821|  3.99M|    mp_digit d;
 4822|  3.99M|    int extra = 0, ix;
 4823|       |
 4824|  3.99M|    ARGMPCHK(v != NULL);
  ------------------
  |  |  349|  3.99M|#define ARGMPCHK(X) assert(X)
  ------------------
 4825|       |
 4826|  3.99M|    ix = MP_USED(v) - 1;
  ------------------
  |  |  145|  3.99M|#define MP_USED(MP) ((MP)->used)
  ------------------
 4827|  3.99M|    d = MP_DIGIT(v, ix); /* most significant digit of v */
  ------------------
  |  |  148|  3.99M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 4828|       |
 4829|  3.99M|    extra = s_mp_ispow2d(d);
 4830|  3.99M|    if (extra < 0 || ix == 0)
  ------------------
  |  Branch (4830:9): [True: 3.79M, False: 203k]
  |  Branch (4830:22): [True: 0, False: 203k]
  ------------------
 4831|  3.79M|        return extra;
 4832|       |
 4833|   294k|    while (--ix >= 0) {
  ------------------
  |  Branch (4833:12): [True: 294k, False: 0]
  ------------------
 4834|   294k|        if (DIGIT(v, ix) != 0)
  ------------------
  |  |  331|   294k|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|   294k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
  |  Branch (4834:13): [True: 203k, False: 91.4k]
  ------------------
 4835|   203k|            return -1; /* not a power of two */
 4836|  91.4k|        extra += MP_DIGIT_BIT;
  ------------------
  |  |  132|  91.4k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  131|  91.4k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
 4837|  91.4k|    }
 4838|       |
 4839|      0|    return extra;
 4840|       |
 4841|   203k|} /* end s_mp_ispow2() */
s_mp_ispow2d:
 4849|  49.7M|{
 4850|  49.7M|    if ((d != 0) && ((d & (d - 1)) == 0)) { /* d is a power of 2 */
  ------------------
  |  Branch (4850:9): [True: 49.7M, False: 0]
  |  Branch (4850:21): [True: 1.46M, False: 48.3M]
  ------------------
 4851|  1.46M|        int pow = 0;
 4852|       |#if defined(MP_USE_UINT_DIGIT)
 4853|       |        if (d & 0xffff0000U)
 4854|       |            pow += 16;
 4855|       |        if (d & 0xff00ff00U)
 4856|       |            pow += 8;
 4857|       |        if (d & 0xf0f0f0f0U)
 4858|       |            pow += 4;
 4859|       |        if (d & 0xccccccccU)
 4860|       |            pow += 2;
 4861|       |        if (d & 0xaaaaaaaaU)
 4862|       |            pow += 1;
 4863|       |#elif defined(MP_USE_LONG_LONG_DIGIT)
 4864|       |        if (d & 0xffffffff00000000ULL)
 4865|       |            pow += 32;
 4866|       |        if (d & 0xffff0000ffff0000ULL)
 4867|       |            pow += 16;
 4868|       |        if (d & 0xff00ff00ff00ff00ULL)
 4869|       |            pow += 8;
 4870|       |        if (d & 0xf0f0f0f0f0f0f0f0ULL)
 4871|       |            pow += 4;
 4872|       |        if (d & 0xccccccccccccccccULL)
 4873|       |            pow += 2;
 4874|       |        if (d & 0xaaaaaaaaaaaaaaaaULL)
 4875|       |            pow += 1;
 4876|       |#elif defined(MP_USE_LONG_DIGIT)
 4877|  1.46M|        if (d & 0xffffffff00000000UL)
  ------------------
  |  Branch (4877:13): [True: 48.1k, False: 1.41M]
  ------------------
 4878|  48.1k|            pow += 32;
 4879|  1.46M|        if (d & 0xffff0000ffff0000UL)
  ------------------
  |  Branch (4879:13): [True: 52.2k, False: 1.41M]
  ------------------
 4880|  52.2k|            pow += 16;
 4881|  1.46M|        if (d & 0xff00ff00ff00ff00UL)
  ------------------
  |  Branch (4881:13): [True: 361k, False: 1.10M]
  ------------------
 4882|   361k|            pow += 8;
 4883|  1.46M|        if (d & 0xf0f0f0f0f0f0f0f0UL)
  ------------------
  |  Branch (4883:13): [True: 994k, False: 470k]
  ------------------
 4884|   994k|            pow += 4;
 4885|  1.46M|        if (d & 0xccccccccccccccccUL)
  ------------------
  |  Branch (4885:13): [True: 187k, False: 1.27M]
  ------------------
 4886|   187k|            pow += 2;
 4887|  1.46M|        if (d & 0xaaaaaaaaaaaaaaaaUL)
  ------------------
  |  Branch (4887:13): [True: 212k, False: 1.25M]
  ------------------
 4888|   212k|            pow += 1;
 4889|       |#else
 4890|       |#error "unknown type for mp_digit"
 4891|       |#endif
 4892|  1.46M|        return pow;
 4893|  1.46M|    }
 4894|  48.3M|    return -1;
 4895|       |
 4896|  49.7M|} /* end s_mp_ispow2d() */
s_mp_todigit:
 4959|   822k|{
 4960|   822k|    char ch;
 4961|       |
 4962|   822k|    if (val >= r)
  ------------------
  |  Branch (4962:9): [True: 0, False: 822k]
  ------------------
 4963|      0|        return 0;
 4964|       |
 4965|   822k|    ch = s_dmap_1[val];
 4966|       |
 4967|   822k|    if (r <= 36 && low)
  ------------------
  |  Branch (4967:9): [True: 822k, False: 0]
  |  Branch (4967:20): [True: 0, False: 822k]
  ------------------
 4968|      0|        ch = tolower(ch);
 4969|       |
 4970|   822k|    return ch;
 4971|       |
 4972|   822k|} /* end s_mp_todigit() */
mp_read_unsigned_octets:
 5002|  4.88k|{
 5003|  4.88k|    int count;
 5004|  4.88k|    mp_err res;
 5005|  4.88k|    mp_digit d;
 5006|       |
 5007|  4.88k|    ARGCHK(mp != NULL && str != NULL && len > 0, MP_BADARG);
  ------------------
  |  |  350|  4.88k|#define ARGCHK(X, Y) assert(X)
  ------------------
 5008|       |
 5009|  4.88k|    mp_zero(mp);
 5010|       |
 5011|  4.88k|    count = len % sizeof(mp_digit);
 5012|  4.88k|    if (count) {
  ------------------
  |  Branch (5012:9): [True: 4.03k, False: 849]
  ------------------
 5013|  17.1k|        for (d = 0; count-- > 0; --len) {
  ------------------
  |  Branch (5013:21): [True: 13.1k, False: 4.03k]
  ------------------
 5014|  13.1k|            d = (d << 8) | *str++;
 5015|  13.1k|        }
 5016|  4.03k|        MP_DIGIT(mp, 0) = d;
  ------------------
  |  |  148|  4.03k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 5017|  4.03k|    }
 5018|       |
 5019|       |    /* Read the rest of the digits */
 5020|  12.9k|    for (; len > 0; len -= sizeof(mp_digit)) {
  ------------------
  |  Branch (5020:12): [True: 8.03k, False: 4.88k]
  ------------------
 5021|  72.2k|        for (d = 0, count = sizeof(mp_digit); count > 0; --count) {
  ------------------
  |  Branch (5021:47): [True: 64.2k, False: 8.03k]
  ------------------
 5022|  64.2k|            d = (d << 8) | *str++;
 5023|  64.2k|        }
 5024|  8.03k|        if (MP_EQ == mp_cmp_z(mp)) {
  ------------------
  |  |   96|  8.03k|#define MP_EQ 0
  ------------------
  |  Branch (5024:13): [True: 849, False: 7.18k]
  ------------------
 5025|    849|            if (!d)
  ------------------
  |  Branch (5025:17): [True: 0, False: 849]
  ------------------
 5026|      0|                continue;
 5027|  7.18k|        } else {
 5028|  7.18k|            if ((res = s_mp_lshd(mp, 1)) != MP_OKAY)
  ------------------
  |  |   39|  7.18k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (5028:17): [True: 0, False: 7.18k]
  ------------------
 5029|      0|                return res;
 5030|  7.18k|        }
 5031|  8.03k|        MP_DIGIT(mp, 0) = d;
  ------------------
  |  |  148|  8.03k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 5032|  8.03k|    }
 5033|  4.88k|    return MP_OKAY;
  ------------------
  |  |   39|  4.88k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 5034|  4.88k|} /* end mp_read_unsigned_octets() */
mp_cswap:
 5205|  31.5M|{
 5206|  31.5M|    mp_digit x;
 5207|  31.5M|    unsigned int i;
 5208|  31.5M|    mp_err res = 0;
 5209|       |
 5210|       |    /* if pointers are equal return */
 5211|  31.5M|    if (a == b)
  ------------------
  |  Branch (5211:9): [True: 0, False: 31.5M]
  ------------------
 5212|      0|        return res;
 5213|       |
 5214|  31.5M|    if (MP_ALLOC(a) < numdigits || MP_ALLOC(b) < numdigits) {
  ------------------
  |  |  146|  31.5M|#define MP_ALLOC(MP) ((MP)->alloc)
  ------------------
                  if (MP_ALLOC(a) < numdigits || MP_ALLOC(b) < numdigits) {
  ------------------
  |  |  146|  31.5M|#define MP_ALLOC(MP) ((MP)->alloc)
  ------------------
  |  Branch (5214:9): [True: 0, False: 31.5M]
  |  Branch (5214:36): [True: 0, False: 31.5M]
  ------------------
 5215|      0|        MP_CHECKOK(s_mp_grow(a, numdigits));
  ------------------
  |  |  314|      0|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  315|      0|    goto CLEANUP
  ------------------
 5216|      0|        MP_CHECKOK(s_mp_grow(b, numdigits));
  ------------------
  |  |  314|      0|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  315|      0|    goto CLEANUP
  ------------------
 5217|      0|    }
 5218|       |
 5219|  31.5M|    condition = ((~condition & ((condition - 1))) >> (MP_DIGIT_BIT - 1)) - 1;
  ------------------
  |  |  132|  31.5M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  131|  31.5M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
 5220|       |
 5221|  31.5M|    x = (USED(a) ^ USED(b)) & condition;
  ------------------
  |  |  328|  31.5M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  31.5M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                  x = (USED(a) ^ USED(b)) & condition;
  ------------------
  |  |  328|  31.5M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  31.5M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
 5222|  31.5M|    USED(a) ^= x;
  ------------------
  |  |  328|  31.5M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  31.5M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
 5223|  31.5M|    USED(b) ^= x;
  ------------------
  |  |  328|  31.5M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|  31.5M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
 5224|       |
 5225|  31.5M|    x = (SIGN(a) ^ SIGN(b)) & condition;
  ------------------
  |  |  327|  31.5M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  31.5M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  x = (SIGN(a) ^ SIGN(b)) & condition;
  ------------------
  |  |  327|  31.5M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  31.5M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
 5226|  31.5M|    SIGN(a) ^= x;
  ------------------
  |  |  327|  31.5M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  31.5M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
 5227|  31.5M|    SIGN(b) ^= x;
  ------------------
  |  |  327|  31.5M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  144|  31.5M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
 5228|       |
 5229|   485M|    for (i = 0; i < numdigits; i++) {
  ------------------
  |  Branch (5229:17): [True: 453M, False: 31.5M]
  ------------------
 5230|   453M|        x = (DIGIT(a, i) ^ DIGIT(b, i)) & condition;
  ------------------
  |  |  331|   453M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|   453M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
                      x = (DIGIT(a, i) ^ DIGIT(b, i)) & condition;
  ------------------
  |  |  331|   453M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|   453M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 5231|   453M|        DIGIT(a, i) ^= x;
  ------------------
  |  |  331|   453M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|   453M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 5232|   453M|        DIGIT(b, i) ^= x;
  ------------------
  |  |  331|   453M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|   453M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 5233|   453M|    }
 5234|       |
 5235|  31.5M|CLEANUP:
 5236|  31.5M|    return res;
 5237|  31.5M|} /* end mp_cswap() */

s_mpv_mul_d_add_prop:
   21|   123M|{
   22|   123M|    mp_digit w;
   23|   123M|    mp_digit d;
   24|       |
   25|   123M|    d = s_mpv_mul_add_vec64(c, a, a_len, b);
   26|   123M|    c += a_len;
   27|   246M|    while (d) {
  ------------------
  |  Branch (27:12): [True: 123M, False: 123M]
  ------------------
   28|   123M|        w = c[0] + d;
   29|   123M|        d = (w < c[0] || w < d);
  ------------------
  |  Branch (29:14): [True: 7.62M, False: 115M]
  |  Branch (29:26): [True: 0, False: 115M]
  ------------------
   30|   123M|        *c++ = w;
   31|   123M|    }
   32|   123M|}

mpl_set_bit:
  335|  9.76k|{
  336|  9.76k|    mp_size ix;
  337|  9.76k|    mp_err rv;
  338|  9.76k|    mp_digit mask;
  339|       |
  340|  9.76k|    ARGCHK(a != NULL, MP_BADARG);
  ------------------
  |  |  350|  9.76k|#define ARGCHK(X, Y) assert(X)
  ------------------
  341|       |
  342|  9.76k|    ix = bitNum / MP_DIGIT_BIT;
  ------------------
  |  |  132|  9.76k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  131|  9.76k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
  343|  9.76k|    if (ix + 1 > MP_USED(a)) {
  ------------------
  |  |  145|  9.76k|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (343:9): [True: 0, False: 9.76k]
  ------------------
  344|      0|        rv = s_mp_pad(a, ix + 1);
  345|      0|        if (rv != MP_OKAY)
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (345:13): [True: 0, False: 0]
  ------------------
  346|      0|            return rv;
  347|      0|    }
  348|       |
  349|  9.76k|    bitNum = bitNum % MP_DIGIT_BIT;
  ------------------
  |  |  132|  9.76k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  131|  9.76k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
  350|  9.76k|    mask = (mp_digit)1 << bitNum;
  351|  9.76k|    if (value)
  ------------------
  |  Branch (351:9): [True: 9.76k, False: 0]
  ------------------
  352|  9.76k|        MP_DIGIT(a, ix) |= mask;
  ------------------
  |  |  148|  9.76k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
  353|      0|    else
  354|      0|        MP_DIGIT(a, ix) &= ~mask;
  ------------------
  |  |  148|      0|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
  355|  9.76k|    s_mp_clamp(a);
  356|  9.76k|    return MP_OKAY;
  ------------------
  |  |   39|  9.76k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  357|  9.76k|}
mpl_get_bits:
  392|  5.64M|{
  393|  5.64M|    mp_size rshift = (lsbNum % MP_DIGIT_BIT);
  ------------------
  |  |  132|  5.64M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  131|  5.64M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
  394|  5.64M|    mp_size lsWndx = (lsbNum / MP_DIGIT_BIT);
  ------------------
  |  |  132|  5.64M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  131|  5.64M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
  395|  5.64M|    mp_digit *digit = MP_DIGITS(a) + lsWndx;
  ------------------
  |  |  147|  5.64M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  396|  5.64M|    mp_digit mask = ((1 << numBits) - 1);
  397|       |
  398|  5.64M|    ARGCHK(numBits < CHAR_BIT * sizeof mask, MP_BADARG);
  ------------------
  |  |  350|  5.64M|#define ARGCHK(X, Y) assert(X)
  ------------------
  399|  5.64M|    ARGCHK(MP_HOWMANY(lsbNum, MP_DIGIT_BIT) <= MP_USED(a), MP_RANGE);
  ------------------
  |  |  350|  5.64M|#define ARGCHK(X, Y) assert(X)
  ------------------
  400|       |
  401|  5.64M|    if ((numBits + lsbNum % MP_DIGIT_BIT <= MP_DIGIT_BIT) ||
  ------------------
  |  |  132|  5.64M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  131|  5.64M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
                  if ((numBits + lsbNum % MP_DIGIT_BIT <= MP_DIGIT_BIT) ||
  ------------------
  |  |  132|  5.64M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  131|  5.64M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
  |  Branch (401:9): [True: 5.57M, False: 70.9k]
  ------------------
  402|  5.64M|        (lsWndx + 1 >= MP_USED(a))) {
  ------------------
  |  |  145|  70.9k|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (402:9): [True: 2.98k, False: 68.0k]
  ------------------
  403|  5.57M|        mask &= (digit[0] >> rshift);
  404|  5.57M|    } else {
  405|  68.0k|        mask &= ((digit[0] >> rshift) | (digit[1] << (MP_DIGIT_BIT - rshift)));
  ------------------
  |  |  132|  68.0k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  131|  68.0k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
  406|  68.0k|    }
  407|  5.64M|    return (mp_err)mask;
  408|  5.64M|}
mpl_significant_bits:
  427|   244k|{
  428|       |    /*
  429|       |      start bits at 1.
  430|       |      lg(0) = 0 => bits = 1 by function semantics.
  431|       |      below does a binary search for the _position_ of the top bit set,
  432|       |      which is floor(lg(abs(a))) for a != 0.
  433|       |     */
  434|   244k|    mp_size bits = 1;
  435|   244k|    int ix;
  436|       |
  437|   244k|    ARGCHK(a != NULL, MP_BADARG);
  ------------------
  |  |  350|   244k|#define ARGCHK(X, Y) assert(X)
  ------------------
  438|       |
  439|   244k|    for (ix = MP_USED(a); ix > 0;) {
  ------------------
  |  |  145|   244k|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (439:27): [True: 244k, False: 0]
  ------------------
  440|   244k|        mp_digit d, x, mask;
  441|   244k|        if ((d = MP_DIGIT(a, --ix)) == 0)
  ------------------
  |  |  148|   244k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
  |  Branch (441:13): [True: 0, False: 244k]
  ------------------
  442|      0|            continue;
  443|   244k|#if !defined(MP_USE_UINT_DIGIT)
  444|   244k|        LZCNTLOOP(32);
  ------------------
  |  |  411|   244k|    do {                                           \
  |  |  412|   244k|        x = d >> (i);                              \
  |  |  413|   244k|        mask = (0 - x);                            \
  |  |  414|   244k|        mask = (0 - (mask >> (MP_DIGIT_BIT - 1))); \
  |  |  ------------------
  |  |  |  |  132|   244k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|   244k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  415|   244k|        bits += (i)&mask;                          \
  |  |  416|   244k|        d ^= (x ^ d) & mask;                       \
  |  |  417|   244k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (417:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  445|   244k|#endif
  446|   244k|        LZCNTLOOP(16);
  ------------------
  |  |  411|   244k|    do {                                           \
  |  |  412|   244k|        x = d >> (i);                              \
  |  |  413|   244k|        mask = (0 - x);                            \
  |  |  414|   244k|        mask = (0 - (mask >> (MP_DIGIT_BIT - 1))); \
  |  |  ------------------
  |  |  |  |  132|   244k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|   244k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  415|   244k|        bits += (i)&mask;                          \
  |  |  416|   244k|        d ^= (x ^ d) & mask;                       \
  |  |  417|   244k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (417:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  447|   244k|        LZCNTLOOP(8);
  ------------------
  |  |  411|   244k|    do {                                           \
  |  |  412|   244k|        x = d >> (i);                              \
  |  |  413|   244k|        mask = (0 - x);                            \
  |  |  414|   244k|        mask = (0 - (mask >> (MP_DIGIT_BIT - 1))); \
  |  |  ------------------
  |  |  |  |  132|   244k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|   244k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  415|   244k|        bits += (i)&mask;                          \
  |  |  416|   244k|        d ^= (x ^ d) & mask;                       \
  |  |  417|   244k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (417:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  448|   244k|        LZCNTLOOP(4);
  ------------------
  |  |  411|   244k|    do {                                           \
  |  |  412|   244k|        x = d >> (i);                              \
  |  |  413|   244k|        mask = (0 - x);                            \
  |  |  414|   244k|        mask = (0 - (mask >> (MP_DIGIT_BIT - 1))); \
  |  |  ------------------
  |  |  |  |  132|   244k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|   244k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  415|   244k|        bits += (i)&mask;                          \
  |  |  416|   244k|        d ^= (x ^ d) & mask;                       \
  |  |  417|   244k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (417:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  449|   244k|        LZCNTLOOP(2);
  ------------------
  |  |  411|   244k|    do {                                           \
  |  |  412|   244k|        x = d >> (i);                              \
  |  |  413|   244k|        mask = (0 - x);                            \
  |  |  414|   244k|        mask = (0 - (mask >> (MP_DIGIT_BIT - 1))); \
  |  |  ------------------
  |  |  |  |  132|   244k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|   244k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  415|   244k|        bits += (i)&mask;                          \
  |  |  416|   244k|        d ^= (x ^ d) & mask;                       \
  |  |  417|   244k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (417:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  450|   244k|        LZCNTLOOP(1);
  ------------------
  |  |  411|   244k|    do {                                           \
  |  |  412|   244k|        x = d >> (i);                              \
  |  |  413|   244k|        mask = (0 - x);                            \
  |  |  414|   244k|        mask = (0 - (mask >> (MP_DIGIT_BIT - 1))); \
  |  |  ------------------
  |  |  |  |  132|   244k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|   244k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  415|   244k|        bits += (i)&mask;                          \
  |  |  416|   244k|        d ^= (x ^ d) & mask;                       \
  |  |  417|   244k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (417:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  451|   244k|        break;
  452|   244k|    }
  453|   244k|    bits += ix * MP_DIGIT_BIT;
  ------------------
  |  |  132|   244k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  131|   244k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
  454|   244k|    return bits;
  455|   244k|}

s_mp_redc:
   34|  23.1M|{
   35|  23.1M|    mp_err res;
   36|  23.1M|    mp_size i;
   37|       |
   38|  23.1M|    i = (MP_USED(&mmm->N) << 1) + 1;
  ------------------
  |  |  145|  23.1M|#define MP_USED(MP) ((MP)->used)
  ------------------
   39|  23.1M|    MP_CHECKOK(s_mp_pad(T, i));
  ------------------
  |  |  314|  23.1M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  23.1M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 23.1M]
  |  |  ------------------
  |  |  315|  23.1M|    goto CLEANUP
  ------------------
   40|   109M|    for (i = 0; i < MP_USED(&mmm->N); ++i) {
  ------------------
  |  |  145|   109M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (40:17): [True: 86.3M, False: 23.1M]
  ------------------
   41|  86.3M|        mp_digit m_i = MP_DIGIT(T, i) * mmm->n0prime;
  ------------------
  |  |  148|  86.3M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
   42|       |        /* T += N * m_i * (MP_RADIX ** i); */
   43|  86.3M|        s_mp_mul_d_add_offset(&mmm->N, m_i, T, i);
  ------------------
  |  |  221|  86.3M|    s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  147|  86.3M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  |  |                   s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  145|  86.3M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  |  |                   s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  147|  86.3M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
   44|  86.3M|    }
   45|  23.1M|    s_mp_clamp(T);
   46|       |
   47|       |    /* T /= R */
   48|  23.1M|    s_mp_rshd(T, MP_USED(&mmm->N));
  ------------------
  |  |  145|  23.1M|#define MP_USED(MP) ((MP)->used)
  ------------------
   49|       |
   50|  23.1M|    if ((res = s_mp_cmp(T, &mmm->N)) >= 0) {
  ------------------
  |  Branch (50:9): [True: 1.16M, False: 21.9M]
  ------------------
   51|       |        /* T = T - N */
   52|  1.16M|        MP_CHECKOK(s_mp_sub(T, &mmm->N));
  ------------------
  |  |  314|  1.16M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  1.16M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 1.16M]
  |  |  ------------------
  |  |  315|  1.16M|    goto CLEANUP
  ------------------
   53|  1.16M|#ifdef DEBUG
   54|  1.16M|        if ((res = mp_cmp(T, &mmm->N)) >= 0) {
  ------------------
  |  Branch (54:13): [True: 0, False: 1.16M]
  ------------------
   55|      0|            res = MP_UNDEF;
  ------------------
  |  |   45|      0|#define MP_UNDEF -5  /* answer is undefined   */
  ------------------
   56|      0|            goto CLEANUP;
   57|      0|        }
   58|  1.16M|#endif
   59|  1.16M|    }
   60|  23.1M|    res = MP_OKAY;
  ------------------
  |  |   39|  23.1M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
   61|  23.1M|CLEANUP:
   62|  23.1M|    return res;
   63|  23.1M|}
s_mp_mul_mont:
   75|  6.68M|{
   76|  6.68M|    mp_digit *pb;
   77|  6.68M|    mp_digit m_i;
   78|  6.68M|    mp_err res;
   79|  6.68M|    mp_size ib; /* "index b": index of current digit of B */
   80|  6.68M|    mp_size useda, usedb;
   81|       |
   82|  6.68M|    ARGCHK(a != NULL && b != NULL && c != NULL, MP_BADARG);
  ------------------
  |  |  350|  6.68M|#define ARGCHK(X, Y) assert(X)
  ------------------
   83|       |
   84|  6.68M|    if (MP_USED(a) < MP_USED(b)) {
  ------------------
  |  |  145|  6.68M|#define MP_USED(MP) ((MP)->used)
  ------------------
                  if (MP_USED(a) < MP_USED(b)) {
  ------------------
  |  |  145|  6.68M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (84:9): [True: 18.0k, False: 6.67M]
  ------------------
   85|  18.0k|        const mp_int *xch = b; /* switch a and b, to do fewer outer loops */
   86|  18.0k|        b = a;
   87|  18.0k|        a = xch;
   88|  18.0k|    }
   89|       |
   90|  6.68M|    MP_USED(c) = 1;
  ------------------
  |  |  145|  6.68M|#define MP_USED(MP) ((MP)->used)
  ------------------
   91|  6.68M|    MP_DIGIT(c, 0) = 0;
  ------------------
  |  |  148|  6.68M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
   92|  6.68M|    ib = (MP_USED(&mmm->N) << 1) + 1;
  ------------------
  |  |  145|  6.68M|#define MP_USED(MP) ((MP)->used)
  ------------------
   93|  6.68M|    if ((res = s_mp_pad(c, ib)) != MP_OKAY)
  ------------------
  |  |   39|  6.68M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (93:9): [True: 0, False: 6.68M]
  ------------------
   94|      0|        goto CLEANUP;
   95|       |
   96|  6.68M|    useda = MP_USED(a);
  ------------------
  |  |  145|  6.68M|#define MP_USED(MP) ((MP)->used)
  ------------------
   97|  6.68M|    pb = MP_DIGITS(b);
  ------------------
  |  |  147|  6.68M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
   98|  6.68M|    s_mpv_mul_d(MP_DIGITS(a), useda, *pb++, MP_DIGITS(c));
  ------------------
  |  |  189|  6.68M|    ((mp_digit *)c)[a_len] = s_mpv_mul_set_vec64(c, a, a_len, b)
  ------------------
   99|  6.68M|    s_mp_setz(MP_DIGITS(c) + useda + 1, ib - (useda + 1));
  ------------------
  |  |  147|  6.68M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  100|  6.68M|    m_i = MP_DIGIT(c, 0) * mmm->n0prime;
  ------------------
  |  |  148|  6.68M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
  101|  6.68M|    s_mp_mul_d_add_offset(&mmm->N, m_i, c, 0);
  ------------------
  |  |  221|  6.68M|    s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  147|  6.68M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  |  |                   s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  145|  6.68M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  |  |                   s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  147|  6.68M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
  102|       |
  103|       |    /* Outer loop:  Digits of b */
  104|  6.68M|    usedb = MP_USED(b);
  ------------------
  |  |  145|  6.68M|#define MP_USED(MP) ((MP)->used)
  ------------------
  105|  21.1M|    for (ib = 1; ib < usedb; ib++) {
  ------------------
  |  Branch (105:18): [True: 14.4M, False: 6.68M]
  ------------------
  106|  14.4M|        mp_digit b_i = *pb++;
  107|       |
  108|       |        /* Inner product:  Digits of a */
  109|  14.4M|        if (b_i)
  ------------------
  |  Branch (109:13): [True: 14.4M, False: 47.1k]
  ------------------
  110|  14.4M|            s_mpv_mul_d_add_prop(MP_DIGITS(a), useda, b_i, MP_DIGITS(c) + ib);
  ------------------
  |  |  147|  14.4M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
                          s_mpv_mul_d_add_prop(MP_DIGITS(a), useda, b_i, MP_DIGITS(c) + ib);
  ------------------
  |  |  147|  14.4M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  111|  14.4M|        m_i = MP_DIGIT(c, ib) * mmm->n0prime;
  ------------------
  |  |  148|  14.4M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
  112|  14.4M|        s_mp_mul_d_add_offset(&mmm->N, m_i, c, ib);
  ------------------
  |  |  221|  14.4M|    s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  147|  14.4M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  |  |                   s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  145|  14.4M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  |  |                   s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  147|  14.4M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
  113|  14.4M|    }
  114|  6.68M|    if (usedb < MP_USED(&mmm->N)) {
  ------------------
  |  |  145|  6.68M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (114:9): [True: 993k, False: 5.69M]
  ------------------
  115|  2.57M|        for (usedb = MP_USED(&mmm->N); ib < usedb; ++ib) {
  ------------------
  |  |  145|   993k|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (115:40): [True: 1.58M, False: 993k]
  ------------------
  116|  1.58M|            m_i = MP_DIGIT(c, ib) * mmm->n0prime;
  ------------------
  |  |  148|  1.58M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
  117|  1.58M|            s_mp_mul_d_add_offset(&mmm->N, m_i, c, ib);
  ------------------
  |  |  221|  1.58M|    s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  147|  1.58M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  |  |                   s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  145|  1.58M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  |  |                   s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  147|  1.58M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
  118|  1.58M|        }
  119|   993k|    }
  120|  6.68M|    s_mp_clamp(c);
  121|  6.68M|    s_mp_rshd(c, MP_USED(&mmm->N)); /* c /= R */
  ------------------
  |  |  145|  6.68M|#define MP_USED(MP) ((MP)->used)
  ------------------
  122|  6.68M|    if (s_mp_cmp(c, &mmm->N) >= 0) {
  ------------------
  |  Branch (122:9): [True: 128k, False: 6.56M]
  ------------------
  123|   128k|        MP_CHECKOK(s_mp_sub(c, &mmm->N));
  ------------------
  |  |  314|   128k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   128k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 128k]
  |  |  ------------------
  |  |  315|   128k|    goto CLEANUP
  ------------------
  124|   128k|    }
  125|  6.68M|    res = MP_OKAY;
  ------------------
  |  |   39|  6.68M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  126|       |
  127|  6.68M|CLEANUP:
  128|  6.68M|    return res;
  129|  6.68M|}
mp_to_mont:
  134|   422k|{
  135|   422k|    mp_err res;
  136|       |
  137|       |    /* xMont = x * R mod N   where  N is modulus */
  138|   422k|    if (x != xMont) {
  ------------------
  |  Branch (138:9): [True: 229k, False: 192k]
  ------------------
  139|   229k|        MP_CHECKOK(mp_copy(x, xMont));
  ------------------
  |  |  314|   229k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   229k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 229k]
  |  |  ------------------
  |  |  315|   229k|    goto CLEANUP
  ------------------
  140|   229k|    }
  141|   422k|    MP_CHECKOK(s_mp_lshd(xMont, MP_USED(N))); /* xMont = x << b */
  ------------------
  |  |  314|   422k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   422k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 422k]
  |  |  ------------------
  |  |  315|   422k|    goto CLEANUP
  ------------------
  142|   422k|    MP_CHECKOK(mp_div(xMont, N, 0, xMont));   /*         mod N */
  ------------------
  |  |  314|   422k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   422k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 422k]
  |  |  ------------------
  |  |  315|   422k|    goto CLEANUP
  ------------------
  143|   422k|CLEANUP:
  144|   422k|    return res;
  145|   422k|}
mp_calculate_mont_n0i:
  149|   229k|{
  150|   229k|    return 0 - s_mp_invmod_radix(MP_DIGIT(N, 0));
  ------------------
  |  |  148|   229k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
  151|   229k|}
mpi_to_weave:
  738|   826k|{
  739|   826k|    mp_size i;
  740|   826k|    mp_digit *endDest = weaved + (nDigits * nBignums);
  741|       |
  742|  4.13M|    for (i = 0; i < WEAVE_WORD_SIZE; i++) {
  ------------------
  |  |  694|  4.13M|#define WEAVE_WORD_SIZE 4
  ------------------
  |  Branch (742:17): [True: 3.30M, False: 826k]
  ------------------
  743|  3.30M|        mp_size used = MP_USED(&bignums[i]);
  ------------------
  |  |  145|  3.30M|#define MP_USED(MP) ((MP)->used)
  ------------------
  744|  3.30M|        mp_digit *pSrc = MP_DIGITS(&bignums[i]);
  ------------------
  |  |  147|  3.30M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  745|  3.30M|        mp_digit *endSrc = pSrc + used;
  746|  3.30M|        mp_digit *pDest = weaved + i;
  747|       |
  748|  3.30M|        ARGCHK(MP_SIGN(&bignums[i]) == MP_ZPOS, MP_BADARG);
  ------------------
  |  |  350|  3.30M|#define ARGCHK(X, Y) assert(X)
  ------------------
  749|  3.30M|        ARGCHK(used <= nDigits, MP_BADARG);
  ------------------
  |  |  350|  3.30M|#define ARGCHK(X, Y) assert(X)
  ------------------
  750|       |
  751|  11.6M|        for (; pSrc < endSrc; pSrc++) {
  ------------------
  |  Branch (751:16): [True: 8.32M, False: 3.30M]
  ------------------
  752|  8.32M|            *pDest = *pSrc;
  753|  8.32M|            pDest += nBignums;
  754|  8.32M|        }
  755|  3.79M|        while (pDest < endDest) {
  ------------------
  |  Branch (755:16): [True: 491k, False: 3.30M]
  ------------------
  756|   491k|            *pDest = 0;
  757|   491k|            pDest += nBignums;
  758|   491k|        }
  759|  3.30M|    }
  760|       |
  761|   826k|    return MP_OKAY;
  ------------------
  |  |   39|   826k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  762|   826k|}
weave_to_mpi:
  782|  5.67M|{
  783|       |    /* these are indices, but need to be the same size as mp_digit
  784|       |     * because of the CONST_TIME operations */
  785|  5.67M|    mp_digit i, j;
  786|  5.67M|    mp_digit d;
  787|  5.67M|    mp_digit *pDest = MP_DIGITS(a);
  ------------------
  |  |  147|  5.67M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  788|       |
  789|  5.67M|    MP_SIGN(a) = MP_ZPOS;
  ------------------
  |  |  144|  5.67M|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
                  MP_SIGN(a) = MP_ZPOS;
  ------------------
  |  |   37|  5.67M|#define MP_ZPOS 0
  ------------------
  790|  5.67M|    MP_USED(a) = nDigits;
  ------------------
  |  |  145|  5.67M|#define MP_USED(MP) ((MP)->used)
  ------------------
  791|       |
  792|  5.67M|    assert(weaved != NULL);
  793|       |
  794|       |    /* Fetch the proper column in constant time, indexing over the whole array */
  795|  26.2M|    for (i = 0; i < nDigits; ++i) {
  ------------------
  |  Branch (795:17): [True: 20.5M, False: 5.67M]
  ------------------
  796|  20.5M|        d = 0;
  797|   485M|        for (j = 0; j < nBignums; ++j) {
  ------------------
  |  Branch (797:21): [True: 465M, False: 20.5M]
  ------------------
  798|   465M|            d |= weaved[i * nBignums + j] & CONST_TIME_EQ(j, index);
  ------------------
  |  |  769|   465M|#define CONST_TIME_EQ(a, b) CONST_TIME_EQ_Z((a) ^ (b))
  |  |  ------------------
  |  |  |  |  768|   465M|#define CONST_TIME_EQ_Z(x) CONST_TIME_MSB(~(x) & ((x)-1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  767|   465M|#define CONST_TIME_MSB(x) (0L - ((x) >> (8 * sizeof(x) - 1)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  799|   465M|        }
  800|  20.5M|        pDest[i] = d;
  801|  20.5M|    }
  802|       |
  803|  5.67M|    s_mp_clamp(a);
  804|  5.67M|    return MP_OKAY;
  ------------------
  |  |   39|  5.67M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  805|  5.67M|}
mp_exptmod_safe_i:
  841|   229k|{
  842|   229k|    mp_int *pa1, *pa2, *ptmp;
  843|   229k|    mp_size i;
  844|   229k|    mp_size first_window;
  845|   229k|    mp_err res;
  846|   229k|    int expOff;
  847|   229k|    mp_int accum1, accum2, accum[WEAVE_WORD_SIZE];
  848|   229k|    mp_int tmp;
  849|   229k|    mp_digit *powersArray = NULL;
  850|   229k|    mp_digit *powers = NULL;
  851|       |
  852|   229k|    MP_DIGITS(&accum1) = 0;
  ------------------
  |  |  147|   229k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  853|   229k|    MP_DIGITS(&accum2) = 0;
  ------------------
  |  |  147|   229k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  854|   229k|    MP_DIGITS(&accum[0]) = 0;
  ------------------
  |  |  147|   229k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  855|   229k|    MP_DIGITS(&accum[1]) = 0;
  ------------------
  |  |  147|   229k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  856|   229k|    MP_DIGITS(&accum[2]) = 0;
  ------------------
  |  |  147|   229k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  857|   229k|    MP_DIGITS(&accum[3]) = 0;
  ------------------
  |  |  147|   229k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  858|   229k|    MP_DIGITS(&tmp) = 0;
  ------------------
  |  |  147|   229k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  859|       |
  860|       |    /* grab the first window value. This allows us to preload accumulator1
  861|       |   * and save a conversion, some squares and a multiple*/
  862|   229k|    MP_CHECKOK(mpl_get_bits(exponent,
  ------------------
  |  |  314|   229k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   229k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 229k]
  |  |  ------------------
  |  |  315|   229k|    goto CLEANUP
  ------------------
  863|   229k|                            bits_in_exponent - window_bits, window_bits));
  864|   229k|    first_window = (mp_size)res;
  865|       |
  866|   229k|    MP_CHECKOK(mp_init_size(&accum1, 3 * nLen + 2));
  ------------------
  |  |  314|   229k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   229k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 229k]
  |  |  ------------------
  |  |  315|   229k|    goto CLEANUP
  ------------------
  867|   229k|    MP_CHECKOK(mp_init_size(&accum2, 3 * nLen + 2));
  ------------------
  |  |  314|   229k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   229k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 229k]
  |  |  ------------------
  |  |  315|   229k|    goto CLEANUP
  ------------------
  868|       |
  869|       |    /* build the first WEAVE_WORD powers inline */
  870|       |    /* if WEAVE_WORD_SIZE is not 4, this code will have to change */
  871|   229k|    if (num_powers > 2) {
  ------------------
  |  Branch (871:9): [True: 192k, False: 36.9k]
  ------------------
  872|   192k|        MP_CHECKOK(mp_init_size(&accum[0], 3 * nLen + 2));
  ------------------
  |  |  314|   192k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   192k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 192k]
  |  |  ------------------
  |  |  315|   192k|    goto CLEANUP
  ------------------
  873|   192k|        MP_CHECKOK(mp_init_size(&accum[1], 3 * nLen + 2));
  ------------------
  |  |  314|   192k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   192k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 192k]
  |  |  ------------------
  |  |  315|   192k|    goto CLEANUP
  ------------------
  874|   192k|        MP_CHECKOK(mp_init_size(&accum[2], 3 * nLen + 2));
  ------------------
  |  |  314|   192k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   192k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 192k]
  |  |  ------------------
  |  |  315|   192k|    goto CLEANUP
  ------------------
  875|   192k|        MP_CHECKOK(mp_init_size(&accum[3], 3 * nLen + 2));
  ------------------
  |  |  314|   192k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   192k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 192k]
  |  |  ------------------
  |  |  315|   192k|    goto CLEANUP
  ------------------
  876|   192k|        mp_set(&accum[0], 1);
  877|   192k|        MP_CHECKOK(mp_to_mont(&accum[0], &(mmm->N), &accum[0]));
  ------------------
  |  |  314|   192k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   192k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 192k]
  |  |  ------------------
  |  |  315|   192k|    goto CLEANUP
  ------------------
  878|   192k|        MP_CHECKOK(mp_copy(montBase, &accum[1]));
  ------------------
  |  |  314|   192k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   192k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 192k]
  |  |  ------------------
  |  |  315|   192k|    goto CLEANUP
  ------------------
  879|   385k|        SQR(montBase, &accum[2]);
  ------------------
  |  |  808|   192k|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  314|   192k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   192k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 192k]
  |  |  |  |  ------------------
  |  |  |  |  315|   192k|    goto CLEANUP
  |  |  ------------------
  |  |  809|   192k|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  314|   192k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   192k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 192k]
  |  |  |  |  ------------------
  |  |  |  |  315|   192k|    goto CLEANUP
  |  |  ------------------
  ------------------
  880|   192k|        MUL_NOWEAVE(montBase, &accum[2], &accum[3]);
  ------------------
  |  |  817|   192k|    MP_CHECKOK(s_mp_mul_mont(a, x, b, mmm))
  |  |  ------------------
  |  |  |  |  314|   192k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   192k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 192k]
  |  |  |  |  ------------------
  |  |  |  |  315|   192k|    goto CLEANUP
  |  |  ------------------
  ------------------
  881|   192k|        powersArray = (mp_digit *)malloc(num_powers * (nLen * sizeof(mp_digit) + 1));
  882|   192k|        if (!powersArray) {
  ------------------
  |  Branch (882:13): [True: 0, False: 192k]
  ------------------
  883|      0|            res = MP_MEM;
  ------------------
  |  |   42|      0|#define MP_MEM -2    /* out of memory         */
  ------------------
  884|      0|            goto CLEANUP;
  885|      0|        }
  886|       |        /* powers[i] = base ** (i); */
  887|   192k|        powers = (mp_digit *)MP_ALIGN(powersArray, num_powers);
  ------------------
  |  |  828|   192k|#define MP_ALIGN(x, y) ((((ptrdiff_t)(x)) + ((y)-1)) & (((ptrdiff_t)0) - (y)))
  ------------------
  888|   192k|        MP_CHECKOK(mpi_to_weave(accum, powers, nLen, num_powers));
  ------------------
  |  |  314|   192k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   192k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 192k]
  |  |  ------------------
  |  |  315|   192k|    goto CLEANUP
  ------------------
  889|   192k|        if (first_window < 4) {
  ------------------
  |  Branch (889:13): [True: 60.2k, False: 132k]
  ------------------
  890|  60.2k|            MP_CHECKOK(mp_copy(&accum[first_window], &accum1));
  ------------------
  |  |  314|  60.2k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  60.2k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 60.2k]
  |  |  ------------------
  |  |  315|  60.2k|    goto CLEANUP
  ------------------
  891|  60.2k|            first_window = num_powers;
  892|  60.2k|        }
  893|   192k|    } else {
  894|  36.9k|        if (first_window == 0) {
  ------------------
  |  Branch (894:13): [True: 0, False: 36.9k]
  ------------------
  895|      0|            mp_set(&accum1, 1);
  896|      0|            MP_CHECKOK(mp_to_mont(&accum1, &(mmm->N), &accum1));
  ------------------
  |  |  314|      0|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  315|      0|    goto CLEANUP
  ------------------
  897|  36.9k|        } else {
  898|       |            /* assert first_window == 1? */
  899|  36.9k|            MP_CHECKOK(mp_copy(montBase, &accum1));
  ------------------
  |  |  314|  36.9k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  36.9k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 36.9k]
  |  |  ------------------
  |  |  315|  36.9k|    goto CLEANUP
  ------------------
  900|  36.9k|        }
  901|  36.9k|    }
  902|       |
  903|       |    /*
  904|       |     * calculate all the powers in the powers array.
  905|       |     * this adds 2**(k-1)-2 square operations over just calculating the
  906|       |     * odd powers where k is the window size in the two other mp_modexpt
  907|       |     * implementations in this file. We will get some of that
  908|       |     * back by not needing the first 'k' squares and one multiply for the
  909|       |     * first window.
  910|       |     * Given the value of 4 for WEAVE_WORD_SIZE, this loop will only execute if
  911|       |     * num_powers > 2, in which case powers will have been allocated.
  912|       |     */
  913|  2.76M|    for (i = WEAVE_WORD_SIZE; i < num_powers; i++) {
  ------------------
  |  |  694|   229k|#define WEAVE_WORD_SIZE 4
  ------------------
  |  Branch (913:31): [True: 2.53M, False: 229k]
  ------------------
  914|  2.53M|        int acc_index = i & (WEAVE_WORD_SIZE - 1); /* i % WEAVE_WORD_SIZE */
  ------------------
  |  |  694|  2.53M|#define WEAVE_WORD_SIZE 4
  ------------------
  915|  2.53M|        if (i & 1) {
  ------------------
  |  Branch (915:13): [True: 1.26M, False: 1.26M]
  ------------------
  916|  1.26M|            MUL_NOWEAVE(montBase, &accum[acc_index - 1], &accum[acc_index]);
  ------------------
  |  |  817|  1.26M|    MP_CHECKOK(s_mp_mul_mont(a, x, b, mmm))
  |  |  ------------------
  |  |  |  |  314|  1.26M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  1.26M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 1.26M]
  |  |  |  |  ------------------
  |  |  |  |  315|  1.26M|    goto CLEANUP
  |  |  ------------------
  ------------------
  917|       |            /* we've filled the array do our 'per array' processing */
  918|  1.26M|            if (acc_index == (WEAVE_WORD_SIZE - 1)) {
  ------------------
  |  |  694|  1.26M|#define WEAVE_WORD_SIZE 4
  ------------------
  |  Branch (918:17): [True: 633k, False: 633k]
  ------------------
  919|   633k|                MP_CHECKOK(mpi_to_weave(accum, powers + i - (WEAVE_WORD_SIZE - 1),
  ------------------
  |  |  314|   633k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   633k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 633k]
  |  |  ------------------
  |  |  315|   633k|    goto CLEANUP
  ------------------
  920|   633k|                                        nLen, num_powers));
  921|       |
  922|   633k|                if (first_window <= i) {
  ------------------
  |  Branch (922:21): [True: 132k, False: 501k]
  ------------------
  923|   132k|                    MP_CHECKOK(mp_copy(&accum[first_window & (WEAVE_WORD_SIZE - 1)],
  ------------------
  |  |  314|   132k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   132k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 132k]
  |  |  ------------------
  |  |  315|   132k|    goto CLEANUP
  ------------------
  924|   132k|                                       &accum1));
  925|   132k|                    first_window = num_powers;
  926|   132k|                }
  927|   633k|            }
  928|  1.26M|        } else {
  929|       |            /* up to 8 we can find 2^i-1 in the accum array, but at 8 we our source
  930|       |             * and target are the same so we need to copy.. After that, the
  931|       |             * value is overwritten, so we need to fetch it from the stored
  932|       |             * weave array */
  933|  1.26M|            if (i > 2 * WEAVE_WORD_SIZE) {
  ------------------
  |  |  694|  1.26M|#define WEAVE_WORD_SIZE 4
  ------------------
  |  Branch (933:17): [True: 688k, False: 578k]
  ------------------
  934|   688k|                MP_CHECKOK(weave_to_mpi(&accum2, powers, i / 2, nLen, num_powers));
  ------------------
  |  |  314|   688k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   688k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 688k]
  |  |  ------------------
  |  |  315|   688k|    goto CLEANUP
  ------------------
  935|  1.37M|                SQR(&accum2, &accum[acc_index]);
  ------------------
  |  |  808|   688k|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  314|   688k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   688k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 688k]
  |  |  |  |  ------------------
  |  |  |  |  315|   688k|    goto CLEANUP
  |  |  ------------------
  |  |  809|   688k|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  314|   688k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   688k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 688k]
  |  |  |  |  ------------------
  |  |  |  |  315|   688k|    goto CLEANUP
  |  |  ------------------
  ------------------
  936|  1.37M|            } else {
  937|   578k|                int half_power_index = (i / 2) & (WEAVE_WORD_SIZE - 1);
  ------------------
  |  |  694|   578k|#define WEAVE_WORD_SIZE 4
  ------------------
  938|   578k|                if (half_power_index == acc_index) {
  ------------------
  |  Branch (938:21): [True: 192k, False: 385k]
  ------------------
  939|       |                    /* copy is cheaper than weave_to_mpi */
  940|   192k|                    MP_CHECKOK(mp_copy(&accum[half_power_index], &accum2));
  ------------------
  |  |  314|   192k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   192k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 192k]
  |  |  ------------------
  |  |  315|   192k|    goto CLEANUP
  ------------------
  941|   385k|                    SQR(&accum2, &accum[acc_index]);
  ------------------
  |  |  808|   192k|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  314|   192k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   192k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 192k]
  |  |  |  |  ------------------
  |  |  |  |  315|   192k|    goto CLEANUP
  |  |  ------------------
  |  |  809|   192k|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  314|   192k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   192k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 192k]
  |  |  |  |  ------------------
  |  |  |  |  315|   192k|    goto CLEANUP
  |  |  ------------------
  ------------------
  942|   385k|                } else {
  943|   385k|                    SQR(&accum[half_power_index], &accum[acc_index]);
  ------------------
  |  |  808|   385k|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  314|   385k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   385k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 385k]
  |  |  |  |  ------------------
  |  |  |  |  315|   385k|    goto CLEANUP
  |  |  ------------------
  |  |  809|   385k|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  314|   385k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   385k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 385k]
  |  |  |  |  ------------------
  |  |  |  |  315|   385k|    goto CLEANUP
  |  |  ------------------
  ------------------
  944|   385k|                }
  945|   578k|            }
  946|  1.26M|        }
  947|  2.53M|    }
  948|       |/* if the accum1 isn't set, Then there is something wrong with our logic
  949|       |   * above and is an internal programming error.
  950|       |   */
  951|   229k|#if MP_ARGCHK == 2
  952|   229k|    assert(MP_USED(&accum1) != 0);
  953|   229k|#endif
  954|       |
  955|       |    /* set accumulator to montgomery residue of 1 */
  956|   229k|    pa1 = &accum1;
  957|   229k|    pa2 = &accum2;
  958|       |
  959|       |    /* tmp is not used if window_bits == 1. */
  960|   229k|    if (window_bits != 1) {
  ------------------
  |  Branch (960:9): [True: 192k, False: 36.9k]
  ------------------
  961|   192k|        MP_CHECKOK(mp_init_size(&tmp, 3 * nLen + 2));
  ------------------
  |  |  314|   192k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   192k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 192k]
  |  |  ------------------
  |  |  315|   192k|    goto CLEANUP
  ------------------
  962|   192k|    }
  963|       |
  964|  5.64M|    for (expOff = bits_in_exponent - window_bits * 2; expOff >= 0; expOff -= window_bits) {
  ------------------
  |  Branch (964:55): [True: 5.41M, False: 229k]
  ------------------
  965|  5.41M|        mp_size smallExp;
  966|  5.41M|        MP_CHECKOK(mpl_get_bits(exponent, expOff, window_bits));
  ------------------
  |  |  314|  5.41M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.41M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 5.41M]
  |  |  ------------------
  |  |  315|  5.41M|    goto CLEANUP
  ------------------
  967|  5.41M|        smallExp = (mp_size)res;
  968|       |
  969|       |        /* handle unroll the loops */
  970|  5.41M|        switch (window_bits) {
  971|   427k|            case 1:
  ------------------
  |  Branch (971:13): [True: 427k, False: 4.98M]
  ------------------
  972|   427k|                if (!smallExp) {
  ------------------
  |  Branch (972:21): [True: 183k, False: 244k]
  ------------------
  973|   183k|                    SQR(pa1, pa2);
  ------------------
  |  |  808|   183k|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  314|   183k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   183k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 183k]
  |  |  |  |  ------------------
  |  |  |  |  315|   183k|    goto CLEANUP
  |  |  ------------------
  |  |  809|   183k|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  314|   183k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   183k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 183k]
  |  |  |  |  ------------------
  |  |  |  |  315|   183k|    goto CLEANUP
  |  |  ------------------
  ------------------
  974|   183k|                    SWAPPA;
  ------------------
  |  |  825|   183k|    ptmp = pa1; \
  |  |  826|   183k|    pa1 = pa2;  \
  |  |  827|   183k|    pa2 = ptmp
  ------------------
  975|   244k|                } else if (smallExp & 1) {
  ------------------
  |  Branch (975:28): [True: 244k, False: 0]
  ------------------
  976|   244k|                    SQR(pa1, pa2);
  ------------------
  |  |  808|   244k|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  314|   244k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   244k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 244k]
  |  |  |  |  ------------------
  |  |  |  |  315|   244k|    goto CLEANUP
  |  |  ------------------
  |  |  809|   244k|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  314|   244k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   244k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 244k]
  |  |  |  |  ------------------
  |  |  |  |  315|   244k|    goto CLEANUP
  |  |  ------------------
  ------------------
  977|   244k|                    MUL_NOWEAVE(montBase, pa2, pa1);
  ------------------
  |  |  817|   244k|    MP_CHECKOK(s_mp_mul_mont(a, x, b, mmm))
  |  |  ------------------
  |  |  |  |  314|   244k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   244k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 244k]
  |  |  |  |  ------------------
  |  |  |  |  315|   244k|    goto CLEANUP
  |  |  ------------------
  ------------------
  978|   244k|                } else {
  979|      0|                    abort();
  980|      0|                }
  981|   427k|                break;
  982|   427k|            case 6:
  ------------------
  |  Branch (982:13): [True: 0, False: 5.41M]
  ------------------
  983|      0|                SQR(pa1, pa2);
  ------------------
  |  |  808|      0|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  314|      0|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  315|      0|    goto CLEANUP
  |  |  ------------------
  |  |  809|      0|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  314|      0|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  315|      0|    goto CLEANUP
  |  |  ------------------
  ------------------
  984|      0|                SQR(pa2, pa1);
  ------------------
  |  |  808|      0|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  314|      0|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  315|      0|    goto CLEANUP
  |  |  ------------------
  |  |  809|      0|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  314|      0|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  315|      0|    goto CLEANUP
  |  |  ------------------
  ------------------
  985|       |            /* fall through */
  986|  3.90M|            case 4:
  ------------------
  |  Branch (986:13): [True: 3.90M, False: 1.51M]
  ------------------
  987|  3.90M|                SQR(pa1, pa2);
  ------------------
  |  |  808|  3.90M|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  314|  3.90M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  3.90M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 3.90M]
  |  |  |  |  ------------------
  |  |  |  |  315|  3.90M|    goto CLEANUP
  |  |  ------------------
  |  |  809|  3.90M|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  314|  3.90M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  3.90M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 3.90M]
  |  |  |  |  ------------------
  |  |  |  |  315|  3.90M|    goto CLEANUP
  |  |  ------------------
  ------------------
  988|  7.80M|                SQR(pa2, pa1);
  ------------------
  |  |  808|  3.90M|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  314|  3.90M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  3.90M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 3.90M]
  |  |  |  |  ------------------
  |  |  |  |  315|  3.90M|    goto CLEANUP
  |  |  ------------------
  |  |  809|  3.90M|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  314|  3.90M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  3.90M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 3.90M]
  |  |  |  |  ------------------
  |  |  |  |  315|  3.90M|    goto CLEANUP
  |  |  ------------------
  ------------------
  989|  7.80M|                SQR(pa1, pa2);
  ------------------
  |  |  808|  3.90M|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  314|  3.90M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  3.90M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 3.90M]
  |  |  |  |  ------------------
  |  |  |  |  315|  3.90M|    goto CLEANUP
  |  |  ------------------
  |  |  809|  3.90M|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  314|  3.90M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  3.90M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 3.90M]
  |  |  |  |  ------------------
  |  |  |  |  315|  3.90M|    goto CLEANUP
  |  |  ------------------
  ------------------
  990|  7.80M|                SQR(pa2, pa1);
  ------------------
  |  |  808|  3.90M|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  314|  3.90M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  3.90M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 3.90M]
  |  |  |  |  ------------------
  |  |  |  |  315|  3.90M|    goto CLEANUP
  |  |  ------------------
  |  |  809|  3.90M|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  314|  3.90M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  3.90M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 3.90M]
  |  |  |  |  ------------------
  |  |  |  |  315|  3.90M|    goto CLEANUP
  |  |  ------------------
  ------------------
  991|  7.80M|                MUL(smallExp, pa1, pa2);
  ------------------
  |  |  821|  3.90M|    MP_CHECKOK(weave_to_mpi(&tmp, powers, (x), nLen, num_powers)); \
  |  |  ------------------
  |  |  |  |  314|  3.90M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  3.90M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 3.90M]
  |  |  |  |  ------------------
  |  |  |  |  315|  3.90M|    goto CLEANUP
  |  |  ------------------
  |  |  822|  3.90M|    MUL_NOWEAVE(&tmp, a, b)
  |  |  ------------------
  |  |  |  |  817|  3.90M|    MP_CHECKOK(s_mp_mul_mont(a, x, b, mmm))
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|  3.90M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|  3.90M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (314:9): [True: 0, False: 3.90M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  315|  3.90M|    goto CLEANUP
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  992|  3.90M|                SWAPPA;
  ------------------
  |  |  825|  3.90M|    ptmp = pa1; \
  |  |  826|  3.90M|    pa1 = pa2;  \
  |  |  827|  3.90M|    pa2 = ptmp
  ------------------
  993|  3.90M|                break;
  994|  1.08M|            case 5:
  ------------------
  |  Branch (994:13): [True: 1.08M, False: 4.32M]
  ------------------
  995|  1.08M|                SQR(pa1, pa2);
  ------------------
  |  |  808|  1.08M|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  314|  1.08M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  1.08M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 1.08M]
  |  |  |  |  ------------------
  |  |  |  |  315|  1.08M|    goto CLEANUP
  |  |  ------------------
  |  |  809|  1.08M|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  314|  1.08M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  1.08M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 1.08M]
  |  |  |  |  ------------------
  |  |  |  |  315|  1.08M|    goto CLEANUP
  |  |  ------------------
  ------------------
  996|  2.16M|                SQR(pa2, pa1);
  ------------------
  |  |  808|  1.08M|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  314|  1.08M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  1.08M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 1.08M]
  |  |  |  |  ------------------
  |  |  |  |  315|  1.08M|    goto CLEANUP
  |  |  ------------------
  |  |  809|  1.08M|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  314|  1.08M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  1.08M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 1.08M]
  |  |  |  |  ------------------
  |  |  |  |  315|  1.08M|    goto CLEANUP
  |  |  ------------------
  ------------------
  997|  2.16M|                SQR(pa1, pa2);
  ------------------
  |  |  808|  1.08M|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  314|  1.08M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  1.08M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 1.08M]
  |  |  |  |  ------------------
  |  |  |  |  315|  1.08M|    goto CLEANUP
  |  |  ------------------
  |  |  809|  1.08M|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  314|  1.08M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  1.08M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 1.08M]
  |  |  |  |  ------------------
  |  |  |  |  315|  1.08M|    goto CLEANUP
  |  |  ------------------
  ------------------
  998|  2.16M|                SQR(pa2, pa1);
  ------------------
  |  |  808|  1.08M|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  314|  1.08M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  1.08M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 1.08M]
  |  |  |  |  ------------------
  |  |  |  |  315|  1.08M|    goto CLEANUP
  |  |  ------------------
  |  |  809|  1.08M|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  314|  1.08M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  1.08M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 1.08M]
  |  |  |  |  ------------------
  |  |  |  |  315|  1.08M|    goto CLEANUP
  |  |  ------------------
  ------------------
  999|  2.16M|                SQR(pa1, pa2);
  ------------------
  |  |  808|  1.08M|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  314|  1.08M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  1.08M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 1.08M]
  |  |  |  |  ------------------
  |  |  |  |  315|  1.08M|    goto CLEANUP
  |  |  ------------------
  |  |  809|  1.08M|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  314|  1.08M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  1.08M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 1.08M]
  |  |  |  |  ------------------
  |  |  |  |  315|  1.08M|    goto CLEANUP
  |  |  ------------------
  ------------------
 1000|  2.16M|                MUL(smallExp, pa2, pa1);
  ------------------
  |  |  821|  1.08M|    MP_CHECKOK(weave_to_mpi(&tmp, powers, (x), nLen, num_powers)); \
  |  |  ------------------
  |  |  |  |  314|  1.08M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  1.08M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (314:9): [True: 0, False: 1.08M]
  |  |  |  |  ------------------
  |  |  |  |  315|  1.08M|    goto CLEANUP
  |  |  ------------------
  |  |  822|  1.08M|    MUL_NOWEAVE(&tmp, a, b)
  |  |  ------------------
  |  |  |  |  817|  1.08M|    MP_CHECKOK(s_mp_mul_mont(a, x, b, mmm))
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|  1.08M|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|  1.08M|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (314:9): [True: 0, False: 1.08M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  315|  1.08M|    goto CLEANUP
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1001|  1.08M|                break;
 1002|  1.08M|            default:
  ------------------
  |  Branch (1002:13): [True: 0, False: 5.41M]
  ------------------
 1003|      0|                abort(); /* could do a loop? */
 1004|  5.41M|        }
 1005|  5.41M|    }
 1006|       |
 1007|   229k|    res = s_mp_redc(pa1, mmm);
 1008|   229k|    mp_exch(pa1, result);
 1009|       |
 1010|   229k|CLEANUP:
 1011|   229k|    mp_clear(&accum1);
 1012|   229k|    mp_clear(&accum2);
 1013|   229k|    mp_clear(&accum[0]);
 1014|   229k|    mp_clear(&accum[1]);
 1015|   229k|    mp_clear(&accum[2]);
 1016|   229k|    mp_clear(&accum[3]);
 1017|   229k|    mp_clear(&tmp);
 1018|       |    /* zero required by FIPS here, can't use PORT_ZFree
 1019|       |     * because mpi doesn't link with util */
 1020|   229k|    if (powers) {
  ------------------
  |  Branch (1020:9): [True: 192k, False: 36.9k]
  ------------------
 1021|   192k|        PORT_Memset(powers, 0, num_powers * sizeof(mp_digit));
  ------------------
  |  |  183|   192k|#define PORT_Memset memset
  ------------------
 1022|   192k|    }
 1023|   229k|    free(powersArray);
 1024|   229k|    return res;
 1025|   229k|}
mp_exptmod:
 1033|   229k|{
 1034|   229k|    const mp_int *base;
 1035|   229k|    mp_size bits_in_exponent, i, window_bits, odd_ints;
 1036|   229k|    mp_err res;
 1037|   229k|    int nLen;
 1038|   229k|    mp_int montBase, goodBase;
 1039|   229k|    mp_mont_modulus mmm;
 1040|   229k|#ifdef MP_USING_CACHE_SAFE_MOD_EXP
 1041|   229k|    static unsigned int max_window_bits;
 1042|   229k|#endif
 1043|       |
 1044|       |    /* function for computing n0prime only works if n0 is odd */
 1045|   229k|    if (!mp_isodd(modulus))
  ------------------
  |  Branch (1045:9): [True: 0, False: 229k]
  ------------------
 1046|      0|        return s_mp_exptmod(inBase, exponent, modulus, result);
 1047|       |
 1048|   229k|    if (mp_cmp_z(inBase) == MP_LT)
  ------------------
  |  |   95|   229k|#define MP_LT -1
  ------------------
  |  Branch (1048:9): [True: 0, False: 229k]
  ------------------
 1049|      0|        return MP_RANGE;
  ------------------
  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  ------------------
 1050|   229k|    MP_DIGITS(&montBase) = 0;
  ------------------
  |  |  147|   229k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 1051|   229k|    MP_DIGITS(&goodBase) = 0;
  ------------------
  |  |  147|   229k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 1052|       |
 1053|   229k|    if (mp_cmp(inBase, modulus) < 0) {
  ------------------
  |  Branch (1053:9): [True: 229k, False: 0]
  ------------------
 1054|   229k|        base = inBase;
 1055|   229k|    } else {
 1056|      0|        MP_CHECKOK(mp_init(&goodBase));
  ------------------
  |  |  314|      0|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  315|      0|    goto CLEANUP
  ------------------
 1057|      0|        base = &goodBase;
 1058|      0|        MP_CHECKOK(mp_mod(inBase, modulus, &goodBase));
  ------------------
  |  |  314|      0|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  315|      0|    goto CLEANUP
  ------------------
 1059|      0|    }
 1060|       |
 1061|   229k|    nLen = MP_USED(modulus);
  ------------------
  |  |  145|   229k|#define MP_USED(MP) ((MP)->used)
  ------------------
 1062|   229k|    MP_CHECKOK(mp_init_size(&montBase, 2 * nLen + 2));
  ------------------
  |  |  314|   229k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   229k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 229k]
  |  |  ------------------
  |  |  315|   229k|    goto CLEANUP
  ------------------
 1063|       |
 1064|   229k|    mmm.N = *modulus; /* a copy of the mp_int struct */
 1065|       |
 1066|       |    /* compute n0', given n0, n0' = -(n0 ** -1) mod MP_RADIX
 1067|       |    **        where n0 = least significant mp_digit of N, the modulus.
 1068|       |    */
 1069|   229k|    mmm.n0prime = mp_calculate_mont_n0i(modulus);
 1070|       |
 1071|   229k|    MP_CHECKOK(mp_to_mont(base, modulus, &montBase));
  ------------------
  |  |  314|   229k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   229k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 229k]
  |  |  ------------------
  |  |  315|   229k|    goto CLEANUP
  ------------------
 1072|       |
 1073|   229k|    bits_in_exponent = mpl_significant_bits(exponent);
 1074|   229k|#ifdef MP_USING_CACHE_SAFE_MOD_EXP
 1075|   229k|    if (mp_using_cache_safe_exp) {
  ------------------
  |  Branch (1075:9): [True: 229k, False: 0]
  ------------------
 1076|   229k|        if (bits_in_exponent > 780)
  ------------------
  |  Branch (1076:13): [True: 0, False: 229k]
  ------------------
 1077|      0|            window_bits = 6;
 1078|   229k|        else if (bits_in_exponent > 256)
  ------------------
  |  Branch (1078:18): [True: 13.7k, False: 216k]
  ------------------
 1079|  13.7k|            window_bits = 5;
 1080|   216k|        else if (bits_in_exponent > 20)
  ------------------
  |  Branch (1080:18): [True: 179k, False: 36.9k]
  ------------------
 1081|   179k|            window_bits = 4;
 1082|       |        /* RSA public key exponents are typically under 20 bits (common values
 1083|       |         * are: 3, 17, 65537) and a 4-bit window is inefficient
 1084|       |         */
 1085|  36.9k|        else
 1086|  36.9k|            window_bits = 1;
 1087|   229k|    } else
 1088|      0|#endif
 1089|      0|        if (bits_in_exponent > 480)
  ------------------
  |  Branch (1089:13): [True: 0, False: 0]
  ------------------
 1090|      0|        window_bits = 6;
 1091|      0|    else if (bits_in_exponent > 160)
  ------------------
  |  Branch (1091:14): [True: 0, False: 0]
  ------------------
 1092|      0|        window_bits = 5;
 1093|      0|    else if (bits_in_exponent > 20)
  ------------------
  |  Branch (1093:14): [True: 0, False: 0]
  ------------------
 1094|      0|        window_bits = 4;
 1095|       |    /* RSA public key exponents are typically under 20 bits (common values
 1096|       |     * are: 3, 17, 65537) and a 4-bit window is inefficient
 1097|       |     */
 1098|      0|    else
 1099|      0|        window_bits = 1;
 1100|       |
 1101|   229k|#ifdef MP_USING_CACHE_SAFE_MOD_EXP
 1102|       |    /*
 1103|       |     * clamp the window size based on
 1104|       |     * the cache line size.
 1105|       |     */
 1106|   229k|    if (!max_window_bits) {
  ------------------
  |  Branch (1106:9): [True: 1, False: 229k]
  ------------------
 1107|      1|        unsigned long cache_size = s_mpi_getProcessorLineSize();
 1108|       |        /* processor has no cache, use 'fast' code always */
 1109|      1|        if (cache_size == 0) {
  ------------------
  |  Branch (1109:13): [True: 0, False: 1]
  ------------------
 1110|      0|            mp_using_cache_safe_exp = 0;
 1111|      0|        }
 1112|      1|        if ((cache_size == 0) || (cache_size >= 64)) {
  ------------------
  |  Branch (1112:13): [True: 0, False: 1]
  |  Branch (1112:34): [True: 0, False: 1]
  ------------------
 1113|      0|            max_window_bits = 6;
 1114|      1|        } else if (cache_size >= 32) {
  ------------------
  |  Branch (1114:20): [True: 1, False: 0]
  ------------------
 1115|      1|            max_window_bits = 5;
 1116|      1|        } else if (cache_size >= 16) {
  ------------------
  |  Branch (1116:20): [True: 0, False: 0]
  ------------------
 1117|      0|            max_window_bits = 4;
 1118|      0|        } else
 1119|      0|            max_window_bits = 1; /* should this be an assert? */
 1120|      1|    }
 1121|       |
 1122|       |    /* clamp the window size down before we caclulate bits_in_exponent */
 1123|   229k|    if (mp_using_cache_safe_exp) {
  ------------------
  |  Branch (1123:9): [True: 229k, False: 0]
  ------------------
 1124|   229k|        if (window_bits > max_window_bits) {
  ------------------
  |  Branch (1124:13): [True: 0, False: 229k]
  ------------------
 1125|      0|            window_bits = max_window_bits;
 1126|      0|        }
 1127|   229k|    }
 1128|   229k|#endif
 1129|       |
 1130|   229k|    odd_ints = 1 << (window_bits - 1);
 1131|   229k|    i = bits_in_exponent % window_bits;
 1132|   229k|    if (i != 0) {
  ------------------
  |  Branch (1132:9): [True: 135k, False: 93.9k]
  ------------------
 1133|   135k|        bits_in_exponent += window_bits - i;
 1134|   135k|    }
 1135|       |
 1136|       |#ifdef MP_USING_MONT_MULF
 1137|       |    if (mp_using_mont_mulf) {
 1138|       |        MP_CHECKOK(s_mp_pad(&montBase, nLen));
 1139|       |        res = mp_exptmod_f(&montBase, exponent, modulus, result, &mmm, nLen,
 1140|       |                           bits_in_exponent, window_bits, odd_ints);
 1141|       |    } else
 1142|       |#endif
 1143|   229k|#ifdef MP_USING_CACHE_SAFE_MOD_EXP
 1144|   229k|        if (mp_using_cache_safe_exp) {
  ------------------
  |  Branch (1144:13): [True: 229k, False: 0]
  ------------------
 1145|   229k|        res = mp_exptmod_safe_i(&montBase, exponent, modulus, result, &mmm, nLen,
 1146|   229k|                                bits_in_exponent, window_bits, 1 << window_bits);
 1147|   229k|    } else
 1148|      0|#endif
 1149|      0|        res = mp_exptmod_i(&montBase, exponent, modulus, result, &mmm, nLen,
 1150|      0|                           bits_in_exponent, window_bits, odd_ints);
 1151|       |
 1152|   229k|CLEANUP:
 1153|   229k|    mp_clear(&montBase);
 1154|   229k|    mp_clear(&goodBase);
 1155|       |    /* Don't mp_clear mmm.N because it is merely a copy of modulus.
 1156|       |    ** Just zap it.
 1157|       |    */
 1158|   229k|    memset(&mmm, 0, sizeof mmm);
 1159|   229k|    return res;
 1160|   229k|}

mpp_random:
  110|   203k|{
  111|   203k|    mp_digit next = 0;
  112|   203k|    unsigned int ix, jx;
  113|       |
  114|   203k|    ARGCHK(a != NULL, MP_BADARG);
  ------------------
  |  |  350|   203k|#define ARGCHK(X, Y) assert(X)
  ------------------
  115|       |
  116|   619k|    for (ix = 0; ix < USED(a); ix++) {
  ------------------
  |  |  328|   619k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  145|   619k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (116:18): [True: 415k, False: 203k]
  ------------------
  117|  3.74M|        for (jx = 0; jx < sizeof(mp_digit); jx++) {
  ------------------
  |  Branch (117:22): [True: 3.32M, False: 415k]
  ------------------
  118|  3.32M|            next = (next << CHAR_BIT) | (RANDOM() & UCHAR_MAX);
  ------------------
  |  |   19|  3.32M|#define RANDOM() rand()
  ------------------
  119|  3.32M|        }
  120|   415k|        DIGIT(a, ix) = next;
  ------------------
  |  |  331|   415k|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  148|   415k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
  121|   415k|    }
  122|       |
  123|   203k|    return MP_OKAY;
  ------------------
  |  |   39|   203k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  124|       |
  125|   203k|} /* end mpp_random() */
mpp_fermat:
  212|  25.9k|{
  213|  25.9k|    mp_int base, test;
  214|  25.9k|    mp_err res;
  215|       |
  216|  25.9k|    if ((res = mp_init(&base)) != MP_OKAY)
  ------------------
  |  |   39|  25.9k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (216:9): [True: 0, False: 25.9k]
  ------------------
  217|      0|        return res;
  218|       |
  219|  25.9k|    mp_set(&base, w);
  220|       |
  221|  25.9k|    if ((res = mp_init(&test)) != MP_OKAY)
  ------------------
  |  |   39|  25.9k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (221:9): [True: 0, False: 25.9k]
  ------------------
  222|      0|        goto TEST;
  223|       |
  224|       |    /* Compute test = base^a (mod a) */
  225|  25.9k|    if ((res = mp_exptmod(&base, a, a, &test)) != MP_OKAY)
  ------------------
  |  |   39|  25.9k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (225:9): [True: 0, False: 25.9k]
  ------------------
  226|      0|        goto CLEANUP;
  227|       |
  228|  25.9k|    if (mp_cmp(&base, &test) == 0)
  ------------------
  |  Branch (228:9): [True: 5.07k, False: 20.8k]
  ------------------
  229|  5.07k|        res = MP_YES;
  ------------------
  |  |   40|  5.07k|#define MP_YES 0     /* yes (boolean result)  */
  ------------------
  230|  20.8k|    else
  231|  20.8k|        res = MP_NO;
  ------------------
  |  |   41|  20.8k|#define MP_NO -1     /* no (boolean result)   */
  ------------------
  232|       |
  233|  25.9k|CLEANUP:
  234|  25.9k|    mp_clear(&test);
  235|  25.9k|TEST:
  236|  25.9k|    mp_clear(&base);
  237|       |
  238|  25.9k|    return res;
  239|       |
  240|  25.9k|} /* end mpp_fermat() */
mpp_pprime_ext_random:
  282|  5.07k|{
  283|  5.07k|    mp_err res;
  284|  5.07k|    mp_int x, amo, m, z; /* "amo" = "a minus one" */
  285|  5.07k|    int iter;
  286|  5.07k|    unsigned int jx;
  287|  5.07k|    mp_size b;
  288|       |
  289|  5.07k|    ARGCHK(a != NULL, MP_BADARG);
  ------------------
  |  |  350|  5.07k|#define ARGCHK(X, Y) assert(X)
  ------------------
  290|       |
  291|  5.07k|    MP_DIGITS(&x) = 0;
  ------------------
  |  |  147|  5.07k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  292|  5.07k|    MP_DIGITS(&amo) = 0;
  ------------------
  |  |  147|  5.07k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  293|  5.07k|    MP_DIGITS(&m) = 0;
  ------------------
  |  |  147|  5.07k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  294|  5.07k|    MP_DIGITS(&z) = 0;
  ------------------
  |  |  147|  5.07k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  295|       |
  296|       |    /* Initialize temporaries... */
  297|  5.07k|    MP_CHECKOK(mp_init(&amo));
  ------------------
  |  |  314|  5.07k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.07k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 5.07k]
  |  |  ------------------
  |  |  315|  5.07k|    goto CLEANUP
  ------------------
  298|       |    /* Compute amo = a - 1 for what follows...    */
  299|  5.07k|    MP_CHECKOK(mp_sub_d(a, 1, &amo));
  ------------------
  |  |  314|  5.07k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.07k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 5.07k]
  |  |  ------------------
  |  |  315|  5.07k|    goto CLEANUP
  ------------------
  300|       |
  301|  5.07k|    b = mp_trailing_zeros(&amo);
  302|  5.07k|    if (!b) { /* a was even ? */
  ------------------
  |  Branch (302:9): [True: 0, False: 5.07k]
  ------------------
  303|      0|        res = MP_NO;
  ------------------
  |  |   41|      0|#define MP_NO -1     /* no (boolean result)   */
  ------------------
  304|      0|        goto CLEANUP;
  305|      0|    }
  306|       |
  307|  5.07k|    MP_CHECKOK(mp_init_size(&x, MP_USED(a)));
  ------------------
  |  |  314|  5.07k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.07k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 5.07k]
  |  |  ------------------
  |  |  315|  5.07k|    goto CLEANUP
  ------------------
  308|  5.07k|    MP_CHECKOK(mp_init(&z));
  ------------------
  |  |  314|  5.07k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.07k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 5.07k]
  |  |  ------------------
  |  |  315|  5.07k|    goto CLEANUP
  ------------------
  309|  5.07k|    MP_CHECKOK(mp_init(&m));
  ------------------
  |  |  314|  5.07k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.07k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 5.07k]
  |  |  ------------------
  |  |  315|  5.07k|    goto CLEANUP
  ------------------
  310|  5.07k|    MP_CHECKOK(mp_div_2d(&amo, b, &m, 0));
  ------------------
  |  |  314|  5.07k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.07k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 5.07k]
  |  |  ------------------
  |  |  315|  5.07k|    goto CLEANUP
  ------------------
  311|       |
  312|       |    /* Do the test nt times... */
  313|   208k|    for (iter = 0; iter < nt; iter++) {
  ------------------
  |  Branch (313:20): [True: 203k, False: 4.88k]
  ------------------
  314|       |
  315|       |        /* Choose a random value for 1 < x < a      */
  316|   203k|        MP_CHECKOK(s_mp_pad(&x, USED(a)));
  ------------------
  |  |  314|   203k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   203k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 203k]
  |  |  ------------------
  |  |  315|   203k|    goto CLEANUP
  ------------------
  317|   203k|        MP_CHECKOK((*random)(&x));
  ------------------
  |  |  314|   203k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   203k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 203k]
  |  |  ------------------
  |  |  315|   203k|    goto CLEANUP
  ------------------
  318|   203k|        MP_CHECKOK(mp_mod(&x, a, &x));
  ------------------
  |  |  314|   203k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   203k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 203k]
  |  |  ------------------
  |  |  315|   203k|    goto CLEANUP
  ------------------
  319|   203k|        if (mp_cmp_d(&x, 1) <= 0) {
  ------------------
  |  Branch (319:13): [True: 0, False: 203k]
  ------------------
  320|      0|            iter--;   /* don't count this iteration */
  321|      0|            continue; /* choose a new x */
  322|      0|        }
  323|       |
  324|       |        /* Compute z = (x ** m) mod a               */
  325|   203k|        MP_CHECKOK(mp_exptmod(&x, &m, a, &z));
  ------------------
  |  |  314|   203k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   203k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 203k]
  |  |  ------------------
  |  |  315|   203k|    goto CLEANUP
  ------------------
  326|       |
  327|   203k|        if (mp_cmp_d(&z, 1) == 0 || mp_cmp(&z, &amo) == 0) {
  ------------------
  |  Branch (327:13): [True: 51.1k, False: 152k]
  |  Branch (327:37): [True: 51.0k, False: 101k]
  ------------------
  328|   102k|            res = MP_YES;
  ------------------
  |  |   40|   102k|#define MP_YES 0     /* yes (boolean result)  */
  ------------------
  329|   102k|            continue;
  330|   102k|        }
  331|       |
  332|   101k|        res = MP_NO; /* just in case the following for loop never executes. */
  ------------------
  |  |   41|   101k|#define MP_NO -1     /* no (boolean result)   */
  ------------------
  333|  3.38M|        for (jx = 1; jx < b; jx++) {
  ------------------
  |  Branch (333:22): [True: 3.38M, False: 187]
  ------------------
  334|       |            /* z = z^2 (mod a) */
  335|  3.38M|            MP_CHECKOK(mp_sqrmod(&z, a, &z));
  ------------------
  |  |  314|  3.38M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  3.38M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 3.38M]
  |  |  ------------------
  |  |  315|  3.38M|    goto CLEANUP
  ------------------
  336|  3.38M|            res = MP_NO; /* previous line set res to MP_YES */
  ------------------
  |  |   41|  3.38M|#define MP_NO -1     /* no (boolean result)   */
  ------------------
  337|       |
  338|  3.38M|            if (mp_cmp_d(&z, 1) == 0) {
  ------------------
  |  Branch (338:17): [True: 1, False: 3.38M]
  ------------------
  339|      1|                break;
  340|      1|            }
  341|  3.38M|            if (mp_cmp(&z, &amo) == 0) {
  ------------------
  |  Branch (341:17): [True: 101k, False: 3.28M]
  ------------------
  342|   101k|                res = MP_YES;
  ------------------
  |  |   40|   101k|#define MP_YES 0     /* yes (boolean result)  */
  ------------------
  343|   101k|                break;
  344|   101k|            }
  345|  3.38M|        } /* end testing loop */
  346|       |
  347|       |        /* If the test passes, we will continue iterating, but a failed
  348|       |           test means the candidate is definitely NOT prime, so we will
  349|       |           immediately break out of this loop
  350|       |         */
  351|   101k|        if (res == MP_NO)
  ------------------
  |  |   41|   101k|#define MP_NO -1     /* no (boolean result)   */
  ------------------
  |  Branch (351:13): [True: 188, False: 101k]
  ------------------
  352|    188|            break;
  353|       |
  354|   101k|    } /* end iterations loop */
  355|       |
  356|  5.07k|CLEANUP:
  357|  5.07k|    mp_clear(&m);
  358|  5.07k|    mp_clear(&z);
  359|  5.07k|    mp_clear(&x);
  360|  5.07k|    mp_clear(&amo);
  361|  5.07k|    return res;
  362|       |
  363|  5.07k|} /* end mpp_pprime() */
mpp_sieve:
  380|  4.88k|{
  381|  4.88k|    mp_err res;
  382|  4.88k|    mp_digit rem;
  383|  4.88k|    mp_size ix;
  384|  4.88k|    unsigned long offset;
  385|       |
  386|  4.88k|    memset(sieve, 0, nSieve);
  387|       |
  388|  31.9M|    for (ix = 0; ix < nPrimes; ix++) {
  ------------------
  |  Branch (388:18): [True: 31.9M, False: 4.88k]
  ------------------
  389|  31.9M|        mp_digit prime = primes[ix];
  390|  31.9M|        mp_size i;
  391|  31.9M|        if ((res = mp_mod_d(trial, prime, &rem)) != MP_OKAY)
  ------------------
  |  |   39|  31.9M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (391:13): [True: 0, False: 31.9M]
  ------------------
  392|      0|            return res;
  393|       |
  394|  31.9M|        if (rem == 0) {
  ------------------
  |  Branch (394:13): [True: 11.4k, False: 31.9M]
  ------------------
  395|  11.4k|            offset = 0;
  396|  31.9M|        } else {
  397|  31.9M|            offset = prime - rem;
  398|  31.9M|        }
  399|       |
  400|   725M|        for (i = offset; i < nSieve * 2; i += prime) {
  ------------------
  |  Branch (400:26): [True: 693M, False: 31.9M]
  ------------------
  401|   693M|            if (i % 2 == 0) {
  ------------------
  |  Branch (401:17): [True: 346M, False: 346M]
  ------------------
  402|   346M|                sieve[i / 2] = 1;
  403|   346M|            }
  404|   693M|        }
  405|  31.9M|    }
  406|       |
  407|  4.88k|    return MP_OKAY;
  ------------------
  |  |   39|  4.88k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  408|  4.88k|}
mpp_make_prime:
  414|  4.88k|{
  415|  4.88k|    return mpp_make_prime_ext_random(start, nBits, strong, mpp_random_insecure);
  416|  4.88k|}
mpp_make_prime_ext_random:
  420|  4.88k|{
  421|  4.88k|    mp_digit np;
  422|  4.88k|    mp_err res;
  423|  4.88k|    unsigned int i = 0;
  424|  4.88k|    mp_int trial;
  425|  4.88k|    mp_int q;
  426|  4.88k|    mp_size num_tests;
  427|  4.88k|    unsigned char *sieve;
  428|       |
  429|  4.88k|    ARGCHK(start != 0, MP_BADARG);
  ------------------
  |  |  350|  4.88k|#define ARGCHK(X, Y) assert(X)
  ------------------
  430|  4.88k|    ARGCHK(nBits > 16, MP_RANGE);
  ------------------
  |  |  350|  4.88k|#define ARGCHK(X, Y) assert(X)
  ------------------
  431|       |
  432|  4.88k|    sieve = malloc(SIEVE_SIZE);
  ------------------
  |  |  410|  4.88k|#define SIEVE_SIZE 32 * 1024
  ------------------
  433|  4.88k|    ARGCHK(sieve != NULL, MP_MEM);
  ------------------
  |  |  350|  4.88k|#define ARGCHK(X, Y) assert(X)
  ------------------
  434|       |
  435|  4.88k|    MP_DIGITS(&trial) = 0;
  ------------------
  |  |  147|  4.88k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  436|  4.88k|    MP_DIGITS(&q) = 0;
  ------------------
  |  |  147|  4.88k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  437|  4.88k|    MP_CHECKOK(mp_init(&trial));
  ------------------
  |  |  314|  4.88k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  4.88k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 4.88k]
  |  |  ------------------
  |  |  315|  4.88k|    goto CLEANUP
  ------------------
  438|  4.88k|    MP_CHECKOK(mp_init(&q));
  ------------------
  |  |  314|  4.88k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  4.88k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 4.88k]
  |  |  ------------------
  |  |  315|  4.88k|    goto CLEANUP
  ------------------
  439|       |    /* values originally taken from table 4.4,
  440|       |   * HandBook of Applied Cryptography, augmented by FIPS-186
  441|       |   * requirements, Table C.2 and C.3 */
  442|  4.88k|    if (nBits >= 2000) {
  ------------------
  |  Branch (442:9): [True: 0, False: 4.88k]
  ------------------
  443|      0|        num_tests = 3;
  444|  4.88k|    } else if (nBits >= 1536) {
  ------------------
  |  Branch (444:16): [True: 0, False: 4.88k]
  ------------------
  445|      0|        num_tests = 4;
  446|  4.88k|    } else if (nBits >= 1024) {
  ------------------
  |  Branch (446:16): [True: 0, False: 4.88k]
  ------------------
  447|      0|        num_tests = 5;
  448|  4.88k|    } else if (nBits >= 550) {
  ------------------
  |  Branch (448:16): [True: 0, False: 4.88k]
  ------------------
  449|      0|        num_tests = 6;
  450|  4.88k|    } else if (nBits >= 450) {
  ------------------
  |  Branch (450:16): [True: 133, False: 4.75k]
  ------------------
  451|    133|        num_tests = 7;
  452|  4.75k|    } else if (nBits >= 400) {
  ------------------
  |  Branch (452:16): [True: 101, False: 4.65k]
  ------------------
  453|    101|        num_tests = 8;
  454|  4.65k|    } else if (nBits >= 350) {
  ------------------
  |  Branch (454:16): [True: 94, False: 4.55k]
  ------------------
  455|     94|        num_tests = 9;
  456|  4.55k|    } else if (nBits >= 300) {
  ------------------
  |  Branch (456:16): [True: 72, False: 4.48k]
  ------------------
  457|     72|        num_tests = 10;
  458|  4.48k|    } else if (nBits >= 250) {
  ------------------
  |  Branch (458:16): [True: 226, False: 4.25k]
  ------------------
  459|    226|        num_tests = 20;
  460|  4.25k|    } else if (nBits >= 200) {
  ------------------
  |  Branch (460:16): [True: 653, False: 3.60k]
  ------------------
  461|    653|        num_tests = 41;
  462|  3.60k|    } else if (nBits >= 100) {
  ------------------
  |  Branch (462:16): [True: 930, False: 2.67k]
  ------------------
  463|    930|        num_tests = 38; /* funny anomaly in the FIPS tables, for aux primes, the
  464|       |                         * required more iterations for larger aux primes */
  465|    930|    } else
  466|  2.67k|        num_tests = 50;
  467|       |
  468|  4.88k|    if (strong)
  ------------------
  |  Branch (468:9): [True: 0, False: 4.88k]
  ------------------
  469|      0|        --nBits;
  470|  4.88k|    MP_CHECKOK(mpl_set_bit(start, nBits - 1, 1));
  ------------------
  |  |  314|  4.88k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  4.88k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 4.88k]
  |  |  ------------------
  |  |  315|  4.88k|    goto CLEANUP
  ------------------
  471|  4.88k|    MP_CHECKOK(mpl_set_bit(start, 0, 1));
  ------------------
  |  |  314|  4.88k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  4.88k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 4.88k]
  |  |  ------------------
  |  |  315|  4.88k|    goto CLEANUP
  ------------------
  472|  4.88k|    for (i = mpl_significant_bits(start) - 1; i >= nBits; --i) {
  ------------------
  |  Branch (472:47): [True: 0, False: 4.88k]
  ------------------
  473|      0|        MP_CHECKOK(mpl_set_bit(start, i, 0));
  ------------------
  |  |  314|      0|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  315|      0|    goto CLEANUP
  ------------------
  474|      0|    }
  475|       |    /* start sieveing with prime value of 3. */
  476|  4.88k|    MP_CHECKOK(mpp_sieve(start, prime_tab + 1, prime_tab_size - 1,
  ------------------
  |  |  314|  4.88k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  4.88k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 4.88k]
  |  |  ------------------
  |  |  315|  4.88k|    goto CLEANUP
  ------------------
  477|  4.88k|                         sieve, SIEVE_SIZE));
  478|       |
  479|       |#ifdef DEBUG_SIEVE
  480|       |    res = 0;
  481|       |    for (i = 0; i < SIEVE_SIZE; ++i) {
  482|       |        if (!sieve[i])
  483|       |            ++res;
  484|       |    }
  485|       |    fprintf(stderr, "sieve found %d potential primes.\n", res);
  486|       |#define FPUTC(x, y) fputc(x, y)
  487|       |#else
  488|  4.88k|#define FPUTC(x, y)
  489|  4.88k|#endif
  490|       |
  491|  4.88k|    res = MP_NO;
  ------------------
  |  |   41|  4.88k|#define MP_NO -1     /* no (boolean result)   */
  ------------------
  492|   236k|    for (i = 0; i < SIEVE_SIZE; ++i) {
  ------------------
  |  |  410|   236k|#define SIEVE_SIZE 32 * 1024
  ------------------
  |  Branch (492:17): [True: 236k, False: 0]
  ------------------
  493|   236k|        if (sieve[i]) /* this number is composite */
  ------------------
  |  Branch (493:13): [True: 210k, False: 25.9k]
  ------------------
  494|   210k|            continue;
  495|  25.9k|        MP_CHECKOK(mp_add_d(start, 2 * i, &trial));
  ------------------
  |  |  314|  25.9k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  25.9k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 25.9k]
  |  |  ------------------
  |  |  315|  25.9k|    goto CLEANUP
  ------------------
  496|  25.9k|        FPUTC('.', stderr);
  497|       |        /* run a Fermat test */
  498|  25.9k|        res = mpp_fermat(&trial, 2);
  499|  25.9k|        if (res != MP_OKAY) {
  ------------------
  |  |   39|  25.9k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (499:13): [True: 20.8k, False: 5.07k]
  ------------------
  500|  20.8k|            if (res == MP_NO)
  ------------------
  |  |   41|  20.8k|#define MP_NO -1     /* no (boolean result)   */
  ------------------
  |  Branch (500:17): [True: 20.8k, False: 0]
  ------------------
  501|  20.8k|                continue; /* was composite */
  502|      0|            goto CLEANUP;
  503|  20.8k|        }
  504|       |
  505|  5.07k|        FPUTC('+', stderr);
  506|       |        /* If that passed, run some Miller-Rabin tests  */
  507|  5.07k|        res = mpp_pprime_ext_random(&trial, num_tests, random);
  508|  5.07k|        if (res != MP_OKAY) {
  ------------------
  |  |   39|  5.07k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (508:13): [True: 188, False: 4.88k]
  ------------------
  509|    188|            if (res == MP_NO)
  ------------------
  |  |   41|    188|#define MP_NO -1     /* no (boolean result)   */
  ------------------
  |  Branch (509:17): [True: 188, False: 0]
  ------------------
  510|    188|                continue; /* was composite */
  511|      0|            goto CLEANUP;
  512|    188|        }
  513|  4.88k|        FPUTC('!', stderr);
  514|       |
  515|  4.88k|        if (!strong)
  ------------------
  |  Branch (515:13): [True: 4.88k, False: 0]
  ------------------
  516|  4.88k|            break; /* success !! */
  517|       |
  518|       |        /* At this point, we have strong evidence that our candidate
  519|       |           is itself prime.  If we want a strong prime, we need now
  520|       |           to test q = 2p + 1 for primality...
  521|       |        */
  522|      0|        MP_CHECKOK(mp_mul_2(&trial, &q));
  ------------------
  |  |  314|      0|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  315|      0|    goto CLEANUP
  ------------------
  523|      0|        MP_CHECKOK(mp_add_d(&q, 1, &q));
  ------------------
  |  |  314|      0|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (314:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  315|      0|    goto CLEANUP
  ------------------
  524|       |
  525|       |        /* Test q for small prime divisors ... */
  526|      0|        np = prime_tab_size;
  527|      0|        res = mpp_divis_primes(&q, &np);
  528|      0|        if (res == MP_YES) { /* is composite */
  ------------------
  |  |   40|      0|#define MP_YES 0     /* yes (boolean result)  */
  ------------------
  |  Branch (528:13): [True: 0, False: 0]
  ------------------
  529|      0|            mp_clear(&q);
  530|      0|            continue;
  531|      0|        }
  532|      0|        if (res != MP_NO)
  ------------------
  |  |   41|      0|#define MP_NO -1     /* no (boolean result)   */
  ------------------
  |  Branch (532:13): [True: 0, False: 0]
  ------------------
  533|      0|            goto CLEANUP;
  534|       |
  535|       |        /* And test with Fermat, as with its parent ... */
  536|      0|        res = mpp_fermat(&q, 2);
  537|      0|        if (res != MP_YES) {
  ------------------
  |  |   40|      0|#define MP_YES 0     /* yes (boolean result)  */
  ------------------
  |  Branch (537:13): [True: 0, False: 0]
  ------------------
  538|      0|            mp_clear(&q);
  539|      0|            if (res == MP_NO)
  ------------------
  |  |   41|      0|#define MP_NO -1     /* no (boolean result)   */
  ------------------
  |  Branch (539:17): [True: 0, False: 0]
  ------------------
  540|      0|                continue; /* was composite */
  541|      0|            goto CLEANUP;
  542|      0|        }
  543|       |
  544|       |        /* And test with Miller-Rabin, as with its parent ... */
  545|      0|        res = mpp_pprime_ext_random(&q, num_tests, random);
  546|      0|        if (res != MP_YES) {
  ------------------
  |  |   40|      0|#define MP_YES 0     /* yes (boolean result)  */
  ------------------
  |  Branch (546:13): [True: 0, False: 0]
  ------------------
  547|      0|            mp_clear(&q);
  548|      0|            if (res == MP_NO)
  ------------------
  |  |   41|      0|#define MP_NO -1     /* no (boolean result)   */
  ------------------
  |  Branch (548:17): [True: 0, False: 0]
  ------------------
  549|      0|                continue; /* was composite */
  550|      0|            goto CLEANUP;
  551|      0|        }
  552|       |
  553|       |        /* If it passed, we've got a winner */
  554|      0|        mp_exch(&q, &trial);
  555|      0|        mp_clear(&q);
  556|      0|        break;
  557|       |
  558|      0|    } /* end of loop through sieved values */
  559|  4.88k|    if (res == MP_YES)
  ------------------
  |  |   40|  4.88k|#define MP_YES 0     /* yes (boolean result)  */
  ------------------
  |  Branch (559:9): [True: 4.88k, False: 0]
  ------------------
  560|  4.88k|        mp_exch(&trial, start);
  561|  4.88k|CLEANUP:
  562|  4.88k|    mp_clear(&trial);
  563|  4.88k|    mp_clear(&q);
  564|  4.88k|    if (sieve != NULL) {
  ------------------
  |  Branch (564:9): [True: 4.88k, False: 0]
  ------------------
  565|  4.88k|        memset(sieve, 0, SIEVE_SIZE);
  ------------------
  |  |  410|  4.88k|#define SIEVE_SIZE 32 * 1024
  ------------------
  566|  4.88k|        free(sieve);
  567|  4.88k|    }
  568|  4.88k|    return res;
  569|  4.88k|}

